@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,14 +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.ts";
6
- import {
7
- TursoProtocol,
8
- type TursoOpError,
9
- type TursoOpContext,
10
- } from "../protocol.ts";
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, type TursoOpError, type TursoOpContext } from "../protocol.ts";
11
7
  import * as Retry from "../retry.ts";
8
+ import * as T from "../traits.ts";
12
9
 
13
10
  export type { TursoOpError, TursoOpContext };
14
11
 
@@ -133,11 +130,7 @@ export const AddOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() =>
133
130
  username: S.optional(S.String),
134
131
  role: S.optional(AddOrganizationMemberRequestRole),
135
132
  }).pipe(
136
- T.Http({
137
- method: "POST",
138
- uri: "/v1/organizations/{organizationSlug}/members",
139
- code: 200,
140
- }),
133
+ T.Http({ method: "POST", uri: "/v1/organizations/{organizationSlug}/members", code: 200 }),
141
134
  ),
142
135
  ).annotate({
143
136
  identifier: "AddOrganizationMemberRequest",
@@ -198,32 +191,22 @@ export const CreateAPITokenRequest = /*@__PURE__*/ S.suspend(() =>
198
191
  organization: S.optional(S.String),
199
192
  group: S.optional(S.String),
200
193
  scopes: S.optional(CreateAPITokenRequestScopesList),
201
- }).pipe(
202
- T.Http({
203
- method: "POST",
204
- uri: "/v1/auth/api-tokens/{tokenName}",
205
- code: 200,
206
- }),
207
- ),
208
- ).annotate({
209
- identifier: "CreateAPITokenRequest",
210
- }) as any as S.Schema<CreateAPITokenRequest>;
194
+ }).pipe(T.Http({ method: "POST", uri: "/v1/auth/api-tokens/{tokenName}", code: 200 })),
195
+ ).annotate({ identifier: "CreateAPITokenRequest" }) as any as S.Schema<CreateAPITokenRequest>;
211
196
 
212
197
  export interface CreateAPITokenResponse {
213
198
  name?: string;
214
199
  id?: string;
215
200
  /** The actual token contents as a JWT. This is used with the `Bearer` header, see [Authentication](/authentication) for more details. **This token is never revealed again.** */
216
- token?: string;
201
+ token?: Redacted.Redacted<string>;
217
202
  }
218
203
  export const CreateAPITokenResponse = /*@__PURE__*/ S.suspend(() =>
219
204
  S.Struct({
220
205
  name: S.optional(S.String),
221
206
  id: S.optional(S.String),
222
- token: S.optional(S.String),
207
+ token: S.optional(S.String.pipe(T.SensitiveValue({}))),
223
208
  }),
224
- ).annotate({
225
- identifier: "CreateAPITokenResponse",
226
- }) as any as S.Schema<CreateAPITokenResponse>;
209
+ ).annotate({ identifier: "CreateAPITokenResponse" }) as any as S.Schema<CreateAPITokenResponse>;
227
210
 
228
211
  /** The type of seed to be used to create a new database. Use `database` to copy from an existing database, or `database_upload` to [upload a SQLite database file](/api-reference/databases/upload). */
229
212
  export type CreateDatabaseRequestSeedType = "database" | "database_upload";
@@ -265,18 +248,13 @@ export interface CreateDatabaseRequestRemoteEncryption {
265
248
  /** Base64-encoded encryption key. Key size depends on cipher: 32 bytes for aes256gcm, chacha20poly1305, aegis256 variants; 16 bytes for aes128gcm, aegis128l variants. */
266
249
  encryption_key?: string;
267
250
  /** The encryption cipher to use. */
268
- encryption_cipher?:
269
- | CreateDatabaseRequestRemoteEncryptionEncryptionCipher
270
- | (string & {});
271
- }
272
- export const CreateDatabaseRequestRemoteEncryption = /*@__PURE__*/ S.suspend(
273
- () =>
274
- S.Struct({
275
- encryption_key: S.optional(S.String),
276
- encryption_cipher: S.optional(
277
- CreateDatabaseRequestRemoteEncryptionEncryptionCipher,
278
- ),
279
- }),
251
+ encryption_cipher?: CreateDatabaseRequestRemoteEncryptionEncryptionCipher | (string & {});
252
+ }
253
+ export const CreateDatabaseRequestRemoteEncryption = /*@__PURE__*/ S.suspend(() =>
254
+ S.Struct({
255
+ encryption_key: S.optional(S.String),
256
+ encryption_cipher: S.optional(CreateDatabaseRequestRemoteEncryptionEncryptionCipher),
257
+ }),
280
258
  ).annotate({
281
259
  identifier: "CreateDatabaseRequestRemoteEncryption",
282
260
  }) as any as S.Schema<CreateDatabaseRequestRemoteEncryption>;
@@ -303,15 +281,9 @@ export const CreateDatabaseRequest = /*@__PURE__*/ S.suspend(() =>
303
281
  size_limit: S.optional(S.String),
304
282
  remote_encryption: S.optional(CreateDatabaseRequestRemoteEncryption),
305
283
  }).pipe(
306
- T.Http({
307
- method: "POST",
308
- uri: "/v1/organizations/{organizationSlug}/databases",
309
- code: 200,
310
- }),
284
+ T.Http({ method: "POST", uri: "/v1/organizations/{organizationSlug}/databases", code: 200 }),
311
285
  ),
312
- ).annotate({
313
- identifier: "CreateDatabaseRequest",
314
- }) as any as S.Schema<CreateDatabaseRequest>;
286
+ ).annotate({ identifier: "CreateDatabaseRequest" }) as any as S.Schema<CreateDatabaseRequest>;
315
287
 
316
288
  export interface CreateDatabaseOutput {
317
289
  DbId?: string;
@@ -324,9 +296,7 @@ export const CreateDatabaseOutput = /*@__PURE__*/ S.suspend(() =>
324
296
  Hostname: S.optional(S.String),
325
297
  Name: S.optional(S.String),
326
298
  }),
327
- ).annotate({
328
- identifier: "CreateDatabaseOutput",
329
- }) as any as S.Schema<CreateDatabaseOutput>;
299
+ ).annotate({ identifier: "CreateDatabaseOutput" }) as any as S.Schema<CreateDatabaseOutput>;
330
300
 
331
301
  export interface CreateDatabaseResponse {
332
302
  /** The newly created database */
@@ -336,47 +306,37 @@ export const CreateDatabaseResponse = /*@__PURE__*/ S.suspend(() =>
336
306
  S.Struct({
337
307
  database: S.optional(CreateDatabaseOutput),
338
308
  }),
339
- ).annotate({
340
- identifier: "CreateDatabaseResponse",
341
- }) as any as S.Schema<CreateDatabaseResponse>;
309
+ ).annotate({ identifier: "CreateDatabaseResponse" }) as any as S.Schema<CreateDatabaseResponse>;
342
310
 
343
- export type CreateDatabaseTokenRequestAuthorization =
344
- | "full-access"
345
- | "read-only";
311
+ export type CreateDatabaseTokenRequestAuthorization = "full-access" | "read-only";
346
312
  export const CreateDatabaseTokenRequestAuthorization = S.String;
347
313
 
348
- export type CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList =
349
- Array<string>;
350
- export const CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList =
351
- /*@__PURE__*/ S.Array(
352
- S.String,
353
- ) as any as S.Schema<CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList>;
314
+ export type CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList = Array<string>;
315
+ export const CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList = /*@__PURE__*/ S.Array(
316
+ S.String,
317
+ ) as any as S.Schema<CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList>;
354
318
 
355
319
  /** Read `ATTACH` permission for the token. */
356
320
  export interface CreateDatabaseTokenRequestPermissionsReadAttach {
357
321
  databases?: CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList;
358
322
  }
359
- export const CreateDatabaseTokenRequestPermissionsReadAttach =
360
- /*@__PURE__*/ S.suspend(() =>
361
- S.Struct({
362
- databases: S.optional(
363
- CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList,
364
- ),
365
- }),
366
- ).annotate({
367
- identifier: "CreateDatabaseTokenRequestPermissionsReadAttach",
368
- }) as any as S.Schema<CreateDatabaseTokenRequestPermissionsReadAttach>;
323
+ export const CreateDatabaseTokenRequestPermissionsReadAttach = /*@__PURE__*/ S.suspend(() =>
324
+ S.Struct({
325
+ databases: S.optional(CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList),
326
+ }),
327
+ ).annotate({
328
+ identifier: "CreateDatabaseTokenRequestPermissionsReadAttach",
329
+ }) as any as S.Schema<CreateDatabaseTokenRequestPermissionsReadAttach>;
369
330
 
370
331
  /** The permissions for the token. */
371
332
  export interface CreateDatabaseTokenRequestPermissions {
372
333
  /** Read `ATTACH` permission for the token. */
373
334
  read_attach?: CreateDatabaseTokenRequestPermissionsReadAttach;
374
335
  }
