@distilled.cloud/turso 1.0.0-rc.2 → 1.0.0-rc.21

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.
Files changed (49) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +33 -0
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +15 -2
  8. package/lib/credentials.d.ts.map +1 -1
  9. package/lib/credentials.js +1 -27
  10. package/lib/errors.d.ts +22 -18
  11. package/lib/errors.d.ts.map +1 -1
  12. package/lib/errors.js +1 -32
  13. package/lib/index.d.ts +5 -5
  14. package/lib/index.d.ts.map +1 -1
  15. package/lib/index.js +1 -14
  16. package/lib/index.lazy.js +6 -0
  17. package/lib/index.lazy.js.map +1 -0
  18. package/lib/protocol.d.ts +10 -12
  19. package/lib/protocol.d.ts.map +1 -1
  20. package/lib/protocol.js +1 -46
  21. package/lib/retry.d.ts +2 -2
  22. package/lib/retry.d.ts.map +1 -1
  23. package/lib/retry.js +1 -33
  24. package/lib/services/index.d.ts.map +1 -1
  25. package/lib/services/index.js +0 -2
  26. package/lib/services/turso.d.ts +425 -433
  27. package/lib/services/turso.d.ts.map +1 -1
  28. package/lib/services/turso.js +83 -1462
  29. package/lib/services/turso.js.map +1 -1
  30. package/lib/services.lazy/index.js +3 -0
  31. package/lib/services.lazy/turso.js +4 -0
  32. package/lib/traits.d.ts +2 -2
  33. package/lib/traits.d.ts.map +1 -1
  34. package/lib/traits.js +1 -13
  35. package/package.json +27 -19
  36. package/src/credentials.ts +25 -21
  37. package/src/errors.ts +21 -18
  38. package/src/index.ts +5 -9
  39. package/src/protocol.ts +28 -46
  40. package/src/retry.ts +6 -10
  41. package/src/services/turso.ts +2427 -2132
  42. package/src/traits.ts +2 -2
  43. package/lib/credentials.js.map +0 -1
  44. package/lib/errors.js.map +0 -1
  45. package/lib/index.js.map +0 -1
  46. package/lib/protocol.js.map +0 -1
  47. package/lib/retry.js.map +0 -1
  48. package/lib/services/index.js.map +0 -1
  49. package/lib/traits.js.map +0 -1
@@ -1,30 +1,59 @@
1
- import * as S from "@distilled.cloud/core/schema";
2
1
  import * as API from "@distilled.cloud/core/api";
2
+ import * as S from "@distilled.cloud/core/schema-lite";
3
+ import type * as Redacted from "effect/Redacted";
3
4
  import { type TursoOpError, type TursoOpContext } from "../protocol.ts";
4
5
  export type { TursoOpError, TursoOpContext };
5
- declare const BadRequest_base: S.Class<BadRequest, S.TaggedStruct<"BadRequest", {
6
+ declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
6
7
  readonly code: any;
7
8
  readonly message: any;
8
- }>, import("effect/Cause").YieldableError>;
9
+ readonly body: any;
10
+ readonly headers: any;
11
+ }> & (new (...args: any[]) => {
12
+ "@distilled.cloud/error/categories": {
13
+ BadRequestError: true;
14
+ };
15
+ });
9
16
  export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
17
+ readonly body?: Error400Body4 | Error400Body | Error400Body2 | Error400Body3 | Error400Body5 | Error400Body6 | string;
10
18
  }
11
- declare const Conflict_base: S.Class<Conflict, S.TaggedStruct<"Conflict", {
19
+ declare const Conflict_base: S.TaggedErrorClass<"Conflict", {
12
20
  readonly code: any;
13
21
  readonly message: any;
14
- }>, import("effect/Cause").YieldableError>;
22
+ readonly body: any;
23
+ readonly headers: any;
24
+ }> & (new (...args: any[]) => {
25
+ "@distilled.cloud/error/categories": {
26
+ ConflictError: true;
27
+ };
28
+ });
15
29
  export declare class Conflict extends /*@__PURE__*/ Conflict_base {
30
+ readonly body?: Error409Body3 | Error409Body | Error409Body2 | string;
16
31
  }
17
- declare const Forbidden_base: S.Class<Forbidden, S.TaggedStruct<"Forbidden", {
32
+ declare const Forbidden_base: S.TaggedErrorClass<"Forbidden", {
18
33
  readonly code: any;
19
34
  readonly message: any;
20
- }>, import("effect/Cause").YieldableError>;
35
+ readonly body: any;
36
+ readonly headers: any;
37
+ }> & (new (...args: any[]) => {
38
+ "@distilled.cloud/error/categories": {
39
+ AuthError: true;
40
+ };
41
+ });
21
42
  export declare class Forbidden extends /*@__PURE__*/ Forbidden_base {
43
+ readonly body?: Error403Body | string;
22
44
  }
23
- declare const NotFound_base: S.Class<NotFound, S.TaggedStruct<"NotFound", {
45
+ declare const NotFound_base: S.TaggedErrorClass<"NotFound", {
24
46
  readonly code: any;
25
47
  readonly message: any;
26
- }>, import("effect/Cause").YieldableError>;
48
+ readonly body: any;
49
+ readonly headers: any;
50
+ }> & (new (...args: any[]) => {
51
+ "@distilled.cloud/error/categories": {
52
+ BadRequestError: true;
53
+ };
54
+ });
27
55
  export declare class NotFound extends /*@__PURE__*/ NotFound_base {
56
+ readonly body?: Error400Body | Error404Body3 | Error404Body | Error404Body6 | Error404Body2 | Error404Body4 | Error404Body5 | string;
28
57
  }
