@distilled.cloud/turso 1.0.0-rc.13 → 1.0.0-rc.15

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.
@@ -1,10 +1,11 @@
1
- // AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit.
2
- import * as S from "@distilled.cloud/core/schema";
3
1
  import * as API from "@distilled.cloud/core/api";
4
2
  import * as C from "@distilled.cloud/core/category";
5
- import * as T from "../traits.js";
6
- import { TursoProtocol, } from "../protocol.js";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema";
5
+ import * as Redacted from "effect/Redacted";
6
+ import { TursoProtocol } from "../protocol.js";
7
7
  import * as Retry from "../retry.js";
8
+ import * as T from "../traits.js";
8
9
  export class BadRequest extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
9
10
  /*@__PURE__*/ S.TaggedError()("BadRequest", {
10
11
  code: S.Number,
@@ -59,11 +60,7 @@ export const AddOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() => S.Stru
59
60
  organizationSlug: S.String.pipe(T.Label()),
60
61
  username: S.optional(S.String),
61
62
  role: S.optional(AddOrganizationMemberRequestRole),
62
- }).pipe(T.Http({
63
- method: "POST",
64
- uri: "/v1/organizations/{organizationSlug}/members",
65
- code: 200,
66
- }))).annotate({
63
+ }).pipe(T.Http({ method: "POST", uri: "/v1/organizations/{organizationSlug}/members", code: 200 }))).annotate({
67
64
  identifier: "AddOrganizationMemberRequest",
68
65
  });
69
66
  export const Role = S.String;
@@ -80,20 +77,12 @@ export const CreateAPITokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
80
77
  organization: S.optional(S.String),
81
78
  group: S.optional(S.String),
82
79
  scopes: S.optional(CreateAPITokenRequestScopesList),
83
- }).pipe(T.Http({
84
- method: "POST",
85
- uri: "/v1/auth/api-tokens/{tokenName}",
86
- code: 200,
87
- }))).annotate({
88
- identifier: "CreateAPITokenRequest",
89
- });
80
+ }).pipe(T.Http({ method: "POST", uri: "/v1/auth/api-tokens/{tokenName}", code: 200 }))).annotate({ identifier: "CreateAPITokenRequest" });
90
81
  export const CreateAPITokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
91
82
  name: S.optional(S.String),
92
83
  id: S.optional(S.String),
93
- token: S.optional(S.String),
94
- })).annotate({
95
- identifier: "CreateAPITokenResponse",
96
- });
84
+ token: S.optional(S.String.pipe(T.SensitiveValue({}))),
85
+ })).annotate({ identifier: "CreateAPITokenResponse" });
97
86
  export const CreateDatabaseRequestSeedType = S.String;
98
87
  export const CreateDatabaseRequestSeed = /*@__PURE__*/ S.suspend(() => S.Struct({
99
88
  type: S.optional(CreateDatabaseRequestSeedType),
@@ -116,30 +105,18 @@ export const CreateDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
116
105
  seed: S.optional(CreateDatabaseRequestSeed),
117
106
  size_limit: S.optional(S.String),
118
107
  remote_encryption: S.optional(CreateDatabaseRequestRemoteEncryption),
119
- }).pipe(T.Http({
120
- method: "POST",
121
- uri: "/v1/organizations/{organizationSlug}/databases",
122
- code: 200,
123
- }))).annotate({
124
- identifier: "CreateDatabaseRequest",
125
- });
108
+ }).pipe(T.Http({ method: "POST", uri: "/v1/organizations/{organizationSlug}/databases", code: 200 }))).annotate({ identifier: "CreateDatabaseRequest" });
126
109
  export const CreateDatabaseOutput = /*@__PURE__*/ S.suspend(() => S.Struct({
127
110
  DbId: S.optional(S.String),
128
111
  Hostname: S.optional(S.String),
129
112
  Name: S.optional(S.String),
130
- })).annotate({
131
- identifier: "CreateDatabaseOutput",
132
- });
113
+ })).annotate({ identifier: "CreateDatabaseOutput" });
133
114
  export const CreateDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
134
115
  database: S.optional(CreateDatabaseOutput),
135
- })).annotate({
136
- identifier: "CreateDatabaseResponse",
137
- });
116
+ })).annotate({ identifier: "CreateDatabaseResponse" });
138
117
  export const CreateDatabaseTokenRequestAuthorization = S.String;
139
- export const CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList =
140
- /*@__PURE__*/ S.Array(S.String);
141
- export const CreateDatabaseTokenRequestPermissionsReadAttach =
142
- /*@__PURE__*/ S.suspend(() => S.Struct({
118
+ export const CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList = /*@__PURE__*/ S.Array(S.String);
119
+ export const CreateDatabaseTokenRequestPermissionsReadAttach = /*@__PURE__*/ S.suspend(() => S.Struct({
143
120
  databases: S.optional(CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList),
144
121
  })).annotate({
145
122
  identifier: "CreateDatabaseTokenRequestPermissionsReadAttach",
@@ -163,7 +140,7 @@ export const CreateDatabaseTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct
163
140
  identifier: "CreateDatabaseTokenRequest",
164
141
  });
165
142
  export const CreateDatabaseTokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
166
- jwt: S.optional(S.String),
143
+ jwt: S.optional(S.String.pipe(T.SensitiveValue({}))),
167
144
  })).annotate({
168
145
  identifier: "CreateDatabaseTokenResponse",
169
146
  });
@@ -176,23 +153,13 @@ export const CreateGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
176
153
  name: S.String,
177
154
  location: S.String,
178
155
  extensions: S.optional(Extensions),
179
- }).pipe(T.Http({
180
- method: "POST",
181
- uri: "/v1/organizations/{organizationSlug}/groups",
182
- code: 200,
183
- }))).annotate({
184
- identifier: "CreateGroupRequest",
185
- });
156
+ }).pipe(T.Http({ method: "POST", uri: "/v1/organizations/{organizationSlug}/groups", code: 200 }))).annotate({ identifier: "CreateGroupRequest" });
186
157
  export const CreateGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
187
158
  group: S.optional(Group),
188
- })).annotate({
189
- identifier: "CreateGroupResponse",
190
- });
159
+ })).annotate({ identifier: "CreateGroupResponse" });
191
160
  export const CreateGroupTokenRequestAuthorization = S.String;
