@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,384 @@
|
|
|
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: "SavedQueries",
|
|
29
|
+
labels: "clickhouse_cloud",
|
|
30
|
+
propagate: "w3c",
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
/** Default query parameters. */
|
|
34
|
+
export type CreateSavedQueryRequestParametersMap = { [key: string]: string | undefined };
|
|
35
|
+
export interface CreateSavedQueryRequest {
|
|
36
|
+
/** ID of the requested organization. */
|
|
37
|
+
organizationId: string;
|
|
38
|
+
/** ID of the requested service. */
|
|
39
|
+
serviceId: string;
|
|
40
|
+
/** Name of the saved query. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Saved SQL query. */
|
|
43
|
+
sql: string;
|
|
44
|
+
/** Database used by the saved query. */
|
|
45
|
+
database: string;
|
|
46
|
+
/** Default query parameters. */
|
|
47
|
+
parameters?: CreateSavedQueryRequestParametersMap | undefined;
|
|
48
|
+
}
|
|
49
|
+
/** Query parameters. */
|
|
50
|
+
export type PublicSavedQueryParametersMap = { [key: string]: string | undefined };
|
|
51
|
+
export interface PublicSavedQuery {
|
|
52
|
+
/** Unique ID of the saved query. */
|
|
53
|
+
id: string;
|
|
54
|
+
/** Name of the saved query. */
|
|
55
|
+
name: string;
|
|
56
|
+
/** Saved SQL query. */
|
|
57
|
+
sql: string;
|
|
58
|
+
/** Database used by the saved query. */
|
|
59
|
+
database: string;
|
|
60
|
+
/** Query parameters. */
|
|
61
|
+
parameters: PublicSavedQueryParametersMap;
|
|
62
|
+
}
|
|
63
|
+
export interface DeleteSavedQueryRequest {
|
|
64
|
+
/** ID of the requested organization. */
|
|
65
|
+
organizationId: string;
|
|
66
|
+
/** ID of the requested service. */
|
|
67
|
+
serviceId: string;
|
|
68
|
+
/** ID of the requested saved query. */
|
|
69
|
+
queryId: string;
|
|
70
|
+
}
|
|
71
|
+
export interface DeleteSavedQueryResponse {
|
|
72
|
+
/** HTTP status code. */
|
|
73
|
+
status: number;
|
|
74
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
75
|
+
requestId: string;
|
|
76
|
+
}
|
|
77
|
+
export interface GetSavedQueryRequest {
|
|
78
|
+
/** ID of the requested organization. */
|
|
79
|
+
organizationId: string;
|
|
80
|
+
/** ID of the requested service. */
|
|
81
|
+
serviceId: string;
|
|
82
|
+
/** ID of the requested saved query. */
|
|
83
|
+
queryId: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ListSavedQueriesRequest {
|
|
86
|
+
/** ID of the requested organization. */
|
|
87
|
+
organizationId: string;
|
|
88
|
+
/** ID of the requested service. */
|
|
89
|
+
serviceId: string;
|
|
90
|
+
/** Cursor returned as `nextCursor` on the previous page. */
|
|
91
|
+
cursor?: string | undefined;
|
|
92
|
+
/** Maximum number of records to return per page. Defaults to 100. Maximum is 100. */
|
|
93
|
+
limit?: number | undefined;
|
|
94
|
+
}
|
|
95
|
+
export interface PublicSavedQueryListItem {
|
|
96
|
+
/** Unique ID of the saved query. */
|
|
97
|
+
id: string;
|
|
98
|
+
/** Name of the saved query. */
|
|
99
|
+
name: string;
|
|
100
|
+
/** Database used by the saved query. */
|
|
101
|
+
database: string;
|
|
102
|
+
}
|
|
103
|
+
/** Saved queries for the service. */
|
|
104
|
+
export type ListSavedQueriesResponseResultList = Array<PublicSavedQueryListItem>;
|
|
105
|
+
export interface ListSavedQueriesResponse {
|
|
106
|
+
/** Saved queries for the service. */
|
|
107
|
+
result: ListSavedQueriesResponseResultList;
|
|
108
|
+
/** Maximum number of results returned in this page. */
|
|
109
|
+
limit: number;
|
|
110
|
+
/** 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. */
|
|
111
|
+
totalCount: number | null;
|
|
112
|
+
/** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
|
|
113
|
+
nextCursor: string | null;
|
|
114
|
+
/** HTTP status code. */
|
|
115
|
+
status: number;
|
|
116
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
117
|
+
requestId: string;
|
|
118
|
+
}
|
|
119
|
+
/** Default query parameters. */
|
|
120
|
+
export type UpdateSavedQueryRequestParametersMap = { [key: string]: string | undefined };
|
|
121
|
+
export interface UpdateSavedQueryRequest {
|
|
122
|
+
/** ID of the requested organization. */
|
|
123
|
+
organizationId: string;
|
|
124
|
+
/** ID of the requested service. */
|
|
125
|
+
serviceId: string;
|
|
126
|
+
/** ID of the requested saved query. */
|
|
127
|
+
queryId: string;
|
|
128
|
+
/** Name of the saved query. */
|
|
129
|
+
name: string;
|
|
130
|
+
/** Saved SQL query. */
|
|
131
|
+
sql: string;
|
|
132
|
+
/** Database used by the saved query. */
|
|
133
|
+
database: string;
|
|
134
|
+
/** Default query parameters. */
|
|
135
|
+
parameters?: UpdateSavedQueryRequestParametersMap | undefined;
|
|
136
|
+
}
|
|
137
|
+
export type CreateSavedQueryError = ClickHouseCloudOpError;
|
|
138
|
+
/** Create a saved query Creates a saved query. */
|
|
139
|
+
export const createSavedQuery: API.OperationMethod<
|
|
140
|
+
CreateSavedQueryRequest,
|
|
141
|
+
PublicSavedQuery,
|
|
142
|
+
CreateSavedQueryError,
|
|
143
|
+
ClickHouseCloudOpContext
|
|
144
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
145
|
+
input: __S(0, __c0, 0) as any as S.Schema<CreateSavedQueryRequest>,
|
|
146
|
+
output: __S(5, __c1, 1) as any as S.Schema<PublicSavedQuery>,
|
|
147
|
+
errors: [],
|
|
148
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
149
|
+
protocol: ClickHouseCloudProtocol,
|
|
150
|
+
retry: Retry.Retry,
|
|
151
|
+
telemetry: TELEMETRY,
|
|
152
|
+
span: "CreateSavedQuery",
|
|
153
|
+
}));
|
|
154
|
+
|
|
155
|
+
export type DeleteSavedQueryError = ClickHouseCloudOpError;
|
|
156
|
+
/** Delete a saved query Deletes a saved query. */
|
|
157
|
+
export const deleteSavedQuery: API.OperationMethod<
|
|
158
|
+
DeleteSavedQueryRequest,
|
|
159
|
+
DeleteSavedQueryResponse,
|
|
160
|
+
DeleteSavedQueryError,
|
|
161
|
+
ClickHouseCloudOpContext
|
|
162
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
163
|
+
input: __S(8, __c2, 0) as any as S.Schema<DeleteSavedQueryRequest>,
|
|
164
|
+
output: __S(9, __c2, 1) as any as S.Schema<DeleteSavedQueryResponse>,
|
|
165
|
+
errors: [],
|
|
166
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
167
|
+
protocol: ClickHouseCloudProtocol,
|
|
168
|
+
retry: Retry.Retry,
|
|
169
|
+
telemetry: TELEMETRY,
|
|
170
|
+
span: "DeleteSavedQuery",
|
|
171
|
+
}));
|
|
172
|
+
|
|
173
|
+
export type GetSavedQueryError = ClickHouseCloudOpError;
|
|
174
|
+
/** Get a saved query Returns a saved query. */
|
|
175
|
+
export const getSavedQuery: API.OperationMethod<
|
|
176
|
+
GetSavedQueryRequest,
|
|
177
|
+
PublicSavedQuery,
|
|
178
|
+
GetSavedQueryError,
|
|
179
|
+
ClickHouseCloudOpContext
|
|
180
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
181
|
+
input: __S(12, __c3, 0) as any as S.Schema<GetSavedQueryRequest>,
|
|
182
|
+
output: __S(5, __c1, 1) as any as S.Schema<PublicSavedQuery>,
|
|
183
|
+
errors: [],
|
|
184
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
185
|
+
protocol: ClickHouseCloudProtocol,
|
|
186
|
+
retry: Retry.Retry,
|
|
187
|
+
telemetry: TELEMETRY,
|
|
188
|
+
span: "GetSavedQuery",
|
|
189
|
+
}));
|
|
190
|
+
|
|
191
|
+
export type ListSavedQueriesError = ClickHouseCloudOpError;
|
|
192
|
+
/** List saved queries Returns saved queries for the service. */
|
|
193
|
+
export const listSavedQueries: API.PaginatedOperationMethod<
|
|
194
|
+
ListSavedQueriesRequest,
|
|
195
|
+
ListSavedQueriesResponse,
|
|
196
|
+
ListSavedQueriesError,
|
|
197
|
+
ClickHouseCloudOpContext,
|
|
198
|
+
PublicSavedQueryListItem
|
|
199
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
200
|
+
() => ({
|
|
201
|
+
input: __S(16, __c4, 0) as any as S.Schema<ListSavedQueriesRequest>,
|
|
202
|
+
output: __S(19, __c4, 3) as any as S.Schema<ListSavedQueriesResponse>,
|
|
203
|
+
errors: [],
|
|
204
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
205
|
+
protocol: ClickHouseCloudPaginatedProtocol,
|
|
206
|
+
retry: Retry.Retry,
|
|
207
|
+
telemetry: TELEMETRY,
|
|
208
|
+
span: "ListSavedQueries",
|
|
209
|
+
pagination: {
|
|
210
|
+
mode: "cursor",
|
|
211
|
+
inputToken: "cursor",
|
|
212
|
+
outputToken: "nextCursor",
|
|
213
|
+
items: "result",
|
|
214
|
+
pageSize: "limit",
|
|
215
|
+
} as const,
|
|
216
|
+
}),
|
|
217
|
+
paginateCursor,
|
|
218
|
+
) as any;
|
|
219
|
+
|
|
220
|
+
export type UpdateSavedQueryError = ClickHouseCloudOpError;
|
|
221
|
+
/** Update a saved query Updates a saved query. */
|
|
222
|
+
export const updateSavedQuery: API.OperationMethod<
|
|
223
|
+
UpdateSavedQueryRequest,
|
|
224
|
+
PublicSavedQuery,
|
|
225
|
+
UpdateSavedQueryError,
|
|
226
|
+
ClickHouseCloudOpContext
|
|
227
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
228
|
+
input: __S(20, __c5, 0) as any as S.Schema<UpdateSavedQueryRequest>,
|
|
229
|
+
output: __S(5, __c1, 1) as any as S.Schema<PublicSavedQuery>,
|
|
230
|
+
errors: [],
|
|
231
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
232
|
+
protocol: ClickHouseCloudProtocol,
|
|
233
|
+
retry: Retry.Retry,
|
|
234
|
+
telemetry: TELEMETRY,
|
|
235
|
+
span: "UpdateSavedQuery",
|
|
236
|
+
}));
|
|
237
|
+
|
|
238
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
239
|
+
function __c0(j: number): any {
|
|
240
|
+
switch (j) {
|
|
241
|
+
case 0:
|
|
242
|
+
return S.suspend(() =>
|
|
243
|
+
S.Struct({
|
|
244
|
+
organizationId: S.String.pipe(T.Label()),
|
|
245
|
+
serviceId: S.String.pipe(T.Label()),
|
|
246
|
+
name: S.String,
|
|
247
|
+
sql: S.String,
|
|
248
|
+
database: S.String,
|
|
249
|
+
parameters: S.optional(__S(4, __c1, 0)),
|
|
250
|
+
}).pipe(
|
|
251
|
+
T.Http({
|
|
252
|
+
method: "POST",
|
|
253
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/saved-queries",
|
|
254
|
+
code: 200,
|
|
255
|
+
}),
|
|
256
|
+
),
|
|
257
|
+
).annotate({ identifier: "CreateSavedQueryRequest" });
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function __c1(j: number): any {
|
|
261
|
+
switch (j) {
|
|
262
|
+
case 0:
|
|
263
|
+
return S.Record(S.String, S.String);
|
|
264
|
+
case 1:
|
|
265
|
+
return S.suspend(() =>
|
|
266
|
+
S.Struct({
|
|
267
|
+
id: S.String,
|
|
268
|
+
name: S.String,
|
|
269
|
+
sql: S.String,
|
|
270
|
+
database: S.String,
|
|
271
|
+
parameters: __S(4, __c1, 0),
|
|
272
|
+
}),
|
|
273
|
+
).annotate({ identifier: "PublicSavedQuery" });
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function __c2(j: number): any {
|
|
277
|
+
switch (j) {
|
|
278
|
+
case 0:
|
|
279
|
+
return S.suspend(() =>
|
|
280
|
+
S.Struct({
|
|
281
|
+
organizationId: S.String.pipe(T.Label()),
|
|
282
|
+
serviceId: S.String.pipe(T.Label()),
|
|
283
|
+
queryId: S.String.pipe(T.Label()),
|
|
284
|
+
}).pipe(
|
|
285
|
+
T.Http({
|
|
286
|
+
method: "DELETE",
|
|
287
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/saved-queries/{queryId}",
|
|
288
|
+
code: 200,
|
|
289
|
+
}),
|
|
290
|
+
),
|
|
291
|
+
).annotate({ identifier: "DeleteSavedQueryRequest" });
|
|
292
|
+
case 1:
|
|
293
|
+
return S.suspend(() =>
|
|
294
|
+
S.Struct({
|
|
295
|
+
status: S.Number,
|
|
296
|
+
requestId: S.String,
|
|
297
|
+
}),
|
|
298
|
+
).annotate({ identifier: "DeleteSavedQueryResponse" });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function __c3(j: number): any {
|
|
302
|
+
switch (j) {
|
|
303
|
+
case 0:
|
|
304
|
+
return S.suspend(() =>
|
|
305
|
+
S.Struct({
|
|
306
|
+
organizationId: S.String.pipe(T.Label()),
|
|
307
|
+
serviceId: S.String.pipe(T.Label()),
|
|
308
|
+
queryId: S.String.pipe(T.Label()),
|
|
309
|
+
}).pipe(
|
|
310
|
+
T.Http({
|
|
311
|
+
method: "GET",
|
|
312
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/saved-queries/{queryId}",
|
|
313
|
+
code: 200,
|
|
314
|
+
}),
|
|
315
|
+
),
|
|
316
|
+
).annotate({ identifier: "GetSavedQueryRequest" });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function __c4(j: number): any {
|
|
320
|
+
switch (j) {
|
|
321
|
+
case 0:
|
|
322
|
+
return S.suspend(() =>
|
|
323
|
+
S.Struct({
|
|
324
|
+
organizationId: S.String.pipe(T.Label()),
|
|
325
|
+
serviceId: S.String.pipe(T.Label()),
|
|
326
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
327
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
328
|
+
}).pipe(
|
|
329
|
+
T.Http({
|
|
330
|
+
method: "GET",
|
|
331
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/saved-queries",
|
|
332
|
+
code: 200,
|
|
333
|
+
}),
|
|
334
|
+
),
|
|
335
|
+
).annotate({ identifier: "ListSavedQueriesRequest" });
|
|
336
|
+
case 1:
|
|
337
|
+
return S.suspend(() =>
|
|
338
|
+
S.Struct({
|
|
339
|
+
id: S.String,
|
|
340
|
+
name: S.String,
|
|
341
|
+
database: S.String,
|
|
342
|
+
}),
|
|
343
|
+
).annotate({ identifier: "PublicSavedQueryListItem" });
|
|
344
|
+
case 2:
|
|
345
|
+
return S.Array(__S(17, __c4, 1));
|
|
346
|
+
case 3:
|
|
347
|
+
return S.suspend(() =>
|
|
348
|
+
S.Struct({
|
|
349
|
+
result: __S(18, __c4, 2),
|
|
350
|
+
limit: S.Number,
|
|
351
|
+
totalCount: S.NullOr(S.Number),
|
|
352
|
+
nextCursor: S.NullOr(S.String),
|
|
353
|
+
status: S.Number,
|
|
354
|
+
requestId: S.String,
|
|
355
|
+
}),
|
|
356
|
+
).annotate({ identifier: "ListSavedQueriesResponse" });
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function __c5(j: number): any {
|
|
360
|
+
switch (j) {
|
|
361
|
+
case 0:
|
|
362
|
+
return S.suspend(() =>
|
|
363
|
+
S.Struct({
|
|
364
|
+
organizationId: S.String.pipe(T.Label()),
|
|
365
|
+
serviceId: S.String.pipe(T.Label()),
|
|
366
|
+
queryId: S.String.pipe(T.Label()),
|
|
367
|
+
name: S.String,
|
|
368
|
+
sql: S.String,
|
|
369
|
+
database: S.String,
|
|
370
|
+
parameters: S.optional(__S(4, __c1, 0)),
|
|
371
|
+
}).pipe(
|
|
372
|
+
T.Http({
|
|
373
|
+
method: "PUT",
|
|
374
|
+
uri: "/v1/organizations/{organizationId}/services/{serviceId}/saved-queries/{queryId}",
|
|
375
|
+
code: 200,
|
|
376
|
+
}),
|
|
377
|
+
),
|
|
378
|
+
).annotate({ identifier: "UpdateSavedQueryRequest" });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
382
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
383
|
+
return (__s[i] ??= __L.at(f, j));
|
|
384
|
+
}
|