@katerai/sdk 0.5.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 (301) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +23 -16
  3. package/client.d.mts +11 -13
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +11 -13
  6. package/client.d.ts.map +1 -1
  7. package/client.js +45 -17
  8. package/client.js.map +1 -1
  9. package/client.mjs +45 -17
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/internal/utils/log.d.mts.map +1 -1
  18. package/internal/utils/log.d.ts.map +1 -1
  19. package/internal/utils/log.js +2 -1
  20. package/internal/utils/log.js.map +1 -1
  21. package/internal/utils/log.mjs +2 -1
  22. package/internal/utils/log.mjs.map +1 -1
  23. package/package.json +2 -2
  24. package/resources/index.d.mts +0 -2
  25. package/resources/index.d.mts.map +1 -1
  26. package/resources/index.d.ts +0 -2
  27. package/resources/index.d.ts.map +1 -1
  28. package/resources/index.js +1 -5
  29. package/resources/index.js.map +1 -1
  30. package/resources/index.mjs +0 -2
  31. package/resources/index.mjs.map +1 -1
  32. package/resources/v1/connections.d.mts +216 -1
  33. package/resources/v1/connections.d.mts.map +1 -1
  34. package/resources/v1/connections.d.ts +216 -1
  35. package/resources/v1/connections.d.ts.map +1 -1
  36. package/resources/v1/connections.js +22 -2
  37. package/resources/v1/connections.js.map +1 -1
  38. package/resources/v1/connections.mjs +20 -1
  39. package/resources/v1/connections.mjs.map +1 -1
  40. package/resources/v1/index.d.mts +2 -6
  41. package/resources/v1/index.d.mts.map +1 -1
  42. package/resources/v1/index.d.ts +2 -6
  43. package/resources/v1/index.d.ts.map +1 -1
  44. package/resources/v1/index.js +5 -13
  45. package/resources/v1/index.js.map +1 -1
  46. package/resources/v1/index.mjs +2 -6
  47. package/resources/v1/index.mjs.map +1 -1
  48. package/resources/v1/tenants.d.mts +125 -1
  49. package/resources/v1/tenants.d.mts.map +1 -1
  50. package/resources/v1/tenants.d.ts +125 -1
  51. package/resources/v1/tenants.d.ts.map +1 -1
  52. package/resources/v1/tenants.js +46 -2
  53. package/resources/v1/tenants.js.map +1 -1
  54. package/resources/v1/tenants.mjs +44 -1
  55. package/resources/v1/tenants.mjs.map +1 -1
  56. package/resources/v1/v1.d.mts +6 -22
  57. package/resources/v1/v1.d.mts.map +1 -1
  58. package/resources/v1/v1.d.ts +6 -22
  59. package/resources/v1/v1.d.ts.map +1 -1
  60. package/resources/v1/v1.js +4 -20
  61. package/resources/v1/v1.js.map +1 -1
  62. package/resources/v1/v1.mjs +4 -20
  63. package/resources/v1/v1.mjs.map +1 -1
  64. package/src/client.ts +57 -25
  65. package/src/internal/parse.ts +6 -0
  66. package/src/internal/utils/log.ts +1 -0
  67. package/src/resources/index.ts +0 -2
  68. package/src/resources/v1/connections.ts +277 -1
  69. package/src/resources/v1/index.ts +7 -31
  70. package/src/resources/v1/tenants.ts +162 -1
  71. package/src/resources/v1/v1.ts +14 -78
  72. package/src/version.ts +1 -1
  73. package/version.d.mts +1 -1
  74. package/version.d.ts +1 -1
  75. package/version.js +1 -1
  76. package/version.mjs +1 -1
  77. package/resources/healthz.d.mts +0 -16
  78. package/resources/healthz.d.mts.map +0 -1
  79. package/resources/healthz.d.ts +0 -16
  80. package/resources/healthz.d.ts.map +0 -1
  81. package/resources/healthz.js +0 -15
  82. package/resources/healthz.js.map +0 -1
  83. package/resources/healthz.mjs +0 -11
  84. package/resources/healthz.mjs.map +0 -1
  85. package/resources/readyz.d.mts +0 -16
  86. package/resources/readyz.d.mts.map +0 -1
  87. package/resources/readyz.d.ts +0 -16
  88. package/resources/readyz.d.ts.map +0 -1
  89. package/resources/readyz.js +0 -15
  90. package/resources/readyz.js.map +0 -1
  91. package/resources/readyz.mjs +0 -11
  92. package/resources/readyz.mjs.map +0 -1
  93. package/resources/v1/connections/connections.d.mts +0 -847
  94. package/resources/v1/connections/connections.d.mts.map +0 -1
  95. package/resources/v1/connections/connections.d.ts +0 -847
  96. package/resources/v1/connections/connections.d.ts.map +0 -1
  97. package/resources/v1/connections/connections.js +0 -100
  98. package/resources/v1/connections/connections.js.map +0 -1
  99. package/resources/v1/connections/connections.mjs +0 -95
  100. package/resources/v1/connections/connections.mjs.map +0 -1
  101. package/resources/v1/connections/databases.d.mts +0 -25
  102. package/resources/v1/connections/databases.d.mts.map +0 -1
  103. package/resources/v1/connections/databases.d.ts +0 -25
  104. package/resources/v1/connections/databases.d.ts.map +0 -1
  105. package/resources/v1/connections/databases.js +0 -26
  106. package/resources/v1/connections/databases.js.map +0 -1
  107. package/resources/v1/connections/databases.mjs +0 -22
  108. package/resources/v1/connections/databases.mjs.map +0 -1
  109. package/resources/v1/connections/index.d.mts +0 -3
  110. package/resources/v1/connections/index.d.mts.map +0 -1
  111. package/resources/v1/connections/index.d.ts +0 -3
  112. package/resources/v1/connections/index.d.ts.map +0 -1
  113. package/resources/v1/connections/index.js +0 -9
  114. package/resources/v1/connections/index.js.map +0 -1
  115. package/resources/v1/connections/index.mjs +0 -4
  116. package/resources/v1/connections/index.mjs.map +0 -1
  117. package/resources/v1/github/github.d.mts +0 -95
  118. package/resources/v1/github/github.d.mts.map +0 -1
  119. package/resources/v1/github/github.d.ts +0 -95
  120. package/resources/v1/github/github.d.ts.map +0 -1
  121. package/resources/v1/github/github.js +0 -49
  122. package/resources/v1/github/github.js.map +0 -1
  123. package/resources/v1/github/github.mjs +0 -44
  124. package/resources/v1/github/github.mjs.map +0 -1
  125. package/resources/v1/github/index.d.mts +0 -5
  126. package/resources/v1/github/index.d.mts.map +0 -1
  127. package/resources/v1/github/index.d.ts +0 -5
  128. package/resources/v1/github/index.d.ts.map +0 -1
  129. package/resources/v1/github/index.js +0 -13
  130. package/resources/v1/github/index.js.map +0 -1
  131. package/resources/v1/github/index.mjs +0 -6
  132. package/resources/v1/github/index.mjs.map +0 -1
  133. package/resources/v1/github/repos.d.mts +0 -54
  134. package/resources/v1/github/repos.d.mts.map +0 -1
  135. package/resources/v1/github/repos.d.ts +0 -54
  136. package/resources/v1/github/repos.d.ts.map +0 -1
  137. package/resources/v1/github/repos.js +0 -22
  138. package/resources/v1/github/repos.js.map +0 -1
  139. package/resources/v1/github/repos.mjs +0 -18
  140. package/resources/v1/github/repos.mjs.map +0 -1
  141. package/resources/v1/github/scaffold.d.mts +0 -29
  142. package/resources/v1/github/scaffold.d.mts.map +0 -1
  143. package/resources/v1/github/scaffold.d.ts +0 -29
  144. package/resources/v1/github/scaffold.d.ts.map +0 -1
  145. package/resources/v1/github/scaffold.js +0 -21
  146. package/resources/v1/github/scaffold.js.map +0 -1
  147. package/resources/v1/github/scaffold.mjs +0 -17
  148. package/resources/v1/github/scaffold.mjs.map +0 -1
  149. package/resources/v1/github/webhooks.d.mts +0 -28
  150. package/resources/v1/github/webhooks.d.mts.map +0 -1
  151. package/resources/v1/github/webhooks.d.ts +0 -28
  152. package/resources/v1/github/webhooks.d.ts.map +0 -1
  153. package/resources/v1/github/webhooks.js +0 -27
  154. package/resources/v1/github/webhooks.js.map +0 -1
  155. package/resources/v1/github/webhooks.mjs +0 -23
  156. package/resources/v1/github/webhooks.mjs.map +0 -1
  157. package/resources/v1/github.d.mts +0 -2
  158. package/resources/v1/github.d.mts.map +0 -1
  159. package/resources/v1/github.d.ts +0 -2
  160. package/resources/v1/github.d.ts.map +0 -1
  161. package/resources/v1/github.js +0 -6
  162. package/resources/v1/github.js.map +0 -1
  163. package/resources/v1/github.mjs +0 -3
  164. package/resources/v1/github.mjs.map +0 -1
  165. package/resources/v1/groups/groups.d.mts +0 -162
  166. package/resources/v1/groups/groups.d.mts.map +0 -1
  167. package/resources/v1/groups/groups.d.ts +0 -162
  168. package/resources/v1/groups/groups.d.ts.map +0 -1
  169. package/resources/v1/groups/groups.js +0 -81
  170. package/resources/v1/groups/groups.js.map +0 -1
  171. package/resources/v1/groups/groups.mjs +0 -76
  172. package/resources/v1/groups/groups.mjs.map +0 -1
  173. package/resources/v1/groups/index.d.mts +0 -3
  174. package/resources/v1/groups/index.d.mts.map +0 -1
  175. package/resources/v1/groups/index.d.ts +0 -3
  176. package/resources/v1/groups/index.d.ts.map +0 -1
  177. package/resources/v1/groups/index.js +0 -9
  178. package/resources/v1/groups/index.js.map +0 -1
  179. package/resources/v1/groups/index.mjs +0 -4
  180. package/resources/v1/groups/index.mjs.map +0 -1
  181. package/resources/v1/groups/tenants.d.mts +0 -55
  182. package/resources/v1/groups/tenants.d.mts.map +0 -1
  183. package/resources/v1/groups/tenants.d.ts +0 -55
  184. package/resources/v1/groups/tenants.d.ts.map +0 -1
  185. package/resources/v1/groups/tenants.js +0 -39
  186. package/resources/v1/groups/tenants.js.map +0 -1
  187. package/resources/v1/groups/tenants.mjs +0 -35
  188. package/resources/v1/groups/tenants.mjs.map +0 -1
  189. package/resources/v1/groups.d.mts +0 -2
  190. package/resources/v1/groups.d.mts.map +0 -1
  191. package/resources/v1/groups.d.ts +0 -2
  192. package/resources/v1/groups.d.ts.map +0 -1
  193. package/resources/v1/groups.js +0 -6
  194. package/resources/v1/groups.js.map +0 -1
  195. package/resources/v1/groups.mjs +0 -3
  196. package/resources/v1/groups.mjs.map +0 -1
  197. package/resources/v1/me.d.mts +0 -43
  198. package/resources/v1/me.d.mts.map +0 -1
  199. package/resources/v1/me.d.ts +0 -43
  200. package/resources/v1/me.d.ts.map +0 -1
  201. package/resources/v1/me.js +0 -20
  202. package/resources/v1/me.js.map +0 -1
  203. package/resources/v1/me.mjs +0 -16
  204. package/resources/v1/me.mjs.map +0 -1
  205. package/resources/v1/org/client.d.mts +0 -53
  206. package/resources/v1/org/client.d.mts.map +0 -1
  207. package/resources/v1/org/client.d.ts +0 -53
  208. package/resources/v1/org/client.d.ts.map +0 -1
  209. package/resources/v1/org/client.js +0 -25
  210. package/resources/v1/org/client.js.map +0 -1
  211. package/resources/v1/org/client.mjs +0 -21
  212. package/resources/v1/org/client.mjs.map +0 -1
  213. package/resources/v1/org/index.d.mts +0 -4
  214. package/resources/v1/org/index.d.mts.map +0 -1
  215. package/resources/v1/org/index.d.ts +0 -4
  216. package/resources/v1/org/index.d.ts.map +0 -1
  217. package/resources/v1/org/index.js +0 -11
  218. package/resources/v1/org/index.js.map +0 -1
  219. package/resources/v1/org/index.mjs +0 -5
  220. package/resources/v1/org/index.mjs.map +0 -1
  221. package/resources/v1/org/org.d.mts +0 -14
  222. package/resources/v1/org/org.d.mts.map +0 -1
  223. package/resources/v1/org/org.d.ts +0 -14
  224. package/resources/v1/org/org.d.ts.map +0 -1
  225. package/resources/v1/org/org.js +0 -21
  226. package/resources/v1/org/org.js.map +0 -1
  227. package/resources/v1/org/org.mjs +0 -16
  228. package/resources/v1/org/org.mjs.map +0 -1
  229. package/resources/v1/org/users.d.mts +0 -87
  230. package/resources/v1/org/users.d.mts.map +0 -1
  231. package/resources/v1/org/users.d.ts +0 -87
  232. package/resources/v1/org/users.d.ts.map +0 -1
  233. package/resources/v1/org/users.js +0 -60
  234. package/resources/v1/org/users.js.map +0 -1
  235. package/resources/v1/org/users.mjs +0 -56
  236. package/resources/v1/org/users.mjs.map +0 -1
  237. package/resources/v1/org.d.mts +0 -2
  238. package/resources/v1/org.d.mts.map +0 -1
  239. package/resources/v1/org.d.ts +0 -2
  240. package/resources/v1/org.d.ts.map +0 -1
  241. package/resources/v1/org.js +0 -6
  242. package/resources/v1/org.js.map +0 -1
  243. package/resources/v1/org.mjs +0 -3
  244. package/resources/v1/org.mjs.map +0 -1
  245. package/resources/v1/tenants/batch.d.mts +0 -159
  246. package/resources/v1/tenants/batch.d.mts.map +0 -1
  247. package/resources/v1/tenants/batch.d.ts +0 -159
  248. package/resources/v1/tenants/batch.d.ts.map +0 -1
  249. package/resources/v1/tenants/batch.js +0 -42
  250. package/resources/v1/tenants/batch.js.map +0 -1
  251. package/resources/v1/tenants/batch.mjs +0 -38
  252. package/resources/v1/tenants/batch.mjs.map +0 -1
  253. package/resources/v1/tenants/import.d.mts +0 -126
  254. package/resources/v1/tenants/import.d.mts.map +0 -1
  255. package/resources/v1/tenants/import.d.ts +0 -126
  256. package/resources/v1/tenants/import.d.ts.map +0 -1
  257. package/resources/v1/tenants/import.js +0 -50
  258. package/resources/v1/tenants/import.js.map +0 -1
  259. package/resources/v1/tenants/import.mjs +0 -46
  260. package/resources/v1/tenants/import.mjs.map +0 -1
  261. package/resources/v1/tenants/index.d.mts +0 -4
  262. package/resources/v1/tenants/index.d.mts.map +0 -1
  263. package/resources/v1/tenants/index.d.ts +0 -4
  264. package/resources/v1/tenants/index.d.ts.map +0 -1
  265. package/resources/v1/tenants/index.js +0 -11
  266. package/resources/v1/tenants/index.js.map +0 -1
  267. package/resources/v1/tenants/index.mjs +0 -5
  268. package/resources/v1/tenants/index.mjs.map +0 -1
  269. package/resources/v1/tenants/tenants.d.mts +0 -205
  270. package/resources/v1/tenants/tenants.d.mts.map +0 -1
  271. package/resources/v1/tenants/tenants.d.ts +0 -205
  272. package/resources/v1/tenants/tenants.d.ts.map +0 -1
  273. package/resources/v1/tenants/tenants.js +0 -97
  274. package/resources/v1/tenants/tenants.js.map +0 -1
  275. package/resources/v1/tenants/tenants.mjs +0 -92
  276. package/resources/v1/tenants/tenants.mjs.map +0 -1
  277. package/src/resources/healthz.ts +0 -20
  278. package/src/resources/readyz.ts +0 -20
  279. package/src/resources/v1/connections/connections.ts +0 -1072
  280. package/src/resources/v1/connections/databases.ts +0 -42
  281. package/src/resources/v1/connections/index.ts +0 -13
  282. package/src/resources/v1/github/github.ts +0 -157
  283. package/src/resources/v1/github/index.ts +0 -20
  284. package/src/resources/v1/github/repos.ts +0 -85
  285. package/src/resources/v1/github/scaffold.ts +0 -44
  286. package/src/resources/v1/github/webhooks.ts +0 -60
  287. package/src/resources/v1/github.ts +0 -3
  288. package/src/resources/v1/groups/groups.ts +0 -218
  289. package/src/resources/v1/groups/index.ts +0 -10
  290. package/src/resources/v1/groups/tenants.ts +0 -78
  291. package/src/resources/v1/groups.ts +0 -3
  292. package/src/resources/v1/me.ts +0 -62
  293. package/src/resources/v1/org/client.ts +0 -81
  294. package/src/resources/v1/org/index.ts +0 -11
  295. package/src/resources/v1/org/org.ts +0 -32
  296. package/src/resources/v1/org/users.ts +0 -127
  297. package/src/resources/v1/org.ts +0 -3
  298. package/src/resources/v1/tenants/batch.ts +0 -200
  299. package/src/resources/v1/tenants/import.ts +0 -158
  300. package/src/resources/v1/tenants/index.ts +0 -27
  301. package/src/resources/v1/tenants/tenants.ts +0 -290