192
- export const CreateGroupTokenRequestPermissionsReadAttachDatabasesList =
193
- /*@__PURE__*/ S.Array(S.String);
194
- export const CreateGroupTokenRequestPermissionsReadAttach =
195
- /*@__PURE__*/ S.suspend(() => S.Struct({
161
+ export const CreateGroupTokenRequestPermissionsReadAttachDatabasesList = /*@__PURE__*/ S.Array(S.String);
162
+ export const CreateGroupTokenRequestPermissionsReadAttach = /*@__PURE__*/ S.suspend(() => S.Struct({
196
163
  databases: S.optional(CreateGroupTokenRequestPermissionsReadAttachDatabasesList),
197
164
  })).annotate({
198
165
  identifier: "CreateGroupTokenRequestPermissionsReadAttach",
@@ -212,14 +179,10 @@ export const CreateGroupTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
212
179
  method: "POST",
213
180
  uri: "/v1/organizations/{organizationSlug}/groups/{groupName}/auth/tokens",
214
181
  code: 200,
215
- }))).annotate({
216
- identifier: "CreateGroupTokenRequest",
217
- });
182
+ }))).annotate({ identifier: "CreateGroupTokenRequest" });
218
183
  export const CreateGroupTokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
219
- jwt: S.optional(S.String),
220
- })).annotate({
221
- identifier: "CreateGroupTokenResponse",
222
- });
184
+ jwt: S.optional(S.String.pipe(T.SensitiveValue({}))),
185
+ })).annotate({ identifier: "CreateGroupTokenResponse" });
223
186
  export const DeleteDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
224
187
  organizationSlug: S.String.pipe(T.Label()),
225
188
  databaseName: S.String.pipe(T.Label()),
@@ -227,14 +190,10 @@ export const DeleteDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
227
190
  method: "DELETE",
228
191
  uri: "/v1/organizations/{organizationSlug}/databases/{databaseName}",
229
192
  code: 200,
230
- }))).annotate({
231
- identifier: "DeleteDatabaseRequest",
232
- });
193
+ }))).annotate({ identifier: "DeleteDatabaseRequest" });
233
194
  export const DeleteDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
234
195
  database: S.optional(S.String),
235
- })).annotate({
236
- identifier: "DeleteDatabaseResponse",
237
- });
196
+ })).annotate({ identifier: "DeleteDatabaseResponse" });
238
197
  export const DeleteGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
239
198
  organizationSlug: S.String.pipe(T.Label()),
240
199
  groupName: S.String.pipe(T.Label()),
@@ -242,14 +201,10 @@ export const DeleteGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
242
201
  method: "DELETE",
243
202
  uri: "/v1/organizations/{organizationSlug}/groups/{groupName}",
244
203
  code: 200,
245
- }))).annotate({
246
- identifier: "DeleteGroupRequest",
247
- });
204
+ }))).annotate({ identifier: "DeleteGroupRequest" });
248
205
  export const DeleteGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
249
206
  group: S.optional(Group),
250
- })).annotate({
251
- identifier: "DeleteGroupResponse",
252
- });
207
+ })).annotate({ identifier: "DeleteGroupResponse" });
253
208
  export const DeleteOrganizationInviteByEmailV2Request = /*@__PURE__*/ S.suspend(() => S.Struct({
254
209
  organizationSlug: S.String.pipe(T.Label()),
255
210
  email: S.String.pipe(T.Label()),
@@ -260,13 +215,10 @@ export const DeleteOrganizationInviteByEmailV2Request = /*@__PURE__*/ S.suspend(
260
215
  }))).annotate({
261
216
  identifier: "DeleteOrganizationInviteByEmailV2Request",
262
217
  });
263
- export const DeleteOrganizationInviteByEmailV2Response =
264
- /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
218
+ export const DeleteOrganizationInviteByEmailV2Response = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
265
219
  identifier: "DeleteOrganizationInviteByEmailV2Response",
266
220
  });
267
- export const GetCurrentUserRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/user", code: 200 }))).annotate({
268
- identifier: "GetCurrentUserRequest",
269
- });
221
+ export const GetCurrentUserRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/user", code: 200 }))).annotate({ identifier: "GetCurrentUserRequest" });
270
222
  export const GetCurrentUserResponseUser = /*@__PURE__*/ S.suspend(() => S.Struct({
271
223
  username: S.optional(S.String),
272
224
  name: S.optional(S.String),
@@ -280,9 +232,7 @@ export const GetCurrentUserResponseUser = /*@__PURE__*/ S.suspend(() => S.Struct
280
232
  });
281
233
  export const GetCurrentUserResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
282
234
  user: S.optional(GetCurrentUserResponseUser),
283
- })).annotate({
284
- identifier: "GetCurrentUserResponse",
285
- });
235
+ })).annotate({ identifier: "GetCurrentUserResponse" });
286
236
  export const GetDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
287
237
  organizationSlug: S.String.pipe(T.Label()),
288
238
  databaseName: S.String.pipe(T.Label()),
@@ -290,9 +240,7 @@ export const GetDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
290
240
  method: "GET",
291
241
  uri: "/v1/organizations/{organizationSlug}/databases/{databaseName}",
292
242
  code: 200,
293
- }))).annotate({
294
- identifier: "GetDatabaseRequest",
295
- });
243
+ }))).annotate({ identifier: "GetDatabaseRequest" });
296
244
  export const DatabaseRegionsList = /*@__PURE__*/ S.Array(S.String);
297
245
  export const DatabaseParent = /*@__PURE__*/ S.suspend(() => S.Struct({
298
246
  id: S.optional(S.String),
@@ -310,12 +258,11 @@ export const Database = /*@__PURE__*/ S.suspend(() => S.Struct({
310
258
  group: S.optional(S.String),
311
259
  delete_protection: S.optional(S.Boolean),
312
260
  parent: S.optional(S.NullOr(DatabaseParent)),
261
+ allow_attach: S.optional(S.Boolean),
313
262
  })).annotate({ identifier: "Database" });
314
263
  export const GetDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
315
264
  database: S.optional(Database),
316
- })).annotate({
317
- identifier: "GetDatabaseResponse",
318
- });
265
+ })).annotate({ identifier: "GetDatabaseResponse" });
319
266
  export const GetDatabaseConfigurationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
320
267
  organizationSlug: S.String.pipe(T.Label()),
321
268
  databaseName: S.String.pipe(T.Label()),
@@ -326,10 +273,8 @@ export const GetDatabaseConfigurationRequest = /*@__PURE__*/ S.suspend(() => S.S
326
273
  }))).annotate({
327
274
  identifier: "GetDatabaseConfigurationRequest",
328
275
  });
329
- export const DatabaseConfigurationResponseAllowedIpsList =
330
- /*@__PURE__*/ S.Array(S.String);
331
- export const DatabaseConfigurationResponseAllowedAwsVpcIdsList =
332
- /*@__PURE__*/ S.Array(S.String);
276
+ export const DatabaseConfigurationResponseAllowedIpsList = /*@__PURE__*/ S.Array(S.String);
277
+ export const DatabaseConfigurationResponseAllowedAwsVpcIdsList = /*@__PURE__*/ S.Array(S.String);
333
278
  export const DatabaseConfigurationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