375
- export const CreateDatabaseTokenRequestPermissions = /*@__PURE__*/ S.suspend(
376
- () =>
377
- S.Struct({
378
- read_attach: S.optional(CreateDatabaseTokenRequestPermissionsReadAttach),
379
- }),
336
+ export const CreateDatabaseTokenRequestPermissions = /*@__PURE__*/ S.suspend(() =>
337
+ S.Struct({
338
+ read_attach: S.optional(CreateDatabaseTokenRequestPermissionsReadAttach),
339
+ }),
380
340
  ).annotate({
381
341
  identifier: "CreateDatabaseTokenRequestPermissions",
382
342
  }) as any as S.Schema<CreateDatabaseTokenRequestPermissions>;
@@ -398,9 +358,7 @@ export const CreateDatabaseTokenRequest = /*@__PURE__*/ S.suspend(() =>
398
358
  organizationSlug: S.String.pipe(T.Label()),
399
359
  databaseName: S.String.pipe(T.Label()),
400
360
  expiration: S.optional(S.String.pipe(T.Query())),
401
- authorization: S.optional(
402
- CreateDatabaseTokenRequestAuthorization.pipe(T.Query()),
403
- ),
361
+ authorization: S.optional(CreateDatabaseTokenRequestAuthorization.pipe(T.Query())),
404
362
  permissions: S.optional(CreateDatabaseTokenRequestPermissions),
405
363
  }).pipe(
406
364
  T.Http({
@@ -415,11 +373,11 @@ export const CreateDatabaseTokenRequest = /*@__PURE__*/ S.suspend(() =>
415
373
 
416
374
  export interface CreateDatabaseTokenResponse {
417
375
  /** The generated authorization token (JWT). */
418
- jwt?: string;
376
+ jwt?: Redacted.Redacted<string>;
419
377
  }
420
378
  export const CreateDatabaseTokenResponse = /*@__PURE__*/ S.suspend(() =>
421
379
  S.Struct({
422
- jwt: S.optional(S.String),
380
+ jwt: S.optional(S.String.pipe(T.SensitiveValue({}))),
423
381
  }),
424
382
  ).annotate({
425
383
  identifier: "CreateDatabaseTokenResponse",
@@ -468,15 +426,9 @@ export const CreateGroupRequest = /*@__PURE__*/ S.suspend(() =>
468
426
  location: S.String,
469
427
  extensions: S.optional(Extensions),
470
428
  }).pipe(
471
- T.Http({
472
- method: "POST",
473
- uri: "/v1/organizations/{organizationSlug}/groups",
474
- code: 200,
475
- }),
429
+ T.Http({ method: "POST", uri: "/v1/organizations/{organizationSlug}/groups", code: 200 }),
476
430
  ),
477
- ).annotate({
478
- identifier: "CreateGroupRequest",
479
- }) as any as S.Schema<CreateGroupRequest>;
431
+ ).annotate({ identifier: "CreateGroupRequest" }) as any as S.Schema<CreateGroupRequest>;
480
432
 
481
433
  export interface CreateGroupResponse {
482
434
  /** The newly created group */
@@ -486,34 +438,27 @@ export const CreateGroupResponse = /*@__PURE__*/ S.suspend(() =>
486
438
  S.Struct({
487
439
  group: S.optional(Group),
488
440
  }),
489
- ).annotate({
490
- identifier: "CreateGroupResponse",
491
- }) as any as S.Schema<CreateGroupResponse>;
441
+ ).annotate({ identifier: "CreateGroupResponse" }) as any as S.Schema<CreateGroupResponse>;
492
442
 
493
443
  export type CreateGroupTokenRequestAuthorization = "full-access" | "read-only";
494
444
  export const CreateGroupTokenRequestAuthorization = S.String;
495
445
 
496
- export type CreateGroupTokenRequestPermissionsReadAttachDatabasesList =
497
- Array<string>;
498
- export const CreateGroupTokenRequestPermissionsReadAttachDatabasesList =
499
- /*@__PURE__*/ S.Array(
500
- S.String,
501
- ) as any as S.Schema<CreateGroupTokenRequestPermissionsReadAttachDatabasesList>;
446
+ export type CreateGroupTokenRequestPermissionsReadAttachDatabasesList = Array<string>;
447
+ export const CreateGroupTokenRequestPermissionsReadAttachDatabasesList = /*@__PURE__*/ S.Array(
448
+ S.String,
449
+ ) as any as S.Schema<CreateGroupTokenRequestPermissionsReadAttachDatabasesList>;
502
450
 
503
451
  /** Read `ATTACH` permission for the token. */
504
452
  export interface CreateGroupTokenRequestPermissionsReadAttach {
505
453
  databases?: CreateGroupTokenRequestPermissionsReadAttachDatabasesList;
506
454
  }
507
- export const CreateGroupTokenRequestPermissionsReadAttach =
508
- /*@__PURE__*/ S.suspend(() =>
509
- S.Struct({
510
- databases: S.optional(
511
- CreateGroupTokenRequestPermissionsReadAttachDatabasesList,
512
- ),
513
- }),
514
- ).annotate({
515
- identifier: "CreateGroupTokenRequestPermissionsReadAttach",
516
- }) as any as S.Schema<CreateGroupTokenRequestPermissionsReadAttach>;
455
+ export const CreateGroupTokenRequestPermissionsReadAttach = /*@__PURE__*/ S.suspend(() =>
456
+ S.Struct({
457
+ databases: S.optional(CreateGroupTokenRequestPermissionsReadAttachDatabasesList),
458
+ }),
459
+ ).annotate({
460
+ identifier: "CreateGroupTokenRequestPermissionsReadAttach",
461
+ }) as any as S.Schema<CreateGroupTokenRequestPermissionsReadAttach>;
517
462
 
518
463
  /** The permissions for the token. */
519
464
  export interface CreateGroupTokenRequestPermissions {
@@ -545,9 +490,7 @@ export const CreateGroupTokenRequest = /*@__PURE__*/ S.suspend(() =>
545
490
  organizationSlug: S.String.pipe(T.Label()),
546
491
  groupName: S.String.pipe(T.Label()),
547
492
  expiration: S.optional(S.String.pipe(T.Query())),
548
- authorization: S.optional(
549
- CreateGroupTokenRequestAuthorization.pipe(T.Query()),
550
- ),
493
+ authorization: S.optional(CreateGroupTokenRequestAuthorization.pipe(T.Query())),
551
494
  permissions: S.optional(CreateGroupTokenRequestPermissions),
552
495
  }).pipe(
553
496
  T.Http({
@@ -556,21 +499,17 @@ export const CreateGroupTokenRequest = /*@__PURE__*/ S.suspend(() =>
556
499
  code: 200,
557
500
  }),
558
501
  ),
559
- ).annotate({
560
- identifier: "CreateGroupTokenRequest",
561
- }) as any as S.Schema<CreateGroupTokenRequest>;
502
+ ).annotate({ identifier: "CreateGroupTokenRequest" }) as any as S.Schema<CreateGroupTokenRequest>;
562
503
 
563
504
  export interface CreateGroupTokenResponse {
564
505
  /** The generated authorization token (JWT). */
565
- jwt?: string;
506
+ jwt?: Redacted.Redacted<string>;
566
507
  }
567
508
  export const CreateGroupTokenResponse = /*@__PURE__*/ S.suspend(() =>
568
509
  S.Struct({
569
- jwt: S.optional(S.String),
510
+ jwt: S.optional(S.String.pipe(T.SensitiveValue({}))),
570
511
  }),
571
- ).annotate({
572
- identifier: "CreateGroupTokenResponse",
573
- }) as any as S.Schema<CreateGroupTokenResponse>;
512
+ ).annotate({ identifier: "CreateGroupTokenResponse" }) as any as S.Schema<CreateGroupTokenResponse>;
574
513
 
575
514
  export interface DeleteDatabaseRequest {
576
515
  /** The slug of the organization or user account. */
@@ -589,9 +528,7 @@ export const DeleteDatabaseRequest = /*@__PURE__*/ S.suspend(() =>
589
528
  code: 200,
590
529
  }),
591
530
  ),
592
- ).annotate({
593
- identifier: "DeleteDatabaseRequest",
594
- }) as any as S.Schema<DeleteDatabaseRequest>;
531
+ ).annotate({ identifier: "DeleteDatabaseRequest" }) as any as S.Schema<DeleteDatabaseRequest>;
595
532
 
596
533
  export interface DeleteDatabaseResponse {
597
534
  /** The name of the database that was deleted. */
@@ -601,9 +538,7 @@ export const DeleteDatabaseResponse = /*@__PURE__*/ S.suspend(() =>
601
538
  S.Struct({
602
539
  database: S.optional(S.String),
603
540
  }),
604
- ).annotate({
605
- identifier: "DeleteDatabaseResponse",
606
- }) as any as S.Schema<DeleteDatabaseResponse>;
541
+ ).annotate({ identifier: "DeleteDatabaseResponse" }) as any as S.Schema<DeleteDatabaseResponse>;
607
542
 
608
543
  export interface DeleteGroupRequest {
609
544
  /** The slug of the organization or user account. */
@@ -622,9 +557,7 @@ export const DeleteGroupRequest = /*@__PURE__*/ S.suspend(() =>
622
557
  code: 200,
623
558
  }),
624
559
  ),
625
- ).annotate({
626
- identifier: "DeleteGroupRequest",
627
- }) as any as S.Schema<DeleteGroupRequest>;
560
+ ).annotate({ identifier: "DeleteGroupRequest" }) as any as S.Schema<DeleteGroupRequest>;
628
561
 
629
562
  export interface DeleteGroupResponse {
630
563
  group?: Group;
@@ -633,43 +566,39 @@ export const DeleteGroupResponse = /*@__PURE__*/ S.suspend(() =>
633
566
  S.Struct({
634
567
  group: S.optional(Group),
635
568
  }),
636
- ).annotate({
637
- identifier: "DeleteGroupResponse",
638
- }) as any as S.Schema<DeleteGroupResponse>;
569
+ ).annotate({ identifier: "DeleteGroupResponse" }) as any as S.Schema<DeleteGroupResponse>;
639
570
 
640
571
  export interface DeleteOrganizationInviteByEmailV2Request {
641
572
  /** The slug of the organization or user account. */
642
573
  organizationSlug: string;
643
574
  email: string;
644
575
  }
645
- export const DeleteOrganizationInviteByEmailV2Request = /*@__PURE__*/ S.suspend(
646
- () =>
647
- S.Struct({
648
- organizationSlug: S.String.pipe(T.Label()),
649
- email: S.String.pipe(T.Label()),
650
- }).pipe(
651
- T.Http({
652
- method: "DELETE",
653
- uri: "/v2/organizations/{organizationSlug}/invites/{email}",
654
- code: 200,
655
- }),
656
- ),
576
+ export const DeleteOrganizationInviteByEmailV2Request = /*@__PURE__*/ S.suspend(() =>
577
+ S.Struct({
578
+ organizationSlug: S.String.pipe(T.Label()),
579
+ email: S.String.pipe(T.Label()),
580
+ }).pipe(
581
+ T.Http({
582
+ method: "DELETE",
583
+ uri: "/v2/organizations/{organizationSlug}/invites/{email}",
584
+ code: 200,
585
+ }),
586
+ ),
657
587
  ).annotate({
658
588
  identifier: "DeleteOrganizationInviteByEmailV2Request",
659
589
  }) as any as S.Schema<DeleteOrganizationInviteByEmailV2Request>;
660
590
 
661
591
  export interface DeleteOrganizationInviteByEmailV2Response {}
662
- export const DeleteOrganizationInviteByEmailV2Response =
663
- /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
664
- identifier: "DeleteOrganizationInviteByEmailV2Response",
665
- }) as any as S.Schema<DeleteOrganizationInviteByEmailV2Response>;
592
+ export const DeleteOrganizationInviteByEmailV2Response = /*@__PURE__*/ S.suspend(() =>
593
+ S.Struct({}),
594
+ ).annotate({
595
+ identifier: "DeleteOrganizationInviteByEmailV2Response",
596
+ }) as any as S.Schema<DeleteOrganizationInviteByEmailV2Response>;
666
597
 
667
598
  export interface GetCurrentUserRequest {}
668
599
  export const GetCurrentUserRequest = /*@__PURE__*/ S.suspend(() =>
669
600
  S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/user", code: 200 })),
670
- ).annotate({
671
- identifier: "GetCurrentUserRequest",
672
- }) as any as S.Schema<GetCurrentUserRequest>;
601
+ ).annotate({ identifier: "GetCurrentUserRequest" }) as any as S.Schema<GetCurrentUserRequest>;
673
602
 
674
603
  export interface GetCurrentUserResponseUser {
675
604
  /** The username of the user. */
@@ -708,9 +637,7 @@ export const GetCurrentUserResponse = /*@__PURE__*/ S.suspend(() =>
708
637
  S.Struct({
709
638
  user: S.optional(GetCurrentUserResponseUser),
710
639
  }),
711
- ).annotate({
712
- identifier: "GetCurrentUserResponse",
713
- }) as any as S.Schema<GetCurrentUserResponse>;
640
+ ).annotate({ identifier: "GetCurrentUserResponse" }) as any as S.Schema<GetCurrentUserResponse>;
714
641
 
715
642
  export interface GetDatabaseRequest {
716
643
  /** The slug of the organization or user account. */
@@ -729,9 +656,7 @@ export const GetDatabaseRequest = /*@__PURE__*/ S.suspend(() =>
729
656
  code: 200,
730
657
  }),
731
658
  ),
732
- ).annotate({
733
- identifier: "GetDatabaseRequest",
734
- }) as any as S.Schema<GetDatabaseRequest>;
659
+ ).annotate({ identifier: "GetDatabaseRequest" }) as any as S.Schema<GetDatabaseRequest>;
735
660
 
736
661
  /** A list of regions for the group the database belongs to. */
737
662
  export type DatabaseRegionsList = Array<string>;
@@ -775,6 +700,8 @@ export interface Database {
775
700
  /** The current status for delete protection. If enabled, the database cannot be deleted. */
776
701
  delete_protection?: boolean;
777
702
  parent?: DatabaseParent | null;
703
+ /** Whether other databases may be attached to this database with `ATTACH`. */
704
+ allow_attach?: boolean;
778
705
  }
779
706
  export const Database = /*@__PURE__*/ S.suspend(() =>
780
707
  S.Struct({
@@ -788,6 +715,7 @@ export const Database = /*@__PURE__*/ S.suspend(() =>
788
715
  group: S.optional(S.String),
789
716
  delete_protection: S.optional(S.Boolean),
790
717
  parent: S.optional(S.NullOr(DatabaseParent)),
718
+ allow_attach: S.optional(S.Boolean),
791
719
  }),
792
720
  ).annotate({ identifier: "Database" }) as any as S.Schema<Database>;
793
721
 
@@ -798,9 +726,7 @@ export const GetDatabaseResponse = /*@__PURE__*/ S.suspend(() =>
798
726
  S.Struct({
799
727
  database: S.optional(Database),
800
728
  }),
801
- ).annotate({
802
- identifier: "GetDatabaseResponse",
803
- }) as any as S.Schema<GetDatabaseResponse>;
729
+ ).annotate({ identifier: "GetDatabaseResponse" }) as any as S.Schema<GetDatabaseResponse>;
804
730
 
