@distilled.cloud/clickhouse-cloud 0.0.0-stage → 1.0.0-rc.21

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 (183) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +138 -2
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +34 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +58 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +49 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +10 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +35 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/api_keys.d.ts +175 -0
  26. package/lib/services/api_keys.d.ts.map +1 -0
  27. package/lib/services/api_keys.js +2 -0
  28. package/lib/services/api_keys.js.map +1 -0
  29. package/lib/services/backup.d.ts +117 -0
  30. package/lib/services/backup.d.ts.map +1 -0
  31. package/lib/services/backup.js +2 -0
  32. package/lib/services/backup.js.map +1 -0
  33. package/lib/services/billing.d.ts +69 -0
  34. package/lib/services/billing.d.ts.map +1 -0
  35. package/lib/services/billing.js +2 -0
  36. package/lib/services/billing.js.map +1 -0
  37. package/lib/services/click_pipes.d.ts +1637 -0
  38. package/lib/services/click_pipes.d.ts.map +1 -0
  39. package/lib/services/click_pipes.js +31 -0
  40. package/lib/services/click_pipes.js.map +1 -0
  41. package/lib/services/index.d.ts +14 -0
  42. package/lib/services/index.d.ts.map +1 -0
  43. package/lib/services/index.js +13 -0
  44. package/lib/services/organization.d.ts +336 -0
  45. package/lib/services/organization.d.ts.map +1 -0
  46. package/lib/services/organization.js +2 -0
  47. package/lib/services/organization.js.map +1 -0
  48. package/lib/services/postgres.d.ts +726 -0
  49. package/lib/services/postgres.d.ts.map +1 -0
  50. package/lib/services/postgres.js +31 -0
  51. package/lib/services/postgres.js.map +1 -0
  52. package/lib/services/prometheus.d.ts +71 -0
  53. package/lib/services/prometheus.d.ts.map +1 -0
  54. package/lib/services/prometheus.js +2 -0
  55. package/lib/services/prometheus.js.map +1 -0
  56. package/lib/services/query_api_endpoints.d.ts +189 -0
  57. package/lib/services/query_api_endpoints.d.ts.map +1 -0
  58. package/lib/services/query_api_endpoints.js +2 -0
  59. package/lib/services/query_api_endpoints.js.map +1 -0
  60. package/lib/services/role_management.d.ts +159 -0
  61. package/lib/services/role_management.d.ts.map +1 -0
  62. package/lib/services/role_management.js +2 -0
  63. package/lib/services/role_management.js.map +1 -0
  64. package/lib/services/saved_queries.d.ts +129 -0
  65. package/lib/services/saved_queries.d.ts.map +1 -0
  66. package/lib/services/saved_queries.js +2 -0
  67. package/lib/services/saved_queries.js.map +1 -0
  68. package/lib/services/service.d.ts +886 -0
  69. package/lib/services/service.d.ts.map +1 -0
  70. package/lib/services/service.js +41 -0
  71. package/lib/services/service.js.map +1 -0
  72. package/lib/services/udf.d.ts +373 -0
  73. package/lib/services/udf.d.ts.map +1 -0
  74. package/lib/services/udf.js +24 -0
  75. package/lib/services/udf.js.map +1 -0
  76. package/lib/services/user_management.d.ts +150 -0
  77. package/lib/services/user_management.d.ts.map +1 -0
  78. package/lib/services/user_management.js +2 -0
  79. package/lib/services/user_management.js.map +1 -0
  80. package/lib/services.lazy/api_keys.js +1 -0
  81. package/lib/services.lazy/backup.js +1 -0
  82. package/lib/services.lazy/billing.js +1 -0
  83. package/lib/services.lazy/click_pipes.js +3 -0
  84. package/lib/services.lazy/index.js +3 -0
  85. package/lib/services.lazy/organization.js +1 -0
  86. package/lib/services.lazy/postgres.js +4 -0
  87. package/lib/services.lazy/prometheus.js +1 -0
  88. package/lib/services.lazy/query_api_endpoints.js +1 -0
  89. package/lib/services.lazy/role_management.js +1 -0
  90. package/lib/services.lazy/saved_queries.js +1 -0
  91. package/lib/services.lazy/service.js +4 -0
  92. package/lib/services.lazy/udf.js +3 -0
  93. package/lib/services.lazy/user_management.js +1 -0
  94. package/lib/traits.d.ts +11 -0
  95. package/lib/traits.d.ts.map +1 -0
  96. package/lib/traits.js +1 -0
  97. package/lib/unstable-services/backup.d.ts +165 -0
  98. package/lib/unstable-services/backup.d.ts.map +1 -0
  99. package/lib/unstable-services/backup.js +2 -0
  100. package/lib/unstable-services/backup.js.map +1 -0
  101. package/lib/unstable-services/billing.d.ts +84 -0
  102. package/lib/unstable-services/billing.d.ts.map +1 -0
  103. package/lib/unstable-services/billing.js +2 -0
  104. package/lib/unstable-services/billing.js.map +1 -0
  105. package/lib/unstable-services/click_pipes.d.ts +324 -0
  106. package/lib/unstable-services/click_pipes.d.ts.map +1 -0
  107. package/lib/unstable-services/click_pipes.js +2 -0
  108. package/lib/unstable-services/click_pipes.js.map +1 -0
  109. package/lib/unstable-services/click_stack.d.ts +3538 -0
  110. package/lib/unstable-services/click_stack.d.ts.map +1 -0
  111. package/lib/unstable-services/click_stack.js +60 -0
  112. package/lib/unstable-services/click_stack.js.map +1 -0
  113. package/lib/unstable-services/index.d.ts +11 -0
  114. package/lib/unstable-services/index.d.ts.map +1 -0
  115. package/lib/unstable-services/index.js +10 -0
  116. package/lib/unstable-services/notifications.d.ts +166 -0
  117. package/lib/unstable-services/notifications.d.ts.map +1 -0
  118. package/lib/unstable-services/notifications.js +2 -0
  119. package/lib/unstable-services/notifications.js.map +1 -0
  120. package/lib/unstable-services/organization.d.ts +403 -0
  121. package/lib/unstable-services/organization.d.ts.map +1 -0
  122. package/lib/unstable-services/organization.js +26 -0
  123. package/lib/unstable-services/organization.js.map +1 -0
  124. package/lib/unstable-services/postgres.d.ts +415 -0
  125. package/lib/unstable-services/postgres.d.ts.map +1 -0
  126. package/lib/unstable-services/postgres.js +2 -0
  127. package/lib/unstable-services/postgres.js.map +1 -0
  128. package/lib/unstable-services/service.d.ts +244 -0
  129. package/lib/unstable-services/service.d.ts.map +1 -0
  130. package/lib/unstable-services/service.js +2 -0
  131. package/lib/unstable-services/service.js.map +1 -0
  132. package/lib/unstable-services/snapshot.d.ts +146 -0
  133. package/lib/unstable-services/snapshot.d.ts.map +1 -0
  134. package/lib/unstable-services/snapshot.js +2 -0
  135. package/lib/unstable-services/snapshot.js.map +1 -0
  136. package/lib/unstable-services/user_management.d.ts +41 -0
  137. package/lib/unstable-services/user_management.d.ts.map +1 -0
  138. package/lib/unstable-services/user_management.js +2 -0
  139. package/lib/unstable-services/user_management.js.map +1 -0
  140. package/lib/unstable-services.lazy/backup.js +1 -0
  141. package/lib/unstable-services.lazy/billing.js +1 -0
  142. package/lib/unstable-services.lazy/click_pipes.js +1 -0
  143. package/lib/unstable-services.lazy/click_stack.js +4 -0
  144. package/lib/unstable-services.lazy/index.js +3 -0
  145. package/lib/unstable-services.lazy/notifications.js +1 -0
  146. package/lib/unstable-services.lazy/organization.js +4 -0
  147. package/lib/unstable-services.lazy/postgres.js +1 -0
  148. package/lib/unstable-services.lazy/service.js +1 -0
  149. package/lib/unstable-services.lazy/snapshot.js +1 -0
  150. package/lib/unstable-services.lazy/user_management.js +1 -0
  151. package/package.json +94 -3
  152. package/src/credentials.ts +88 -0
  153. package/src/errors.ts +76 -0
  154. package/src/index.ts +53 -0
  155. package/src/pagination.ts +9 -0
  156. package/src/protocol.ts +76 -0
  157. package/src/retry.ts +53 -0
  158. package/src/services/api_keys.ts +466 -0
  159. package/src/services/backup.ts +347 -0
  160. package/src/services/billing.ts +170 -0
  161. package/src/services/click_pipes.ts +3483 -0
  162. package/src/services/index.ts +14 -0
  163. package/src/services/organization.ts +901 -0
  164. package/src/services/postgres.ts +1967 -0
  165. package/src/services/prometheus.ts +271 -0
  166. package/src/services/query_api_endpoints.ts +466 -0
  167. package/src/services/role_management.ts +436 -0
  168. package/src/services/saved_queries.ts +384 -0
  169. package/src/services/service.ts +2112 -0
  170. package/src/services/udf.ts +1019 -0
  171. package/src/services/user_management.ts +508 -0
  172. package/src/traits.ts +45 -0
  173. package/src/unstable-services/backup.ts +422 -0
  174. package/src/unstable-services/billing.ts +232 -0
  175. package/src/unstable-services/click_pipes.ts +702 -0
  176. package/src/unstable-services/click_stack.ts +7114 -0
  177. package/src/unstable-services/index.ts +11 -0
  178. package/src/unstable-services/notifications.ts +451 -0
  179. package/src/unstable-services/organization.ts +1107 -0
  180. package/src/unstable-services/postgres.ts +1061 -0
  181. package/src/unstable-services/service.ts +795 -0
  182. package/src/unstable-services/snapshot.ts +397 -0
  183. package/src/unstable-services/user_management.ts +127 -0