334
279
  size_limit: S.optional(S.String),
335
280
  allow_attach: S.optional(S.Boolean),
@@ -372,22 +317,16 @@ export const GetDatabaseStatsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
372
317
  method: "GET",
373
318
  uri: "/v1/organizations/{organizationSlug}/databases/{databaseName}/stats",
374
319
  code: 200,
375
- }))).annotate({
376
- identifier: "GetDatabaseStatsRequest",
377
- });
320
+ }))).annotate({ identifier: "GetDatabaseStatsRequest" });
378
321
  export const DatabaseStatsOutput = /*@__PURE__*/ S.suspend(() => S.Struct({
379
322
  query: S.optional(S.String),
380
323
  rows_read: S.optional(S.Number),
381
324
  rows_written: S.optional(S.Number),
382
- })).annotate({
383
- identifier: "DatabaseStatsOutput",
384
- });
325
+ })).annotate({ identifier: "DatabaseStatsOutput" });
385
326
  export const GetDatabaseStatsResponseTopQueriesList = /*@__PURE__*/ S.Array(DatabaseStatsOutput);
386
327
  export const GetDatabaseStatsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
387
328
  top_queries: S.optional(S.NullOr(GetDatabaseStatsResponseTopQueriesList)),
388
- })).annotate({
389
- identifier: "GetDatabaseStatsResponse",
390
- });
329
+ })).annotate({ identifier: "GetDatabaseStatsResponse" });
391
330
  export const GetDatabaseUsageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
392
331
  organizationSlug: S.String.pipe(T.Label()),
393
332
  databaseName: S.String.pipe(T.Label()),
@@ -397,17 +336,13 @@ export const GetDatabaseUsageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
397
336
  method: "GET",
398
337
  uri: "/v1/organizations/{organizationSlug}/databases/{databaseName}/usage",
399
338
  code: 200,
400
- }))).annotate({
401
- identifier: "GetDatabaseUsageRequest",
402
- });
339
+ }))).annotate({ identifier: "GetDatabaseUsageRequest" });
403
340
  export const DatabaseUsageObject = /*@__PURE__*/ S.suspend(() => S.Struct({
404
341
  rows_read: S.optional(S.Number),
405
342
  rows_written: S.optional(S.Number),
406
343
  storage_bytes: S.optional(S.Number),
407
344
  bytes_synced: S.optional(S.Number),
408
- })).annotate({
409
- identifier: "DatabaseUsageObject",
410
- });
345
+ })).annotate({ identifier: "DatabaseUsageObject" });
411
346
  export const DatabaseUsageOutputInstancesItem = /*@__PURE__*/ S.suspend(() => S.Struct({
412
347
  uuid: S.optional(S.String),
413
348
  usage: S.optional(DatabaseUsageObject),
@@ -419,14 +354,10 @@ export const DatabaseUsageOutput = /*@__PURE__*/ S.suspend(() => S.Struct({
419
354
  uuid: S.optional(S.String),
420
355
  instances: S.optional(DatabaseUsageOutputInstancesList),
421
356
  total: S.optional(DatabaseUsageObject),
422
- })).annotate({
423
- identifier: "DatabaseUsageOutput",
424
- });
357
+ })).annotate({ identifier: "DatabaseUsageOutput" });
425
358
  export const GetDatabaseUsageResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
426
359
  database: S.optional(DatabaseUsageOutput),
427
- })).annotate({
428
- identifier: "GetDatabaseUsageResponse",
429
- });
360
+ })).annotate({ identifier: "GetDatabaseUsageResponse" });
430
361
  export const GetGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
431
362
  organizationSlug: S.String.pipe(T.Label()),
432
363
  groupName: S.String.pipe(T.Label()),
@@ -434,14 +365,10 @@ export const GetGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
434
365
  method: "GET",
435
366
  uri: "/v1/organizations/{organizationSlug}/groups/{groupName}",
436
367
  code: 200,
437
- }))).annotate({
438
- identifier: "GetGroupRequest",
439
- });
368
+ }))).annotate({ identifier: "GetGroupRequest" });
440
369
  export const GetGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
441
370
  group: S.optional(Group),
442
- })).annotate({
443
- identifier: "GetGroupResponse",
444
- });
371
+ })).annotate({ identifier: "GetGroupResponse" });
445
372
  export const GetGroupConfigurationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
446
373
  organizationSlug: S.String.pipe(T.Label()),
447
374
  groupName: S.String.pipe(T.Label()),
@@ -459,13 +386,7 @@ export const GroupConfigurationResponse = /*@__PURE__*/ S.suspend(() => S.Struct
459
386
  });
460
387
  export const GetOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
461
388
  organizationSlug: S.String.pipe(T.Label()),
462
- }).pipe(T.Http({
463
- method: "GET",
464
- uri: "/v1/organizations/{organizationSlug}",
465
- code: 200,
466
- }))).annotate({
467
- identifier: "GetOrganizationRequest",
468
- });
389
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}", code: 200 }))).annotate({ identifier: "GetOrganizationRequest" });
469
390
  export const OrganizationType = S.String;
470
391
  export const Organization = /*@__PURE__*/ S.suspend(() => S.Struct({
471
392
  name: S.optional(S.String),
@@ -478,12 +399,11 @@ export const Organization = /*@__PURE__*/ S.suspend(() => S.Struct({
478
399
  plan_id: S.optional(S.String),
479
400
  plan_timeline: S.optional(S.String),
480
401
  platform: S.optional(S.String),
402
+ restore_enabled: S.optional(S.Boolean),
481
403
  })).annotate({ identifier: "Organization" });
482
404
  export const GetOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
483
405
  organization: S.optional(Organization),
484
- })).annotate({
485
- identifier: "GetOrganizationResponse",
486
- });
406
+ })).annotate({ identifier: "GetOrganizationResponse" });
487
407
  export const GetOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
488
408
  organizationSlug: S.String.pipe(T.Label()),
489
409
  username: S.String.pipe(T.Label()),
@@ -507,15 +427,10 @@ export const GetOrganizationMemberResponse = /*@__PURE__*/ S.suspend(() => S.Str
507
427
  });
508
428
  export const GetOrganizationSubscriptionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
509
429
  organizationSlug: S.String.pipe(T.Label()),
510
- }).pipe(T.Http({
511
- method: "GET",
512
- uri: "/v1/organizations/{organizationSlug}/subscription",
513
- code: 200,
514
- }))).annotate({
430
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/subscription", code: 200 }))).annotate({
515
431
  identifier: "GetOrganizationSubscriptionRequest",
516
432
  });