805
731
  export interface GetDatabaseConfigurationRequest {
806
732
  /** The slug of the organization or user account. */
@@ -825,17 +751,15 @@ export const GetDatabaseConfigurationRequest = /*@__PURE__*/ S.suspend(() =>
825
751
 
826
752
  /** List of allowed IP addresses and CIDR blocks. Empty means no IP restriction. */
827
753
  export type DatabaseConfigurationResponseAllowedIpsList = Array<string>;
828
- export const DatabaseConfigurationResponseAllowedIpsList =
829
- /*@__PURE__*/ S.Array(
830
- S.String,
831
- ) as any as S.Schema<DatabaseConfigurationResponseAllowedIpsList>;
754
+ export const DatabaseConfigurationResponseAllowedIpsList = /*@__PURE__*/ S.Array(
755
+ S.String,
756
+ ) as any as S.Schema<DatabaseConfigurationResponseAllowedIpsList>;
832
757
 
833
758
  /** List of allowed AWS VPC endpoint IDs. Empty means no VPC endpoint restriction. */
834
759
  export type DatabaseConfigurationResponseAllowedAwsVpcIdsList = Array<string>;
835
- export const DatabaseConfigurationResponseAllowedAwsVpcIdsList =
836
- /*@__PURE__*/ S.Array(
837
- S.String,
838
- ) as any as S.Schema<DatabaseConfigurationResponseAllowedAwsVpcIdsList>;
760
+ export const DatabaseConfigurationResponseAllowedAwsVpcIdsList = /*@__PURE__*/ S.Array(
761
+ S.String,
762
+ ) as any as S.Schema<DatabaseConfigurationResponseAllowedAwsVpcIdsList>;
839
763
 
840
764
  export interface DatabaseConfigurationResponse {
841
765
  /** The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb. */
@@ -861,9 +785,7 @@ export const DatabaseConfigurationResponse = /*@__PURE__*/ S.suspend(() =>
861
785
  block_writes: S.optional(S.Boolean),
862
786
  delete_protection: S.optional(S.Boolean),
863
787
  allowed_ips: S.optional(DatabaseConfigurationResponseAllowedIpsList),
864
- allowed_aws_vpc_ids: S.optional(
865
- DatabaseConfigurationResponseAllowedAwsVpcIdsList,
866
- ),
788
+ allowed_aws_vpc_ids: S.optional(DatabaseConfigurationResponseAllowedAwsVpcIdsList),
867
789
  }),
868
790
  ).annotate({
869
791
  identifier: "DatabaseConfigurationResponse",
@@ -947,9 +869,7 @@ export const GetDatabaseStatsRequest = /*@__PURE__*/ S.suspend(() =>
947
869
  code: 200,
948
870
  }),
949
871
  ),
950
- ).annotate({
951
- identifier: "GetDatabaseStatsRequest",
952
- }) as any as S.Schema<GetDatabaseStatsRequest>;
872
+ ).annotate({ identifier: "GetDatabaseStatsRequest" }) as any as S.Schema<GetDatabaseStatsRequest>;
953
873
 
954
874
  export interface DatabaseStatsOutput {
955
875
  /** A string representing the SQL query executed. */
@@ -965,9 +885,7 @@ export const DatabaseStatsOutput = /*@__PURE__*/ S.suspend(() =>
965
885
  rows_read: S.optional(S.Number),
966
886
  rows_written: S.optional(S.Number),
967
887
  }),
968
- ).annotate({
969
- identifier: "DatabaseStatsOutput",
970
- }) as any as S.Schema<DatabaseStatsOutput>;
888
+ ).annotate({ identifier: "DatabaseStatsOutput" }) as any as S.Schema<DatabaseStatsOutput>;
971
889
 
972
890
  /** The top queries performed on the given database as well as the total rows read and written. */
973
891
  export type GetDatabaseStatsResponseTopQueriesList = Array<DatabaseStatsOutput>;
@@ -983,9 +901,7 @@ export const GetDatabaseStatsResponse = /*@__PURE__*/ S.suspend(() =>
983
901
  S.Struct({
984
902
  top_queries: S.optional(S.NullOr(GetDatabaseStatsResponseTopQueriesList)),
985
903
  }),
986
- ).annotate({
987
- identifier: "GetDatabaseStatsResponse",
988
- }) as any as S.Schema<GetDatabaseStatsResponse>;
904
+ ).annotate({ identifier: "GetDatabaseStatsResponse" }) as any as S.Schema<GetDatabaseStatsResponse>;
989
905
 
990
906
  export interface GetDatabaseUsageRequest {
991
907
  /** The slug of the organization or user account. */
@@ -1010,9 +926,7 @@ export const GetDatabaseUsageRequest = /*@__PURE__*/ S.suspend(() =>
1010
926
  code: 200,
1011
927
  }),
1012
928
  ),
1013
- ).annotate({
1014
- identifier: "GetDatabaseUsageRequest",
1015
- }) as any as S.Schema<GetDatabaseUsageRequest>;
929
+ ).annotate({ identifier: "GetDatabaseUsageRequest" }) as any as S.Schema<GetDatabaseUsageRequest>;
1016
930
 
1017
931
  export interface DatabaseUsageObject {
1018
932
  /** The total rows read in the time period. */
@@ -1031,9 +945,7 @@ export const DatabaseUsageObject = /*@__PURE__*/ S.suspend(() =>
1031
945
  storage_bytes: S.optional(S.Number),
1032
946
  bytes_synced: S.optional(S.Number),
1033
947
  }),
1034
- ).annotate({
1035
- identifier: "DatabaseUsageObject",
1036
- }) as any as S.Schema<DatabaseUsageObject>;
948
+ ).annotate({ identifier: "DatabaseUsageObject" }) as any as S.Schema<DatabaseUsageObject>;
1037
949
 
1038
950
  export interface DatabaseUsageOutputInstancesItem {
1039
951
  /** The instance universal unique identifier (UUID). */
@@ -1051,8 +963,7 @@ export const DatabaseUsageOutputInstancesItem = /*@__PURE__*/ S.suspend(() =>
1051
963
  }) as any as S.Schema<DatabaseUsageOutputInstancesItem>;
1052
964
 
1053
965
  /** The usage objects for instances of the current database. */
1054
- export type DatabaseUsageOutputInstancesList =
1055
- Array<DatabaseUsageOutputInstancesItem>;
966
+ export type DatabaseUsageOutputInstancesList = Array<DatabaseUsageOutputInstancesItem>;
1056
967
  export const DatabaseUsageOutputInstancesList = /*@__PURE__*/ S.Array(
1057
968
  DatabaseUsageOutputInstancesItem,
1058
969
  ) as any as S.Schema<DatabaseUsageOutputInstancesList>;
@@ -1070,9 +981,7 @@ export const DatabaseUsageOutput = /*@__PURE__*/ S.suspend(() =>
1070
981
  instances: S.optional(DatabaseUsageOutputInstancesList),
1071
982
  total: S.optional(DatabaseUsageObject),
1072
983
  }),
1073
- ).annotate({
1074
- identifier: "DatabaseUsageOutput",
1075
- }) as any as S.Schema<DatabaseUsageOutput>;
984
+ ).annotate({ identifier: "DatabaseUsageOutput" }) as any as S.Schema<DatabaseUsageOutput>;
1076
985
 
1077
986
  export interface GetDatabaseUsageResponse {
1078
987
  /** The database usage object, containg the total and individual instance usage for rows read and written, as well as the total storage size (in bytes). */
@@ -1082,9 +991,7 @@ export const GetDatabaseUsageResponse = /*@__PURE__*/ S.suspend(() =>
1082
991
  S.Struct({
1083
992
  database: S.optional(DatabaseUsageOutput),
1084
993
  }),
1085
- ).annotate({
1086
- identifier: "GetDatabaseUsageResponse",
1087
- }) as any as S.Schema<GetDatabaseUsageResponse>;
994
+ ).annotate({ identifier: "GetDatabaseUsageResponse" }) as any as S.Schema<GetDatabaseUsageResponse>;
1088
995
 
1089
996
  export interface GetGroupRequest {
1090
997
  /** The slug of the organization or user account. */
@@ -1103,9 +1010,7 @@ export const GetGroupRequest = /*@__PURE__*/ S.suspend(() =>
1103
1010
  code: 200,
1104
1011
  }),
1105
1012
  ),
1106
- ).annotate({
1107
- identifier: "GetGroupRequest",
1108
- }) as any as S.Schema<GetGroupRequest>;
1013
+ ).annotate({ identifier: "GetGroupRequest" }) as any as S.Schema<GetGroupRequest>;
1109
1014
 
1110
1015
  export interface GetGroupResponse {
1111
1016
  group?: Group;
@@ -1114,9 +1019,7 @@ export const GetGroupResponse = /*@__PURE__*/ S.suspend(() =>
1114
1019
  S.Struct({
1115
1020
  group: S.optional(Group),
1116
1021
  }),
1117
- ).annotate({
1118
- identifier: "GetGroupResponse",
1119
- }) as any as S.Schema<GetGroupResponse>;
1022
+ ).annotate({ identifier: "GetGroupResponse" }) as any as S.Schema<GetGroupResponse>;
1120
1023
 
1121
1024
  export interface GetGroupConfigurationRequest {
1122
1025
  /** The slug of the organization or user account. */
@@ -1158,16 +1061,8 @@ export interface GetOrganizationRequest {
1158
1061
  export const GetOrganizationRequest = /*@__PURE__*/ S.suspend(() =>
1159
1062
  S.Struct({
1160
1063
  organizationSlug: S.String.pipe(T.Label()),
1161
- }).pipe(
1162
- T.Http({
1163
- method: "GET",
1164
- uri: "/v1/organizations/{organizationSlug}",
1165
- code: 200,
1166
- }),
1167
- ),
1168
- ).annotate({
1169
- identifier: "GetOrganizationRequest",
1170
- }) as any as S.Schema<GetOrganizationRequest>;
1064
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}", code: 200 })),
1065
+ ).annotate({ identifier: "GetOrganizationRequest" }) as any as S.Schema<GetOrganizationRequest>;
1171
1066
 
1172
1067
  /** The type of account this organization is. Will always be `personal` or `team`. */
1173
1068
  export type OrganizationType = "personal" | "team";
@@ -1194,6 +1089,8 @@ export interface Organization {
1194
1089
  plan_timeline?: string;
1195
1090
  /** The external platform this organization is managed by. Will be empty for Turso managed organizations. */
1196
1091
  platform?: string;
1092
+ /** Whether deleted database and group recovery is enabled for the organization. Returned when retrieving a single organization. */
1093
+ restore_enabled?: boolean;
1197
1094
  }
1198
1095
  export const Organization = /*@__PURE__*/ S.suspend(() =>
1199
1096
  S.Struct({
@@ -1207,6 +1104,7 @@ export const Organization = /*@__PURE__*/ S.suspend(() =>
1207
1104
  plan_id: S.optional(S.String),
1208
1105
  plan_timeline: S.optional(S.String),
1209
1106
  platform: S.optional(S.String),
1107
+ restore_enabled: S.optional(S.Boolean),
1210
1108
  }),
1211
1109
  ).annotate({ identifier: "Organization" }) as any as S.Schema<Organization>;
1212
1110
 
@@ -1217,9 +1115,7 @@ export const GetOrganizationResponse = /*@__PURE__*/ S.suspend(() =>
1217
1115
  S.Struct({
1218
1116
  organization: S.optional(Organization),
1219
1117
  }),
1220
- ).annotate({
1221
- identifier: "GetOrganizationResponse",
1222
- }) as any as S.Schema<GetOrganizationResponse>;
1118
+ ).annotate({ identifier: "GetOrganizationResponse" }) as any as S.Schema<GetOrganizationResponse>;
1223
1119
 
