@katerai/sdk 0.6.0 → 0.8.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 +34 -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/compiler.d.mts +1116 -0
  27. package/resources/v1/compiler.d.mts.map +1 -0
  28. package/resources/v1/compiler.d.ts +1116 -0
  29. package/resources/v1/compiler.d.ts.map +1 -0
  30. package/resources/v1/compiler.js +70 -0
  31. package/resources/v1/compiler.js.map +1 -0
  32. package/resources/v1/compiler.mjs +66 -0
  33. package/resources/v1/compiler.mjs.map +1 -0
  34. package/resources/v1/connections.d.mts +216 -1
  35. package/resources/v1/connections.d.mts.map +1 -1
  36. package/resources/v1/connections.d.ts +216 -1
  37. package/resources/v1/connections.d.ts.map +1 -1
  38. package/resources/v1/connections.js +22 -2
  39. package/resources/v1/connections.js.map +1 -1
  40. package/resources/v1/connections.mjs +20 -1
  41. package/resources/v1/connections.mjs.map +1 -1
  42. package/resources/v1/index.d.mts +3 -6
  43. package/resources/v1/index.d.mts.map +1 -1
  44. package/resources/v1/index.d.ts +3 -6
  45. package/resources/v1/index.d.ts.map +1 -1
  46. package/resources/v1/index.js +7 -13
  47. package/resources/v1/index.js.map +1 -1
  48. package/resources/v1/index.mjs +2 -5
  49. package/resources/v1/index.mjs.map +1 -1
  50. package/resources/v1/tenants/groups.d.mts +5 -5
  51. package/resources/v1/tenants/groups.d.mts.map +1 -1
  52. package/resources/v1/tenants/groups.d.ts +5 -5
  53. package/resources/v1/tenants/groups.d.ts.map +1 -1
  54. package/resources/v1/tenants/groups.js +1 -1
  55. package/resources/v1/tenants/groups.js.map +1 -1
  56. package/resources/v1/tenants/groups.mjs +1 -1
  57. package/resources/v1/tenants/groups.mjs.map +1 -1
  58. package/resources/v1/tenants/index.d.mts +2 -4
  59. package/resources/v1/tenants/index.d.mts.map +1 -1
  60. package/resources/v1/tenants/index.d.ts +2 -4
  61. package/resources/v1/tenants/index.d.ts.map +1 -1
  62. package/resources/v1/tenants/index.js +1 -5
  63. package/resources/v1/tenants/index.js.map +1 -1
  64. package/resources/v1/tenants/index.mjs +0 -2
  65. package/resources/v1/tenants/index.mjs.map +1 -1
  66. package/resources/v1/tenants/tenants.d.mts +72 -151
  67. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  68. package/resources/v1/tenants/tenants.d.ts +72 -151
  69. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  70. package/resources/v1/tenants/tenants.js +29 -72
  71. package/resources/v1/tenants/tenants.js.map +1 -1
  72. package/resources/v1/tenants/tenants.mjs +29 -72
  73. package/resources/v1/tenants/tenants.mjs.map +1 -1
  74. package/resources/v1/v1.d.mts +9 -21
  75. package/resources/v1/v1.d.mts.map +1 -1
  76. package/resources/v1/v1.d.ts +9 -21
  77. package/resources/v1/v1.d.ts.map +1 -1
  78. package/resources/v1/v1.js +6 -18
  79. package/resources/v1/v1.js.map +1 -1
  80. package/resources/v1/v1.mjs +6 -18
  81. package/resources/v1/v1.mjs.map +1 -1
  82. package/src/client.ts +48 -23
  83. package/src/internal/utils/log.ts +1 -0
  84. package/src/resources/index.ts +0 -2
  85. package/src/resources/v1/compiler.ts +1484 -0
  86. package/src/resources/v1/connections.ts +277 -1
  87. package/src/resources/v1/index.ts +23 -43
  88. package/src/resources/v1/tenants/groups.ts +5 -5
  89. package/src/resources/v1/tenants/index.ts +5 -24
  90. package/src/resources/v1/tenants/tenants.ts +89 -213
  91. package/src/resources/v1/v1.ts +49 -101
  92. package/src/version.ts +1 -1
  93. package/version.d.mts +1 -1
  94. package/version.d.ts +1 -1
  95. package/version.js +1 -1
  96. package/version.mjs +1 -1
  97. package/resources/healthz.d.mts +0 -16
  98. package/resources/healthz.d.mts.map +0 -1
  99. package/resources/healthz.d.ts +0 -16
  100. package/resources/healthz.d.ts.map +0 -1
  101. package/resources/healthz.js +0 -15
  102. package/resources/healthz.js.map +0 -1
  103. package/resources/healthz.mjs +0 -11
  104. package/resources/healthz.mjs.map +0 -1
  105. package/resources/readyz.d.mts +0 -16
  106. package/resources/readyz.d.mts.map +0 -1
  107. package/resources/readyz.d.ts +0 -16
  108. package/resources/readyz.d.ts.map +0 -1
  109. package/resources/readyz.js +0 -15
  110. package/resources/readyz.js.map +0 -1
  111. package/resources/readyz.mjs +0 -11
  112. package/resources/readyz.mjs.map +0 -1
  113. package/resources/v1/connections/connections.d.mts +0 -1470
  114. package/resources/v1/connections/connections.d.mts.map +0 -1
  115. package/resources/v1/connections/connections.d.ts +0 -1470
  116. package/resources/v1/connections/connections.d.ts.map +0 -1
  117. package/resources/v1/connections/connections.js +0 -163
  118. package/resources/v1/connections/connections.js.map +0 -1
  119. package/resources/v1/connections/connections.mjs +0 -158
  120. package/resources/v1/connections/connections.mjs.map +0 -1
  121. package/resources/v1/connections/databases.d.mts +0 -25
  122. package/resources/v1/connections/databases.d.mts.map +0 -1
  123. package/resources/v1/connections/databases.d.ts +0 -25
  124. package/resources/v1/connections/databases.d.ts.map +0 -1
  125. package/resources/v1/connections/databases.js +0 -26
  126. package/resources/v1/connections/databases.js.map +0 -1
  127. package/resources/v1/connections/databases.mjs +0 -22
  128. package/resources/v1/connections/databases.mjs.map +0 -1
  129. package/resources/v1/connections/index.d.mts +0 -5
  130. package/resources/v1/connections/index.d.mts.map +0 -1
  131. package/resources/v1/connections/index.d.ts +0 -5
  132. package/resources/v1/connections/index.d.ts.map +0 -1
  133. package/resources/v1/connections/index.js +0 -13
  134. package/resources/v1/connections/index.js.map +0 -1
  135. package/resources/v1/connections/index.mjs +0 -6
  136. package/resources/v1/connections/index.mjs.map +0 -1
  137. package/resources/v1/connections/views.d.mts +0 -77
  138. package/resources/v1/connections/views.d.mts.map +0 -1
  139. package/resources/v1/connections/views.d.ts +0 -77
  140. package/resources/v1/connections/views.d.ts.map +0 -1
  141. package/resources/v1/connections/views.js +0 -24
  142. package/resources/v1/connections/views.js.map +0 -1
  143. package/resources/v1/connections/views.mjs +0 -20
  144. package/resources/v1/connections/views.mjs.map +0 -1
  145. package/resources/v1/connections/yaml.d.mts +0 -57
  146. package/resources/v1/connections/yaml.d.mts.map +0 -1
  147. package/resources/v1/connections/yaml.d.ts +0 -57
  148. package/resources/v1/connections/yaml.d.ts.map +0 -1
  149. package/resources/v1/connections/yaml.js +0 -22
  150. package/resources/v1/connections/yaml.js.map +0 -1
  151. package/resources/v1/connections/yaml.mjs +0 -18
  152. package/resources/v1/connections/yaml.mjs.map +0 -1
  153. package/resources/v1/github/github.d.mts +0 -99
  154. package/resources/v1/github/github.d.mts.map +0 -1
  155. package/resources/v1/github/github.d.ts +0 -99
  156. package/resources/v1/github/github.d.ts.map +0 -1
  157. package/resources/v1/github/github.js +0 -49
  158. package/resources/v1/github/github.js.map +0 -1
  159. package/resources/v1/github/github.mjs +0 -44
  160. package/resources/v1/github/github.mjs.map +0 -1
  161. package/resources/v1/github/index.d.mts +0 -5
  162. package/resources/v1/github/index.d.mts.map +0 -1
  163. package/resources/v1/github/index.d.ts +0 -5
  164. package/resources/v1/github/index.d.ts.map +0 -1
  165. package/resources/v1/github/index.js +0 -13
  166. package/resources/v1/github/index.js.map +0 -1
  167. package/resources/v1/github/index.mjs +0 -6
  168. package/resources/v1/github/index.mjs.map +0 -1
  169. package/resources/v1/github/repos.d.mts +0 -54
  170. package/resources/v1/github/repos.d.mts.map +0 -1
  171. package/resources/v1/github/repos.d.ts +0 -54
  172. package/resources/v1/github/repos.d.ts.map +0 -1
  173. package/resources/v1/github/repos.js +0 -22
  174. package/resources/v1/github/repos.js.map +0 -1
  175. package/resources/v1/github/repos.mjs +0 -18
  176. package/resources/v1/github/repos.mjs.map +0 -1
  177. package/resources/v1/github/scaffold.d.mts +0 -29
  178. package/resources/v1/github/scaffold.d.mts.map +0 -1
  179. package/resources/v1/github/scaffold.d.ts +0 -29
  180. package/resources/v1/github/scaffold.d.ts.map +0 -1
  181. package/resources/v1/github/scaffold.js +0 -21
  182. package/resources/v1/github/scaffold.js.map +0 -1
  183. package/resources/v1/github/scaffold.mjs +0 -17
  184. package/resources/v1/github/scaffold.mjs.map +0 -1
  185. package/resources/v1/github/webhooks.d.mts +0 -28
  186. package/resources/v1/github/webhooks.d.mts.map +0 -1
  187. package/resources/v1/github/webhooks.d.ts +0 -28
  188. package/resources/v1/github/webhooks.d.ts.map +0 -1
  189. package/resources/v1/github/webhooks.js +0 -27
  190. package/resources/v1/github/webhooks.js.map +0 -1
  191. package/resources/v1/github/webhooks.mjs +0 -23
  192. package/resources/v1/github/webhooks.mjs.map +0 -1
  193. package/resources/v1/github.d.mts +0 -2
  194. package/resources/v1/github.d.mts.map +0 -1
  195. package/resources/v1/github.d.ts +0 -2
  196. package/resources/v1/github.d.ts.map +0 -1
  197. package/resources/v1/github.js +0 -6
  198. package/resources/v1/github.js.map +0 -1
  199. package/resources/v1/github.mjs +0 -3
  200. package/resources/v1/github.mjs.map +0 -1
  201. package/resources/v1/groups/groups.d.mts +0 -162
  202. package/resources/v1/groups/groups.d.mts.map +0 -1
  203. package/resources/v1/groups/groups.d.ts +0 -162
  204. package/resources/v1/groups/groups.d.ts.map +0 -1
  205. package/resources/v1/groups/groups.js +0 -81
  206. package/resources/v1/groups/groups.js.map +0 -1
  207. package/resources/v1/groups/groups.mjs +0 -76
  208. package/resources/v1/groups/groups.mjs.map +0 -1
  209. package/resources/v1/groups/index.d.mts +0 -3
  210. package/resources/v1/groups/index.d.mts.map +0 -1
  211. package/resources/v1/groups/index.d.ts +0 -3
  212. package/resources/v1/groups/index.d.ts.map +0 -1
  213. package/resources/v1/groups/index.js +0 -9
  214. package/resources/v1/groups/index.js.map +0 -1
  215. package/resources/v1/groups/index.mjs +0 -4
  216. package/resources/v1/groups/index.mjs.map +0 -1
  217. package/resources/v1/groups/tenants.d.mts +0 -55
  218. package/resources/v1/groups/tenants.d.mts.map +0 -1
  219. package/resources/v1/groups/tenants.d.ts +0 -55
  220. package/resources/v1/groups/tenants.d.ts.map +0 -1
  221. package/resources/v1/groups/tenants.js +0 -39
  222. package/resources/v1/groups/tenants.js.map +0 -1
  223. package/resources/v1/groups/tenants.mjs +0 -35
  224. package/resources/v1/groups/tenants.mjs.map +0 -1
  225. package/resources/v1/groups.d.mts +0 -2
  226. package/resources/v1/groups.d.mts.map +0 -1
  227. package/resources/v1/groups.d.ts +0 -2
  228. package/resources/v1/groups.d.ts.map +0 -1
  229. package/resources/v1/groups.js +0 -6
  230. package/resources/v1/groups.js.map +0 -1
  231. package/resources/v1/groups.mjs +0 -3
  232. package/resources/v1/groups.mjs.map +0 -1
  233. package/resources/v1/me.d.mts +0 -43
  234. package/resources/v1/me.d.mts.map +0 -1
  235. package/resources/v1/me.d.ts +0 -43
  236. package/resources/v1/me.d.ts.map +0 -1
  237. package/resources/v1/me.js +0 -20
  238. package/resources/v1/me.js.map +0 -1
  239. package/resources/v1/me.mjs +0 -16
  240. package/resources/v1/me.mjs.map +0 -1
  241. package/resources/v1/org/client.d.mts +0 -53
  242. package/resources/v1/org/client.d.mts.map +0 -1
  243. package/resources/v1/org/client.d.ts +0 -53
  244. package/resources/v1/org/client.d.ts.map +0 -1
  245. package/resources/v1/org/client.js +0 -25
  246. package/resources/v1/org/client.js.map +0 -1
  247. package/resources/v1/org/client.mjs +0 -21
  248. package/resources/v1/org/client.mjs.map +0 -1
  249. package/resources/v1/org/index.d.mts +0 -4
  250. package/resources/v1/org/index.d.mts.map +0 -1
  251. package/resources/v1/org/index.d.ts +0 -4
  252. package/resources/v1/org/index.d.ts.map +0 -1
  253. package/resources/v1/org/index.js +0 -11
  254. package/resources/v1/org/index.js.map +0 -1
  255. package/resources/v1/org/index.mjs +0 -5
  256. package/resources/v1/org/index.mjs.map +0 -1
  257. package/resources/v1/org/org.d.mts +0 -14
  258. package/resources/v1/org/org.d.mts.map +0 -1
  259. package/resources/v1/org/org.d.ts +0 -14
  260. package/resources/v1/org/org.d.ts.map +0 -1
  261. package/resources/v1/org/org.js +0 -21
  262. package/resources/v1/org/org.js.map +0 -1
  263. package/resources/v1/org/org.mjs +0 -16
  264. package/resources/v1/org/org.mjs.map +0 -1
  265. package/resources/v1/org/users.d.mts +0 -87
  266. package/resources/v1/org/users.d.mts.map +0 -1
  267. package/resources/v1/org/users.d.ts +0 -87
  268. package/resources/v1/org/users.d.ts.map +0 -1
  269. package/resources/v1/org/users.js +0 -60
  270. package/resources/v1/org/users.js.map +0 -1
  271. package/resources/v1/org/users.mjs +0 -56
  272. package/resources/v1/org/users.mjs.map +0 -1
  273. package/resources/v1/org.d.mts +0 -2
  274. package/resources/v1/org.d.mts.map +0 -1
  275. package/resources/v1/org.d.ts +0 -2
  276. package/resources/v1/org.d.ts.map +0 -1
  277. package/resources/v1/org.js +0 -6
  278. package/resources/v1/org.js.map +0 -1
  279. package/resources/v1/org.mjs +0 -3
  280. package/resources/v1/org.mjs.map +0 -1
  281. package/resources/v1/tenants/batch.d.mts +0 -159
  282. package/resources/v1/tenants/batch.d.mts.map +0 -1
  283. package/resources/v1/tenants/batch.d.ts +0 -159
  284. package/resources/v1/tenants/batch.d.ts.map +0 -1
  285. package/resources/v1/tenants/batch.js +0 -42
  286. package/resources/v1/tenants/batch.js.map +0 -1
  287. package/resources/v1/tenants/batch.mjs +0 -38
  288. package/resources/v1/tenants/batch.mjs.map +0 -1
  289. package/resources/v1/tenants/import.d.mts +0 -126
  290. package/resources/v1/tenants/import.d.mts.map +0 -1
  291. package/resources/v1/tenants/import.d.ts +0 -126
  292. package/resources/v1/tenants/import.d.ts.map +0 -1
  293. package/resources/v1/tenants/import.js +0 -50
  294. package/resources/v1/tenants/import.js.map +0 -1
  295. package/resources/v1/tenants/import.mjs +0 -46
  296. package/resources/v1/tenants/import.mjs.map +0 -1
  297. package/src/resources/healthz.ts +0 -20
  298. package/src/resources/readyz.ts +0 -20
  299. package/src/resources/v1/connections/connections.ts +0 -1905
  300. package/src/resources/v1/connections/databases.ts +0 -42
  301. package/src/resources/v1/connections/index.ts +0 -33
  302. package/src/resources/v1/connections/views.ts +0 -112
  303. package/src/resources/v1/connections/yaml.ts +0 -81
  304. package/src/resources/v1/github/github.ts +0 -165
  305. package/src/resources/v1/github/index.ts +0 -20
  306. package/src/resources/v1/github/repos.ts +0 -85
  307. package/src/resources/v1/github/scaffold.ts +0 -44
  308. package/src/resources/v1/github/webhooks.ts +0 -60
  309. package/src/resources/v1/github.ts +0 -3
  310. package/src/resources/v1/groups/groups.ts +0 -218
  311. package/src/resources/v1/groups/index.ts +0 -10
  312. package/src/resources/v1/groups/tenants.ts +0 -78
  313. package/src/resources/v1/groups.ts +0 -3
  314. package/src/resources/v1/me.ts +0 -62
  315. package/src/resources/v1/org/client.ts +0 -81
  316. package/src/resources/v1/org/index.ts +0 -11
  317. package/src/resources/v1/org/org.ts +0 -32
  318. package/src/resources/v1/org/users.ts +0 -127
  319. package/src/resources/v1/org.ts +0 -3
  320. package/src/resources/v1/tenants/batch.ts +0 -200
  321. package/src/resources/v1/tenants/import.ts +0 -158
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"OAEO,EAA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,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAID,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,KAAK,kCAAkC,IAAI,kCAAkC,EAAE,CAAC;CAC5G"}
@@ -1,185 +1,112 @@
1
1
  import { APIResource } from "../../../core/resource.js";