517
- export const GetOrganizationSubscriptionResponseSubscription =
518
- /*@__PURE__*/ S.suspend(() => S.Struct({
433
+ export const GetOrganizationSubscriptionResponseSubscription = /*@__PURE__*/ S.suspend(() => S.Struct({
519
434
  name: S.optional(S.String),
520
435
  overages: S.optional(S.Boolean),
521
436
  plan: S.optional(S.String),
@@ -530,15 +445,10 @@ export const GetOrganizationSubscriptionResponse = /*@__PURE__*/ S.suspend(() =>
530
445
  });
531
446
  export const GetOrganizationUsageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
532
447
  organizationSlug: S.String.pipe(T.Label()),
533
- }).pipe(T.Http({
534
- method: "GET",
535
- uri: "/v1/organizations/{organizationSlug}/usage",
536
- code: 200,
537
- }))).annotate({
448
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/usage", code: 200 }))).annotate({
538
449
  identifier: "GetOrganizationUsageRequest",
539
450
  });
540
- export const GetOrganizationUsageResponseOrganizationUsage =
541
- /*@__PURE__*/ S.suspend(() => S.Struct({
451
+ export const GetOrganizationUsageResponseOrganizationUsage = /*@__PURE__*/ S.suspend(() => S.Struct({
542
452
  rows_read: S.optional(S.Number),
543
453
  rows_written: S.optional(S.Number),
544
454
  databases: S.optional(S.Number),
@@ -549,8 +459,7 @@ export const GetOrganizationUsageResponseOrganizationUsage =
549
459
  })).annotate({
550
460
  identifier: "GetOrganizationUsageResponseOrganizationUsage",
551
461
  });
552
- export const GetOrganizationUsageResponseOrganizationDatabasesList =
553
- /*@__PURE__*/ S.Array(DatabaseUsageOutput);
462
+ export const GetOrganizationUsageResponseOrganizationDatabasesList = /*@__PURE__*/ S.Array(DatabaseUsageOutput);
554
463
  export const GetOrganizationUsageResponseOrganization = /*@__PURE__*/ S.suspend(() => S.Struct({
555
464
  uuid: S.optional(S.String),
556
465
  usage: S.optional(GetOrganizationUsageResponseOrganizationUsage),
@@ -595,11 +504,7 @@ export const InviteOrganizationMemberV2Request = /*@__PURE__*/ S.suspend(() => S
595
504
  email: S.optional(S.String),
596
505
  username: S.optional(S.String),
597
506
  role: S.optional(InviteOrganizationMemberV2RequestRole),
598
- }).pipe(T.Http({
599
- method: "POST",
600
- uri: "/v2/organizations/{organizationSlug}/invites",
601
- code: 200,
602
- }))).annotate({
507
+ }).pipe(T.Http({ method: "POST", uri: "/v2/organizations/{organizationSlug}/invites", code: 200 }))).annotate({
603
508
  identifier: "InviteOrganizationMemberV2Request",
604
509
  });
605
510
  export const InviteCreatedV2Role = S.String;
@@ -607,17 +512,13 @@ export const InviteCreatedV2 = /*@__PURE__*/ S.suspend(() => S.Struct({
607
512
  email: S.optional(S.String),
608
513
  role: S.optional(InviteCreatedV2Role),
609
514
  organization: S.optional(S.String),
610
- })).annotate({
611
- identifier: "InviteCreatedV2",
612
- });
515
+ })).annotate({ identifier: "InviteCreatedV2" });
613
516
  export const InviteOrganizationMemberV2Response = /*@__PURE__*/ S.suspend(() => S.Struct({
614
517
  invited: S.optional(InviteCreatedV2),
615
518
  })).annotate({
616
519
  identifier: "InviteOrganizationMemberV2Response",
617
520
  });
618
- export const ListAPITokensRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/auth/api-tokens", code: 200 }))).annotate({
619
- identifier: "ListAPITokensRequest",
620
- });
521
+ export const ListAPITokensRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/auth/api-tokens", code: 200 }))).annotate({ identifier: "ListAPITokensRequest" });
621
522
  export const APITokenScopesList = /*@__PURE__*/ S.Array(S.String);
622
523
  export const APIToken = /*@__PURE__*/ S.suspend(() => S.Struct({
623
524
  name: S.optional(S.String),
@@ -630,9 +531,7 @@ export const APIToken = /*@__PURE__*/ S.suspend(() => S.Struct({
630
531
  export const ListAPITokensResponseTokensList = /*@__PURE__*/ S.Array(APIToken);
631
532
  export const ListAPITokensResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
632
533
  tokens: S.optional(ListAPITokensResponseTokensList),
633
- })).annotate({
634
- identifier: "ListAPITokensResponse",
635
- });
534
+ })).annotate({ identifier: "ListAPITokensResponse" });
636
535
  export const ListDatabaseInstancesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
637
536
  organizationSlug: S.String.pipe(T.Label()),
638
537
  databaseName: S.String.pipe(T.Label()),
@@ -654,63 +553,87 @@ export const ListDatabasesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
654
553
  group: S.optional(S.String.pipe(T.Query())),
655
554
  schema: S.optional(S.String.pipe(T.Query())),
656
555
  parent: S.optional(S.String.pipe(T.Query())),
657
- }).pipe(T.Http({
658
- method: "GET",
659
- uri: "/v1/organizations/{organizationSlug}/databases",
660
- code: 200,
661
- }))).annotate({
662
- identifier: "ListDatabasesRequest",
663
- });
556
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/databases", code: 200 }))).annotate({ identifier: "ListDatabasesRequest" });
664
557
  export const ListDatabasesResponseDatabasesList = /*@__PURE__*/ S.Array(Database);
665
558
  export const ListDatabasesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
666
559
  databases: S.optional(ListDatabasesResponseDatabasesList),
