@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,205 +0,0 @@
1
- import { APIResource } from "../../../core/resource.mjs";
2
- import * as BatchAPI from "./batch.mjs";
3
- import { Batch, BatchCreateParams, BatchCreateResponse, BatchDeleteParams, BatchDeleteResponse, BatchTenantError, BatchTenantSuccess, BatchUpdateParams, BatchUpdateResponse } from "./batch.mjs";
4
- import * as ImportAPI from "./import.mjs";
5
- import { Import, ImportFromCsvParams, ImportFromWarehouseParams, ImportTenants } from "./import.mjs";
6
- import { APIPromise } from "../../../core/api-promise.mjs";
7
- import { RequestOptions } from "../../../internal/request-options.mjs";
8
- export declare class Tenants extends APIResource {
9
- batch: BatchAPI.Batch;
10
- import: ImportAPI.Import;
11
- /**
12
- * Create a new tenant.
13
- *
14
- * Validates the client's tenancy type and creates the tenant accordingly:
15
- *
16
- * - ROW tenancy: Creates tenant with optional group associations
17
- * - DATABASE tenancy: Requires database_name, creates tenant with database
18
- * association
19
- * - NONE tenancy: Returns error (tenant creation not allowed)
20
- *
21
- * RLS: Filtered to current client (ClientRLSDB).
22
- */
23
- create(body: TenantCreateParams, options?: RequestOptions): APIPromise<Tenant>;
24
- /**
25
- * Get a single tenant by ID.
26
- *
27
- * Returns the tenant with associated groups and databases.
28
- *
29
- * RLS: Filtered to current client (ClientRLSDB).
30
- *
31
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
32
- */
33
- retrieve(tenantID: string, options?: RequestOptions): APIPromise<Tenant>;
34
- /**
35
- * Update a tenant.
36
- *
37
- * Updates tenant metadata, group associations, and/or database associations. Group
38
- * associations use replace semantics:
39
- *
40
- * - Omit group_names to leave existing associations unchanged
41
- * - Pass empty list to remove all group associations
42
- * - Pass list of names to replace all associations
43
- *
44
- * Database associations (DATABASE tenancy only):
45
- *
46
- * - Both connection_id and database_name must be provided together
47
- * - Replaces existing database association
48
- *
49
- * RLS: Filtered to current client (ClientRLSDB).
50
- *
51
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
52
- */
53
- update(tenantID: string, body: TenantUpdateParams, options?: RequestOptions): APIPromise<Tenant>;
54
- /**
55
- * List all tenants for the client.
56
- *
57
- * Returns tenants with their associated groups and databases.
58
- *
59
- * RLS: Filtered to current client (ClientRLSDB).
60
- */
61
- list(options?: RequestOptions): APIPromise<TenantListResponse>;
62
- /**
63
- * Delete a tenant.
64
- *
65
- * Soft-deletes the tenant and its group/database associations.
66
- *
67
- * RLS: Filtered to current client (ClientRLSDB).
68
- *
69
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
70
- */
71
- delete(tenantID: string, options?: RequestOptions): APIPromise<void>;
72
- }
73
- /**
74
- * Request model for creating a single tenant.
75
- */
76
- export interface CreateTenant {
77
- /**
78
- * Unique tenant identifier within the client
79
- */
80
- tenant_key: string;
81
- /**
82
- * Connection ID (required for DATABASE tenancy type)
83
- */
84
- connection_id?: string | null;
85
- /**
86
- * Database name (required for DATABASE tenancy type)
87
- */
88
- database_name?: string | null;
89
- /**
90
- * List of group names to associate with the tenant
91
- */
92
- group_names?: Array<string> | null;
93
- /**
94
- * Human-readable tenant name
95
- */
96
- tenant_name?: string | null;
97
- }
98
- /**
99
- * Response model for a single tenant.
100
- */
101
- export interface Tenant {
102
- /**
103
- * Tenant ID
104
- */
105
- id: string;
106
- /**
107
- * Creation timestamp
108
- */
109
- created_at: string;
110
- /**
111
- * Associated databases
112
- */
113
- databases: Array<Tenant.Database>;
114
- /**
115
- * Associated groups
116
- */
117
- groups: Array<Tenant.Group>;
118
- /**
119
- * Human-readable tenant name
120
- */
121
- name: string | null;
122
- /**
123
- * Unique tenant identifier
124
- */
125
- tenant_key: string;
126
- /**
127
- * Last update timestamp
128
- */
129
- updated_at: string;
130
- }
131
- export declare namespace Tenant {
132
- /**
133
- * Database information in tenant responses.
134
- */
135
- interface Database {
136
- /**
137
- * Database ID
138
- */
139
- id: string;
140
- /**
141
- * Database name
142
- */
143
- name: string;
144
- }
145
- /**
146
- * Group information in tenant responses.
147
- */
148
- interface Group {
149
- /**
150
- * Group ID
151
- */
152
- id: string;
153
- /**
154
- * Group name
155
- */
156
- name: string;
157
- }
158
- }
159
- export type TenantListResponse = Array<Tenant>;
160
- export interface TenantCreateParams {
161
- /**
162
- * Unique tenant identifier within the client
163
- */
164
- tenant_key: string;
165
- /**
166
- * Connection ID (required for DATABASE tenancy type)
167
- */
168
- connection_id?: string | null;
169
- /**
170
- * Database name (required for DATABASE tenancy type)
171
- */
172
- database_name?: string | null;
173
- /**
174
- * List of group names to associate with the tenant
175
- */
176
- group_names?: Array<string> | null;
177
- /**
178
- * Human-readable tenant name
179
- */
180
- tenant_name?: string | null;
181
- }
182
- export interface TenantUpdateParams {
183
- /**
184
- * Connection ID for database association (required with database_name)
185
- */
186
- connection_id?: string | null;
187
- /**
188
- * Database name for association (required with connection_id)
189
- */
190
- database_name?: string | null;
191
- /**
192
- * New list of group names (replaces all existing associations)
193
- */
194
- group_names?: Array<string> | null;
195
- /**
196
- * New human-readable tenant name
197
- */
198
- tenant_name?: string | null;
199
- }
200
- export declare namespace Tenants {
201
- export { type CreateTenant as CreateTenant, type Tenant as Tenant, type TenantListResponse as TenantListResponse, type TenantCreateParams as TenantCreateParams, type TenantUpdateParams as TenantUpdateParams, };
202
- 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, };
203
- export { Import as Import, type ImportTenants as ImportTenants, type ImportFromCsvParams as ImportFromCsvParams, type ImportFromWarehouseParams as ImportFromWarehouseParams, };
204
- }
205
- //# sourceMappingURL=tenants.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenants.d.mts","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,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;IAE9D;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIxE;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIhG;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE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AEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -1,205 +0,0 @@
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
- import * as ImportAPI from "./import.js";
5
- import { Import, ImportFromCsvParams, ImportFromWarehouseParams, ImportTenants } from "./import.js";
6
- import { APIPromise } from "../../../core/api-promise.js";
7
- import { RequestOptions } from "../../../internal/request-options.js";
8
- export declare class Tenants extends APIResource {
9
- batch: BatchAPI.Batch;
10
- import: ImportAPI.Import;
11
- /**
12
- * Create a new tenant.
13
- *
14
- * Validates the client's tenancy type and creates the tenant accordingly:
15
- *
16
- * - ROW tenancy: Creates tenant with optional group associations
17
- * - DATABASE tenancy: Requires database_name, creates tenant with database
18
- * association
19
- * - NONE tenancy: Returns error (tenant creation not allowed)
20
- *
21
- * RLS: Filtered to current client (ClientRLSDB).
22
- */
23
- create(body: TenantCreateParams, options?: RequestOptions): APIPromise<Tenant>;
24
- /**
25
- * Get a single tenant by ID.
26
- *
27
- * Returns the tenant with associated groups and databases.
28
- *
29
- * RLS: Filtered to current client (ClientRLSDB).
30
- *
31
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
32
- */
33
- retrieve(tenantID: string, options?: RequestOptions): APIPromise<Tenant>;
34
- /**
35
- * Update a tenant.
36
- *
37
- * Updates tenant metadata, group associations, and/or database associations. Group
38
- * associations use replace semantics:
39
- *
40
- * - Omit group_names to leave existing associations unchanged
41
- * - Pass empty list to remove all group associations
42
- * - Pass list of names to replace all associations
43
- *
44
- * Database associations (DATABASE tenancy only):
45
- *
46
- * - Both connection_id and database_name must be provided together
47
- * - Replaces existing database association
48
- *
49
- * RLS: Filtered to current client (ClientRLSDB).
50
- *
51
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
52
- */
53
- update(tenantID: string, body: TenantUpdateParams, options?: RequestOptions): APIPromise<Tenant>;
54
- /**
55
- * List all tenants for the client.
56
- *
57
- * Returns tenants with their associated groups and databases.
58
- *
59
- * RLS: Filtered to current client (ClientRLSDB).
60
- */
61
- list(options?: RequestOptions): APIPromise<TenantListResponse>;
62
- /**
63
- * Delete a tenant.
64
- *
65
- * Soft-deletes the tenant and its group/database associations.
66
- *
67
- * RLS: Filtered to current client (ClientRLSDB).
68
- *
69
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
70
- */
71
- delete(tenantID: string, options?: RequestOptions): APIPromise<void>;
72
- }
73
- /**
74
- * Request model for creating a single tenant.
75
- */
76
- export interface CreateTenant {
77
- /**
78
- * Unique tenant identifier within the client
79
- */
80
- tenant_key: string;
81
- /**
82
- * Connection ID (required for DATABASE tenancy type)
83
- */
84
- connection_id?: string | null;
85
- /**
86
- * Database name (required for DATABASE tenancy type)
87
- */
88
- database_name?: string | null;
89
- /**
90
- * List of group names to associate with the tenant
91
- */
92
- group_names?: Array<string> | null;
93
- /**
94
- * Human-readable tenant name
95
- */
96
- tenant_name?: string | null;
97
- }
98
- /**
99
- * Response model for a single tenant.
100
- */
101
- export interface Tenant {
102
- /**
103
- * Tenant ID
104
- */
105
- id: string;
106
- /**
107
- * Creation timestamp
108
- */
109
- created_at: string;
110
- /**
111
- * Associated databases
112
- */
113
- databases: Array<Tenant.Database>;
114
- /**
115
- * Associated groups
116
- */
117
- groups: Array<Tenant.Group>;
118
- /**
119
- * Human-readable tenant name
120
- */
121
- name: string | null;
122
- /**
123
- * Unique tenant identifier
124
- */
125
- tenant_key: string;
126
- /**
127
- * Last update timestamp
128
- */
129
- updated_at: string;
130
- }
131
- export declare namespace Tenant {
132
- /**
133
- * Database information in tenant responses.
134
- */
135
- interface Database {
136
- /**
137
- * Database ID
138
- */
139
- id: string;
140
- /**
141
- * Database name
142
- */
143
- name: string;
144
- }
145
- /**
146
- * Group information in tenant responses.
147
- */
148
- interface Group {
149
- /**
150
- * Group ID
151
- */
152
- id: string;
153
- /**
154
- * Group name
155
- */
156
- name: string;
157
- }
158
- }
159
- export type TenantListResponse = Array<Tenant>;
160
- export interface TenantCreateParams {
161
- /**
162
- * Unique tenant identifier within the client
163
- */
164
- tenant_key: string;
165
- /**
166
- * Connection ID (required for DATABASE tenancy type)
167
- */
168
- connection_id?: string | null;
169
- /**
170
- * Database name (required for DATABASE tenancy type)
171
- */
172
- database_name?: string | null;
173
- /**
174
- * List of group names to associate with the tenant
175
- */
176
- group_names?: Array<string> | null;
177
- /**
178
- * Human-readable tenant name
179
- */
180
- tenant_name?: string | null;
181
- }
182
- export interface TenantUpdateParams {
183
- /**
184
- * Connection ID for database association (required with database_name)
185
- */
186
- connection_id?: string | null;
187
- /**
188
- * Database name for association (required with connection_id)
189
- */
190
- database_name?: string | null;
191
- /**
192
- * New list of group names (replaces all existing associations)
193
- */
194
- group_names?: Array<string> | null;
195
- /**
196
- * New human-readable tenant name
197
- */
198
- tenant_name?: string | null;
199
- }
200
- export declare namespace Tenants {
201
- export { type CreateTenant as CreateTenant, type Tenant as Tenant, type TenantListResponse as TenantListResponse, type TenantCreateParams as TenantCreateParams, type TenantUpdateParams as TenantUpdateParams, };
202
- 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, };
203
- export { Import as Import, type ImportTenants as ImportTenants, type ImportFromCsvParams as ImportFromCsvParams, type ImportFromWarehouseParams as ImportFromWarehouseParams, };
204
- }
205
- //# sourceMappingURL=tenants.d.ts.map
@@ -1 +0,0 @@
1
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MAAM,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAKD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,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;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Tenants = void 0;
5
- const tslib_1 = require("../../../internal/tslib.js");
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
- const ImportAPI = tslib_1.__importStar(require("./import.js"));
10
- const import_1 = require("./import.js");
11
- const headers_1 = require("../../../internal/headers.js");
12
- const path_1 = require("../../../internal/utils/path.js");
13
- class Tenants extends resource_1.APIResource {
14
- constructor() {
15
- super(...arguments);
16
- this.batch = new BatchAPI.Batch(this._client);
17
- this.import = new ImportAPI.Import(this._client);
18
- }
19
- /**
20
- * Create a new tenant.
21
- *
22
- * Validates the client's tenancy type and creates the tenant accordingly:
23
- *
24
- * - ROW tenancy: Creates tenant with optional group associations
25
- * - DATABASE tenancy: Requires database_name, creates tenant with database
26
- * association
27
- * - NONE tenancy: Returns error (tenant creation not allowed)
28
- *
29
- * RLS: Filtered to current client (ClientRLSDB).
30
- */
31
- create(body, options) {
32
- return this._client.post('/api/v1/tenants', { body, ...options });
33
- }
34
- /**
35
- * Get a single tenant by ID.
36
- *
37
- * Returns the tenant with associated groups and databases.
38
- *
39
- * RLS: Filtered to current client (ClientRLSDB).
40
- *
41
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
42
- */
43
- retrieve(tenantID, options) {
44
- return this._client.get((0, path_1.path) `/api/v1/tenants/${tenantID}`, options);
45
- }
46
- /**
47
- * Update a tenant.
48
- *
49
- * Updates tenant metadata, group associations, and/or database associations. Group
50
- * associations use replace semantics:
51
- *
52
- * - Omit group_names to leave existing associations unchanged
53
- * - Pass empty list to remove all group associations
54
- * - Pass list of names to replace all associations
55
- *
56
- * Database associations (DATABASE tenancy only):
57
- *
58
- * - Both connection_id and database_name must be provided together
59
- * - Replaces existing database association
60
- *
61
- * RLS: Filtered to current client (ClientRLSDB).
62
- *
63
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
64
- */
65
- update(tenantID, body, options) {
66
- return this._client.patch((0, path_1.path) `/api/v1/tenants/${tenantID}`, { body, ...options });
67
- }
68
- /**
69
- * List all tenants for the client.
70
- *
71
- * Returns tenants with their associated groups and databases.
72
- *
73
- * RLS: Filtered to current client (ClientRLSDB).
74
- */
75
- list(options) {
76
- return this._client.get('/api/v1/tenants', options);
77
- }
78
- /**
79
- * Delete a tenant.
80
- *
81
- * Soft-deletes the tenant and its group/database associations.
82
- *
83
- * RLS: Filtered to current client (ClientRLSDB).
84
- *
85
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
86
- */
87
- delete(tenantID, options) {
88
- return this._client.delete((0, path_1.path) `/api/v1/tenants/${tenantID}`, {
89
- ...options,
90
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
91
- });
92
- }
93
- }
94
- exports.Tenants = Tenants;
95
- Tenants.Batch = batch_1.Batch;
96
- Tenants.Import = import_1.Import;
97
- //# sourceMappingURL=tenants.js.map
@@ -1 +0,0 @@
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,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;IAgFhE,CAAC;IA9EC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,mBAAmB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,mBAAmB,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,mBAAmB,QAAQ,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAlFD,0BAkFC;AA2JD,OAAO,CAAC,KAAK,GAAG,aAAK,CAAC;AACtB,OAAO,CAAC,MAAM,GAAG,eAAM,CAAC"}
@@ -1,92 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../../core/resource.mjs";
3
- import * as BatchAPI from "./batch.mjs";
4
- import { Batch, } from "./batch.mjs";
5
- import * as ImportAPI from "./import.mjs";
6
- import { Import } from "./import.mjs";
7
- import { buildHeaders } from "../../../internal/headers.mjs";
8
- import { path } from "../../../internal/utils/path.mjs";
9
- export class Tenants extends APIResource {
10
- constructor() {
11
- super(...arguments);
12
- this.batch = new BatchAPI.Batch(this._client);
13
- this.import = new ImportAPI.Import(this._client);
14
- }
15
- /**
16
- * Create a new tenant.
17
- *
18
- * Validates the client's tenancy type and creates the tenant accordingly:
19
- *
20
- * - ROW tenancy: Creates tenant with optional group associations
21
- * - DATABASE tenancy: Requires database_name, creates tenant with database
22
- * association
23
- * - NONE tenancy: Returns error (tenant creation not allowed)
24
- *
25
- * RLS: Filtered to current client (ClientRLSDB).
26
- */
27
- create(body, options) {
28
- return this._client.post('/api/v1/tenants', { body, ...options });
29
- }
30
- /**
31
- * Get a single tenant by ID.
32
- *
33
- * Returns the tenant with associated groups and databases.
34
- *
35
- * RLS: Filtered to current client (ClientRLSDB).
36
- *
37
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
38
- */
39
- retrieve(tenantID, options) {
40
- return this._client.get(path `/api/v1/tenants/${tenantID}`, options);
41
- }
42
- /**
43
- * Update a tenant.
44
- *
45
- * Updates tenant metadata, group associations, and/or database associations. Group
46
- * associations use replace semantics:
47
- *
48
- * - Omit group_names to leave existing associations unchanged
49
- * - Pass empty list to remove all group associations
50
- * - Pass list of names to replace all associations
51
- *
52
- * Database associations (DATABASE tenancy only):
53
- *
54
- * - Both connection_id and database_name must be provided together
55
- * - Replaces existing database association
56
- *
57
- * RLS: Filtered to current client (ClientRLSDB).
58
- *
59
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
60
- */
61
- update(tenantID, body, options) {
62
- return this._client.patch(path `/api/v1/tenants/${tenantID}`, { body, ...options });
63
- }
64
- /**
65
- * List all tenants for the client.
66
- *
67
- * Returns tenants with their associated groups and databases.
68
- *
69
- * RLS: Filtered to current client (ClientRLSDB).
70
- */
71
- list(options) {
72
- return this._client.get('/api/v1/tenants', options);
73
- }
74
- /**
75
- * Delete a tenant.
76
- *
77
- * Soft-deletes the tenant and its group/database associations.
78
- *
79
- * RLS: Filtered to current client (ClientRLSDB).
80
- *
81
- * Raises: TenantNotFoundError: If tenant doesn't exist (404)
82
- */
83
- delete(tenantID, options) {
84
- return this._client.delete(path `/api/v1/tenants/${tenantID}`, {
85
- ...options,
86
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
87
- });
88
- }
89
- }
90
- Tenants.Batch = Batch;
91
- Tenants.Import = Import;
92
- //# sourceMappingURL=tenants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EACL,KAAK,GASN;OACM,KAAK,SAAS;OACd,EAAE,MAAM,EAAiE;OAEzE,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;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;IAgFhE,CAAC;IA9EC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,mBAAmB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,mBAAmB,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,mBAAmB,QAAQ,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA2JD,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;AACtB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -1,20 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { RequestOptions } from '../internal/request-options';
6
-
7
- export class Healthz extends APIResource {
8
- /**
9
- * Returns 200 if the service is alive. Used by Kubernetes liveness probe.
10
- */
11
- check(options?: RequestOptions): APIPromise<HealthzCheckResponse> {
12
- return this._client.get('/healthz', options);
13
- }
14
- }
15
-
16
- export type HealthzCheckResponse = { [key: string]: string };
17
-
18
- export declare namespace Healthz {
19
- export { type HealthzCheckResponse as HealthzCheckResponse };
20
- }
@@ -1,20 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { RequestOptions } from '../internal/request-options';
6
-
7
- export class Readyz extends APIResource {
8
- /**
9
- * Returns 200 if the service is ready to accept traffic.
10
- */
11
- check(options?: RequestOptions): APIPromise<ReadyzCheckResponse> {
12
- return this._client.get('/readyz', options);
13
- }
14
- }
15
-
16
- export type ReadyzCheckResponse = { [key: string]: unknown };
17
-
18
- export declare namespace Readyz {
19
- export { type ReadyzCheckResponse as ReadyzCheckResponse };
20
- }