@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,11 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts. Do not edit.
|
|
2
|
+
export * as backup from "./backup.ts";
|
|
3
|
+
export * as billing from "./billing.ts";
|
|
4
|
+
export * as clickPipes from "./click_pipes.ts";
|
|
5
|
+
export * as clickStack from "./click_stack.ts";
|
|
6
|
+
export * as notifications from "./notifications.ts";
|
|
7
|
+
export * as organization from "./organization.ts";
|
|
8
|
+
export * as postgres from "./postgres.ts";
|
|
9
|
+
export * as service from "./service.ts";
|
|
10
|
+
export * as snapshot from "./snapshot.ts";
|
|
11
|
+
export * as userManagement from "./user_management.ts";
|
|
@@ -0,0 +1,451 @@
|
|
|
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: "Notifications",
|
|
29
|
+
labels: "clickhouse_cloud",
|
|
30
|
+
propagate: "w3c",
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
export interface ListMemberNotificationSettingsRequest {
|
|
34
|
+
/** ID of the organization the member belongs to. */
|
|
35
|
+
organizationId: string;
|
|
36
|
+
/** ID of the member whose settings are returned. */
|
|
37
|
+
userId: string;
|
|
38
|
+
/** Maximum number of results to return. */
|
|
39
|
+
limit?: number | undefined;
|
|
40
|
+
/** Opaque cursor from a previous response's `nextCursor`, marking where to resume the list. */
|
|
41
|
+
cursor?: string | undefined;
|
|
42
|
+
/** Filter to settings for this notification type. */
|
|
43
|
+
type?: string | undefined;
|
|
44
|
+
/** Filter to settings for this resource. */
|
|
45
|
+
resource_id?: string | undefined;
|
|
46
|
+
/** Filter to settings for resources of this kind. One of 'service', 'organization', 'clickpipe', 'postgres'. */
|
|
47
|
+
resource_type?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
export interface NotificationSetting {
|
|
50
|
+
/** Notification type the setting applies to, named as in [List notification types](#tag/Notifications/operation/notificationTypesGetList). New types are added over time, so treat this as an open set. */
|
|
51
|
+
type: string;
|
|
52
|
+
/** Kind of resource `resourceId` identifies. Current values: service, organization, clickpipe, postgres. New values may be added over time. [List notification types](#tag/Notifications/operation/notificationTypesGetList) reports the same value for every notification of a given type. */
|
|
53
|
+
resourceType: string;
|
|
54
|
+
/** ID of the resource the setting applies to, of the kind `resourceType` gives. Settings that apply to the organization itself, such as billing notifications, carry the organization ID. */
|
|
55
|
+
resourceId: string;
|
|
56
|
+
/** Delivery channel the setting applies to. One of 'ui', 'email'. */
|
|
57
|
+
channelType: string;
|
|
58
|
+
/** Whether the member receives this notification on this channel for this resource. One of 'enabled', 'disabled'. */
|
|
59
|
+
effect: string;
|
|
60
|
+
}
|
|
61
|
+
export type ListMemberNotificationSettingsResponseResultList = Array<NotificationSetting>;
|
|
62
|
+
export interface ListMemberNotificationSettingsResponse {
|
|
63
|
+
/** HTTP status code. */
|
|
64
|
+
status?: number | undefined;
|
|
65
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
66
|
+
requestId?: string | undefined;
|
|
67
|
+
result: ListMemberNotificationSettingsResponseResultList;
|
|
68
|
+
/** Maximum number of results returned in this page. */
|
|
69
|
+
limit?: number | undefined;
|
|
70
|
+
/** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
|
|
71
|
+
nextCursor?: string | null | undefined;
|
|
72
|
+
}
|
|
73
|
+
export interface ListNotificationsRequest {
|
|
74
|
+
/** ID of the organization the notifications belong to. */
|
|
75
|
+
organizationId: string;
|
|
76
|
+
/** Maximum number of results to return. */
|
|
77
|
+
limit?: number | undefined;
|
|
78
|
+
/** Opaque cursor from a previous response's `nextCursor`, marking where to resume the list. */
|
|
79
|
+
cursor?: string | undefined;
|
|
80
|
+
/** Filter to notifications of this severity: 'info', 'warning', 'critical'. */
|
|
81
|
+
severity?: string | undefined;
|
|
82
|
+
/** Filter to notifications of this type. New types are added over time; the [notification types endpoint](#tag/Notifications/operation/notificationTypesGetList) lists the ones this organization can receive. */
|
|
83
|
+
type?: string | undefined;
|
|
84
|
+
/** Filter to notifications about this resource. A service also matches the notifications of its ClickPipes; pass `resource_type` to narrow to one kind of resource. */
|
|
85
|
+
resource_id?: string | undefined;
|
|
86
|
+
/** Filter to notifications about resources of this kind. One of 'service', 'organization', 'clickpipe', 'postgres'. */
|
|
87
|
+
resource_type?: string | undefined;
|
|
88
|
+
/** Return notifications created at or after this time. An RFC 3339 timestamp, not a bare date. */
|
|
89
|
+
from_date?: string | undefined;
|
|
90
|
+
/** Return notifications created at or before this time. An RFC 3339 timestamp, not a bare date. */
|
|
91
|
+
to_date?: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
export interface Notification {
|
|
94
|
+
/** Unique notification ID. */
|
|
95
|
+
id: string;
|
|
96
|
+
/** Notification type. New types are added over time, so treat this as an open set. */
|
|
97
|
+
type: string;
|
|
98
|
+
/** Severity of the notification. One of 'info', 'warning', 'critical'. */
|
|
99
|
+
severity: string;
|
|
100
|
+
/** Kind of resource the notification is about. One of 'service', 'organization', 'clickpipe', 'postgres'. */
|
|
101
|
+
resourceType: string;
|
|
102
|
+
/** ID of the resource the notification is about. */
|
|
103
|
+
resourceId: string;
|
|
104
|
+
/** Name the resource had when the notification was created. Absent for most notification types; use `resourceId` to identify the resource. */
|
|
105
|
+
resourceName?: string | undefined;
|
|
106
|
+
/** When the notification was created. ISO-8601. */
|
|
107
|
+
createdAt: string;
|
|
108
|
+
/** Short human-readable summary. */
|
|
109
|
+
title: string;
|
|
110
|
+
/** Human-readable body as plain text, with any links written as "label (url)". */
|
|
111
|
+
description: string;
|
|
112
|
+
}
|
|
113
|
+
export type ListNotificationsResponseResultList = Array<Notification>;
|
|
114
|
+
export interface ListNotificationsResponse {
|
|
115
|
+
/** HTTP status code. */
|
|
116
|
+
status?: number | undefined;
|
|
117
|
+
/** Unique id assigned to every request. UUIDv4 */
|
|
118
|
+
requestId?: string | undefined;
|
|
119
|
+
result: ListNotificationsResponseResultList;
|
|
120
|
+
/** Maximum number of results returned in this page. */
|
|
121
|
+
limit?: number | undefined;
|
|
122
|
+
/** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
|
|
123
|
+
nextCursor?: string | null | undefined;
|
|
124
|
+
}
|
|
125
|
+
export interface ListNotificationTypesRequest {
|
|
126
|
+
/** ID of the requested organization. */
|
|
127
|
+
organizationId: string;
|
|
128
|
+
}
|
|
129
|
+
/** Relative importance of notifications of this type. */
|
|
130
|
+
export type NotificationTypeSeverity = "info" | "warning" | "critical";
|
|
131
|
+
export interface NotificationType {
|
|
132
|
+
/** Stable identifier of the notification type. Never renamed or reused. */
|
|
133
|
+
name: string;
|
|
134
|
+
/** Human-readable name of the notification type. */
|
|
135
|
+
title: string;
|
|
136
|
+
/** Longer explanation of what the notification reports. Omitted for types that have none. */
|
|
137
|
+
description?: string | undefined;
|
|
138
|
+
/** Broad grouping the notification type belongs to. Current values: billing, service, clickpipe, postgres. New values may be added over time. */
|
|
139
|
+
category: string;
|
|
140
|
+
/** Relative importance of notifications of this type. */
|
|
141
|
+
severity: NotificationTypeSeverity;
|
|
142
|
+
/** Kind of resource a notification of this type is about. Current values: service, organization, clickpipe, postgres. New values may be added over time. */
|
|
143
|
+
resourceType: string;
|
|
144
|
+
/** Whether the per-role delivery default can be changed. When false the role default is frozen; this does not mean the notification is always delivered. */
|
|
145
|
+
isConfigurable: boolean;
|
|
146
|
+
/** False when the caller lacks the permission this type requires. The type is still returned, just flagged. */
|
|
147
|
+
isAvailable: boolean;
|
|
148
|
+
}
|
|
149
|
+
export type ListNotificationTypesResponseBodyList = Array<NotificationType>;
|
|
150
|
+
export type ListNotificationTypesResponse = ListNotificationTypesResponseBodyList;
|
|
151
|
+
/** Notification types the rule applies to, named as in [List notification types](#tag/Notifications/operation/notificationTypesGetList). */
|
|
152
|
+
export type NotificationSettingRuleNotificationsList = Array<string>;
|
|
153
|
+
/** IDs of the resources the rule applies to, of the kind each notification type reports as its `resourceType`. Name every ID: there are no wildcards, and a rule covers no resource created afterwards. Notification types that apply to the organization itself, such as billing, take the organization ID. */
|
|
154
|
+
export type NotificationSettingRuleResourcesList = Array<string>;
|
|
155
|
+
/** Delivery channels the rule applies to. One of 'ui', 'email'. Omit to apply the rule to every channel. */
|
|
156
|
+
export type NotificationSettingRuleChannelsList = Array<string>;
|
|
157
|
+
export interface NotificationSettingRule {
|
|
158
|
+
/** What the rule does to the settings it names. One of 'enabled', 'disabled', 'inherit'. 'inherit' removes the setting, so the notification follows the platform default for the member's role again, whoever set it. */
|
|
159
|
+
effect: string;
|
|
160
|
+
/** Notification types the rule applies to, named as in [List notification types](#tag/Notifications/operation/notificationTypesGetList). */
|
|
161
|
+
notifications: NotificationSettingRuleNotificationsList;
|
|
162
|
+
/** IDs of the resources the rule applies to, of the kind each notification type reports as its `resourceType`. Name every ID: there are no wildcards, and a rule covers no resource created afterwards. Notification types that apply to the organization itself, such as billing, take the organization ID. */
|
|
163
|
+
resources: NotificationSettingRuleResourcesList;
|
|
164
|
+
/** Delivery channels the rule applies to. One of 'ui', 'email'. Omit to apply the rule to every channel. */
|
|
165
|
+
channels?: NotificationSettingRuleChannelsList | undefined;
|
|
166
|
+
}
|
|
167
|
+
/** Rules to apply. Every rule is applied, in the order given. */
|
|
168
|
+
export type UpdateMemberNotificationSettingsRequestRulesList = Array<NotificationSettingRule>;
|
|
169
|
+
export interface UpdateMemberNotificationSettingsRequest {
|
|
170
|
+
/** ID of the organization the member belongs to. */
|
|
171
|
+
organizationId: string;
|
|
172
|
+
/** ID of the member whose settings are updated. */
|
|
173
|
+
userId: string;
|
|
174
|
+
/** Rules to apply. Every rule is applied, in the order given. */
|
|
175
|
+
rules: UpdateMemberNotificationSettingsRequestRulesList;
|
|
176
|
+
}
|
|
177
|
+
/** The member's settings for what the request addressed, after the change. A setting the request set to 'inherit' is absent, because it no longer exists. */
|
|
178
|
+
export type MemberNotificationSettingsPatchResponseSettingsList = Array<NotificationSetting>;
|
|
179
|
+
export interface MemberNotificationSettingsPatchResponse {
|
|
180
|
+
/** The member's settings for what the request addressed, after the change. A setting the request set to 'inherit' is absent, because it no longer exists. */
|
|
181
|
+
settings: MemberNotificationSettingsPatchResponseSettingsList;
|
|
182
|
+
}
|
|
183
|
+
export type ListMemberNotificationSettingsError = ClickHouseCloudOpError;
|
|
184
|
+
/** List a member's notification settings **Disclaimer:** This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the notification settings an organization member has explicitly chosen. A member who has never changed a setting has none, so an empty list means every notification follows the platform default for their role -- it does not mean notifications are off. Settings for notification types the member cannot use are omitted, which depends on their permissions rather than the caller's. Slack is configured for the whole organization and never appears here. A page holds at most `limit` settings (default 100, maximum 250; a larger value is clamped) and the server may return fewer. Every response carries `limit` and `nextCursor`; pass `nextCursor` as the `cursor` query parameter to fetch the next page, repeating until it is null. */
|
|
185
|
+
export const listMemberNotificationSettings: API.PaginatedOperationMethod<
|
|
186
|
+
ListMemberNotificationSettingsRequest,
|
|
187
|
+
ListMemberNotificationSettingsResponse,
|
|
188
|
+
ListMemberNotificationSettingsError,
|
|
189
|
+
ClickHouseCloudOpContext,
|
|
190
|
+
NotificationSetting
|
|
191
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
192
|
+
() => ({
|
|
193
|
+
input: __S(0, __c0, 0) as any as S.Schema<ListMemberNotificationSettingsRequest>,
|
|
194
|
+
output: __S(1, __c0, 1) as any as S.Schema<ListMemberNotificationSettingsResponse>,
|
|
195
|
+
errors: [],
|
|
196
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
197
|
+
protocol: ClickHouseCloudPaginatedProtocol,
|
|
198
|
+
retry: Retry.Retry,
|
|
199
|
+
telemetry: TELEMETRY,
|
|
200
|
+
span: "ListMemberNotificationSettings",
|
|
201
|
+
pagination: {
|
|
202
|
+
mode: "cursor",
|
|
203
|
+
inputToken: "cursor",
|
|
204
|
+
outputToken: "nextCursor",
|
|
205
|
+
items: "result",
|
|
206
|
+
pageSize: "limit",
|
|
207
|
+
} as const,
|
|
208
|
+
}),
|
|
209
|
+
paginateCursor,
|
|
210
|
+
) as any;
|
|
211
|
+
|
|
212
|
+
export type ListNotificationsError = ClickHouseCloudOpError;
|
|
213
|
+
/** List of organization notifications **Disclaimer:** This beta endpoint is evolving; the API contract may change. <br /><br /> Returns notifications for the organization, most recent first. Only notifications about resources the caller can access are returned, so two keys in the same organization can see different results. The [notification types endpoint](#tag/Notifications/operation/notificationTypesGetList) lists the types this organization can receive, so it shows what to expect here. Notifications are retained for 180 days. A page holds at most `limit` notifications (default 100, maximum 250; a larger value is clamped) and the server may return fewer. Every response carries `limit` and `nextCursor`; pass `nextCursor` as the `cursor` query parameter to fetch the next page, repeating until it is null. */
|
|
214
|
+
export const listNotifications: API.PaginatedOperationMethod<
|
|
215
|
+
ListNotificationsRequest,
|
|
216
|
+
ListNotificationsResponse,
|
|
217
|
+
ListNotificationsError,
|
|
218
|
+
ClickHouseCloudOpContext,
|
|
219
|
+
Notification
|
|
220
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
221
|
+
() => ({
|
|
222
|
+
input: __S(16, __c2, 0) as any as S.Schema<ListNotificationsRequest>,
|
|
223
|
+
output: __S(19, __c2, 3) as any as S.Schema<ListNotificationsResponse>,
|
|
224
|
+
errors: [],
|
|
225
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
226
|
+
protocol: ClickHouseCloudPaginatedProtocol,
|
|
227
|
+
retry: Retry.Retry,
|
|
228
|
+
telemetry: TELEMETRY,
|
|
229
|
+
span: "ListNotifications",
|
|
230
|
+
pagination: {
|
|
231
|
+
mode: "cursor",
|
|
232
|
+
inputToken: "cursor",
|
|
233
|
+
outputToken: "nextCursor",
|
|
234
|
+
items: "result",
|
|
235
|
+
pageSize: "limit",
|
|
236
|
+
} as const,
|
|
237
|
+
}),
|
|
238
|
+
paginateCursor,
|
|
239
|
+
) as any;
|
|
240
|
+
|
|
241
|
+
export type ListNotificationTypesError = ClickHouseCloudOpError;
|
|
242
|
+
/** List notification types **Disclaimer:** This beta endpoint is evolving; the API contract may change. <br /><br /> Returns every notification type the organization is entitled to, each flagged with whether the caller may use it. Types the organization is not entitled to are omitted; types the caller lacks permission to use are returned with `isAvailable` set to false. Every type supports the `ui`, `email` and `slack` channels, so channels are a property of the API rather than of a type. The effective delivery default is a function of type, role and channel, so no per-type default is reported here. */
|
|
243
|
+
export const listNotificationTypes: API.OperationMethod<
|
|
244
|
+
ListNotificationTypesRequest,
|
|
245
|
+
ListNotificationTypesResponse,
|
|
246
|
+
ListNotificationTypesError,
|
|
247
|
+
ClickHouseCloudOpContext
|
|
248
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
249
|
+
input: __S(24, __c3, 0) as any as S.Schema<ListNotificationTypesRequest>,
|
|
250
|
+
output: __S(27, __c3, 3) as any as S.Schema<ListNotificationTypesResponse>,
|
|
251
|
+
errors: [],
|
|
252
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
253
|
+
protocol: ClickHouseCloudProtocol,
|
|
254
|
+
retry: Retry.Retry,
|
|
255
|
+
telemetry: TELEMETRY,
|
|
256
|
+
span: "ListNotificationTypes",
|
|
257
|
+
}));
|
|
258
|
+
|
|
259
|
+
export type UpdateMemberNotificationSettingsError = ClickHouseCloudOpError;
|
|
260
|
+
/** Update a member's notification settings **Disclaimer:** This beta endpoint is evolving; the API contract may change. <br /><br /> Sets the notification settings an organization member has explicitly chosen. Each rule names notification types, resources and channels, and applies one effect to every combination of them. A notification type no rule names keeps the setting it had, so this endpoint never has to carry a member's whole configuration. Three effects: 'enabled' and 'disabled' store an explicit choice, and 'inherit' removes the stored setting so the notification follows the platform default again. Sending the same body twice changes nothing the second time. The request either applies completely or changes nothing: a rule naming a notification type that does not exist, that the member cannot configure, or a resource the caller cannot access is rejected whole, as is a request that names the same type, resource and channel twice. A request carries at most 100 rules, addressing at most 1000 settings in total. */
|
|
261
|
+
export const updateMemberNotificationSettings: API.OperationMethod<
|
|
262
|
+
UpdateMemberNotificationSettingsRequest,
|
|
263
|
+
MemberNotificationSettingsPatchResponse,
|
|
264
|
+
UpdateMemberNotificationSettingsError,
|
|
265
|
+
ClickHouseCloudOpContext
|
|
266
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
267
|
+
input: __S(35, __c4, 3) as any as S.Schema<UpdateMemberNotificationSettingsRequest>,
|
|
268
|
+
output: __S(36, __c4, 4) as any as S.Schema<MemberNotificationSettingsPatchResponse>,
|
|
269
|
+
errors: [],
|
|
270
|
+
serviceErrors: ClickHouseCloudServiceErrors,
|
|
271
|
+
protocol: ClickHouseCloudProtocol,
|
|
272
|
+
retry: Retry.Retry,
|
|
273
|
+
telemetry: TELEMETRY,
|
|
274
|
+
span: "UpdateMemberNotificationSettings",
|
|
275
|
+
}));
|
|
276
|
+
|
|
277
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
278
|
+
function __c0(j: number): any {
|
|
279
|
+
switch (j) {
|
|
280
|
+
case 0:
|
|
281
|
+
return S.suspend(() =>
|
|
282
|
+
S.Struct({
|
|
283
|
+
organizationId: S.String.pipe(T.Label()),
|
|
284
|
+
userId: S.String.pipe(T.Label()),
|
|
285
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
286
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
287
|
+
type: S.optional(S.String.pipe(T.Query())),
|
|
288
|
+
resource_id: S.optional(S.String.pipe(T.Query())),
|
|
289
|
+
resource_type: S.optional(S.String.pipe(T.Query())),
|
|
290
|
+
}).pipe(
|
|
291
|
+
T.Http({
|
|
292
|
+
method: "GET",
|
|
293
|
+
uri: "/v1/organizations/{organizationId}/members/{userId}/notificationSettings",
|
|
294
|
+
code: 200,
|
|
295
|
+
}),
|
|
296
|
+
),
|
|
297
|
+
).annotate({ identifier: "ListMemberNotificationSettingsRequest" });
|
|
298
|
+
case 1:
|
|
299
|
+
return S.suspend(() =>
|
|
300
|
+
S.Struct({
|
|
301
|
+
status: S.optional(S.Number),
|
|
302
|
+
requestId: S.optional(S.String),
|
|
303
|
+
result: __S(9, __c1, 1),
|
|
304
|
+
limit: S.optional(S.Number),
|
|
305
|
+
nextCursor: S.optional(S.NullOr(S.String)),
|
|
306
|
+
}),
|
|
307
|
+
).annotate({ identifier: "ListMemberNotificationSettingsResponse" });
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function __c1(j: number): any {
|
|
311
|
+
switch (j) {
|
|
312
|
+
case 0:
|
|
313
|
+
return S.suspend(() =>
|
|
314
|
+
S.Struct({
|
|
315
|
+
type: S.String,
|
|
316
|
+
resourceType: S.String,
|
|
317
|
+
resourceId: S.String,
|
|
318
|
+
channelType: S.String,
|
|
319
|
+
effect: S.String,
|
|
320
|
+
}),
|
|
321
|
+
).annotate({ identifier: "NotificationSetting" });
|
|
322
|
+
case 1:
|
|
323
|
+
return S.Array(__S(8, __c1, 0));
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function __c2(j: number): any {
|
|
327
|
+
switch (j) {
|
|
328
|
+
case 0:
|
|
329
|
+
return S.suspend(() =>
|
|
330
|
+
S.Struct({
|
|
331
|
+
organizationId: S.String.pipe(T.Label()),
|
|
332
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
333
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
334
|
+
severity: S.optional(S.String.pipe(T.Query())),
|
|
335
|
+
type: S.optional(S.String.pipe(T.Query())),
|
|
336
|
+
resource_id: S.optional(S.String.pipe(T.Query())),
|
|
337
|
+
resource_type: S.optional(S.String.pipe(T.Query())),
|
|
338
|
+
from_date: S.optional(S.String.pipe(T.Query())),
|
|
339
|
+
to_date: S.optional(S.String.pipe(T.Query())),
|
|
340
|
+
}).pipe(
|
|
341
|
+
T.Http({
|
|
342
|
+
method: "GET",
|
|
343
|
+
uri: "/v1/organizations/{organizationId}/notifications",
|
|
344
|
+
code: 200,
|
|
345
|
+
}),
|
|
346
|
+
),
|
|
347
|
+
).annotate({ identifier: "ListNotificationsRequest" });
|
|
348
|
+
case 1:
|
|
349
|
+
return S.suspend(() =>
|
|
350
|
+
S.Struct({
|
|
351
|
+
id: S.String,
|
|
352
|
+
type: S.String,
|
|
353
|
+
severity: S.String,
|
|
354
|
+
resourceType: S.String,
|
|
355
|
+
resourceId: S.String,
|
|
356
|
+
resourceName: S.optional(S.String),
|
|
357
|
+
createdAt: S.String,
|
|
358
|
+
title: S.String,
|
|
359
|
+
description: S.String,
|
|
360
|
+
}),
|
|
361
|
+
).annotate({ identifier: "Notification" });
|
|
362
|
+
case 2:
|
|
363
|
+
return S.Array(__S(17, __c2, 1));
|
|
364
|
+
case 3:
|
|
365
|
+
return S.suspend(() =>
|
|
366
|
+
S.Struct({
|
|
367
|
+
status: S.optional(S.Number),
|
|
368
|
+
requestId: S.optional(S.String),
|
|
369
|
+
result: __S(18, __c2, 2),
|
|
370
|
+
limit: S.optional(S.Number),
|
|
371
|
+
nextCursor: S.optional(S.NullOr(S.String)),
|
|
372
|
+
}),
|
|
373
|
+
).annotate({ identifier: "ListNotificationsResponse" });
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
function __c3(j: number): any {
|
|
377
|
+
switch (j) {
|
|
378
|
+
case 0:
|
|
379
|
+
return S.suspend(() =>
|
|
380
|
+
S.Struct({
|
|
381
|
+
organizationId: S.String.pipe(T.Label()),
|
|
382
|
+
}).pipe(
|
|
383
|
+
T.Http({
|
|
384
|
+
method: "GET",
|
|
385
|
+
uri: "/v1/organizations/{organizationId}/notificationTypes",
|
|
386
|
+
code: 200,
|
|
387
|
+
}),
|
|
388
|
+
),
|
|
389
|
+
).annotate({ identifier: "ListNotificationTypesRequest" });
|
|
390
|
+
case 1:
|
|
391
|
+
return S.suspend(() =>
|
|
392
|
+
S.Struct({
|
|
393
|
+
name: S.String,
|
|
394
|
+
title: S.String,
|
|
395
|
+
description: S.optional(S.String),
|
|
396
|
+
category: S.String,
|
|
397
|
+
severity: S.String,
|
|
398
|
+
resourceType: S.String,
|
|
399
|
+
isConfigurable: S.Boolean,
|
|
400
|
+
isAvailable: S.Boolean,
|
|
401
|
+
}),
|
|
402
|
+
).annotate({ identifier: "NotificationType" });
|
|
403
|
+
case 2:
|
|
404
|
+
return S.Array(__S(25, __c3, 1));
|
|
405
|
+
case 3:
|
|
406
|
+
return S.suspend(() => __S(26, __c3, 2).pipe(T.RawResponseRoot())).annotate({
|
|
407
|
+
identifier: "ListNotificationTypesResponse",
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function __c4(j: number): any {
|
|
412
|
+
switch (j) {
|
|
413
|
+
case 0:
|
|
414
|
+
return S.Array(S.String);
|
|
415
|
+
case 1:
|
|
416
|
+
return S.suspend(() =>
|
|
417
|
+
S.Struct({
|
|
418
|
+
effect: S.String,
|
|
419
|
+
notifications: __S(32, __c4, 0),
|
|
420
|
+
resources: __S(32, __c4, 0),
|
|
421
|
+
channels: S.optional(__S(32, __c4, 0)),
|
|
422
|
+
}),
|
|
423
|
+
).annotate({ identifier: "NotificationSettingRule" });
|
|
424
|
+
case 2:
|
|
425
|
+
return S.Array(__S(33, __c4, 1));
|
|
426
|
+
case 3:
|
|
427
|
+
return S.suspend(() =>
|
|
428
|
+
S.Struct({
|
|
429
|
+
organizationId: S.String.pipe(T.Label()),
|
|
430
|
+
userId: S.String.pipe(T.Label()),
|
|
431
|
+
rules: __S(34, __c4, 2),
|
|
432
|
+
}).pipe(
|
|
433
|
+
T.Http({
|
|
434
|
+
method: "PATCH",
|
|
435
|
+
uri: "/v1/organizations/{organizationId}/members/{userId}/notificationSettings",
|
|
436
|
+
code: 200,
|
|
437
|
+
}),
|
|
438
|
+
),
|
|
439
|
+
).annotate({ identifier: "UpdateMemberNotificationSettingsRequest" });
|
|
440
|
+
case 4:
|
|
441
|
+
return S.suspend(() =>
|
|
442
|
+
S.Struct({
|
|
443
|
+
settings: __S(9, __c1, 1),
|
|
444
|
+
}),
|
|
445
|
+
).annotate({ identifier: "MemberNotificationSettingsPatchResponse" });
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
449
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
450
|
+
return (__s[i] ??= __L.at(f, j));
|
|
451
|
+
}
|