560
+ })).annotate({ identifier: "ListDatabasesResponse" });
561
+ export const ListDeletedDatabasesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
562
+ organizationId: S.String.pipe(T.Label()),
563
+ deleted: S.Boolean.pipe(T.Query()),
564
+ search: S.optional(S.String.pipe(T.Query())),
565
+ limit: S.optional(S.Number.pipe(T.Query())),
566
+ cursor: S.optional(S.String.pipe(T.Query())),
567
+ }).pipe(T.Http({ method: "GET", uri: "/v3/organizations/{organizationId}/databases", code: 200 }))).annotate({
568
+ identifier: "ListDeletedDatabasesRequest",
569
+ });
570
+ export const DeletedDatabaseRegionsList = /*@__PURE__*/ S.Array(S.String);
571
+ export const DeletedDatabase = /*@__PURE__*/ S.suspend(() => S.Struct({
572
+ Name: S.optional(S.String),
573
+ DbId: S.optional(S.String),
574
+ Hostname: S.optional(S.String),
575
+ group: S.optional(S.String),
576
+ group_id: S.optional(S.String),
577
+ organization_id: S.optional(S.String),
578
+ regions: S.optional(DeletedDatabaseRegionsList),
579
+ primaryRegion: S.optional(S.String),
580
+ delete_protection: S.optional(S.Boolean),
581
+ deleted_at: S.optional(S.String),
582
+ group_deleted_at: S.optional(S.String),
583
+ })).annotate({ identifier: "DeletedDatabase" });
584
+ export const ListDeletedDatabasesResponseDatabasesList = /*@__PURE__*/ S.Array(DeletedDatabase);
585
+ export const Pagination = /*@__PURE__*/ S.suspend(() => S.Struct({
586
+ next: S.optional(S.String),
587
+ })).annotate({ identifier: "Pagination" });
588
+ export const ListDeletedDatabasesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
589
+ databases: S.optional(ListDeletedDatabasesResponseDatabasesList),
590
+ pagination: S.optional(Pagination),
591
+ })).annotate({
592
+ identifier: "ListDeletedDatabasesResponse",
593
+ });
594
+ export const ListDeletedGroupsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
595
+ organizationId: S.String.pipe(T.Label()),
596
+ limit: S.optional(S.Number.pipe(T.Query())),
597
+ cursor: S.optional(S.String.pipe(T.Query())),
598
+ }).pipe(T.Http({ method: "GET", uri: "/v3/organizations/{organizationId}/deleted-groups", code: 200 }))).annotate({ identifier: "ListDeletedGroupsRequest" });
599
+ export const DeletedGroup = /*@__PURE__*/ S.suspend(() => S.Struct({
600
+ uuid: S.optional(S.String),
601
+ name: S.optional(S.String),
602
+ deleted_at: S.optional(S.String),
603
+ cascade_databases: S.optional(S.Number),
604
+ })).annotate({ identifier: "DeletedGroup" });
605
+ export const ListDeletedGroupsResponseGroupsList = /*@__PURE__*/ S.Array(DeletedGroup);
606
+ export const ListDeletedGroupsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
607
+ groups: S.optional(ListDeletedGroupsResponseGroupsList),
608
+ pagination: S.optional(Pagination),
667
609
  })).annotate({
668
- identifier: "ListDatabasesResponse",
610
+ identifier: "ListDeletedGroupsResponse",
669
611
  });
670
612
  export const ListGroupsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
671
613
  organizationSlug: S.String.pipe(T.Label()),
672
- }).pipe(T.Http({
673
- method: "GET",
674
- uri: "/v1/organizations/{organizationSlug}/groups",
675
- code: 200,
676
- }))).annotate({
677
- identifier: "ListGroupsRequest",
678
- });
614
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/groups", code: 200 }))).annotate({ identifier: "ListGroupsRequest" });
679
615
  export const ListGroupsResponseGroupsList = /*@__PURE__*/ S.Array(Group);
680
616
  export const ListGroupsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
681
617
  groups: S.optional(ListGroupsResponseGroupsList),
682
- })).annotate({
683
- identifier: "ListGroupsResponse",
684
- });
685
- export const ListLocationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/locations", code: 200 }))).annotate({
686
- identifier: "ListLocationsRequest",
687
- });
618
+ })).annotate({ identifier: "ListGroupsResponse" });
619
+ export const ListLocationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/locations", code: 200 }))).annotate({ identifier: "ListLocationsRequest" });
688
620
  export const ListLocationsResponseLocationsMap = /*@__PURE__*/ S.Record(S.String, S.String);
689
621
  export const ListLocationsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
690
622
  locations: S.optional(ListLocationsResponseLocationsMap),
691
- })).annotate({
692
- identifier: "ListLocationsResponse",
693
- });
623
+ })).annotate({ identifier: "ListLocationsResponse" });
694
624
  export const ListOrganizationAPITokensRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
695
625
  organizationSlug: S.String.pipe(T.Label()),
696
- }).pipe(T.Http({
697
- method: "GET",
698
- uri: "/v1/organizations/{organizationSlug}/api-tokens",
699
- code: 200,
700
- }))).annotate({
626
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/api-tokens", code: 200 }))).annotate({
701
627
  identifier: "ListOrganizationAPITokensRequest",
702
628
  });