29
58
  export interface AddLocationToGroupRequest {
30
59
  /** The slug of the organization or user account. */
@@ -34,96 +63,80 @@ export interface AddLocationToGroupRequest {
34
63
  /** The location code to add to the group. */
35
64
  location: string;
36
65
  }
37
- export declare const AddLocationToGroupRequest: S.Schema<AddLocationToGroupRequest>;
38
66
  /** An array of location keys the group is located. */
39
67
  export type GroupLocationsList = Array<string>;
40
- export declare const GroupLocationsList: S.Schema<GroupLocationsList>;
41
68
  export interface Group {
42
69
  /** The group name, unique across your organization. */
43
- name?: string;
70
+ name?: string | undefined;
44
71
  /** The current libSQL server version the databases in that group are running. */
45
- version?: string;
72
+ version?: string | undefined;
46
73
  /** The group universal unique identifier (UUID). */
47
- uuid?: string;
74
+ uuid?: string | undefined;
48
75
  /** An array of location keys the group is located. */
49
- locations?: GroupLocationsList;
76
+ locations?: GroupLocationsList | undefined;
50
77
  /** The primary location key. */
51
- primary?: string;
78
+ primary?: string | undefined;
52
79
  /** The current status for delete protection. If enabled, the group and all its databases cannot be deleted. */
53
- delete_protection?: boolean;
80
+ delete_protection?: boolean | undefined;
54
81
  }
55
- export declare const Group: S.Schema<Group>;
56
82
  export interface AddLocationToGroupResponse {
57
83
  /** The group with the added location */
58
- group?: Group;
84
+ group?: Group | undefined;
59
85
  }
60
- export declare const AddLocationToGroupResponse: S.Schema<AddLocationToGroupResponse>;
61
86
  /** The role given to the user. */
62
87
  export type AddOrganizationMemberRequestRole = "admin" | "member" | "viewer";
63
- export declare const AddOrganizationMemberRequestRole: any;
64
88
  export interface AddOrganizationMemberRequest {
65
89
  /** The slug of the organization or user account. */
66
90
  organizationSlug: string;
67
91
  /** The username of an existing Turso user. */
68
- username?: string;
92
+ username?: string | undefined;
69
93
  /** The role given to the user. */
70
- role?: AddOrganizationMemberRequestRole | (string & {});
94
+ role?: AddOrganizationMemberRequestRole | (string & {}) | undefined;
71
95
  }
72
- export declare const AddOrganizationMemberRequest: S.Schema<AddOrganizationMemberRequest>;
73
96
  /** The role assigned to the member. */
74
97
  export type Role = "owner" | "admin" | "member" | "viewer";
75
- export declare const Role: any;
76
98
  export interface AddOrganizationMemberResponse {
77
- member?: string;
78
- role?: Role;
99
+ member?: string | undefined;
100
+ role?: Role | undefined;
79
101
  }
80
- export declare const AddOrganizationMemberResponse: S.Schema<AddOrganizationMemberResponse>;
81
- export type CreateAPITokenRequestScopesItem = "read" | "db:create" | "db:delete" | "db:configure" | "db:mint-token" | "db:rotate-creds" | "group:configure" | "group:mint-token" | "group:rotate-creds" | "read-only" | "full-access";
82
- export declare const CreateAPITokenRequestScopesItem: any;
83
- /** Permissions to grant a group-scoped token. Each entry is either an individual scope or one of the presets `read-only` (expands to `read`) and `full-access` (expands to every scope). Required and must be non-empty when `group` is set. `db:mint-token` lets the token issue new SQL credentials; `db:rotate-creds` invalidates every existing SQL token for the database — they are deliberately separate because rotation is destructive. */
102
+ export type CreateAPITokenRequestScopesItem = "read" | "db:create" | "db:delete" | "db:configure" | "db:mint-token" | "db:rotate-creds" | "group:configure" | "group:mint-token" | "group:rotate-creds" | "group:create" | "group:delete" | "org:read" | "read-only" | "full-access";
103
+ /** Permissions to grant the token. Each entry is either an individual scope or one of the presets `read-only` (expands to `read`) and `full-access` (expands to every group scope, without `group:create`, `group:delete`, and `org:read`). Required and must be non-empty when `group` is set. Optional for an org-scoped token: without `scopes`, the token can do everything that its user can do in the organization. `group:create`, `group:delete`, and `org:read` are valid only on org-scoped tokens. `db:mint-token` lets the token issue new SQL credentials; `db:rotate-creds` invalidates every existing SQL token for the database -- they are deliberately separate because rotation is destructive. */
84
104
  export type CreateAPITokenRequestScopesList = Array<CreateAPITokenRequestScopesItem | (string & {})>;
85
- export declare const CreateAPITokenRequestScopesList: S.Schema<CreateAPITokenRequestScopesList>;
86
105
  export interface CreateAPITokenRequest {
87
106
  /** The name of the api token. */
88
107
  tokenName: string;
89
108
  /** The organization slug to restrict this token to. Required when `group` is set. */
90
- organization?: string;
109
+ organization?: string | undefined;
91
110
  /** The group name (inside `organization`) to restrict this token to. Requires `organization` and a non-empty `scopes` list. */
92
- group?: string;
93
- /** Permissions to grant a group-scoped token. Each entry is either an individual scope or one of the presets `read-only` (expands to `read`) and `full-access` (expands to every scope). Required and must be non-empty when `group` is set. `db:mint-token` lets the token issue new SQL credentials; `db:rotate-creds` invalidates every existing SQL token for the database — they are deliberately separate because rotation is destructive. */
94
- scopes?: CreateAPITokenRequestScopesList;
111
+ group?: string | undefined;
112
+ /** Permissions to grant the token. Each entry is either an individual scope or one of the presets `read-only` (expands to `read`) and `full-access` (expands to every group scope, without `group:create`, `group:delete`, and `org:read`). Required and must be non-empty when `group` is set. Optional for an org-scoped token: without `scopes`, the token can do everything that its user can do in the organization. `group:create`, `group:delete`, and `org:read` are valid only on org-scoped tokens. `db:mint-token` lets the token issue new SQL credentials; `db:rotate-creds` invalidates every existing SQL token for the database -- they are deliberately separate because rotation is destructive. */
113
+ scopes?: CreateAPITokenRequestScopesList | undefined;
95
114
  }
96
- export declare const CreateAPITokenRequest: S.Schema<CreateAPITokenRequest>;
97
115
  export interface CreateAPITokenResponse {
98
- name?: string;
99
- id?: string;
116
+ name?: string | undefined;
117
+ id?: string | undefined;
100
118
  /** 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.** */
101
- token?: string;
119
+ token?: Redacted.Redacted<string> | undefined;
102
120
  }
103
- export declare const CreateAPITokenResponse: S.Schema<CreateAPITokenResponse>;
104
121
  /** 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). */
105
122
  export type CreateDatabaseRequestSeedType = "database" | "database_upload";
106
- export declare const CreateDatabaseRequestSeedType: any;
107
123
  export interface CreateDatabaseRequestSeed {
108
124
  /** 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). */
109
- type?: CreateDatabaseRequestSeedType | (string & {});
125
+ type?: CreateDatabaseRequestSeedType | (string & {}) | undefined;
110
126
  /** The name of the existing database when `database` is used as a seed type. */
111
- name?: string;
127
+ name?: string | undefined;
112
128
  /** A formatted [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) recovery point to create a database from. This must be within the last 24 hours, or 30 days on the scaler plan. */
113
- timestamp?: string;
129
+ timestamp?: string | undefined;
114
130
  }
115
- export declare const CreateDatabaseRequestSeed: S.Schema<CreateDatabaseRequestSeed>;
116
131
  /** The encryption cipher to use. */
117
132
  export type CreateDatabaseRequestRemoteEncryptionEncryptionCipher = "aes256gcm" | "aes128gcm" | "chacha20poly1305" | "aegis128l" | "aegis128x2" | "aegis128x4" | "aegis256" | "aegis256x2" | "aegis256x4";
118
- export declare const CreateDatabaseRequestRemoteEncryptionEncryptionCipher: any;
119
133
  /** Encryption configuration for the database. Can be used when creating a new encrypted database, creating a encrypted database from upload (`seed.type = "database_upload"`), or forking from an encrypted database (required when the source database is encrypted). */
120
134
  export interface CreateDatabaseRequestRemoteEncryption {
121
135
  /** Base64-encoded encryption key. Key size depends on cipher: 32 bytes for aes256gcm, chacha20poly1305, aegis256 variants; 16 bytes for aes128gcm, aegis128l variants. */
122
- encryption_key?: string;
136
+ encryption_key?: Redacted.Redacted<string> | undefined;
123
137
  /** The encryption cipher to use. */
124
- encryption_cipher?: CreateDatabaseRequestRemoteEncryptionEncryptionCipher | (string & {});
138
+ encryption_cipher?: CreateDatabaseRequestRemoteEncryptionEncryptionCipher | (string & {}) | undefined;
125
139
  }
126
- export declare const CreateDatabaseRequestRemoteEncryption: S.Schema<CreateDatabaseRequestRemoteEncryption>;
127
140
  export interface CreateDatabaseRequest {
128
141
  /** The slug of the organization or user account. */
129
142
  organizationSlug: string;
@@ -131,68 +144,55 @@ export interface CreateDatabaseRequest {
131
144
  name: string;
132
145
  /** The name of the group where the database should be created. **The group must already exist.** */
133
146
  group: string;
134
- seed?: CreateDatabaseRequestSeed;
147
+ seed?: CreateDatabaseRequestSeed | undefined;
135
148
  /** The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb. */
136
- size_limit?: string;
149
+ size_limit?: string | undefined;
137
150
  /** Encryption configuration for the database. Can be used when creating a new encrypted database, creating a encrypted database from upload (`seed.type = "database_upload"`), or forking from an encrypted database (required when the source database is encrypted). */
138
- remote_encryption?: CreateDatabaseRequestRemoteEncryption;
151
+ remote_encryption?: CreateDatabaseRequestRemoteEncryption | undefined;
139
152
  }
140
- export declare const CreateDatabaseRequest: S.Schema<CreateDatabaseRequest>;
141
153
  export interface CreateDatabaseOutput {
142
- DbId?: string;
143
- Hostname?: string;
144
- Name?: string;
154
+ DbId?: string | undefined;
155
+ Hostname?: string | undefined;
156
+ Name?: string | undefined;
145
157
  }
146
- export declare const CreateDatabaseOutput: S.Schema<CreateDatabaseOutput>;
147
158
  export interface CreateDatabaseResponse {
148
159
  /** The newly created database */
149
- database?: CreateDatabaseOutput;
160
+ database?: CreateDatabaseOutput | undefined;
150
161
  }
151
- export declare const CreateDatabaseResponse: S.Schema<CreateDatabaseResponse>;
152
162
  export type CreateDatabaseTokenRequestAuthorization = "full-access" | "read-only";
153
- export declare const CreateDatabaseTokenRequestAuthorization: any;
154
163
  export type CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList = Array<string>;
155
- export declare const CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList: S.Schema<CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList>;
156
164
  /** Read `ATTACH` permission for the token. */
157
165
  export interface CreateDatabaseTokenRequestPermissionsReadAttach {
158
- databases?: CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList;
166
+ databases?: CreateDatabaseTokenRequestPermissionsReadAttachDatabasesList | undefined;
159
167
  }
160
- export declare const CreateDatabaseTokenRequestPermissionsReadAttach: S.Schema<CreateDatabaseTokenRequestPermissionsReadAttach>;
161
168
  /** The permissions for the token. */
162
169
  export interface CreateDatabaseTokenRequestPermissions {
163
170
  /** Read `ATTACH` permission for the token. */
164
- read_attach?: CreateDatabaseTokenRequestPermissionsReadAttach;
171
+ read_attach?: CreateDatabaseTokenRequestPermissionsReadAttach | undefined;
165
172
  }
166
- export declare const CreateDatabaseTokenRequestPermissions: S.Schema<CreateDatabaseTokenRequestPermissions>;
167
173
  export interface CreateDatabaseTokenRequest {
168
174
  /** The slug of the organization or user account. */
169
175
  organizationSlug: string;
170
176
  /** The name of the database. */
171
177
  databaseName: string;
172
178
  /** Expiration time for the token (e.g., 2w1d30m). */
173
- expiration?: string;
179
+ expiration?: string | undefined;
174
180
  /** Authorization level for the token (full-access or read-only). */
175
- authorization?: CreateDatabaseTokenRequestAuthorization | (string & {});
181
+ authorization?: CreateDatabaseTokenRequestAuthorization | (string & {}) | undefined;
176
182
  /** The permissions for the token. */
177
- permissions?: CreateDatabaseTokenRequestPermissions;
183
+ permissions?: CreateDatabaseTokenRequestPermissions | undefined;
178
184
  }
179
- export declare const CreateDatabaseTokenRequest: S.Schema<CreateDatabaseTokenRequest>;
180
185
  export interface CreateDatabaseTokenResponse {
181
186
  /** The generated authorization token (JWT). */
182
- jwt?: string;
187
+ jwt?: Redacted.Redacted<string> | undefined;
183
188
  }
184
- export declare const CreateDatabaseTokenResponse: S.Schema<CreateDatabaseTokenResponse>;
185
189
  /** Set to `all` to enable all extensions. */
186
190
  export type ExtensionsCase0 = "all";
187
- export declare const ExtensionsCase0: any;
188
191
  export type ExtensionsCase1Item = "vector" | "crypto" | "fuzzy" | "math" | "stats" | "text" | "unicode" | "uuid" | "regexp" | "vec";
189
- export declare const ExtensionsCase1Item: any;
190
192
  /** Array of extensions to enable. */
191
193
  export type ExtensionsCase1List = Array<ExtensionsCase1Item | (string & {})>;
192
- export declare const ExtensionsCase1List: S.Schema<ExtensionsCase1List>;
193
194
  /** The extensions to enable for new databases created in this group. Users looking to enable vector extensions should instead use the native [libSQL vector datatype](/features/ai-and-embeddings). */
194
195
  export type Extensions = ExtensionsCase0 | ExtensionsCase1List;
195
- export declare const Extensions: S.Schema<Extensions>;
196
196
  export interface CreateGroupRequest {
197
197
  /** The slug of the organization or user account. */
198
198
  organizationSlug: string;
@@ -200,178 +200,154 @@ export interface CreateGroupRequest {
200
200
  name: string;
201
201
  /** The location key for the new group. */
202
202
  location: string;
203
- extensions?: Extensions;
203
+ extensions?: Extensions | undefined;
204
204
  }
205
- export declare const CreateGroupRequest: S.Schema<CreateGroupRequest>;
206
205
  export interface CreateGroupResponse {
207
206
  /** The newly created group */
208
- group?: Group;
207
+ group?: Group | undefined;
209
208
  }
210
- export declare const CreateGroupResponse: S.Schema<CreateGroupResponse>;
211
209
  export type CreateGroupTokenRequestAuthorization = "full-access" | "read-only";
212
- export declare const CreateGroupTokenRequestAuthorization: any;
213
210
  export type CreateGroupTokenRequestPermissionsReadAttachDatabasesList = Array<string>;
214
- export declare const CreateGroupTokenRequestPermissionsReadAttachDatabasesList: S.Schema<CreateGroupTokenRequestPermissionsReadAttachDatabasesList>;
215
211
  /** Read `ATTACH` permission for the token. */
216
212
  export interface CreateGroupTokenRequestPermissionsReadAttach {
217
- databases?: CreateGroupTokenRequestPermissionsReadAttachDatabasesList;
213
+ databases?: CreateGroupTokenRequestPermissionsReadAttachDatabasesList | undefined;
218
214
  }
219
- export declare const CreateGroupTokenRequestPermissionsReadAttach: S.Schema<CreateGroupTokenRequestPermissionsReadAttach>;
220
215
  /** The permissions for the token. */
221
216
  export interface CreateGroupTokenRequestPermissions {
222
217
  /** Read `ATTACH` permission for the token. */
223
- read_attach?: CreateGroupTokenRequestPermissionsReadAttach;
218
+ read_attach?: CreateGroupTokenRequestPermissionsReadAttach | undefined;
224
219
  }
225
- export declare const CreateGroupTokenRequestPermissions: S.Schema<CreateGroupTokenRequestPermissions>;
226
220
  export interface CreateGroupTokenRequest {
227
221
  /** The slug of the organization or user account. */
228
222
  organizationSlug: string;
229
223
  /** The name of the group. */
230
224
  groupName: string;
231
225
  /** Expiration time for the token (e.g., 2w1d30m). */
232
- expiration?: string;
226
+ expiration?: string | undefined;
233
227
  /** Authorization level for the token (full-access or read-only). */
234
- authorization?: CreateGroupTokenRequestAuthorization | (string & {});
228
+ authorization?: CreateGroupTokenRequestAuthorization | (string & {}) | undefined;
235
229
  /** The permissions for the token. */
236
- permissions?: CreateGroupTokenRequestPermissions;
230
+ permissions?: CreateGroupTokenRequestPermissions | undefined;
237
231
  }
238
- export declare const CreateGroupTokenRequest: S.Schema<CreateGroupTokenRequest>;
239
232
  export interface CreateGroupTokenResponse {
240
233
  /** The generated authorization token (JWT). */
241
- jwt?: string;
234
+ jwt?: Redacted.Redacted<string> | undefined;
242
235
  }
243
- export declare const CreateGroupTokenResponse: S.Schema<CreateGroupTokenResponse>;
244
236
  export interface DeleteDatabaseRequest {
245
237
  /** The slug of the organization or user account. */
246
238
  organizationSlug: string;
247
239
  /** The name of the database. */
248
240
  databaseName: string;
249
241
  }
250
- export declare const DeleteDatabaseRequest: S.Schema<DeleteDatabaseRequest>;
251
242
  export interface DeleteDatabaseResponse {
252
243
  /** The name of the database that was deleted. */
253
- database?: string;
244
+ database?: string | undefined;
254
245
  }
255
- export declare const DeleteDatabaseResponse: S.Schema<DeleteDatabaseResponse>;
256
246
  export interface DeleteGroupRequest {
257
247
  /** The slug of the organization or user account. */
258
248
  organizationSlug: string;
259
249
  /** The name of the group. */
260
250
  groupName: string;
261
251
  }
262
- export declare const DeleteGroupRequest: S.Schema<DeleteGroupRequest>;
263
252
  export interface DeleteGroupResponse {
264
- group?: Group;
253
+ group?: Group | undefined;
265
254
  }
266
- export declare const DeleteGroupResponse: S.Schema<DeleteGroupResponse>;
267
255
  export interface DeleteOrganizationInviteByEmailV2Request {
268
256
  /** The slug of the organization or user account. */
269
257
  organizationSlug: string;
270
258
  email: string;
271
259
  }
272
- export declare const DeleteOrganizationInviteByEmailV2Request: S.Schema<DeleteOrganizationInviteByEmailV2Request>;
273
260
  export interface DeleteOrganizationInviteByEmailV2Response {
274
261
  }
275
- export declare const DeleteOrganizationInviteByEmailV2Response: S.Schema<DeleteOrganizationInviteByEmailV2Response>;
276
262
  export interface GetCurrentUserRequest {
277
263
  }
278
- export declare const GetCurrentUserRequest: S.Schema<GetCurrentUserRequest>;
279
264
  export interface GetCurrentUserResponseUser {
280
265
  /** The username of the user. */
281
- username?: string;
266
+ username?: string | undefined;
282
267
  /** The display name of the user. */
283
- name?: string;
268
+ name?: string | undefined;
284
269
  /** The primary email address of the user. */
285
- email?: string;
270
+ email?: string | undefined;
286
271
  /** URL to the user's avatar image. */
287
- avatarUrl?: string;
272
+ avatarUrl?: string | undefined;
288
273
  /** The user's current plan. */
289
- plan?: string;
274
+ plan?: string | undefined;
290
275
  /** Whether the user has multi-factor authentication enabled. */
291
- mfa?: boolean;
276
+ mfa?: boolean | undefined;
292
277
  /** Whether the user has pending organization invites waiting to be accepted or declined. */
293
- has_pending_invites?: boolean;
278
+ has_pending_invites?: boolean | undefined;
294
279
  }
295
- export declare const GetCurrentUserResponseUser: S.Schema<GetCurrentUserResponseUser>;
296
280
  export interface GetCurrentUserResponse {
297
- user?: GetCurrentUserResponseUser;
281
+ user?: GetCurrentUserResponseUser | undefined;
298
282
  }
299
- export declare const GetCurrentUserResponse: S.Schema<GetCurrentUserResponse>;
300
283
  export interface GetDatabaseRequest {
301
284
  /** The slug of the organization or user account. */
302
285
  organizationSlug: string;
303
286
  /** The name of the database. */
304
287
  databaseName: string;
305
288
  }
306
- export declare const GetDatabaseRequest: S.Schema<GetDatabaseRequest>;
307
289
  /** A list of regions for the group the database belongs to. */
308
290
  export type DatabaseRegionsList = Array<string>;
309
- export declare const DatabaseRegionsList: S.Schema<DatabaseRegionsList>;
310
291
  export interface DatabaseParent {
311
292
  /** The parent database identifier. */
312
- id?: string;
293
+ id?: string | undefined;
313
294
  /** The name of the parent database. */
314
- name?: string;
295
+ name?: string | undefined;
315
296
  /** The timestamp when the database was branched from the parent. */
316
- branched_at?: string;
297
+ branched_at?: string | undefined;
317
298
  }
318
- export declare const DatabaseParent: S.Schema<DatabaseParent>;
319
299
  export interface Database {
320
300
  /** The database name, **unique** across your organization. */
321
- Name?: string;
301
+ Name?: string | undefined;
322
302
  /** The database universal unique identifier (UUID). */
323
- DbId?: string;
303
+ DbId?: string | undefined;
324
304
  /** The DNS hostname used for client libSQL and HTTP connections. */
325
- Hostname?: string;
305
+ Hostname?: string | undefined;
326
306
  /** The current status for blocked reads. */
327
- block_reads?: boolean;
307
+ block_reads?: boolean | undefined;
328
308
  /** The current status for blocked writes. */
329
- block_writes?: boolean;
309
+ block_writes?: boolean | undefined;
330
310
  /** A list of regions for the group the database belongs to. */
331
- regions?: DatabaseRegionsList;
311
+ regions?: DatabaseRegionsList | undefined;
332
312
  /** The primary region location code the group the database belongs to. */
333
- primaryRegion?: string;
313
+ primaryRegion?: string | undefined;
334
314
  /** The name of the group the database belongs to. */
335
- group?: string;
315
+ group?: string | undefined;
336
316
  /** The current status for delete protection. If enabled, the database cannot be deleted. */
337
- delete_protection?: boolean;
338
- parent?: DatabaseParent | null;
317
+ delete_protection?: boolean | undefined;
318
+ parent?: DatabaseParent | null | undefined;
319
+ /** Whether other databases may be attached to this database with `ATTACH`. */
320
+ allow_attach?: boolean | undefined;
339
321
  }
340
- export declare const Database: S.Schema<Database>;
341
322
  export interface GetDatabaseResponse {
342
- database?: Database;
323
+ database?: Database | undefined;
343
324
  }
344
- export declare const GetDatabaseResponse: S.Schema<GetDatabaseResponse>;
345
325
  export interface GetDatabaseConfigurationRequest {
346
326
  /** The slug of the organization or user account. */
347
327
  organizationSlug: string;
348
328
  /** The name of the database. */
349
329
  databaseName: string;
350
330
  }
351
- export declare const GetDatabaseConfigurationRequest: S.Schema<GetDatabaseConfigurationRequest>;
352
331
  /** List of allowed IP addresses and CIDR blocks. Empty means no IP restriction. */
353
332
  export type DatabaseConfigurationResponseAllowedIpsList = Array<string>;
354
- export declare const DatabaseConfigurationResponseAllowedIpsList: S.Schema<DatabaseConfigurationResponseAllowedIpsList>;
355
333
  /** List of allowed AWS VPC endpoint IDs. Empty means no VPC endpoint restriction. */
356
334
  export type DatabaseConfigurationResponseAllowedAwsVpcIdsList = Array<string>;
357
- export declare const DatabaseConfigurationResponseAllowedAwsVpcIdsList: S.Schema<DatabaseConfigurationResponseAllowedAwsVpcIdsList>;
358
335
  export interface DatabaseConfigurationResponse {
359
336
  /** The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb. */
360
- size_limit?: string;
337
+ size_limit?: string | undefined;
361
338
  /** Allow or disallow attaching databases to the current database. */
362
- allow_attach?: boolean;
339
+ allow_attach?: boolean | undefined;
363
340
  /** The current status for blocked reads. */
364
- block_reads?: boolean;
341
+ block_reads?: boolean | undefined;
365
342
  /** The current status for blocked writes. */
366
- block_writes?: boolean;
343
+ block_writes?: boolean | undefined;
367
344
  /** Prevent the database from being deleted. */
368
- delete_protection?: boolean;
345
+ delete_protection?: boolean | undefined;
369
346
  /** List of allowed IP addresses and CIDR blocks. Empty means no IP restriction. */
370
- allowed_ips?: DatabaseConfigurationResponseAllowedIpsList;
347
+ allowed_ips?: DatabaseConfigurationResponseAllowedIpsList | undefined;
371
348
  /** List of allowed AWS VPC endpoint IDs. Empty means no VPC endpoint restriction. */
372
- allowed_aws_vpc_ids?: DatabaseConfigurationResponseAllowedAwsVpcIdsList;
349
+ allowed_aws_vpc_ids?: DatabaseConfigurationResponseAllowedAwsVpcIdsList | undefined;
373
350
  }
374
- export declare const DatabaseConfigurationResponse: S.Schema<DatabaseConfigurationResponse>;
375
351
  export interface GetDatabaseInstanceRequest {
376
352
  /** The slug of the organization or user account. */
377
353
  organizationSlug: string;
@@ -380,574 +356,551 @@ export interface GetDatabaseInstanceRequest {
380
356
  /** The name of the instance (location code). */
381
357
  instanceName: string;
382
358
  }
383
- export declare const GetDatabaseInstanceRequest: S.Schema<GetDatabaseInstanceRequest>;
384
359
  /** The type of database instance this, will be `primary` or `replica`. */
385
360
  export type InstanceType = "primary" | "replica";
386
- export declare const InstanceType: any;
387
361
  export interface Instance {
388
362
  /** The instance universal unique identifier (UUID). */
389
- uuid?: string;
363
+ uuid?: string | undefined;
390
364
  /** The name of the instance (location code). */
391
- name?: string;
365
+ name?: string | undefined;
392
366
  /** The type of database instance this, will be `primary` or `replica`. */
393
- type?: InstanceType;
367
+ type?: InstanceType | undefined;
394
368
  /** The location code for the region this instance is located. */
395
- region?: string;
369
+ region?: string | undefined;
396
370
  /** The DNS hostname used for client libSQL and HTTP connections (specific to this instance only). */
397
- hostname?: string;
371
+ hostname?: string | undefined;
398
372
  }
399
- export declare const Instance: S.Schema<Instance>;
400
373
  export interface GetDatabaseInstanceResponse {
401
- instance?: Instance;
374
+ instance?: Instance | undefined;
402
375
  }
403
- export declare const GetDatabaseInstanceResponse: S.Schema<GetDatabaseInstanceResponse>;
404
376
  export interface GetDatabaseStatsRequest {
405
377
  /** The slug of the organization or user account. */
406
378
  organizationSlug: string;
407
379
  /** The name of the database. */
408
380
  databaseName: string;
409
381
  }
410
- export declare const GetDatabaseStatsRequest: S.Schema<GetDatabaseStatsRequest>;
411
382
  export interface DatabaseStatsOutput {
412
383
  /** A string representing the SQL query executed. */
413
- query?: string;
384
+ query?: string | undefined;
414
385
  /** An integer indicating the number of rows read by the query, which reflects the volume of data the query processed from the database. */
415
- rows_read?: number;
386
+ rows_read?: number | undefined;
416
387
  /** An integer indicating the number of rows written (inserted, updated, or deleted) by the query, which reflects the impact of the query on the database data. */
417
- rows_written?: number;
388
+ rows_written?: number | undefined;
418
389
  }
419
- export declare const DatabaseStatsOutput: S.Schema<DatabaseStatsOutput>;
420
390
  /** The top queries performed on the given database as well as the total rows read and written. */
421
391
  export type GetDatabaseStatsResponseTopQueriesList = Array<DatabaseStatsOutput>;
422
- export declare const GetDatabaseStatsResponseTopQueriesList: S.Schema<GetDatabaseStatsResponseTopQueriesList>;
423
392
  export interface GetDatabaseStatsResponse {
424
393
  /** The top queries performed on the given database as well as the total rows read and written. */
425
- top_queries?: GetDatabaseStatsResponseTopQueriesList | null;
394
+ top_queries?: GetDatabaseStatsResponseTopQueriesList | null | undefined;
426
395
  }
427
- export declare const GetDatabaseStatsResponse: S.Schema<GetDatabaseStatsResponse>;
428
396
  export interface GetDatabaseUsageRequest {
429
397
  /** The slug of the organization or user account. */
430
398
  organizationSlug: string;
431
399
  /** The name of the database. */
432
400
  databaseName: string;
433
401
  /** The datetime to retrieve usage **from** in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Defaults to the current calendar month if not provided. Example: `2023-01-01T00:00:00Z` */
434
- from?: string;
402
+ from?: string | undefined;
435
403
  /** The datetime to retrieve usage **to** in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Defaults to the current calendar month if not provided. Example: `2023-02-01T00:00:00Z` */
436
- to?: string;
404
+ to?: string | undefined;
437
405
  }
438
- export declare const GetDatabaseUsageRequest: S.Schema<GetDatabaseUsageRequest>;
439
406
  export interface DatabaseUsageObject {
440
407
  /** The total rows read in the time period. */
441
- rows_read?: number;
408
+ rows_read?: number | undefined;
442
409
  /** The total rows written in the time period. */
443
- rows_written?: number;
410
+ rows_written?: number | undefined;
444
411
  /** The total storage used. */
445
- storage_bytes?: number;
412
+ storage_bytes?: number | undefined;
446
413
  /** The total bytes synced. */
447
- bytes_synced?: number;
414
+ bytes_synced?: number | undefined;
448
415
  }
449
- export declare const DatabaseUsageObject: S.Schema<DatabaseUsageObject>;
450
416
  export interface DatabaseUsageOutputInstancesItem {
451
417
  /** The instance universal unique identifier (UUID). */
452
- uuid?: string;
418
+ uuid?: string | undefined;
453
419
  /** The usage for the current database instance. */
454
- usage?: DatabaseUsageObject;
420
+ usage?: DatabaseUsageObject | undefined;
455
421
  }
456
- export declare const DatabaseUsageOutputInstancesItem: S.Schema<DatabaseUsageOutputInstancesItem>;
457
422
  /** The usage objects for instances of the current database. */
458
423
  export type DatabaseUsageOutputInstancesList = Array<DatabaseUsageOutputInstancesItem>;
459
- export declare const DatabaseUsageOutputInstancesList: S.Schema<DatabaseUsageOutputInstancesList>;
460
424
  export interface DatabaseUsageOutput {
461
- uuid?: string;
425
+ uuid?: string | undefined;
462
426
  /** The usage objects for instances of the current database. */
463
- instances?: DatabaseUsageOutputInstancesList;
427
+ instances?: DatabaseUsageOutputInstancesList | undefined;
464
428
  /** The total usage for the database. */
465
- total?: DatabaseUsageObject;
429
+ total?: DatabaseUsageObject | undefined;
466
430
  }
467
- export declare const DatabaseUsageOutput: S.Schema<DatabaseUsageOutput>;
468
431
  export interface GetDatabaseUsageResponse {
469
432
  /** 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). */
470
- database?: DatabaseUsageOutput;
433
+ database?: DatabaseUsageOutput | undefined;
471
434
  }
472
- export declare const GetDatabaseUsageResponse: S.Schema<GetDatabaseUsageResponse>;
473
435
  export interface GetGroupRequest {
474
436
  /** The slug of the organization or user account. */
475
437
  organizationSlug: string;
476
438
  /** The name of the group. */
477
439
  groupName: string;
478
440
  }
479
- export declare const GetGroupRequest: S.Schema<GetGroupRequest>;
480
441
  export interface GetGroupResponse {
481
- group?: Group;
442
+ group?: Group | undefined;
482
443
  }
483
- export declare const GetGroupResponse: S.Schema<GetGroupResponse>;
484
444
  export interface GetGroupConfigurationRequest {
485
445
  /** The slug of the organization or user account. */
486
446
  organizationSlug: string;
487
447
  /** The name of the group. */
488
448
  groupName: string;
489
449
  }
490
- export declare const GetGroupConfigurationRequest: S.Schema<GetGroupConfigurationRequest>;
491
450
  export interface GroupConfigurationResponse {
492
451
  /** Prevent the group from being deleted. */
493
- delete_protection?: boolean;
452
+ delete_protection?: boolean | undefined;
494
453
  }
495
- export declare const GroupConfigurationResponse: S.Schema<GroupConfigurationResponse>;
496
454
  export interface GetOrganizationRequest {
497
455
  /** The slug of the organization or user account. */
498
456
  organizationSlug: string;
499
457
  }
500
- export declare const GetOrganizationRequest: S.Schema<GetOrganizationRequest>;
501
458
  /** The type of account this organization is. Will always be `personal` or `team`. */
502
459
  export type OrganizationType = "personal" | "team";
503
- export declare const OrganizationType: any;
504
460
  export interface Organization {
505
461
  /** The organization name. Every user has a `personal` organization for their own account. */
506
- name?: string;
462
+ name?: string | undefined;
507
463
  /** The organization slug. This will be your username for `personal` accounts. */
508
- slug?: string;
464
+ slug?: string | undefined;
509
465
  /** The type of account this organization is. Will always be `personal` or `team`. */
510
- type?: OrganizationType;
466
+ type?: OrganizationType | undefined;
511
467
  /** The name of the organization. Every user has a `personal` organization for their own account. */
512
- overages?: boolean;
468
+ overages?: boolean | undefined;
513
469
  /** Whether all members of the organization are required to have multi-factor authentication enabled. */
514
- require_mfa?: boolean;
470
+ require_mfa?: boolean | undefined;
515
471
  /** Returns the current status for blocked reads. */
516
- blocked_reads?: boolean;
472
+ blocked_reads?: boolean | undefined;
517
473
  /** Returns the current status for blocked writes. */
518
- blocked_writes?: boolean;
474
+ blocked_writes?: boolean | undefined;
519
475
  /** The pricing plan identifier this organization is subscribed to. */
520
- plan_id?: string;
476
+ plan_id?: string | undefined;
521
477
  /** The billing cycle for the paid plan, if any. */
522
- plan_timeline?: string;
478
+ plan_timeline?: string | undefined;
523
479
  /** The external platform this organization is managed by. Will be empty for Turso managed organizations. */
524
- platform?: string;
480
+ platform?: string | undefined;
481
+ /** Whether deleted database and group recovery is enabled for the organization. Returned when retrieving a single organization. */
482
+ restore_enabled?: boolean | undefined;
525
483
  }
526
- export declare const Organization: S.Schema<Organization>;
527
484
  export interface GetOrganizationResponse {
528
- organization?: Organization;
485
+ organization?: Organization | undefined;
529
486
  }
530
- export declare const GetOrganizationResponse: S.Schema<GetOrganizationResponse>;
531
487
  export interface GetOrganizationMemberRequest {
532
488
  /** The slug of the organization or user account. */
533
489
  organizationSlug: string;
534
490
  /** The username of a Turso user or organization member. */
535
491
  username: string;
536
492
  }
537
- export declare const GetOrganizationMemberRequest: S.Schema<GetOrganizationMemberRequest>;
538
493
  /** The role assigned to the member. */
539
494
  export type MemberRole = "owner" | "admin" | "member" | "viewer";
540
- export declare const MemberRole: any;
541
495
  export interface Member {
542
496
  /** The username for the member. */
543
- username?: string;
497
+ username?: string | undefined;
544
498
  /** The role assigned to the member. */
545
- role?: MemberRole;
499
+ role?: MemberRole | undefined;
546
500
  /** The email for the member. */
547
- email?: string;
501
+ email?: string | undefined;
548
502
  }
549
- export declare const Member: S.Schema<Member>;
550
503
  export interface GetOrganizationMemberResponse {
551
- member?: Member;
504
+ member?: Member | undefined;
552
505
  }
553
- export declare const GetOrganizationMemberResponse: S.Schema<GetOrganizationMemberResponse>;
554
506
  export interface GetOrganizationSubscriptionRequest {
555
507
  /** The slug of the organization or user account. */
556
508
  organizationSlug: string;
557
509
  }
558
- export declare const GetOrganizationSubscriptionRequest: S.Schema<GetOrganizationSubscriptionRequest>;
559
510
  export interface GetOrganizationSubscriptionResponseSubscription {
560
511
  /** The name of the plan for the current subscription. */
561
- name?: string;
512
+ name?: string | undefined;
562
513
  /** Whether overages are enabled for the organization. */
563
- overages?: boolean;
514
+ overages?: boolean | undefined;
564
515
  /** The name of the plan for the current subscription. */
565
- plan?: string;
516
+ plan?: string | undefined;
566
517
  /** Whether the plan is billed monthly or yearly. */
567
- timeline?: string;
518
+ timeline?: string | undefined;
568
519
  }
569
- export declare const GetOrganizationSubscriptionResponseSubscription: S.Schema<GetOrganizationSubscriptionResponseSubscription>;
570
520
  export interface GetOrganizationSubscriptionResponse {
571
- subscription?: GetOrganizationSubscriptionResponseSubscription;
521
+ subscription?: GetOrganizationSubscriptionResponseSubscription | undefined;
572
522
  }
573
- export declare const GetOrganizationSubscriptionResponse: S.Schema<GetOrganizationSubscriptionResponse>;
574
523
  export interface GetOrganizationUsageRequest {
575
524
  /** The slug of the organization or user account. */
576
525
  organizationSlug: string;
577
526
  }
578
- export declare const GetOrganizationUsageRequest: S.Schema<GetOrganizationUsageRequest>;
579
527
  /** The usage object for the organization. */
580
528
  export interface GetOrganizationUsageResponseOrganizationUsage {
581
529
  /** The number of rows read allowed for the specific plan. */
582
- rows_read?: number;
530
+ rows_read?: number | undefined;
583
531
  /** The number of rows written allowed for the specific plan. */
584
- rows_written?: number;
532
+ rows_written?: number | undefined;
585
533
  /** The number of databases allowed for the specific plan. */
586
- databases?: number;
534
+ databases?: number | undefined;
587
535
  /** The number of locations allowed for the specific plan. */
588
- locations?: number;
536
+ locations?: number | undefined;
589
537
  /** The amount of storage allowed for the specific plan, in bytes. */
590
- storage_bytes?: number;
538
+ storage_bytes?: number | undefined;
591
539
  /** The number of groups allowed for the specific plan. */
592
- groups?: number;
540
+ groups?: number | undefined;
593
541
  /** The number of bytes synced allowed for the specific plan, in bytes. */
594
- bytes_synced?: number;
542
+ bytes_synced?: number | undefined;
595
543
  }
596
- export declare const GetOrganizationUsageResponseOrganizationUsage: S.Schema<GetOrganizationUsageResponseOrganizationUsage>;
597
544
  /** The databases for the organization and their usage. */
598
545
  export type GetOrganizationUsageResponseOrganizationDatabasesList = Array<DatabaseUsageOutput>;
599
- export declare const GetOrganizationUsageResponseOrganizationDatabasesList: S.Schema<GetOrganizationUsageResponseOrganizationDatabasesList>;
600
546
  /** The organization usage object, containing the total usage for rows read and written, as well as the total storage size (in bytes). */
601
547
  export interface GetOrganizationUsageResponseOrganization {
602
548
  /** The UUID of the organization. */
603
- uuid?: string;
549
+ uuid?: string | undefined;
604
550
  /** The usage object for the organization. */
605
- usage?: GetOrganizationUsageResponseOrganizationUsage;
551
+ usage?: GetOrganizationUsageResponseOrganizationUsage | undefined;
606
552
  /** The databases for the organization and their usage. */
607
- databases?: GetOrganizationUsageResponseOrganizationDatabasesList;
553
+ databases?: GetOrganizationUsageResponseOrganizationDatabasesList | undefined;
608
554
  }
609
- export declare const GetOrganizationUsageResponseOrganization: S.Schema<GetOrganizationUsageResponseOrganization>;
610
555
  export interface GetOrganizationUsageResponse {
611
556
  /** The organization usage object, containing the total usage for rows read and written, as well as the total storage size (in bytes). */
612
- organization?: GetOrganizationUsageResponseOrganization;
557
+ organization?: GetOrganizationUsageResponseOrganization | undefined;
613
558
  }
614
- export declare const GetOrganizationUsageResponse: S.Schema<GetOrganizationUsageResponse>;
615
559
  export interface InvalidateDatabaseTokensRequest {
616
560
  /** The slug of the organization or user account. */
617
561
  organizationSlug: string;
618
562
  /** The name of the database. */
619
563
  databaseName: string;
620
564
  }
621
- export declare const InvalidateDatabaseTokensRequest: S.Schema<InvalidateDatabaseTokensRequest>;
622
565
  export interface InvalidateDatabaseTokensResponse {
623
566
  }
624
- export declare const InvalidateDatabaseTokensResponse: S.Schema<InvalidateDatabaseTokensResponse>;
625
567
  export interface InvalidateGroupTokensRequest {
626
568
  /** The slug of the organization or user account. */
627
569
  organizationSlug: string;
628
570
  /** The name of the group. */
629
571
  groupName: string;
630
572
  }
631
- export declare const InvalidateGroupTokensRequest: S.Schema<InvalidateGroupTokensRequest>;
632
573
  export interface InvalidateGroupTokensResponse {
633
574
  }
634
- export declare const InvalidateGroupTokensResponse: S.Schema<InvalidateGroupTokensResponse>;
635
575
  /** The role given to the user. */
636
576
  export type InviteOrganizationMemberV2RequestRole = "admin" | "member" | "viewer";
637
- export declare const InviteOrganizationMemberV2RequestRole: any;
638
577
  export interface InviteOrganizationMemberV2Request {
639
578
  /** The slug of the organization or user account. */
640
579
  organizationSlug: string;
641
580
  /** The email of the user you want to invite. Exactly one of email or username must be provided. */
642
- email?: string;
581
+ email?: string | undefined;
643
582
  /** The username of an existing Turso user you want to invite. Exactly one of email or username must be provided. */
644
- username?: string;
583
+ username?: string | undefined;
645
584
  /** The role given to the user. */
646
- role?: InviteOrganizationMemberV2RequestRole | (string & {});
585
+ role?: InviteOrganizationMemberV2RequestRole | (string & {}) | undefined;
647
586
  }
648
- export declare const InviteOrganizationMemberV2Request: S.Schema<InviteOrganizationMemberV2Request>;
649
587
  /** The assigned role for the invited user. */
650
588
  export type InviteCreatedV2Role = "admin" | "member" | "viewer";
651
- export declare const InviteCreatedV2Role: any;
652
589
  export interface InviteCreatedV2 {
653
590
  /** The email of the person invited. */
654
- email?: string;
591
+ email?: string | undefined;
655
592
  /** The assigned role for the invited user. */
656
- role?: InviteCreatedV2Role;
593
+ role?: InviteCreatedV2Role | undefined;
657
594
  /** The name of the organization the user was invited to. */
658
- organization?: string;
595
+ organization?: string | undefined;
659
596
  }
660
- export declare const InviteCreatedV2: S.Schema<InviteCreatedV2>;
661
597
  export interface InviteOrganizationMemberV2Response {
662
- invited?: InviteCreatedV2;
598
+ invited?: InviteCreatedV2 | undefined;
663
599
  }
664
- export declare const InviteOrganizationMemberV2Response: S.Schema<InviteOrganizationMemberV2Response>;
665
600
  export interface ListAPITokensRequest {
666
601
  }
667
- export declare const ListAPITokensRequest: S.Schema<ListAPITokensRequest>;
668
- /** 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. */
602
+ /** The expanded list of scopes granted to this token. Present only for tokens with scopes. Presets passed at creation time (`read-only`, `full-access`) are stored as the underlying individual scopes and are returned in that form. */
669
603
  export type APITokenScopesList = Array<string>;
670
- export declare const APITokenScopesList: S.Schema<APITokenScopesList>;
671
604
  export interface APIToken {
672
605
  /** The name given to the API Token. */
673
- name?: string;
606
+ name?: string | undefined;
674
607
  /** The ID generated by Turso for the API Token. */
675
- id?: string;
608
+ id?: string | undefined;
676
609
  /** The organization slug this token is restricted to. Omitted if the token has access to all organizations. */
677
- organization?: string;
610
+ organization?: string | undefined;
678
611
  /** The group name this token is pinned to. Present only for group-scoped tokens. */
679
- group?: string;
680
- /** 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. */
681
- scopes?: APITokenScopesList;
612
+ group?: string | undefined;
613
+ /** The expanded list of scopes granted to this token. Present only for tokens with scopes. Presets passed at creation time (`read-only`, `full-access`) are stored as the underlying individual scopes and are returned in that form. */
614
+ scopes?: APITokenScopesList | undefined;
682
615
  /** The date the token was created, in `YYYY-MM-DD` format. */
683
- created_at?: string;
616
+ created_at?: string | undefined;
684
617
  }
685
- export declare const APIToken: S.Schema<APIToken>;
686
618
  export type ListAPITokensResponseTokensList = Array<APIToken>;
687
- export declare const ListAPITokensResponseTokensList: S.Schema<ListAPITokensResponseTokensList>;
688
619
  export interface ListAPITokensResponse {
689
- tokens?: ListAPITokensResponseTokensList;
620
+ tokens?: ListAPITokensResponseTokensList | undefined;
690
621
  }
691
- export declare const ListAPITokensResponse: S.Schema<ListAPITokensResponse>;
692
622
  export interface ListDatabaseInstancesRequest {
693
623
  /** The slug of the organization or user account. */
694
624
  organizationSlug: string;
695
625
  /** The name of the database. */
696
626
  databaseName: string;
697
627
  }
698
- export declare const ListDatabaseInstancesRequest: S.Schema<ListDatabaseInstancesRequest>;
699
628
  export type ListDatabaseInstancesResponseInstancesList = Array<Instance>;
700
- export declare const ListDatabaseInstancesResponseInstancesList: S.Schema<ListDatabaseInstancesResponseInstancesList>;
701
629
  export interface ListDatabaseInstancesResponse {
702
- instances?: ListDatabaseInstancesResponseInstancesList;
630
+ instances?: ListDatabaseInstancesResponseInstancesList | undefined;
703
631
  }
704
- export declare const ListDatabaseInstancesResponse: S.Schema<ListDatabaseInstancesResponse>;
705
632
  export interface ListDatabasesRequest {
706
633
  /** The slug of the organization or user account. */
707
634
  organizationSlug: string;
708
635
  /** Filter databases by group name. */
709
- group?: string;
636
+ group?: string | undefined;
710
637
  /** The schema database name that can be used to get databases that belong to that parent schema. */
711
- schema?: string;
638
+ schema?: string | undefined;
712
639
  /** Filter database branches by using their parent database ID. */
713
- parent?: string;
640
+ parent?: string | undefined;
714
641
  }
715
- export declare const ListDatabasesRequest: S.Schema<ListDatabasesRequest>;
716
642
  export type ListDatabasesResponseDatabasesList = Array<Database>;
717
- export declare const ListDatabasesResponseDatabasesList: S.Schema<ListDatabasesResponseDatabasesList>;
718
643
  export interface ListDatabasesResponse {
719
- databases?: ListDatabasesResponseDatabasesList;
644
+ databases?: ListDatabasesResponseDatabasesList | undefined;
645
+ }
646
+ export interface ListDeletedDatabasesRequest {
647
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
648
+ organizationId: string;
649
+ /** Must be `true` to list deleted databases. */
650
+ deleted: boolean;
651
+ /** Filter deleted databases by name. */
652
+ search?: string | undefined;
653
+ /** Page size, from 1 to 1000. */
654
+ limit?: number | undefined;
655
+ /** Opaque pagination cursor from the previous page's `pagination.next`. */
656
+ cursor?: string | undefined;
657
+ }
658
+ /** The regions the database was located in. */
659
+ export type DeletedDatabaseRegionsList = Array<string>;
660
+ export interface DeletedDatabase {
661
+ /** The database name. */
662
+ Name?: string | undefined;
663
+ /** The database UUID. Use it to restore the database. */
664
+ DbId?: string | undefined;
665
+ /** The DNS hostname the database had, used for client and HTTP connections. */
666
+ Hostname?: string | undefined;
667
+ /** The name of the group the database belonged to. */
668
+ group?: string | undefined;
669
+ /** The UUID of the group the database belonged to. */
670
+ group_id?: string | undefined;
671
+ /** The UUID of the organization. */
672
+ organization_id?: string | undefined;
673
+ /** The regions the database was located in. */
674
+ regions?: DeletedDatabaseRegionsList | undefined;
675
+ /** The primary region of the database. */
676
+ primaryRegion?: string | undefined;
677
+ /** Whether delete protection was enabled for the database. */
678
+ delete_protection?: boolean | undefined;
679
+ /** When the database was deleted. */
680
+ deleted_at?: string | undefined;
681
+ /** Set when the database's group was deleted with it. Restoring the database also restores the group. */
682
+ group_deleted_at?: string | undefined;
683
+ }
684
+ export type ListDeletedDatabasesResponseDatabasesList = Array<DeletedDatabase>;
685
+ export interface Pagination {
686
+ /** Opaque cursor for the next page. Pass it back as the `cursor` query parameter. Absent on the last page. */
687
+ next?: string | undefined;
688
+ }
689
+ export interface ListDeletedDatabasesResponse {
690
+ databases?: ListDeletedDatabasesResponseDatabasesList | undefined;
691
+ pagination?: Pagination | undefined;
692
+ }
693
+ export interface ListDeletedGroupsRequest {
694
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
695
+ organizationId: string;
696
+ /** Page size, from 1 to 1000. */
697
+ limit?: number | undefined;
698
+ /** Opaque pagination cursor from the previous page's `pagination.next`. */
699
+ cursor?: string | undefined;
700
+ }
701
+ export interface DeletedGroup {
702
+ /** The group UUID. Use it to restore the group. */
703
+ uuid?: string | undefined;
704
+ /** The group name. */
705
+ name?: string | undefined;
706
+ /** When the group was deleted. */
707
+ deleted_at?: string | undefined;
708
+ /** The number of member databases that restoring the group would bring back with it. */
709
+ cascade_databases?: number | undefined;
710
+ }
711
+ export type ListDeletedGroupsResponseGroupsList = Array<DeletedGroup>;
712
+ export interface ListDeletedGroupsResponse {
713
+ groups?: ListDeletedGroupsResponseGroupsList | undefined;
714
+ pagination?: Pagination | undefined;
720
715
  }
721
- export declare const ListDatabasesResponse: S.Schema<ListDatabasesResponse>;
722
716
  export interface ListGroupsRequest {
723
717
  /** The slug of the organization or user account. */
724
718
  organizationSlug: string;
725
719
  }
726
- export declare const ListGroupsRequest: S.Schema<ListGroupsRequest>;
727
720
  export type ListGroupsResponseGroupsList = Array<Group>;
728
- export declare const ListGroupsResponseGroupsList: S.Schema<ListGroupsResponseGroupsList>;
729
721
  export interface ListGroupsResponse {
730
- groups?: ListGroupsResponseGroupsList;
722
+ groups?: ListGroupsResponseGroupsList | undefined;
731
723
  }
732
- export declare const ListGroupsResponse: S.Schema<ListGroupsResponse>;
733
724
  export interface ListLocationsRequest {
734
725
  }
735
- export declare const ListLocationsRequest: S.Schema<ListLocationsRequest>;
736
726
  /** A mapping of location codes to location names. */
737
727
  export type ListLocationsResponseLocationsMap = {
738
728
  [key: string]: string | undefined;
739
729
  };
740
- export declare const ListLocationsResponseLocationsMap: S.Schema<ListLocationsResponseLocationsMap>;
741
730
  export interface ListLocationsResponse {
742
731
  /** A mapping of location codes to location names. */
743
- locations?: ListLocationsResponseLocationsMap;
732
+ locations?: ListLocationsResponseLocationsMap | undefined;
744
733
  }
745
- export declare const ListLocationsResponse: S.Schema<ListLocationsResponse>;
746
734
  export interface ListOrganizationAPITokensRequest {
747
735
  /** The slug of the organization or user account. */
748
736
  organizationSlug: string;
749
737
  }
750
- export declare const ListOrganizationAPITokensRequest: S.Schema<ListOrganizationAPITokensRequest>;
751
- /** The expanded scope list. Present only for group-scoped tokens. */
738
+ /** The expanded scope list. Present only for tokens with scopes. */
752
739
  export type ListOrganizationAPITokensResponseTokensItemScopesList = Array<string>;
753
- export declare const ListOrganizationAPITokensResponseTokensItemScopesList: S.Schema<ListOrganizationAPITokensResponseTokensItemScopesList>;
754
740
  /** The user who minted the token. Returned to admins and owners so they can see who provisioned each token. */
755
741
  export interface ListOrganizationAPITokensResponseTokensItemOwner {
756
- username?: string;
757
- email?: string;
742
+ username?: string | undefined;
743
+ email?: string | undefined;
758
744
  }
759
- export declare const ListOrganizationAPITokensResponseTokensItemOwner: S.Schema<ListOrganizationAPITokensResponseTokensItemOwner>;
760
745
  export interface ListOrganizationAPITokensResponseTokensItem {
761
746
  /** The token name. */
762
- name?: string;
747
+ name?: string | undefined;
763
748
  /** The token ID. Pass this to the revoke endpoint. */
764
- id?: string;
749
+ id?: string | undefined;
765
750
  /** The organization slug. Always equal to the path parameter for tokens returned here. */
766
- organization?: string;
751
+ organization?: string | undefined;
767
752
  /** The group name. Present only for group-scoped tokens. */
768
- group?: string;
769
- /** The expanded scope list. Present only for group-scoped tokens. */
770
- scopes?: ListOrganizationAPITokensResponseTokensItemScopesList;
753
+ group?: string | undefined;
754
+ /** The expanded scope list. Present only for tokens with scopes. */
755
+ scopes?: ListOrganizationAPITokensResponseTokensItemScopesList | undefined;
771
756
  /** The user who minted the token. Returned to admins and owners so they can see who provisioned each token. */
772
- owner?: ListOrganizationAPITokensResponseTokensItemOwner;
757
+ owner?: ListOrganizationAPITokensResponseTokensItemOwner | undefined;
773
758
  /** The date the token was created. */
774
- created_at?: string;
759
+ created_at?: string | undefined;
775
760
  }
776
- export declare const ListOrganizationAPITokensResponseTokensItem: S.Schema<ListOrganizationAPITokensResponseTokensItem>;
777
761
  export type ListOrganizationAPITokensResponseTokensList = Array<ListOrganizationAPITokensResponseTokensItem>;
778
- export declare const ListOrganizationAPITokensResponseTokensList: S.Schema<ListOrganizationAPITokensResponseTokensList>;
779
762
  export interface ListOrganizationAPITokensResponse {
780
- tokens?: ListOrganizationAPITokensResponseTokensList;
763
+ tokens?: ListOrganizationAPITokensResponseTokensList | undefined;
781
764
  }
782
- export declare const ListOrganizationAPITokensResponse: S.Schema<ListOrganizationAPITokensResponse>;
783
765
  export interface ListOrganizationAuditLogsRequest {
784
766
  /** The slug of the organization or user account. */
785
767
  organizationSlug: string;
786
768
  /** The limit of items to return per page. Defaults to 100. */
787
- page_size?: number;
769
+ page_size?: number | undefined;
788
770
  /** The page number to return. Defaults to 1. */
789
- page?: number;
771
+ page?: number | undefined;
790
772
  }
791
- export declare const ListOrganizationAuditLogsRequest: S.Schema<ListOrganizationAuditLogsRequest>;
792
773
  /** The code associated to the action taken. */
793
774
  export type AuditLogCode = "user-signup" | "db-create" | "db-delete" | "db-protect" | "db-unprotect" | "db-token-create" | "group-token-create" | "user-token-create" | "instance-create" | "instance-delete" | "org-create" | "org-delete" | "org-member-add" | "org-member-rm" | "org-member-leave" | "org-plan-update" | "org-set-overages" | "group-create" | "group-delete" | "group-unarchive" | "group-protect" | "group-unprotect" | "db-aunrchive" | "user-delete";
794
- export declare const AuditLogCode: any;
795
775
  export interface AuditLog {
796
776
  /** The code associated to the action taken. */
797
- code?: AuditLogCode;
777
+ code?: AuditLogCode | undefined;
798
778
  /** Additional context from the performed action. */
799
- message?: string;
779
+ message?: string | undefined;
800
780
  /** Where this action was performed. Will be either `cli` or `web` depending on the `User-Agent` sent to the API. */
801
- origin?: string;
781
+ origin?: string | undefined;
802
782
  /** The username of the user who performed the action. */
803
- author?: string;
783
+ author?: string | undefined;
804
784
  /** A formatted [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp this action was performed. */
805
- created_at?: string;
785
+ created_at?: string | undefined;
806
786
  /** The payload of the action performed. */
807
- data?: unknown;
787
+ data?: unknown | undefined;
808
788
  }
809
- export declare const AuditLog: S.Schema<AuditLog>;
810
789
  export type ListOrganizationAuditLogsResponseAuditLogsList = Array<AuditLog>;
811
- export declare const ListOrganizationAuditLogsResponseAuditLogsList: S.Schema<ListOrganizationAuditLogsResponseAuditLogsList>;
812
790
  export interface ListOrganizationAuditLogsResponsePagination {
813
791
  /** The current page number. */
814
- page?: number;
792
+ page?: number | undefined;
815
793
  /** The number of items per page. */
816
- page_size?: number;
794
+ page_size?: number | undefined;
817
795
  /** The total number of pages. */
818
- total_pages?: number;
796
+ total_pages?: number | undefined;
819
797
  /** The total number of items. */
820
- total_rows?: number;
798
+ total_rows?: number | undefined;
821
799
  }
822
- export declare const ListOrganizationAuditLogsResponsePagination: S.Schema<ListOrganizationAuditLogsResponsePagination>;
823
800
  export interface ListOrganizationAuditLogsResponse {
824
- audit_logs?: ListOrganizationAuditLogsResponseAuditLogsList;
825
- pagination?: ListOrganizationAuditLogsResponsePagination;
801
+ audit_logs?: ListOrganizationAuditLogsResponseAuditLogsList | undefined;
802
+ pagination?: ListOrganizationAuditLogsResponsePagination | undefined;
826
803
  }
827
- export declare const ListOrganizationAuditLogsResponse: S.Schema<ListOrganizationAuditLogsResponse>;
828
804
  export interface ListOrganizationInvitesV2Request {
829
805
  /** The slug of the organization or user account. */
830
806
  organizationSlug: string;
831
807
  }
832
- export declare const ListOrganizationInvitesV2Request: S.Schema<ListOrganizationInvitesV2Request>;
833
808
  /** The assigned role for the invited user. */
834
809
  export type InviteV2Role = "admin" | "member" | "viewer";
835
- export declare const InviteV2Role: any;
836
810
  export interface InviteV2 {
837
811
  /** The unique ID for the invite. */
838
- id?: number;
812
+ id?: number | undefined;
839
813
  /** The email of the person invited. */
840
- email?: string;
814
+ email?: string | undefined;
841
815
  /** The assigned role for the invited user. */
842
- role?: InviteV2Role;
816
+ role?: InviteV2Role | undefined;
843
817
  /** The datetime the invite was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */
844
- created_at?: string;
818
+ created_at?: string | undefined;
845
819
  }
846
- export declare const InviteV2: S.Schema<InviteV2>;
847
820
  export type ListOrganizationInvitesV2ResponseInvitesList = Array<InviteV2>;
848
- export declare const ListOrganizationInvitesV2ResponseInvitesList: S.Schema<ListOrganizationInvitesV2ResponseInvitesList>;
849
821
  export interface ListOrganizationInvitesV2Response {
850
- invites?: ListOrganizationInvitesV2ResponseInvitesList;
822
+ invites?: ListOrganizationInvitesV2ResponseInvitesList | undefined;
851
823
  }
852
- export declare const ListOrganizationInvitesV2Response: S.Schema<ListOrganizationInvitesV2Response>;
853
824
  export type ListOrganizationInvoicesRequestType = "all" | "upcoming" | "issued";
854
- export declare const ListOrganizationInvoicesRequestType: any;
855
825
  export interface ListOrganizationInvoicesRequest {
856
826
  /** The slug of the organization or user account. */
857
827
  organizationSlug: string;
858
828
  /** The type of invoice to retrieve. */
859
- type?: ListOrganizationInvoicesRequestType | (string & {});
829
+ type?: ListOrganizationInvoicesRequestType | (string & {}) | undefined;
860
830
  }
861
- export declare const ListOrganizationInvoicesRequest: S.Schema<ListOrganizationInvoicesRequest>;
862
831
  export interface ListOrganizationInvoicesResponseInvoicesItem {
863
832
  /** The unique ID for the invoice. */
864
- invoice_number?: string;
833
+ invoice_number?: string | undefined;
865
834
  /** The formatted price in USD for the invoice. */
866
- amount_due?: string;
835
+ amount_due?: string | undefined;
867
836
  /** The due date for the invoice. */
868
- due_date?: string;
837
+ due_date?: string | undefined;
869
838
  /** The date the invoice was paid. */
870
- paid_at?: string;
839
+ paid_at?: string | undefined;
871
840
  /** The date the invoice payment last failed. */
872
- payment_failed_at?: string;
841
+ payment_failed_at?: string | undefined;
873
842
  /** The link to the invoice PDF you can download. */
874
- invoice_pdf?: string;
843
+ invoice_pdf?: string | undefined;
875
844
  }
876
- export declare const ListOrganizationInvoicesResponseInvoicesItem: S.Schema<ListOrganizationInvoicesResponseInvoicesItem>;
877
845
  /** The list of invoices for the organization. */
878
846
  export type ListOrganizationInvoicesResponseInvoicesList = Array<ListOrganizationInvoicesResponseInvoicesItem>;
879
- export declare const ListOrganizationInvoicesResponseInvoicesList: S.Schema<ListOrganizationInvoicesResponseInvoicesList>;
880
847
  export interface ListOrganizationInvoicesResponse {
881
848
  /** The list of invoices for the organization. */
882
- invoices?: ListOrganizationInvoicesResponseInvoicesList;
849
+ invoices?: ListOrganizationInvoicesResponseInvoicesList | undefined;
883
850
  }
884
- export declare const ListOrganizationInvoicesResponse: S.Schema<ListOrganizationInvoicesResponse>;
885
851
  export interface ListOrganizationMembersRequest {
886
852
  /** The slug of the organization or user account. */
887
853
  organizationSlug: string;
888
854
  }
889
- export declare const ListOrganizationMembersRequest: S.Schema<ListOrganizationMembersRequest>;
890
855
  export type ListOrganizationMembersResponseMembersList = Array<Member>;
891
- export declare const ListOrganizationMembersResponseMembersList: S.Schema<ListOrganizationMembersResponseMembersList>;
892
856
  export interface ListOrganizationMembersResponse {
893
- members?: ListOrganizationMembersResponseMembersList;
857
+ members?: ListOrganizationMembersResponseMembersList | undefined;
894
858
  }
895
- export declare const ListOrganizationMembersResponse: S.Schema<ListOrganizationMembersResponse>;
896
859
  export interface ListOrganizationPlansRequest {
897
860
  /** The slug of the organization or user account. */
898
861
  organizationSlug: string;
899
862
  }
900
- export declare const ListOrganizationPlansRequest: S.Schema<ListOrganizationPlansRequest>;
901
863
  export interface PlanPrice {
902
864
  /** Price of the available plan. */
903
- value?: string;
865
+ value?: string | undefined;
904
866
  /** Payment regularity. */
905
- timeline?: string;
867
+ timeline?: string | undefined;
906
868
  }
907
- export declare const PlanPrice: S.Schema<PlanPrice>;
908
869
  export type OrganizationPlanPricesList = Array<PlanPrice>;
909
- export declare const OrganizationPlanPricesList: S.Schema<OrganizationPlanPricesList>;
910
870
  export interface PlanQuotas {
911
871
  /** The number of rows read allowed for the specific plan. */
912
- rowsRead?: number;
872
+ rowsRead?: number | undefined;
913
873
  /** The number of rows written allowed for the specific plan. */
914
- rowsWritten?: number;
874
+ rowsWritten?: number | undefined;
915
875
  /** The number of databases allowed for the specific plan. */
916
- databases?: number | null;
876
+ databases?: number | null | undefined;
917
877
  /** The number of locations allowed for the specific plan. */
918
- locations?: number;
878
+ locations?: number | undefined;
919
879
  /** The amount of storage allowed for the specific plan, in bytes. */
920
- storage?: number;
880
+ storage?: number | undefined;
921
881
  /** The number of groups allowed for the specific plan. */
922
- groups?: number;
882
+ groups?: number | undefined;
923
883
  /** The number of bytes synced allowed for the specific plan, in bytes. */
924
- bytesSynced?: number;
884
+ bytesSynced?: number | undefined;
925
885
  }
926
- export declare const PlanQuotas: S.Schema<PlanQuotas>;
927
886
  export interface OrganizationPlan {
928
887
  /** The name of the plan. */
929
- name?: string;
888
+ name?: string | undefined;
930
889
  /** The monthly price of the plan. */
931
- price?: string;
932
- prices?: OrganizationPlanPricesList;
933
- quotas?: PlanQuotas;
890
+ price?: string | undefined;
891
+ prices?: OrganizationPlanPricesList | undefined;
892
+ quotas?: PlanQuotas | undefined;
934
893
  }
935
- export declare const OrganizationPlan: S.Schema<OrganizationPlan>;
936
894
  /** List of available plans. */
937
895
  export type ListOrganizationPlansResponsePlansList = Array<OrganizationPlan>;
938
- export declare const ListOrganizationPlansResponsePlansList: S.Schema<ListOrganizationPlansResponsePlansList>;
939
896
  export interface ListOrganizationPlansResponse {
940
897
  /** List of available plans. */
941
- plans?: ListOrganizationPlansResponsePlansList;
898
+ plans?: ListOrganizationPlansResponsePlansList | undefined;
942
899
  }
943
- export declare const ListOrganizationPlansResponse: S.Schema<ListOrganizationPlansResponse>;
944
900
  export interface ListOrganizationsRequest {
945
901
  }
946
- export declare const ListOrganizationsRequest: S.Schema<ListOrganizationsRequest>;
947
902
  export type ListOrganizationsResponseBodyList = Array<Organization>;
948
- export declare const ListOrganizationsResponseBodyList: S.Schema<ListOrganizationsResponseBodyList>;
949
903
  export type ListOrganizationsResponse = ListOrganizationsResponseBodyList;
950
- export declare const ListOrganizationsResponse: S.Schema<ListOrganizationsResponse>;
951
904
  export interface RemoveLocationFromGroupRequest {
952
905
  /** The slug of the organization or user account. */
953
906
  organizationSlug: string;
@@ -956,133 +909,145 @@ export interface RemoveLocationFromGroupRequest {
956
909
  /** The location code to remove from the group. */
957
910
  location: string;
958
911
  }
959
- export declare const RemoveLocationFromGroupRequest: S.Schema<RemoveLocationFromGroupRequest>;
960
912
  export interface RemoveLocationFromGroupResponse {
961
913
  /** The group with the removed location */
962
- group?: Group;
914
+ group?: Group | undefined;
963
915
  }
964
- export declare const RemoveLocationFromGroupResponse: S.Schema<RemoveLocationFromGroupResponse>;
965
916
  export interface RemoveOrganizationMemberRequest {
966
917
  /** The slug of the organization or user account. */
967
918
  organizationSlug: string;
968
919
  /** The username of a Turso user or organization member. */
969
920
  username: string;
970
921
  }
971
- export declare const RemoveOrganizationMemberRequest: S.Schema<RemoveOrganizationMemberRequest>;
972
922
  export interface RemoveOrganizationMemberResponse {
973
- member?: string;
923
+ member?: string | undefined;
924
+ }
925
+ export interface RestoreDatabaseRequest {
926
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
927
+ organizationId: string;
928
+ /** The UUID of the database, as returned when listing deleted databases (the `DbId` field). */
929
+ databaseId: string;
930
+ /** Optional new name for the restored database. If omitted, the original name is reused. The hostname is re-derived from the name. */
931
+ name?: string | undefined;
932
+ }
933
+ export interface RestoreDatabaseResponse {
934
+ /** The restored database. */
935
+ database?: DeletedDatabase | undefined;
936
+ }
937
+ export interface RestoreGroupRequest {
938
+ /** The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the `id` field). */
939
+ organizationId: string;
940
+ /** The UUID of the group, as returned when listing deleted groups (the `uuid` field). */
941
+ groupId: string;
942
+ }
943
+ /** The member databases restored with the group, in restore order. */
944
+ export type RestoreGroupResponseDatabasesList = Array<DeletedDatabase>;
945
+ /** Maps database UUID to error message for members whose restore failed. Retry them individually with Restore Database. */
946
+ export type RestoreGroupResponseFailuresMap = {
947
+ [key: string]: string | undefined;
948
+ };
949
+ export interface RestoreGroupResponse {
950
+ /** The restored group. */
951
+ group?: Group | undefined;
952
+ /** The member databases restored with the group, in restore order. */
953
+ databases?: RestoreGroupResponseDatabasesList | undefined;
954
+ /** Maps database UUID to error message for members whose restore failed. Retry them individually with Restore Database. */
955
+ failures?: RestoreGroupResponseFailuresMap | undefined;
974
956
  }
975
- export declare const RemoveOrganizationMemberResponse: S.Schema<RemoveOrganizationMemberResponse>;
976
957
  export interface RevokeAPITokenRequest {
977
958
  /** The name of the api token. */
978
959
  tokenName: string;
979
960
  }
980
- export declare const RevokeAPITokenRequest: S.Schema<RevokeAPITokenRequest>;
981
961
  export interface RevokeAPITokenResponse {
982
962
  /** The revoked token name. */
983
- token?: string;
963
+ token?: Redacted.Redacted<string> | undefined;
984
964
  }
985
- export declare const RevokeAPITokenResponse: S.Schema<RevokeAPITokenResponse>;
986
965
  export interface RevokeOrganizationAPITokenRequest {
987
966
  /** The slug of the organization or user account. */
988
967
  organizationSlug: string;
989
968
  /** The ID of the token to revoke (from the list endpoint). */
990
969
  tokenId: string;
991
970
  }
992
- export declare const RevokeOrganizationAPITokenRequest: S.Schema<RevokeOrganizationAPITokenRequest>;
993
971
  export interface RevokeOrganizationAPITokenResponse {
994
972
  /** The ID of the revoked token. */
995
- token?: string;
973
+ token?: Redacted.Redacted<string> | undefined;
996
974
  }
997
- export declare const RevokeOrganizationAPITokenResponse: S.Schema<RevokeOrganizationAPITokenResponse>;
998
975
  export interface TransferGroupRequest {
999
976
  /** The slug of the organization or user account. */
1000
977
  organizationSlug: string;
1001
978
  /** The name of the group. */
1002
979
  groupName: string;
1003
980
  /** The slug of the organization to transfer the group to. */
1004
- organization?: string;
981
+ organization?: string | undefined;
1005
982
  }
1006
- export declare const TransferGroupRequest: S.Schema<TransferGroupRequest>;
1007
983
  /** An array of location keys the group is located. */
1008
984
  export type TransferGroupResponseLocationsList = Array<string>;
1009
- export declare const TransferGroupResponseLocationsList: S.Schema<TransferGroupResponseLocationsList>;
1010
985
  export interface TransferGroupResponse {
1011
986
  /** The group name, unique across your organization. */
1012
- name?: string;
987
+ name?: string | undefined;
1013
988
  /** The current libSQL server version the databases in that group are running. */
1014
- version?: string;
989
+ version?: string | undefined;
1015
990
  /** The group universal unique identifier (UUID). */
1016
- uuid?: string;
991
+ uuid?: string | undefined;
1017
992
  /** An array of location keys the group is located. */
1018
- locations?: TransferGroupResponseLocationsList;
993
+ locations?: TransferGroupResponseLocationsList | undefined;
1019
994
  /** The primary location key. */
1020
- primary?: string;
995
+ primary?: string | undefined;
1021
996
  /** The current status for delete protection. If enabled, the group and all its databases cannot be deleted. */
1022
- delete_protection?: boolean;
997
+ delete_protection?: boolean | undefined;
1023
998
  }
1024
- export declare const TransferGroupResponse: S.Schema<TransferGroupResponse>;
1025
999
  export interface UnarchiveGroupRequest {
1026
1000
  /** The slug of the organization or user account. */
1027
1001
  organizationSlug: string;
1028
1002
  /** The name of the group. */
1029
1003
  groupName: string;
1030
1004
  }
1031
- export declare const UnarchiveGroupRequest: S.Schema<UnarchiveGroupRequest>;
1032
1005
  export interface UnarchiveGroupResponse {
1033
1006
  /** The group that was unarchived */
1034
- group?: Group;
1007
+ group?: Group | undefined;
1035
1008
  }
1036
- export declare const UnarchiveGroupResponse: S.Schema<UnarchiveGroupResponse>;
1037
1009
  /** 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. */
1038
1010
  export type UpdateDatabaseConfigurationRequestAllowedIpsList = Array<string>;
1039
- export declare const UpdateDatabaseConfigurationRequestAllowedIpsList: S.Schema<UpdateDatabaseConfigurationRequestAllowedIpsList>;
1040
1011
  /** 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. */
1041
1012
  export type UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList = Array<string>;
1042
- export declare const UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList: S.Schema<UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList>;
1043
1013
  export interface UpdateDatabaseConfigurationRequest {
1044
1014
  /** The slug of the organization or user account. */
1045
1015
  organizationSlug: string;
1046
1016
  /** The name of the database. */
1047
1017
  databaseName: string;
1048
1018
  /** The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb. */
1049
- size_limit?: string;
1019
+ size_limit?: string | undefined;
1050
1020
  /** Allow or disallow attaching databases to the current database. */
1051
- allow_attach?: boolean;
1021
+ allow_attach?: boolean | undefined;
1052
1022
  /** Block all database reads. */
1053
- block_reads?: boolean;
1023
+ block_reads?: boolean | undefined;
1054
1024
  /** Block all database writes. */
1055
- block_writes?: boolean;
1025
+ block_writes?: boolean | undefined;
1056
1026
  /** Prevent the database from being deleted. */
1057
- delete_protection?: boolean;
1027
+ delete_protection?: boolean | undefined;
1058
1028
  /** 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. */
1059
- allowed_ips?: UpdateDatabaseConfigurationRequestAllowedIpsList;
1029
+ allowed_ips?: UpdateDatabaseConfigurationRequestAllowedIpsList | undefined;
1060
1030
  /** 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. */
1061
- allowed_aws_vpc_ids?: UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList;
1031
+ allowed_aws_vpc_ids?: UpdateDatabaseConfigurationRequestAllowedAwsVpcIdsList | undefined;
1062
1032
  }
1063
- export declare const UpdateDatabaseConfigurationRequest: S.Schema<UpdateDatabaseConfigurationRequest>;
1064
1033
  export interface UpdateGroupConfigurationRequest {
1065
1034
  /** The slug of the organization or user account. */
1066
1035
  organizationSlug: string;
1067
1036
  /** The name of the group. */
1068
1037
  groupName: string;
1069
1038
  /** Prevent the group from being deleted. */
1070
- delete_protection?: boolean;
1039
+ delete_protection?: boolean | undefined;
1071
1040
  }
1072
- export declare const UpdateGroupConfigurationRequest: S.Schema<UpdateGroupConfigurationRequest>;
1073
1041
  export interface UpdateGroupDatabasesRequest {
1074
1042
  /** The slug of the organization or user account. */
1075
1043
  organizationSlug: string;
1076
1044
  /** The name of the group. */
1077
1045
  groupName: string;
1078
1046
  }
1079
- export declare const UpdateGroupDatabasesRequest: S.Schema<UpdateGroupDatabasesRequest>;
1080
1047
  export interface UpdateGroupDatabasesResponse {
1081
1048
  }
1082
- export declare const UpdateGroupDatabasesResponse: S.Schema<UpdateGroupDatabasesResponse>;
1083
1049
  /** The new role to assign to the member. */
1084
1050
  export type UpdateMemberRoleRequestRole = "admin" | "member" | "viewer";
1085
- export declare const UpdateMemberRoleRequestRole: any;
1086
1051
  export interface UpdateMemberRoleRequest {
1087
1052
  /** The slug of the organization or user account. */
1088
1053
  organizationSlug: string;
@@ -1091,53 +1056,68 @@ export interface UpdateMemberRoleRequest {
1091
1056
  /** The new role to assign to the member. */
1092
1057
  role: UpdateMemberRoleRequestRole | (string & {});
1093
1058
  }
1094
- export declare const UpdateMemberRoleRequest: S.Schema<UpdateMemberRoleRequest>;
1095
1059
  /** The new role of the updated member. */
1096
1060
  export type UpdateMemberRoleResponseMemberRole = "admin" | "member" | "viewer";
1097
- export declare const UpdateMemberRoleResponseMemberRole: any;
1098
1061
  export interface UpdateMemberRoleResponseMember {
1099
1062
  /** The username of the updated member. */
1100
- username?: string;
1063
+ username?: string | undefined;
1101
1064
  /** The email of the updated member. */
1102
- email?: string;
1065
+ email?: string | undefined;
1103
1066
  /** The new role of the updated member. */
1104
- role?: UpdateMemberRoleResponseMemberRole;
1067
+ role?: UpdateMemberRoleResponseMemberRole | undefined;
1105
1068
  }
1106
- export declare const UpdateMemberRoleResponseMember: S.Schema<UpdateMemberRoleResponseMember>;
1107
1069
  export interface UpdateMemberRoleResponse {
1108
- member?: UpdateMemberRoleResponseMember;
1070
+ member?: UpdateMemberRoleResponseMember | undefined;
1109
1071
  }
1110
- export declare const UpdateMemberRoleResponse: S.Schema<UpdateMemberRoleResponse>;
1111
1072
  export interface UpdateOrganizationRequest {
1112
1073
  /** The slug of the organization or user account. */
1113
1074
  organizationSlug: string;
1114
1075
  /** Enable or disable overages for the organization. */
1115
- overages?: boolean;
1076
+ overages?: boolean | undefined;
1116
1077
  /** 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. */
1117
- require_mfa?: boolean;
1078
+ require_mfa?: boolean | undefined;
1079
+ /** Enable or disable deleted database and group recovery for the organization. Must be updated separately from other organization settings. Requires an admin or owner. */
1080
+ restore_enabled?: boolean | undefined;
1118
1081
  }
1119
- export declare const UpdateOrganizationRequest: S.Schema<UpdateOrganizationRequest>;
1120
1082
  export interface UpdateOrganizationResponse {
1121
1083
  /** The updated organization. */
1122
- organization?: Organization;
1084
+ organization?: Organization | undefined;
1123
1085
  }
1124
- export declare const UpdateOrganizationResponse: S.Schema<UpdateOrganizationResponse>;
1125
1086
  export interface ValidateAPITokenRequest {
1126
1087
  }
1127
- export declare const ValidateAPITokenRequest: S.Schema<ValidateAPITokenRequest>;
1128
1088
  export interface ValidateAPITokenResponse {
1129
1089
  /** The time of expiration for the provided token in unix epoch seconds, or `-1` if there is no expiration. */
1130
- exp?: number;
1131
- }
1132
- export declare const ValidateAPITokenResponse: S.Schema<ValidateAPITokenResponse>;
1090
+ exp?: number | undefined;
1091
+ }
1092
+ export interface Error400Body4 {
1093
+ /** The error message */
1094
+ error?: string | undefined;
1095
+ }
1096
+ export type Error400Body = Error400Body4;
1097
+ export type Error400Body2 = Error400Body4;
1098
+ export type Error400Body3 = Error400Body4;
1099
+ export type Error400Body5 = Error400Body4;
1100
+ export type Error400Body6 = Error400Body4;
1101
+ export type Error409Body3 = Error400Body4;
1102
+ export type Error409Body = Error400Body4;
1103
+ export type Error409Body2 = Error400Body4;
1104
+ export type Error403Body = Error400Body4;
1105
+ export type Error404Body3 = Error400Body4;
1106
+ export type Error404Body = Error400Body4;
1107
+ export interface Error404Body6 {
1108
+ error?: string | undefined;
1109
+ }
1110
+ export type Error404Body2 = Error400Body4;
1111
+ export type Error404Body4 = Error400Body4;
1112
+ export type Error404Body5 = Error400Body4;
1133
1113
  export type AddLocationToGroupError = BadRequest | NotFound | TursoOpError;
1134
1114
  /** Add Location to Group Adds a location to the specified group. */
1135
1115
  export declare const addLocationToGroup: API.OperationMethod<AddLocationToGroupRequest, AddLocationToGroupResponse, AddLocationToGroupError, TursoOpContext>;
1136
1116
  export type AddOrganizationMemberError = BadRequest | NotFound | Conflict | TursoOpError;
1137
1117
  /** Add Member Add an existing Turso user to an organization. */
1138
1118
  export declare const addOrganizationMember: API.OperationMethod<AddOrganizationMemberRequest, AddOrganizationMemberResponse, AddOrganizationMemberError, TursoOpContext>;
1139
- export type CreateAPITokenError = TursoOpError;
1140
- /** 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. */
1119
+ export type CreateAPITokenError = BadRequest | NotFound | Conflict | TursoOpError;
1120
+ /** 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`, and optionally `scopes`. The token can only act on resources inside that organization. With `scopes`, it can do only the listed operations, in every group of the 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. */
1141
1121
  export declare const createAPIToken: API.OperationMethod<CreateAPITokenRequest, CreateAPITokenResponse, CreateAPITokenError, TursoOpContext>;
1142
1122
  export type CreateDatabaseError = BadRequest | Conflict | TursoOpError;
1143
1123
  /** Create Database Creates a new database in a group for the organization or user. */
@@ -1197,12 +1177,12 @@ export type GetOrganizationUsageError = TursoOpError;
1197
1177
  /** Organization Usage Fetch current billing cycle usage for an organization. */
1198
1178
  export declare const getOrganizationUsage: API.OperationMethod<GetOrganizationUsageRequest, GetOrganizationUsageResponse, GetOrganizationUsageError, TursoOpContext>;
1199
1179
  export type InvalidateDatabaseTokensError = NotFound | TursoOpError;
1200
- /** Invalidate All Database Auth Tokens Invalidates all authorization tokens for the specified database. */
1180
+ /** Invalidate All Database Auth Tokens Invalidates all database-scoped authorization tokens for the specified database. On AWS, only tokens for this database are invalidated; group tokens and tokens for other databases in the group are not affected. */
1201
1181
  export declare const invalidateDatabaseTokens: API.OperationMethod<InvalidateDatabaseTokensRequest, InvalidateDatabaseTokensResponse, InvalidateDatabaseTokensError, TursoOpContext>;
1202
1182
  export type InvalidateGroupTokensError = NotFound | TursoOpError;
1203
- /** Invalidate All Group Auth Tokens Invalidates all authorization tokens for the specified group. */
1183
+ /** Invalidate All Group Auth Tokens Invalidates all group authorization tokens for the specified group. On AWS, database-scoped tokens are not invalidated; invalidate them per database. */
1204
1184
  export declare const invalidateGroupTokens: API.OperationMethod<InvalidateGroupTokensRequest, InvalidateGroupTokensResponse, InvalidateGroupTokensError, TursoOpContext>;
1205
- export type InviteOrganizationMemberV2Error = TursoOpError;
1185
+ export type InviteOrganizationMemberV2Error = BadRequest | TursoOpError;
1206
1186
  /** Invite Organization Member Invite a user to an organization. If the user isn't already registered with Turso, they will receive a signup link. If an existing pending invite exists for the same email, it will be replaced. */
1207
1187
  export declare const inviteOrganizationMemberV2: API.OperationMethod<InviteOrganizationMemberV2Request, InviteOrganizationMemberV2Response, InviteOrganizationMemberV2Error, TursoOpContext>;
1208
1188
  export type ListAPITokensError = TursoOpError;
@@ -1214,6 +1194,12 @@ export declare const listDatabaseInstances: API.OperationMethod<ListDatabaseInst
1214
1194
  export type ListDatabasesError = TursoOpError;
1215
1195
  /** List Databases Returns a list of databases belonging to the organization or user. */
1216
1196
  export declare const listDatabases: API.OperationMethod<ListDatabasesRequest, ListDatabasesResponse, ListDatabasesError, TursoOpContext>;
1197
+ export type ListDeletedDatabasesError = Forbidden | TursoOpError;
1198
+ /** 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. */
1199
+ export declare const listDeletedDatabases: API.OperationMethod<ListDeletedDatabasesRequest, ListDeletedDatabasesResponse, ListDeletedDatabasesError, TursoOpContext>;
1200
+ export type ListDeletedGroupsError = Forbidden | TursoOpError;
1201
+ /** 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. */
1202
+ export declare const listDeletedGroups: API.OperationMethod<ListDeletedGroupsRequest, ListDeletedGroupsResponse, ListDeletedGroupsError, TursoOpContext>;
1217
1203
  export type ListGroupsError = TursoOpError;
1218
1204
  /** List Groups Returns a list of groups belonging to the organization or user. */
1219
1205
  export declare const listGroups: API.OperationMethod<ListGroupsRequest, ListGroupsResponse, ListGroupsError, TursoOpContext>;
@@ -1221,7 +1207,7 @@ export type ListLocationsError = TursoOpError;
1221
1207
  /** List Locations Returns a list of locations where you can create or replicate databases. */
1222
1208
  export declare const listLocations: API.OperationMethod<ListLocationsRequest, ListLocationsResponse, ListLocationsError, TursoOpContext>;
1223
1209
  export type ListOrganizationAPITokensError = TursoOpError;
1224
- /** List Organization API Tokens Returns the API tokens scoped to this organization (both organization-scoped and group-scoped). Unrestricted tokens are not returned here — manage those via [`GET /v1/auth/api-tokens`](/api-reference/tokens/list). Authorization is symmetric with the revoke endpoint: - **Admins and owners** see every token scoped to the organization, with the minting user attached in the `owner` field. - **Members and viewers** see only tokens they minted themselves. This mirrors the personal-access-token model used in GitHub organization settings: admins get the full attribution list; everyone else sees their own access. */
1210
+ /** List Organization API Tokens Returns the API tokens scoped to this organization (both organization-scoped and group-scoped). Unrestricted tokens are not returned here -- manage those via [`GET /v1/auth/api-tokens`](/api-reference/tokens/list). Authorization is symmetric with the revoke endpoint: - **Admins and owners** see every token scoped to the organization, with the minting user attached in the `owner` field. - **Members and viewers** see only tokens they minted themselves. This mirrors the personal-access-token model used in GitHub organization settings: admins get the full attribution list; everyone else sees their own access. */
1225
1211
  export declare const listOrganizationAPITokens: API.OperationMethod<ListOrganizationAPITokensRequest, ListOrganizationAPITokensResponse, ListOrganizationAPITokensError, TursoOpContext>;
1226
1212
  export type ListOrganizationAuditLogsError = TursoOpError;
1227
1213
  /** List Audit Logs Return the audit logs for the given organization, ordered by the `created_at` field in descending order. */
@@ -1247,11 +1233,17 @@ export declare const removeLocationFromGroup: API.OperationMethod<RemoveLocation
1247
1233
  export type RemoveOrganizationMemberError = NotFound | TursoOpError;
1248
1234
  /** Remove Member Remove a user from the organization by username. */
1249
1235
  export declare const removeOrganizationMember: API.OperationMethod<RemoveOrganizationMemberRequest, RemoveOrganizationMemberResponse, RemoveOrganizationMemberError, TursoOpContext>;
1236
+ export type RestoreDatabaseError = BadRequest | Forbidden | NotFound | TursoOpError;
1237
+ /** 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. */
1238
+ export declare const restoreDatabase: API.OperationMethod<RestoreDatabaseRequest, RestoreDatabaseResponse, RestoreDatabaseError, TursoOpContext>;
1239
+ export type RestoreGroupError = BadRequest | Forbidden | NotFound | TursoOpError;
1240
+ /** 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. */
1241
+ export declare const restoreGroup: API.OperationMethod<RestoreGroupRequest, RestoreGroupResponse, RestoreGroupError, TursoOpContext>;
1250
1242
  export type RevokeAPITokenError = NotFound | TursoOpError;
1251
1243
  /** Revoke API Token Revokes the provided API token belonging to a user. */
1252
1244
  export declare const revokeAPIToken: API.OperationMethod<RevokeAPITokenRequest, RevokeAPITokenResponse, RevokeAPITokenError, TursoOpContext>;
1253
- export type RevokeOrganizationAPITokenError = TursoOpError;
1254
- /** 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). */
1245
+ export type RevokeOrganizationAPITokenError = NotFound | TursoOpError;
1246
+ /** 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). */
1255
1247
  export declare const revokeOrganizationAPIToken: API.OperationMethod<RevokeOrganizationAPITokenRequest, RevokeOrganizationAPITokenResponse, RevokeOrganizationAPITokenError, TursoOpContext>;
1256
1248
  export type TransferGroupError = NotFound | TursoOpError;
1257
1249
  /** Transfer Group Transfer a group to another organization that you own or a member of. */