1224
1120
  export interface GetOrganizationMemberRequest {
1225
1121
  /** The slug of the organization or user account. */
@@ -1281,11 +1177,7 @@ export const GetOrganizationSubscriptionRequest = /*@__PURE__*/ S.suspend(() =>
1281
1177
  S.Struct({
1282
1178
  organizationSlug: S.String.pipe(T.Label()),
1283
1179
  }).pipe(
1284
- T.Http({
1285
- method: "GET",
1286
- uri: "/v1/organizations/{organizationSlug}/subscription",
1287
- code: 200,
1288
- }),
1180
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/subscription", code: 200 }),
1289
1181
  ),
1290
1182
  ).annotate({
1291
1183
  identifier: "GetOrganizationSubscriptionRequest",
@@ -1301,17 +1193,16 @@ export interface GetOrganizationSubscriptionResponseSubscription {
1301
1193
  /** Whether the plan is billed monthly or yearly. */
1302
1194
  timeline?: string;
1303
1195
  }
1304
- export const GetOrganizationSubscriptionResponseSubscription =
1305
- /*@__PURE__*/ S.suspend(() =>
1306
- S.Struct({
1307
- name: S.optional(S.String),
1308
- overages: S.optional(S.Boolean),
1309
- plan: S.optional(S.String),
1310
- timeline: S.optional(S.String),
1311
- }),
1312
- ).annotate({
1313
- identifier: "GetOrganizationSubscriptionResponseSubscription",
1314
- }) as any as S.Schema<GetOrganizationSubscriptionResponseSubscription>;
1196
+ export const GetOrganizationSubscriptionResponseSubscription = /*@__PURE__*/ S.suspend(() =>
1197
+ S.Struct({
1198
+ name: S.optional(S.String),
1199
+ overages: S.optional(S.Boolean),
1200
+ plan: S.optional(S.String),
1201
+ timeline: S.optional(S.String),
1202
+ }),
1203
+ ).annotate({
1204
+ identifier: "GetOrganizationSubscriptionResponseSubscription",
1205
+ }) as any as S.Schema<GetOrganizationSubscriptionResponseSubscription>;
1315
1206
 
1316
1207
  export interface GetOrganizationSubscriptionResponse {
1317
1208
  subscription?: GetOrganizationSubscriptionResponseSubscription;
@@ -1331,13 +1222,7 @@ export interface GetOrganizationUsageRequest {
1331
1222
  export const GetOrganizationUsageRequest = /*@__PURE__*/ S.suspend(() =>
1332
1223
  S.Struct({
1333
1224
  organizationSlug: S.String.pipe(T.Label()),
1334
- }).pipe(
1335
- T.Http({
1336
- method: "GET",
1337
- uri: "/v1/organizations/{organizationSlug}/usage",
1338
- code: 200,
1339
- }),
1340
- ),
1225
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/usage", code: 200 })),
1341
1226
  ).annotate({
1342
1227
  identifier: "GetOrganizationUsageRequest",
1343
1228
  }) as any as S.Schema<GetOrganizationUsageRequest>;
@@ -1359,28 +1244,25 @@ export interface GetOrganizationUsageResponseOrganizationUsage {
1359
1244
  /** The number of bytes synced allowed for the specific plan, in bytes. */
1360
1245
  bytes_synced?: number;
1361
1246
  }
1362
- export const GetOrganizationUsageResponseOrganizationUsage =
1363
- /*@__PURE__*/ S.suspend(() =>
1364
- S.Struct({
1365
- rows_read: S.optional(S.Number),
1366
- rows_written: S.optional(S.Number),
1367
- databases: S.optional(S.Number),
1368
- locations: S.optional(S.Number),
1369
- storage_bytes: S.optional(S.Number),
1370
- groups: S.optional(S.Number),
1371
- bytes_synced: S.optional(S.Number),
1372
- }),
1373
- ).annotate({
1374
- identifier: "GetOrganizationUsageResponseOrganizationUsage",
1375
- }) as any as S.Schema<GetOrganizationUsageResponseOrganizationUsage>;
1247
+ export const GetOrganizationUsageResponseOrganizationUsage = /*@__PURE__*/ S.suspend(() =>
1248
+ S.Struct({
1249
+ rows_read: S.optional(S.Number),
1250
+ rows_written: S.optional(S.Number),
1251
+ databases: S.optional(S.Number),
1252
+ locations: S.optional(S.Number),
1253
+ storage_bytes: S.optional(S.Number),
1254
+ groups: S.optional(S.Number),
1255
+ bytes_synced: S.optional(S.Number),
1256
+ }),
1257
+ ).annotate({
1258
+ identifier: "GetOrganizationUsageResponseOrganizationUsage",
1259
+ }) as any as S.Schema<GetOrganizationUsageResponseOrganizationUsage>;
1376
1260
 
1377
1261
  /** The databases for the organization and their usage. */
1378
- export type GetOrganizationUsageResponseOrganizationDatabasesList =
1379
- Array<DatabaseUsageOutput>;
1380
- export const GetOrganizationUsageResponseOrganizationDatabasesList =
1381
- /*@__PURE__*/ S.Array(
1382
- DatabaseUsageOutput,
1383
- ) as any as S.Schema<GetOrganizationUsageResponseOrganizationDatabasesList>;
1262
+ export type GetOrganizationUsageResponseOrganizationDatabasesList = Array<DatabaseUsageOutput>;
1263
+ export const GetOrganizationUsageResponseOrganizationDatabasesList = /*@__PURE__*/ S.Array(
1264
+ DatabaseUsageOutput,
1265
+ ) as any as S.Schema<GetOrganizationUsageResponseOrganizationDatabasesList>;
1384
1266
 
1385
1267
  /** The organization usage object, containing the total usage for rows read and written, as well as the total storage size (in bytes). */
1386
1268
  export interface GetOrganizationUsageResponseOrganization {
@@ -1391,15 +1273,12 @@ export interface GetOrganizationUsageResponseOrganization {
1391
1273
  /** The databases for the organization and their usage. */
1392
1274
  databases?: GetOrganizationUsageResponseOrganizationDatabasesList;
1393
1275
  }
1394
- export const GetOrganizationUsageResponseOrganization = /*@__PURE__*/ S.suspend(
1395
- () =>
1396
- S.Struct({
1397
- uuid: S.optional(S.String),
1398
- usage: S.optional(GetOrganizationUsageResponseOrganizationUsage),
1399
- databases: S.optional(
1400
- GetOrganizationUsageResponseOrganizationDatabasesList,
1401
- ),
1402
- }),
1276
+ export const GetOrganizationUsageResponseOrganization = /*@__PURE__*/ S.suspend(() =>
1277
+ S.Struct({
1278
+ uuid: S.optional(S.String),
1279
+ usage: S.optional(GetOrganizationUsageResponseOrganizationUsage),
1280
+ databases: S.optional(GetOrganizationUsageResponseOrganizationDatabasesList),
1281
+ }),
1403
1282
  ).annotate({
1404
1283
  identifier: "GetOrganizationUsageResponseOrganization",
1405
1284
  }) as any as S.Schema<GetOrganizationUsageResponseOrganization>;
@@ -1466,17 +1345,12 @@ export const InvalidateGroupTokensRequest = /*@__PURE__*/ S.suspend(() =>
1466
1345
  }) as any as S.Schema<InvalidateGroupTokensRequest>;
1467
1346
 
1468
1347
  export interface InvalidateGroupTokensResponse {}
1469
- export const InvalidateGroupTokensResponse = /*@__PURE__*/ S.suspend(() =>
1470
- S.Struct({}),
1471
- ).annotate({
1348
+ export const InvalidateGroupTokensResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
1472
1349
  identifier: "InvalidateGroupTokensResponse",
1473
1350
  }) as any as S.Schema<InvalidateGroupTokensResponse>;
1474
1351
 
1475
1352
  /** The role given to the user. */
1476
- export type InviteOrganizationMemberV2RequestRole =
1477
- | "admin"
1478
- | "member"
1479
- | "viewer";
1353
+ export type InviteOrganizationMemberV2RequestRole = "admin" | "member" | "viewer";
1480
1354
  export const InviteOrganizationMemberV2RequestRole = S.String;
1481
1355
 
1482
1356
  export interface InviteOrganizationMemberV2Request {
@@ -1496,11 +1370,7 @@ export const InviteOrganizationMemberV2Request = /*@__PURE__*/ S.suspend(() =>
1496
1370
  username: S.optional(S.String),
1497
1371
  role: S.optional(InviteOrganizationMemberV2RequestRole),
1498
1372
  }).pipe(
1499
- T.Http({
1500
- method: "POST",
1501
- uri: "/v2/organizations/{organizationSlug}/invites",
1502
- code: 200,
1503
- }),
1373
+ T.Http({ method: "POST", uri: "/v2/organizations/{organizationSlug}/invites", code: 200 }),
1504
1374
  ),
1505
1375
  ).annotate({
1506
1376
  identifier: "InviteOrganizationMemberV2Request",
@@ -1524,9 +1394,7 @@ export const InviteCreatedV2 = /*@__PURE__*/ S.suspend(() =>
1524
1394
  role: S.optional(InviteCreatedV2Role),
1525
1395
  organization: S.optional(S.String),
1526
1396
  }),
1527
- ).annotate({
1528
- identifier: "InviteCreatedV2",
1529
- }) as any as S.Schema<InviteCreatedV2>;
1397
+ ).annotate({ identifier: "InviteCreatedV2" }) as any as S.Schema<InviteCreatedV2>;
1530
1398
 
1531
1399
  export interface InviteOrganizationMemberV2Response {
1532
1400
  invited?: InviteCreatedV2;
@@ -1541,12 +1409,8 @@ export const InviteOrganizationMemberV2Response = /*@__PURE__*/ S.suspend(() =>
1541
1409
 
1542
1410
  export interface ListAPITokensRequest {}
1543
1411
  export const ListAPITokensRequest = /*@__PURE__*/ S.suspend(() =>
1544
- S.Struct({}).pipe(
1545
- T.Http({ method: "GET", uri: "/v1/auth/api-tokens", code: 200 }),
1546
- ),
1547
- ).annotate({
1548
- identifier: "ListAPITokensRequest",
1549
- }) as any as S.Schema<ListAPITokensRequest>;
1412
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/auth/api-tokens", code: 200 })),
1413
+ ).annotate({ identifier: "ListAPITokensRequest" }) as any as S.Schema<ListAPITokensRequest>;
1550
1414
 
1551
1415
  /** The expanded list of scopes granted to this token. Present only for group-scoped tokens. Presets passed at creation time (`read-only`, `full-access`) are stored as the underlying individual scopes and are returned in that form. */
1552
1416
  export type APITokenScopesList = Array<string>;
@@ -1591,9 +1455,7 @@ export const ListAPITokensResponse = /*@__PURE__*/ S.suspend(() =>
1591
1455
  S.Struct({
1592
1456
  tokens: S.optional(ListAPITokensResponseTokensList),
1593
1457
  }),
1594
- ).annotate({
1595
- identifier: "ListAPITokensResponse",
1596
- }) as any as S.Schema<ListAPITokensResponse>;
1458
+ ).annotate({ identifier: "ListAPITokensResponse" }) as any as S.Schema<ListAPITokensResponse>;
1597
1459
 
1598
1460
  export interface ListDatabaseInstancesRequest {
1599
1461
  /** The slug of the organization or user account. */
@@ -1649,15 +1511,9 @@ export const ListDatabasesRequest = /*@__PURE__*/ S.suspend(() =>
1649
1511
  schema: S.optional(S.String.pipe(T.Query())),
1650
1512
  parent: S.optional(S.String.pipe(T.Query())),
1651
1513
  }).pipe(
1652
- T.Http({
1653
- method: "GET",
1654
- uri: "/v1/organizations/{organizationSlug}/databases",
1655
- code: 200,
1656
- }),
1514
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/databases", code: 200 }),
1657
1515
  ),
1658
- ).annotate({
1659
- identifier: "ListDatabasesRequest",
1660
- }) as any as S.Schema<ListDatabasesRequest>;
1516
+ ).annotate({ identifier: "ListDatabasesRequest" }) as any as S.Schema<ListDatabasesRequest>;
1661
1517
 
1662
1518
  export type ListDatabasesResponseDatabasesList = Array<Database>;
1663
1519
  export const ListDatabasesResponseDatabasesList = /*@__PURE__*/ S.Array(
@@ -1671,9 +1527,162 @@ export const ListDatabasesResponse = /*@__PURE__*/ S.suspend(() =>
1671
1527
  S.Struct({
1672
1528
  databases: S.optional(ListDatabasesResponseDatabasesList),
1673
1529
  }),
1530
+ ).annotate({ identifier: "ListDatabasesResponse" }) as any as S.Schema<ListDatabasesResponse>;
1531
+
1532
+ export interface ListDeletedDatabasesRequest {
1533
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
1534
+ organizationId: string;
1535
+ /** Must be `true` to list deleted databases. */
1536
+ deleted: boolean;
1537
+ /** Filter deleted databases by name. */
1538
+ search?: string;
1539
+ /** Page size, from 1 to 1000. */
1540
+ limit?: number;
1541
+ /** Opaque pagination cursor from the previous page's `pagination.next`. */
1542
+ cursor?: string;
1543
+ }
1544
+ export const ListDeletedDatabasesRequest = /*@__PURE__*/ S.suspend(() =>
1545
+ S.Struct({
1546
+ organizationId: S.String.pipe(T.Label()),
1547
+ deleted: S.Boolean.pipe(T.Query()),
1548
+ search: S.optional(S.String.pipe(T.Query())),
1549
+ limit: S.optional(S.Number.pipe(T.Query())),
1550
+ cursor: S.optional(S.String.pipe(T.Query())),
1551
+ }).pipe(
1552
+ T.Http({ method: "GET", uri: "/v3/organizations/{organizationId}/databases", code: 200 }),
1553
+ ),
1554
+ ).annotate({
1555
+ identifier: "ListDeletedDatabasesRequest",
1556
+ }) as any as S.Schema<ListDeletedDatabasesRequest>;
1557
+
1558
+ /** The regions the database was located in. */
1559
+ export type DeletedDatabaseRegionsList = Array<string>;
1560
+ export const DeletedDatabaseRegionsList = /*@__PURE__*/ S.Array(
1561
+ S.String,
1562
+ ) as any as S.Schema<DeletedDatabaseRegionsList>;
1563
+
1564
+ export interface DeletedDatabase {
1565
+ /** The database name. */
1566
+ Name?: string;
1567
+ /** The database UUID. Use it to restore the database. */
1568
+ DbId?: string;
1569
+ /** The DNS hostname the database had, used for client and HTTP connections. */
1570
+ Hostname?: string;
1571
+ /** The name of the group the database belonged to. */
1572
+ group?: string;
1573
+ /** The UUID of the group the database belonged to. */
1574
+ group_id?: string;
1575
+ /** The UUID of the organization. */
1576
+ organization_id?: string;
1577
+ /** The regions the database was located in. */
1578
+ regions?: DeletedDatabaseRegionsList;
1579
+ /** The primary region of the database. */
1580
+ primaryRegion?: string;
1581
+ /** Whether delete protection was enabled for the database. */
1582
+ delete_protection?: boolean;
1583
+ /** When the database was deleted. */
1584
+ deleted_at?: string;
1585
+ /** Set when the database's group was deleted with it. Restoring the database also restores the group. */
1586
+ group_deleted_at?: string;
1587
+ }
1588
+ export const DeletedDatabase = /*@__PURE__*/ S.suspend(() =>
1589
+ S.Struct({
1590
+ Name: S.optional(S.String),
1591
+ DbId: S.optional(S.String),
1592
+ Hostname: S.optional(S.String),
1593
+ group: S.optional(S.String),
1594
+ group_id: S.optional(S.String),
1595
+ organization_id: S.optional(S.String),
1596
+ regions: S.optional(DeletedDatabaseRegionsList),
1597
+ primaryRegion: S.optional(S.String),
1598
+ delete_protection: S.optional(S.Boolean),
1599
+ deleted_at: S.optional(S.String),
1600
+ group_deleted_at: S.optional(S.String),
1601
+ }),
1602
+ ).annotate({ identifier: "DeletedDatabase" }) as any as S.Schema<DeletedDatabase>;
1603
+
1604
+ export type ListDeletedDatabasesResponseDatabasesList = Array<DeletedDatabase>;
1605
+ export const ListDeletedDatabasesResponseDatabasesList = /*@__PURE__*/ S.Array(
1606
+ DeletedDatabase,
1607
+ ) as any as S.Schema<ListDeletedDatabasesResponseDatabasesList>;
1608
+
1609
+ export interface Pagination {
1610
+ /** Opaque cursor for the next page. Pass it back as the `cursor` query parameter. Absent on the last page. */
1611
+ next?: string;
1612
+ }
1613
+ export const Pagination = /*@__PURE__*/ S.suspend(() =>
1614
+ S.Struct({
1615
+ next: S.optional(S.String),
1616
+ }),
1617
+ ).annotate({ identifier: "Pagination" }) as any as S.Schema<Pagination>;
1618
+
1619
+ export interface ListDeletedDatabasesResponse {
1620
+ databases?: ListDeletedDatabasesResponseDatabasesList;
1621
+ pagination?: Pagination;
1622
+ }
1623
+ export const ListDeletedDatabasesResponse = /*@__PURE__*/ S.suspend(() =>
1624
+ S.Struct({
1625
+ databases: S.optional(ListDeletedDatabasesResponseDatabasesList),
1626
+ pagination: S.optional(Pagination),
1627
+ }),
1628
+ ).annotate({
1629
+ identifier: "ListDeletedDatabasesResponse",
1630
+ }) as any as S.Schema<ListDeletedDatabasesResponse>;
1631
+
1632
+ export interface ListDeletedGroupsRequest {
1633
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
1634
+ organizationId: string;
1635
+ /** Page size, from 1 to 1000. */
1636
+ limit?: number;
1637
+ /** Opaque pagination cursor from the previous page's `pagination.next`. */
1638
+ cursor?: string;
1639
+ }
1640
+ export const ListDeletedGroupsRequest = /*@__PURE__*/ S.suspend(() =>
1641
+ S.Struct({
1642
+ organizationId: S.String.pipe(T.Label()),
1643
+ limit: S.optional(S.Number.pipe(T.Query())),
1644
+ cursor: S.optional(S.String.pipe(T.Query())),
1645
+ }).pipe(
1646
+ T.Http({ method: "GET", uri: "/v3/organizations/{organizationId}/deleted-groups", code: 200 }),
1647
+ ),
1648
+ ).annotate({ identifier: "ListDeletedGroupsRequest" }) as any as S.Schema<ListDeletedGroupsRequest>;
1649
+
1650
+ export interface DeletedGroup {
1651
+ /** The group UUID. Use it to restore the group. */
1652
+ uuid?: string;
1653
+ /** The group name. */
1654
+ name?: string;
1655
+ /** When the group was deleted. */
1656
+ deleted_at?: string;
1657
+ /** The number of member databases that restoring the group would bring back with it. */
1658
+ cascade_databases?: number;
1659
+ }
1660
+ export const DeletedGroup = /*@__PURE__*/ S.suspend(() =>
1661
+ S.Struct({
1662
+ uuid: S.optional(S.String),
1663
+ name: S.optional(S.String),
1664
+ deleted_at: S.optional(S.String),
1665
+ cascade_databases: S.optional(S.Number),
1666
+ }),
1667
+ ).annotate({ identifier: "DeletedGroup" }) as any as S.Schema<DeletedGroup>;
1668
+
1669
+ export type ListDeletedGroupsResponseGroupsList = Array<DeletedGroup>;
1670
+ export const ListDeletedGroupsResponseGroupsList = /*@__PURE__*/ S.Array(
1671
+ DeletedGroup,
1672
+ ) as any as S.Schema<ListDeletedGroupsResponseGroupsList>;
1673
+
1674
+ export interface ListDeletedGroupsResponse {
1675
+ groups?: ListDeletedGroupsResponseGroupsList;
1676
+ pagination?: Pagination;
1677
+ }
1678
+ export const ListDeletedGroupsResponse = /*@__PURE__*/ S.suspend(() =>
1679
+ S.Struct({
1680
+ groups: S.optional(ListDeletedGroupsResponseGroupsList),
1681
+ pagination: S.optional(Pagination),
1682
+ }),
1674
1683
  ).annotate({
1675
- identifier: "ListDatabasesResponse",
1676
- }) as any as S.Schema<ListDatabasesResponse>;
1684
+ identifier: "ListDeletedGroupsResponse",
1685
+ }) as any as S.Schema<ListDeletedGroupsResponse>;
1677
1686
 
1678
1687
  export interface ListGroupsRequest {
1679
1688
  /** The slug of the organization or user account. */
@@ -1682,16 +1691,8 @@ export interface ListGroupsRequest {
1682
1691
  export const ListGroupsRequest = /*@__PURE__*/ S.suspend(() =>
1683
1692
  S.Struct({
1684
1693
  organizationSlug: S.String.pipe(T.Label()),
1685
- }).pipe(
1686
- T.Http({
1687
- method: "GET",
1688
- uri: "/v1/organizations/{organizationSlug}/groups",
1689
- code: 200,
1690
- }),
1691
- ),
1692
- ).annotate({
1693
- identifier: "ListGroupsRequest",
1694
- }) as any as S.Schema<ListGroupsRequest>;
1694
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/groups", code: 200 })),
1695
+ ).annotate({ identifier: "ListGroupsRequest" }) as any as S.Schema<ListGroupsRequest>;
1695
1696
 
1696
1697
  export type ListGroupsResponseGroupsList = Array<Group>;
1697
1698
  export const ListGroupsResponseGroupsList = /*@__PURE__*/ S.Array(
@@ -1705,21 +1706,15 @@ export const ListGroupsResponse = /*@__PURE__*/ S.suspend(() =>
1705
1706
  S.Struct({
1706
1707
  groups: S.optional(ListGroupsResponseGroupsList),
1707
1708
  }),
1708
- ).annotate({
1709
- identifier: "ListGroupsResponse",
1710
- }) as any as S.Schema<ListGroupsResponse>;
1709
+ ).annotate({ identifier: "ListGroupsResponse" }) as any as S.Schema<ListGroupsResponse>;
1711
1710
 
1712
1711
  export interface ListLocationsRequest {}
1713
1712
  export const ListLocationsRequest = /*@__PURE__*/ S.suspend(() =>
1714
1713
  S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/locations", code: 200 })),
1715
- ).annotate({
1716
- identifier: "ListLocationsRequest",
1717
- }) as any as S.Schema<ListLocationsRequest>;
1714
+ ).annotate({ identifier: "ListLocationsRequest" }) as any as S.Schema<ListLocationsRequest>;
1718
1715
 
1719
1716
  /** A mapping of location codes to location names. */
1720
- export type ListLocationsResponseLocationsMap = {
1721
- [key: string]: string | undefined;
1722
- };
1717
+ export type ListLocationsResponseLocationsMap = { [key: string]: string | undefined };
1723
1718
  export const ListLocationsResponseLocationsMap = /*@__PURE__*/ S.Record(
1724
1719
  S.String,
1725
1720
  S.String,
@@ -1733,9 +1728,7 @@ export const ListLocationsResponse = /*@__PURE__*/ S.suspend(() =>
1733
1728
  S.Struct({
1734
1729
  locations: S.optional(ListLocationsResponseLocationsMap),
1735
1730
  }),
1736
- ).annotate({
1737
- identifier: "ListLocationsResponse",
1738
- }) as any as S.Schema<ListLocationsResponse>;
1731
+ ).annotate({ identifier: "ListLocationsResponse" }) as any as S.Schema<ListLocationsResponse>;
1739
1732
 
1740
1733
  export interface ListOrganizationAPITokensRequest {
1741
1734
  /** The slug of the organization or user account. */
@@ -1745,38 +1738,31 @@ export const ListOrganizationAPITokensRequest = /*@__PURE__*/ S.suspend(() =>
1745
1738
  S.Struct({
1746
1739
  organizationSlug: S.String.pipe(T.Label()),
1747
1740
  }).pipe(
1748
- T.Http({
1749
- method: "GET",
1750
- uri: "/v1/organizations/{organizationSlug}/api-tokens",
1751
- code: 200,
1752
- }),
1741
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/api-tokens", code: 200 }),
1753
1742
  ),
1754
1743
  ).annotate({
1755
1744
  identifier: "ListOrganizationAPITokensRequest",
1756
1745
  }) as any as S.Schema<ListOrganizationAPITokensRequest>;
1757
1746
 
1758
1747
  /** The expanded scope list. Present only for group-scoped tokens. */
1759
- export type ListOrganizationAPITokensResponseTokensItemScopesList =
1760
- Array<string>;
1761
- export const ListOrganizationAPITokensResponseTokensItemScopesList =
1762
- /*@__PURE__*/ S.Array(
1763
- S.String,
1764
- ) as any as S.Schema<ListOrganizationAPITokensResponseTokensItemScopesList>;
1748
+ export type ListOrganizationAPITokensResponseTokensItemScopesList = Array<string>;
1749
+ export const ListOrganizationAPITokensResponseTokensItemScopesList = /*@__PURE__*/ S.Array(
1750
+ S.String,
1751
+ ) as any as S.Schema<ListOrganizationAPITokensResponseTokensItemScopesList>;
1765
1752
 
1766
1753
  /** The user who minted the token. Returned to admins and owners so they can see who provisioned each token. */
1767
1754
  export interface ListOrganizationAPITokensResponseTokensItemOwner {
1768
1755
  username?: string;
1769
1756
  email?: string;
1770
1757
  }
1771
- export const ListOrganizationAPITokensResponseTokensItemOwner =
1772
- /*@__PURE__*/ S.suspend(() =>
1773
- S.Struct({
1774
- username: S.optional(S.String),
1775
- email: S.optional(S.String),
1776
- }),
1777
- ).annotate({
1778
- identifier: "ListOrganizationAPITokensResponseTokensItemOwner",
1779
- }) as any as S.Schema<ListOrganizationAPITokensResponseTokensItemOwner>;
1758
+ export const ListOrganizationAPITokensResponseTokensItemOwner = /*@__PURE__*/ S.suspend(() =>
1759
+ S.Struct({
1760
+ username: S.optional(S.String),
1761
+ email: S.optional(S.String),
1762
+ }),
1763
+ ).annotate({
1764
+ identifier: "ListOrganizationAPITokensResponseTokensItemOwner",
1765
+ }) as any as S.Schema<ListOrganizationAPITokensResponseTokensItemOwner>;
1780
1766
 
1781
1767
  export interface ListOrganizationAPITokensResponseTokensItem {
1782
1768
  /** The token name. */
@@ -1794,27 +1780,25 @@ export interface ListOrganizationAPITokensResponseTokensItem {
1794
1780
  /** The date the token was created. */
1795
1781
  created_at?: string;
1796
1782
  }
1797
- export const ListOrganizationAPITokensResponseTokensItem =
1798
- /*@__PURE__*/ S.suspend(() =>
1799
- S.Struct({
1800
- name: S.optional(S.String),
1801
- id: S.optional(S.String),
1802
- organization: S.optional(S.String),
1803
- group: S.optional(S.String),
1804
- scopes: S.optional(ListOrganizationAPITokensResponseTokensItemScopesList),
1805
- owner: S.optional(ListOrganizationAPITokensResponseTokensItemOwner),
1806
- created_at: S.optional(S.String),
1807
- }),
1808
- ).annotate({
1809
- identifier: "ListOrganizationAPITokensResponseTokensItem",
1810
- }) as any as S.Schema<ListOrganizationAPITokensResponseTokensItem>;
1783
+ export const ListOrganizationAPITokensResponseTokensItem = /*@__PURE__*/ S.suspend(() =>
1784
+ S.Struct({
1785
+ name: S.optional(S.String),
1786
+ id: S.optional(S.String),
1787
+ organization: S.optional(S.String),
1788
+ group: S.optional(S.String),
1789
+ scopes: S.optional(ListOrganizationAPITokensResponseTokensItemScopesList),
1790
+ owner: S.optional(ListOrganizationAPITokensResponseTokensItemOwner),
1791
+ created_at: S.optional(S.String),
1792
+ }),
1793
+ ).annotate({
1794
+ identifier: "ListOrganizationAPITokensResponseTokensItem",
1795
+ }) as any as S.Schema<ListOrganizationAPITokensResponseTokensItem>;
1811
1796
 
1812
1797
  export type ListOrganizationAPITokensResponseTokensList =
1813
1798
  Array<ListOrganizationAPITokensResponseTokensItem>;
1814
- export const ListOrganizationAPITokensResponseTokensList =
1815
- /*@__PURE__*/ S.Array(
1816
- ListOrganizationAPITokensResponseTokensItem,
1817
- ) as any as S.Schema<ListOrganizationAPITokensResponseTokensList>;
1799
+ export const ListOrganizationAPITokensResponseTokensList = /*@__PURE__*/ S.Array(
1800
+ ListOrganizationAPITokensResponseTokensItem,
1801
+ ) as any as S.Schema<ListOrganizationAPITokensResponseTokensList>;
1818
1802
 
1819
1803
  export interface ListOrganizationAPITokensResponse {
1820
1804
  tokens?: ListOrganizationAPITokensResponseTokensList;
@@ -1841,11 +1825,7 @@ export const ListOrganizationAuditLogsRequest = /*@__PURE__*/ S.suspend(() =>
1841
1825
  page_size: S.optional(S.Number.pipe(T.Query())),
1842
1826
  page: S.optional(S.Number.pipe(T.Query())),
1843
1827
  }).pipe(
1844
- T.Http({
1845
- method: "GET",
1846
- uri: "/v1/organizations/{organizationSlug}/audit-logs",
1847
- code: 200,
1848
- }),
1828
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/audit-logs", code: 200 }),
1849
1829
  ),
1850
1830
  ).annotate({
1851
1831
  identifier: "ListOrganizationAuditLogsRequest",
@@ -1905,10 +1885,9 @@ export const AuditLog = /*@__PURE__*/ S.suspend(() =>
1905
1885
  ).annotate({ identifier: "AuditLog" }) as any as S.Schema<AuditLog>;
1906
1886
 
1907
1887
  export type ListOrganizationAuditLogsResponseAuditLogsList = Array<AuditLog>;
1908
- export const ListOrganizationAuditLogsResponseAuditLogsList =
1909
- /*@__PURE__*/ S.Array(
1910
- AuditLog,
1911
- ) as any as S.Schema<ListOrganizationAuditLogsResponseAuditLogsList>;
1888
+ export const ListOrganizationAuditLogsResponseAuditLogsList = /*@__PURE__*/ S.Array(
1889
+ AuditLog,
1890
+ ) as any as S.Schema<ListOrganizationAuditLogsResponseAuditLogsList>;
1912
1891
 
1913
1892
  export interface ListOrganizationAuditLogsResponsePagination {
1914
1893
  /** The current page number. */
@@ -1920,17 +1899,16 @@ export interface ListOrganizationAuditLogsResponsePagination {
1920
1899
  /** The total number of items. */
1921
1900
  total_rows?: number;
1922
1901
  }
1923
- export const ListOrganizationAuditLogsResponsePagination =
1924
- /*@__PURE__*/ S.suspend(() =>
1925
- S.Struct({
1926
- page: S.optional(S.Number),
1927
- page_size: S.optional(S.Number),
1928
- total_pages: S.optional(S.Number),
1929
- total_rows: S.optional(S.Number),
1930
- }),
1931
- ).annotate({
1932
- identifier: "ListOrganizationAuditLogsResponsePagination",
1933
- }) as any as S.Schema<ListOrganizationAuditLogsResponsePagination>;
1902
+ export const ListOrganizationAuditLogsResponsePagination = /*@__PURE__*/ S.suspend(() =>
1903
+ S.Struct({
1904
+ page: S.optional(S.Number),
1905
+ page_size: S.optional(S.Number),
1906
+ total_pages: S.optional(S.Number),
1907
+ total_rows: S.optional(S.Number),
1908
+ }),
1909
+ ).annotate({
1910
+ identifier: "ListOrganizationAuditLogsResponsePagination",
1911
+ }) as any as S.Schema<ListOrganizationAuditLogsResponsePagination>;
1934
1912
 
1935
1913
  export interface ListOrganizationAuditLogsResponse {
1936
1914
  audit_logs?: ListOrganizationAuditLogsResponseAuditLogsList;
@@ -1953,11 +1931,7 @@ export const ListOrganizationInvitesV2Request = /*@__PURE__*/ S.suspend(() =>
1953
1931
  S.Struct({
1954
1932
  organizationSlug: S.String.pipe(T.Label()),
1955
1933
  }).pipe(
1956
- T.Http({
1957
- method: "GET",
1958
- uri: "/v2/organizations/{organizationSlug}/invites",
1959
- code: 200,
1960
- }),
1934
+ T.Http({ method: "GET", uri: "/v2/organizations/{organizationSlug}/invites", code: 200 }),
1961
1935
  ),
1962
1936
  ).annotate({
1963
1937
  identifier: "ListOrganizationInvitesV2Request",
@@ -1987,10 +1961,9 @@ export const InviteV2 = /*@__PURE__*/ S.suspend(() =>
1987
1961
  ).annotate({ identifier: "InviteV2" }) as any as S.Schema<InviteV2>;
1988
1962
 
1989
1963
  export type ListOrganizationInvitesV2ResponseInvitesList = Array<InviteV2>;
1990
- export const ListOrganizationInvitesV2ResponseInvitesList =
1991
- /*@__PURE__*/ S.Array(
1992
- InviteV2,
1993
- ) as any as S.Schema<ListOrganizationInvitesV2ResponseInvitesList>;
1964
+ export const ListOrganizationInvitesV2ResponseInvitesList = /*@__PURE__*/ S.Array(
1965
+ InviteV2,
1966
+ ) as any as S.Schema<ListOrganizationInvitesV2ResponseInvitesList>;
1994
1967
 
1995
1968
  export interface ListOrganizationInvitesV2Response {
1996
1969
  invites?: ListOrganizationInvitesV2ResponseInvitesList;
@@ -2017,11 +1990,7 @@ export const ListOrganizationInvoicesRequest = /*@__PURE__*/ S.suspend(() =>
2017
1990
  organizationSlug: S.String.pipe(T.Label()),
2018
1991
  type: S.optional(ListOrganizationInvoicesRequestType.pipe(T.Query())),
2019
1992
  }).pipe(
2020
- T.Http({
2021
- method: "GET",
2022
- uri: "/v1/organizations/{organizationSlug}/invoices",
2023
- code: 200,
2024
- }),
1993
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/invoices", code: 200 }),
2025
1994
  ),
2026
1995
  ).annotate({
2027
1996
  identifier: "ListOrganizationInvoicesRequest",
@@ -2041,27 +2010,25 @@ export interface ListOrganizationInvoicesResponseInvoicesItem {
2041
2010
  /** The link to the invoice PDF you can download. */
2042
2011
  invoice_pdf?: string;
2043
2012
  }
2044
- export const ListOrganizationInvoicesResponseInvoicesItem =
2045
- /*@__PURE__*/ S.suspend(() =>
2046
- S.Struct({
2047
- invoice_number: S.optional(S.String),
2048
- amount_due: S.optional(S.String),
2049
- due_date: S.optional(S.String),
2050
- paid_at: S.optional(S.String),
2051
- payment_failed_at: S.optional(S.String),
2052
- invoice_pdf: S.optional(S.String),
2053
- }),
2054
- ).annotate({
2055
- identifier: "ListOrganizationInvoicesResponseInvoicesItem",
2056
- }) as any as S.Schema<ListOrganizationInvoicesResponseInvoicesItem>;
2013
+ export const ListOrganizationInvoicesResponseInvoicesItem = /*@__PURE__*/ S.suspend(() =>
2014
+ S.Struct({
2015
+ invoice_number: S.optional(S.String),
2016
+ amount_due: S.optional(S.String),
2017
+ due_date: S.optional(S.String),
2018
+ paid_at: S.optional(S.String),
2019
+ payment_failed_at: S.optional(S.String),
2020
+ invoice_pdf: S.optional(S.String),
2021
+ }),
2022
+ ).annotate({
2023
+ identifier: "ListOrganizationInvoicesResponseInvoicesItem",
2024
+ }) as any as S.Schema<ListOrganizationInvoicesResponseInvoicesItem>;
2057
2025
 
2058
2026
  /** The list of invoices for the organization. */
2059
2027
  export type ListOrganizationInvoicesResponseInvoicesList =
2060
2028
  Array<ListOrganizationInvoicesResponseInvoicesItem>;
2061
- export const ListOrganizationInvoicesResponseInvoicesList =
2062
- /*@__PURE__*/ S.Array(
2063
- ListOrganizationInvoicesResponseInvoicesItem,
2064
- ) as any as S.Schema<ListOrganizationInvoicesResponseInvoicesList>;
2029
+ export const ListOrganizationInvoicesResponseInvoicesList = /*@__PURE__*/ S.Array(
2030
+ ListOrganizationInvoicesResponseInvoicesItem,
2031
+ ) as any as S.Schema<ListOrganizationInvoicesResponseInvoicesList>;
2065
2032
 
2066
2033
  export interface ListOrganizationInvoicesResponse {
2067
2034
  /** The list of invoices for the organization. */
@@ -2083,11 +2050,7 @@ export const ListOrganizationMembersRequest = /*@__PURE__*/ S.suspend(() =>
2083
2050
  S.Struct({
2084
2051
  organizationSlug: S.String.pipe(T.Label()),
2085
2052
  }).pipe(
2086
- T.Http({
2087
- method: "GET",
2088
- uri: "/v1/organizations/{organizationSlug}/members",
2089
- code: 200,
2090
- }),
2053
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/members", code: 200 }),
2091
2054
  ),
2092
2055
  ).annotate({
2093
2056
  identifier: "ListOrganizationMembersRequest",
@@ -2116,13 +2079,7 @@ export interface ListOrganizationPlansRequest {
2116
2079
  export const ListOrganizationPlansRequest = /*@__PURE__*/ S.suspend(() =>
2117
2080
  S.Struct({
2118
2081
  organizationSlug: S.String.pipe(T.Label()),
2119
- }).pipe(
2120
- T.Http({
2121
- method: "GET",
2122
- uri: "/v1/organizations/{organizationSlug}/plans",
2123
- code: 200,
2124
- }),
2125
- ),
2082
+ }).pipe(T.Http({ method: "GET", uri: "/v1/organizations/{organizationSlug}/plans", code: 200 })),
2126
2083
  ).annotate({
2127
2084
  identifier: "ListOrganizationPlansRequest",
2128
2085
  }) as any as S.Schema<ListOrganizationPlansRequest>;
@@ -2188,9 +2145,7 @@ export const OrganizationPlan = /*@__PURE__*/ S.suspend(() =>
2188
2145
  prices: S.optional(OrganizationPlanPricesList),
2189
2146
  quotas: S.optional(PlanQuotas),
2190
2147
  }),
2191
- ).annotate({
2192
- identifier: "OrganizationPlan",
2193
- }) as any as S.Schema<OrganizationPlan>;
2148
+ ).annotate({ identifier: "OrganizationPlan" }) as any as S.Schema<OrganizationPlan>;
2194
2149
 
2195
2150
  /** List of available plans. */
2196
2151
  export type ListOrganizationPlansResponsePlansList = Array<OrganizationPlan>;
@@ -2212,12 +2167,8 @@ export const ListOrganizationPlansResponse = /*@__PURE__*/ S.suspend(() =>
2212
2167
 
2213
2168
  export interface ListOrganizationsRequest {}
2214
2169
  export const ListOrganizationsRequest = /*@__PURE__*/ S.suspend(() =>
2215
- S.Struct({}).pipe(
2216
- T.Http({ method: "GET", uri: "/v1/organizations", code: 200 }),
2217
- ),
2218
- ).annotate({
2219
- identifier: "ListOrganizationsRequest",
2220
- }) as any as S.Schema<ListOrganizationsRequest>;
2170
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/organizations", code: 200 })),
2171
+ ).annotate({ identifier: "ListOrganizationsRequest" }) as any as S.Schema<ListOrganizationsRequest>;
2221
2172
 
2222
2173
  export type ListOrganizationsResponseBodyList = Array<Organization>;
2223
2174
  export const ListOrganizationsResponseBodyList = /*@__PURE__*/ S.Array(
@@ -2299,23 +2250,95 @@ export const RemoveOrganizationMemberResponse = /*@__PURE__*/ S.suspend(() =>
2299
2250
  identifier: "RemoveOrganizationMemberResponse",
2300
2251
  }) as any as S.Schema<RemoveOrganizationMemberResponse>;
2301
2252
 
2302
- export interface RevokeAPITokenRequest {
2303
- /** The name of the api token. */
2304
- tokenName: string;
2253
+ export interface RestoreDatabaseRequest {
2254
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
2255
+ organizationId: string;
2256
+ /** The UUID of the database, as returned when listing deleted databases (the `DbId` field). */
2257
+ databaseId: string;
2258
+ /** Optional new name for the restored database. If omitted, the original name is reused. The hostname is re-derived from the name. */
2259
+ name?: string;
2305
2260
  }
2306
- export const RevokeAPITokenRequest = /*@__PURE__*/ S.suspend(() =>
2261
+ export const RestoreDatabaseRequest = /*@__PURE__*/ S.suspend(() =>
2307
2262
  S.Struct({
2308
- tokenName: S.String.pipe(T.Label()),
2263
+ organizationId: S.String.pipe(T.Label()),
2264
+ databaseId: S.String.pipe(T.Label()),
2265
+ name: S.optional(S.String),
2309
2266
  }).pipe(
2310
2267
  T.Http({
2311
- method: "DELETE",
2312
- uri: "/v1/auth/api-tokens/{tokenName}",
2268
+ method: "POST",
2269
+ uri: "/v3/organizations/{organizationId}/databases/{databaseId}/restore",
2313
2270
  code: 200,
2314
2271
  }),
2315
2272
  ),
2316
- ).annotate({
2317
- identifier: "RevokeAPITokenRequest",
2318
- }) as any as S.Schema<RevokeAPITokenRequest>;
2273
+ ).annotate({ identifier: "RestoreDatabaseRequest" }) as any as S.Schema<RestoreDatabaseRequest>;
2274
+
2275
+ export interface RestoreDatabaseResponse {
2276
+ /** The restored database. */
2277
+ database?: DeletedDatabase;
2278
+ }
2279
+ export const RestoreDatabaseResponse = /*@__PURE__*/ S.suspend(() =>
2280
+ S.Struct({
2281
+ database: S.optional(DeletedDatabase),
2282
+ }),
2283
+ ).annotate({ identifier: "RestoreDatabaseResponse" }) as any as S.Schema<RestoreDatabaseResponse>;
2284
+
2285
+ export interface RestoreGroupRequest {
2286
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
2287
+ organizationId: string;
2288
+ /** The UUID of the group, as returned when listing deleted groups (the `uuid` field). */
2289
+ groupId: string;
2290
+ }
2291
+ export const RestoreGroupRequest = /*@__PURE__*/ S.suspend(() =>
2292
+ S.Struct({
2293
+ organizationId: S.String.pipe(T.Label()),
2294
+ groupId: S.String.pipe(T.Label()),
2295
+ }).pipe(
2296
+ T.Http({
2297
+ method: "POST",
2298
+ uri: "/v3/organizations/{organizationId}/groups/{groupId}/restore",
2299
+ code: 200,
2300
+ }),
2301
+ ),
2302
+ ).annotate({ identifier: "RestoreGroupRequest" }) as any as S.Schema<RestoreGroupRequest>;
2303
+
2304
+ /** The member databases restored with the group, in restore order. */
2305
+ export type RestoreGroupResponseDatabasesList = Array<DeletedDatabase>;
2306
+ export const RestoreGroupResponseDatabasesList = /*@__PURE__*/ S.Array(
2307
+ DeletedDatabase,
2308
+ ) as any as S.Schema<RestoreGroupResponseDatabasesList>;
2309
+
2310
+ /** Maps database UUID to error message for members whose restore failed. Retry them individually with Restore Database. */
2311
+ export type RestoreGroupResponseFailuresMap = { [key: string]: string | undefined };
2312
+ export const RestoreGroupResponseFailuresMap = /*@__PURE__*/ S.Record(
2313
+ S.String,
2314
+ S.String,
2315
+ ) as any as S.Schema<RestoreGroupResponseFailuresMap>;
2316
+
2317
+ export interface RestoreGroupResponse {
2318
+ /** The restored group. */
2319
+ group?: Group;
2320
+ /** The member databases restored with the group, in restore order. */
2321
+ databases?: RestoreGroupResponseDatabasesList;
2322
+ /** Maps database UUID to error message for members whose restore failed. Retry them individually with Restore Database. */
2323
+ failures?: RestoreGroupResponseFailuresMap;
2324
+ }
2325
+ export const RestoreGroupResponse = /*@__PURE__*/ S.suspend(() =>
2326
+ S.Struct({
2327
+ group: S.optional(Group),
2328
+ databases: S.optional(RestoreGroupResponseDatabasesList),
2329
+ failures: S.optional(RestoreGroupResponseFailuresMap),
2330
+ }),
2331
+ ).annotate({ identifier: "RestoreGroupResponse" }) as any as S.Schema<RestoreGroupResponse>;
2332
+
2333
+ export interface RevokeAPITokenRequest {
2334
+ /** The name of the api token. */
2335
+ tokenName: string;
2336
+ }
2337
+ export const RevokeAPITokenRequest = /*@__PURE__*/ S.suspend(() =>
2338
+ S.Struct({
2339
+ tokenName: S.String.pipe(T.Label()),
2340
+ }).pipe(T.Http({ method: "DELETE", uri: "/v1/auth/api-tokens/{tokenName}", code: 200 })),
2341
+ ).annotate({ identifier: "RevokeAPITokenRequest" }) as any as S.Schema<RevokeAPITokenRequest>;
2319
2342
 
2320
2343
  export interface RevokeAPITokenResponse {
2321
2344
  /** The revoked token name. */
@@ -2325,9 +2348,7 @@ export const RevokeAPITokenResponse = /*@__PURE__*/ S.suspend(() =>
2325
2348
  S.Struct({
2326
2349
  token: S.optional(S.String),
2327
2350
  }),
2328
- ).annotate({
2329
- identifier: "RevokeAPITokenResponse",
2330
- }) as any as S.Schema<RevokeAPITokenResponse>;
2351
+ ).annotate({ identifier: "RevokeAPITokenResponse" }) as any as S.Schema<RevokeAPITokenResponse>;
2331
2352
 
2332
2353
  export interface RevokeOrganizationAPITokenRequest {
2333
2354
  /** The slug of the organization or user account. */
@@ -2382,9 +2403,7 @@ export const TransferGroupRequest = /*@__PURE__*/ S.suspend(() =>
2382
2403
  code: 200,
2383
2404
  }),
2384
2405
  ),
2385
- ).annotate({
2386
- identifier: "TransferGroupRequest",
2387
- }) as any as S.Schema<TransferGroupRequest>;
2406
+ ).annotate({ identifier: "TransferGroupRequest" }) as any as S.Schema<TransferGroupRequest>;
2388
2407
 
2389
2408
  /** An array of location keys the group is located. */
2390
2409
  export type TransferGroupResponseLocationsList = Array<string>;
@@ -2415,9 +2434,7 @@ export const TransferGroupResponse = /*@__PURE__*/ S.suspend(() =>
2415
2434
  primary: S.optional(S.String),
2416
2435
  delete_protection: S.optional(S.Boolean),
2417
2436
  }),
2418
- ).annotate({
2419
- identifier: "TransferGroupResponse",
2420
- }) as any as S.Schema<TransferGroupResponse>;
2437
+ ).annotate({ identifier: "TransferGroupResponse" }) as any as S.Schema<TransferGroupResponse>;
2421
2438
 
2422
2439
  export interface UnarchiveGroupRequest {
2423
2440
  /** The slug of the organization or user account. */
@@ -2436,9 +2453,7 @@ export const UnarchiveGroupRequest = /*@__PURE__*/ S.suspend(() =>
2436
2453
  code: 200,
2437
2454
  }),
2438
2455
  ),
2439
- ).annotate({
2440
- identifier: "UnarchiveGroupRequest",
2441
- }) as any as S.Schema<UnarchiveGroupRequest>;
2456
+ ).annotate({ identifier: "UnarchiveGroupRequest" }) as any as S.Schema<UnarchiveGroupRequest>;
2442
2457
 