703
- export const ListOrganizationAPITokensResponseTokensItemScopesList =
704
- /*@__PURE__*/ S.Array(S.String);
705
- export const ListOrganizationAPITokensResponseTokensItemOwner =
706
- /*@__PURE__*/ S.suspend(() => S.Struct({
629
+ export const ListOrganizationAPITokensResponseTokensItemScopesList = /*@__PURE__*/ S.Array(S.String);
630
+ export const ListOrganizationAPITokensResponseTokensItemOwner = /*@__PURE__*/ S.suspend(() => S.Struct({
707
631
  username: S.optional(S.String),
708
632
  email: S.optional(S.String),
709
633
  })).annotate({
710
634
  identifier: "ListOrganizationAPITokensResponseTokensItemOwner",
711
635
  });
712
- export const ListOrganizationAPITokensResponseTokensItem =
713
- /*@__PURE__*/ S.suspend(() => S.Struct({
636
+ export const ListOrganizationAPITokensResponseTokensItem = /*@__PURE__*/ S.suspend(() => S.Struct({
714
637
  name: S.optional(S.String),
715
638
  id: S.optional(S.String),
716
639
  organization: S.optional(S.String),
@@ -721,8 +644,7 @@ export const ListOrganizationAPITokensResponseTokensItem =
721
644
  })).annotate({
722
645
  identifier: "ListOrganizationAPITokensResponseTokensItem",
723
646
  });
724
- export const ListOrganizationAPITokensResponseTokensList =
725
- /*@__PURE__*/ S.Array(ListOrganizationAPITokensResponseTokensItem);
647
+ export const ListOrganizationAPITokensResponseTokensList = /*@__PURE__*/ S.Array(ListOrganizationAPITokensResponseTokensItem);
726
648
  export const ListOrganizationAPITokensResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
727
649
  tokens: S.optional(ListOrganizationAPITokensResponseTokensList),
728
650
  })).annotate({
@@ -732,11 +654,7 @@ export const ListOrganizationAuditLogsRequest = /*@__PURE__*/ S.suspend(() => S.
732
654
  organizationSlug: S.String.pipe(T.Label()),
733
655
  page_size: S.optional(S.Number.pipe(T.Query())),
734
656
  page: S.optional(S.Number.pipe(T.Query())),
735
- }).pipe(T.Http({
736
- method: "GET",
737
- uri: "/v1/organizations/{organizationSlug}/audit-logs",
738
- code: 200,
739
- }))).annotate({
657
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/audit-logs", code: 200 }))).annotate({
740
658
  identifier: "ListOrganizationAuditLogsRequest",
741
659
  });
742
660
  export const AuditLogCode = S.String;
@@ -748,10 +666,8 @@ export const AuditLog = /*@__PURE__*/ S.suspend(() => S.Struct({
748
666
  created_at: S.optional(S.String),
749
667
  data: S.optional(S.Unknown),
750
668
  })).annotate({ identifier: "AuditLog" });
751
- export const ListOrganizationAuditLogsResponseAuditLogsList =
752
- /*@__PURE__*/ S.Array(AuditLog);
753
- export const ListOrganizationAuditLogsResponsePagination =
754
- /*@__PURE__*/ S.suspend(() => S.Struct({
669
+ export const ListOrganizationAuditLogsResponseAuditLogsList = /*@__PURE__*/ S.Array(AuditLog);
670
+ export const ListOrganizationAuditLogsResponsePagination = /*@__PURE__*/ S.suspend(() => S.Struct({
755
671
  page: S.optional(S.Number),
756
672
  page_size: S.optional(S.Number),
757
673
  total_pages: S.optional(S.Number),
@@ -767,11 +683,7 @@ export const ListOrganizationAuditLogsResponse = /*@__PURE__*/ S.suspend(() => S
767
683
  });
768
684
  export const ListOrganizationInvitesV2Request = /*@__PURE__*/ S.suspend(() => S.Struct({
769
685
  organizationSlug: S.String.pipe(T.Label()),
770
- }).pipe(T.Http({
771
- method: "GET",
772
- uri: "/v2/organizations/{organizationSlug}/invites",
773
- code: 200,
774
- }))).annotate({
686
+ }).pipe(T.Http({ method: "GET", uri: "/v2/organizations/{organizationSlug}/invites", code: 200 }))).annotate({
775
687
  identifier: "ListOrganizationInvitesV2Request",
776
688
  });
777
689
  export const InviteV2Role = S.String;
@@ -781,8 +693,7 @@ export const InviteV2 = /*@__PURE__*/ S.suspend(() => S.Struct({
781
693
  role: S.optional(InviteV2Role),
782
694
  created_at: S.optional(S.String),
783
695
  })).annotate({ identifier: "InviteV2" });
784
- export const ListOrganizationInvitesV2ResponseInvitesList =
785
- /*@__PURE__*/ S.Array(InviteV2);
696
+ export const ListOrganizationInvitesV2ResponseInvitesList = /*@__PURE__*/ S.Array(InviteV2);
786
697
  export const ListOrganizationInvitesV2Response = /*@__PURE__*/ S.suspend(() => S.Struct({
787
698
  invites: S.optional(ListOrganizationInvitesV2ResponseInvitesList),
788
699
  })).annotate({
@@ -792,15 +703,10 @@ export const ListOrganizationInvoicesRequestType = S.String;
792
703
  export const ListOrganizationInvoicesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
793
704
  organizationSlug: S.String.pipe(T.Label()),
794
705
  type: S.optional(ListOrganizationInvoicesRequestType.pipe(T.Query())),
795
- }).pipe(T.Http({
796
- method: "GET",
797
- uri: "/v1/organizations/{organizationSlug}/invoices",
798
- code: 200,
799
- }))).annotate({
706
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/invoices", code: 200 }))).annotate({
800
707
  identifier: "ListOrganizationInvoicesRequest",
801
708
  });
802
- export const ListOrganizationInvoicesResponseInvoicesItem =
803
- /*@__PURE__*/ S.suspend(() => S.Struct({
709
+ export const ListOrganizationInvoicesResponseInvoicesItem = /*@__PURE__*/ S.suspend(() => S.Struct({
804
710
  invoice_number: S.optional(S.String),
805
711
  amount_due: S.optional(S.String),
806
712
  due_date: S.optional(S.String),
@@ -810,8 +716,7 @@ export const ListOrganizationInvoicesResponseInvoicesItem =
810
716
  })).annotate({
811
717
  identifier: "ListOrganizationInvoicesResponseInvoicesItem",
812
718
  });
813
- export const ListOrganizationInvoicesResponseInvoicesList =
814
- /*@__PURE__*/ S.Array(ListOrganizationInvoicesResponseInvoicesItem);
719
+ export const ListOrganizationInvoicesResponseInvoicesList = /*@__PURE__*/ S.Array(ListOrganizationInvoicesResponseInvoicesItem);
815
720
  export const ListOrganizationInvoicesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
816
721
  invoices: S.optional(ListOrganizationInvoicesResponseInvoicesList),
817
722
  })).annotate({
@@ -819,11 +724,7 @@ export const ListOrganizationInvoicesResponse = /*@__PURE__*/ S.suspend(() => S.
819
724
  });
820
725
  export const ListOrganizationMembersRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
821
726
  organizationSlug: S.String.pipe(T.Label()),
822
- }).pipe(T.Http({
823
- method: "GET",
824
- uri: "/v1/organizations/{organizationSlug}/members",
825
- code: 200,
826
- }))).annotate({
727
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/members", code: 200 }))).annotate({
827
728
  identifier: "ListOrganizationMembersRequest",
828
729
  });
829
730
  export const ListOrganizationMembersResponseMembersList = /*@__PURE__*/ S.Array(Member);
@@ -834,11 +735,7 @@ export const ListOrganizationMembersResponse = /*@__PURE__*/ S.suspend(() => S.S
834
735
  });
835
736
  export const ListOrganizationPlansRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
836
737
  organizationSlug: S.String.pipe(T.Label()),
837
- }).pipe(T.Http({
838
- method: "GET",
839
- uri: "/v1/organizations/{organizationSlug}/plans",
840
- code: 200,
841
- }))).annotate({
738
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/plans", code: 200 }))).annotate({
842
739
  identifier: "ListOrganizationPlansRequest",
843
740
  });
844
741
  export const PlanPrice = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -860,18 +757,14 @@ export const OrganizationPlan = /*@__PURE__*/ S.suspend(() => S.Struct({
860
757
  price: S.optional(S.String),
861
758
  prices: S.optional(OrganizationPlanPricesList),
862
759
  quotas: S.optional(PlanQuotas),
863
- })).annotate({
864
- identifier: "OrganizationPlan",
865
- });
760
+ })).annotate({ identifier: "OrganizationPlan" });
866
761
  export const ListOrganizationPlansResponsePlansList = /*@__PURE__*/ S.Array(OrganizationPlan);