2
- import * as BatchAPI from "./batch.js";
3
- import { Batch, BatchCreateParams, BatchCreateResponse, BatchDeleteParams, BatchDeleteResponse, BatchTenantError, BatchTenantSuccess, BatchUpdateParams, BatchUpdateResponse } from "./batch.js";
4
2
  import * as GroupsAPI from "./groups.js";
5
- import { GroupRetrieveSchemaResponse, Groups } from "./groups.js";
6
- import * as ImportAPI from "./import.js";
7
- import { Import, ImportFromCsvParams, ImportFromWarehouseParams, ImportTenants } from "./import.js";
3
+ import { GroupGetTenantGroupsSchemaResponse, Groups } from "./groups.js";
8
4
  import { APIPromise } from "../../../core/api-promise.js";
5
+ import { type Uploadable } from "../../../core/uploads.js";
9
6
  import { RequestOptions } from "../../../internal/request-options.js";
10
7
  export declare class Tenants extends APIResource {
11
- batch: BatchAPI.Batch;
12
- import: ImportAPI.Import;
13
8
  groups: GroupsAPI.Groups;
14
9
  /**
15
- * Create a new tenant.
16
- *
17
- * Validates the client's tenancy type and creates the tenant accordingly:
18
- *
19
- * - ROW tenancy: Creates tenant with optional group associations
20
- * - DATABASE tenancy: Requires database_name, creates tenant with database
21
- * association
22
- * - NONE tenancy: Returns error (tenant creation not allowed)
23
- *
24
- * RLS: Filtered to current client (ClientRLSDB).
25
- */
26
- create(body: TenantCreateParams, options?: RequestOptions): APIPromise<Tenant>;
27
- /**
28
- * Get a single tenant by ID.
10
+ * Get all tenants as a TenantSchema object.
29
11
  *
30
- * Returns the tenant with associated groups and databases.
12
+ * Returns tenants in the YAML-compatible schema format with group references.
13
+ * Supports content negotiation: JSON by default, YAML with Accept:
14
+ * application/yaml.
31
15
  *
32
16
  * RLS: Filtered to current client (ClientRLSDB).
33
- *
34
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
35
17
  */
36
- retrieve(tenantID: string, options?: RequestOptions): APIPromise<Tenant>;
18
+ getTenantsSchema(options?: RequestOptions): APIPromise<TenantGetTenantsSchemaResponse>;
37
19
  /**
38
- * Update a tenant.
39
- *
40
- * Updates tenant metadata, group associations, and/or database associations. Group
41
- * associations use replace semantics:
20
+ * Import tenants from a CSV file using upsert semantics.
42
21
  *
43
- * - Omit group_names to leave existing associations unchanged
44
- * - Pass empty list to remove all group associations
45
- * - Pass list of names to replace all associations
22
+ * Expected CSV format:
46
23
  *
47
- * Database associations (DATABASE tenancy only):
24
+ * - tenant_key (required): Unique tenant identifier
25
+ * - tenant_name (optional): Human-readable name
26
+ * - group_names (optional): Comma-separated list of group names
48
27
  *
49
- * - Both connection_id and database_name must be provided together
50
- * - Replaces existing database association
28
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
29
+ * added additively (not replaced) and auto-created if needed.
51
30
  *
52
31
  * RLS: Filtered to current client (ClientRLSDB).
53
32
  *
54
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
33
+ * Raises: ValidationError: If CSV format is invalid (400)
34
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
55
35
  */
56
- update(tenantID: string, body: TenantUpdateParams, options?: RequestOptions): APIPromise<Tenant>;
36
+ importFromCsv(body: TenantImportFromCsvParams, options?: RequestOptions): APIPromise<ImportTenantsResponse>;
57
37
  /**
58
- * List all tenants for the client.
38
+ * Import tenants from a warehouse table using upsert semantics.
59
39
  *
60
- * Returns tenants with their associated groups and databases.
40
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
41
+ * added additively (not replaced).
61
42
  *
62
- * RLS: Filtered to current client (ClientRLSDB).
63
- */
64
- list(options?: RequestOptions): APIPromise<TenantListResponse>;
65
- /**
66
- * Delete a tenant.
43
+ * Streams data from the warehouse in batches to handle large datasets without
44
+ * loading everything into memory.
67
45
  *
68
- * Soft-deletes the tenant and its group/database associations.
46
+ * For tenants with groups, groups are aggregated per tenant key and auto-created
47
+ * if they don't exist.
69
48
  *
70
49
  * RLS: Filtered to current client (ClientRLSDB).
71
50
  *
72
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
51
+ * Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
52
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
73
53
  */
74
- delete(tenantID: string, options?: RequestOptions): APIPromise<void>;
75
- /**
76
- * Get all tenants as a TenantSchema object.
77
- *
78
- * Returns tenants in the YAML-compatible schema format with group references.
79
- * Supports content negotiation: JSON by default, YAML with Accept:
80
- * application/yaml.
81
- *
82
- * RLS: Filtered to current client (ClientRLSDB).
83
- */
84
- retrieveSchema(options?: RequestOptions): APIPromise<TenantRetrieveSchemaResponse>;
54
+ importFromWarehouse(body: TenantImportFromWarehouseParams, options?: RequestOptions): APIPromise<ImportTenantsResponse>;
85
55
  }