2443
2458
  export interface UnarchiveGroupResponse {
2444
2459
  /** The group that was unarchived */
@@ -2448,24 +2463,19 @@ export const UnarchiveGroupResponse = /*@__PURE__*/ S.suspend(() =>
2448
2463
  S.Struct({
2449
2464
  group: S.optional(Group),
2450
2465
  }),
2451
- ).annotate({
2452
- identifier: "UnarchiveGroupResponse",
2453
- }) as any as S.Schema<UnarchiveGroupResponse>;
2466
+ ).annotate({ identifier: "UnarchiveGroupResponse" }) as any as S.Schema<UnarchiveGroupResponse>;
2454
2467
 
2455
2468
  /** List of allowed IP addresses and CIDR blocks. Only connections from these sources are accepted. Pass an empty array to clear the list. Omit to leave unchanged. */
2456
2469
  export type UpdateDatabaseConfigurationRequestAllowedIpsList = Array<string>;
2457
- export const UpdateDatabaseConfigurationRequestAllowedIpsList =
2458
- /*@__PURE__*/ S.Array(
2459
- S.String,
2460
- ) as any as S.Schema<UpdateDatabaseConfigurationRequestAllowedIpsList>;
2470
+ export const UpdateDatabaseConfigurationRequestAllowedIpsList = /*@__PURE__*/ S.Array(
2471
+ S.String,
2472
+ ) as any as S.Schema<UpdateDatabaseConfigurationRequestAllowedIpsList>;
2461
2473
 