@@ -0,0 +1,508 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-clickhouse-cloud/specs/openapi.json). Do not edit.
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
5
+ import { ClickHouseCloudServiceErrors } from "../errors.ts";
6
+ import {
7
+ ClickHouseCloudProtocol,
8
+ type ClickHouseCloudOpError,
9
+ type ClickHouseCloudOpContext,
10
+ } from "../protocol.ts";
11
+ import * as Retry from "../retry.ts";
12
+ import * as T from "../traits.ts";
13
+ // Schema table, filled on first reach (see __S at the end).
14
+ const __s: any[] = [];
15
+
16
+ export type { ClickHouseCloudOpError, ClickHouseCloudOpContext };
17
+
18
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
19
+ const TELEMETRY = {
20
+ system: "clickhouse-cloud-api",
21
+ responseHeaders: [
22
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
23
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
24
+ ],
25
+ prefix: "ClickhouseCloud",
26
+ service: "UserManagement",
27
+ labels: "clickhouse_cloud",
28
+ propagate: "w3c",
29
+ } as const;
30
+
31
+ /** DEPRECATED. Use `assignedRoleIds` instead. Role to assign to the invited user in the organization. */
32
+ export type CreateInvitationRequestRole = "admin" | "developer";
33
+ /** List of role IDs to assign to the invited user when they accept the invitation */
34
+ export type CreateInvitationRequestAssignedRoleIdsList = Array<string>;
35
+ export interface CreateInvitationRequest {
36
+ /** ID of the organization to invite a user to. */
37
+ organizationId: string;
38
+ /** Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form. */
39
+ email: string;
40
+ /** DEPRECATED. Use `assignedRoleIds` instead. Role to assign to the invited user in the organization. */
41
+ role?: CreateInvitationRequestRole | (string & {}) | undefined;
42
+ /** List of role IDs to assign to the invited user when they accept the invitation */
43
+ assignedRoleIds?: CreateInvitationRequestAssignedRoleIdsList | undefined;
44
+ }
45
+ /** DEPRECATED. Use `assignedRoles` instead. Role of the invited user in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect the role assignment that will be applied. */
46
+ export type InvitationRole = "admin" | "developer";
47
+ /** Type of role: system (predefined) or custom (organization-defined) */
48
+ export type AssignedRoleRoleType = "system" | "custom";
49
+ export interface AssignedRole {
50
+ /** Unique identifier of the role */
51
+ roleId?: string | undefined;
52
+ /** Human-readable name of the role */
53
+ roleName?: string | undefined;
54
+ /** Type of role: system (predefined) or custom (organization-defined) */
55
+ roleType?: AssignedRoleRoleType | undefined;
56
+ }
57
+ /** Custom roles and System roles that will be assigned to the user when they accept the invitation */
58
+ export type InvitationAssignedRolesList = Array<AssignedRole>;
59
+ export interface Invitation {
60
+ /** DEPRECATED. Use `assignedRoles` instead. Role of the invited user in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect the role assignment that will be applied. */
61
+ role?: InvitationRole | undefined;
62
+ /** Unique invitation ID. */
63
+ id?: string | undefined;
64
+ /** Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form. */
65
+ email?: string | undefined;
66
+ /** Invitation creation timestamp. ISO-8601. */
67
+ createdAt?: string | undefined;
68
+ /** Timestamp the invitation expires. ISO-8601. */
69
+ expireAt?: string | undefined;
70
+ /** Custom roles and System roles that will be assigned to the user when they accept the invitation */
71
+ assignedRoles?: InvitationAssignedRolesList | undefined;
72
+ }
73
+ export interface DeleteInvitationRequest {
74
+ /** ID of the organization that has the invitation. */
75
+ organizationId: string;
76
+ /** ID of the requested organization. */
77
+ invitationId: string;
78
+ }
79
+ export interface DeleteInvitationResponse {
80
+ /** HTTP status code. */
81
+ status?: number | undefined;
82
+ /** Unique id assigned to every request. UUIDv4 */
83
+ requestId?: string | undefined;
84
+ }
85
+ export interface DeleteMemberRequest {
86
+ /** ID of the requested organization. */
87
+ organizationId: string;
88
+ /** ID of the requested user. */
89
+ userId: string;
90
+ }
91
+ export interface DeleteMemberResponse {
92
+ /** HTTP status code. */
93
+ status?: number | undefined;
94
+ /** Unique id assigned to every request. UUIDv4 */
95
+ requestId?: string | undefined;
96
+ }
97
+ export interface GetInvitationRequest {
98
+ /** ID of the requested organization. */
99
+ organizationId: string;
100
+ /** ID of the requested organization. */
101
+ invitationId: string;
102
+ }
103
+ export interface GetMemberRequest {
104
+ /** ID of the organization the member is part of. */
105
+ organizationId: string;
106
+ /** ID of the requested user. */
107
+ userId: string;
108
+ }
109
+ /** DEPRECATED. Use `assignedRoles` instead. Role of the member in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect current role assignments. */
110
+ export type MemberRole = "admin" | "developer";
111
+ /** Custom roles and System roles assigned to this member */
112
+ export type MemberAssignedRolesList = Array<AssignedRole>;
113
+ export interface Member {
114
+ /** Unique user ID. If a user is a member in multiple organizations this ID will stay the same. */
115
+ userId?: string | undefined;
116
+ /** Name of the member as set a personal user profile. */
117
+ name?: string | undefined;
118
+ /** Email of the member as set in personal user profile. */
119
+ email?: string | undefined;
120
+ /** DEPRECATED. Use `assignedRoles` instead. Role of the member in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect current role assignments. */
121
+ role?: MemberRole | undefined;
122
+ /** Timestamp the member joined the organization. ISO-8601. */
123
+ joinedAt?: string | undefined;
124
+ /** Custom roles and System roles assigned to this member */
125
+ assignedRoles?: MemberAssignedRolesList | undefined;
126
+ }
127
+ export interface ListInvitationsRequest {
128
+ /** ID of the requested organization. */
129
+ organizationId: string;
130
+ }
131
+ export type ListInvitationsResponseBodyList = Array<Invitation>;
132
+ export type ListInvitationsResponse = ListInvitationsResponseBodyList;
133
+ export interface ListMembersRequest {
134
+ /** ID of the requested organization. */
135
+ organizationId: string;
136
+ }
137
+ export type ListMembersResponseBodyList = Array<Member>;
138
+ export type ListMembersResponse = ListMembersResponseBodyList;
139
+ /** DEPRECATED. Use `assignedRoleIds` instead. Role of the member in the organization. */
140
+ export type UpdateMemberRequestRole = "admin" | "developer";
141
+ /** List of role IDs to assign to the member */
142
+ export type UpdateMemberRequestAssignedRoleIdsList = Array<string>;
143
+ export interface UpdateMemberRequest {
144
+ /** ID of the organization the member is part of. */
145
+ organizationId: string;
146
+ /** ID of the user to patch */
147
+ userId: string;
148
+ /** DEPRECATED. Use `assignedRoleIds` instead. Role of the member in the organization. */
149
+ role?: UpdateMemberRequestRole | (string & {}) | undefined;
150
+ /** List of role IDs to assign to the member */
151
+ assignedRoleIds?: UpdateMemberRequestAssignedRoleIdsList | undefined;
152
+ }
153
+ export type CreateInvitationError = ClickHouseCloudOpError;
154
+ /** Create an invitation Creates organization invitation. */
155
+ export const createInvitation: API.OperationMethod<
156
+ CreateInvitationRequest,
157
+ Invitation,
158
+ CreateInvitationError,
159
+ ClickHouseCloudOpContext
160
+ > = /*@__PURE__*/ API.make(() => ({
161
+ input: __S(0, __c0, 0) as any as S.Schema<CreateInvitationRequest>,
162
+ output: __S(8, __c2, 0) as any as S.Schema<Invitation>,
163
+ errors: [],
164
+ serviceErrors: ClickHouseCloudServiceErrors,
165
+ protocol: ClickHouseCloudProtocol,
166
+ retry: Retry.Retry,
167
+ telemetry: TELEMETRY,
168
+ span: "CreateInvitation",
169
+ }));
170
+
171
+ export type DeleteInvitationError = ClickHouseCloudOpError;
172
+ /** Delete organization invitation Deletes a single organization invitation. */
173
+ export const deleteInvitation: API.OperationMethod<
174
+ DeleteInvitationRequest,
175
+ DeleteInvitationResponse,
176
+ DeleteInvitationError,
177
+ ClickHouseCloudOpContext
178
+ > = /*@__PURE__*/ API.make(() => ({
179
+ input: __S(16, __c4, 0) as any as S.Schema<DeleteInvitationRequest>,
180
+ output: __S(20, __c5, 0) as any as S.Schema<DeleteInvitationResponse>,
181
+ errors: [],
182
+ serviceErrors: ClickHouseCloudServiceErrors,
183
+ protocol: ClickHouseCloudProtocol,
184
+ retry: Retry.Retry,
185
+ telemetry: TELEMETRY,
186
+ span: "DeleteInvitation",
187
+ }));
188
+
189
+ export type DeleteMemberError = ClickHouseCloudOpError;
190
+ /** Remove an organization member Removes a user from the organization */
191
+ export const deleteMember: API.OperationMethod<
192
+ DeleteMemberRequest,
193
+ DeleteMemberResponse,
194
+ DeleteMemberError,
195
+ ClickHouseCloudOpContext
196
+ > = /*@__PURE__*/ API.make(() => ({
197
+ input: __S(24, __c6, 0) as any as S.Schema<DeleteMemberRequest>,
198
+ output: __S(20, __c5, 0) as any as S.Schema<DeleteMemberResponse>,
199
+ errors: [],
200
+ serviceErrors: ClickHouseCloudServiceErrors,
201
+ protocol: ClickHouseCloudProtocol,
202
+ retry: Retry.Retry,
203
+ telemetry: TELEMETRY,
204
+ span: "DeleteMember",
205
+ }));
206
+
207
+ export type GetInvitationError = ClickHouseCloudOpError;
208
+ /** Get invitation details Returns details for a single organization invitation. */
209
+ export const getInvitation: API.OperationMethod<
210
+ GetInvitationRequest,
211
+ Invitation,
212
+ GetInvitationError,
213
+ ClickHouseCloudOpContext
214
+ > = /*@__PURE__*/ API.make(() => ({
215
+ input: __S(28, __c7, 0) as any as S.Schema<GetInvitationRequest>,
216
+ output: __S(8, __c2, 0) as any as S.Schema<Invitation>,
217
+ errors: [],
218
+ serviceErrors: ClickHouseCloudServiceErrors,
219
+ protocol: ClickHouseCloudProtocol,
220
+ retry: Retry.Retry,
221
+ telemetry: TELEMETRY,
222
+ span: "GetInvitation",
223
+ }));
224
+
225
+ export type GetMemberError = ClickHouseCloudOpError;
226
+ /** Get member details Returns a single organization member details. */
227
+ export const getMember: API.OperationMethod<
228
+ GetMemberRequest,
229
+ Member,
230
+ GetMemberError,
231
+ ClickHouseCloudOpContext
232
+ > = /*@__PURE__*/ API.make(() => ({
233
+ input: __S(32, __c8, 0) as any as S.Schema<GetMemberRequest>,
234
+ output: __S(36, __c9, 0) as any as S.Schema<Member>,
235
+ errors: [],
236
+ serviceErrors: ClickHouseCloudServiceErrors,
237
+ protocol: ClickHouseCloudProtocol,
238
+ retry: Retry.Retry,
239
+ telemetry: TELEMETRY,
240
+ span: "GetMember",
241
+ }));
242
+
243
+ export type ListInvitationsError = ClickHouseCloudOpError;
244
+ /** List all invitations Returns list of all organization invitations. */
245
+ export const listInvitations: API.OperationMethod<
246
+ ListInvitationsRequest,
247
+ ListInvitationsResponse,
248
+ ListInvitationsError,
249
+ ClickHouseCloudOpContext
250
+ > = /*@__PURE__*/ API.make(() => ({
251
+ input: __S(40, __c10, 0) as any as S.Schema<ListInvitationsRequest>,
252
+ output: __S(42, __c10, 2) as any as S.Schema<ListInvitationsResponse>,
253
+ errors: [],
254
+ serviceErrors: ClickHouseCloudServiceErrors,
255
+ protocol: ClickHouseCloudProtocol,
256
+ retry: Retry.Retry,
257
+ telemetry: TELEMETRY,
258
+ span: "ListInvitations",
259
+ }));
260
+
261
+ export type ListMembersError = ClickHouseCloudOpError;
262
+ /** List organization members Returns a list of all members in the organization. */
263
+ export const listMembers: API.OperationMethod<
264
+ ListMembersRequest,
265
+ ListMembersResponse,
266
+ ListMembersError,
267
+ ClickHouseCloudOpContext
268
+ > = /*@__PURE__*/ API.make(() => ({
269
+ input: __S(44, __c11, 0) as any as S.Schema<ListMembersRequest>,
270
+ output: __S(46, __c11, 2) as any as S.Schema<ListMembersResponse>,
271
+ errors: [],
272
+ serviceErrors: ClickHouseCloudServiceErrors,
273
+ protocol: ClickHouseCloudProtocol,
274
+ retry: Retry.Retry,
275
+ telemetry: TELEMETRY,
276
+ span: "ListMembers",
277
+ }));
278
+
279
+ export type UpdateMemberError = ClickHouseCloudOpError;
280
+ /** Update organization member Updates organization member role. */
281
+ export const updateMember: API.OperationMethod<
282
+ UpdateMemberRequest,
283
+ Member,
284
+ UpdateMemberError,
285
+ ClickHouseCloudOpContext
286
+ > = /*@__PURE__*/ API.make(() => ({
287
+ input: __S(48, __c12, 0) as any as S.Schema<UpdateMemberRequest>,
288
+ output: __S(36, __c9, 0) as any as S.Schema<Member>,
289
+ errors: [],
290
+ serviceErrors: ClickHouseCloudServiceErrors,
291
+ protocol: ClickHouseCloudProtocol,
292
+ retry: Retry.Retry,
293
+ telemetry: TELEMETRY,
294
+ span: "UpdateMember",
295
+ }));
296
+
297
+ // Schema builders: each runs one schema initializer, on that schema's first use.
298
+ function __c0(j: number): any {
299
+ switch (j) {
300
+ case 0:
301
+ return S.suspend(() =>
302
+ S.Struct({
303
+ organizationId: S.String.pipe(T.Label()),
304
+ email: S.String,
305
+ role: S.optional(S.String),
306
+ assignedRoleIds: S.optional(__S(12, __c3, 0)),
307
+ }).pipe(
308
+ T.Http({
309
+ method: "POST",
310
+ uri: "/v1/organizations/{organizationId}/invitations",
311
+ code: 200,
312
+ }),
313
+ ),
314
+ ).annotate({ identifier: "CreateInvitationRequest" });
315
+ }
316
+ }
317
+ function __c1(j: number): any {
318
+ switch (j) {
319
+ case 0:
320
+ return S.suspend(() =>
321
+ S.Struct({
322
+ roleId: S.optional(S.String),
323
+ roleName: S.optional(S.String),
324
+ roleType: S.optional(S.String),
325
+ }),
326
+ ).annotate({ identifier: "AssignedRole" });
327
+ case 1:
328
+ return S.Array(__S(4, __c1, 0));
329
+ }
330
+ }
331
+ function __c2(j: number): any {
332
+ switch (j) {
333
+ case 0:
334
+ return S.suspend(() =>
335
+ S.Struct({
336
+ role: S.optional(S.String),
337
+ id: S.optional(S.String),
338
+ email: S.optional(S.String),
339
+ createdAt: S.optional(S.String),
340
+ expireAt: S.optional(S.String),
341
+ assignedRoles: S.optional(__S(5, __c1, 1)),
342
+ }),
343
+ ).annotate({ identifier: "Invitation" });
344
+ }
345
+ }
346
+ function __c3(j: number): any {
347
+ switch (j) {
348
+ case 0:
349
+ return S.Array(S.String);
350
+ }
351
+ }
352
+ function __c4(j: number): any {
353
+ switch (j) {
354
+ case 0:
355
+ return S.suspend(() =>
356
+ S.Struct({
357
+ organizationId: S.String.pipe(T.Label()),
358
+ invitationId: S.String.pipe(T.Label()),
359
+ }).pipe(
360
+ T.Http({
361
+ method: "DELETE",
362
+ uri: "/v1/organizations/{organizationId}/invitations/{invitationId}",
363
+ code: 200,
364
+ }),
365
+ ),
366
+ ).annotate({ identifier: "DeleteInvitationRequest" });
367
+ }
368
+ }
369
+ function __c5(j: number): any {
370
+ switch (j) {
371
+ case 0:
372
+ return S.suspend(() =>
373
+ S.Struct({
374
+ status: S.optional(S.Number),
375
+ requestId: S.optional(S.String),
376
+ }),
377
+ ).annotate({ identifier: "DeleteInvitationResponse" });
378
+ }
379
+ }
380
+ function __c6(j: number): any {
381
+ switch (j) {
382
+ case 0:
383
+ return S.suspend(() =>
384
+ S.Struct({
385
+ organizationId: S.String.pipe(T.Label()),
386
+ userId: S.String.pipe(T.Label()),
387
+ }).pipe(
388
+ T.Http({
389
+ method: "DELETE",
390
+ uri: "/v1/organizations/{organizationId}/members/{userId}",
391
+ code: 200,
392
+ }),
393
+ ),
394
+ ).annotate({ identifier: "DeleteMemberRequest" });
395
+ }
396
+ }
397
+ function __c7(j: number): any {
398
+ switch (j) {
399
+ case 0:
400
+ return S.suspend(() =>
401
+ S.Struct({
402
+ organizationId: S.String.pipe(T.Label()),
403
+ invitationId: S.String.pipe(T.Label()),
404
+ }).pipe(
405
+ T.Http({
406
+ method: "GET",
407
+ uri: "/v1/organizations/{organizationId}/invitations/{invitationId}",
408
+ code: 200,
409
+ }),
410
+ ),
411
+ ).annotate({ identifier: "GetInvitationRequest" });
412
+ }
413
+ }
414
+ function __c8(j: number): any {
415
+ switch (j) {
416
+ case 0:
417
+ return S.suspend(() =>
418
+ S.Struct({
419
+ organizationId: S.String.pipe(T.Label()),
420
+ userId: S.String.pipe(T.Label()),
421
+ }).pipe(
422
+ T.Http({
423
+ method: "GET",
424
+ uri: "/v1/organizations/{organizationId}/members/{userId}",
425
+ code: 200,
426
+ }),
427
+ ),
428
+ ).annotate({ identifier: "GetMemberRequest" });
429
+ }
430
+ }
431
+ function __c9(j: number): any {
432
+ switch (j) {
433
+ case 0:
434
+ return S.suspend(() =>
435
+ S.Struct({
436
+ userId: S.optional(S.String),
437
+ name: S.optional(S.String),
438
+ email: S.optional(S.String),
439
+ role: S.optional(S.String),
440
+ joinedAt: S.optional(S.String),
441
+ assignedRoles: S.optional(__S(5, __c1, 1)),
442
+ }),
443
+ ).annotate({ identifier: "Member" });
444
+ }
445
+ }
446
+ function __c10(j: number): any {
447
+ switch (j) {
448
+ case 0:
449
+ return S.suspend(() =>
450
+ S.Struct({
451
+ organizationId: S.String.pipe(T.Label()),
452
+ }).pipe(
453
+ T.Http({
454
+ method: "GET",
455
+ uri: "/v1/organizations/{organizationId}/invitations",
456
+ code: 200,
457
+ }),
458
+ ),
459
+ ).annotate({ identifier: "ListInvitationsRequest" });
460
+ case 1:
461
+ return S.Array(__S(8, __c2, 0));
462
+ case 2:
463
+ return S.suspend(() => __S(41, __c10, 1).pipe(T.RawResponseRoot())).annotate({
464
+ identifier: "ListInvitationsResponse",
465
+ });
466
+ }
467
+ }
468
+ function __c11(j: number): any {
469
+ switch (j) {
470
+ case 0:
471
+ return S.suspend(() =>
472
+ S.Struct({
473
+ organizationId: S.String.pipe(T.Label()),
474
+ }).pipe(
475
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationId}/members", code: 200 }),
476
+ ),
477
+ ).annotate({ identifier: "ListMembersRequest" });
478
+ case 1:
479
+ return S.Array(__S(36, __c9, 0));
480
+ case 2:
481
+ return S.suspend(() => __S(45, __c11, 1).pipe(T.RawResponseRoot())).annotate({
482
+ identifier: "ListMembersResponse",
483
+ });
484
+ }
485
+ }
486
+ function __c12(j: number): any {
487
+ switch (j) {
488
+ case 0:
489
+ return S.suspend(() =>
490
+ S.Struct({
491
+ organizationId: S.String.pipe(T.Label()),
492
+ userId: S.String.pipe(T.Label()),
493
+ role: S.optional(S.String),
494
+ assignedRoleIds: S.optional(__S(12, __c3, 0)),
495
+ }).pipe(
496
+ T.Http({
497
+ method: "PATCH",
498
+ uri: "/v1/organizations/{organizationId}/members/{userId}",
499
+ code: 200,
500
+ }),
501
+ ),
502
+ ).annotate({ identifier: "UpdateMemberRequest" });
503
+ }
504
+ }
505
+ // Schema table: entry i is schema j of builder f, made on first reach.
506
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
507
+ return (__s[i] ??= __L.at(f, j));
508
+ }
package/src/traits.ts ADDED
@@ -0,0 +1,45 @@
1
+ /**
2
+ * ClickHouse Cloud SDK trait surface -- hand-written.
3
+ *
4
+ * Re-exports the generic protocol traits from core so generated operations
5
+ * import everything from one place. ClickHouse Cloud speaks plain JSON REST;
6
+ * the protocol unwraps the `{ status, requestId, result }` envelope (see
7
+ * `protocol.ts`), so there are no provider-specific traits.
8
+ */
9
+ export {
10
+ Body,
11
+ Header,
12
+ Query,
13
+ Label,
14
+ Http,
15
+ ResponseCode,
16
+ HttpBody,
17
+ FormDataFile,
18
+ KeyDictionary,
19
+ UnionCases,
20
+ applyErrorMatchers,
21
+ getErrorMatchers,
22
+ type HttpTrait,
23
+ type ErrorMatcher,
24
+ bodySymbol,
25
+ headerSymbol,
26
+ querySymbol,
27
+ labelSymbol,
28
+ httpSymbol,
29
+ responseCodeSymbol,
30
+ httpBodySymbol,
31
+ formDataFileSymbol,
32
+ keyDictionarySymbol,
33
+ unionCasesSymbol,
34
+ errorMatchersSymbol,
35
+ } from "@distilled.cloud/core/trait";
36
+
37
+ // REST protocol traits (sensitive strings, bare-payload responses).
38
+ export {
39
+ SensitiveValue,
40
+ RawResponse,
41
+ RawResponseRoot,
42
+ sensitiveValueSymbol,
43
+ rawResponseSymbol,
44
+ rawResponseRootSymbol,
45
+ } from "@distilled.cloud/core/protocol-rest";