@distilled.cloud/clickhouse-cloud 0.0.0 → 1.0.0-rc.22
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.
- package/LICENSE +201 -0
- package/README.md +134 -4
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +34 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +1 -0
- package/lib/errors.d.ts +58 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +1 -0
- package/lib/index.d.ts +49 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +1 -0
- package/lib/protocol.d.ts +19 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +1 -0
- package/lib/retry.d.ts +35 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +1 -0
- package/lib/services/api_keys.d.ts +175 -0
- package/lib/services/api_keys.d.ts.map +1 -0
- package/lib/services/api_keys.js +2 -0
- package/lib/services/api_keys.js.map +1 -0
- package/lib/services/backup.d.ts +117 -0
- package/lib/services/backup.d.ts.map +1 -0
- package/lib/services/backup.js +2 -0
- package/lib/services/backup.js.map +1 -0
- package/lib/services/billing.d.ts +69 -0
- package/lib/services/billing.d.ts.map +1 -0
- package/lib/services/billing.js +2 -0
- package/lib/services/billing.js.map +1 -0
- package/lib/services/click_pipes.d.ts +1637 -0
- package/lib/services/click_pipes.d.ts.map +1 -0
- package/lib/services/click_pipes.js +31 -0
- package/lib/services/click_pipes.js.map +1 -0
- package/lib/services/index.d.ts +14 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +13 -0
- package/lib/services/organization.d.ts +336 -0
- package/lib/services/organization.d.ts.map +1 -0
- package/lib/services/organization.js +2 -0
- package/lib/services/organization.js.map +1 -0
- package/lib/services/postgres.d.ts +726 -0
- package/lib/services/postgres.d.ts.map +1 -0
- package/lib/services/postgres.js +31 -0
- package/lib/services/postgres.js.map +1 -0
- package/lib/services/prometheus.d.ts +71 -0
- package/lib/services/prometheus.d.ts.map +1 -0
- package/lib/services/prometheus.js +2 -0
- package/lib/services/prometheus.js.map +1 -0
- package/lib/services/query_api_endpoints.d.ts +189 -0
- package/lib/services/query_api_endpoints.d.ts.map +1 -0
- package/lib/services/query_api_endpoints.js +2 -0
- package/lib/services/query_api_endpoints.js.map +1 -0
- package/lib/services/role_management.d.ts +159 -0
- package/lib/services/role_management.d.ts.map +1 -0
- package/lib/services/role_management.js +2 -0
- package/lib/services/role_management.js.map +1 -0
- package/lib/services/saved_queries.d.ts +129 -0
- package/lib/services/saved_queries.d.ts.map +1 -0
- package/lib/services/saved_queries.js +2 -0
- package/lib/services/saved_queries.js.map +1 -0
- package/lib/services/service.d.ts +886 -0
- package/lib/services/service.d.ts.map +1 -0
- package/lib/services/service.js +41 -0
- package/lib/services/service.js.map +1 -0
- package/lib/services/udf.d.ts +373 -0
- package/lib/services/udf.d.ts.map +1 -0
- package/lib/services/udf.js +24 -0
- package/lib/services/udf.js.map +1 -0
- package/lib/services/user_management.d.ts +150 -0
- package/lib/services/user_management.d.ts.map +1 -0
- package/lib/services/user_management.js +2 -0
- package/lib/services/user_management.js.map +1 -0
- package/lib/services.lazy/api_keys.js +1 -0
- package/lib/services.lazy/backup.js +1 -0
- package/lib/services.lazy/billing.js +1 -0
- package/lib/services.lazy/click_pipes.js +3 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/organization.js +1 -0
- package/lib/services.lazy/postgres.js +4 -0
- package/lib/services.lazy/prometheus.js +1 -0
- package/lib/services.lazy/query_api_endpoints.js +1 -0
- package/lib/services.lazy/role_management.js +1 -0
- package/lib/services.lazy/saved_queries.js +1 -0
- package/lib/services.lazy/service.js +4 -0
- package/lib/services.lazy/udf.js +3 -0
- package/lib/services.lazy/user_management.js +1 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +1 -0
- package/lib/unstable-services/backup.d.ts +165 -0
- package/lib/unstable-services/backup.d.ts.map +1 -0
- package/lib/unstable-services/backup.js +2 -0
- package/lib/unstable-services/backup.js.map +1 -0
- package/lib/unstable-services/billing.d.ts +84 -0
- package/lib/unstable-services/billing.d.ts.map +1 -0
- package/lib/unstable-services/billing.js +2 -0
- package/lib/unstable-services/billing.js.map +1 -0
- package/lib/unstable-services/click_pipes.d.ts +324 -0
- package/lib/unstable-services/click_pipes.d.ts.map +1 -0
- package/lib/unstable-services/click_pipes.js +2 -0
- package/lib/unstable-services/click_pipes.js.map +1 -0
- package/lib/unstable-services/click_stack.d.ts +3538 -0
- package/lib/unstable-services/click_stack.d.ts.map +1 -0
- package/lib/unstable-services/click_stack.js +60 -0
- package/lib/unstable-services/click_stack.js.map +1 -0
- package/lib/unstable-services/index.d.ts +11 -0
- package/lib/unstable-services/index.d.ts.map +1 -0
- package/lib/unstable-services/index.js +10 -0
- package/lib/unstable-services/notifications.d.ts +166 -0
- package/lib/unstable-services/notifications.d.ts.map +1 -0
- package/lib/unstable-services/notifications.js +2 -0
- package/lib/unstable-services/notifications.js.map +1 -0
- package/lib/unstable-services/organization.d.ts +403 -0
- package/lib/unstable-services/organization.d.ts.map +1 -0
- package/lib/unstable-services/organization.js +26 -0
- package/lib/unstable-services/organization.js.map +1 -0
- package/lib/unstable-services/postgres.d.ts +415 -0
- package/lib/unstable-services/postgres.d.ts.map +1 -0
- package/lib/unstable-services/postgres.js +2 -0
- package/lib/unstable-services/postgres.js.map +1 -0
- package/lib/unstable-services/service.d.ts +244 -0
- package/lib/unstable-services/service.d.ts.map +1 -0
- package/lib/unstable-services/service.js +2 -0
- package/lib/unstable-services/service.js.map +1 -0
- package/lib/unstable-services/snapshot.d.ts +146 -0
- package/lib/unstable-services/snapshot.d.ts.map +1 -0
- package/lib/unstable-services/snapshot.js +2 -0
- package/lib/unstable-services/snapshot.js.map +1 -0
- package/lib/unstable-services/user_management.d.ts +41 -0
- package/lib/unstable-services/user_management.d.ts.map +1 -0
- package/lib/unstable-services/user_management.js +2 -0
- package/lib/unstable-services/user_management.js.map +1 -0
- package/lib/unstable-services.lazy/backup.js +1 -0
- package/lib/unstable-services.lazy/billing.js +1 -0
- package/lib/unstable-services.lazy/click_pipes.js +1 -0
- package/lib/unstable-services.lazy/click_stack.js +4 -0
- package/lib/unstable-services.lazy/index.js +3 -0
- package/lib/unstable-services.lazy/notifications.js +1 -0
- package/lib/unstable-services.lazy/organization.js +4 -0
- package/lib/unstable-services.lazy/postgres.js +1 -0
- package/lib/unstable-services.lazy/service.js +1 -0
- package/lib/unstable-services.lazy/snapshot.js +1 -0
- package/lib/unstable-services.lazy/user_management.js +1 -0
- package/package.json +89 -2
- package/src/credentials.ts +88 -0
- package/src/errors.ts +76 -0
- package/src/index.ts +53 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +76 -0
- package/src/retry.ts +53 -0
- package/src/services/api_keys.ts +466 -0
- package/src/services/backup.ts +347 -0
- package/src/services/billing.ts +170 -0
- package/src/services/click_pipes.ts +3483 -0
- package/src/services/index.ts +14 -0
- package/src/services/organization.ts +901 -0
- package/src/services/postgres.ts +1967 -0
- package/src/services/prometheus.ts +271 -0
- package/src/services/query_api_endpoints.ts +466 -0
- package/src/services/role_management.ts +436 -0
- package/src/services/saved_queries.ts +384 -0
- package/src/services/service.ts +2112 -0
- package/src/services/udf.ts +1019 -0
- package/src/services/user_management.ts +508 -0
- package/src/traits.ts +45 -0
- package/src/unstable-services/backup.ts +422 -0
- package/src/unstable-services/billing.ts +232 -0
- package/src/unstable-services/click_pipes.ts +702 -0
- package/src/unstable-services/click_stack.ts +7114 -0
- package/src/unstable-services/index.ts +11 -0
- package/src/unstable-services/notifications.ts +451 -0
- package/src/unstable-services/organization.ts +1107 -0
- package/src/unstable-services/postgres.ts +1061 -0
- package/src/unstable-services/service.ts +795 -0
- package/src/unstable-services/snapshot.ts +397 -0
- package/src/unstable-services/user_management.ts +127 -0
|
@@ -0,0 +1,436 @@
|
|
|
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 { paginateCursor } from "../pagination.ts";
|
|
7
|
+
import {
|
|
8
|
+
ClickHouseCloudProtocol,
|
|
9
|
+
ClickHouseCloudPaginatedProtocol,
|
|
10
|
+
type ClickHouseCloudOpError,
|
|
11
|
+
type ClickHouseCloudOpContext,
|
|
12
|
+
} from "../protocol.ts";
|
|
13
|
+
import * as Retry from "../retry.ts";
|
|
14
|
+
import * as T from "../traits.ts";
|
|
15
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
16
|
+
const __s: any[] = [];
|
|
17
|
+
|
|
18
|
+
export type { ClickHouseCloudOpError, ClickHouseCloudOpContext };
|
|
19
|
+
|
|
20
|
+
/** Span facts shared by every operation (com.distilled.telemetry#service). */
|
|
21
|
+
const TELEMETRY = {
|
|
22
|
+
system: "clickhouse-cloud-api",
|
|
23
|
+
responseHeaders: [
|
|
24
|
+
{ header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
|
|
25
|
+
{ header: "request-id", name: "http.response.header.request-id", transform: "list" },
|
|
26
|
+
],
|
|
27
|
+
prefix: "ClickhouseCloud",
|
|
28
|
+
service: "RoleManagement",
|
|
29
|
+
labels: "clickhouse_cloud",
|
|
30
|
+
propagate: "w3c",
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
/** List of actor resource IDs to assign to this role (e.g., ["user/uuid", "apiKey/uuid"]) */
|
|
34
|
+
export type CreateOrganizationRoleRequestActorsList = Array<string>;
|
|
35
|
+
/** Whether this policy allows or denies access */
|
|
36
|
+
export type RBACPolicyCreateRequestAllowDeny = "ALLOW" | "DENY";
|
|
37
|
+
/** List of permissions to grant or deny (e.g., ["control-plane:organization:view"]) */
|
|
38
|
+
export type RBACPolicyCreateRequestPermissionsList = Array<string>;
|
|
39
|
+
/** List of resource IDs this policy applies to (e.g., ["instance/uuid", "instance/*"]) */
|
|
40
|
+
export type RBACPolicyCreateRequestResourcesList = Array<string>;
|
|
41
|
+
/** Optional list of database grants (e.g., database names) */
|
|
42
|
+
export type RBACPolicyTagsGrantsList = Array<string>;
|
|
43
|
+
/** Optional SQL console role type */
|
|
44
|
+
export type RBACPolicyTagsRoleV2 = "sql-console-readonly" | "sql-console-admin";
|
|
45
|
+
export interface RBACPolicyTags {
|
|
46
|
+
/** Optional list of database grants (e.g., database names) */
|
|
47
|
+
grants?: RBACPolicyTagsGrantsList | undefined;
|
|
48
|
+
/** Optional SQL console role type */
|
|
49
|
+
roleV2?: RBACPolicyTagsRoleV2 | (string & {}) | undefined;
|
|
50
|
+
}
|
|
51
|
+
export interface RBACPolicyCreateRequest {
|
|
52
|
+
/** Whether this policy allows or denies access */
|
|
53
|
+
allowDeny: RBACPolicyCreateRequestAllowDeny | (string & {});
|
|
54
|
+
/** List of permissions to grant or deny (e.g., ["control-plane:organization:view"]) */
|
|
55
|
+
permissions: RBACPolicyCreateRequestPermissionsList;
|
|
56
|
+
/** List of resource IDs this policy applies to (e.g., ["instance/uuid", "instance/*"]) */
|
|
57
|
+
resources: RBACPolicyCreateRequestResourcesList;
|
|
58
|
+
tags?: RBACPolicyTags | undefined;
|
|
59
|
+
}
|
|
60
|
+
/** List of policies to create for this role */
|
|
61
|
+
export type CreateOrganizationRoleRequestPoliciesList = Array<RBACPolicyCreateRequest>;
|
|
62
|
+
export interface CreateOrganizationRoleRequest {
|
|
63
|
+
/** ID of the requested organization. */
|
|
64
|
+
organizationId: string;
|
|
65
|
+
/** Name of the role */
|
|
66
|
+
name: string;
|
|
67
|
+
/** List of actor resource IDs to assign to this role (e.g., ["user/uuid", "apiKey/uuid"]) */
|
|
68
|
+
actors: CreateOrganizationRoleRequestActorsList;
|
|
69
|
+
/** List of policies to create for this role */
|
|
70
|
+
policies: CreateOrganizationRoleRequestPoliciesList;
|
|
71
|
+
}
|
|
72
|
+
/** Whether this is a system role or a custom role */
|
|
73
|
+
export type RBACRoleType = "system" | "custom";
|
|
74
|
+
/** List of actor resource IDs assigned to this role (e.g., user/uuid, apiKey/uuid) */
|
|
75
|
+
export type RBACRoleActorsList = Array<string>;
|
|
76
|
+
/** Whether this policy allows or denies access */
|
|
77
|
+
export type RBACPolicyAllowDeny = "ALLOW" | "DENY";
|
|
78
|
+
/** List of permissions granted or denied by this policy */
|
|
79
|
+
export type RBACPolicyPermissionsList = Array<string>;
|
|
80
|
+
/** List of resource IDs this policy applies to (e.g., instance/uuid, instance/*) */
|
|
81
|
+
export type RBACPolicyResourcesList = Array<string>;
|
|
82
|
+
export interface RBACPolicy {
|
|
83
|
+
/** Unique policy identifier */
|
|
84
|
+
id?: string | undefined;
|
|
85
|
+
/** ID of the role this policy belongs to */
|
|
86
|
+
roleId?: string | undefined;
|
|
87
|
+
/** Tenant resource ID (e.g., organization/uuid) */
|
|
88
|
+
tenantId?: string | undefined;
|
|
89
|
+
/** Whether this policy allows or denies access */
|
|
90
|
+
allowDeny?: RBACPolicyAllowDeny | undefined;
|
|
91
|
+
/** List of permissions granted or denied by this policy */
|
|
92
|
+
permissions?: RBACPolicyPermissionsList | undefined;
|
|
93
|
+
/** List of resource IDs this policy applies to (e.g., instance/uuid, instance/*) */
|
|
94
|
+
resources?: RBACPolicyResourcesList | undefined;
|
|
95
|
+
tags?: RBACPolicyTags | undefined;
|
|
96
|
+
}
|
|
97
|
+
/** List of policies associated with this role */
|
|
98
|
+
export type RBACRolePoliciesList = Array<RBACPolicy>;
|
|
99
|
+
export interface RBACRole {
|
|
100
|
+
/** Unique role identifier */
|
|
101
|
+
id?: string | undefined;
|
|
102
|
+
/** Tenant resource ID (e.g., organization/uuid) */
|
|
103
|
+
tenantId?: string | undefined;
|
|
104
|
+
/** Owner resource ID (e.g., organization/uuid) */
|
|
105
|
+
ownerId?: string | undefined;
|
|
106
|
+
/** Name of the role */
|
|
107
|
+
name?: string | undefined;
|
|
108
|
+
/** Whether this is a system role or a custom role */
|
|
109
|
+
type?: RBACRoleType | undefined;
|
|
110
|
+
/** List of actor resource IDs assigned to this role (e.g., user/uuid, apiKey/uuid) */
|
|
111
|
+
actors?: RBACRoleActorsList | undefined;
|
|
112
|
+
/** List of policies associated with this role */
|
|
113
|
+
policies?: RBACRolePoliciesList | undefined;
|
|
114
|
+
/** Timestamp when the role was created. ISO-8601. */
|
|
115
|
+
createdAt?: string | undefined;
|
|
116
|
+
/** Timestamp when the role was last updated. ISO-8601. */
|
|
117
|
+
updatedAt?: string | undefined;
|
|
118
|
+
}
|
|
119
|
+
export interface DeleteOrganizationRoleRequest {
|
|
120
|
+
/** ID of the requested organization. */
|
|
121
|
+
organizationId: string;
|
|
122
|
+
/** ID of the requested role. */
|
|
123
|
+
roleId: string;
|
|
124
|
+
}
|
|
125
|
+
export interface DeleteOrganizationRoleResponse {
|
|
126
|
+
/** HTTP status code. */
|
|
127
|
+
status?: number | undefined;
|
|
128
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
129
|
+
requestId?: string | undefined;
|
|
130
|
+
}
|
|
131
|
+
export interface GetOrganizationRoleRequest {
|
|
132
|
+
/** ID of the requested organization. */
|
|
133
|
+
organizationId: string;
|
|
134
|
+
/** ID of the requested role. */
|
|
135
|
+
roleId: string;
|
|
136
|
+
}
|
|
137
|
+
export interface ListOrganizationRolesRequest {
|
|
138
|
+
/** ID of the requested organization. */
|
|
139
|
+
organizationId: string;
|
|
140
|
+
/** Maximum number of results to return. */
|
|
141
|
+
limit?: number | undefined;
|
|
142
|
+
/** Opaque cursor from a previous response's `nextCursor`, marking where to resume the list. */
|
|
143
|
+
cursor?: string | undefined;
|
|
144
|
+
}
|
|
145
|
+
export type ListOrganizationRolesResponseResultList = Array<RBACRole>;
|
|
146
|
+
export interface ListOrganizationRolesResponse {
|
|
147
|
+
/** HTTP status code. */
|
|
148
|
+
status?: number | undefined;
|
|
149
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
150
|
+
requestId?: string | undefined;
|
|
151
|
+
result: ListOrganizationRolesResponseResultList;
|
|
152
|
+
/** Maximum number of results returned in this page. */
|
|
153
|
+
limit?: number | undefined;
|
|
154
|
+
/** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
|
|
155
|
+
nextCursor?: string | null | undefined;
|
|
156
|
+
}
|
|
157
|
+
/** New list of actor resource IDs (replaces existing actors) */
|
|
158
|
+
export type UpdateOrganizationRoleRequestActorsList = Array<string>;
|
|
159
|
+
/** New list of policies (replaces existing policies) */
|
|
160
|
+
export type UpdateOrganizationRoleRequestPoliciesList = Array<RBACPolicyCreateRequest>;
|
|
161
|
+
export interface UpdateOrganizationRoleRequest {
|
|
162
|
+
/** ID of the requested organization. */
|
|
163
|
+
organizationId: string;
|
|
164
|
+
/** ID of the requested role. */
|
|
165
|
+
roleId: string;
|
|
166
|
+
/** New name for the role */
|
|
167
|
+
name?: string | undefined;
|
|
168
|
+
/** New list of actor resource IDs (replaces existing actors) */
|
|
169
|
+
actors?: UpdateOrganizationRoleRequestActorsList | undefined;
|
|
170
|
+
/** New list of policies (replaces existing policies) */
|
|
171
|
+
policies?: UpdateOrganizationRoleRequestPoliciesList | undefined;
|
|
172
|
+
}
|
|
173
|
+
export type CreateOrganizationRoleError = ClickHouseCloudOpError;
|
|
174
|
+
/** Create a new role Creates a new custom role for an organization with specified policies and actors. */
|
|
175
|
+
export const createOrganizationRole: API.OperationMethod<
|
|
176
|
+
CreateOrganizationRoleRequest,
|
|
177
|
+
RBACRole,
|
|
178
|
+
CreateOrganizationRoleError,
|
|
179
|
+
ClickHouseCloudOpContext
|
|
180
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
181
|
+
input: __S(0, __c0, 0) as any as S.Schema<CreateOrganizationRoleRequest>,
|
|
182
|
+
output: __S(12, __c1, 4) as any as S.Schema<RBACRole>,
|
|
183
|
+
errors: [],
|
|
184
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
185
|
+
protocol: ClickHouseCloudProtocol,
|
|
186
|
+
retry: Retry.Retry,
|
|
187
|
+
telemetry: TELEMETRY,
|
|
188
|
+
span: "CreateOrganizationRole",
|
|
189
|
+
}));
|
|
190
|
+
|
|
191
|
+
export type DeleteOrganizationRoleError = ClickHouseCloudOpError;
|
|
192
|
+
/** Delete a role Deletes an existing custom role. System roles cannot be deleted. This operation will remove the role and all its associated policies. */
|
|
193
|
+
export const deleteOrganizationRole: API.OperationMethod<
|
|
194
|
+
DeleteOrganizationRoleRequest,
|
|
195
|
+
DeleteOrganizationRoleResponse,
|
|
196
|
+
DeleteOrganizationRoleError,
|
|
197
|
+
ClickHouseCloudOpContext
|
|
198
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
199
|
+
input: __S(24, __c3, 0) as any as S.Schema<DeleteOrganizationRoleRequest>,
|
|
200
|
+
output: __S(25, __c3, 1) as any as S.Schema<DeleteOrganizationRoleResponse>,
|
|
201
|
+
errors: [],
|
|
202
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
203
|
+
protocol: ClickHouseCloudProtocol,
|
|
204
|
+
retry: Retry.Retry,
|
|
205
|
+
telemetry: TELEMETRY,
|
|
206
|
+
span: "DeleteOrganizationRole",
|
|
207
|
+
}));
|
|
208
|
+
|
|
209
|
+
export type GetOrganizationRoleError = ClickHouseCloudOpError;
|
|
210
|
+
/** Get role details Returns details for a specific role. */
|
|
211
|
+
export const getOrganizationRole: API.OperationMethod<
|
|
212
|
+
GetOrganizationRoleRequest,
|
|
213
|
+
RBACRole,
|
|
214
|
+
GetOrganizationRoleError,
|
|
215
|
+
ClickHouseCloudOpContext
|
|
216
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
217
|
+
input: __S(32, __c4, 0) as any as S.Schema<GetOrganizationRoleRequest>,
|
|
218
|
+
output: __S(12, __c1, 4) as any as S.Schema<RBACRole>,
|
|
219
|
+
errors: [],
|
|
220
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
221
|
+
protocol: ClickHouseCloudProtocol,
|
|
222
|
+
retry: Retry.Retry,
|
|
223
|
+
telemetry: TELEMETRY,
|
|
224
|
+
span: "GetOrganizationRole",
|
|
225
|
+
}));
|
|
226
|
+
|
|
227
|
+
export type ListOrganizationRolesError = ClickHouseCloudOpError;
|
|
228
|
+
/** List all available roles for an organization Returns available roles (system + custom) for an organization, ordered by unique role ID ascending. Results are capped at `limit` (default and maximum 250) per page. Pass `nextCursor` as the `cursor` query parameter to fetch the next page until it is null. */
|
|
229
|
+
export const listOrganizationRoles: API.PaginatedOperationMethod<
|
|
230
|
+
ListOrganizationRolesRequest,
|
|
231
|
+
ListOrganizationRolesResponse,
|
|
232
|
+
ListOrganizationRolesError,
|
|
233
|
+
ClickHouseCloudOpContext,
|
|
234
|
+
RBACRole
|
|
235
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
236
|
+
() => ({
|
|
237
|
+
input: __S(40, __c5, 0) as any as S.Schema<ListOrganizationRolesRequest>,
|
|
238
|
+
output: __S(42, __c5, 2) as any as S.Schema<ListOrganizationRolesResponse>,
|
|
239
|
+
errors: [],
|
|
240
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
241
|
+
protocol: ClickHouseCloudPaginatedProtocol,
|
|
242
|
+
retry: Retry.Retry,
|
|
243
|
+
telemetry: TELEMETRY,
|
|
244
|
+
span: "ListOrganizationRoles",
|
|
245
|
+
pagination: {
|
|
246
|
+
mode: "cursor",
|
|
247
|
+
inputToken: "cursor",
|
|
248
|
+
outputToken: "nextCursor",
|
|
249
|
+
items: "result",
|
|
250
|
+
pageSize: "limit",
|
|
251
|
+
} as const,
|
|
252
|
+
}),
|
|
253
|
+
paginateCursor,
|
|
254
|
+
) as any;
|
|
255
|
+
|
|
256
|
+
export type UpdateOrganizationRoleError = ClickHouseCloudOpError;
|
|
257
|
+
/** Update a role Updates an existing custom role. System roles cannot be updated. All fields are optional - only provided fields will be updated. */
|
|
258
|
+
export const updateOrganizationRole: API.OperationMethod<
|
|
259
|
+
UpdateOrganizationRoleRequest,
|
|
260
|
+
RBACRole,
|
|
261
|
+
UpdateOrganizationRoleError,
|
|
262
|
+
ClickHouseCloudOpContext
|
|
263
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
264
|
+
input: __S(48, __c6, 0) as any as S.Schema<UpdateOrganizationRoleRequest>,
|
|
265
|
+
output: __S(12, __c1, 4) as any as S.Schema<RBACRole>,
|
|
266
|
+
errors: [],
|
|
267
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
268
|
+
protocol: ClickHouseCloudProtocol,
|
|
269
|
+
retry: Retry.Retry,
|
|
270
|
+
telemetry: TELEMETRY,
|
|
271
|
+
span: "UpdateOrganizationRole",
|
|
272
|
+
}));
|
|
273
|
+
|
|
274
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
275
|
+
function __c0(j: number): any {
|
|
276
|
+
switch (j) {
|
|
277
|
+
case 0:
|
|
278
|
+
return S.suspend(() =>
|
|
279
|
+
S.Struct({
|
|
280
|
+
organizationId: S.String.pipe(T.Label()),
|
|
281
|
+
name: S.String,
|
|
282
|
+
actors: __S(8, __c1, 0),
|
|
283
|
+
policies: __S(17, __c2, 1),
|
|
284
|
+
}).pipe(
|
|
285
|
+
T.Http({ method: "POST", uri: "/v1/organizations/{organizationId}/roles", code: 200 }),
|
|
286
|
+
),
|
|
287
|
+
).annotate({ identifier: "CreateOrganizationRoleRequest" });
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function __c1(j: number): any {
|
|
291
|
+
switch (j) {
|
|
292
|
+
case 0:
|
|
293
|
+
return S.Array(S.String);
|
|
294
|
+
case 1:
|
|
295
|
+
return S.suspend(() =>
|
|
296
|
+
S.Struct({
|
|
297
|
+
grants: S.optional(__S(8, __c1, 0)),
|
|
298
|
+
roleV2: S.optional(S.String),
|
|
299
|
+
}),
|
|
300
|
+
).annotate({ identifier: "RBACPolicyTags" });
|
|
301
|
+
case 2:
|
|
302
|
+
return S.suspend(() =>
|
|
303
|
+
S.Struct({
|
|
304
|
+
id: S.optional(S.String),
|
|
305
|
+
roleId: S.optional(S.String),
|
|
306
|
+
tenantId: S.optional(S.String),
|
|
307
|
+
allowDeny: S.optional(S.String),
|
|
308
|
+
permissions: S.optional(__S(8, __c1, 0)),
|
|
309
|
+
resources: S.optional(__S(8, __c1, 0)),
|
|
310
|
+
tags: S.optional(__S(9, __c1, 1)),
|
|
311
|
+
}),
|
|
312
|
+
).annotate({ identifier: "RBACPolicy" });
|
|
313
|
+
case 3:
|
|
314
|
+
return S.Array(__S(10, __c1, 2));
|
|
315
|
+
case 4:
|
|
316
|
+
return S.suspend(() =>
|
|
317
|
+
S.Struct({
|
|
318
|
+
id: S.optional(S.String),
|
|
319
|
+
tenantId: S.optional(S.String),
|
|
320
|
+
ownerId: S.optional(S.String),
|
|
321
|
+
name: S.optional(S.String),
|
|
322
|
+
type: S.optional(S.String),
|
|
323
|
+
actors: S.optional(__S(8, __c1, 0)),
|
|
324
|
+
policies: S.optional(__S(11, __c1, 3)),
|
|
325
|
+
createdAt: S.optional(S.String),
|
|
326
|
+
updatedAt: S.optional(S.String),
|
|
327
|
+
}),
|
|
328
|
+
).annotate({ identifier: "RBACRole" });
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function __c2(j: number): any {
|
|
332
|
+
switch (j) {
|
|
333
|
+
case 0:
|
|
334
|
+
return S.suspend(() =>
|
|
335
|
+
S.Struct({
|
|
336
|
+
allowDeny: S.String,
|
|
337
|
+
permissions: __S(8, __c1, 0),
|
|
338
|
+
resources: __S(8, __c1, 0),
|
|
339
|
+
tags: S.optional(__S(9, __c1, 1)),
|
|
340
|
+
}),
|
|
341
|
+
).annotate({ identifier: "RBACPolicyCreateRequest" });
|
|
342
|
+
case 1:
|
|
343
|
+
return S.Array(__S(16, __c2, 0));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function __c3(j: number): any {
|
|
347
|
+
switch (j) {
|
|
348
|
+
case 0:
|
|
349
|
+
return S.suspend(() =>
|
|
350
|
+
S.Struct({
|
|
351
|
+
organizationId: S.String.pipe(T.Label()),
|
|
352
|
+
roleId: S.String.pipe(T.Label()),
|
|
353
|
+
}).pipe(
|
|
354
|
+
T.Http({
|
|
355
|
+
method: "DELETE",
|
|
356
|
+
uri: "/v1/organizations/{organizationId}/roles/{roleId}",
|
|
357
|
+
code: 200,
|
|
358
|
+
}),
|
|
359
|
+
),
|
|
360
|
+
).annotate({ identifier: "DeleteOrganizationRoleRequest" });
|
|
361
|
+
case 1:
|
|
362
|
+
return S.suspend(() =>
|
|
363
|
+
S.Struct({
|
|
364
|
+
status: S.optional(S.Number),
|
|
365
|
+
requestId: S.optional(S.String),
|
|
366
|
+
}),
|
|
367
|
+
).annotate({ identifier: "DeleteOrganizationRoleResponse" });
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
function __c4(j: number): any {
|
|
371
|
+
switch (j) {
|
|
372
|
+
case 0:
|
|
373
|
+
return S.suspend(() =>
|
|
374
|
+
S.Struct({
|
|
375
|
+
organizationId: S.String.pipe(T.Label()),
|
|
376
|
+
roleId: S.String.pipe(T.Label()),
|
|
377
|
+
}).pipe(
|
|
378
|
+
T.Http({
|
|
379
|
+
method: "GET",
|
|
380
|
+
uri: "/v1/organizations/{organizationId}/roles/{roleId}",
|
|
381
|
+
code: 200,
|
|
382
|
+
}),
|
|
383
|
+
),
|
|
384
|
+
).annotate({ identifier: "GetOrganizationRoleRequest" });
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function __c5(j: number): any {
|
|
388
|
+
switch (j) {
|
|
389
|
+
case 0:
|
|
390
|
+
return S.suspend(() =>
|
|
391
|
+
S.Struct({
|
|
392
|
+
organizationId: S.String.pipe(T.Label()),
|
|
393
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
394
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
395
|
+
}).pipe(
|
|
396
|
+
T.Http({ method: "GET", uri: "/v1/organizations/{organizationId}/roles", code: 200 }),
|
|
397
|
+
),
|
|
398
|
+
).annotate({ identifier: "ListOrganizationRolesRequest" });
|
|
399
|
+
case 1:
|
|
400
|
+
return S.Array(__S(12, __c1, 4));
|
|
401
|
+
case 2:
|
|
402
|
+
return S.suspend(() =>
|
|
403
|
+
S.Struct({
|
|
404
|
+
status: S.optional(S.Number),
|
|
405
|
+
requestId: S.optional(S.String),
|
|
406
|
+
result: __S(41, __c5, 1),
|
|
407
|
+
limit: S.optional(S.Number),
|
|
408
|
+
nextCursor: S.optional(S.NullOr(S.String)),
|
|
409
|
+
}),
|
|
410
|
+
).annotate({ identifier: "ListOrganizationRolesResponse" });
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function __c6(j: number): any {
|
|
414
|
+
switch (j) {
|
|
415
|
+
case 0:
|
|
416
|
+
return S.suspend(() =>
|
|
417
|
+
S.Struct({
|
|
418
|
+
organizationId: S.String.pipe(T.Label()),
|
|
419
|
+
roleId: S.String.pipe(T.Label()),
|
|
420
|
+
name: S.optional(S.String),
|
|
421
|
+
actors: S.optional(__S(8, __c1, 0)),
|
|
422
|
+
policies: S.optional(__S(17, __c2, 1)),
|
|
423
|
+
}).pipe(
|
|
424
|
+
T.Http({
|
|
425
|
+
method: "PATCH",
|
|
426
|
+
uri: "/v1/organizations/{organizationId}/roles/{roleId}",
|
|
427
|
+
code: 200,
|
|
428
|
+
}),
|
|
429
|
+
),
|
|
430
|
+
).annotate({ identifier: "UpdateOrganizationRoleRequest" });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
434
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
435
|
+
return (__s[i] ??= __L.at(f, j));
|
|
436
|
+
}
|