2462
2474
  /** List of allowed AWS VPC endpoint IDs (vpce-...). Only connections arriving through these endpoints are accepted. Pass an empty array to clear the list. Omit to leave unchanged. */
2463
- export type UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList =
2464
- Array<string>;
2465
- export const UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList =
2466
- /*@__PURE__*/ S.Array(
2467
- S.String,
2468
- ) as any as S.Schema<UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList>;
2475
+ export type UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList = Array<string>;
2476
+ export const UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList = /*@__PURE__*/ S.Array(
2477
+ S.String,
2478
+ ) as any as S.Schema<UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList>;
2469
2479
 
2470
2480
  export interface UpdateDatabaseConfigurationRequest {
2471
2481
  /** The slug of the organization or user account. */
@@ -2497,9 +2507,7 @@ export const UpdateDatabaseConfigurationRequest = /*@__PURE__*/ S.suspend(() =>
2497
2507
  block_writes: S.optional(S.Boolean),
2498
2508
  delete_protection: S.optional(S.Boolean),
2499
2509
  allowed_ips: S.optional(UpdateDatabaseConfigurationRequestAllowedIpsList),
2500
- allowed_aws_vpc_ids: S.optional(
2501
- UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList,
2502
- ),
2510
+ allowed_aws_vpc_ids: S.optional(UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList),
2503
2511
  }).pipe(
2504
2512
  T.Http({
2505
2513
  method: "PATCH",
@@ -2557,9 +2565,7 @@ export const UpdateGroupDatabasesRequest = /*@__PURE__*/ S.suspend(() =>
2557
2565
  }) as any as S.Schema<UpdateGroupDatabasesRequest>;
2558
2566
 
2559
2567
  export interface UpdateGroupDatabasesResponse {}
2560
- export const UpdateGroupDatabasesResponse = /*@__PURE__*/ S.suspend(() =>
2561
- S.Struct({}),
2562
- ).annotate({
2568
+ export const UpdateGroupDatabasesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
2563
2569
  identifier: "UpdateGroupDatabasesResponse",
2564
2570
  }) as any as S.Schema<UpdateGroupDatabasesResponse>;
2565
2571
 
@@ -2587,9 +2593,7 @@ export const UpdateMemberRoleRequest = /*@__PURE__*/ S.suspend(() =>
2587
2593
  code: 200,
2588
2594
  }),
2589
2595
  ),