867
762
  export const ListOrganizationPlansResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
868
763
  plans: S.optional(ListOrganizationPlansResponsePlansList),
869
764
  })).annotate({
870
765
  identifier: "ListOrganizationPlansResponse",
871
766
  });
872
- export const ListOrganizationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/organizations", code: 200 }))).annotate({
873
- identifier: "ListOrganizationsRequest",
874
- });
767
+ export const ListOrganizationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/organizations", code: 200 }))).annotate({ identifier: "ListOrganizationsRequest" });
875
768
  export const ListOrganizationsResponseBodyList = /*@__PURE__*/ S.Array(Organization);
876
769
  export const ListOrganizationsResponse = /*@__PURE__*/ S.suspend(() => ListOrganizationsResponseBodyList.pipe(T.RawResponseRoot())).annotate({
877
770
  identifier: "ListOrganizationsResponse",
@@ -907,20 +800,39 @@ export const RemoveOrganizationMemberResponse = /*@__PURE__*/ S.suspend(() => S.
907
800
  })).annotate({
908
801
  identifier: "RemoveOrganizationMemberResponse",
909
802
  });
910
- export const RevokeAPITokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
911
- tokenName: S.String.pipe(T.Label()),
803
+ export const RestoreDatabaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
804
+ organizationId: S.String.pipe(T.Label()),
805
+ databaseId: S.String.pipe(T.Label()),
806
+ name: S.optional(S.String),
912
807
  }).pipe(T.Http({
913
- method: "DELETE",
914
- uri: "/v1/auth/api-tokens/{tokenName}",
808
+ method: "POST",
809
+ uri: "/v3/organizations/{organizationId}/databases/{databaseId}/restore",
915
810
  code: 200,
916
- }))).annotate({
917
- identifier: "RevokeAPITokenRequest",
918
- });
811
+ }))).annotate({ identifier: "RestoreDatabaseRequest" });
812
+ export const RestoreDatabaseResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
813
+ database: S.optional(DeletedDatabase),
814
+ })).annotate({ identifier: "RestoreDatabaseResponse" });
815
+ export const RestoreGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
816
+ organizationId: S.String.pipe(T.Label()),
817
+ groupId: S.String.pipe(T.Label()),
818
+ }).pipe(T.Http({
819
+ method: "POST",
820
+ uri: "/v3/organizations/{organizationId}/groups/{groupId}/restore",
821
+ code: 200,
822
+ }))).annotate({ identifier: "RestoreGroupRequest" });
823
+ export const RestoreGroupResponseDatabasesList = /*@__PURE__*/ S.Array(DeletedDatabase);
824
+ export const RestoreGroupResponseFailuresMap = /*@__PURE__*/ S.Record(S.String, S.String);
825
+ export const RestoreGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
826
+ group: S.optional(Group),
827
+ databases: S.optional(RestoreGroupResponseDatabasesList),
828
+ failures: S.optional(RestoreGroupResponseFailuresMap),
829
+ })).annotate({ identifier: "RestoreGroupResponse" });
830
+ export const RevokeAPITokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
831
+ tokenName: S.String.pipe(T.Label()),
832
+ }).pipe(T.Http({ method: "DELETE", uri: "/v1/auth/api-tokens/{tokenName}", code: 200 }))).annotate({ identifier: "RevokeAPITokenRequest" });
919
833
  export const RevokeAPITokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
920
834
  token: S.optional(S.String),
921
- })).annotate({
922
- identifier: "RevokeAPITokenResponse",
923
- });
835
+ })).annotate({ identifier: "RevokeAPITokenResponse" });
924
836
  export const RevokeOrganizationAPITokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
925
837
  organizationSlug: S.String.pipe(T.Label()),
926
838
  tokenId: S.String.pipe(T.Label()),
@@ -944,9 +856,7 @@ export const TransferGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
944
856
  method: "POST",
945
857
  uri: "/v1/organizations/{organizationSlug}/groups/{groupName}/transfer",
946
858
  code: 200,
947
- }))).annotate({
948
- identifier: "TransferGroupRequest",
949
- });
859
+ }))).annotate({ identifier: "TransferGroupRequest" });
950
860
  export const TransferGroupResponseLocationsList = /*@__PURE__*/ S.Array(S.String);
951
861
  export const TransferGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
952
862
  name: S.optional(S.String),
@@ -955,9 +865,7 @@ export const TransferGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
955
865
  locations: S.optional(TransferGroupResponseLocationsList),
956
866
  primary: S.optional(S.String),
957
867
  delete_protection: S.optional(S.Boolean),
958
- })).annotate({
959
- identifier: "TransferGroupResponse",
960
- });
868
+ })).annotate({ identifier: "TransferGroupResponse" });
961
869
  export const UnarchiveGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
962
870
  organizationSlug: S.String.pipe(T.Label()),
963
871
  groupName: S.String.pipe(T.Label()),
@@ -965,18 +873,12 @@ export const UnarchiveGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
965
873
  method: "POST",
966
874
  uri: "/v1/organizations/{organizationSlug}/groups/{groupName}/unarchive",
967
875
  code: 200,
968
- }))).annotate({
969
- identifier: "UnarchiveGroupRequest",
970
- });
876
+ }))).annotate({ identifier: "UnarchiveGroupRequest" });
971
877
  export const UnarchiveGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
972
878
  group: S.optional(Group),
973
- })).annotate({
974
- identifier: "UnarchiveGroupResponse",
975
- });
976
- export const UpdateDatabaseConfigurationRequestAllowedIpsList =
977
- /*@__PURE__*/ S.Array(S.String);
978
- export const UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList =
979
- /*@__PURE__*/ S.Array(S.String);
879
+ })).annotate({ identifier: "UnarchiveGroupResponse" });
880
+ export const UpdateDatabaseConfigurationRequestAllowedIpsList = /*@__PURE__*/ S.Array(S.String);
881
+ export const UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList = /*@__PURE__*/ S.Array(S.String);
980
882
  export const UpdateDatabaseConfigurationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
981
883
  organizationSlug: S.String.pipe(T.Label()),
982
884
  databaseName: S.String.pipe(T.Label()),
@@ -1027,9 +929,7 @@ export const UpdateMemberRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1027
929
  method: "PATCH",
1028
930
  uri: "/v1/organizations/{organizationSlug}/members/{username}",
1029
931
  code: 200,
1030
- }))).annotate({
1031
- identifier: "UpdateMemberRoleRequest",
1032
- });
932
+ }))).annotate({ identifier: "UpdateMemberRoleRequest" });
1033
933
  export const UpdateMemberRoleResponseMemberRole = S.String;