@@ -1,6 +1,50 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("../../internal/tslib.js");
5
- tslib_1.__exportStar(require("./tenants/index.js"), exports);
4
+ exports.Tenants = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const uploads_1 = require("../../internal/uploads.js");
7
+ class Tenants extends resource_1.APIResource {
8
+ /**
9
+ * Import tenants from a CSV file using upsert semantics.
10
+ *
11
+ * Expected CSV format:
12
+ *
13
+ * - tenant_key (required): Unique tenant identifier
14
+ * - tenant_name (optional): Human-readable name
15
+ * - group_names (optional): Comma-separated list of group names
16
+ *
17
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
18
+ * added additively (not replaced) and auto-created if needed.
19
+ *
20
+ * RLS: Filtered to current client (ClientRLSDB).
21
+ *
22
+ * Raises: ValidationError: If CSV format is invalid (400)
23
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
24
+ */
25
+ importFromCsv(body, options) {
26
+ return this._client.post('/api/v1/tenants/import/csv', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
27
+ }
28
+ /**
29
+ * Import tenants from a warehouse table using upsert semantics.
30
+ *
31
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
32
+ * added additively (not replaced).
33
+ *
34
+ * Streams data from the warehouse in batches to handle large datasets without
35
+ * loading everything into memory.
36
+ *
37
+ * For tenants with groups, groups are aggregated per tenant key and auto-created
38
+ * if they don't exist.
39
+ *
40
+ * RLS: Filtered to current client (ClientRLSDB).
41
+ *
42
+ * Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
43
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
44
+ */
45
+ importFromWarehouse(body, options) {
46
+ return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
47
+ }
48
+ }
49
+ exports.Tenants = Tenants;
6
50
  //# sourceMappingURL=tenants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../src/resources/v1/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
1
+ {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../src/resources/v1/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAqE;AAErE,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;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;AAnDD,0BAmDC"}
@@ -1,3 +1,46 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- export * from "./tenants/index.mjs";
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
4
+ export class Tenants extends APIResource {
5
+ /**
6
+ * Import tenants from a CSV file using upsert semantics.
7
+ *
8
+ * Expected CSV format:
9
+ *
10
+ * - tenant_key (required): Unique tenant identifier
11
+ * - tenant_name (optional): Human-readable name
12
+ * - group_names (optional): Comma-separated list of group names
13
+ *
14
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
15
+ * added additively (not replaced) and auto-created if needed.
16
+ *
17
+ * RLS: Filtered to current client (ClientRLSDB).
18
+ *
19
+ * Raises: ValidationError: If CSV format is invalid (400)
20
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
21
+ */
22
+ importFromCsv(body, options) {
23
+ return this._client.post('/api/v1/tenants/import/csv', multipartFormRequestOptions({ body, ...options }, this._client));
24
+ }
25
+ /**
26
+ * Import tenants from a warehouse table using upsert semantics.
27
+ *
28
+ * Creates new tenants and updates existing ones with new name/groups. Groups are
29
+ * added additively (not replaced).
30
+ *
31
+ * Streams data from the warehouse in batches to handle large datasets without
32
+ * loading everything into memory.
33
+ *
34
+ * For tenants with groups, groups are aggregated per tenant key and auto-created
35
+ * if they don't exist.
36
+ *
37
+ * RLS: Filtered to current client (ClientRLSDB).
38
+ *
39
+ * Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
40
+ * TenantCreationNotAllowedError: If tenancy type is NONE (400)
41
+ */
42
+ importFromWarehouse(body, options) {
43
+ return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
44
+ }
45
+ }
3
46
  //# sourceMappingURL=tenants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/v1/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
1
+ {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/v1/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,2BAA2B,EAAE;AAEtC,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,4BAA4B,EAC5B,2BAA2B,CAAC,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"}
@@ -1,30 +1,14 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
- import * as MeAPI from "./me.mjs";
3
- import { ClientUser, ClientUserRole, Me } from "./me.mjs";
4
- import * as ConnectionsAPI from "./connections/connections.mjs";
5
- import { Connection, ConnectionCreateParams, ConnectionListResponse, ConnectionRetrieveCredentialResponse, ConnectionSyncResponse, ConnectionUpdateParams, Connections, DatabaseConfig } from "./connections/connections.mjs";
6
- import * as GitHubAPI from "./github/github.mjs";
7
- import { GitHub, GitHubCallbackParams, GitHubCallbackResponse, GitHubConnectParams, GitHubConnectResponse, GitHubGetInstallationLinkResponse, GitHubGetStatusResponse } from "./github/github.mjs";
8
- import * as GroupsAPI from "./groups/groups.mjs";
9
- import { GroupCreateParams, GroupDetail, GroupListResponse, GroupUpdateParams, Groups } from "./groups/groups.mjs";
10
- import * as OrgAPI from "./org/org.mjs";
11
- import { Org } from "./org/org.mjs";
12
- import * as TenantsAPI from "./tenants/tenants.mjs";
13
- import { CreateTenant, Tenant, TenantCreateParams, TenantListResponse, TenantUpdateParams, Tenants } from "./tenants/tenants.mjs";
2
+ import * as ConnectionsAPI from "./connections.mjs";
3
+ import { Connection, ConnectionListConnectionsParams, ConnectionListConnectionsResponse, Connections } from "./connections.mjs";
4
+ import * as TenantsAPI from "./tenants.mjs";
5
+ import { ImportTenantsResponse, TenantImportFromCsvParams, TenantImportFromWarehouseParams, Tenants } from "./tenants.mjs";
14
6
  export declare class V1 extends APIResource {
15
7
  connections: ConnectionsAPI.Connections;
16
- github: GitHubAPI.GitHub;
17
- groups: GroupsAPI.Groups;
18
- me: MeAPI.Me;
19
- org: OrgAPI.Org;
20
8
  tenants: TenantsAPI.Tenants;
21
9
  }
22
10
  export declare namespace V1 {
23
- export { Connections as Connections, type Connection as Connection, type DatabaseConfig as DatabaseConfig, type ConnectionListResponse as ConnectionListResponse, type ConnectionRetrieveCredentialResponse as ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse as ConnectionSyncResponse, type ConnectionCreateParams as ConnectionCreateParams, type ConnectionUpdateParams as ConnectionUpdateParams, };
24
- export { GitHub as GitHub, type GitHubCallbackResponse as GitHubCallbackResponse, type GitHubConnectResponse as GitHubConnectResponse, type GitHubGetInstallationLinkResponse as GitHubGetInstallationLinkResponse, type GitHubGetStatusResponse as GitHubGetStatusResponse, type GitHubCallbackParams as GitHubCallbackParams, type GitHubConnectParams as GitHubConnectParams, };
25
- export { Groups as Groups, type GroupDetail as GroupDetail, type GroupListResponse as GroupListResponse, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, };
26
- export { Me as Me, type ClientUser as ClientUser, type ClientUserRole as ClientUserRole };
27
- export { Org as Org };
28
- export { Tenants as Tenants, type CreateTenant as CreateTenant, type Tenant as Tenant, type TenantListResponse as TenantListResponse, type TenantCreateParams as TenantCreateParams, type TenantUpdateParams as TenantUpdateParams, };
11
+ export { Connections as Connections, type Connection as Connection, type ConnectionListConnectionsResponse as ConnectionListConnectionsResponse, type ConnectionListConnectionsParams as ConnectionListConnectionsParams, };
12
+ export { Tenants as Tenants, type ImportTenantsResponse as ImportTenantsResponse, type TenantImportFromCsvParams as TenantImportFromCsvParams, type TenantImportFromWarehouseParams as TenantImportFromWarehouseParams, };
29
13
  }
30
14
  //# sourceMappingURL=v1.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v1.d.mts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;OAClC,KAAK,cAAc;OACnB,EACL,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,oCAAoC,EACpC,sBAAsB,EACtB,sBAAsB,EACtB,WAAW,EACX,cAAc,EACf;OACM,KAAK,SAAS;OACd,EACL,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACxB;OACM,KAAK,SAAS;OACd,EACL,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACP;OACM,KAAK,MAAM;OACX,EAAE,GAAG,EAAE;OACP,KAAK,UAAU;OACf,EACL,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EACR;AAED,qBAAa,EAAG,SAAQ,WAAW;IACjC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;IAC1C,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;IAC/C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;CACpE;AASD,MAAM,CAAC,OAAO,WAAW,EAAE,CAAC;IAC1B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,UAAU,IAAI,UAAU,EAAE,KAAK,cAAc,IAAI,cAAc,EAAE,CAAC;IAE1F,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC;IAEtB,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
1
+ {"version":3,"file":"v1.d.mts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EACL,UAAU,EACV,+BAA+B,EAC/B,iCAAiC,EACjC,WAAW,EACZ;OACM,KAAK,UAAU;OACf,EACL,qBAAqB,EACrB,yBAAyB,EACzB,+BAA+B,EAC/B,OAAO,EACR;AAED,qBAAa,EAAG,SAAQ,WAAW;IACjC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;CACpE;AAKD,MAAM,CAAC,OAAO,WAAW,EAAE,CAAC;IAC1B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
@@ -1,30 +1,14 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
- import * as MeAPI from "./me.js";
3
- import { ClientUser, ClientUserRole, Me } from "./me.js";
4
- import * as ConnectionsAPI from "./connections/connections.js";
5
- import { Connection, ConnectionCreateParams, ConnectionListResponse, ConnectionRetrieveCredentialResponse, ConnectionSyncResponse, ConnectionUpdateParams, Connections, DatabaseConfig } from "./connections/connections.js";
6
- import * as GitHubAPI from "./github/github.js";
7
- import { GitHub, GitHubCallbackParams, GitHubCallbackResponse, GitHubConnectParams, GitHubConnectResponse, GitHubGetInstallationLinkResponse, GitHubGetStatusResponse } from "./github/github.js";
8
- import * as GroupsAPI from "./groups/groups.js";
9
- import { GroupCreateParams, GroupDetail, GroupListResponse, GroupUpdateParams, Groups } from "./groups/groups.js";
10
- import * as OrgAPI from "./org/org.js";
11
- import { Org } from "./org/org.js";
12
- import * as TenantsAPI from "./tenants/tenants.js";
13
- import { CreateTenant, Tenant, TenantCreateParams, TenantListResponse, TenantUpdateParams, Tenants } from "./tenants/tenants.js";
2
+ import * as ConnectionsAPI from "./connections.js";
3
+ import { Connection, ConnectionListConnectionsParams, ConnectionListConnectionsResponse, Connections } from "./connections.js";
4
+ import * as TenantsAPI from "./tenants.js";
5
+ import { ImportTenantsResponse, TenantImportFromCsvParams, TenantImportFromWarehouseParams, Tenants } from "./tenants.js";
14
6
  export declare class V1 extends APIResource {
15
7
  connections: ConnectionsAPI.Connections;
16
- github: GitHubAPI.GitHub;
17
- groups: GroupsAPI.Groups;
18
- me: MeAPI.Me;
19
- org: OrgAPI.Org;
20
8
  tenants: TenantsAPI.Tenants;
21
9
  }
22
10
  export declare namespace V1 {
23
- export { Connections as Connections, type Connection as Connection, type DatabaseConfig as DatabaseConfig, type ConnectionListResponse as ConnectionListResponse, type ConnectionRetrieveCredentialResponse as ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse as ConnectionSyncResponse, type ConnectionCreateParams as ConnectionCreateParams, type ConnectionUpdateParams as ConnectionUpdateParams, };
24
- export { GitHub as GitHub, type GitHubCallbackResponse as GitHubCallbackResponse, type GitHubConnectResponse as GitHubConnectResponse, type GitHubGetInstallationLinkResponse as GitHubGetInstallationLinkResponse, type GitHubGetStatusResponse as GitHubGetStatusResponse, type GitHubCallbackParams as GitHubCallbackParams, type GitHubConnectParams as GitHubConnectParams, };
25
- export { Groups as Groups, type GroupDetail as GroupDetail, type GroupListResponse as GroupListResponse, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, };
26
- export { Me as Me, type ClientUser as ClientUser, type ClientUserRole as ClientUserRole };
27
- export { Org as Org };
28
- export { Tenants as Tenants, type CreateTenant as CreateTenant, type Tenant as Tenant, type TenantListResponse as TenantListResponse, type TenantCreateParams as TenantCreateParams, type TenantUpdateParams as TenantUpdateParams, };
11
+ export { Connections as Connections, type Connection as Connection, type ConnectionListConnectionsResponse as ConnectionListConnectionsResponse, type ConnectionListConnectionsParams as ConnectionListConnectionsParams, };
12
+ export { Tenants as Tenants, type ImportTenantsResponse as ImportTenantsResponse, type TenantImportFromCsvParams as TenantImportFromCsvParams, type TenantImportFromWarehouseParams as TenantImportFromWarehouseParams, };
29
13
  }
30
14
  //# sourceMappingURL=v1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;OAClC,KAAK,cAAc;OACnB,EACL,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,oCAAoC,EACpC,sBAAsB,EACtB,sBAAsB,EACtB,WAAW,EACX,cAAc,EACf;OACM,KAAK,SAAS;OACd,EACL,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACxB;OACM,KAAK,SAAS;OACd,EACL,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACP;OACM,KAAK,MAAM;OACX,EAAE,GAAG,EAAE;OACP,KAAK,UAAU;OACf,EACL,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EACR;AAED,qBAAa,EAAG,SAAQ,WAAW;IACjC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;IAC1C,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;IAC/C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;CACpE;AASD,MAAM,CAAC,OAAO,WAAW,EAAE,CAAC;IAC1B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,UAAU,IAAI,UAAU,EAAE,KAAK,cAAc,IAAI,cAAc,EAAE,CAAC;IAE1F,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC;IAEtB,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
1
+ {"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EACL,UAAU,EACV,+BAA+B,EAC/B,iCAAiC,EACjC,WAAW,EACZ;OACM,KAAK,UAAU;OACf,EACL,qBAAqB,EACrB,yBAAyB,EACzB,+BAA+B,EAC/B,OAAO,EACR;AAED,qBAAa,EAAG,SAAQ,WAAW;IACjC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;CACpE;AAKD,MAAM,CAAC,OAAO,WAAW,EAAE,CAAC;IAC1B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
@@ -4,34 +4,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.V1 = void 0;
5
5
  const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
- const MeAPI = tslib_1.__importStar(require("./me.js"));
8
- const me_1 = require("./me.js");
9
- const ConnectionsAPI = tslib_1.__importStar(require("./connections/connections.js"));
10
- const connections_1 = require("./connections/connections.js");
11
- const GitHubAPI = tslib_1.__importStar(require("./github/github.js"));
12
- const github_1 = require("./github/github.js");
13
- const GroupsAPI = tslib_1.__importStar(require("./groups/groups.js"));
14
- const groups_1 = require("./groups/groups.js");
15
- const OrgAPI = tslib_1.__importStar(require("./org/org.js"));
16
- const org_1 = require("./org/org.js");
17
- const TenantsAPI = tslib_1.__importStar(require("./tenants/tenants.js"));
18
- const tenants_1 = require("./tenants/tenants.js");
7
+ const ConnectionsAPI = tslib_1.__importStar(require("./connections.js"));
8
+ const connections_1 = require("./connections.js");
9
+ const TenantsAPI = tslib_1.__importStar(require("./tenants.js"));
10
+ const tenants_1 = require("./tenants.js");
19
11
  class V1 extends resource_1.APIResource {
20
12
  constructor() {
21
13
  super(...arguments);
22
14
  this.connections = new ConnectionsAPI.Connections(this._client);
23
- this.github = new GitHubAPI.GitHub(this._client);
24
- this.groups = new GroupsAPI.Groups(this._client);
25
- this.me = new MeAPI.Me(this._client);
26
- this.org = new OrgAPI.Org(this._client);
27
15
  this.tenants = new TenantsAPI.Tenants(this._client);
28
16
  }
29
17
  }
30
18
  exports.V1 = V1;
31
19
  V1.Connections = connections_1.Connections;
32
- V1.GitHub = github_1.GitHub;
33
- V1.Groups = groups_1.Groups;
34
- V1.Me = me_1.Me;
35
- V1.Org = org_1.Org;
36
20
  V1.Tenants = tenants_1.Tenants;
37
21
  //# sourceMappingURL=v1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"v1.js","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,uDAA8B;AAC9B,gCAAsD;AACtD,qFAA4D;AAC5D,8DASmC;AACnC,sEAA6C;AAC7C,+CAQyB;AACzB,sEAA6C;AAC7C,+CAMyB;AACzB,6DAAoC;AACpC,sCAAgC;AAChC,yEAAgD;AAChD,kDAO2B;AAE3B,MAAa,EAAG,SAAQ,sBAAW;IAAnC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,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;QAC9D,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAPD,gBAOC;AAED,EAAE,CAAC,WAAW,GAAG,yBAAW,CAAC;AAC7B,EAAE,CAAC,MAAM,GAAG,eAAM,CAAC;AACnB,EAAE,CAAC,MAAM,GAAG,eAAM,CAAC;AACnB,EAAE,CAAC,EAAE,GAAG,OAAE,CAAC;AACX,EAAE,CAAC,GAAG,GAAG,SAAG,CAAC;AACb,EAAE,CAAC,OAAO,GAAG,iBAAO,CAAC"}
1
+ {"version":3,"file":"v1.js","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,kDAKuB;AACvB,iEAAwC;AACxC,0CAKmB;AAEnB,MAAa,EAAG,SAAQ,sBAAW;IAAnC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAHD,gBAGC;AAED,EAAE,CAAC,WAAW,GAAG,yBAAW,CAAC;AAC7B,EAAE,CAAC,OAAO,GAAG,iBAAO,CAAC"}
@@ -1,32 +1,16 @@
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 MeAPI from "./me.mjs";
4
- import { Me } from "./me.mjs";
5
- import * as ConnectionsAPI from "./connections/connections.mjs";
6
- import { Connections, } from "./connections/connections.mjs";
7
- import * as GitHubAPI from "./github/github.mjs";
8
- import { GitHub, } from "./github/github.mjs";
9
- import * as GroupsAPI from "./groups/groups.mjs";
10
- import { Groups, } from "./groups/groups.mjs";
11
- import * as OrgAPI from "./org/org.mjs";
12
- import { Org } from "./org/org.mjs";
13
- import * as TenantsAPI from "./tenants/tenants.mjs";
14
- import { Tenants, } from "./tenants/tenants.mjs";
3
+ import * as ConnectionsAPI from "./connections.mjs";
4
+ import { Connections, } from "./connections.mjs";
5
+ import * as TenantsAPI from "./tenants.mjs";
6
+ import { Tenants, } from "./tenants.mjs";
15
7
  export class V1 extends APIResource {
16
8
  constructor() {
17
9
  super(...arguments);
18
10
  this.connections = new ConnectionsAPI.Connections(this._client);
19
- this.github = new GitHubAPI.GitHub(this._client);
20
- this.groups = new GroupsAPI.Groups(this._client);
21
- this.me = new MeAPI.Me(this._client);
22
- this.org = new OrgAPI.Org(this._client);
23
11
  this.tenants = new TenantsAPI.Tenants(this._client);
24
12
  }
25
13
  }
26
14
  V1.Connections = Connections;
27
- V1.GitHub = GitHub;
28
- V1.Groups = Groups;
29
- V1.Me = Me;
30
- V1.Org = Org;
31
15
  V1.Tenants = Tenants;
32
16
  //# sourceMappingURL=v1.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAA8B,EAAE,EAAE;OAClC,KAAK,cAAc;OACnB,EAOL,WAAW,GAEZ;OACM,KAAK,SAAS;OACd,EACL,MAAM,GAOP;OACM,KAAK,SAAS;OACd,EAKL,MAAM,GACP;OACM,KAAK,MAAM;OACX,EAAE,GAAG,EAAE;OACP,KAAK,UAAU;OACf,EAML,OAAO,GACR;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,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;QAC9D,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAED,EAAE,CAAC,WAAW,GAAG,WAAW,CAAC;AAC7B,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;AACnB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;AACnB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AACX,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;AACb,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAIL,WAAW,GACZ;OACM,KAAK,UAAU;OACf,EAIL,OAAO,GACR;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAED,EAAE,CAAC,WAAW,GAAG,WAAW,CAAC;AAC7B,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC"}
package/src/client.ts CHANGED
@@ -16,8 +16,6 @@ import * as Errors from './core/error';
16
16
  import * as Uploads from './core/uploads';
17
17
  import * as API from './resources/index';
18
18
  import { APIPromise } from './core/api-promise';
19
- import { Healthz, HealthzCheckResponse } from './resources/healthz';
20
- import { Readyz, ReadyzCheckResponse } from './resources/readyz';
21
19
  import { V1 } from './resources/v1/v1';
22
20
  import { type Fetch } from './internal/builtin-types';
23
21
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
@@ -34,14 +32,14 @@ import { isEmptyObj } from './internal/utils/values';
34
32
 
35
33
  export interface ClientOptions {
36
34
  /**
37
- * API key for programmatic access. Format: kat_live_{key_id}_{secret}
35
+ * Defaults to process.env['KATER_API_KEY'].
38
36
  */
39
37
  apiKey?: string | null | undefined;
40
38
 
41
39
  /**
42
- * Propel Auth bearer token for internal CLI access
40
+ * Defaults to process.env['KATER_AUTH_TOKEN'].
43
41
  */
44
- bearerToken?: string | null | undefined;
42
+ authToken?: string | null | undefined;
45
43
 
46
44
  /**
47
45
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
@@ -117,7 +115,7 @@ export interface ClientOptions {
117
115
  */
118
116
  export class Kater {
119
117
  apiKey: string | null;
120
- bearerToken: string | null;
118
+ authToken: string | null;
121
119
 
122
120
  baseURL: string;
123
121
  maxRetries: number;
@@ -135,8 +133,8 @@ export class Kater {
135
133
  * API Client for interfacing with the Kater API.
136
134
  *
137
135
  * @param {string | null | undefined} [opts.apiKey=process.env['KATER_API_KEY'] ?? null]
138
- * @param {string | null | undefined} [opts.bearerToken=process.env['KATER_AUTH_TOKEN'] ?? null]
139
- * @param {string} [opts.baseURL=process.env['KATER_BASE_URL'] ?? https://api.example.com] - Override the default base URL for the API.
136
+ * @param {string | null | undefined} [opts.authToken=process.env['KATER_AUTH_TOKEN'] ?? null]
137
+ * @param {string} [opts.baseURL=process.env['KATER_BASE_URL'] ?? https://api.kater.ai] - Override the default base URL for the API.
140
138
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
141
139
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
142
140
  * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -147,14 +145,14 @@ export class Kater {
147
145
  constructor({
148
146
  baseURL = readEnv('KATER_BASE_URL'),
149
147
  apiKey = readEnv('KATER_API_KEY') ?? null,
150
- bearerToken = readEnv('KATER_AUTH_TOKEN') ?? null,
148
+ authToken = readEnv('KATER_AUTH_TOKEN') ?? null,
151
149
  ...opts
152
150
  }: ClientOptions = {}) {
153
151
  const options: ClientOptions = {
154
152
  apiKey,
155
- bearerToken,
153
+ authToken,
156
154
  ...opts,
157
- baseURL: baseURL || `https://api.example.com`,
155
+ baseURL: baseURL || `https://api.kater.ai`,
158
156
  };
159
157
 
160
158
  this.baseURL = options.baseURL!;
@@ -175,7 +173,7 @@ export class Kater {
175
173
  this._options = options;
176
174
 
177
175
  this.apiKey = apiKey;
178
- this.bearerToken = bearerToken;
176
+ this.authToken = authToken;
179
177
  }
180
178
 
181
179
  /**
@@ -192,7 +190,7 @@ export class Kater {
192
190
  fetch: this.fetch,
193
191
  fetchOptions: this.fetchOptions,
194
192
  apiKey: this.apiKey,
195
- bearerToken: this.bearerToken,
193
+ authToken: this.authToken,
196
194
  ...options,
197
195
  });
198
196
  return client;
@@ -202,7 +200,7 @@ export class Kater {
202
200
  * Check whether the base URL is set to its default.
203
201
  */
204
202
  #baseURLOverridden(): boolean {
205
- return this.baseURL !== 'https://api.example.com';
203
+ return this.baseURL !== 'https://api.kater.ai';
206
204
  }
207
205
 
208
206
  protected defaultQuery(): Record<string, string | undefined> | undefined {
@@ -210,7 +208,41 @@ export class Kater {
210
208
  }
211
209
 
212
210
  protected validateHeaders({ values, nulls }: NullableHeaders) {
213
- return;
211
+ if (this.apiKey && values.get('x-api-key')) {
212
+ return;
213
+ }
214
+ if (nulls.has('x-api-key')) {
215
+ return;
216
+ }
217
+
218
+ if (this.authToken && values.get('authorization')) {
219
+ return;
220
+ }
221
+ if (nulls.has('authorization')) {
222
+ return;
223
+ }
224
+
225
+ throw new Error(
226
+ 'Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-API-Key" or "Authorization" headers to be explicitly omitted',
227
+ );
228
+ }
229
+
230
+ protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
231
+ return buildHeaders([await this.apiKeyAuth(opts), await this.propelAuth(opts)]);
232
+ }
233
+
234
+ protected async apiKeyAuth(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
235
+ if (this.apiKey == null) {
236
+ return undefined;
237
+ }
238
+ return buildHeaders([{ 'X-API-Key': this.apiKey }]);
239
+ }
240
+
241
+ protected async propelAuth(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
242
+ if (this.authToken == null) {
243
+ return undefined;
244
+ }
245
+ return buildHeaders([{ Authorization: `Bearer ${this.authToken}` }]);
214
246
  }
215
247
 
216
248
  /**
@@ -492,9 +524,10 @@ export class Kater {
492
524
  controller: AbortController,
493
525
  ): Promise<Response> {
494
526
  const { signal, method, ...options } = init || {};
495
- if (signal) signal.addEventListener('abort', () => controller.abort());
527
+ const abort = this._makeAbort(controller);
528
+ if (signal) signal.addEventListener('abort', abort, { once: true });
496
529
 
497
- const timeout = setTimeout(() => controller.abort(), ms);
530
+ const timeout = setTimeout(abort, ms);
498
531
 
499
532
  const isReadableBody =
500
533
  ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
@@ -650,6 +683,7 @@ export class Kater {
650
683
  ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
651
684
  ...getPlatformHeaders(),
652
685
  },
686
+ await this.authHeaders(options),
653
687
  this._options.defaultHeaders,
654
688
  bodyHeaders,
655
689
  options.headers,
@@ -660,6 +694,12 @@ export class Kater {
660
694
  return headers.values;
661
695
  }
662
696
 
697
+ private _makeAbort(controller: AbortController) {
698
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
699
+ // would capture all request options, and cause a memory leak.
700
+ return () => controller.abort();
701
+ }
702
+
663
703
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
664
704
  bodyHeaders: HeadersLike;
665
705
  body: BodyInit | undefined;
@@ -717,20 +757,12 @@ export class Kater {
717
757
  static toFile = Uploads.toFile;
718
758
 
719
759
  v1: API.V1 = new API.V1(this);
720
- healthz: API.Healthz = new API.Healthz(this);
721
- readyz: API.Readyz = new API.Readyz(this);
722
760
  }
723
761
 
724
762
  Kater.V1 = V1;
725
- Kater.Healthz = Healthz;
726
- Kater.Readyz = Readyz;
727
763
 
728
764
  export declare namespace Kater {
729
765
  export type RequestOptions = Opts.RequestOptions;
730
766
 
731
767
  export { V1 as V1 };
732
-
733
- export { Healthz as Healthz, type HealthzCheckResponse as HealthzCheckResponse };
734
-
735
- export { Readyz as Readyz, type ReadyzCheckResponse as ReadyzCheckResponse };
736
768
  }
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Kater, props: APIResponseP
29
29
  const mediaType = contentType?.split(';')[0]?.trim();
30
30
  const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
31
31
  if (isJSON) {
32
+ const contentLength = response.headers.get('content-length');
33
+ if (contentLength === '0') {
34
+ // if there is no content we can't do anything
35
+ return undefined as T;
36
+ }
37
+
32
38
  const json = await response.json();
33
39
  return json as T;
34
40
  }
@@ -106,6 +106,7 @@ export const formatRequestDetails = (details: {
106
106
  ([name, value]) => [
107
107
  name,
108
108
  (
109
+ name.toLowerCase() === 'x-api-key' ||
109
110
  name.toLowerCase() === 'authorization' ||
110
111
  name.toLowerCase() === 'cookie' ||
111
112
  name.toLowerCase() === 'set-cookie'
@@ -1,5 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Healthz, type HealthzCheckResponse } from './healthz';
4
- export { Readyz, type ReadyzCheckResponse } from './readyz';
5
3
  export { V1 } from './v1/v1';