2590
- ).annotate({
2591
- identifier: "UpdateMemberRoleRequest",
2592
- }) as any as S.Schema<UpdateMemberRoleRequest>;
2596
+ ).annotate({ identifier: "UpdateMemberRoleRequest" }) as any as S.Schema<UpdateMemberRoleRequest>;
2593
2597
 
2594
2598
  /** The new role of the updated member. */
2595
2599
  export type UpdateMemberRoleResponseMemberRole = "admin" | "member" | "viewer";
@@ -2620,9 +2624,7 @@ export const UpdateMemberRoleResponse = /*@__PURE__*/ S.suspend(() =>
2620
2624
  S.Struct({
2621
2625
  member: S.optional(UpdateMemberRoleResponseMember),
2622
2626
  }),
2623
- ).annotate({
2624
- identifier: "UpdateMemberRoleResponse",
2625
- }) as any as S.Schema<UpdateMemberRoleResponse>;
2627
+ ).annotate({ identifier: "UpdateMemberRoleResponse" }) as any as S.Schema<UpdateMemberRoleResponse>;
2626
2628
 
2627
2629
  export interface UpdateOrganizationRequest {
2628
2630
  /** The slug of the organization or user account. */
@@ -2631,19 +2633,16 @@ export interface UpdateOrganizationRequest {
2631
2633
  overages?: boolean;
2632
2634
  /** Require all members of the organization to have multi-factor authentication enabled. The requesting user must have MFA enabled on their own account before enabling this requirement. */
2633
2635
  require_mfa?: boolean;
2636
+ /** Enable or disable deleted database and group recovery for the organization. Must be updated separately from other organization settings. Requires an admin or owner. */
2637
+ restore_enabled?: boolean;
2634
2638
  }
2635
2639
  export const UpdateOrganizationRequest = /*@__PURE__*/ S.suspend(() =>
2636
2640
  S.Struct({
2637
2641
  organizationSlug: S.String.pipe(T.Label()),
2638
2642
  overages: S.optional(S.Boolean),
2639
2643
  require_mfa: S.optional(S.Boolean),
2640
- }).pipe(
2641
- T.Http({
2642
- method: "PATCH",
2643
- uri: "/v1/organizations/{organizationSlug}",
2644
- code: 200,
2645
- }),
2646
- ),
2644
+ restore_enabled: S.optional(S.Boolean),
2645
+ }).pipe(T.Http({ method: "PATCH", uri: "/v1/organizations/{organizationSlug}", code: 200 })),
2647
2646
  ).annotate({
2648
2647
  identifier: "UpdateOrganizationRequest",
2649
2648
  }) as any as S.Schema<UpdateOrganizationRequest>;
