@distilled.cloud/fly-io 1.0.0-rc.14 → 1.0.0-rc.16
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/lib/credentials.d.ts +3 -3
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +43 -38
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +24 -24
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +37 -37
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +31 -31
- package/lib/pagination.d.ts +1 -1
- package/lib/pagination.js +3 -3
- package/lib/protocol.d.ts +2 -2
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +89 -66
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +26 -25
- package/lib/retry.js.map +1 -1
- package/lib/services/addons.d.ts +0 -65
- package/lib/services/addons.d.ts.map +1 -1
- package/lib/services/addons.js +54 -561
- package/lib/services/machines.d.ts +25 -444
- package/lib/services/machines.d.ts.map +1 -1
- package/lib/services/machines.js +317 -2726
- package/lib/services/mpg.d.ts +1 -67
- package/lib/services/mpg.d.ts.map +1 -1
- package/lib/services/mpg.js +75 -448
- package/lib/services/sprites.d.ts +1 -125
- package/lib/services/sprites.d.ts.map +1 -1
- package/lib/services/sprites.js +146 -884
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +14 -14
- package/lib/traits.js.map +1 -1
- package/package.json +13 -9
- package/src/credentials.ts +18 -15
- package/src/errors.ts +26 -28
- package/src/index.ts +2 -2
- package/src/pagination.ts +1 -1
- package/src/protocol.ts +67 -36
- package/src/retry.ts +6 -4
- package/src/services/addons.ts +593 -692
- package/src/services/machines.ts +3332 -3364
- package/src/services/mpg.ts +582 -519
- package/src/services/sprites.ts +1008 -948
- package/src/traits.ts +8 -4
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -126
- package/lib/protocol.test.js.map +0 -1
- package/lib/services/addons.js.map +0 -1
- package/lib/services/machines.js.map +0 -1
- package/lib/services/mpg.js.map +0 -1
- package/lib/services/sprites.js.map +0 -1
- package/lib/sprites-mint.test.d.ts +0 -2
- package/lib/sprites-mint.test.d.ts.map +0 -1
- package/lib/sprites-mint.test.js +0 -169
- package/lib/sprites-mint.test.js.map +0 -1
- package/src/protocol.test.ts +0 -214
- package/src/sprites-mint.test.ts +0 -228
package/src/services/mpg.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as API from "@distilled.cloud/core/api";
|
|
2
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit.
|
|
3
|
-
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as S from "@distilled.cloud/core/schema-lite";
|
|
4
|
+
import * as __L from "@distilled.cloud/core/schema-lite";
|
|
4
5
|
import type * as Redacted from "effect/Redacted";
|
|
5
6
|
import { Conflict, Forbidden, NotFound } from "../errors.ts";
|
|
6
7
|
import { FlyApiProtocol, type FlyIoOpError, type FlyIoOpContext } from "../protocol.ts";
|
|
7
8
|
import * as Retry from "../retry.ts";
|
|
8
9
|
import * as T from "../traits.ts";
|
|
10
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
11
|
+
const __s: any[] = [];
|
|
9
12
|
|
|
10
13
|
export type { FlyIoOpError, FlyIoOpContext };
|
|
11
14
|
|
|
@@ -13,55 +16,20 @@ export interface CreateAttachmentRequest {
|
|
|
13
16
|
id: string;
|
|
14
17
|
app_name: string;
|
|
15
18
|
}
|
|
16
|
-
export const CreateAttachmentRequest = /*@__PURE__*/ S.suspend(() =>
|
|
17
|
-
S.Struct({
|
|
18
|
-
id: S.String.pipe(T.Label()),
|
|
19
|
-
app_name: S.String,
|
|
20
|
-
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/attachments", code: 200 })),
|
|
21
|
-
).annotate({ identifier: "CreateAttachmentRequest" }) as any as S.Schema<CreateAttachmentRequest>;
|
|
22
|
-
|
|
23
19
|
export interface CreateAttachmentResponseData {
|
|
24
20
|
id?: number;
|
|
25
21
|
app_id?: number;
|
|
26
22
|
managed_service_id?: number;
|
|
27
23
|
attached_at?: string;
|
|
28
24
|
}
|
|
29
|
-
export const CreateAttachmentResponseData = /*@__PURE__*/ S.suspend(() =>
|
|
30
|
-
S.Struct({
|
|
31
|
-
id: S.optional(S.Number),
|
|
32
|
-
app_id: S.optional(S.Number),
|
|
33
|
-
managed_service_id: S.optional(S.Number),
|
|
34
|
-
attached_at: S.optional(S.String),
|
|
35
|
-
}),
|
|
36
|
-
).annotate({
|
|
37
|
-
identifier: "CreateAttachmentResponseData",
|
|
38
|
-
}) as any as S.Schema<CreateAttachmentResponseData>;
|
|
39
|
-
|
|
40
25
|
export interface CreateAttachmentResponse {
|
|
41
26
|
data?: CreateAttachmentResponseData;
|
|
42
27
|
}
|
|
43
|
-
export const CreateAttachmentResponse = /*@__PURE__*/ S.suspend(() =>
|
|
44
|
-
S.Struct({
|
|
45
|
-
data: S.optional(CreateAttachmentResponseData),
|
|
46
|
-
}),
|
|
47
|
-
).annotate({ identifier: "CreateAttachmentResponse" }) as any as S.Schema<CreateAttachmentResponse>;
|
|
48
|
-
|
|
49
28
|
export interface CreateBackupRequest {
|
|
50
29
|
id: string;
|
|
51
30
|
type?: string;
|
|
52
31
|
}
|
|
53
|
-
export const CreateBackupRequest = /*@__PURE__*/ S.suspend(() =>
|
|
54
|
-
S.Struct({
|
|
55
|
-
id: S.String.pipe(T.Label()),
|
|
56
|
-
type: S.optional(S.String),
|
|
57
|
-
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/backups", code: 200 })),
|
|
58
|
-
).annotate({ identifier: "CreateBackupRequest" }) as any as S.Schema<CreateBackupRequest>;
|
|
59
|
-
|
|
60
32
|
export interface CreateBackupResponse {}
|
|
61
|
-
export const CreateBackupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
62
|
-
identifier: "CreateBackupResponse",
|
|
63
|
-
}) as any as S.Schema<CreateBackupResponse>;
|
|
64
|
-
|
|
65
33
|
export interface CreateClusterRequest {
|
|
66
34
|
org_slug: string;
|
|
67
35
|
name: string;
|
|
@@ -71,57 +39,18 @@ export interface CreateClusterRequest {
|
|
|
71
39
|
storage_in_gb?: number;
|
|
72
40
|
postgis_enabled?: boolean;
|
|
73
41
|
}
|
|
74
|
-
export const CreateClusterRequest = /*@__PURE__*/ S.suspend(() =>
|
|
75
|
-
S.Struct({
|
|
76
|
-
org_slug: S.String.pipe(T.Label()),
|
|
77
|
-
name: S.String,
|
|
78
|
-
region: S.String,
|
|
79
|
-
plan: S.String,
|
|
80
|
-
pg_major_version: S.optional(S.String),
|
|
81
|
-
storage_in_gb: S.optional(S.Number),
|
|
82
|
-
postgis_enabled: S.optional(S.Boolean),
|
|
83
|
-
}).pipe(
|
|
84
|
-
T.Http({ method: "POST", uri: "/api/v1/organizations/{org_slug}/postgresv2", code: 200 }),
|
|
85
|
-
),
|
|
86
|
-
).annotate({ identifier: "CreateClusterRequest" }) as any as S.Schema<CreateClusterRequest>;
|
|
87
|
-
|
|
88
42
|
export interface Organization {
|
|
89
43
|
id?: string;
|
|
90
44
|
name?: string;
|
|
91
45
|
slug?: string;
|
|
92
46
|
raw_slug?: string;
|
|
93
47
|
}
|
|
94
|
-
export const Organization = /*@__PURE__*/ S.suspend(() =>
|
|
95
|
-
S.Struct({
|
|
96
|
-
id: S.optional(S.String),
|
|
97
|
-
name: S.optional(S.String),
|
|
98
|
-
slug: S.optional(S.String),
|
|
99
|
-
raw_slug: S.optional(S.String),
|
|
100
|
-
}),
|
|
101
|
-
).annotate({ identifier: "Organization" }) as any as S.Schema<Organization>;
|
|
102
|
-
|
|
103
48
|
export type IpAssignments = { [key: string]: string | undefined };
|
|
104
|
-
export const IpAssignments = /*@__PURE__*/ S.Record(
|
|
105
|
-
S.String,
|
|
106
|
-
S.String,
|
|
107
|
-
) as any as S.Schema<IpAssignments>;
|
|
108
|
-
|
|
109
49
|
export interface AttachedApp {
|
|
110
50
|
name?: string;
|
|
111
51
|
id?: string;
|
|
112
52
|
}
|
|
113
|
-
export const AttachedApp = /*@__PURE__*/ S.suspend(() =>
|
|
114
|
-
S.Struct({
|
|
115
|
-
name: S.optional(S.String),
|
|
116
|
-
id: S.optional(S.String),
|
|
117
|
-
}),
|
|
118
|
-
).annotate({ identifier: "AttachedApp" }) as any as S.Schema<AttachedApp>;
|
|
119
|
-
|
|
120
53
|
export type ManagedClusterAttachedAppsList = Array<AttachedApp>;
|
|
121
|
-
export const ManagedClusterAttachedAppsList = /*@__PURE__*/ S.Array(
|
|
122
|
-
AttachedApp,
|
|
123
|
-
) as any as S.Schema<ManagedClusterAttachedAppsList>;
|
|
124
|
-
|
|
125
54
|
export interface ManagedCluster {
|
|
126
55
|
id?: string;
|
|
127
56
|
name?: string;
|
|
@@ -138,195 +67,58 @@ export interface ManagedCluster {
|
|
|
138
67
|
postgis_enabled?: boolean;
|
|
139
68
|
environment?: string;
|
|
140
69
|
}
|
|
141
|
-
export const ManagedCluster = /*@__PURE__*/ S.suspend(() =>
|
|
142
|
-
S.Struct({
|
|
143
|
-
id: S.optional(S.String),
|
|
144
|
-
name: S.optional(S.String),
|
|
145
|
-
status: S.optional(S.String),
|
|
146
|
-
engine: S.optional(S.String),
|
|
147
|
-
plan: S.optional(S.String),
|
|
148
|
-
region: S.optional(S.String),
|
|
149
|
-
organization: S.optional(Organization),
|
|
150
|
-
mpgd_cluster_id: S.optional(S.String),
|
|
151
|
-
disk: S.optional(S.Number),
|
|
152
|
-
replicas: S.optional(S.Number),
|
|
153
|
-
ip_assignments: S.optional(IpAssignments),
|
|
154
|
-
attached_apps: S.optional(ManagedClusterAttachedAppsList),
|
|
155
|
-
postgis_enabled: S.optional(S.Boolean),
|
|
156
|
-
environment: S.optional(S.String),
|
|
157
|
-
}),
|
|
158
|
-
).annotate({ identifier: "ManagedCluster" }) as any as S.Schema<ManagedCluster>;
|
|
159
|
-
|
|
160
70
|
export type CreateClusterResponseErrorsMap = { [key: string]: unknown | undefined };
|
|
161
|
-
export const CreateClusterResponseErrorsMap = /*@__PURE__*/ S.Record(
|
|
162
|
-
S.String,
|
|
163
|
-
S.Unknown,
|
|
164
|
-
) as any as S.Schema<CreateClusterResponseErrorsMap>;
|
|
165
|
-
|
|
166
71
|
export interface CreateClusterResponse {
|
|
167
72
|
ok?: boolean;
|
|
168
73
|
data?: ManagedCluster;
|
|
169
74
|
errors?: CreateClusterResponseErrorsMap;
|
|
170
75
|
}
|
|
171
|
-
export const CreateClusterResponse = /*@__PURE__*/ S.suspend(() =>
|
|
172
|
-
S.Struct({
|
|
173
|
-
ok: S.optional(S.Boolean),
|
|
174
|
-
data: S.optional(ManagedCluster),
|
|
175
|
-
errors: S.optional(CreateClusterResponseErrorsMap),
|
|
176
|
-
}),
|
|
177
|
-
).annotate({ identifier: "CreateClusterResponse" }) as any as S.Schema<CreateClusterResponse>;
|
|
178
|
-
|
|
179
76
|
export interface CreateDatabaseRequest {
|
|
180
77
|
id: string;
|
|
181
78
|
name: string;
|
|
182
79
|
}
|
|
183
|
-
export const CreateDatabaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
184
|
-
S.Struct({
|
|
185
|
-
id: S.String.pipe(T.Label()),
|
|
186
|
-
name: S.String,
|
|
187
|
-
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/databases", code: 200 })),
|
|
188
|
-
).annotate({ identifier: "CreateDatabaseRequest" }) as any as S.Schema<CreateDatabaseRequest>;
|
|
189
|
-
|
|
190
80
|
export interface CreateDatabaseResponse {}
|
|
191
|
-
export const CreateDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
192
|
-
identifier: "CreateDatabaseResponse",
|
|
193
|
-
}) as any as S.Schema<CreateDatabaseResponse>;
|
|
194
|
-
|
|
195
81
|
export type CreateUserRequestRole = "schema_admin" | "writer" | "reader";
|
|
196
|
-
export const CreateUserRequestRole = S.String;
|
|
197
|
-
|
|
198
82
|
export interface CreateUserRequest {
|
|
199
83
|
id: string;
|
|
200
84
|
username: string;
|
|
201
85
|
role: CreateUserRequestRole | (string & {});
|
|
202
86
|
}
|
|
203
|
-
export const CreateUserRequest = /*@__PURE__*/ S.suspend(() =>
|
|
204
|
-
S.Struct({
|
|
205
|
-
id: S.String.pipe(T.Label()),
|
|
206
|
-
username: S.String,
|
|
207
|
-
role: CreateUserRequestRole,
|
|
208
|
-
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/users", code: 200 })),
|
|
209
|
-
).annotate({ identifier: "CreateUserRequest" }) as any as S.Schema<CreateUserRequest>;
|
|
210
|
-
|
|
211
87
|
export interface User {
|
|
212
88
|
name?: string;
|
|
213
89
|
username?: string;
|
|
214
90
|
role?: string;
|
|
215
91
|
}
|
|
216
|
-
export const User = /*@__PURE__*/ S.suspend(() =>
|
|
217
|
-
S.Struct({
|
|
218
|
-
name: S.optional(S.String),
|
|
219
|
-
username: S.optional(S.String),
|
|
220
|
-
role: S.optional(S.String),
|
|
221
|
-
}),
|
|
222
|
-
).annotate({ identifier: "User" }) as any as S.Schema<User>;
|
|
223
|
-
|
|
224
92
|
export interface CreateUserResponse {
|
|
225
93
|
data?: User;
|
|
226
94
|
}
|
|
227
|
-
export const CreateUserResponse = /*@__PURE__*/ S.suspend(() =>
|
|
228
|
-
S.Struct({
|
|
229
|
-
data: S.optional(User),
|
|
230
|
-
}),
|
|
231
|
-
).annotate({ identifier: "CreateUserResponse" }) as any as S.Schema<CreateUserResponse>;
|
|
232
|
-
|
|
233
95
|
export interface DeleteAttachmentRequest {
|
|
234
96
|
id: string;
|
|
235
97
|
app_name: string;
|
|
236
98
|
}
|
|
237
|
-
export const DeleteAttachmentRequest = /*@__PURE__*/ S.suspend(() =>
|
|
238
|
-
S.Struct({
|
|
239
|
-
id: S.String.pipe(T.Label()),
|
|
240
|
-
app_name: S.String.pipe(T.Label()),
|
|
241
|
-
}).pipe(
|
|
242
|
-
T.Http({ method: "DELETE", uri: "/api/v1/postgresv2/{id}/attachments/{app_name}", code: 200 }),
|
|
243
|
-
),
|
|
244
|
-
).annotate({ identifier: "DeleteAttachmentRequest" }) as any as S.Schema<DeleteAttachmentRequest>;
|
|
245
|
-
|
|
246
99
|
export interface DeleteAttachmentResponseData {
|
|
247
100
|
message?: string;
|
|
248
101
|
}
|
|
249
|
-
export const DeleteAttachmentResponseData = /*@__PURE__*/ S.suspend(() =>
|
|
250
|
-
S.Struct({
|
|
251
|
-
message: S.optional(S.String),
|
|
252
|
-
}),
|
|
253
|
-
).annotate({
|
|
254
|
-
identifier: "DeleteAttachmentResponseData",
|
|
255
|
-
}) as any as S.Schema<DeleteAttachmentResponseData>;
|
|
256
|
-
|
|
257
102
|
export interface DeleteAttachmentResponse {
|
|
258
103
|
data?: DeleteAttachmentResponseData;
|
|
259
104
|
}
|
|
260
|
-
export const DeleteAttachmentResponse = /*@__PURE__*/ S.suspend(() =>
|
|
261
|
-
S.Struct({
|
|
262
|
-
data: S.optional(DeleteAttachmentResponseData),
|
|
263
|
-
}),
|
|
264
|
-
).annotate({ identifier: "DeleteAttachmentResponse" }) as any as S.Schema<DeleteAttachmentResponse>;
|
|
265
|
-
|
|
266
105
|
export interface DeleteUserRequest {
|
|
267
106
|
id: string;
|
|
268
107
|
username: string;
|
|
269
108
|
}
|
|
270
|
-
export const DeleteUserRequest = /*@__PURE__*/ S.suspend(() =>
|
|
271
|
-
S.Struct({
|
|
272
|
-
id: S.String.pipe(T.Label()),
|
|
273
|
-
username: S.String.pipe(T.Label()),
|
|
274
|
-
}).pipe(T.Http({ method: "DELETE", uri: "/api/v1/postgresv2/{id}/users/{username}", code: 200 })),
|
|
275
|
-
).annotate({ identifier: "DeleteUserRequest" }) as any as S.Schema<DeleteUserRequest>;
|
|
276
|
-
|
|
277
109
|
export interface DeleteUserResponse {}
|
|
278
|
-
export const DeleteUserResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
279
|
-
identifier: "DeleteUserResponse",
|
|
280
|
-
}) as any as S.Schema<DeleteUserResponse>;
|
|
281
|
-
|
|
282
110
|
export interface DestroyClusterRequest {
|
|
283
111
|
org_slug: string;
|
|
284
112
|
id: string;
|
|
285
113
|
}
|
|
286
|
-
export const DestroyClusterRequest = /*@__PURE__*/ S.suspend(() =>
|
|
287
|
-
S.Struct({
|
|
288
|
-
org_slug: S.String.pipe(T.Label()),
|
|
289
|
-
id: S.String.pipe(T.Label()),
|
|
290
|
-
}).pipe(
|
|
291
|
-
T.Http({
|
|
292
|
-
method: "DELETE",
|
|
293
|
-
uri: "/api/v1/organizations/{org_slug}/postgresv2/{id}",
|
|
294
|
-
code: 200,
|
|
295
|
-
}),
|
|
296
|
-
),
|
|
297
|
-
).annotate({ identifier: "DestroyClusterRequest" }) as any as S.Schema<DestroyClusterRequest>;
|
|
298
|
-
|
|
299
114
|
export interface DestroyClusterResponse {}
|
|
300
|
-
export const DestroyClusterResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
301
|
-
identifier: "DestroyClusterResponse",
|
|
302
|
-
}) as any as S.Schema<DestroyClusterResponse>;
|
|
303
|
-
|
|
304
115
|
export interface DisableExtensionRequest {
|
|
305
116
|
id: string;
|
|
306
117
|
database: string;
|
|
307
118
|
name: string;
|
|
308
119
|
force?: boolean;
|
|
309
120
|
}
|
|
310
|
-
export const DisableExtensionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
311
|
-
S.Struct({
|
|
312
|
-
id: S.String.pipe(T.Label()),
|
|
313
|
-
database: S.String.pipe(T.Label()),
|
|
314
|
-
name: S.String.pipe(T.Label()),
|
|
315
|
-
force: S.optional(S.Boolean.pipe(T.Query())),
|
|
316
|
-
}).pipe(
|
|
317
|
-
T.Http({
|
|
318
|
-
method: "DELETE",
|
|
319
|
-
uri: "/api/v1/postgresv2/{id}/databases/{database}/extensions/{name}",
|
|
320
|
-
code: 200,
|
|
321
|
-
}),
|
|
322
|
-
),
|
|
323
|
-
).annotate({ identifier: "DisableExtensionRequest" }) as any as S.Schema<DisableExtensionRequest>;
|
|
324
|
-
|
|
325
121
|
export interface DisableExtensionResponse {}
|
|
326
|
-
export const DisableExtensionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
327
|
-
identifier: "DisableExtensionResponse",
|
|
328
|
-
}) as any as S.Schema<DisableExtensionResponse>;
|
|
329
|
-
|
|
330
122
|
export interface EnableExtensionRequest {
|
|
331
123
|
id: string;
|
|
332
124
|
database: string;
|
|
@@ -334,40 +126,11 @@ export interface EnableExtensionRequest {
|
|
|
334
126
|
schema?: string;
|
|
335
127
|
create_schema_if_needed?: boolean;
|
|
336
128
|
}
|
|
337
|
-
export const EnableExtensionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
338
|
-
S.Struct({
|
|
339
|
-
id: S.String.pipe(T.Label()),
|
|
340
|
-
database: S.String.pipe(T.Label()),
|
|
341
|
-
name: S.String,
|
|
342
|
-
schema: S.optional(S.String),
|
|
343
|
-
create_schema_if_needed: S.optional(S.Boolean),
|
|
344
|
-
}).pipe(
|
|
345
|
-
T.Http({
|
|
346
|
-
method: "POST",
|
|
347
|
-
uri: "/api/v1/postgresv2/{id}/databases/{database}/extensions",
|
|
348
|
-
code: 200,
|
|
349
|
-
}),
|
|
350
|
-
),
|
|
351
|
-
).annotate({ identifier: "EnableExtensionRequest" }) as any as S.Schema<EnableExtensionRequest>;
|
|
352
|
-
|
|
353
129
|
export interface EnableExtensionResponse {}
|
|
354
|
-
export const EnableExtensionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
355
|
-
identifier: "EnableExtensionResponse",
|
|
356
|
-
}) as any as S.Schema<EnableExtensionResponse>;
|
|
357
|
-
|
|
358
130
|
export interface GetClusterRequest {
|
|
359
131
|
org_slug: string;
|
|
360
132
|
id: string;
|
|
361
133
|
}
|
|
362
|
-
export const GetClusterRequest = /*@__PURE__*/ S.suspend(() =>
|
|
363
|
-
S.Struct({
|
|
364
|
-
org_slug: S.String.pipe(T.Label()),
|
|
365
|
-
id: S.String.pipe(T.Label()),
|
|
366
|
-
}).pipe(
|
|
367
|
-
T.Http({ method: "GET", uri: "/api/v1/organizations/{org_slug}/postgresv2/{id}", code: 200 }),
|
|
368
|
-
),
|
|
369
|
-
).annotate({ identifier: "GetClusterRequest" }) as any as S.Schema<GetClusterRequest>;
|
|
370
|
-
|
|
371
134
|
export interface ClusterCredentials {
|
|
372
135
|
status?: string;
|
|
373
136
|
user?: string;
|
|
@@ -375,90 +138,28 @@ export interface ClusterCredentials {
|
|
|
375
138
|
dbname?: string;
|
|
376
139
|
pgbouncer_uri?: string | Redacted.Redacted<string>;
|
|
377
140
|
}
|
|
378
|
-
export const ClusterCredentials = /*@__PURE__*/ S.suspend(() =>
|
|
379
|
-
S.Struct({
|
|
380
|
-
status: S.optional(S.String),
|
|
381
|
-
user: S.optional(S.String),
|
|
382
|
-
password: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
383
|
-
dbname: S.optional(S.String),
|
|
384
|
-
pgbouncer_uri: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
385
|
-
}),
|
|
386
|
-
).annotate({ identifier: "ClusterCredentials" }) as any as S.Schema<ClusterCredentials>;
|
|
387
|
-
|
|
388
141
|
export interface GetClusterResponse {
|
|
389
142
|
data?: ManagedCluster;
|
|
390
143
|
credentials?: ClusterCredentials;
|
|
391
144
|
}
|
|
392
|
-
export const GetClusterResponse = /*@__PURE__*/ S.suspend(() =>
|
|
393
|
-
S.Struct({
|
|
394
|
-
data: S.optional(ManagedCluster),
|
|
395
|
-
credentials: S.optional(ClusterCredentials),
|
|
396
|
-
}),
|
|
397
|
-
).annotate({ identifier: "GetClusterResponse" }) as any as S.Schema<GetClusterResponse>;
|
|
398
|
-
|
|
399
145
|
export interface GetClusterByIdRequest {
|
|
400
146
|
id: string;
|
|
401
147
|
}
|
|
402
|
-
export const GetClusterByIdRequest = /*@__PURE__*/ S.suspend(() =>
|
|
403
|
-
S.Struct({
|
|
404
|
-
id: S.String.pipe(T.Label()),
|
|
405
|
-
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}", code: 200 })),
|
|
406
|
-
).annotate({ identifier: "GetClusterByIdRequest" }) as any as S.Schema<GetClusterByIdRequest>;
|
|
407
|
-
|
|
408
148
|
export interface GetUserCredentialsRequest {
|
|
409
149
|
id: string;
|
|
410
150
|
username: string;
|
|
411
151
|
}
|
|
412
|
-
export const GetUserCredentialsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
413
|
-
S.Struct({
|
|
414
|
-
id: S.String.pipe(T.Label()),
|
|
415
|
-
username: S.String.pipe(T.Label()),
|
|
416
|
-
}).pipe(
|
|
417
|
-
T.Http({
|
|
418
|
-
method: "GET",
|
|
419
|
-
uri: "/api/v1/postgresv2/{id}/users/{username}/credentials",
|
|
420
|
-
code: 200,
|
|
421
|
-
}),
|
|
422
|
-
),
|
|
423
|
-
).annotate({
|
|
424
|
-
identifier: "GetUserCredentialsRequest",
|
|
425
|
-
}) as any as S.Schema<GetUserCredentialsRequest>;
|
|
426
|
-
|
|
427
152
|
export interface GetUserCredentialsResponseData {
|
|
428
153
|
username?: string;
|
|
429
154
|
user?: string;
|
|
430
155
|
password?: string | Redacted.Redacted<string>;
|
|
431
156
|
}
|
|
432
|
-
export const GetUserCredentialsResponseData = /*@__PURE__*/ S.suspend(() =>
|
|
433
|
-
S.Struct({
|
|
434
|
-
username: S.optional(S.String),
|
|
435
|
-
user: S.optional(S.String),
|
|
436
|
-
password: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
437
|
-
}),
|
|
438
|
-
).annotate({
|
|
439
|
-
identifier: "GetUserCredentialsResponseData",
|
|
440
|
-
}) as any as S.Schema<GetUserCredentialsResponseData>;
|
|
441
|
-
|
|
442
157
|
export interface GetUserCredentialsResponse {
|
|
443
158
|
data?: GetUserCredentialsResponseData;
|
|
444
159
|
}
|
|
445
|
-
export const GetUserCredentialsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
446
|
-
S.Struct({
|
|
447
|
-
data: S.optional(GetUserCredentialsResponseData),
|
|
448
|
-
}),
|
|
449
|
-
).annotate({
|
|
450
|
-
identifier: "GetUserCredentialsResponse",
|
|
451
|
-
}) as any as S.Schema<GetUserCredentialsResponse>;
|
|
452
|
-
|
|
453
160
|
export interface ListBackupsRequest {
|
|
454
161
|
id: string;
|
|
455
162
|
}
|
|
456
|
-
export const ListBackupsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
457
|
-
S.Struct({
|
|
458
|
-
id: S.String.pipe(T.Label()),
|
|
459
|
-
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}/backups", code: 200 })),
|
|
460
|
-
).annotate({ identifier: "ListBackupsRequest" }) as any as S.Schema<ListBackupsRequest>;
|
|
461
|
-
|
|
462
163
|
export interface ClusterBackup {
|
|
463
164
|
id?: string;
|
|
464
165
|
status?: string;
|
|
@@ -466,113 +167,35 @@ export interface ClusterBackup {
|
|
|
466
167
|
start?: string;
|
|
467
168
|
stop?: string;
|
|
468
169
|
}
|
|
469
|
-
export const ClusterBackup = /*@__PURE__*/ S.suspend(() =>
|
|
470
|
-
S.Struct({
|
|
471
|
-
id: S.optional(S.String),
|
|
472
|
-
status: S.optional(S.String),
|
|
473
|
-
type: S.optional(S.String),
|
|
474
|
-
start: S.optional(S.String),
|
|
475
|
-
stop: S.optional(S.String),
|
|
476
|
-
}),
|
|
477
|
-
).annotate({ identifier: "ClusterBackup" }) as any as S.Schema<ClusterBackup>;
|
|
478
|
-
|
|
479
170
|
export type ListBackupsResponseDataList = Array<ClusterBackup>;
|
|
480
|
-
export const ListBackupsResponseDataList = /*@__PURE__*/ S.Array(
|
|
481
|
-
ClusterBackup,
|
|
482
|
-
) as any as S.Schema<ListBackupsResponseDataList>;
|
|
483
|
-
|
|
484
171
|
export interface ListBackupsResponse {
|
|
485
172
|
data?: ListBackupsResponseDataList;
|
|
486
173
|
}
|
|
487
|
-
export const ListBackupsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
488
|
-
S.Struct({
|
|
489
|
-
data: S.optional(ListBackupsResponseDataList),
|
|
490
|
-
}),
|
|
491
|
-
).annotate({ identifier: "ListBackupsResponse" }) as any as S.Schema<ListBackupsResponse>;
|
|
492
|
-
|
|
493
174
|
export interface ListClustersRequest {
|
|
494
175
|
org_slug: string;
|
|
495
176
|
}
|
|
496
|
-
export const ListClustersRequest = /*@__PURE__*/ S.suspend(() =>
|
|
497
|
-
S.Struct({
|
|
498
|
-
org_slug: S.String.pipe(T.Label()),
|
|
499
|
-
}).pipe(T.Http({ method: "GET", uri: "/api/v1/organizations/{org_slug}/postgresv2", code: 200 })),
|
|
500
|
-
).annotate({ identifier: "ListClustersRequest" }) as any as S.Schema<ListClustersRequest>;
|
|
501
|
-
|
|
502
177
|
export type ListClustersResponseDataList = Array<ManagedCluster>;
|
|
503
|
-
export const ListClustersResponseDataList = /*@__PURE__*/ S.Array(
|
|
504
|
-
ManagedCluster,
|
|
505
|
-
) as any as S.Schema<ListClustersResponseDataList>;
|
|
506
|
-
|
|
507
178
|
export interface ListClustersResponse {
|
|
508
179
|
data?: ListClustersResponseDataList;
|
|
509
180
|
}
|
|
510
|
-
export const ListClustersResponse = /*@__PURE__*/ S.suspend(() =>
|
|
511
|
-
S.Struct({
|
|
512
|
-
data: S.optional(ListClustersResponseDataList),
|
|
513
|
-
}),
|
|
514
|
-
).annotate({ identifier: "ListClustersResponse" }) as any as S.Schema<ListClustersResponse>;
|
|
515
|
-
|
|
516
181
|
export interface ListDatabasesRequest {
|
|
517
182
|
id: string;
|
|
518
183
|
}
|
|
519
|
-
export const ListDatabasesRequest = /*@__PURE__*/ S.suspend(() =>
|
|
520
|
-
S.Struct({
|
|
521
|
-
id: S.String.pipe(T.Label()),
|
|
522
|
-
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}/databases", code: 200 })),
|
|
523
|
-
).annotate({ identifier: "ListDatabasesRequest" }) as any as S.Schema<ListDatabasesRequest>;
|
|
524
|
-
|
|
525
184
|
export interface Database {
|
|
526
185
|
name?: string;
|
|
527
186
|
}
|
|
528
|
-
export const Database = /*@__PURE__*/ S.suspend(() =>
|
|
529
|
-
S.Struct({
|
|
530
|
-
name: S.optional(S.String),
|
|
531
|
-
}),
|
|
532
|
-
).annotate({ identifier: "Database" }) as any as S.Schema<Database>;
|
|
533
|
-
|
|
534
187
|
export type ListDatabasesResponseDataList = Array<Database>;
|
|
535
|
-
export const ListDatabasesResponseDataList = /*@__PURE__*/ S.Array(
|
|
536
|
-
Database,
|
|
537
|
-
) as any as S.Schema<ListDatabasesResponseDataList>;
|
|
538
|
-
|
|
539
188
|
export interface ListDatabasesResponse {
|
|
540
189
|
data?: ListDatabasesResponseDataList;
|
|
541
190
|
}
|
|
542
|
-
export const ListDatabasesResponse = /*@__PURE__*/ S.suspend(() =>
|
|
543
|
-
S.Struct({
|
|
544
|
-
data: S.optional(ListDatabasesResponseDataList),
|
|
545
|
-
}),
|
|
546
|
-
).annotate({ identifier: "ListDatabasesResponse" }) as any as S.Schema<ListDatabasesResponse>;
|
|
547
|
-
|
|
548
191
|
export interface ListExtensionsRequest {
|
|
549
192
|
id: string;
|
|
550
193
|
database: string;
|
|
551
194
|
}
|
|
552
|
-
export const ListExtensionsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
553
|
-
S.Struct({
|
|
554
|
-
id: S.String.pipe(T.Label()),
|
|
555
|
-
database: S.String.pipe(T.Label()),
|
|
556
|
-
}).pipe(
|
|
557
|
-
T.Http({
|
|
558
|
-
method: "GET",
|
|
559
|
-
uri: "/api/v1/postgresv2/{id}/databases/{database}/extensions",
|
|
560
|
-
code: 200,
|
|
561
|
-
}),
|
|
562
|
-
),
|
|
563
|
-
).annotate({ identifier: "ListExtensionsRequest" }) as any as S.Schema<ListExtensionsRequest>;
|
|
564
|
-
|
|
565
195
|
export interface InstalledExtension {
|
|
566
196
|
version?: string;
|
|
567
197
|
schema?: string;
|
|
568
198
|
}
|
|
569
|
-
export const InstalledExtension = /*@__PURE__*/ S.suspend(() =>
|
|
570
|
-
S.Struct({
|
|
571
|
-
version: S.optional(S.String),
|
|
572
|
-
schema: S.optional(S.String),
|
|
573
|
-
}),
|
|
574
|
-
).annotate({ identifier: "InstalledExtension" }) as any as S.Schema<InstalledExtension>;
|
|
575
|
-
|
|
576
199
|
export interface Extension {
|
|
577
200
|
name?: string;
|
|
578
201
|
description?: string;
|
|
@@ -581,139 +204,44 @@ export interface Extension {
|
|
|
581
204
|
is_system?: boolean;
|
|
582
205
|
installed?: InstalledExtension;
|
|
583
206
|
}
|
|
584
|
-
export const Extension = /*@__PURE__*/ S.suspend(() =>
|
|
585
|
-
S.Struct({
|
|
586
|
-
name: S.optional(S.String),
|
|
587
|
-
description: S.optional(S.String),
|
|
588
|
-
docs_url: S.optional(S.String),
|
|
589
|
-
default_version: S.optional(S.String),
|
|
590
|
-
is_system: S.optional(S.Boolean),
|
|
591
|
-
installed: S.optional(InstalledExtension),
|
|
592
|
-
}),
|
|
593
|
-
).annotate({ identifier: "Extension" }) as any as S.Schema<Extension>;
|
|
594
|
-
|
|
595
207
|
export type ListExtensionsResponseDataList = Array<Extension>;
|
|
596
|
-
export const ListExtensionsResponseDataList = /*@__PURE__*/ S.Array(
|
|
597
|
-
Extension,
|
|
598
|
-
) as any as S.Schema<ListExtensionsResponseDataList>;
|
|
599
|
-
|
|
600
208
|
export interface ListExtensionsResponse {
|
|
601
209
|
data?: ListExtensionsResponseDataList;
|
|
602
210
|
}
|
|
603
|
-
export const ListExtensionsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
604
|
-
S.Struct({
|
|
605
|
-
data: S.optional(ListExtensionsResponseDataList),
|
|
606
|
-
}),
|
|
607
|
-
).annotate({ identifier: "ListExtensionsResponse" }) as any as S.Schema<ListExtensionsResponse>;
|
|
608
|
-
|
|
609
211
|
export interface ListRegionsRequest {
|
|
610
212
|
org_slug: string;
|
|
611
213
|
}
|
|
612
|
-
export const ListRegionsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
613
|
-
S.Struct({
|
|
614
|
-
org_slug: S.String.pipe(T.Label()),
|
|
615
|
-
}).pipe(
|
|
616
|
-
T.Http({
|
|
617
|
-
method: "GET",
|
|
618
|
-
uri: "/api/v1/organizations/{org_slug}/postgresv2/regions",
|
|
619
|
-
code: 200,
|
|
620
|
-
}),
|
|
621
|
-
),
|
|
622
|
-
).annotate({ identifier: "ListRegionsRequest" }) as any as S.Schema<ListRegionsRequest>;
|
|
623
|
-
|
|
624
214
|
export interface Region {
|
|
625
215
|
code?: string;
|
|
626
216
|
available?: boolean;
|
|
627
217
|
}
|
|
628
|
-
export const Region = /*@__PURE__*/ S.suspend(() =>
|
|
629
|
-
S.Struct({
|
|
630
|
-
code: S.optional(S.String),
|
|
631
|
-
available: S.optional(S.Boolean),
|
|
632
|
-
}),
|
|
633
|
-
).annotate({ identifier: "Region" }) as any as S.Schema<Region>;
|
|
634
|
-
|
|
635
218
|
export type ListRegionsResponseDataList = Array<Region>;
|
|
636
|
-
export const ListRegionsResponseDataList = /*@__PURE__*/ S.Array(
|
|
637
|
-
Region,
|
|
638
|
-
) as any as S.Schema<ListRegionsResponseDataList>;
|
|
639
|
-
|
|
640
219
|
export interface ListRegionsResponse {
|
|
641
220
|
data?: ListRegionsResponseDataList;
|
|
642
221
|
}
|
|
643
|
-
export const ListRegionsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
644
|
-
S.Struct({
|
|
645
|
-
data: S.optional(ListRegionsResponseDataList),
|
|
646
|
-
}),
|
|
647
|
-
).annotate({ identifier: "ListRegionsResponse" }) as any as S.Schema<ListRegionsResponse>;
|
|
648
|
-
|
|
649
222
|
export interface ListUsersRequest {
|
|
650
223
|
id: string;
|
|
651
224
|
}
|
|
652
|
-
export const ListUsersRequest = /*@__PURE__*/ S.suspend(() =>
|
|
653
|
-
S.Struct({
|
|
654
|
-
id: S.String.pipe(T.Label()),
|
|
655
|
-
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}/users", code: 200 })),
|
|
656
|
-
).annotate({ identifier: "ListUsersRequest" }) as any as S.Schema<ListUsersRequest>;
|
|
657
|
-
|
|
658
225
|
export type ListUsersResponseDataList = Array<User>;
|
|
659
|
-
export const ListUsersResponseDataList = /*@__PURE__*/ S.Array(
|
|
660
|
-
User,
|
|
661
|
-
) as any as S.Schema<ListUsersResponseDataList>;
|
|
662
|
-
|
|
663
226
|
export interface ListUsersResponse {
|
|
664
227
|
data?: ListUsersResponseDataList;
|
|
665
228
|
}
|
|
666
|
-
export const ListUsersResponse = /*@__PURE__*/ S.suspend(() =>
|
|
667
|
-
S.Struct({
|
|
668
|
-
data: S.optional(ListUsersResponseDataList),
|
|
669
|
-
}),
|
|
670
|
-
).annotate({ identifier: "ListUsersResponse" }) as any as S.Schema<ListUsersResponse>;
|
|
671
|
-
|
|
672
229
|
export interface RestoreBackupRequest {
|
|
673
230
|
id: string;
|
|
674
231
|
backup_id?: string;
|
|
675
232
|
name?: string;
|
|
676
233
|
pitr_time?: string;
|
|
677
234
|
}
|
|
678
|
-
export const RestoreBackupRequest = /*@__PURE__*/ S.suspend(() =>
|
|
679
|
-
S.Struct({
|
|
680
|
-
id: S.String.pipe(T.Label()),
|
|
681
|
-
backup_id: S.optional(S.String),
|
|
682
|
-
name: S.optional(S.String),
|
|
683
|
-
pitr_time: S.optional(S.String),
|
|
684
|
-
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/restore", code: 200 })),
|
|
685
|
-
).annotate({ identifier: "RestoreBackupRequest" }) as any as S.Schema<RestoreBackupRequest>;
|
|
686
|
-
|
|
687
235
|
export interface RestoreBackupResponse {
|
|
688
236
|
data?: ManagedCluster;
|
|
689
237
|
}
|
|
690
|
-
export const RestoreBackupResponse = /*@__PURE__*/ S.suspend(() =>
|
|
691
|
-
S.Struct({
|
|
692
|
-
data: S.optional(ManagedCluster),
|
|
693
|
-
}),
|
|
694
|
-
).annotate({ identifier: "RestoreBackupResponse" }) as any as S.Schema<RestoreBackupResponse>;
|
|
695
|
-
|
|
696
238
|
export type UpdateUserRoleRequestRole = "schema_admin" | "writer" | "reader";
|
|
697
|
-
export const UpdateUserRoleRequestRole = S.String;
|
|
698
|
-
|
|
699
239
|
export interface UpdateUserRoleRequest {
|
|
700
240
|
id: string;
|
|
701
241
|
username: string;
|
|
702
242
|
role: UpdateUserRoleRequestRole | (string & {});
|
|
703
243
|
}
|
|
704
|
-
export const UpdateUserRoleRequest = /*@__PURE__*/ S.suspend(() =>
|
|
705
|
-
S.Struct({
|
|
706
|
-
id: S.String.pipe(T.Label()),
|
|
707
|
-
username: S.String.pipe(T.Label()),
|
|
708
|
-
role: UpdateUserRoleRequestRole,
|
|
709
|
-
}).pipe(T.Http({ method: "PATCH", uri: "/api/v1/postgresv2/{id}/users/{username}", code: 200 })),
|
|
710
|
-
).annotate({ identifier: "UpdateUserRoleRequest" }) as any as S.Schema<UpdateUserRoleRequest>;
|
|
711
|
-
|
|
712
244
|
export interface UpdateUserRoleResponse {}
|
|
713
|
-
export const UpdateUserRoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
714
|
-
identifier: "UpdateUserRoleResponse",
|
|
715
|
-
}) as any as S.Schema<UpdateUserRoleResponse>;
|
|
716
|
-
|
|
717
245
|
export type CreateAttachmentError = NotFound | Conflict | FlyIoOpError;
|
|
718
246
|
/** Attach a cluster to a Machines app */
|
|
719
247
|
export const createAttachment: API.OperationMethod<
|
|
@@ -722,8 +250,8 @@ export const createAttachment: API.OperationMethod<
|
|
|
722
250
|
CreateAttachmentError,
|
|
723
251
|
FlyIoOpContext
|
|
724
252
|
> = /*@__PURE__*/ API.make(() => ({
|
|
725
|
-
input: CreateAttachmentRequest
|
|
726
|
-
output: CreateAttachmentResponse
|
|
253
|
+
input: __S(0, __c0, 0) as any as S.Schema<CreateAttachmentRequest>,
|
|
254
|
+
output: __S(2, __c0, 2) as any as S.Schema<CreateAttachmentResponse>,
|
|
727
255
|
errors: [NotFound, Conflict],
|
|
728
256
|
protocol: FlyApiProtocol,
|
|
729
257
|
retry: Retry.Retry,
|
|
@@ -737,8 +265,8 @@ export const createBackup: API.OperationMethod<
|
|
|
737
265
|
CreateBackupError,
|
|
738
266
|
FlyIoOpContext
|
|
739
267
|
> = /*@__PURE__*/ API.make(() => ({
|
|
740
|
-
input: CreateBackupRequest
|
|
741
|
-
output: CreateBackupResponse
|
|
268
|
+
input: __S(8, __c1, 0) as any as S.Schema<CreateBackupRequest>,
|
|
269
|
+
output: __S(16, __c2, 0) as any as S.Schema<CreateBackupResponse>,
|
|
742
270
|
errors: [NotFound],
|
|
743
271
|
protocol: FlyApiProtocol,
|
|
744
272
|
retry: Retry.Retry,
|
|
@@ -752,8 +280,8 @@ export const createCluster: API.OperationMethod<
|
|
|
752
280
|
CreateClusterError,
|
|
753
281
|
FlyIoOpContext
|
|
754
282
|
> = /*@__PURE__*/ API.make(() => ({
|
|
755
|
-
input: CreateClusterRequest
|
|
756
|
-
output: CreateClusterResponse
|
|
283
|
+
input: __S(112, __c14, 0) as any as S.Schema<CreateClusterRequest>,
|
|
284
|
+
output: __S(114, __c14, 2) as any as S.Schema<CreateClusterResponse>,
|
|
757
285
|
errors: [Forbidden, NotFound, Conflict],
|
|
758
286
|
protocol: FlyApiProtocol,
|
|
759
287
|
retry: Retry.Retry,
|
|
@@ -767,8 +295,8 @@ export const createDatabase: API.OperationMethod<
|
|
|
767
295
|
CreateDatabaseError,
|
|
768
296
|
FlyIoOpContext
|
|
769
297
|
> = /*@__PURE__*/ API.make(() => ({
|
|
770
|
-
input: CreateDatabaseRequest
|
|
771
|
-
output: CreateDatabaseResponse
|
|
298
|
+
input: __S(136, __c17, 0) as any as S.Schema<CreateDatabaseRequest>,
|
|
299
|
+
output: __S(16, __c2, 0) as any as S.Schema<CreateDatabaseResponse>,
|
|
772
300
|
errors: [NotFound, Conflict],
|
|
773
301
|
protocol: FlyApiProtocol,
|
|
774
302
|
retry: Retry.Retry,
|
|
@@ -782,8 +310,8 @@ export const createUser: API.OperationMethod<
|
|
|
782
310
|
CreateUserError,
|
|
783
311
|
FlyIoOpContext
|
|
784
312
|
> = /*@__PURE__*/ API.make(() => ({
|
|
785
|
-
input: CreateUserRequest
|
|
786
|
-
output: CreateUserResponse
|
|
313
|
+
input: __S(144, __c18, 0) as any as S.Schema<CreateUserRequest>,
|
|
314
|
+
output: __S(145, __c18, 1) as any as S.Schema<CreateUserResponse>,
|
|
787
315
|
errors: [NotFound, Conflict],
|
|
788
316
|
protocol: FlyApiProtocol,
|
|
789
317
|
retry: Retry.Retry,
|
|
@@ -797,8 +325,8 @@ export const deleteAttachment: API.OperationMethod<
|
|
|
797
325
|
DeleteAttachmentError,
|
|
798
326
|
FlyIoOpContext
|
|
799
327
|
> = /*@__PURE__*/ API.make(() => ({
|
|
800
|
-
input: DeleteAttachmentRequest
|
|
801
|
-
output: DeleteAttachmentResponse
|
|
328
|
+
input: __S(160, __c20, 0) as any as S.Schema<DeleteAttachmentRequest>,
|
|
329
|
+
output: __S(162, __c20, 2) as any as S.Schema<DeleteAttachmentResponse>,
|
|
802
330
|
errors: [NotFound],
|
|
803
331
|
protocol: FlyApiProtocol,
|
|
804
332
|
retry: Retry.Retry,
|
|
@@ -812,23 +340,23 @@ export const deleteUser: API.OperationMethod<
|
|
|
812
340
|
DeleteUserError,
|
|
813
341
|
FlyIoOpContext
|
|
814
342
|
> = /*@__PURE__*/ API.make(() => ({
|
|
815
|
-
input: DeleteUserRequest
|
|
816
|
-
output: DeleteUserResponse
|
|
343
|
+
input: __S(168, __c21, 0) as any as S.Schema<DeleteUserRequest>,
|
|
344
|
+
output: __S(16, __c2, 0) as any as S.Schema<DeleteUserResponse>,
|
|
817
345
|
errors: [NotFound],
|
|
818
346
|
protocol: FlyApiProtocol,
|
|
819
347
|
retry: Retry.Retry,
|
|
820
348
|
}));
|
|
821
349
|
|
|
822
350
|
export type DestroyClusterError = NotFound | FlyIoOpError;
|
|
823
|
-
/** Destroy an MPG v2 cluster (async
|
|
351
|
+
/** Destroy an MPG v2 cluster (async -- poll 404) */
|
|
824
352
|
export const destroyCluster: API.OperationMethod<
|
|
825
353
|
DestroyClusterRequest,
|
|
826
354
|
DestroyClusterResponse,
|
|
827
355
|
DestroyClusterError,
|
|
828
356
|
FlyIoOpContext
|
|
829
357
|
> = /*@__PURE__*/ API.make(() => ({
|
|
830
|
-
input: DestroyClusterRequest
|
|
831
|
-
output: DestroyClusterResponse
|
|
358
|
+
input: __S(176, __c22, 0) as any as S.Schema<DestroyClusterRequest>,
|
|
359
|
+
output: __S(16, __c2, 0) as any as S.Schema<DestroyClusterResponse>,
|
|
832
360
|
errors: [NotFound],
|
|
833
361
|
protocol: FlyApiProtocol,
|
|
834
362
|
retry: Retry.Retry,
|
|
@@ -842,8 +370,8 @@ export const disableExtension: API.OperationMethod<
|
|
|
842
370
|
DisableExtensionError,
|
|
843
371
|
FlyIoOpContext
|
|
844
372
|
> = /*@__PURE__*/ API.make(() => ({
|
|
845
|
-
input: DisableExtensionRequest
|
|
846
|
-
output: DisableExtensionResponse
|
|
373
|
+
input: __S(184, __c23, 0) as any as S.Schema<DisableExtensionRequest>,
|
|
374
|
+
output: __S(16, __c2, 0) as any as S.Schema<DisableExtensionResponse>,
|
|
847
375
|
errors: [NotFound],
|
|
848
376
|
protocol: FlyApiProtocol,
|
|
849
377
|
retry: Retry.Retry,
|
|
@@ -857,8 +385,8 @@ export const enableExtension: API.OperationMethod<
|
|
|
857
385
|
EnableExtensionError,
|
|
858
386
|
FlyIoOpContext
|
|
859
387
|
> = /*@__PURE__*/ API.make(() => ({
|
|
860
|
-
input: EnableExtensionRequest
|
|
861
|
-
output: EnableExtensionResponse
|
|
388
|
+
input: __S(192, __c24, 0) as any as S.Schema<EnableExtensionRequest>,
|
|
389
|
+
output: __S(16, __c2, 0) as any as S.Schema<EnableExtensionResponse>,
|
|
862
390
|
errors: [NotFound, Conflict],
|
|
863
391
|
protocol: FlyApiProtocol,
|
|
864
392
|
retry: Retry.Retry,
|
|
@@ -872,8 +400,8 @@ export const getCluster: API.OperationMethod<
|
|
|
872
400
|
GetClusterError,
|
|
873
401
|
FlyIoOpContext
|
|
874
402
|
> = /*@__PURE__*/ API.make(() => ({
|
|
875
|
-
input: GetClusterRequest
|
|
876
|
-
output: GetClusterResponse
|
|
403
|
+
input: __S(24, __c3, 0) as any as S.Schema<GetClusterRequest>,
|
|
404
|
+
output: __S(33, __c4, 1) as any as S.Schema<GetClusterResponse>,
|
|
877
405
|
errors: [NotFound],
|
|
878
406
|
protocol: FlyApiProtocol,
|
|
879
407
|
retry: Retry.Retry,
|
|
@@ -887,8 +415,8 @@ export const getClusterById: API.OperationMethod<
|
|
|
887
415
|
GetClusterByIdError,
|
|
888
416
|
FlyIoOpContext
|
|
889
417
|
> = /*@__PURE__*/ API.make(() => ({
|
|
890
|
-
input: GetClusterByIdRequest
|
|
891
|
-
output: GetClusterResponse
|
|
418
|
+
input: __S(40, __c5, 0) as any as S.Schema<GetClusterByIdRequest>,
|
|
419
|
+
output: __S(33, __c4, 1) as any as S.Schema<GetClusterResponse>,
|
|
892
420
|
errors: [NotFound],
|
|
893
421
|
protocol: FlyApiProtocol,
|
|
894
422
|
retry: Retry.Retry,
|
|
@@ -902,8 +430,8 @@ export const getUserCredentials: API.OperationMethod<
|
|
|
902
430
|
GetUserCredentialsError,
|
|
903
431
|
FlyIoOpContext
|
|
904
432
|
> = /*@__PURE__*/ API.make(() => ({
|
|
905
|
-
input: GetUserCredentialsRequest
|
|
906
|
-
output: GetUserCredentialsResponse
|
|
433
|
+
input: __S(48, __c6, 0) as any as S.Schema<GetUserCredentialsRequest>,
|
|
434
|
+
output: __S(50, __c6, 2) as any as S.Schema<GetUserCredentialsResponse>,
|
|
907
435
|
errors: [NotFound],
|
|
908
436
|
protocol: FlyApiProtocol,
|
|
909
437
|
retry: Retry.Retry,
|
|
@@ -917,8 +445,8 @@ export const listBackups: API.OperationMethod<
|
|
|
917
445
|
ListBackupsError,
|
|
918
446
|
FlyIoOpContext
|
|
919
447
|
> = /*@__PURE__*/ API.make(() => ({
|
|
920
|
-
input: ListBackupsRequest
|
|
921
|
-
output: ListBackupsResponse
|
|
448
|
+
input: __S(56, __c7, 0) as any as S.Schema<ListBackupsRequest>,
|
|
449
|
+
output: __S(59, __c7, 3) as any as S.Schema<ListBackupsResponse>,
|
|
922
450
|
errors: [NotFound],
|
|
923
451
|
protocol: FlyApiProtocol,
|
|
924
452
|
retry: Retry.Retry,
|
|
@@ -932,8 +460,8 @@ export const listClusters: API.OperationMethod<
|
|
|
932
460
|
ListClustersError,
|
|
933
461
|
FlyIoOpContext
|
|
934
462
|
> = /*@__PURE__*/ API.make(() => ({
|
|
935
|
-
input: ListClustersRequest
|
|
936
|
-
output: ListClustersResponse
|
|
463
|
+
input: __S(64, __c8, 0) as any as S.Schema<ListClustersRequest>,
|
|
464
|
+
output: __S(66, __c8, 2) as any as S.Schema<ListClustersResponse>,
|
|
937
465
|
errors: [Forbidden, NotFound],
|
|
938
466
|
protocol: FlyApiProtocol,
|
|
939
467
|
retry: Retry.Retry,
|
|
@@ -947,8 +475,8 @@ export const listDatabases: API.OperationMethod<
|
|
|
947
475
|
ListDatabasesError,
|
|
948
476
|
FlyIoOpContext
|
|
949
477
|
> = /*@__PURE__*/ API.make(() => ({
|
|
950
|
-
input: ListDatabasesRequest
|
|
951
|
-
output: ListDatabasesResponse
|
|
478
|
+
input: __S(72, __c9, 0) as any as S.Schema<ListDatabasesRequest>,
|
|
479
|
+
output: __S(75, __c9, 3) as any as S.Schema<ListDatabasesResponse>,
|
|
952
480
|
errors: [NotFound],
|
|
953
481
|
protocol: FlyApiProtocol,
|
|
954
482
|
retry: Retry.Retry,
|
|
@@ -962,8 +490,8 @@ export const listExtensions: API.OperationMethod<
|
|
|
962
490
|
ListExtensionsError,
|
|
963
491
|
FlyIoOpContext
|
|
964
492
|
> = /*@__PURE__*/ API.make(() => ({
|
|
965
|
-
input: ListExtensionsRequest
|
|
966
|
-
output: ListExtensionsResponse
|
|
493
|
+
input: __S(80, __c10, 0) as any as S.Schema<ListExtensionsRequest>,
|
|
494
|
+
output: __S(84, __c10, 4) as any as S.Schema<ListExtensionsResponse>,
|
|
967
495
|
errors: [NotFound],
|
|
968
496
|
protocol: FlyApiProtocol,
|
|
969
497
|
retry: Retry.Retry,
|
|
@@ -977,8 +505,8 @@ export const listRegions: API.OperationMethod<
|
|
|
977
505
|
ListRegionsError,
|
|
978
506
|
FlyIoOpContext
|
|
979
507
|
> = /*@__PURE__*/ API.make(() => ({
|
|
980
|
-
input: ListRegionsRequest
|
|
981
|
-
output: ListRegionsResponse
|
|
508
|
+
input: __S(88, __c11, 0) as any as S.Schema<ListRegionsRequest>,
|
|
509
|
+
output: __S(91, __c11, 3) as any as S.Schema<ListRegionsResponse>,
|
|
982
510
|
errors: [],
|
|
983
511
|
protocol: FlyApiProtocol,
|
|
984
512
|
retry: Retry.Retry,
|
|
@@ -992,8 +520,8 @@ export const listUsers: API.OperationMethod<
|
|
|
992
520
|
ListUsersError,
|
|
993
521
|
FlyIoOpContext
|
|
994
522
|
> = /*@__PURE__*/ API.make(() => ({
|
|
995
|
-
input: ListUsersRequest
|
|
996
|
-
output: ListUsersResponse
|
|
523
|
+
input: __S(96, __c12, 0) as any as S.Schema<ListUsersRequest>,
|
|
524
|
+
output: __S(98, __c12, 2) as any as S.Schema<ListUsersResponse>,
|
|
997
525
|
errors: [NotFound],
|
|
998
526
|
protocol: FlyApiProtocol,
|
|
999
527
|
retry: Retry.Retry,
|
|
@@ -1007,8 +535,8 @@ export const restoreBackup: API.OperationMethod<
|
|
|
1007
535
|
RestoreBackupError,
|
|
1008
536
|
FlyIoOpContext
|
|
1009
537
|
> = /*@__PURE__*/ API.make(() => ({
|
|
1010
|
-
input: RestoreBackupRequest
|
|
1011
|
-
output: RestoreBackupResponse
|
|
538
|
+
input: __S(104, __c13, 0) as any as S.Schema<RestoreBackupRequest>,
|
|
539
|
+
output: __S(105, __c13, 1) as any as S.Schema<RestoreBackupResponse>,
|
|
1012
540
|
errors: [NotFound],
|
|
1013
541
|
protocol: FlyApiProtocol,
|
|
1014
542
|
retry: Retry.Retry,
|
|
@@ -1022,9 +550,544 @@ export const updateUserRole: API.OperationMethod<
|
|
|
1022
550
|
UpdateUserRoleError,
|
|
1023
551
|
FlyIoOpContext
|
|
1024
552
|
> = /*@__PURE__*/ API.make(() => ({
|
|
1025
|
-
input: UpdateUserRoleRequest
|
|
1026
|
-
output: UpdateUserRoleResponse
|
|
553
|
+
input: __S(128, __c16, 0) as any as S.Schema<UpdateUserRoleRequest>,
|
|
554
|
+
output: __S(16, __c2, 0) as any as S.Schema<UpdateUserRoleResponse>,
|
|
1027
555
|
errors: [NotFound],
|
|
1028
556
|
protocol: FlyApiProtocol,
|
|
1029
557
|
retry: Retry.Retry,
|
|
1030
558
|
}));
|
|
559
|
+
|
|
560
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
561
|
+
function __c0(j: number): any {
|
|
562
|
+
switch (j) {
|
|
563
|
+
case 0:
|
|
564
|
+
return S.suspend(() =>
|
|
565
|
+
S.Struct({
|
|
566
|
+
id: S.String.pipe(T.Label()),
|
|
567
|
+
app_name: S.String,
|
|
568
|
+
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/attachments", code: 200 })),
|
|
569
|
+
).annotate({ identifier: "CreateAttachmentRequest" });
|
|
570
|
+
case 1:
|
|
571
|
+
return S.suspend(() =>
|
|
572
|
+
S.Struct({
|
|
573
|
+
id: S.optional(S.Number),
|
|
574
|
+
app_id: S.optional(S.Number),
|
|
575
|
+
managed_service_id: S.optional(S.Number),
|
|
576
|
+
attached_at: S.optional(S.String),
|
|
577
|
+
}),
|
|
578
|
+
).annotate({ identifier: "CreateAttachmentResponseData" });
|
|
579
|
+
case 2:
|
|
580
|
+
return S.suspend(() =>
|
|
581
|
+
S.Struct({
|
|
582
|
+
data: S.optional(__S(1, __c0, 1)),
|
|
583
|
+
}),
|
|
584
|
+
).annotate({ identifier: "CreateAttachmentResponse" });
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function __c1(j: number): any {
|
|
588
|
+
switch (j) {
|
|
589
|
+
case 0:
|
|
590
|
+
return S.suspend(() =>
|
|
591
|
+
S.Struct({
|
|
592
|
+
id: S.String.pipe(T.Label()),
|
|
593
|
+
type: S.optional(S.String),
|
|
594
|
+
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/backups", code: 200 })),
|
|
595
|
+
).annotate({ identifier: "CreateBackupRequest" });
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function __c2(j: number): any {
|
|
599
|
+
switch (j) {
|
|
600
|
+
case 0:
|
|
601
|
+
return S.suspend(() => S.Struct({})).annotate({ identifier: "CreateBackupResponse" });
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function __c3(j: number): any {
|
|
605
|
+
switch (j) {
|
|
606
|
+
case 0:
|
|
607
|
+
return S.suspend(() =>
|
|
608
|
+
S.Struct({
|
|
609
|
+
org_slug: S.String.pipe(T.Label()),
|
|
610
|
+
id: S.String.pipe(T.Label()),
|
|
611
|
+
}).pipe(
|
|
612
|
+
T.Http({
|
|
613
|
+
method: "GET",
|
|
614
|
+
uri: "/api/v1/organizations/{org_slug}/postgresv2/{id}",
|
|
615
|
+
code: 200,
|
|
616
|
+
}),
|
|
617
|
+
),
|
|
618
|
+
).annotate({ identifier: "GetClusterRequest" });
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
function __c4(j: number): any {
|
|
622
|
+
switch (j) {
|
|
623
|
+
case 0:
|
|
624
|
+
return S.suspend(() =>
|
|
625
|
+
S.Struct({
|
|
626
|
+
status: S.optional(S.String),
|
|
627
|
+
user: S.optional(S.String),
|
|
628
|
+
password: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
629
|
+
dbname: S.optional(S.String),
|
|
630
|
+
pgbouncer_uri: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
631
|
+
}),
|
|
632
|
+
).annotate({ identifier: "ClusterCredentials" });
|
|
633
|
+
case 1:
|
|
634
|
+
return S.suspend(() =>
|
|
635
|
+
S.Struct({
|
|
636
|
+
data: S.optional(__S(124, __c15, 4)),
|
|
637
|
+
credentials: S.optional(__S(32, __c4, 0)),
|
|
638
|
+
}),
|
|
639
|
+
).annotate({ identifier: "GetClusterResponse" });
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function __c5(j: number): any {
|
|
643
|
+
switch (j) {
|
|
644
|
+
case 0:
|
|
645
|
+
return S.suspend(() =>
|
|
646
|
+
S.Struct({
|
|
647
|
+
id: S.String.pipe(T.Label()),
|
|
648
|
+
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}", code: 200 })),
|
|
649
|
+
).annotate({ identifier: "GetClusterByIdRequest" });
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function __c6(j: number): any {
|
|
653
|
+
switch (j) {
|
|
654
|
+
case 0:
|
|
655
|
+
return S.suspend(() =>
|
|
656
|
+
S.Struct({
|
|
657
|
+
id: S.String.pipe(T.Label()),
|
|
658
|
+
username: S.String.pipe(T.Label()),
|
|
659
|
+
}).pipe(
|
|
660
|
+
T.Http({
|
|
661
|
+
method: "GET",
|
|
662
|
+
uri: "/api/v1/postgresv2/{id}/users/{username}/credentials",
|
|
663
|
+
code: 200,
|
|
664
|
+
}),
|
|
665
|
+
),
|
|
666
|
+
).annotate({ identifier: "GetUserCredentialsRequest" });
|
|
667
|
+
case 1:
|
|
668
|
+
return S.suspend(() =>
|
|
669
|
+
S.Struct({
|
|
670
|
+
username: S.optional(S.String),
|
|
671
|
+
user: S.optional(S.String),
|
|
672
|
+
password: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
673
|
+
}),
|
|
674
|
+
).annotate({ identifier: "GetUserCredentialsResponseData" });
|
|
675
|
+
case 2:
|
|
676
|
+
return S.suspend(() =>
|
|
677
|
+
S.Struct({
|
|
678
|
+
data: S.optional(__S(49, __c6, 1)),
|
|
679
|
+
}),
|
|
680
|
+
).annotate({ identifier: "GetUserCredentialsResponse" });
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function __c7(j: number): any {
|
|
684
|
+
switch (j) {
|
|
685
|
+
case 0:
|
|
686
|
+
return S.suspend(() =>
|
|
687
|
+
S.Struct({
|
|
688
|
+
id: S.String.pipe(T.Label()),
|
|
689
|
+
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}/backups", code: 200 })),
|
|
690
|
+
).annotate({ identifier: "ListBackupsRequest" });
|
|
691
|
+
case 1:
|
|
692
|
+
return S.suspend(() =>
|
|
693
|
+
S.Struct({
|
|
694
|
+
id: S.optional(S.String),
|
|
695
|
+
status: S.optional(S.String),
|
|
696
|
+
type: S.optional(S.String),
|
|
697
|
+
start: S.optional(S.String),
|
|
698
|
+
stop: S.optional(S.String),
|
|
699
|
+
}),
|
|
700
|
+
).annotate({ identifier: "ClusterBackup" });
|
|
701
|
+
case 2:
|
|
702
|
+
return S.Array(__S(57, __c7, 1));
|
|
703
|
+
case 3:
|
|
704
|
+
return S.suspend(() =>
|
|
705
|
+
S.Struct({
|
|
706
|
+
data: S.optional(__S(58, __c7, 2)),
|
|
707
|
+
}),
|
|
708
|
+
).annotate({ identifier: "ListBackupsResponse" });
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
function __c8(j: number): any {
|
|
712
|
+
switch (j) {
|
|
713
|
+
case 0:
|
|
714
|
+
return S.suspend(() =>
|
|
715
|
+
S.Struct({
|
|
716
|
+
org_slug: S.String.pipe(T.Label()),
|
|
717
|
+
}).pipe(
|
|
718
|
+
T.Http({ method: "GET", uri: "/api/v1/organizations/{org_slug}/postgresv2", code: 200 }),
|
|
719
|
+
),
|
|
720
|
+
).annotate({ identifier: "ListClustersRequest" });
|
|
721
|
+
case 1:
|
|
722
|
+
return S.Array(__S(124, __c15, 4));
|
|
723
|
+
case 2:
|
|
724
|
+
return S.suspend(() =>
|
|
725
|
+
S.Struct({
|
|
726
|
+
data: S.optional(__S(65, __c8, 1)),
|
|
727
|
+
}),
|
|
728
|
+
).annotate({ identifier: "ListClustersResponse" });
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function __c9(j: number): any {
|
|
732
|
+
switch (j) {
|
|
733
|
+
case 0:
|
|
734
|
+
return S.suspend(() =>
|
|
735
|
+
S.Struct({
|
|
736
|
+
id: S.String.pipe(T.Label()),
|
|
737
|
+
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}/databases", code: 200 })),
|
|
738
|
+
).annotate({ identifier: "ListDatabasesRequest" });
|
|
739
|
+
case 1:
|
|
740
|
+
return S.suspend(() =>
|
|
741
|
+
S.Struct({
|
|
742
|
+
name: S.optional(S.String),
|
|
743
|
+
}),
|
|
744
|
+
).annotate({ identifier: "Database" });
|
|
745
|
+
case 2:
|
|
746
|
+
return S.Array(__S(73, __c9, 1));
|
|
747
|
+
case 3:
|
|
748
|
+
return S.suspend(() =>
|
|
749
|
+
S.Struct({
|
|
750
|
+
data: S.optional(__S(74, __c9, 2)),
|
|
751
|
+
}),
|
|
752
|
+
).annotate({ identifier: "ListDatabasesResponse" });
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
function __c10(j: number): any {
|
|
756
|
+
switch (j) {
|
|
757
|
+
case 0:
|
|
758
|
+
return S.suspend(() =>
|
|
759
|
+
S.Struct({
|
|
760
|
+
id: S.String.pipe(T.Label()),
|
|
761
|
+
database: S.String.pipe(T.Label()),
|
|
762
|
+
}).pipe(
|
|
763
|
+
T.Http({
|
|
764
|
+
method: "GET",
|
|
765
|
+
uri: "/api/v1/postgresv2/{id}/databases/{database}/extensions",
|
|
766
|
+
code: 200,
|
|
767
|
+
}),
|
|
768
|
+
),
|
|
769
|
+
).annotate({ identifier: "ListExtensionsRequest" });
|
|
770
|
+
case 1:
|
|
771
|
+
return S.suspend(() =>
|
|
772
|
+
S.Struct({
|
|
773
|
+
version: S.optional(S.String),
|
|
774
|
+
schema: S.optional(S.String),
|
|
775
|
+
}),
|
|
776
|
+
).annotate({ identifier: "InstalledExtension" });
|
|
777
|
+
case 2:
|
|
778
|
+
return S.suspend(() =>
|
|
779
|
+
S.Struct({
|
|
780
|
+
name: S.optional(S.String),
|
|
781
|
+
description: S.optional(S.String),
|
|
782
|
+
docs_url: S.optional(S.String),
|
|
783
|
+
default_version: S.optional(S.String),
|
|
784
|
+
is_system: S.optional(S.Boolean),
|
|
785
|
+
installed: S.optional(__S(81, __c10, 1)),
|
|
786
|
+
}),
|
|
787
|
+
).annotate({ identifier: "Extension" });
|
|
788
|
+
case 3:
|
|
789
|
+
return S.Array(__S(82, __c10, 2));
|
|
790
|
+
case 4:
|
|
791
|
+
return S.suspend(() =>
|
|
792
|
+
S.Struct({
|
|
793
|
+
data: S.optional(__S(83, __c10, 3)),
|
|
794
|
+
}),
|
|
795
|
+
).annotate({ identifier: "ListExtensionsResponse" });
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
function __c11(j: number): any {
|
|
799
|
+
switch (j) {
|
|
800
|
+
case 0:
|
|
801
|
+
return S.suspend(() =>
|
|
802
|
+
S.Struct({
|
|
803
|
+
org_slug: S.String.pipe(T.Label()),
|
|
804
|
+
}).pipe(
|
|
805
|
+
T.Http({
|
|
806
|
+
method: "GET",
|
|
807
|
+
uri: "/api/v1/organizations/{org_slug}/postgresv2/regions",
|
|
808
|
+
code: 200,
|
|
809
|
+
}),
|
|
810
|
+
),
|
|
811
|
+
).annotate({ identifier: "ListRegionsRequest" });
|
|
812
|
+
case 1:
|
|
813
|
+
return S.suspend(() =>
|
|
814
|
+
S.Struct({
|
|
815
|
+
code: S.optional(S.String),
|
|
816
|
+
available: S.optional(S.Boolean),
|
|
817
|
+
}),
|
|
818
|
+
).annotate({ identifier: "Region" });
|
|
819
|
+
case 2:
|
|
820
|
+
return S.Array(__S(89, __c11, 1));
|
|
821
|
+
case 3:
|
|
822
|
+
return S.suspend(() =>
|
|
823
|
+
S.Struct({
|
|
824
|
+
data: S.optional(__S(90, __c11, 2)),
|
|
825
|
+
}),
|
|
826
|
+
).annotate({ identifier: "ListRegionsResponse" });
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
function __c12(j: number): any {
|
|
830
|
+
switch (j) {
|
|
831
|
+
case 0:
|
|
832
|
+
return S.suspend(() =>
|
|
833
|
+
S.Struct({
|
|
834
|
+
id: S.String.pipe(T.Label()),
|
|
835
|
+
}).pipe(T.Http({ method: "GET", uri: "/api/v1/postgresv2/{id}/users", code: 200 })),
|
|
836
|
+
).annotate({ identifier: "ListUsersRequest" });
|
|
837
|
+
case 1:
|
|
838
|
+
return S.Array(__S(152, __c19, 0));
|
|
839
|
+
case 2:
|
|
840
|
+
return S.suspend(() =>
|
|
841
|
+
S.Struct({
|
|
842
|
+
data: S.optional(__S(97, __c12, 1)),
|
|
843
|
+
}),
|
|
844
|
+
).annotate({ identifier: "ListUsersResponse" });
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
function __c13(j: number): any {
|
|
848
|
+
switch (j) {
|
|
849
|
+
case 0:
|
|
850
|
+
return S.suspend(() =>
|
|
851
|
+
S.Struct({
|
|
852
|
+
id: S.String.pipe(T.Label()),
|
|
853
|
+
backup_id: S.optional(S.String),
|
|
854
|
+
name: S.optional(S.String),
|
|
855
|
+
pitr_time: S.optional(S.String),
|
|
856
|
+
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/restore", code: 200 })),
|
|
857
|
+
).annotate({ identifier: "RestoreBackupRequest" });
|
|
858
|
+
case 1:
|
|
859
|
+
return S.suspend(() =>
|
|
860
|
+
S.Struct({
|
|
861
|
+
data: S.optional(__S(124, __c15, 4)),
|
|
862
|
+
}),
|
|
863
|
+
).annotate({ identifier: "RestoreBackupResponse" });
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
function __c14(j: number): any {
|
|
867
|
+
switch (j) {
|
|
868
|
+
case 0:
|
|
869
|
+
return S.suspend(() =>
|
|
870
|
+
S.Struct({
|
|
871
|
+
org_slug: S.String.pipe(T.Label()),
|
|
872
|
+
name: S.String,
|
|
873
|
+
region: S.String,
|
|
874
|
+
plan: S.String,
|
|
875
|
+
pg_major_version: S.optional(S.String),
|
|
876
|
+
storage_in_gb: S.optional(S.Number),
|
|
877
|
+
postgis_enabled: S.optional(S.Boolean),
|
|
878
|
+
}).pipe(
|
|
879
|
+
T.Http({ method: "POST", uri: "/api/v1/organizations/{org_slug}/postgresv2", code: 200 }),
|
|
880
|
+
),
|
|
881
|
+
).annotate({ identifier: "CreateClusterRequest" });
|
|
882
|
+
case 1:
|
|
883
|
+
return S.Record(S.String, S.Unknown);
|
|
884
|
+
case 2:
|
|
885
|
+
return S.suspend(() =>
|
|
886
|
+
S.Struct({
|
|
887
|
+
ok: S.optional(S.Boolean),
|
|
888
|
+
data: S.optional(__S(124, __c15, 4)),
|
|
889
|
+
errors: S.optional(__S(113, __c14, 1)),
|
|
890
|
+
}),
|
|
891
|
+
).annotate({ identifier: "CreateClusterResponse" });
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
function __c15(j: number): any {
|
|
895
|
+
switch (j) {
|
|
896
|
+
case 0:
|
|
897
|
+
return S.suspend(() =>
|
|
898
|
+
S.Struct({
|
|
899
|
+
id: S.optional(S.String),
|
|
900
|
+
name: S.optional(S.String),
|
|
901
|
+
slug: S.optional(S.String),
|
|
902
|
+
raw_slug: S.optional(S.String),
|
|
903
|
+
}),
|
|
904
|
+
).annotate({ identifier: "Organization" });
|
|
905
|
+
case 1:
|
|
906
|
+
return S.Record(S.String, S.String);
|
|
907
|
+
case 2:
|
|
908
|
+
return S.suspend(() =>
|
|
909
|
+
S.Struct({
|
|
910
|
+
name: S.optional(S.String),
|
|
911
|
+
id: S.optional(S.String),
|
|
912
|
+
}),
|
|
913
|
+
).annotate({ identifier: "AttachedApp" });
|
|
914
|
+
case 3:
|
|
915
|
+
return S.Array(__S(122, __c15, 2));
|
|
916
|
+
case 4:
|
|
917
|
+
return S.suspend(() =>
|
|
918
|
+
S.Struct({
|
|
919
|
+
id: S.optional(S.String),
|
|
920
|
+
name: S.optional(S.String),
|
|
921
|
+
status: S.optional(S.String),
|
|
922
|
+
engine: S.optional(S.String),
|
|
923
|
+
plan: S.optional(S.String),
|
|
924
|
+
region: S.optional(S.String),
|
|
925
|
+
organization: S.optional(__S(120, __c15, 0)),
|
|
926
|
+
mpgd_cluster_id: S.optional(S.String),
|
|
927
|
+
disk: S.optional(S.Number),
|
|
928
|
+
replicas: S.optional(S.Number),
|
|
929
|
+
ip_assignments: S.optional(__S(121, __c15, 1)),
|
|
930
|
+
attached_apps: S.optional(__S(123, __c15, 3)),
|
|
931
|
+
postgis_enabled: S.optional(S.Boolean),
|
|
932
|
+
environment: S.optional(S.String),
|
|
933
|
+
}),
|
|
934
|
+
).annotate({ identifier: "ManagedCluster" });
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
function __c16(j: number): any {
|
|
938
|
+
switch (j) {
|
|
939
|
+
case 0:
|
|
940
|
+
return S.suspend(() =>
|
|
941
|
+
S.Struct({
|
|
942
|
+
id: S.String.pipe(T.Label()),
|
|
943
|
+
username: S.String.pipe(T.Label()),
|
|
944
|
+
role: S.String,
|
|
945
|
+
}).pipe(
|
|
946
|
+
T.Http({ method: "PATCH", uri: "/api/v1/postgresv2/{id}/users/{username}", code: 200 }),
|
|
947
|
+
),
|
|
948
|
+
).annotate({ identifier: "UpdateUserRoleRequest" });
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
function __c17(j: number): any {
|
|
952
|
+
switch (j) {
|
|
953
|
+
case 0:
|
|
954
|
+
return S.suspend(() =>
|
|
955
|
+
S.Struct({
|
|
956
|
+
id: S.String.pipe(T.Label()),
|
|
957
|
+
name: S.String,
|
|
958
|
+
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/databases", code: 200 })),
|
|
959
|
+
).annotate({ identifier: "CreateDatabaseRequest" });
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
function __c18(j: number): any {
|
|
963
|
+
switch (j) {
|
|
964
|
+
case 0:
|
|
965
|
+
return S.suspend(() =>
|
|
966
|
+
S.Struct({
|
|
967
|
+
id: S.String.pipe(T.Label()),
|
|
968
|
+
username: S.String,
|
|
969
|
+
role: S.String,
|
|
970
|
+
}).pipe(T.Http({ method: "POST", uri: "/api/v1/postgresv2/{id}/users", code: 200 })),
|
|
971
|
+
).annotate({ identifier: "CreateUserRequest" });
|
|
972
|
+
case 1:
|
|
973
|
+
return S.suspend(() =>
|
|
974
|
+
S.Struct({
|
|
975
|
+
data: S.optional(__S(152, __c19, 0)),
|
|
976
|
+
}),
|
|
977
|
+
).annotate({ identifier: "CreateUserResponse" });
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
function __c19(j: number): any {
|
|
981
|
+
switch (j) {
|
|
982
|
+
case 0:
|
|
983
|
+
return S.suspend(() =>
|
|
984
|
+
S.Struct({
|
|
985
|
+
name: S.optional(S.String),
|
|
986
|
+
username: S.optional(S.String),
|
|
987
|
+
role: S.optional(S.String),
|
|
988
|
+
}),
|
|
989
|
+
).annotate({ identifier: "User" });
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
function __c20(j: number): any {
|
|
993
|
+
switch (j) {
|
|
994
|
+
case 0:
|
|
995
|
+
return S.suspend(() =>
|
|
996
|
+
S.Struct({
|
|
997
|
+
id: S.String.pipe(T.Label()),
|
|
998
|
+
app_name: S.String.pipe(T.Label()),
|
|
999
|
+
}).pipe(
|
|
1000
|
+
T.Http({
|
|
1001
|
+
method: "DELETE",
|
|
1002
|
+
uri: "/api/v1/postgresv2/{id}/attachments/{app_name}",
|
|
1003
|
+
code: 200,
|
|
1004
|
+
}),
|
|
1005
|
+
),
|
|
1006
|
+
).annotate({ identifier: "DeleteAttachmentRequest" });
|
|
1007
|
+
case 1:
|
|
1008
|
+
return S.suspend(() =>
|
|
1009
|
+
S.Struct({
|
|
1010
|
+
message: S.optional(S.String),
|
|
1011
|
+
}),
|
|
1012
|
+
).annotate({ identifier: "DeleteAttachmentResponseData" });
|
|
1013
|
+
case 2:
|
|
1014
|
+
return S.suspend(() =>
|
|
1015
|
+
S.Struct({
|
|
1016
|
+
data: S.optional(__S(161, __c20, 1)),
|
|
1017
|
+
}),
|
|
1018
|
+
).annotate({ identifier: "DeleteAttachmentResponse" });
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
function __c21(j: number): any {
|
|
1022
|
+
switch (j) {
|
|
1023
|
+
case 0:
|
|
1024
|
+
return S.suspend(() =>
|
|
1025
|
+
S.Struct({
|
|
1026
|
+
id: S.String.pipe(T.Label()),
|
|
1027
|
+
username: S.String.pipe(T.Label()),
|
|
1028
|
+
}).pipe(
|
|
1029
|
+
T.Http({ method: "DELETE", uri: "/api/v1/postgresv2/{id}/users/{username}", code: 200 }),
|
|
1030
|
+
),
|
|
1031
|
+
).annotate({ identifier: "DeleteUserRequest" });
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
function __c22(j: number): any {
|
|
1035
|
+
switch (j) {
|
|
1036
|
+
case 0:
|
|
1037
|
+
return S.suspend(() =>
|
|
1038
|
+
S.Struct({
|
|
1039
|
+
org_slug: S.String.pipe(T.Label()),
|
|
1040
|
+
id: S.String.pipe(T.Label()),
|
|
1041
|
+
}).pipe(
|
|
1042
|
+
T.Http({
|
|
1043
|
+
method: "DELETE",
|
|
1044
|
+
uri: "/api/v1/organizations/{org_slug}/postgresv2/{id}",
|
|
1045
|
+
code: 200,
|
|
1046
|
+
}),
|
|
1047
|
+
),
|
|
1048
|
+
).annotate({ identifier: "DestroyClusterRequest" });
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
function __c23(j: number): any {
|
|
1052
|
+
switch (j) {
|
|
1053
|
+
case 0:
|
|
1054
|
+
return S.suspend(() =>
|
|
1055
|
+
S.Struct({
|
|
1056
|
+
id: S.String.pipe(T.Label()),
|
|
1057
|
+
database: S.String.pipe(T.Label()),
|
|
1058
|
+
name: S.String.pipe(T.Label()),
|
|
1059
|
+
force: S.optional(S.Boolean.pipe(T.Query())),
|
|
1060
|
+
}).pipe(
|
|
1061
|
+
T.Http({
|
|
1062
|
+
method: "DELETE",
|
|
1063
|
+
uri: "/api/v1/postgresv2/{id}/databases/{database}/extensions/{name}",
|
|
1064
|
+
code: 200,
|
|
1065
|
+
}),
|
|
1066
|
+
),
|
|
1067
|
+
).annotate({ identifier: "DisableExtensionRequest" });
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
function __c24(j: number): any {
|
|
1071
|
+
switch (j) {
|
|
1072
|
+
case 0:
|
|
1073
|
+
return S.suspend(() =>
|
|
1074
|
+
S.Struct({
|
|
1075
|
+
id: S.String.pipe(T.Label()),
|
|
1076
|
+
database: S.String.pipe(T.Label()),
|
|
1077
|
+
name: S.String,
|
|
1078
|
+
schema: S.optional(S.String),
|
|
1079
|
+
create_schema_if_needed: S.optional(S.Boolean),
|
|
1080
|
+
}).pipe(
|
|
1081
|
+
T.Http({
|
|
1082
|
+
method: "POST",
|
|
1083
|
+
uri: "/api/v1/postgresv2/{id}/databases/{database}/extensions",
|
|
1084
|
+
code: 200,
|
|
1085
|
+
}),
|
|
1086
|
+
),
|
|
1087
|
+
).annotate({ identifier: "EnableExtensionRequest" });
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
1091
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
1092
|
+
return (__s[i] ??= __L.at(f, j));
|
|
1093
|
+
}
|