1034
934
  export const UpdateMemberRoleResponseMember = /*@__PURE__*/ S.suspend(() => S.Struct({
1035
935
  username: S.optional(S.String),
@@ -1040,18 +940,13 @@ export const UpdateMemberRoleResponseMember = /*@__PURE__*/ S.suspend(() => S.St
1040
940
  });
1041
941
  export const UpdateMemberRoleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
1042
942
  member: S.optional(UpdateMemberRoleResponseMember),
1043
- })).annotate({
1044
- identifier: "UpdateMemberRoleResponse",
1045
- });
943
+ })).annotate({ identifier: "UpdateMemberRoleResponse" });
1046
944
  export const UpdateOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1047
945
  organizationSlug: S.String.pipe(T.Label()),
1048
946
  overages: S.optional(S.Boolean),
1049
947
  require_mfa: S.optional(S.Boolean),
1050
- }).pipe(T.Http({
1051
- method: "PATCH",
1052
- uri: "/v1/organizations/{organizationSlug}",
1053
- code: 200,
1054
- }))).annotate({
948
+ restore_enabled: S.optional(S.Boolean),
949
+ }).pipe(T.Http({ method: "PATCH", uri: "/v1/organizations/{organizationSlug}", code: 200 }))).annotate({
1055
950
  identifier: "UpdateOrganizationRequest",
1056
951
  });
1057
952
  export const UpdateOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -1059,14 +954,10 @@ export const UpdateOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct
1059
954
  })).annotate({
1060
955
  identifier: "UpdateOrganizationResponse",
1061
956
  });
1062
- export const ValidateAPITokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/auth/validate", code: 200 }))).annotate({
1063
- identifier: "ValidateAPITokenRequest",
1064
- });
957
+ export const ValidateAPITokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/auth/validate", code: 200 }))).annotate({ identifier: "ValidateAPITokenRequest" });
1065
958
  export const ValidateAPITokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
1066
959
  exp: S.optional(S.Number),
1067
- })).annotate({
1068
- identifier: "ValidateAPITokenResponse",
1069
- });
960
+ })).annotate({ identifier: "ValidateAPITokenResponse" });
1070
961
  /** Add Location to Group Adds a location to the specified group. */
1071
962
  export const addLocationToGroup = /*@__PURE__*/ API.make(() => ({
1072
963
  input: AddLocationToGroupRequest,
@@ -1087,7 +978,7 @@ export const addOrganizationMember = /*@__PURE__*/ API.make(() => ({
1087
978
  export const createAPIToken = /*@__PURE__*/ API.make(() => ({
1088
979
  input: CreateAPITokenRequest,
1089
980
  output: CreateAPITokenResponse,
1090
- errors: [],
981
+ errors: [BadRequest, NotFound, Conflict],
1091
982
  protocol: TursoProtocol,
1092
983
  retry: Retry.Retry,
1093
984
  }));
@@ -1291,6 +1182,22 @@ export const listDatabases = /*@__PURE__*/ API.make(() => ({
1291
1182
  protocol: TursoProtocol,
1292
1183
  retry: Retry.Retry,
1293
1184
  }));
1185
+ /** List Deleted Databases Returns databases deleted within the last five days, which can still be restored. Requires a paid plan. Available even while recovery is disabled for the organization. */
1186
+ export const listDeletedDatabases = /*@__PURE__*/ API.make(() => ({
1187
+ input: ListDeletedDatabasesRequest,
1188
+ output: ListDeletedDatabasesResponse,
1189
+ errors: [Forbidden],
1190
+ protocol: TursoProtocol,
1191
+ retry: Retry.Retry,
1192
+ }));
1193
+ /** List Deleted Groups Returns groups deleted within the last five days, including empty groups, which can still be restored. Requires a paid plan and an organization-level token. Available even while recovery is disabled for the organization. */
1194
+ export const listDeletedGroups = /*@__PURE__*/ API.make(() => ({
1195
+ input: ListDeletedGroupsRequest,
1196
+ output: ListDeletedGroupsResponse,
1197
+ errors: [Forbidden],
1198
+ protocol: TursoProtocol,
1199
+ retry: Retry.Retry,
1200
+ }));
1294
1201
  /** List Groups Returns a list of groups belonging to the organization or user. */
1295
1202
  export const listGroups = /*@__PURE__*/ API.make(() => ({
1296
1203
  input: ListGroupsRequest,
@@ -1379,6 +1286,22 @@ export const removeOrganizationMember = /*@__PURE__*/ API.make(() => ({
1379
1286
  protocol: TursoProtocol,
1380
1287
  retry: Retry.Retry,
1381
1288
  }));
1289
+ /** Restore Database Restore a database deleted within the last five days, exactly as it was at the moment it was deleted. Requires a paid plan, an admin or owner of the organization, and recovery enabled for the organization. */
1290
+ export const restoreDatabase = /*@__PURE__*/ API.make(() => ({
1291
+ input: RestoreDatabaseRequest,
1292
+ output: RestoreDatabaseResponse,
1293
+ errors: [BadRequest, Forbidden, NotFound],
1294
+ protocol: TursoProtocol,
1295
+ retry: Retry.Retry,
1296
+ }));
1297
+ /** Restore Group Restore a group deleted within the last five days, along with the member databases that were deleted with it. Requires a paid plan, an admin or owner of the organization, and recovery enabled for the organization. If some databases fail to restore, the group still becomes active: retry the failed database UUIDs individually with Restore Database. */
1298
+ export const restoreGroup = /*@__PURE__*/ API.make(() => ({
1299
+ input: RestoreGroupRequest,
1300
+ output: RestoreGroupResponse,
1301
+ errors: [BadRequest, Forbidden, NotFound],
1302
+ protocol: TursoProtocol,
1303
+ retry: Retry.Retry,
1304
+ }));
1382
1305
  /** Revoke API Token Revokes the provided API token belonging to a user. */
1383
1306
  export const revokeAPIToken = /*@__PURE__*/ API.make(() => ({
1384
1307
  input: RevokeAPITokenRequest,
@@ -1391,7 +1314,7 @@ export const revokeAPIToken = /*@__PURE__*/ API.make(() => ({
1391
1314
  export const revokeOrganizationAPIToken = /*@__PURE__*/ API.make(() => ({
1392
1315
  input: RevokeOrganizationAPITokenRequest,
1393
1316
  output: RevokeOrganizationAPITokenResponse,
1394
- errors: [],
1317
+ errors: [NotFound],
1395
1318
  protocol: TursoProtocol,
1396
1319
  retry: Retry.Retry,
1397
1320
  }));