@@ -2662,12 +2661,8 @@ export const UpdateOrganizationResponse = /*@__PURE__*/ S.suspend(() =>
2662
2661
 
2663
2662
  export interface ValidateAPITokenRequest {}
2664
2663
  export const ValidateAPITokenRequest = /*@__PURE__*/ S.suspend(() =>
2665
- S.Struct({}).pipe(
2666
- T.Http({ method: "GET", uri: "/v1/auth/validate", code: 200 }),
2667
- ),
2668
- ).annotate({
2669
- identifier: "ValidateAPITokenRequest",
2670
- }) as any as S.Schema<ValidateAPITokenRequest>;
2664
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/auth/validate", code: 200 })),
2665
+ ).annotate({ identifier: "ValidateAPITokenRequest" }) as any as S.Schema<ValidateAPITokenRequest>;
2671
2666
 
2672
2667
  export interface ValidateAPITokenResponse {
2673
2668
  /** The time of expiration for the provided token in unix epoch seconds, or `-1` if there is no expiration. */
@@ -2677,9 +2672,7 @@ export const ValidateAPITokenResponse = /*@__PURE__*/ S.suspend(() =>
2677
2672
  S.Struct({
2678
2673
  exp: S.optional(S.Number),
2679
2674
  }),
2680
- ).annotate({
2681
- identifier: "ValidateAPITokenResponse",
2682
- }) as any as S.Schema<ValidateAPITokenResponse>;
2675
+ ).annotate({ identifier: "ValidateAPITokenResponse" }) as any as S.Schema<ValidateAPITokenResponse>;
2683
2676
 
2684
2677
  export type AddLocationToGroupError = BadRequest | NotFound | TursoOpError;
2685
2678
  /** Add Location to Group Adds a location to the specified group. */
@@ -2696,11 +2689,7 @@ export const addLocationToGroup: API.OperationMethod<
2696
2689
  retry: Retry.Retry,
2697
2690
  }));
2698
2691
 
2699
- export type AddOrganizationMemberError =
2700
- | BadRequest
2701
- | NotFound
2702
- | Conflict
2703
- | TursoOpError;
2692
+ export type AddOrganizationMemberError = BadRequest | NotFound | Conflict | TursoOpError;
2704
2693
  /** Add Member Add an existing Turso user to an organization. */
2705
2694
  export const addOrganizationMember: API.OperationMethod<
2706
2695
  AddOrganizationMemberRequest,
@@ -2715,7 +2704,7 @@ export const addOrganizationMember: API.OperationMethod<
2715
2704
  retry: Retry.Retry,
2716
2705
  }));
2717
2706
 
2718
- export type CreateAPITokenError = TursoOpError;
2707
+ export type CreateAPITokenError = BadRequest | NotFound | Conflict | TursoOpError;
2719
2708
  /** Create API Token Returns a new API token belonging to a user. The token can be minted at three levels of restriction, in increasing order of narrowness: - **Organization-scoped** — pass `organization`. The token can only act on resources inside that organization. - **Group-scoped** — pass `organization`, `group`, and `scopes`. The token is pinned to a single group inside the organization and only the operations listed in `scopes` are allowed. The caller must be an admin or owner of the organization. - **Unrestricted** *(deprecated)* — no request body. The token can act on every organization the caller belongs to. **Unrestricted tokens are deprecated and will be removed in a future release.** Always pass `organization` for new tokens and rotate existing unrestricted tokens to scoped tokens. Group-scoped tokens are designed for automations that should be able to provision and manage databases inside a single group without being able to touch the rest of the organization. */
2720
2709
  export const createAPIToken: API.OperationMethod<
2721
2710
  CreateAPITokenRequest,
@@ -2725,7 +2714,7 @@ export const createAPIToken: API.OperationMethod<
2725
2714
  > = /*@__PURE__*/ API.make(() => ({
2726
2715
  input: CreateAPITokenRequest,
2727
2716
  output: CreateAPITokenResponse,
2728
- errors: [],
2717
+ errors: [BadRequest, NotFound, Conflict],
2729
2718
  protocol: TursoProtocol,
2730
2719
  retry: Retry.Retry,
2731
2720
  }));
@@ -3105,6 +3094,36 @@ export const listDatabases: API.OperationMethod<
3105
3094
  retry: Retry.Retry,
3106
3095
  }));
3107
3096
 
3097
+ export type ListDeletedDatabasesError = Forbidden | TursoOpError;
3098
+ /** 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. */
3099
+ export const listDeletedDatabases: API.OperationMethod<
3100
+ ListDeletedDatabasesRequest,
3101
+ ListDeletedDatabasesResponse,
3102
+ ListDeletedDatabasesError,
3103
+ TursoOpContext
3104
+ > = /*@__PURE__*/ API.make(() => ({
3105
+ input: ListDeletedDatabasesRequest,
3106
+ output: ListDeletedDatabasesResponse,
3107
+ errors: [Forbidden],
3108
+ protocol: TursoProtocol,
3109
+ retry: Retry.Retry,
3110
+ }));
3111
+
3112
+ export type ListDeletedGroupsError = Forbidden | TursoOpError;
3113
+ /** 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. */
3114
+ export const listDeletedGroups: API.OperationMethod<
3115
+ ListDeletedGroupsRequest,
3116
+ ListDeletedGroupsResponse,
3117
+ ListDeletedGroupsError,
3118
+ TursoOpContext
3119
+ > = /*@__PURE__*/ API.make(() => ({
3120
+ input: ListDeletedGroupsRequest,
3121
+ output: ListDeletedGroupsResponse,
3122
+ errors: [Forbidden],
3123
+ protocol: TursoProtocol,
3124
+ retry: Retry.Retry,
3125
+ }));
3126
+
3108
3127
  export type ListGroupsError = TursoOpError;
3109
3128
  /** List Groups Returns a list of groups belonging to the organization or user. */
3110
3129
  export const listGroups: API.OperationMethod<
@@ -3270,6 +3289,36 @@ export const removeOrganizationMember: API.OperationMethod<
3270
3289
  retry: Retry.Retry,
3271
3290
  }));
3272
3291
 
3292
+ export type RestoreDatabaseError = BadRequest | Forbidden | NotFound | TursoOpError;
3293
+ /** 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. */
3294
+ export const restoreDatabase: API.OperationMethod<
3295
+ RestoreDatabaseRequest,
3296
+ RestoreDatabaseResponse,
3297
+ RestoreDatabaseError,
3298
+ TursoOpContext
3299
+ > = /*@__PURE__*/ API.make(() => ({
3300
+ input: RestoreDatabaseRequest,
3301
+ output: RestoreDatabaseResponse,
3302
+ errors: [BadRequest, Forbidden, NotFound],
3303
+ protocol: TursoProtocol,
3304
+ retry: Retry.Retry,
3305
+ }));
3306
+
3307
+ export type RestoreGroupError = BadRequest | Forbidden | NotFound | TursoOpError;
3308
+ /** 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. */
3309
+ export const restoreGroup: API.OperationMethod<
3310
+ RestoreGroupRequest,
3311
+ RestoreGroupResponse,
3312
+ RestoreGroupError,
3313
+ TursoOpContext
3314
+ > = /*@__PURE__*/ API.make(() => ({
3315
+ input: RestoreGroupRequest,
3316
+ output: RestoreGroupResponse,
3317
+ errors: [BadRequest, Forbidden, NotFound],
3318
+ protocol: TursoProtocol,
3319
+ retry: Retry.Retry,
3320
+ }));
3321
+
3273
3322
  export type RevokeAPITokenError = NotFound | TursoOpError;
3274
3323
  /** Revoke API Token Revokes the provided API token belonging to a user. */
3275
3324
  export const revokeAPIToken: API.OperationMethod<
@@ -3285,7 +3334,7 @@ export const revokeAPIToken: API.OperationMethod<
3285
3334
  retry: Retry.Retry,
3286
3335
  }));
3287
3336
 
3288
- export type RevokeOrganizationAPITokenError = TursoOpError;
3337
+ export type RevokeOrganizationAPITokenError = NotFound | TursoOpError;
3289
3338
  /** Revoke Organization API Token Revokes a token scoped to this organization. The path takes a token **ID**, not a name, because names are unique per user but not across users — an admin revoking a member's token can't disambiguate by name alone. Authorization is symmetric with the list endpoint: - **Admins and owners** can revoke any token scoped to the organization (org-scoped or group-scoped, regardless of who minted it). - **Members and viewers** can revoke only tokens they minted themselves. A token scoped to a different organization returns `404`, not `403`, so the endpoint does not leak the existence of cross-org token IDs. Unrestricted tokens are also unreachable here and must be revoked via [`DELETE /v1/auth/api-tokens/{tokenName}`](/api-reference/tokens/revoke). */
3290
3339
  export const revokeOrganizationAPIToken: API.OperationMethod<
3291
3340
  RevokeOrganizationAPITokenRequest,
@@ -3295,7 +3344,7 @@ export const revokeOrganizationAPIToken: API.OperationMethod<
3295
3344
  > = /*@__PURE__*/ API.make(() => ({
3296
3345
  input: RevokeOrganizationAPITokenRequest,
3297
3346
  output: RevokeOrganizationAPITokenResponse,
3298
- errors: [],
3347
+ errors: [NotFound],
3299
3348
  protocol: TursoProtocol,
3300
3349
  retry: Retry.Retry,
3301
3350
  }));
@@ -3375,11 +3424,7 @@ export const updateGroupDatabases: API.OperationMethod<
3375
3424
  retry: Retry.Retry,
3376
3425
  }));
3377
3426
 
3378
- export type UpdateMemberRoleError =
3379
- | BadRequest
3380
- | Forbidden
3381
- | NotFound
3382
- | TursoOpError;
3427
+ export type UpdateMemberRoleError = BadRequest | Forbidden | NotFound | TursoOpError;
3383
3428
  /** Update Member Role Update the role of an organization member. Only organization admins or owners can perform this action. */
3384
3429
  export const updateMemberRole: API.OperationMethod<
3385
3430
  UpdateMemberRoleRequest,