86
56
  /**
87
- * Request model for creating a single tenant.
57
+ * Response model for tenant import operation.
88
58
  */
89
- export interface CreateTenant {
59
+ export interface ImportTenantsResponse {
90
60
  /**
91
- * Unique tenant identifier within the client
61
+ * Unique tenant keys found in source
92
62
  */
93
- tenant_key: string;
63
+ total_found: number;
94
64
  /**
95
- * Connection ID (required for DATABASE tenancy type)
65
+ * New tenants created
96
66
  */
97
- connection_id?: string | null;
67
+ total_imported: number;
98
68
  /**
99
- * Database name (required for DATABASE tenancy type)
69
+ * Existing tenants updated
100
70
  */
101
- database_name?: string | null;
71
+ total_updated: number;
102
72
  /**
103
- * List of group names to associate with the tenant
73
+ * Tenant-specific errors
104
74
  */
105
- group_names?: Array<string> | null;
75
+ errors?: Array<ImportTenantsResponse.Error>;
106
76
  /**
107
- * Human-readable tenant name
77
+ * Groups that were auto-created
108
78
  */
109
- tenant_name?: string | null;
79
+ groups_created?: Array<string>;
110
80
  }
111
- /**
112
- * Response model for a single tenant.
113
- */
114
- export interface Tenant {
81
+ export declare namespace ImportTenantsResponse {
115
82
  /**
116
- * Tenant ID
83
+ * Error for a single tenant during import.
117
84
  */
118
- id: string;
119
- /**
120
- * Creation timestamp
121
- */
122
- created_at: string;
123
- /**
124
- * Associated databases
125
- */
126
- databases: Array<Tenant.Database>;
127
- /**
128
- * Associated groups
129
- */
130
- groups: Array<Tenant.Group>;
131
- /**
132
- * Human-readable tenant name
133
- */
134
- name: string | null;
135
- /**
136
- * Unique tenant identifier
137
- */
138
- tenant_key: string;
139
- /**
140
- * Last update timestamp
141
- */
142
- updated_at: string;
143
- }
144
- export declare namespace Tenant {
145
- /**
146
- * Database information in tenant responses.
147
- */
148
- interface Database {
149
- /**
150
- * Database ID
151
- */
152
- id: string;
85
+ interface Error {
153
86
  /**
154
- * Database name
87
+ * Error code
155
88
  */
156
- name: string;
157
- }
158
- /**
159
- * Group information in tenant responses.
160
- */
161
- interface Group {
89
+ code: string;
162
90
  /**
163
- * Group ID
91
+ * Error message
164
92
  */
165
- id: string;
93
+ message: string;
166
94
  /**
167
- * Group name
95
+ * Tenant key that failed
168
96
  */
169
- name: string;
97
+ tenant_key: string;
170
98
  }
171
99
  }
172
- export type TenantListResponse = Array<Tenant>;
173
100
  /**
174
101
  * Schema for tenant configuration files
175
102
  */
176
- export interface TenantRetrieveSchemaResponse {
103
+ export interface TenantGetTenantsSchemaResponse {
177
104
  /**
178
105
  * Array of tenant configurations
179
106
  */
180
- tenants: Array<TenantRetrieveSchemaResponse.Tenant>;
107
+ tenants: Array<TenantGetTenantsSchemaResponse.Tenant>;
181
108
  }
182
- export declare namespace TenantRetrieveSchemaResponse {
109
+ export declare namespace TenantGetTenantsSchemaResponse {
183
110
  interface Tenant {
184
111
  /**
185
112
  * Unique Kater identifier
@@ -199,50 +126,44 @@ export declare namespace TenantRetrieveSchemaResponse {
199
126
  name?: string | null;
200
127
  }
201
128
  }
202
- export interface TenantCreateParams {
203
- /**
204
- * Unique tenant identifier within the client
205
- */
206
- tenant_key: string;
129
+ export interface TenantImportFromCsvParams {
207
130
  /**
208
- * Connection ID (required for DATABASE tenancy type)
131
+ * CSV file with tenant data
209
132
  */
210
- connection_id?: string | null;
133
+ file: Uploadable;
134
+ }
135
+ export interface TenantImportFromWarehouseParams {
211
136
  /**
212
- * Database name (required for DATABASE tenancy type)
137
+ * Warehouse connection ID to query
213
138
  */
214
- database_name?: string | null;
139
+ connection_id: string;
215
140
  /**
216
- * List of group names to associate with the tenant
141
+ * Database name containing the tenant table
217
142
  */
218
- group_names?: Array<string> | null;
143
+ database: string;
219
144
  /**
220
- * Human-readable tenant name
145
+ * Schema name containing the tenant table
221
146
  */
222
- tenant_name?: string | null;
223
- }
224
- export interface TenantUpdateParams {
147
+ schema: string;
225
148
  /**
226
- * Connection ID for database association (required with database_name)
149
+ * Table name containing tenant data
227
150
  */
228
- connection_id?: string | null;
151
+ table: string;
229
152
  /**
230
- * Database name for association (required with connection_id)
153
+ * Column name for tenant key
231
154
  */
232
- database_name?: string | null;
155
+ tenant_key_column: string;
233
156
  /**
234
- * New list of group names (replaces all existing associations)
157
+ * Column name for tenant group (optional)
235
158
  */
236
- group_names?: Array<string> | null;
159
+ tenant_group_column?: string | null;
237
160
  /**
238
- * New human-readable tenant name
161
+ * Column name for tenant display name (optional)
239
162
  */
240
- tenant_name?: string | null;
163
+ tenant_name_column?: string | null;
241
164
  }
242
165
  export declare namespace Tenants {
243
- export { type CreateTenant as CreateTenant, type Tenant as Tenant, type TenantListResponse as TenantListResponse, type TenantRetrieveSchemaResponse as TenantRetrieveSchemaResponse, type TenantCreateParams as TenantCreateParams, type TenantUpdateParams as TenantUpdateParams, };
244
- export { Batch as Batch, type BatchTenantError as BatchTenantError, type BatchTenantSuccess as BatchTenantSuccess, type BatchCreateResponse as BatchCreateResponse, type BatchUpdateResponse as BatchUpdateResponse, type BatchDeleteResponse as BatchDeleteResponse, type BatchCreateParams as BatchCreateParams, type BatchUpdateParams as BatchUpdateParams, type BatchDeleteParams as BatchDeleteParams, };
245
- export { Import as Import, type ImportTenants as ImportTenants, type ImportFromCsvParams as ImportFromCsvParams, type ImportFromWarehouseParams as ImportFromWarehouseParams, };
246
- export { Groups as Groups, type GroupRetrieveSchemaResponse as GroupRetrieveSchemaResponse };
166
+ export { type ImportTenantsResponse as ImportTenantsResponse, type TenantGetTenantsSchemaResponse as TenantGetTenantsSchemaResponse, type TenantImportFromCsvParams as TenantImportFromCsvParams, type TenantImportFromWarehouseParams as TenantImportFromWarehouseParams, };
167
+ export { Groups as Groups, type GroupGetTenantGroupsSchemaResponse as GroupGetTenantGroupsSchemaResponse };
247
168
  }
248
169
  //# sourceMappingURL=tenants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EACL,KAAK,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACpB;OACM,KAAK,SAAS;OACd,EAAE,2BAA2B,EAAE,MAAM,EAAE;OACvC,KAAK,SAAS;OACd,EAAE,MAAM,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,aAAa,EAAE;OACzE,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IACzD,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC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W,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACvD;AAED,yBAAiB,8BAA8B,CAAC;IAC9C,UAAiB,MAAM;QACrB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAE9B;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB;CACF;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAID,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,KAAK,kCAAkC,IAAI,kCAAkC,EAAE,CAAC;CAC5G"}
@@ -4,110 +4,67 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Tenants = void 0;
5
5
  const tslib_1 = require("../../../internal/tslib.js");
6
6
  const resource_1 = require("../../../core/resource.js");
7
- const BatchAPI = tslib_1.__importStar(require("./batch.js"));
8
- const batch_1 = require("./batch.js");
9
7
  const GroupsAPI = tslib_1.__importStar(require("./groups.js"));
10
8
  const groups_1 = require("./groups.js");
11
- const ImportAPI = tslib_1.__importStar(require("./import.js"));
12
- const import_1 = require("./import.js");
13
- const headers_1 = require("../../../internal/headers.js");
14
- const path_1 = require("../../../internal/utils/path.js");
9
+ const uploads_1 = require("../../../internal/uploads.js");
15
10
  class Tenants extends resource_1.APIResource {
16
11
  constructor() {
17
12
  super(...arguments);
18
- this.batch = new BatchAPI.Batch(this._client);
19
- this.import = new ImportAPI.Import(this._client);
20
13
  this.groups = new GroupsAPI.Groups(this._client);
21
14
  }
22
15
  /**
23
- * Create a new tenant.
24
- *
25
- * Validates the client's tenancy type and creates the tenant accordingly:
26
- *
27
- * - ROW tenancy: Creates tenant with optional group associations
28
- * - DATABASE tenancy: Requires database_name, creates tenant with database
29
- * association
30
- * - NONE tenancy: Returns error (tenant creation not allowed)
31
- *
32
- * RLS: Filtered to current client (ClientRLSDB).
33
- */
34
- create(body, options) {
35
- return this._client.post('/api/v1/tenants', { body, ...options });
36
- }
37
- /**
38
- * Get a single tenant by ID.
16
+ * Get all tenants as a TenantSchema object.
39
17
  *
40
- * Returns the tenant with associated groups and databases.
18
+ * Returns tenants in the YAML-compatible schema format with group references.
19
+ * Supports content negotiation: JSON by default, YAML with Accept:
20
+ * application/yaml.
41
21
  *
42
22
  * RLS: Filtered to current client (ClientRLSDB).
43
- *
44
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
45
23
  */
46
- retrieve(tenantID, options) {
47
- return this._client.get((0, path_1.path) `/api/v1/tenants/${tenantID}`, options);
24
+ getTenantsSchema(options) {
25
+ return this._client.get('/api/v1/tenants/schema', options);
48
26
  }
49
27
  /**
50
- * Update a tenant.
51
- *
52
- * Updates tenant metadata, group associations, and/or database associations. Group
53
- * associations use replace semantics:
28
+ * Import tenants from a CSV file using upsert semantics.
54
29
  *
55
- * - Omit group_names to leave existing associations unchanged
56
- * - Pass empty list to remove all group associations
57
- * - Pass list of names to replace all associations
30
+ * Expected CSV format:
58
31
  *
59
- * Database associations (DATABASE tenancy only):
32
+ * - tenant_key (required): Unique tenant identifier
33
+ * - tenant_name (optional): Human-readable name
34
+ * - group_names (optional): Comma-separated list of group names
60
35
  *
61
- * - Both connection_id and database_name must be provided together
62
- * - Replaces existing database association
36
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
37
+ * added additively (not replaced) and auto-created if needed.
63
38
  *
64
39
  * RLS: Filtered to current client (ClientRLSDB).
65
40
  *
66
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
41
+ * Raises: ValidationError: If CSV format is invalid (400)
42
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
67
43
  */
68
- update(tenantID, body, options) {
69
- return this._client.patch((0, path_1.path) `/api/v1/tenants/${tenantID}`, { body, ...options });
44
+ importFromCsv(body, options) {
45
+ return this._client.post('/api/v1/tenants/import/csv', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
70
46
  }
71
47
  /**
72
- * List all tenants for the client.
48
+ * Import tenants from a warehouse table using upsert semantics.
73
49
  *
74
- * Returns tenants with their associated groups and databases.
50
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
51
+ * added additively (not replaced).
75
52
  *
76
- * RLS: Filtered to current client (ClientRLSDB).
77
- */
78
- list(options) {
79
- return this._client.get('/api/v1/tenants', options);
80
- }
81
- /**
82
- * Delete a tenant.
53
+ * Streams data from the warehouse in batches to handle large datasets without
54
+ * loading everything into memory.
83
55
  *
84
- * Soft-deletes the tenant and its group/database associations.
56
+ * For tenants with groups, groups are aggregated per tenant key and auto-created
57
+ * if they don't exist.
85
58
  *
86
59
  * RLS: Filtered to current client (ClientRLSDB).
87
60
  *
88
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
89
- */
90
- delete(tenantID, options) {
91
- return this._client.delete((0, path_1.path) `/api/v1/tenants/${tenantID}`, {
92
- ...options,
93
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
94
- });
95
- }
96
- /**
97
- * Get all tenants as a TenantSchema object.
98
- *
99
- * Returns tenants in the YAML-compatible schema format with group references.
100
- * Supports content negotiation: JSON by default, YAML with Accept:
101
- * application/yaml.
102
- *
103
- * RLS: Filtered to current client (ClientRLSDB).
61
+ * Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
62
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
104
63
  */
105
- retrieveSchema(options) {
106
- return this._client.get('/api/v1/tenants/schema', options);
64
+ importFromWarehouse(body, options) {
65
+ return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
107
66
  }
108
67
  }
109
68
  exports.Tenants = Tenants;
110
- Tenants.Batch = batch_1.Batch;
111
- Tenants.Import = import_1.Import;
112
69
  Tenants.Groups = groups_1.Groups;
113
70
  //# sourceMappingURL=tenants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,6DAAoC;AACpC,sCAUiB;AACjB,+DAAsC;AACtC,wCAA+D;AAC/D,+DAAsC;AACtC,wCAAiG;AAEjG,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6FhE,CAAC;IA3FC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC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AG,eAAM,CAAC"}
1
+ {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,+DAAsC;AACtC,wCAAsE;AAItE,0DAAwE;AAExE,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiEhE,CAAC;IA/DC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,OAAwB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,4BAA4B,EAC5B,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CACjB,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAlED,0BAkEC;AAoID,OAAO,CAAC,MAAM,GAAG,eAAM,CAAC"}
@@ -1,108 +1,65 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../../core/resource.mjs";
3
- import * as BatchAPI from "./batch.mjs";
4
- import { Batch, } from "./batch.mjs";
5
3
  import * as GroupsAPI from "./groups.mjs";
6
4
  import { Groups } from "./groups.mjs";
7
- import * as ImportAPI from "./import.mjs";
8
- import { Import } from "./import.mjs";
9
- import { buildHeaders } from "../../../internal/headers.mjs";
10
- import { path } from "../../../internal/utils/path.mjs";
5
+ import { multipartFormRequestOptions } from "../../../internal/uploads.mjs";
11
6
  export class Tenants extends APIResource {
12
7
  constructor() {
13
8
  super(...arguments);
14
- this.batch = new BatchAPI.Batch(this._client);
15
- this.import = new ImportAPI.Import(this._client);
16
9
  this.groups = new GroupsAPI.Groups(this._client);
17
10
  }
18
11
  /**
19
- * Create a new tenant.
20
- *
21
- * Validates the client's tenancy type and creates the tenant accordingly:
22
- *
23
- * - ROW tenancy: Creates tenant with optional group associations
24
- * - DATABASE tenancy: Requires database_name, creates tenant with database
25
- * association
26
- * - NONE tenancy: Returns error (tenant creation not allowed)
27
- *
28
- * RLS: Filtered to current client (ClientRLSDB).
29
- */
30
- create(body, options) {
31
- return this._client.post('/api/v1/tenants', { body, ...options });
32
- }
33
- /**
34
- * Get a single tenant by ID.
12
+ * Get all tenants as a TenantSchema object.
35
13
  *
36
- * Returns the tenant with associated groups and databases.
14
+ * Returns tenants in the YAML-compatible schema format with group references.
15
+ * Supports content negotiation: JSON by default, YAML with Accept:
16
+ * application/yaml.
37
17
  *
38
18
  * RLS: Filtered to current client (ClientRLSDB).
39
- *
40
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
41
19
  */
42
- retrieve(tenantID, options) {
43
- return this._client.get(path `/api/v1/tenants/${tenantID}`, options);
20
+ getTenantsSchema(options) {
21
+ return this._client.get('/api/v1/tenants/schema', options);
44
22
  }
45
23
  /**
46
- * Update a tenant.
47
- *
48
- * Updates tenant metadata, group associations, and/or database associations. Group
49
- * associations use replace semantics:
24
+ * Import tenants from a CSV file using upsert semantics.
50
25
  *
51
- * - Omit group_names to leave existing associations unchanged
52
- * - Pass empty list to remove all group associations
53
- * - Pass list of names to replace all associations
26
+ * Expected CSV format:
54
27
  *
55
- * Database associations (DATABASE tenancy only):
28
+ * - tenant_key (required): Unique tenant identifier
29
+ * - tenant_name (optional): Human-readable name
30
+ * - group_names (optional): Comma-separated list of group names
56
31
  *
57
- * - Both connection_id and database_name must be provided together
58
- * - Replaces existing database association
32
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
33
+ * added additively (not replaced) and auto-created if needed.
59
34
  *
60
35
  * RLS: Filtered to current client (ClientRLSDB).
61
36
  *
62
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
37
+ * Raises: ValidationError: If CSV format is invalid (400)
38
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
63
39
  */
64
- update(tenantID, body, options) {
65
- return this._client.patch(path `/api/v1/tenants/${tenantID}`, { body, ...options });
40
+ importFromCsv(body, options) {
41
+ return this._client.post('/api/v1/tenants/import/csv', multipartFormRequestOptions({ body, ...options }, this._client));
66
42
  }
67
43
  /**
68
- * List all tenants for the client.
44
+ * Import tenants from a warehouse table using upsert semantics.
69
45
  *
70
- * Returns tenants with their associated groups and databases.
46
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
47
+ * added additively (not replaced).
71
48
  *
72
- * RLS: Filtered to current client (ClientRLSDB).
73
- */
74
- list(options) {
75
- return this._client.get('/api/v1/tenants', options);
76
- }
77
- /**
78
- * Delete a tenant.
49
+ * Streams data from the warehouse in batches to handle large datasets without
50
+ * loading everything into memory.
79
51
  *
80
- * Soft-deletes the tenant and its group/database associations.
52
+ * For tenants with groups, groups are aggregated per tenant key and auto-created
53
+ * if they don't exist.
81
54
  *
82
55
  * RLS: Filtered to current client (ClientRLSDB).
83
56
  *
84
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
85
- */
86
- delete(tenantID, options) {
87
- return this._client.delete(path `/api/v1/tenants/${tenantID}`, {
88
- ...options,
89
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
90
- });
91
- }
92
- /**
93
- * Get all tenants as a TenantSchema object.
94
- *
95
- * Returns tenants in the YAML-compatible schema format with group references.
96
- * Supports content negotiation: JSON by default, YAML with Accept:
97
- * application/yaml.
98
- *
99
- * RLS: Filtered to current client (ClientRLSDB).
57
+ * Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
58
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
100
59
  */
101
- retrieveSchema(options) {
102
- return this._client.get('/api/v1/tenants/schema', options);
60
+ importFromWarehouse(body, options) {
61
+ return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
103
62
  }
104
63
  }
105
- Tenants.Batch = Batch;
106
- Tenants.Import = Import;
107
64
  Tenants.Groups = Groups;
108
65
  //# sourceMappingURL=tenants.mjs.map