@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.
- package/LICENSE +201 -0
- package/README.md +138 -2
- 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 +94 -3
- 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,466 @@
|
|
|
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: "QueryApiEndpoints",
|
|
29
|
+
labels: "clickhouse_cloud",
|
|
30
|
+
propagate: "w3c",
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
/** Default query parameters. */
|
|
34
|
+
export type CreateQueryApiEndpointRequestParametersMap = { [key: string]: string | undefined };
|
|
35
|
+
/** API key IDs allowed to call the endpoint. */
|
|
36
|
+
export type CreateQueryApiEndpointRequestApiKeyIdsList = Array<string>;
|
|
37
|
+
/** Database roles used by the endpoint. */
|
|
38
|
+
export type CreateQueryApiEndpointRequestRolesList = Array<string>;
|
|
39
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
40
|
+
export type CreateQueryApiEndpointRequestAllowedOriginsList = Array<string>;
|
|
41
|
+
export interface CreateQueryApiEndpointRequest {
|
|
42
|
+
/** ID of the requested organization. */
|
|
43
|
+
organizationId: string;
|
|
44
|
+
/** ID of the requested service. */
|
|
45
|
+
serviceId: string;
|
|
46
|
+
/** Name of the Query API endpoint. */
|
|
47
|
+
name: string;
|
|
48
|
+
/** SQL executed by the endpoint. */
|
|
49
|
+
sql: string;
|
|
50
|
+
/** Database used by the Query API endpoint. */
|
|
51
|
+
database: string;
|
|
52
|
+
/** Default query parameters. */
|
|
53
|
+
parameters?: CreateQueryApiEndpointRequestParametersMap | undefined;
|
|
54
|
+
/** API key IDs allowed to call the endpoint. */
|
|
55
|
+
apiKeyIds: CreateQueryApiEndpointRequestApiKeyIdsList;
|
|
56
|
+
/** Database roles used by the endpoint. */
|
|
57
|
+
roles: CreateQueryApiEndpointRequestRolesList;
|
|
58
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
59
|
+
allowedOrigins?: CreateQueryApiEndpointRequestAllowedOriginsList | undefined;
|
|
60
|
+
}
|
|
61
|
+
/** Query parameters. */
|
|
62
|
+
export type PublicQueryApiEndpointParametersMap = { [key: string]: string | undefined };
|
|
63
|
+
/** API key IDs allowed to call the endpoint. */
|
|
64
|
+
export type PublicQueryApiEndpointApiKeyIdsList = Array<string>;
|
|
65
|
+
/** Database roles used by the endpoint. */
|
|
66
|
+
export type PublicQueryApiEndpointRolesList = Array<string>;
|
|
67
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
68
|
+
export type PublicQueryApiEndpointAllowedOriginsList = Array<string>;
|
|
69
|
+
/** Owner type of the Query API endpoint. Endpoints with a user owned query cannot be updated or deleted through this API. */
|
|
70
|
+
export type PublicQueryApiEndpointOwnerType = "user" | "queryApiEndpoint";
|
|
71
|
+
export interface PublicQueryApiEndpoint {
|
|
72
|
+
/** Unique ID of the Query API endpoint. */
|
|
73
|
+
id: string;
|
|
74
|
+
/** Name of the Query API endpoint. */
|
|
75
|
+
name: string;
|
|
76
|
+
/** SQL executed by the endpoint. */
|
|
77
|
+
sql: string;
|
|
78
|
+
/** Database used by the Query API endpoint. */
|
|
79
|
+
database: string;
|
|
80
|
+
/** Query parameters. */
|
|
81
|
+
parameters: PublicQueryApiEndpointParametersMap;
|
|
82
|
+
/** API key IDs allowed to call the endpoint. */
|
|
83
|
+
apiKeyIds: PublicQueryApiEndpointApiKeyIdsList;
|
|
84
|
+
/** Database roles used by the endpoint. */
|
|
85
|
+
roles: PublicQueryApiEndpointRolesList;
|
|
86
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
87
|
+
allowedOrigins: PublicQueryApiEndpointAllowedOriginsList;
|
|
88
|
+
/** Public URL used to execute the endpoint. */
|
|
89
|
+
url: string;
|
|
90
|
+
/** Owner type of the Query API endpoint. Endpoints with a user owned query cannot be updated or deleted through this API. */
|
|
91
|
+
ownerType: PublicQueryApiEndpointOwnerType;
|
|
92
|
+
}
|
|
93
|
+
export interface DeleteQueryApiEndpointRequest {
|
|
94
|
+
/** ID of the requested organization. */
|
|
95
|
+
organizationId: string;
|
|
96
|
+
/** ID of the requested service. */
|
|
97
|
+
serviceId: string;
|
|
98
|
+
/** ID of the requested Query API endpoint. */
|
|
99
|
+
endpointId: string;
|
|
100
|
+
}
|
|
101
|
+
export interface DeleteQueryApiEndpointResponse {
|
|
102
|
+
/** HTTP status code. */
|
|
103
|
+
status: number;
|
|
104
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
105
|
+
requestId: string;
|
|
106
|
+
}
|
|
107
|
+
export interface GetQueryApiEndpointRequest {
|
|
108
|
+
/** ID of the requested organization. */
|
|
109
|
+
organizationId: string;
|
|
110
|
+
/** ID of the requested service. */
|
|
111
|
+
serviceId: string;
|
|
112
|
+
/** ID of the requested Query API endpoint. */
|
|
113
|
+
endpointId: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ListQueryApiEndpointsRequest {
|
|
116
|
+
/** ID of the requested organization. */
|
|
117
|
+
organizationId: string;
|
|
118
|
+
/** ID of the requested service. */
|
|
119
|
+
serviceId: string;
|
|
120
|
+
/** Cursor returned as `nextCursor` on the previous page. */
|
|
121
|
+
cursor?: string | undefined;
|
|
122
|
+
/** Maximum number of records to return per page. Defaults to 100. Maximum is 100. */
|
|
123
|
+
limit?: number | undefined;
|
|
124
|
+
}
|
|
125
|
+
/** API key IDs allowed to call the endpoint. */
|
|
126
|
+
export type PublicQueryApiEndpointListItemApiKeyIdsList = Array<string>;
|
|
127
|
+
/** Database roles used by the endpoint. */
|
|
128
|
+
export type PublicQueryApiEndpointListItemRolesList = Array<string>;
|
|
129
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
130
|
+
export type PublicQueryApiEndpointListItemAllowedOriginsList = Array<string>;
|
|
131
|
+
/** Owner type of the Query API endpoint. Endpoints with a user owned query cannot be updated or deleted through this API. */
|
|
132
|
+
export type PublicQueryApiEndpointListItemOwnerType = "user" | "queryApiEndpoint";
|
|
133
|
+
export interface PublicQueryApiEndpointListItem {
|
|
134
|
+
/** Unique ID of the Query API endpoint. */
|
|
135
|
+
id: string;
|
|
136
|
+
/** Name of the Query API endpoint. */
|
|
137
|
+
name: string;
|
|
138
|
+
/** Database used by the Query API endpoint. */
|
|
139
|
+
database: string;
|
|
140
|
+
/** API key IDs allowed to call the endpoint. */
|
|
141
|
+
apiKeyIds: PublicQueryApiEndpointListItemApiKeyIdsList;
|
|
142
|
+
/** Database roles used by the endpoint. */
|
|
143
|
+
roles: PublicQueryApiEndpointListItemRolesList;
|
|
144
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
145
|
+
allowedOrigins: PublicQueryApiEndpointListItemAllowedOriginsList;
|
|
146
|
+
/** Public URL used to execute the endpoint. */
|
|
147
|
+
url: string;
|
|
148
|
+
/** Owner type of the Query API endpoint. Endpoints with a user owned query cannot be updated or deleted through this API. */
|
|
149
|
+
ownerType: PublicQueryApiEndpointListItemOwnerType;
|
|
150
|
+
}
|
|
151
|
+
/** Active Query API endpoints for the service. */
|
|
152
|
+
export type ListQueryApiEndpointsResponseResultList = Array<PublicQueryApiEndpointListItem>;
|
|
153
|
+
export interface ListQueryApiEndpointsResponse {
|
|
154
|
+
/** Active Query API endpoints for the service. */
|
|
155
|
+
result: ListQueryApiEndpointsResponseResultList;
|
|
156
|
+
/** Maximum number of results returned in this page. */
|
|
157
|
+
limit: number;
|
|
158
|
+
/** Total number of results across all pages. It has only informative value, thus is not guaranteed and it is provided on a best-effort basis. Null if the total count is unknown. */
|
|
159
|
+
totalCount: number | null;
|
|
160
|
+
/** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
|
|
161
|
+
nextCursor: string | null;
|
|
162
|
+
/** HTTP status code. */
|
|
163
|
+
status: number;
|
|
164
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
165
|
+
requestId: string;
|
|
166
|
+
}
|
|
167
|
+
/** Default query parameters. */
|
|
168
|
+
export type UpdateQueryApiEndpointRequestParametersMap = { [key: string]: string | undefined };
|
|
169
|
+
/** API key IDs allowed to call the endpoint. */
|
|
170
|
+
export type UpdateQueryApiEndpointRequestApiKeyIdsList = Array<string>;
|
|
171
|
+
/** Database roles used by the endpoint. */
|
|
172
|
+
export type UpdateQueryApiEndpointRequestRolesList = Array<string>;
|
|
173
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
174
|
+
export type UpdateQueryApiEndpointRequestAllowedOriginsList = Array<string>;
|
|
175
|
+
export interface UpdateQueryApiEndpointRequest {
|
|
176
|
+
/** ID of the requested organization. */
|
|
177
|
+
organizationId: string;
|
|
178
|
+
/** ID of the requested service. */
|
|
179
|
+
serviceId: string;
|
|
180
|
+
/** ID of the requested Query API endpoint. */
|
|
181
|
+
endpointId: string;
|
|
182
|
+
/** Name of the Query API endpoint. */
|
|
183
|
+
name: string;
|
|
184
|
+
/** SQL executed by the endpoint. */
|
|
185
|
+
sql: string;
|
|
186
|
+
/** Database used by the Query API endpoint. */
|
|
187
|
+
database: string;
|
|
188
|
+
/** Default query parameters. */
|
|
189
|
+
parameters?: UpdateQueryApiEndpointRequestParametersMap | undefined;
|
|
190
|
+
/** API key IDs allowed to call the endpoint. */
|
|
191
|
+
apiKeyIds: UpdateQueryApiEndpointRequestApiKeyIdsList;
|
|
192
|
+
/** Database roles used by the endpoint. */
|
|
193
|
+
roles: UpdateQueryApiEndpointRequestRolesList;
|
|
194
|
+
/** Origins allowed by the endpoint CORS policy. */
|
|
195
|
+
allowedOrigins?: UpdateQueryApiEndpointRequestAllowedOriginsList | undefined;
|
|
196
|
+
}
|
|
197
|
+
export type CreateQueryApiEndpointError = ClickHouseCloudOpError;
|
|
198
|
+
/** Create a Query API endpoint Creates a Query API endpoint. */
|
|
199
|
+
export const createQueryApiEndpoint: API.OperationMethod<
|
|
200
|
+
CreateQueryApiEndpointRequest,
|
|
201
|
+
PublicQueryApiEndpoint,
|
|
202
|
+
CreateQueryApiEndpointError,
|
|
203
|
+
ClickHouseCloudOpContext
|
|
204
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
205
|
+
input: __S(0, __c0, 0) as any as S.Schema<CreateQueryApiEndpointRequest>,
|
|
206
|
+
output: __S(9, __c2, 1) as any as S.Schema<PublicQueryApiEndpoint>,
|
|
207
|
+
errors: [],
|
|
208
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
209
|
+
protocol: ClickHouseCloudProtocol,
|
|
210
|
+
retry: Retry.Retry,
|
|
211
|
+
telemetry: TELEMETRY,
|
|
212
|
+
span: "CreateQueryApiEndpoint",
|
|
213
|
+
}));
|
|
214
|
+
|
|
215
|
+
export type DeleteQueryApiEndpointError = ClickHouseCloudOpError;
|
|
216
|
+
/** Delete a Query API endpoint Deletes a Query API endpoint. */
|
|
217
|
+
export const deleteQueryApiEndpoint: API.OperationMethod<
|
|
218
|
+
DeleteQueryApiEndpointRequest,
|
|
219
|
+
DeleteQueryApiEndpointResponse,
|
|
220
|
+
DeleteQueryApiEndpointError,
|
|
221
|
+
ClickHouseCloudOpContext
|
|
222
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
223
|
+
input: __S(12, __c3, 0) as any as S.Schema<DeleteQueryApiEndpointRequest>,
|
|
224
|
+
output: __S(13, __c3, 1) as any as S.Schema<DeleteQueryApiEndpointResponse>,
|
|
225
|
+
errors: [],
|
|
226
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
227
|
+
protocol: ClickHouseCloudProtocol,
|
|
228
|
+
retry: Retry.Retry,
|
|
229
|
+
telemetry: TELEMETRY,
|
|
230
|
+
span: "DeleteQueryApiEndpoint",
|
|
231
|
+
}));
|
|
232
|
+
|
|
233
|
+
export type GetQueryApiEndpointError = ClickHouseCloudOpError;
|
|
234
|
+
/** Get a Query API endpoint Returns a Query API endpoint. */
|
|
235
|
+
export const getQueryApiEndpoint: API.OperationMethod<
|
|
236
|
+
GetQueryApiEndpointRequest,
|
|
237
|
+
PublicQueryApiEndpoint,
|
|
238
|
+
GetQueryApiEndpointError,
|
|
239
|
+
ClickHouseCloudOpContext
|
|
240
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
241
|
+
input: __S(16, __c4, 0) as any as S.Schema<GetQueryApiEndpointRequest>,
|
|
242
|
+
output: __S(9, __c2, 1) as any as S.Schema<PublicQueryApiEndpoint>,
|
|
243
|
+
errors: [],
|
|
244
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
245
|
+
protocol: ClickHouseCloudProtocol,
|
|
246
|
+
retry: Retry.Retry,
|
|
247
|
+
telemetry: TELEMETRY,
|
|
248
|
+
span: "GetQueryApiEndpoint",
|
|
249
|
+
}));
|
|
250
|
+
|
|
251
|
+
export type ListQueryApiEndpointsError = ClickHouseCloudOpError;
|
|
252
|
+
/** List Query API endpoints Returns all active Query API endpoints for the service. */
|
|
253
|
+
export const listQueryApiEndpoints: API.PaginatedOperationMethod<
|
|
254
|
+
ListQueryApiEndpointsRequest,
|
|
255
|
+
ListQueryApiEndpointsResponse,
|
|
256
|
+
ListQueryApiEndpointsError,
|
|
257
|
+
ClickHouseCloudOpContext,
|
|
258
|
+
PublicQueryApiEndpointListItem
|
|
259
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
260
|
+
() => ({
|
|
261
|
+
input: __S(20, __c5, 0) as any as S.Schema<ListQueryApiEndpointsRequest>,
|
|
262
|
+
output: __S(23, __c5, 3) as any as S.Schema<ListQueryApiEndpointsResponse>,
|
|
263
|
+
errors: [],
|
|
264
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
265
|
+
protocol: ClickHouseCloudPaginatedProtocol,
|
|
266
|
+
retry: Retry.Retry,
|
|
267
|
+
telemetry: TELEMETRY,
|
|
268
|
+
span: "ListQueryApiEndpoints",
|
|
269
|
+
pagination: {
|
|
270
|
+
mode: "cursor",
|
|
271
|
+
inputToken: "cursor",
|
|
272
|
+
outputToken: "nextCursor",
|
|
273
|
+
items: "result",
|
|
274
|
+
pageSize: "limit",
|
|
275
|
+
} as const,
|
|
276
|
+
}),
|
|
277
|
+
paginateCursor,
|
|
278
|
+
) as any;
|
|
279
|
+
|
|
280
|
+
export type UpdateQueryApiEndpointError = ClickHouseCloudOpError;
|
|
281
|
+
/** Update a Query API endpoint Updates a Query API endpoint. */
|
|
282
|
+
export const updateQueryApiEndpoint: API.OperationMethod<
|
|
283
|
+
UpdateQueryApiEndpointRequest,
|
|
284
|
+
PublicQueryApiEndpoint,
|
|
285
|
+
UpdateQueryApiEndpointError,
|
|
286
|
+
ClickHouseCloudOpContext
|
|
287
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
288
|
+
input: __S(24, __c6, 0) as any as S.Schema<UpdateQueryApiEndpointRequest>,
|
|
289
|
+
output: __S(9, __c2, 1) as any as S.Schema<PublicQueryApiEndpoint>,
|
|
290
|
+
errors: [],
|
|
291
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
292
|
+
protocol: ClickHouseCloudProtocol,
|
|
293
|
+
retry: Retry.Retry,
|
|
294
|
+
telemetry: TELEMETRY,
|
|
295
|
+
span: "UpdateQueryApiEndpoint",
|
|
296
|
+
}));
|
|
297
|
+
|
|
298
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
299
|
+
function __c0(j: number): any {
|
|
300
|
+
switch (j) {
|
|
301
|
+
case 0:
|
|
302
|
+
return S.suspend(() =>
|
|
303
|
+
S.Struct({
|
|
304
|
+
organizationId: S.String.pipe(T.Label()),
|
|
305
|
+
serviceId: S.String.pipe(T.Label()),
|
|
306
|
+
name: S.String,
|
|
307
|
+
sql: S.String,
|
|
308
|
+
database: S.String,
|
|
309
|
+
parameters: S.optional(__S(8, __c2, 0)),
|
|
310
|
+
apiKeyIds: __S(4, __c1, 0),
|
|
311
|
+
roles: __S(4, __c1, 0),
|
|
312
|
+
allowedOrigins: S.optional(__S(4, __c1, 0)),
|
|
313
|
+
}).pipe(
|
|
314
|
+
T.Http({
|
|
315
|
+
method: "POST",
|
|
316
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/query-api-endpoints",
|
|
317
|
+
code: 200,
|
|
318
|
+
}),
|
|
319
|
+
),
|
|
320
|
+
).annotate({ identifier: "CreateQueryApiEndpointRequest" });
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function __c1(j: number): any {
|
|
324
|
+
switch (j) {
|
|
325
|
+
case 0:
|
|
326
|
+
return S.Array(S.String);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function __c2(j: number): any {
|
|
330
|
+
switch (j) {
|
|
331
|
+
case 0:
|
|
332
|
+
return S.Record(S.String, S.String);
|
|
333
|
+
case 1:
|
|
334
|
+
return S.suspend(() =>
|
|
335
|
+
S.Struct({
|
|
336
|
+
id: S.String,
|
|
337
|
+
name: S.String,
|
|
338
|
+
sql: S.String,
|
|
339
|
+
database: S.String,
|
|
340
|
+
parameters: __S(8, __c2, 0),
|
|
341
|
+
apiKeyIds: __S(4, __c1, 0),
|
|
342
|
+
roles: __S(4, __c1, 0),
|
|
343
|
+
allowedOrigins: __S(4, __c1, 0),
|
|
344
|
+
url: S.String,
|
|
345
|
+
ownerType: S.String,
|
|
346
|
+
}),
|
|
347
|
+
).annotate({ identifier: "PublicQueryApiEndpoint" });
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function __c3(j: number): any {
|
|
351
|
+
switch (j) {
|
|
352
|
+
case 0:
|
|
353
|
+
return S.suspend(() =>
|
|
354
|
+
S.Struct({
|
|
355
|
+
organizationId: S.String.pipe(T.Label()),
|
|
356
|
+
serviceId: S.String.pipe(T.Label()),
|
|
357
|
+
endpointId: S.String.pipe(T.Label()),
|
|
358
|
+
}).pipe(
|
|
359
|
+
T.Http({
|
|
360
|
+
method: "DELETE",
|
|
361
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/query-api-endpoints/{endpointId}",
|
|
362
|
+
code: 200,
|
|
363
|
+
}),
|
|
364
|
+
),
|
|
365
|
+
).annotate({ identifier: "DeleteQueryApiEndpointRequest" });
|
|
366
|
+
case 1:
|
|
367
|
+
return S.suspend(() =>
|
|
368
|
+
S.Struct({
|
|
369
|
+
status: S.Number,
|
|
370
|
+
requestId: S.String,
|
|
371
|
+
}),
|
|
372
|
+
).annotate({ identifier: "DeleteQueryApiEndpointResponse" });
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function __c4(j: number): any {
|
|
376
|
+
switch (j) {
|
|
377
|
+
case 0:
|
|
378
|
+
return S.suspend(() =>
|
|
379
|
+
S.Struct({
|
|
380
|
+
organizationId: S.String.pipe(T.Label()),
|
|
381
|
+
serviceId: S.String.pipe(T.Label()),
|
|
382
|
+
endpointId: S.String.pipe(T.Label()),
|
|
383
|
+
}).pipe(
|
|
384
|
+
T.Http({
|
|
385
|
+
method: "GET",
|
|
386
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/query-api-endpoints/{endpointId}",
|
|
387
|
+
code: 200,
|
|
388
|
+
}),
|
|
389
|
+
),
|
|
390
|
+
).annotate({ identifier: "GetQueryApiEndpointRequest" });
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
function __c5(j: number): any {
|
|
394
|
+
switch (j) {
|
|
395
|
+
case 0:
|
|
396
|
+
return S.suspend(() =>
|
|
397
|
+
S.Struct({
|
|
398
|
+
organizationId: S.String.pipe(T.Label()),
|
|
399
|
+
serviceId: S.String.pipe(T.Label()),
|
|
400
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
401
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
402
|
+
}).pipe(
|
|
403
|
+
T.Http({
|
|
404
|
+
method: "GET",
|
|
405
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/query-api-endpoints",
|
|
406
|
+
code: 200,
|
|
407
|
+
}),
|
|
408
|
+
),
|
|
409
|
+
).annotate({ identifier: "ListQueryApiEndpointsRequest" });
|
|
410
|
+
case 1:
|
|
411
|
+
return S.suspend(() =>
|
|
412
|
+
S.Struct({
|
|
413
|
+
id: S.String,
|
|
414
|
+
name: S.String,
|
|
415
|
+
database: S.String,
|
|
416
|
+
apiKeyIds: __S(4, __c1, 0),
|
|
417
|
+
roles: __S(4, __c1, 0),
|
|
418
|
+
allowedOrigins: __S(4, __c1, 0),
|
|
419
|
+
url: S.String,
|
|
420
|
+
ownerType: S.String,
|
|
421
|
+
}),
|
|
422
|
+
).annotate({ identifier: "PublicQueryApiEndpointListItem" });
|
|
423
|
+
case 2:
|
|
424
|
+
return S.Array(__S(21, __c5, 1));
|
|
425
|
+
case 3:
|
|
426
|
+
return S.suspend(() =>
|
|
427
|
+
S.Struct({
|
|
428
|
+
result: __S(22, __c5, 2),
|
|
429
|
+
limit: S.Number,
|
|
430
|
+
totalCount: S.NullOr(S.Number),
|
|
431
|
+
nextCursor: S.NullOr(S.String),
|
|
432
|
+
status: S.Number,
|
|
433
|
+
requestId: S.String,
|
|
434
|
+
}),
|
|
435
|
+
).annotate({ identifier: "ListQueryApiEndpointsResponse" });
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function __c6(j: number): any {
|
|
439
|
+
switch (j) {
|
|
440
|
+
case 0:
|
|
441
|
+
return S.suspend(() =>
|
|
442
|
+
S.Struct({
|
|
443
|
+
organizationId: S.String.pipe(T.Label()),
|
|
444
|
+
serviceId: S.String.pipe(T.Label()),
|
|
445
|
+
endpointId: S.String.pipe(T.Label()),
|
|
446
|
+
name: S.String,
|
|
447
|
+
sql: S.String,
|
|
448
|
+
database: S.String,
|
|
449
|
+
parameters: S.optional(__S(8, __c2, 0)),
|
|
450
|
+
apiKeyIds: __S(4, __c1, 0),
|
|
451
|
+
roles: __S(4, __c1, 0),
|
|
452
|
+
allowedOrigins: S.optional(__S(4, __c1, 0)),
|
|
453
|
+
}).pipe(
|
|
454
|
+
T.Http({
|
|
455
|
+
method: "PUT",
|
|
456
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/query-api-endpoints/{endpointId}",
|
|
457
|
+
code: 200,
|
|
458
|
+
}),
|
|
459
|
+
),
|
|
460
|
+
).annotate({ identifier: "UpdateQueryApiEndpointRequest" });
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
464
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
465
|
+
return (__s[i] ??= __L.at(f, j));
|
|
466
|
+
}
|