@xata.io/client 0.8.1 → 0.8.4

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 (68) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/index.cjs +1744 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.ts +3246 -7
  5. package/dist/index.mjs +1649 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +9 -5
  8. package/rollup.config.js +29 -0
  9. package/tsconfig.json +5 -4
  10. package/dist/api/client.d.ts +0 -95
  11. package/dist/api/client.js +0 -251
  12. package/dist/api/components.d.ts +0 -1437
  13. package/dist/api/components.js +0 -998
  14. package/dist/api/fetcher.d.ts +0 -40
  15. package/dist/api/fetcher.js +0 -79
  16. package/dist/api/index.d.ts +0 -13
  17. package/dist/api/index.js +0 -40
  18. package/dist/api/parameters.d.ts +0 -16
  19. package/dist/api/parameters.js +0 -2
  20. package/dist/api/providers.d.ts +0 -8
  21. package/dist/api/providers.js +0 -30
  22. package/dist/api/responses.d.ts +0 -50
  23. package/dist/api/responses.js +0 -2
  24. package/dist/api/schemas.d.ts +0 -311
  25. package/dist/api/schemas.js +0 -2
  26. package/dist/client.d.ts +0 -27
  27. package/dist/client.js +0 -131
  28. package/dist/index.js +0 -30
  29. package/dist/plugins.d.ts +0 -7
  30. package/dist/plugins.js +0 -6
  31. package/dist/schema/filters.d.ts +0 -96
  32. package/dist/schema/filters.js +0 -2
  33. package/dist/schema/filters.spec.d.ts +0 -1
  34. package/dist/schema/filters.spec.js +0 -177
  35. package/dist/schema/index.d.ts +0 -23
  36. package/dist/schema/index.js +0 -50
  37. package/dist/schema/operators.d.ts +0 -74
  38. package/dist/schema/operators.js +0 -93
  39. package/dist/schema/pagination.d.ts +0 -83
  40. package/dist/schema/pagination.js +0 -93
  41. package/dist/schema/query.d.ts +0 -118
  42. package/dist/schema/query.js +0 -242
  43. package/dist/schema/record.d.ts +0 -66
  44. package/dist/schema/record.js +0 -13
  45. package/dist/schema/repository.d.ts +0 -135
  46. package/dist/schema/repository.js +0 -283
  47. package/dist/schema/selection.d.ts +0 -25
  48. package/dist/schema/selection.js +0 -2
  49. package/dist/schema/selection.spec.d.ts +0 -1
  50. package/dist/schema/selection.spec.js +0 -204
  51. package/dist/schema/sorting.d.ts +0 -22
  52. package/dist/schema/sorting.js +0 -35
  53. package/dist/schema/sorting.spec.d.ts +0 -1
  54. package/dist/schema/sorting.spec.js +0 -11
  55. package/dist/search/index.d.ts +0 -34
  56. package/dist/search/index.js +0 -55
  57. package/dist/util/branches.d.ts +0 -5
  58. package/dist/util/branches.js +0 -7
  59. package/dist/util/config.d.ts +0 -11
  60. package/dist/util/config.js +0 -121
  61. package/dist/util/environment.d.ts +0 -5
  62. package/dist/util/environment.js +0 -68
  63. package/dist/util/fetch.d.ts +0 -2
  64. package/dist/util/fetch.js +0 -13
  65. package/dist/util/lang.d.ts +0 -5
  66. package/dist/util/lang.js +0 -22
  67. package/dist/util/types.d.ts +0 -25
  68. package/dist/util/types.js +0 -2
package/dist/index.d.ts CHANGED
@@ -1,10 +1,3249 @@
1
- export declare class XataError extends Error {
1
+ declare type FetchImpl = (url: string, init?: {
2
+ body?: string;
3
+ headers?: Record<string, string>;
4
+ method?: string;
5
+ }) => Promise<{
6
+ ok: boolean;
7
+ status: number;
8
+ json(): Promise<any>;
9
+ }>;
10
+ declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
11
+ declare type FetcherExtraProps = {
12
+ apiUrl: string;
13
+ workspacesApiUrl: string | WorkspaceApiUrlBuilder;
14
+ fetchImpl: FetchImpl;
15
+ apiKey: string;
16
+ };
17
+ declare type ErrorWrapper<TError> = TError | {
18
+ status: 'unknown';
19
+ payload: string;
20
+ };
21
+
22
+ declare abstract class XataPlugin {
23
+ abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
24
+ }
25
+ declare type XataPluginOptions = {
26
+ getFetchProps: () => Promise<FetcherExtraProps>;
27
+ };
28
+
29
+ /**
30
+ * Generated by @openapi-codegen
31
+ *
32
+ * @version 1.0
33
+ */
34
+ declare type User = {
35
+ email: string;
36
+ fullname: string;
37
+ image: string;
38
+ };
39
+ /**
40
+ * @pattern [a-zA-Z0-9_-~:]+
41
+ */
42
+ declare type UserID = string;
43
+ declare type UserWithID = User & {
44
+ id: UserID;
45
+ };
46
+ /**
47
+ * @format date-time
48
+ * @x-go-type string
49
+ */
50
+ declare type DateTime = string;
51
+ /**
52
+ * @pattern [a-zA-Z0-9_\-~]*
53
+ */
54
+ declare type APIKeyName = string;
55
+ /**
56
+ * @pattern ^([a-zA-Z0-9][a-zA-Z0-9_\-~]+-)?[a-zA-Z0-9]{6}
57
+ * @x-go-type auth.WorkspaceID
58
+ */
59
+ declare type WorkspaceID = string;
60
+ /**
61
+ * @x-go-type auth.Role
62
+ */
63
+ declare type Role = 'owner' | 'maintainer';
64
+ declare type WorkspaceMeta = {
65
+ name: string;
66
+ slug: string;
67
+ };
68
+ declare type Workspace = WorkspaceMeta & {
69
+ id: WorkspaceID;
70
+ memberCount: number;
71
+ plan: 'free';
72
+ };
73
+ declare type WorkspaceMember = {
74
+ userId: UserID;
75
+ fullname: string;
76
+ email: string;
77
+ role: Role;
78
+ };
79
+ /**
80
+ * @pattern [a-zA-Z0-9]+
81
+ */
82
+ declare type InviteID = string;
83
+ declare type WorkspaceInvite = {
84
+ inviteId: InviteID;
85
+ email: string;
86
+ expires: string;
87
+ role: Role;
88
+ };
89
+ declare type WorkspaceMembers = {
90
+ members: WorkspaceMember[];
91
+ invites: WorkspaceInvite[];
92
+ };
93
+ /**
94
+ * @pattern ^ik_[a-zA-Z0-9]+
95
+ */
96
+ declare type InviteKey = string;
97
+ declare type ListDatabasesResponse = {
98
+ databases?: {
99
+ name: string;
100
+ displayName: string;
101
+ createdAt: DateTime;
102
+ numberOfBranches: number;
103
+ ui?: {
104
+ color?: string;
105
+ };
106
+ }[];
107
+ };
108
+ declare type ListBranchesResponse = {
109
+ databaseName: string;
110
+ displayName: string;
111
+ branches: Branch[];
112
+ };
113
+ declare type Branch = {
114
+ name: string;
115
+ createdAt: DateTime;
116
+ };
117
+ /**
118
+ * @example {"repository":"github.com/my/repository","branch":"feature-login","stage":"testing","labels":["epic-100"]}
119
+ * @x-go-type xata.BranchMetadata
120
+ */
121
+ declare type BranchMetadata = {
122
+ repository?: string;
123
+ branch?: BranchName;
124
+ stage?: string;
125
+ labels?: string[];
126
+ };
127
+ declare type DBBranch = {
128
+ databaseName: DBName;
129
+ branchName: BranchName;
130
+ createdAt: DateTime;
131
+ id: string;
132
+ version: number;
133
+ lastMigrationID: string;
134
+ metadata?: BranchMetadata;
135
+ startedFrom?: StartedFromMetadata;
136
+ schema: Schema;
137
+ };
138
+ declare type StartedFromMetadata = {
139
+ branchName: BranchName;
140
+ dbBranchID: string;
141
+ migrationID: string;
142
+ };
143
+ /**
144
+ * @x-go-type xata.Schema
145
+ */
146
+ declare type Schema = {
147
+ tables: Table[];
148
+ tablesOrder?: string[];
149
+ };
150
+ declare type Table = {
151
+ id?: string;
152
+ name: TableName;
153
+ columns: Column[];
154
+ revLinks?: RevLink[];
155
+ };
156
+ /**
157
+ * @x-go-type xata.Column
158
+ */
159
+ declare type Column = {
160
+ name: string;
161
+ type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
162
+ link?: {
163
+ table: string;
164
+ };
165
+ columns?: Column[];
166
+ };
167
+ declare type RevLink = {
168
+ linkID: string;
169
+ table: string;
170
+ };
171
+ /**
172
+ * @pattern [a-zA-Z0-9_\-~]+
173
+ */
174
+ declare type BranchName = string;
175
+ /**
176
+ * @pattern [a-zA-Z0-9_\-~]+
177
+ */
178
+ declare type DBName = string;
179
+ /**
180
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
181
+ *
182
+ * @pattern [a-zA-Z0-9_\-~]+:[a-zA-Z0-9_\-~]+
183
+ */
184
+ declare type DBBranchName = string;
185
+ /**
186
+ * @pattern [a-zA-Z0-9_\-~]+
187
+ */
188
+ declare type TableName = string;
189
+ /**
190
+ * @pattern [a-zA-Z0-9_\-~\.]+
191
+ */
192
+ declare type ColumnName = string;
193
+ declare type MetricsDatapoint = {
194
+ timestamp: string;
195
+ value: number;
196
+ };
197
+ declare type MetricsLatency = {
198
+ p50?: MetricsDatapoint[];
199
+ p90?: MetricsDatapoint[];
200
+ };
201
+ declare type BranchMigration = {
202
+ id?: string;
203
+ parentID?: string;
204
+ status: string;
205
+ title?: string;
206
+ lastGitRevision?: string;
207
+ localChanges: boolean;
208
+ createdAt?: DateTime;
209
+ newTables?: {
210
+ [key: string]: Table;
211
+ };
212
+ removedTables?: string[];
213
+ tableMigrations?: {
214
+ [key: string]: TableMigration;
215
+ };
216
+ newTableOrder: string[];
217
+ renamedTables?: TableRename[];
218
+ };
219
+ declare type TableMigration = {
220
+ newColumns?: {
221
+ [key: string]: Column;
222
+ };
223
+ removedColumns?: string[];
224
+ modifiedColumns?: ColumnMigration[];
225
+ newColumnOrder: string[];
226
+ };
227
+ declare type ColumnMigration = {
228
+ old: Column;
229
+ ['new']: Column;
230
+ };
231
+ declare type SortExpression = string[] | {
232
+ [key: string]: SortOrder;
233
+ } | {
234
+ [key: string]: SortOrder;
235
+ }[];
236
+ declare type SortOrder = 'asc' | 'desc';
237
+ /**
238
+ * @minProperties 1
239
+ */
240
+ declare type FilterExpression = {
241
+ $exists?: string;
242
+ $existsNot?: string;
243
+ $any?: FilterList;
244
+ $all?: FilterList;
245
+ $none?: FilterList;
246
+ $not?: FilterList;
247
+ } & {
248
+ [key: string]: FilterColumn;
249
+ };
250
+ declare type FilterList = FilterExpression | FilterExpression[];
251
+ declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
252
+ /**
253
+ * @maxProperties 1
254
+ * @minProperties 1
255
+ */
256
+ declare type FilterColumnIncludes = {
257
+ $includes?: FilterPredicate;
258
+ $includesAny?: FilterPredicate;
259
+ $includesAll?: FilterPredicate;
260
+ $includesNone?: FilterPredicate;
261
+ };
262
+ declare type FilterPredicate = FilterValue | FilterPredicate[] | FilterPredicateOp | FilterPredicateRangeOp;
263
+ /**
264
+ * @maxProperties 1
265
+ * @minProperties 1
266
+ */
267
+ declare type FilterPredicateOp = {
268
+ $any?: FilterPredicate[];
269
+ $all?: FilterPredicate[];
270
+ $none?: FilterPredicate | FilterPredicate[];
271
+ $not?: FilterPredicate | FilterPredicate[];
272
+ $is?: FilterValue | FilterValue[];
273
+ $isNot?: FilterValue | FilterValue[];
274
+ $lt?: FilterRangeValue;
275
+ $le?: FilterRangeValue;
276
+ $gt?: FilterRangeValue;
277
+ $ge?: FilterRangeValue;
278
+ $contains?: string;
279
+ $startsWith?: string;
280
+ $endsWith?: string;
281
+ $pattern?: string;
282
+ };
283
+ /**
284
+ * @maxProperties 2
285
+ * @minProperties 2
286
+ */
287
+ declare type FilterPredicateRangeOp = {
288
+ $lt?: FilterRangeValue;
289
+ $le?: FilterRangeValue;
290
+ $gt?: FilterRangeValue;
291
+ $ge?: FilterRangeValue;
292
+ };
293
+ declare type FilterRangeValue = number | string;
294
+ declare type FilterValue = number | string | boolean;
295
+ /**
296
+ * Pagination settings.
297
+ */
298
+ declare type PageConfig = {
299
+ after?: string;
300
+ before?: string;
301
+ first?: string;
302
+ last?: string;
303
+ size?: number;
304
+ offset?: number;
305
+ };
306
+ declare type ColumnsFilter = string[];
307
+ /**
308
+ * @pattern [a-zA-Z0-9_-~:]+
309
+ */
310
+ declare type RecordID = string;
311
+ /**
312
+ * @example {"newName":"newName","oldName":"oldName"}
313
+ */
314
+ declare type TableRename = {
315
+ newName: string;
316
+ oldName: string;
317
+ };
318
+ /**
319
+ * Records metadata
320
+ */
321
+ declare type RecordsMetadata = {
322
+ page: {
323
+ cursor: string;
324
+ more: boolean;
325
+ };
326
+ };
327
+ /**
328
+ * Xata Table Record
329
+ */
330
+ declare type XataRecord$1 = {
331
+ id: RecordID;
332
+ xata: {
333
+ version: number;
334
+ table?: string;
335
+ warnings?: string[];
336
+ };
337
+ } & {
338
+ [key: string]: any;
339
+ };
340
+
341
+ type schemas_User = User;
342
+ type schemas_UserID = UserID;
343
+ type schemas_UserWithID = UserWithID;
344
+ type schemas_DateTime = DateTime;
345
+ type schemas_APIKeyName = APIKeyName;
346
+ type schemas_WorkspaceID = WorkspaceID;
347
+ type schemas_Role = Role;
348
+ type schemas_WorkspaceMeta = WorkspaceMeta;
349
+ type schemas_Workspace = Workspace;
350
+ type schemas_WorkspaceMember = WorkspaceMember;
351
+ type schemas_InviteID = InviteID;
352
+ type schemas_WorkspaceInvite = WorkspaceInvite;
353
+ type schemas_WorkspaceMembers = WorkspaceMembers;
354
+ type schemas_InviteKey = InviteKey;
355
+ type schemas_ListDatabasesResponse = ListDatabasesResponse;
356
+ type schemas_ListBranchesResponse = ListBranchesResponse;
357
+ type schemas_Branch = Branch;
358
+ type schemas_BranchMetadata = BranchMetadata;
359
+ type schemas_DBBranch = DBBranch;
360
+ type schemas_StartedFromMetadata = StartedFromMetadata;
361
+ type schemas_Schema = Schema;
362
+ type schemas_Table = Table;
363
+ type schemas_Column = Column;
364
+ type schemas_RevLink = RevLink;
365
+ type schemas_BranchName = BranchName;
366
+ type schemas_DBName = DBName;
367
+ type schemas_DBBranchName = DBBranchName;
368
+ type schemas_TableName = TableName;
369
+ type schemas_ColumnName = ColumnName;
370
+ type schemas_MetricsDatapoint = MetricsDatapoint;
371
+ type schemas_MetricsLatency = MetricsLatency;
372
+ type schemas_BranchMigration = BranchMigration;
373
+ type schemas_TableMigration = TableMigration;
374
+ type schemas_ColumnMigration = ColumnMigration;
375
+ type schemas_SortExpression = SortExpression;
376
+ type schemas_SortOrder = SortOrder;
377
+ type schemas_FilterExpression = FilterExpression;
378
+ type schemas_FilterList = FilterList;
379
+ type schemas_FilterColumn = FilterColumn;
380
+ type schemas_FilterColumnIncludes = FilterColumnIncludes;
381
+ type schemas_FilterPredicate = FilterPredicate;
382
+ type schemas_FilterPredicateOp = FilterPredicateOp;
383
+ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
384
+ type schemas_FilterRangeValue = FilterRangeValue;
385
+ type schemas_FilterValue = FilterValue;
386
+ type schemas_PageConfig = PageConfig;
387
+ type schemas_ColumnsFilter = ColumnsFilter;
388
+ type schemas_RecordID = RecordID;
389
+ type schemas_TableRename = TableRename;
390
+ type schemas_RecordsMetadata = RecordsMetadata;
391
+ declare namespace schemas {
392
+ export {
393
+ schemas_User as User,
394
+ schemas_UserID as UserID,
395
+ schemas_UserWithID as UserWithID,
396
+ schemas_DateTime as DateTime,
397
+ schemas_APIKeyName as APIKeyName,
398
+ schemas_WorkspaceID as WorkspaceID,
399
+ schemas_Role as Role,
400
+ schemas_WorkspaceMeta as WorkspaceMeta,
401
+ schemas_Workspace as Workspace,
402
+ schemas_WorkspaceMember as WorkspaceMember,
403
+ schemas_InviteID as InviteID,
404
+ schemas_WorkspaceInvite as WorkspaceInvite,
405
+ schemas_WorkspaceMembers as WorkspaceMembers,
406
+ schemas_InviteKey as InviteKey,
407
+ schemas_ListDatabasesResponse as ListDatabasesResponse,
408
+ schemas_ListBranchesResponse as ListBranchesResponse,
409
+ schemas_Branch as Branch,
410
+ schemas_BranchMetadata as BranchMetadata,
411
+ schemas_DBBranch as DBBranch,
412
+ schemas_StartedFromMetadata as StartedFromMetadata,
413
+ schemas_Schema as Schema,
414
+ schemas_Table as Table,
415
+ schemas_Column as Column,
416
+ schemas_RevLink as RevLink,
417
+ schemas_BranchName as BranchName,
418
+ schemas_DBName as DBName,
419
+ schemas_DBBranchName as DBBranchName,
420
+ schemas_TableName as TableName,
421
+ schemas_ColumnName as ColumnName,
422
+ schemas_MetricsDatapoint as MetricsDatapoint,
423
+ schemas_MetricsLatency as MetricsLatency,
424
+ schemas_BranchMigration as BranchMigration,
425
+ schemas_TableMigration as TableMigration,
426
+ schemas_ColumnMigration as ColumnMigration,
427
+ schemas_SortExpression as SortExpression,
428
+ schemas_SortOrder as SortOrder,
429
+ schemas_FilterExpression as FilterExpression,
430
+ schemas_FilterList as FilterList,
431
+ schemas_FilterColumn as FilterColumn,
432
+ schemas_FilterColumnIncludes as FilterColumnIncludes,
433
+ schemas_FilterPredicate as FilterPredicate,
434
+ schemas_FilterPredicateOp as FilterPredicateOp,
435
+ schemas_FilterPredicateRangeOp as FilterPredicateRangeOp,
436
+ schemas_FilterRangeValue as FilterRangeValue,
437
+ schemas_FilterValue as FilterValue,
438
+ schemas_PageConfig as PageConfig,
439
+ schemas_ColumnsFilter as ColumnsFilter,
440
+ schemas_RecordID as RecordID,
441
+ schemas_TableRename as TableRename,
442
+ schemas_RecordsMetadata as RecordsMetadata,
443
+ XataRecord$1 as XataRecord,
444
+ };
445
+ }
446
+
447
+ /**
448
+ * Generated by @openapi-codegen
449
+ *
450
+ * @version 1.0
451
+ */
452
+
453
+ declare type SimpleError = {
454
+ id?: string;
455
+ message: string;
456
+ };
457
+ declare type BadRequestError = {
458
+ id?: string;
459
+ message: string;
460
+ };
461
+ /**
462
+ * @example {"message":"invalid API key"}
463
+ */
464
+ declare type AuthError = {
465
+ id?: string;
466
+ message: string;
467
+ };
468
+ declare type BulkError = {
469
+ errors: {
470
+ message?: string;
471
+ status?: number;
472
+ }[];
473
+ };
474
+ declare type BranchMigrationPlan = {
475
+ version: number;
476
+ migration: BranchMigration;
477
+ };
478
+ declare type RecordUpdateResponse = {
479
+ id: string;
480
+ xata: {
481
+ version: number;
482
+ };
483
+ };
484
+ declare type QueryResponse = {
485
+ records: XataRecord$1[];
486
+ meta: RecordsMetadata;
487
+ };
488
+ declare type SearchResponse = {
489
+ records: XataRecord$1[];
490
+ };
491
+ /**
492
+ * @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
493
+ */
494
+ declare type MigrationIdResponse = {
495
+ migrationID: string;
496
+ };
497
+
498
+ type responses_SimpleError = SimpleError;
499
+ type responses_BadRequestError = BadRequestError;
500
+ type responses_AuthError = AuthError;
501
+ type responses_BulkError = BulkError;
502
+ type responses_BranchMigrationPlan = BranchMigrationPlan;
503
+ type responses_RecordUpdateResponse = RecordUpdateResponse;
504
+ type responses_QueryResponse = QueryResponse;
505
+ type responses_SearchResponse = SearchResponse;
506
+ type responses_MigrationIdResponse = MigrationIdResponse;
507
+ declare namespace responses {
508
+ export {
509
+ responses_SimpleError as SimpleError,
510
+ responses_BadRequestError as BadRequestError,
511
+ responses_AuthError as AuthError,
512
+ responses_BulkError as BulkError,
513
+ responses_BranchMigrationPlan as BranchMigrationPlan,
514
+ responses_RecordUpdateResponse as RecordUpdateResponse,
515
+ responses_QueryResponse as QueryResponse,
516
+ responses_SearchResponse as SearchResponse,
517
+ responses_MigrationIdResponse as MigrationIdResponse,
518
+ };
519
+ }
520
+
521
+ /**
522
+ * Generated by @openapi-codegen
523
+ *
524
+ * @version 1.0
525
+ */
526
+
527
+ declare type GetUserError = ErrorWrapper<{
528
+ status: 400;
529
+ payload: BadRequestError;
530
+ } | {
531
+ status: 401;
532
+ payload: AuthError;
533
+ } | {
534
+ status: 404;
535
+ payload: SimpleError;
536
+ }>;
537
+ declare type GetUserVariables = FetcherExtraProps;
538
+ /**
539
+ * Return details of the user making the request
540
+ */
541
+ declare const getUser: (variables: GetUserVariables) => Promise<UserWithID>;
542
+ declare type UpdateUserError = ErrorWrapper<{
543
+ status: 400;
544
+ payload: BadRequestError;
545
+ } | {
546
+ status: 401;
547
+ payload: AuthError;
548
+ } | {
549
+ status: 404;
550
+ payload: SimpleError;
551
+ }>;
552
+ declare type UpdateUserVariables = {
553
+ body: User;
554
+ } & FetcherExtraProps;
555
+ /**
556
+ * Update user info
557
+ */
558
+ declare const updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
559
+ declare type DeleteUserError = ErrorWrapper<{
560
+ status: 400;
561
+ payload: BadRequestError;
562
+ } | {
563
+ status: 401;
564
+ payload: AuthError;
565
+ } | {
566
+ status: 404;
567
+ payload: SimpleError;
568
+ }>;
569
+ declare type DeleteUserVariables = FetcherExtraProps;
570
+ /**
571
+ * Delete the user making the request
572
+ */
573
+ declare const deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
574
+ declare type GetUserAPIKeysError = ErrorWrapper<{
575
+ status: 400;
576
+ payload: BadRequestError;
577
+ } | {
578
+ status: 401;
579
+ payload: AuthError;
580
+ } | {
581
+ status: 404;
582
+ payload: SimpleError;
583
+ }>;
584
+ declare type GetUserAPIKeysResponse = {
585
+ keys: {
586
+ name: string;
587
+ createdAt: DateTime;
588
+ }[];
589
+ };
590
+ declare type GetUserAPIKeysVariables = FetcherExtraProps;
591
+ /**
592
+ * Retrieve a list of existing user API keys
593
+ */
594
+ declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
595
+ declare type CreateUserAPIKeyPathParams = {
596
+ keyName: APIKeyName;
597
+ };
598
+ declare type CreateUserAPIKeyError = ErrorWrapper<{
599
+ status: 400;
600
+ payload: BadRequestError;
601
+ } | {
602
+ status: 401;
603
+ payload: AuthError;
604
+ } | {
605
+ status: 404;
606
+ payload: SimpleError;
607
+ }>;
608
+ declare type CreateUserAPIKeyResponse = {
609
+ name: string;
610
+ key: string;
611
+ createdAt: DateTime;
612
+ };
613
+ declare type CreateUserAPIKeyVariables = {
614
+ pathParams: CreateUserAPIKeyPathParams;
615
+ } & FetcherExtraProps;
616
+ /**
617
+ * Create and return new API key
618
+ */
619
+ declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
620
+ declare type DeleteUserAPIKeyPathParams = {
621
+ keyName: APIKeyName;
622
+ };
623
+ declare type DeleteUserAPIKeyError = ErrorWrapper<{
624
+ status: 400;
625
+ payload: BadRequestError;
626
+ } | {
627
+ status: 401;
628
+ payload: AuthError;
629
+ } | {
630
+ status: 404;
631
+ payload: SimpleError;
632
+ }>;
633
+ declare type DeleteUserAPIKeyVariables = {
634
+ pathParams: DeleteUserAPIKeyPathParams;
635
+ } & FetcherExtraProps;
636
+ /**
637
+ * Delete an existing API key
638
+ */
639
+ declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
640
+ declare type CreateWorkspaceError = ErrorWrapper<{
641
+ status: 400;
642
+ payload: BadRequestError;
643
+ } | {
644
+ status: 401;
645
+ payload: AuthError;
646
+ } | {
647
+ status: 404;
648
+ payload: SimpleError;
649
+ }>;
650
+ declare type CreateWorkspaceVariables = {
651
+ body: WorkspaceMeta;
652
+ } & FetcherExtraProps;
653
+ /**
654
+ * Creates a new workspace with the user requesting it as its single owner.
655
+ */
656
+ declare const createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
657
+ declare type GetWorkspacesListError = ErrorWrapper<{
658
+ status: 400;
659
+ payload: BadRequestError;
660
+ } | {
661
+ status: 401;
662
+ payload: AuthError;
663
+ } | {
664
+ status: 404;
665
+ payload: SimpleError;
666
+ }>;
667
+ declare type GetWorkspacesListResponse = {
668
+ workspaces: {
669
+ id: WorkspaceID;
670
+ name: string;
671
+ slug: string;
672
+ role: Role;
673
+ }[];
674
+ };
675
+ declare type GetWorkspacesListVariables = FetcherExtraProps;
676
+ /**
677
+ * Retrieve the list of workspaces the user belongs to
678
+ */
679
+ declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
680
+ declare type GetWorkspacePathParams = {
681
+ workspaceId: WorkspaceID;
682
+ };
683
+ declare type GetWorkspaceError = ErrorWrapper<{
684
+ status: 400;
685
+ payload: BadRequestError;
686
+ } | {
687
+ status: 401;
688
+ payload: AuthError;
689
+ } | {
690
+ status: 404;
691
+ payload: SimpleError;
692
+ }>;
693
+ declare type GetWorkspaceVariables = {
694
+ pathParams: GetWorkspacePathParams;
695
+ } & FetcherExtraProps;
696
+ /**
697
+ * Retrieve workspace info from a workspace ID
698
+ */
699
+ declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
700
+ declare type UpdateWorkspacePathParams = {
701
+ workspaceId: WorkspaceID;
702
+ };
703
+ declare type UpdateWorkspaceError = ErrorWrapper<{
704
+ status: 400;
705
+ payload: BadRequestError;
706
+ } | {
707
+ status: 401;
708
+ payload: AuthError;
709
+ } | {
710
+ status: 404;
711
+ payload: SimpleError;
712
+ }>;
713
+ declare type UpdateWorkspaceVariables = {
714
+ body: WorkspaceMeta;
715
+ pathParams: UpdateWorkspacePathParams;
716
+ } & FetcherExtraProps;
717
+ /**
718
+ * Update workspace info
719
+ */
720
+ declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
721
+ declare type DeleteWorkspacePathParams = {
722
+ workspaceId: WorkspaceID;
723
+ };
724
+ declare type DeleteWorkspaceError = ErrorWrapper<{
725
+ status: 400;
726
+ payload: BadRequestError;
727
+ } | {
728
+ status: 401;
729
+ payload: AuthError;
730
+ } | {
731
+ status: 404;
732
+ payload: SimpleError;
733
+ }>;
734
+ declare type DeleteWorkspaceVariables = {
735
+ pathParams: DeleteWorkspacePathParams;
736
+ } & FetcherExtraProps;
737
+ /**
738
+ * Delete the workspace with the provided ID
739
+ */
740
+ declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
741
+ declare type GetWorkspaceMembersListPathParams = {
742
+ workspaceId: WorkspaceID;
743
+ };
744
+ declare type GetWorkspaceMembersListError = ErrorWrapper<{
745
+ status: 400;
746
+ payload: BadRequestError;
747
+ } | {
748
+ status: 401;
749
+ payload: AuthError;
750
+ } | {
751
+ status: 404;
752
+ payload: SimpleError;
753
+ }>;
754
+ declare type GetWorkspaceMembersListVariables = {
755
+ pathParams: GetWorkspaceMembersListPathParams;
756
+ } & FetcherExtraProps;
757
+ /**
758
+ * Retrieve the list of members of the given workspace
759
+ */
760
+ declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
761
+ declare type UpdateWorkspaceMemberRolePathParams = {
762
+ workspaceId: WorkspaceID;
763
+ userId: UserID;
764
+ };
765
+ declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
766
+ status: 400;
767
+ payload: BadRequestError;
768
+ } | {
769
+ status: 401;
770
+ payload: AuthError;
771
+ } | {
772
+ status: 404;
773
+ payload: SimpleError;
774
+ }>;
775
+ declare type UpdateWorkspaceMemberRoleRequestBody = {
776
+ role: Role;
777
+ };
778
+ declare type UpdateWorkspaceMemberRoleVariables = {
779
+ body: UpdateWorkspaceMemberRoleRequestBody;
780
+ pathParams: UpdateWorkspaceMemberRolePathParams;
781
+ } & FetcherExtraProps;
782
+ /**
783
+ * Update a workspace member role. Workspaces must always have at least one owner, so this operation will fail if trying to remove owner role from the last owner in the workspace.
784
+ */
785
+ declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
786
+ declare type RemoveWorkspaceMemberPathParams = {
787
+ workspaceId: WorkspaceID;
788
+ userId: UserID;
789
+ };
790
+ declare type RemoveWorkspaceMemberError = ErrorWrapper<{
791
+ status: 400;
792
+ payload: BadRequestError;
793
+ } | {
794
+ status: 401;
795
+ payload: AuthError;
796
+ } | {
797
+ status: 404;
798
+ payload: SimpleError;
799
+ }>;
800
+ declare type RemoveWorkspaceMemberVariables = {
801
+ pathParams: RemoveWorkspaceMemberPathParams;
802
+ } & FetcherExtraProps;
803
+ /**
804
+ * Remove the member from the workspace
805
+ */
806
+ declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
807
+ declare type InviteWorkspaceMemberPathParams = {
808
+ workspaceId: WorkspaceID;
809
+ };
810
+ declare type InviteWorkspaceMemberError = ErrorWrapper<{
811
+ status: 400;
812
+ payload: BadRequestError;
813
+ } | {
814
+ status: 401;
815
+ payload: AuthError;
816
+ } | {
817
+ status: 404;
818
+ payload: SimpleError;
819
+ }>;
820
+ declare type InviteWorkspaceMemberRequestBody = {
821
+ email: string;
822
+ role: Role;
823
+ };
824
+ declare type InviteWorkspaceMemberVariables = {
825
+ body: InviteWorkspaceMemberRequestBody;
826
+ pathParams: InviteWorkspaceMemberPathParams;
827
+ } & FetcherExtraProps;
828
+ /**
829
+ * Invite some user to join the workspace with the given role
830
+ */
831
+ declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
832
+ declare type CancelWorkspaceMemberInvitePathParams = {
833
+ workspaceId: WorkspaceID;
834
+ inviteId: InviteID;
835
+ };
836
+ declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
837
+ status: 400;
838
+ payload: BadRequestError;
839
+ } | {
840
+ status: 401;
841
+ payload: AuthError;
842
+ } | {
843
+ status: 404;
844
+ payload: SimpleError;
845
+ }>;
846
+ declare type CancelWorkspaceMemberInviteVariables = {
847
+ pathParams: CancelWorkspaceMemberInvitePathParams;
848
+ } & FetcherExtraProps;
849
+ /**
850
+ * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
851
+ */
852
+ declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
853
+ declare type ResendWorkspaceMemberInvitePathParams = {
854
+ workspaceId: WorkspaceID;
855
+ inviteId: InviteID;
856
+ };
857
+ declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
858
+ status: 400;
859
+ payload: BadRequestError;
860
+ } | {
861
+ status: 401;
862
+ payload: AuthError;
863
+ } | {
864
+ status: 404;
865
+ payload: SimpleError;
866
+ }>;
867
+ declare type ResendWorkspaceMemberInviteVariables = {
868
+ pathParams: ResendWorkspaceMemberInvitePathParams;
869
+ } & FetcherExtraProps;
870
+ /**
871
+ * This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
872
+ */
873
+ declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
874
+ declare type AcceptWorkspaceMemberInvitePathParams = {
875
+ workspaceId: WorkspaceID;
876
+ inviteKey: InviteKey;
877
+ };
878
+ declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
879
+ status: 400;
880
+ payload: BadRequestError;
881
+ } | {
882
+ status: 401;
883
+ payload: AuthError;
884
+ } | {
885
+ status: 404;
886
+ payload: SimpleError;
887
+ }>;
888
+ declare type AcceptWorkspaceMemberInviteVariables = {
889
+ pathParams: AcceptWorkspaceMemberInvitePathParams;
890
+ } & FetcherExtraProps;
891
+ /**
892
+ * Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
893
+ */
894
+ declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
895
+ declare type GetDatabaseListPathParams = {
896
+ workspace: string;
897
+ };
898
+ declare type GetDatabaseListError = ErrorWrapper<{
899
+ status: 400;
900
+ payload: BadRequestError;
901
+ } | {
902
+ status: 401;
903
+ payload: AuthError;
904
+ }>;
905
+ declare type GetDatabaseListVariables = {
906
+ pathParams: GetDatabaseListPathParams;
907
+ } & FetcherExtraProps;
908
+ /**
909
+ * List all databases available in your Workspace.
910
+ */
911
+ declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
912
+ declare type GetBranchListPathParams = {
913
+ dbName: DBName;
914
+ workspace: string;
915
+ };
916
+ declare type GetBranchListError = ErrorWrapper<{
917
+ status: 400;
918
+ payload: BadRequestError;
919
+ } | {
920
+ status: 401;
921
+ payload: AuthError;
922
+ } | {
923
+ status: 404;
924
+ payload: SimpleError;
925
+ }>;
926
+ declare type GetBranchListVariables = {
927
+ pathParams: GetBranchListPathParams;
928
+ } & FetcherExtraProps;
929
+ /**
930
+ * List all available Branches
931
+ */
932
+ declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
933
+ declare type CreateDatabasePathParams = {
934
+ dbName: DBName;
935
+ workspace: string;
936
+ };
937
+ declare type CreateDatabaseError = ErrorWrapper<{
938
+ status: 400;
939
+ payload: BadRequestError;
940
+ } | {
941
+ status: 401;
942
+ payload: AuthError;
943
+ }>;
944
+ declare type CreateDatabaseResponse = {
945
+ databaseName: string;
946
+ branchName?: string;
947
+ };
948
+ declare type CreateDatabaseRequestBody = {
949
+ displayName?: string;
950
+ branchName?: string;
951
+ ui?: {
952
+ color?: string;
953
+ };
954
+ metadata?: BranchMetadata;
955
+ };
956
+ declare type CreateDatabaseVariables = {
957
+ body?: CreateDatabaseRequestBody;
958
+ pathParams: CreateDatabasePathParams;
959
+ } & FetcherExtraProps;
960
+ /**
961
+ * Create Database with identifier name
962
+ */
963
+ declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
964
+ declare type DeleteDatabasePathParams = {
965
+ dbName: DBName;
966
+ workspace: string;
967
+ };
968
+ declare type DeleteDatabaseError = ErrorWrapper<{
969
+ status: 400;
970
+ payload: BadRequestError;
971
+ } | {
972
+ status: 401;
973
+ payload: AuthError;
974
+ } | {
975
+ status: 404;
976
+ payload: SimpleError;
977
+ }>;
978
+ declare type DeleteDatabaseVariables = {
979
+ pathParams: DeleteDatabasePathParams;
980
+ } & FetcherExtraProps;
981
+ /**
982
+ * Delete a database and all of its branches and tables permanently.
983
+ */
984
+ declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
985
+ declare type GetBranchDetailsPathParams = {
986
+ dbBranchName: DBBranchName;
987
+ workspace: string;
988
+ };
989
+ declare type GetBranchDetailsError = ErrorWrapper<{
990
+ status: 400;
991
+ payload: BadRequestError;
992
+ } | {
993
+ status: 401;
994
+ payload: AuthError;
995
+ } | {
996
+ status: 404;
997
+ payload: SimpleError;
998
+ }>;
999
+ declare type GetBranchDetailsVariables = {
1000
+ pathParams: GetBranchDetailsPathParams;
1001
+ } & FetcherExtraProps;
1002
+ declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
1003
+ declare type CreateBranchPathParams = {
1004
+ dbBranchName: DBBranchName;
1005
+ workspace: string;
1006
+ };
1007
+ declare type CreateBranchQueryParams = {
1008
+ from?: string;
1009
+ };
1010
+ declare type CreateBranchError = ErrorWrapper<{
1011
+ status: 400;
1012
+ payload: BadRequestError;
1013
+ } | {
1014
+ status: 401;
1015
+ payload: AuthError;
1016
+ } | {
1017
+ status: 404;
1018
+ payload: SimpleError;
1019
+ }>;
1020
+ declare type CreateBranchRequestBody = {
1021
+ from?: string;
1022
+ metadata?: BranchMetadata;
1023
+ };
1024
+ declare type CreateBranchVariables = {
1025
+ body?: CreateBranchRequestBody;
1026
+ pathParams: CreateBranchPathParams;
1027
+ queryParams?: CreateBranchQueryParams;
1028
+ } & FetcherExtraProps;
1029
+ declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
1030
+ declare type DeleteBranchPathParams = {
1031
+ dbBranchName: DBBranchName;
1032
+ workspace: string;
1033
+ };
1034
+ declare type DeleteBranchError = ErrorWrapper<{
1035
+ status: 400;
1036
+ payload: BadRequestError;
1037
+ } | {
1038
+ status: 401;
1039
+ payload: AuthError;
1040
+ } | {
1041
+ status: 404;
1042
+ payload: SimpleError;
1043
+ }>;
1044
+ declare type DeleteBranchVariables = {
1045
+ pathParams: DeleteBranchPathParams;
1046
+ } & FetcherExtraProps;
1047
+ /**
1048
+ * Delete the branch in the database and all its resources
1049
+ */
1050
+ declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1051
+ declare type UpdateBranchMetadataPathParams = {
1052
+ dbBranchName: DBBranchName;
1053
+ workspace: string;
1054
+ };
1055
+ declare type UpdateBranchMetadataError = ErrorWrapper<{
1056
+ status: 400;
1057
+ payload: BadRequestError;
1058
+ } | {
1059
+ status: 401;
1060
+ payload: AuthError;
1061
+ } | {
1062
+ status: 404;
1063
+ payload: SimpleError;
1064
+ }>;
1065
+ declare type UpdateBranchMetadataVariables = {
1066
+ body?: BranchMetadata;
1067
+ pathParams: UpdateBranchMetadataPathParams;
1068
+ } & FetcherExtraProps;
1069
+ /**
1070
+ * Update the branch metadata
1071
+ */
1072
+ declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1073
+ declare type GetBranchMetadataPathParams = {
1074
+ dbBranchName: DBBranchName;
1075
+ workspace: string;
1076
+ };
1077
+ declare type GetBranchMetadataError = ErrorWrapper<{
1078
+ status: 400;
1079
+ payload: BadRequestError;
1080
+ } | {
1081
+ status: 401;
1082
+ payload: AuthError;
1083
+ } | {
1084
+ status: 404;
1085
+ payload: SimpleError;
1086
+ }>;
1087
+ declare type GetBranchMetadataVariables = {
1088
+ pathParams: GetBranchMetadataPathParams;
1089
+ } & FetcherExtraProps;
1090
+ declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
1091
+ declare type GetBranchMigrationHistoryPathParams = {
1092
+ dbBranchName: DBBranchName;
1093
+ workspace: string;
1094
+ };
1095
+ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
1096
+ status: 400;
1097
+ payload: BadRequestError;
1098
+ } | {
1099
+ status: 401;
1100
+ payload: AuthError;
1101
+ } | {
1102
+ status: 404;
1103
+ payload: SimpleError;
1104
+ }>;
1105
+ declare type GetBranchMigrationHistoryResponse = {
1106
+ startedFrom?: StartedFromMetadata;
1107
+ migrations?: BranchMigration[];
1108
+ };
1109
+ declare type GetBranchMigrationHistoryRequestBody = {
1110
+ limit?: number;
1111
+ startFrom?: string;
1112
+ };
1113
+ declare type GetBranchMigrationHistoryVariables = {
1114
+ body?: GetBranchMigrationHistoryRequestBody;
1115
+ pathParams: GetBranchMigrationHistoryPathParams;
1116
+ } & FetcherExtraProps;
1117
+ declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1118
+ declare type ExecuteBranchMigrationPlanPathParams = {
1119
+ dbBranchName: DBBranchName;
1120
+ workspace: string;
1121
+ };
1122
+ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
1123
+ status: 400;
1124
+ payload: BadRequestError;
1125
+ } | {
1126
+ status: 401;
1127
+ payload: AuthError;
1128
+ } | {
1129
+ status: 404;
1130
+ payload: SimpleError;
1131
+ }>;
1132
+ declare type ExecuteBranchMigrationPlanRequestBody = {
1133
+ version: number;
1134
+ migration: BranchMigration;
1135
+ };
1136
+ declare type ExecuteBranchMigrationPlanVariables = {
1137
+ body: ExecuteBranchMigrationPlanRequestBody;
1138
+ pathParams: ExecuteBranchMigrationPlanPathParams;
1139
+ } & FetcherExtraProps;
1140
+ /**
1141
+ * Apply a migration plan to the branch
1142
+ */
1143
+ declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
1144
+ declare type GetBranchMigrationPlanPathParams = {
1145
+ dbBranchName: DBBranchName;
1146
+ workspace: string;
1147
+ };
1148
+ declare type GetBranchMigrationPlanError = ErrorWrapper<{
1149
+ status: 400;
1150
+ payload: BadRequestError;
1151
+ } | {
1152
+ status: 401;
1153
+ payload: AuthError;
1154
+ } | {
1155
+ status: 404;
1156
+ payload: SimpleError;
1157
+ }>;
1158
+ declare type GetBranchMigrationPlanVariables = {
1159
+ body: Schema;
1160
+ pathParams: GetBranchMigrationPlanPathParams;
1161
+ } & FetcherExtraProps;
1162
+ /**
1163
+ * Compute a migration plan from a target schema the branch should be migrated too.
1164
+ */
1165
+ declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
1166
+ declare type GetBranchStatsPathParams = {
1167
+ dbBranchName: DBBranchName;
1168
+ workspace: string;
1169
+ };
1170
+ declare type GetBranchStatsError = ErrorWrapper<{
1171
+ status: 400;
1172
+ payload: SimpleError;
1173
+ } | {
1174
+ status: 401;
1175
+ payload: AuthError;
1176
+ } | {
1177
+ status: 404;
1178
+ payload: SimpleError;
1179
+ }>;
1180
+ declare type GetBranchStatsResponse = {
1181
+ timestamp: string;
1182
+ interval: string;
1183
+ resolution: string;
1184
+ numberOfRecords?: MetricsDatapoint[];
1185
+ writesOverTime?: MetricsDatapoint[];
1186
+ readsOverTime?: MetricsDatapoint[];
1187
+ readLatency?: MetricsLatency;
1188
+ writeLatency?: MetricsLatency;
1189
+ warning?: string;
1190
+ };
1191
+ declare type GetBranchStatsVariables = {
1192
+ pathParams: GetBranchStatsPathParams;
1193
+ } & FetcherExtraProps;
1194
+ /**
1195
+ * Get branch usage metrics.
1196
+ */
1197
+ declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
1198
+ declare type CreateTablePathParams = {
1199
+ dbBranchName: DBBranchName;
1200
+ tableName: TableName;
1201
+ workspace: string;
1202
+ };
1203
+ declare type CreateTableError = ErrorWrapper<{
1204
+ status: 400;
1205
+ payload: BadRequestError;
1206
+ } | {
1207
+ status: 401;
1208
+ payload: AuthError;
1209
+ } | {
1210
+ status: 404;
1211
+ payload: SimpleError;
1212
+ } | {
1213
+ status: 422;
1214
+ payload: SimpleError;
1215
+ }>;
1216
+ declare type CreateTableVariables = {
1217
+ pathParams: CreateTablePathParams;
1218
+ } & FetcherExtraProps;
1219
+ /**
1220
+ * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1221
+ */
1222
+ declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
1223
+ declare type DeleteTablePathParams = {
1224
+ dbBranchName: DBBranchName;
1225
+ tableName: TableName;
1226
+ workspace: string;
1227
+ };
1228
+ declare type DeleteTableError = ErrorWrapper<{
1229
+ status: 400;
1230
+ payload: BadRequestError;
1231
+ } | {
1232
+ status: 401;
1233
+ payload: AuthError;
1234
+ }>;
1235
+ declare type DeleteTableVariables = {
1236
+ pathParams: DeleteTablePathParams;
1237
+ } & FetcherExtraProps;
1238
+ /**
1239
+ * Deletes the table with the given name.
1240
+ */
1241
+ declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
1242
+ declare type UpdateTablePathParams = {
1243
+ dbBranchName: DBBranchName;
1244
+ tableName: TableName;
1245
+ workspace: string;
1246
+ };
1247
+ declare type UpdateTableError = ErrorWrapper<{
1248
+ status: 400;
1249
+ payload: BadRequestError;
1250
+ } | {
1251
+ status: 401;
1252
+ payload: AuthError;
1253
+ } | {
1254
+ status: 404;
1255
+ payload: SimpleError;
1256
+ }>;
1257
+ declare type UpdateTableRequestBody = {
1258
+ name: string;
1259
+ };
1260
+ declare type UpdateTableVariables = {
1261
+ body: UpdateTableRequestBody;
1262
+ pathParams: UpdateTablePathParams;
1263
+ } & FetcherExtraProps;
1264
+ /**
1265
+ * Update table. Currently there is only one update operation supported: renaming the table by providing a new name.
1266
+ *
1267
+ * In the example below, we rename a table from “users” to “people”:
1268
+ *
1269
+ * ```jsx
1270
+ * PATCH /db/test:main/tables/users
1271
+ * {
1272
+ * "name": "people"
1273
+ * }
1274
+ * ```
1275
+ */
1276
+ declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
1277
+ declare type GetTableSchemaPathParams = {
1278
+ dbBranchName: DBBranchName;
1279
+ tableName: TableName;
1280
+ workspace: string;
1281
+ };
1282
+ declare type GetTableSchemaError = ErrorWrapper<{
1283
+ status: 400;
1284
+ payload: BadRequestError;
1285
+ } | {
1286
+ status: 401;
1287
+ payload: AuthError;
1288
+ } | {
1289
+ status: 404;
1290
+ payload: SimpleError;
1291
+ }>;
1292
+ declare type GetTableSchemaResponse = {
1293
+ columns: Column[];
1294
+ };
1295
+ declare type GetTableSchemaVariables = {
1296
+ pathParams: GetTableSchemaPathParams;
1297
+ } & FetcherExtraProps;
1298
+ declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
1299
+ declare type SetTableSchemaPathParams = {
1300
+ dbBranchName: DBBranchName;
1301
+ tableName: TableName;
1302
+ workspace: string;
1303
+ };
1304
+ declare type SetTableSchemaError = ErrorWrapper<{
1305
+ status: 400;
1306
+ payload: BadRequestError;
1307
+ } | {
1308
+ status: 401;
1309
+ payload: AuthError;
1310
+ } | {
1311
+ status: 404;
1312
+ payload: SimpleError;
1313
+ } | {
1314
+ status: 409;
1315
+ payload: SimpleError;
1316
+ }>;
1317
+ declare type SetTableSchemaRequestBody = {
1318
+ columns: Column[];
1319
+ };
1320
+ declare type SetTableSchemaVariables = {
1321
+ body: SetTableSchemaRequestBody;
1322
+ pathParams: SetTableSchemaPathParams;
1323
+ } & FetcherExtraProps;
1324
+ declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
1325
+ declare type GetTableColumnsPathParams = {
1326
+ dbBranchName: DBBranchName;
1327
+ tableName: TableName;
1328
+ workspace: string;
1329
+ };
1330
+ declare type GetTableColumnsError = ErrorWrapper<{
1331
+ status: 400;
1332
+ payload: BadRequestError;
1333
+ } | {
1334
+ status: 401;
1335
+ payload: AuthError;
1336
+ } | {
1337
+ status: 404;
1338
+ payload: SimpleError;
1339
+ }>;
1340
+ declare type GetTableColumnsResponse = {
1341
+ columns: Column[];
1342
+ };
1343
+ declare type GetTableColumnsVariables = {
1344
+ pathParams: GetTableColumnsPathParams;
1345
+ } & FetcherExtraProps;
1346
+ /**
1347
+ * Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
1348
+ * full dot-separated path (flattened).
1349
+ */
1350
+ declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
1351
+ declare type AddTableColumnPathParams = {
1352
+ dbBranchName: DBBranchName;
1353
+ tableName: TableName;
1354
+ workspace: string;
1355
+ };
1356
+ declare type AddTableColumnError = ErrorWrapper<{
1357
+ status: 400;
1358
+ payload: BadRequestError;
1359
+ } | {
1360
+ status: 401;
1361
+ payload: AuthError;
1362
+ } | {
1363
+ status: 404;
1364
+ payload: SimpleError;
1365
+ }>;
1366
+ declare type AddTableColumnVariables = {
1367
+ body: Column;
1368
+ pathParams: AddTableColumnPathParams;
1369
+ } & FetcherExtraProps;
1370
+ /**
1371
+ * Adds a new column to the table. The body of the request should contain the column definition. In the column definition, the 'name' field should
1372
+ * contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
1373
+ * passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
1374
+ */
1375
+ declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
1376
+ declare type GetColumnPathParams = {
1377
+ dbBranchName: DBBranchName;
1378
+ tableName: TableName;
1379
+ columnName: ColumnName;
1380
+ workspace: string;
1381
+ };
1382
+ declare type GetColumnError = ErrorWrapper<{
1383
+ status: 400;
1384
+ payload: BadRequestError;
1385
+ } | {
1386
+ status: 401;
1387
+ payload: AuthError;
1388
+ } | {
1389
+ status: 404;
1390
+ payload: SimpleError;
1391
+ }>;
1392
+ declare type GetColumnVariables = {
1393
+ pathParams: GetColumnPathParams;
1394
+ } & FetcherExtraProps;
1395
+ /**
1396
+ * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1397
+ */
1398
+ declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
1399
+ declare type DeleteColumnPathParams = {
1400
+ dbBranchName: DBBranchName;
1401
+ tableName: TableName;
1402
+ columnName: ColumnName;
1403
+ workspace: string;
1404
+ };
1405
+ declare type DeleteColumnError = ErrorWrapper<{
1406
+ status: 400;
1407
+ payload: BadRequestError;
1408
+ } | {
1409
+ status: 401;
1410
+ payload: AuthError;
1411
+ } | {
1412
+ status: 404;
1413
+ payload: SimpleError;
1414
+ }>;
1415
+ declare type DeleteColumnVariables = {
1416
+ pathParams: DeleteColumnPathParams;
1417
+ } & FetcherExtraProps;
1418
+ /**
1419
+ * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1420
+ */
1421
+ declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
1422
+ declare type UpdateColumnPathParams = {
1423
+ dbBranchName: DBBranchName;
1424
+ tableName: TableName;
1425
+ columnName: ColumnName;
1426
+ workspace: string;
1427
+ };
1428
+ declare type UpdateColumnError = ErrorWrapper<{
1429
+ status: 400;
1430
+ payload: BadRequestError;
1431
+ } | {
1432
+ status: 401;
1433
+ payload: AuthError;
1434
+ } | {
1435
+ status: 404;
1436
+ payload: SimpleError;
1437
+ }>;
1438
+ declare type UpdateColumnRequestBody = {
1439
+ name: string;
1440
+ };
1441
+ declare type UpdateColumnVariables = {
1442
+ body: UpdateColumnRequestBody;
1443
+ pathParams: UpdateColumnPathParams;
1444
+ } & FetcherExtraProps;
1445
+ /**
1446
+ * Update column with partial data. Can be used for renaming the column by providing a new "name" field. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1447
+ */
1448
+ declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
1449
+ declare type InsertRecordPathParams = {
1450
+ dbBranchName: DBBranchName;
1451
+ tableName: TableName;
1452
+ workspace: string;
1453
+ };
1454
+ declare type InsertRecordError = ErrorWrapper<{
1455
+ status: 400;
1456
+ payload: BadRequestError;
1457
+ } | {
1458
+ status: 401;
1459
+ payload: AuthError;
1460
+ } | {
1461
+ status: 404;
1462
+ payload: SimpleError;
1463
+ }>;
1464
+ declare type InsertRecordResponse = {
1465
+ id: string;
1466
+ xata: {
1467
+ version: number;
1468
+ };
1469
+ };
1470
+ declare type InsertRecordVariables = {
1471
+ body?: Record<string, any>;
1472
+ pathParams: InsertRecordPathParams;
1473
+ } & FetcherExtraProps;
1474
+ /**
1475
+ * Insert a new Record into the Table
1476
+ */
1477
+ declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
1478
+ declare type InsertRecordWithIDPathParams = {
1479
+ dbBranchName: DBBranchName;
1480
+ tableName: TableName;
1481
+ recordId: RecordID;
1482
+ workspace: string;
1483
+ };
1484
+ declare type InsertRecordWithIDQueryParams = {
1485
+ createOnly?: boolean;
1486
+ ifVersion?: number;
1487
+ };
1488
+ declare type InsertRecordWithIDError = ErrorWrapper<{
1489
+ status: 400;
1490
+ payload: BadRequestError;
1491
+ } | {
1492
+ status: 401;
1493
+ payload: AuthError;
1494
+ } | {
1495
+ status: 404;
1496
+ payload: SimpleError;
1497
+ } | {
1498
+ status: 422;
1499
+ payload: SimpleError;
1500
+ }>;
1501
+ declare type InsertRecordWithIDVariables = {
1502
+ body?: Record<string, any>;
1503
+ pathParams: InsertRecordWithIDPathParams;
1504
+ queryParams?: InsertRecordWithIDQueryParams;
1505
+ } & FetcherExtraProps;
1506
+ /**
1507
+ * By default, IDs are auto-generated when data is insterted into Xata. Sending a request to this endpoint allows us to insert a record with a pre-existing ID, bypassing the default automatic ID generation.
1508
+ */
1509
+ declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
1510
+ declare type UpdateRecordWithIDPathParams = {
1511
+ dbBranchName: DBBranchName;
1512
+ tableName: TableName;
1513
+ recordId: RecordID;
1514
+ workspace: string;
1515
+ };
1516
+ declare type UpdateRecordWithIDQueryParams = {
1517
+ ifVersion?: number;
1518
+ };
1519
+ declare type UpdateRecordWithIDError = ErrorWrapper<{
1520
+ status: 400;
1521
+ payload: BadRequestError;
1522
+ } | {
1523
+ status: 401;
1524
+ payload: AuthError;
1525
+ } | {
1526
+ status: 404;
1527
+ payload: SimpleError;
1528
+ } | {
1529
+ status: 422;
1530
+ payload: SimpleError;
1531
+ }>;
1532
+ declare type UpdateRecordWithIDVariables = {
1533
+ body?: Record<string, any>;
1534
+ pathParams: UpdateRecordWithIDPathParams;
1535
+ queryParams?: UpdateRecordWithIDQueryParams;
1536
+ } & FetcherExtraProps;
1537
+ declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
1538
+ declare type UpsertRecordWithIDPathParams = {
1539
+ dbBranchName: DBBranchName;
1540
+ tableName: TableName;
1541
+ recordId: RecordID;
1542
+ workspace: string;
1543
+ };
1544
+ declare type UpsertRecordWithIDQueryParams = {
1545
+ ifVersion?: number;
1546
+ };
1547
+ declare type UpsertRecordWithIDError = ErrorWrapper<{
1548
+ status: 400;
1549
+ payload: BadRequestError;
1550
+ } | {
1551
+ status: 401;
1552
+ payload: AuthError;
1553
+ } | {
1554
+ status: 404;
1555
+ payload: SimpleError;
1556
+ } | {
1557
+ status: 422;
1558
+ payload: SimpleError;
1559
+ }>;
1560
+ declare type UpsertRecordWithIDVariables = {
1561
+ body?: Record<string, any>;
1562
+ pathParams: UpsertRecordWithIDPathParams;
1563
+ queryParams?: UpsertRecordWithIDQueryParams;
1564
+ } & FetcherExtraProps;
1565
+ declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
1566
+ declare type DeleteRecordPathParams = {
1567
+ dbBranchName: DBBranchName;
1568
+ tableName: TableName;
1569
+ recordId: RecordID;
1570
+ workspace: string;
1571
+ };
1572
+ declare type DeleteRecordError = ErrorWrapper<{
1573
+ status: 400;
1574
+ payload: BadRequestError;
1575
+ } | {
1576
+ status: 401;
1577
+ payload: AuthError;
1578
+ } | {
1579
+ status: 404;
1580
+ payload: SimpleError;
1581
+ }>;
1582
+ declare type DeleteRecordVariables = {
1583
+ pathParams: DeleteRecordPathParams;
1584
+ } & FetcherExtraProps;
1585
+ declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
1586
+ declare type GetRecordPathParams = {
1587
+ dbBranchName: DBBranchName;
1588
+ tableName: TableName;
1589
+ recordId: RecordID;
1590
+ workspace: string;
1591
+ };
1592
+ declare type GetRecordError = ErrorWrapper<{
1593
+ status: 400;
1594
+ payload: BadRequestError;
1595
+ } | {
1596
+ status: 401;
1597
+ payload: AuthError;
1598
+ } | {
1599
+ status: 404;
1600
+ payload: SimpleError;
1601
+ }>;
1602
+ declare type GetRecordRequestBody = {
1603
+ columns?: ColumnsFilter;
1604
+ };
1605
+ declare type GetRecordVariables = {
1606
+ body?: GetRecordRequestBody;
1607
+ pathParams: GetRecordPathParams;
1608
+ } & FetcherExtraProps;
1609
+ /**
1610
+ * Retrieve record by ID
1611
+ */
1612
+ declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
1613
+ declare type BulkInsertTableRecordsPathParams = {
1614
+ dbBranchName: DBBranchName;
1615
+ tableName: TableName;
1616
+ workspace: string;
1617
+ };
1618
+ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1619
+ status: 400;
1620
+ payload: BulkError;
1621
+ } | {
1622
+ status: 401;
1623
+ payload: AuthError;
1624
+ } | {
1625
+ status: 404;
1626
+ payload: SimpleError;
1627
+ }>;
1628
+ declare type BulkInsertTableRecordsResponse = {
1629
+ recordIDs: string[];
1630
+ };
1631
+ declare type BulkInsertTableRecordsRequestBody = {
1632
+ records: Record<string, any>[];
1633
+ };
1634
+ declare type BulkInsertTableRecordsVariables = {
1635
+ body: BulkInsertTableRecordsRequestBody;
1636
+ pathParams: BulkInsertTableRecordsPathParams;
1637
+ } & FetcherExtraProps;
1638
+ /**
1639
+ * Bulk insert records
1640
+ */
1641
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
1642
+ declare type QueryTablePathParams = {
1643
+ dbBranchName: DBBranchName;
1644
+ tableName: TableName;
1645
+ workspace: string;
1646
+ };
1647
+ declare type QueryTableError = ErrorWrapper<{
1648
+ status: 400;
1649
+ payload: BadRequestError;
1650
+ } | {
1651
+ status: 401;
1652
+ payload: AuthError;
1653
+ } | {
1654
+ status: 404;
1655
+ payload: SimpleError;
1656
+ }>;
1657
+ declare type QueryTableRequestBody = {
1658
+ filter?: FilterExpression;
1659
+ sort?: SortExpression;
1660
+ page?: PageConfig;
1661
+ columns?: ColumnsFilter;
1662
+ };
1663
+ declare type QueryTableVariables = {
1664
+ body?: QueryTableRequestBody;
1665
+ pathParams: QueryTablePathParams;
1666
+ } & FetcherExtraProps;
1667
+ /**
1668
+ * The Query Table API can be used to retrieve all records in a table.
1669
+ * The API support filtering, sorting, selecting a subset of columns, and pagination.
1670
+ *
1671
+ * The overall structure of the request looks like this:
1672
+ *
1673
+ * ```json
1674
+ * // POST /db/<dbname>:<branch>/tables/<table>/query
1675
+ * {
1676
+ * "columns": [...],
1677
+ * "filter": {
1678
+ * "$all": [...]
1679
+ * "$any": [...]
1680
+ * ...
1681
+ * },
1682
+ * "sort": {
1683
+ * "multiple": [...]
1684
+ * ...
1685
+ * },
1686
+ * "page": {
1687
+ * ...
1688
+ * }
1689
+ * }
1690
+ * ```
1691
+ *
1692
+ * ### Column selection
1693
+ *
1694
+ * If the `columns` array is not specified, all columns are included. For link
1695
+ * fields, only the ID column of the linked records is included in the response.
1696
+ *
1697
+ * If the `columns` array is specified, only the selected columns are included.
1698
+ * The `*` wildcard can be used to select all columns of the given array
1699
+ *
1700
+ * For objects and link fields, if the column name of the object is specified, we
1701
+ * include all of its sub-keys. If only some sub-keys are specified (via dotted
1702
+ * notation, e.g. `"settings.plan"` ), then only those sub-keys from the object
1703
+ * are included.
1704
+ *
1705
+ * By the way of example, assuming two tables like this:
1706
+ *
1707
+ * ```json {"truncate": true}
1708
+ * {
1709
+ * "formatVersion": "1.0",
1710
+ * "tables": [
1711
+ * {
1712
+ * "name": "teams",
1713
+ * "columns": [
1714
+ * {
1715
+ * "name": "name",
1716
+ * "type": "string"
1717
+ * },
1718
+ * {
1719
+ * "name": "owner",
1720
+ * "type": "link",
1721
+ * "link": {
1722
+ * "table": "users"
1723
+ * }
1724
+ * }
1725
+ * ]
1726
+ * },
1727
+ * {
1728
+ * "name": "users",
1729
+ * "columns": [
1730
+ * {
1731
+ * "name": "email",
1732
+ * "type": "email"
1733
+ * },
1734
+ * {
1735
+ * "name": "full_name",
1736
+ * "type": "string"
1737
+ * },
1738
+ * {
1739
+ * "name": "address",
1740
+ * "type": "object",
1741
+ * "columns": [
1742
+ * {
1743
+ * "name": "street",
1744
+ * "type": "string"
1745
+ * },
1746
+ * {
1747
+ * "name": "number",
1748
+ * "type": "int"
1749
+ * },
1750
+ * {
1751
+ * "name": "zipcode",
1752
+ * "type": "int"
1753
+ * }
1754
+ * ]
1755
+ * },
1756
+ * {
1757
+ * "name": "team",
1758
+ * "type": "link",
1759
+ * "link": {
1760
+ * "table": "teams"
1761
+ * }
1762
+ * }
1763
+ * ]
1764
+ * }
1765
+ * ]
1766
+ * }
1767
+ * ```
1768
+ *
1769
+ * A query like this:
1770
+ *
1771
+ * ```json
1772
+ * POST /db/<dbname>:<branch>/tables/<table>/query
1773
+ * {
1774
+ * "columns": [
1775
+ * "name",
1776
+ * "address.*"
1777
+ * ]
1778
+ * }
1779
+ * ```
1780
+ *
1781
+ * returns objects like:
1782
+ *
1783
+ * ```json
1784
+ * {
1785
+ * "name": "Kilian",
1786
+ * "address": {
1787
+ * "street": "New street",
1788
+ * "number": 41,
1789
+ * "zipcode": 10407
1790
+ * }
1791
+ * }
1792
+ * ```
1793
+ *
1794
+ * while a query like this:
1795
+ *
1796
+ * ```json
1797
+ * POST /db/<dbname>:<branch>/tables/<table>/query
1798
+ * {
1799
+ * "columns": [
1800
+ * "name",
1801
+ * "address.street"
1802
+ * ]
1803
+ * }
1804
+ * ```
1805
+ *
1806
+ * returns objects like:
1807
+ *
1808
+ * ```json
1809
+ * {
1810
+ * "name": "Kilian",
1811
+ * "address": {
1812
+ * "street": "New street",
1813
+ * }
1814
+ * }
1815
+ * ```
1816
+ *
1817
+ * If you want to return all columns from the main table and selected columns from the linked table, you can do it like this:
1818
+ *
1819
+ * ```json
1820
+ * {
1821
+ * "columns": [
1822
+ * "*",
1823
+ * "team.name"
1824
+ * ]
1825
+ * }
1826
+ * ```
1827
+ *
1828
+ * The `"*"` in the above means all columns, including columns of objects. This returns data like:
1829
+ *
1830
+ * ```json
1831
+ * {
1832
+ * "name": "Kilian",
1833
+ * "email": "kilian@gmail.com",
1834
+ * "address": {
1835
+ * "street": "New street",
1836
+ * "number": 41,
1837
+ * "zipcode": 10407
1838
+ * },
1839
+ * "team": {
1840
+ * "id": "XX",
1841
+ * "xata": {
1842
+ * "version": 0,
1843
+ * },
1844
+ * "name": "first team"
1845
+ * }
1846
+ * }
1847
+ * ```
1848
+ *
1849
+ * If you want all columns of the linked table, you can do:
1850
+ *
1851
+ * ```json
1852
+ * {
1853
+ * "columns": [
1854
+ * "*",
1855
+ * "team.*"
1856
+ * ]
1857
+ * }
1858
+ * ```
1859
+ *
1860
+ * This returns, for example:
1861
+ *
1862
+ * ```json
1863
+ * {
1864
+ * "name": "Kilian",
1865
+ * "email": "kilian@gmail.com",
1866
+ * "address": {
1867
+ * "street": "New street",
1868
+ * "number": 41,
1869
+ * "zipcode": 10407
1870
+ * },
1871
+ * "team": {
1872
+ * "id": "XX",
1873
+ * "xata": {
1874
+ * "version": 0,
1875
+ * },
1876
+ * "name": "first team",
1877
+ * "code": "A1"
1878
+ * }
1879
+ * }
1880
+ * ```
1881
+ *
1882
+ * ### Filtering
1883
+ *
1884
+ * There are two types of operators:
1885
+ *
1886
+ * - Operators that work on a single column: `$is`, `$contains`, `$pattern`,
1887
+ * `$includes`, `$gt`, etc.
1888
+ * - Control operators that combine multiple conditions: `$any`, `$all`, `$not` ,
1889
+ * `$none`, etc.
1890
+ *
1891
+ * All operators start with an `$` to differentiate them from column names
1892
+ * (which are not allowed to start with an dollar sign).
1893
+ *
1894
+ * #### Exact matching and control operators
1895
+ *
1896
+ * Filter by one column:
1897
+ *
1898
+ * ```json
1899
+ * {
1900
+ * "filter": {
1901
+ * "<column_name>": "value"
1902
+ * }
1903
+ * }
1904
+ * ```
1905
+ *
1906
+ * This is equivalent to using the `$is` operator:
1907
+ *
1908
+ * ```json
1909
+ * {
1910
+ * "filter": {
1911
+ * "<column_name>": {
1912
+ * "$is": "value"
1913
+ * }
1914
+ * }
1915
+ * }
1916
+ * ```
1917
+ *
1918
+ * For example:
1919
+ *
1920
+ * ```json
1921
+ * {
1922
+ * "filter": {
1923
+ * "name": "r2",
1924
+ * }
1925
+ * }
1926
+ * ```
1927
+ *
1928
+ * Or:
1929
+ *
1930
+ * ```json
1931
+ * {
1932
+ * "filter": {
1933
+ * "name": {
1934
+ * "$is": "r2"
1935
+ * }
1936
+ * }
1937
+ * }
1938
+ * ```
1939
+ *
1940
+ * For objects, both dots and nested versions work:
1941
+ *
1942
+ * ```json
1943
+ * {
1944
+ * "filter": {
1945
+ * "settings.plan": "free",
1946
+ * }
1947
+ * }
1948
+ * ```
1949
+ *
1950
+ * ```json
1951
+ * {
1952
+ * "filter": {
1953
+ * "settings": {
1954
+ * "plan": "free"
1955
+ * },
1956
+ * },
1957
+ * }
1958
+ * ```
1959
+ *
1960
+ * If you want to OR together multiple values, you can use the `$any` operator with an array of values:
1961
+ *
1962
+ * ```json
1963
+ * {
1964
+ * "filter": {
1965
+ * "settings.plan": {"$any": ["free", "paid"]}
1966
+ * },
1967
+ * }
1968
+ * ```
1969
+ *
1970
+ * If you specify multiple columns in the same filter, they are logically AND'ed together:
1971
+ *
1972
+ * ```json
1973
+ * {
1974
+ * "filter": {
1975
+ * "settings.dark": true,
1976
+ * "settings.plan": "free",
1977
+ * },
1978
+ * }
1979
+ * ```
1980
+ *
1981
+ * The above matches if both conditions are met.
1982
+ *
1983
+ * To be more explicit about it, you can use `$all` or `$any`:
1984
+ *
1985
+ * ```json
1986
+ * {
1987
+ * "filter": {
1988
+ * "$any": {
1989
+ * "settings.dark": true,
1990
+ * "settings.plan": "free"
1991
+ * }
1992
+ * },
1993
+ * }
1994
+ * ```
1995
+ *
1996
+ * The `$all` and `$any` operators can also receive an array of objects, which allows for repeating column names:
1997
+ *
1998
+ * ```json
1999
+ * {
2000
+ * "filter": {
2001
+ * "$any": [
2002
+ * {
2003
+ * "name": "r1",
2004
+ * },
2005
+ * {
2006
+ * "name": "r2",
2007
+ * }
2008
+ * ]
2009
+ * }
2010
+ * }
2011
+ * ```
2012
+ *
2013
+ * You can check for a value being not-null with `$exists`:
2014
+ *
2015
+ * ```json
2016
+ * {
2017
+ * "filter": {
2018
+ * "$exists": "settings",
2019
+ * }
2020
+ * }
2021
+ * ```
2022
+ *
2023
+ * This can be combined with `$all` or `$any` :
2024
+ *
2025
+ * ```json
2026
+ * {
2027
+ * "filter": {
2028
+ * "$all": [
2029
+ * {
2030
+ * "$exists": "settings",
2031
+ * },
2032
+ * {
2033
+ * "$exists": "name",
2034
+ * }
2035
+ * ]
2036
+ * }
2037
+ * }
2038
+ * ```
2039
+ *
2040
+ * Or you can use the inverse operator `$notExists`:
2041
+ *
2042
+ * ```json
2043
+ * {
2044
+ * "filter": {
2045
+ * "$notExists": "settings",
2046
+ * }
2047
+ * }
2048
+ * ```
2049
+ *
2050
+ * #### Partial match
2051
+ *
2052
+ * `$contains` is the simplest operator for partial matching. We should generally
2053
+ * discourage overusing `$contains` because it typically can't make use of
2054
+ * indices.
2055
+ *
2056
+ * ```json
2057
+ * {
2058
+ * "filter": {
2059
+ * "<column_name>": {
2060
+ * "$contains": "value"
2061
+ * }
2062
+ * }
2063
+ * }
2064
+ * ```
2065
+ *
2066
+ * Wildcards are supported via the `$pattern` operator:
2067
+ *
2068
+ * ```json
2069
+ * {
2070
+ * "filter": {
2071
+ * "<column_name>": {
2072
+ * "$pattern": "v*alue*"
2073
+ * }
2074
+ * }
2075
+ * }
2076
+ * ```
2077
+ *
2078
+ * We could also have `$endsWith` and `$startsWith` operators:
2079
+ *
2080
+ * ```json
2081
+ * {
2082
+ * "filter": {
2083
+ * "<column_name>": {
2084
+ * "$endsWith": ".gz"
2085
+ * },
2086
+ * "<column_name>": {
2087
+ * "$startsWith": "tmp-"
2088
+ * }
2089
+ * }
2090
+ * }
2091
+ * ```
2092
+ *
2093
+ * #### Numeric ranges
2094
+ *
2095
+ * ```json
2096
+ * {
2097
+ * "filter": {
2098
+ * "<column_name>": {
2099
+ * "$ge": 0,
2100
+ * "$lt": 100
2101
+ * }
2102
+ * }
2103
+ * }
2104
+ * ```
2105
+ *
2106
+ * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
2107
+ *
2108
+ *
2109
+ * #### Negations
2110
+ *
2111
+ * A general `$not` operator can inverse any operation.
2112
+ *
2113
+ * ```json
2114
+ * {
2115
+ * "filter": {
2116
+ * "$not": {
2117
+ * "<column_name1>": "value1",
2118
+ * "<column_name2>": "value1"
2119
+ * }
2120
+ * }
2121
+ * }
2122
+ * ```
2123
+ *
2124
+ * Note: in the above the two condition are AND together, so this does (NOT ( ...
2125
+ * AND ...))
2126
+ *
2127
+ * Or more complex:
2128
+ *
2129
+ * ```json
2130
+ * {
2131
+ * "filter": {
2132
+ * "$not": {
2133
+ * "$any": [{
2134
+ * "<column_name1>": "value1"
2135
+ * }, {
2136
+ * "$all": [{
2137
+ * "<column_name2>": "value2"
2138
+ * }, {
2139
+ * "<column_name3>": "value3"
2140
+ * }]
2141
+ * }]
2142
+ * }
2143
+ * }
2144
+ * }
2145
+ * ```
2146
+ *
2147
+ * The `$not: { $any: {}}` can be shorted using the `$none` operator:
2148
+ *
2149
+ * ```json
2150
+ * {
2151
+ * "filter": {
2152
+ * "$none": {
2153
+ * "<column_name1>": "value1",
2154
+ * "<column_name2>": "value1"
2155
+ * }
2156
+ * }
2157
+ * }
2158
+ * ```
2159
+ *
2160
+ * In addition, you can use operators like `$isNot` or `$notExists` to simplify expressions:
2161
+ *
2162
+ * ```json
2163
+ * {
2164
+ * "filter": {
2165
+ * "<column_name>": {
2166
+ * "$isNot": "2019-10-12T07:20:50.52Z"
2167
+ * }
2168
+ * }
2169
+ * }
2170
+ * ```
2171
+ *
2172
+ * #### Working with arrays
2173
+ *
2174
+ * To test that an array contains a value, use `$includes`.
2175
+ *
2176
+ * ```json
2177
+ * {
2178
+ * "filter": {
2179
+ * "<array_name>": {
2180
+ * "$includes": "value"
2181
+ * }
2182
+ * }
2183
+ * }
2184
+ * ```
2185
+ *
2186
+ * The `$includes` operator accepts a custom predicate that will check if any
2187
+ * array values matches the predicate. For example a complex predicate can include
2188
+ * the `$all` , `$contains` and `$endsWith` operators:
2189
+ *
2190
+ * ```json
2191
+ * {
2192
+ * "filter": {
2193
+ * "<array name>": {
2194
+ * "$includes": {
2195
+ * "$all": [
2196
+ * {"$contains": "label"},
2197
+ * {"$not": {"$endsWith": "-debug"}}
2198
+ * ]
2199
+ * }
2200
+ * }
2201
+ * }
2202
+ * }
2203
+ * ```
2204
+ *
2205
+ * The `$includes` all operator succeeds if any column in the array matches the
2206
+ * predicate. The `$includesAll` operator succeeds if all array items match the
2207
+ * predicate. The `$includesNone` operator succeeds if no array item matches the
2208
+ * predicate. The `$includes` operator is a synonym for the `$includesAny`
2209
+ * operator.
2210
+ *
2211
+ * Here is an example of using the `$includesAll` operator:
2212
+ *
2213
+ * ```json
2214
+ * {
2215
+ * "filter": {
2216
+ * "settings.labels": {
2217
+ * "$includesAll": [
2218
+ * {"$contains": "label"},
2219
+ * ]
2220
+ * }
2221
+ * }
2222
+ * }
2223
+ * ```
2224
+ *
2225
+ * The above matches if all label values contain the string "labels".
2226
+ *
2227
+ * ### Sorting
2228
+ *
2229
+ * Sorting by one element:
2230
+ *
2231
+ * ```json
2232
+ * POST /db/demo:main/tables/table/query
2233
+ * {
2234
+ * "sort": {
2235
+ * "index": "asc"
2236
+ * }
2237
+ * }
2238
+ * ```
2239
+ *
2240
+ * or descendently:
2241
+ *
2242
+ * ```json
2243
+ * POST /db/demo:main/tables/table/query
2244
+ * {
2245
+ * "sort": {
2246
+ * "index": "desc"
2247
+ * }
2248
+ * }
2249
+ * ```
2250
+ *
2251
+ * Sorting by multiple fields:
2252
+ *
2253
+ * ```json
2254
+ * POST /db/demo:main/tables/table/query
2255
+ * {
2256
+ * "sort": [
2257
+ * {
2258
+ * "index": "desc"
2259
+ * },
2260
+ * {
2261
+ * "createdAt": "desc"
2262
+ * }
2263
+ * ]
2264
+ * }
2265
+ * ```
2266
+ *
2267
+ *
2268
+ * ### Pagination
2269
+ *
2270
+ * We offer cursor pagination and offset pagination. The offset pagination is limited
2271
+ * in the amount of data it can retrieve, so we recommend the cursor pagination if you have more than 1000 records.
2272
+ *
2273
+ * Example of size + offset pagination:
2274
+ *
2275
+ * ```json
2276
+ * POST /db/demo:main/tables/table/query
2277
+ * {
2278
+ * "page": {
2279
+ * "size": 100,
2280
+ * "offset": 200
2281
+ * }
2282
+ * }
2283
+ * ```
2284
+ *
2285
+ * The `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.
2286
+ * The `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.
2287
+ *
2288
+ * Example of cursor pagination:
2289
+ *
2290
+ * ```json
2291
+ * POST /db/demo:main/tables/table/query
2292
+ * {
2293
+ * "page": {
2294
+ * "after":"fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD"
2295
+ * }
2296
+ * }
2297
+ * ```
2298
+ *
2299
+ * In the above example, the value of the `page.after` parameter is the cursor returned by the previous query. A sample response is shown below:
2300
+ *
2301
+ * ```json
2302
+ * {
2303
+ * "meta": {
2304
+ * "page": {
2305
+ * "cursor": "fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD",
2306
+ * "more": true
2307
+ * }
2308
+ * },
2309
+ * "records": [...]
2310
+ * }
2311
+ * ```
2312
+ *
2313
+ * The `page` object might contain the follow keys, in addition to `size` and `offset` that were introduced before:
2314
+ *
2315
+ * - `after`: Return the next page 'after' the current cursor
2316
+ * - `before`: Return the previous page 'before' the current cursor.
2317
+ * - `first`: Return the first page in the table from a cursor.
2318
+ * - `last`: Return the last N records in the table from a cursor, where N is the `page.size` parameter.
2319
+ *
2320
+ * The request will fail if an invalid cursor value is given to `page.before`,
2321
+ * `page.after`, `page.first` , or `page.last`. No other cursor setting can be
2322
+ * used if `page.first` or `page.last` is set in a query.
2323
+ *
2324
+ * If both `page.before` and `page.after` parameters are present we treat the
2325
+ * request as a range query. The range query will return all entries after
2326
+ * `page.after`, but before `page.before`, up to `page.size` or the maximum
2327
+ * page size. This query requires both cursors to use the same filters and sort
2328
+ * settings, plus we require `page.after < page.before`. The range query returns
2329
+ * a new cursor. If the range encompass multiple pages the next page in the range
2330
+ * can be queried by update `page.after` to the returned cursor while keeping the
2331
+ * `page.before` cursor from the first range query.
2332
+ *
2333
+ * The `filter` , `columns`, `sort` , and `page.size` configuration will be
2334
+ * encoded with the cursor. The pagination request will be invalid if
2335
+ * `filter` or `sort` is set. The columns returned and page size can be changed
2336
+ * anytime by passing the `columns` or `page.size` settings to the next query.
2337
+ *
2338
+ * **Special cursors:**
2339
+ *
2340
+ * - `page.after=end`: Result points past the last entry. The list of records
2341
+ * returned is empty, but `page.meta.cursor` will include a cursor that can be
2342
+ * used to "tail" the table from the end waiting for new data to be inserted.
2343
+ * - `page.before=end`: This cursor returns the last page.
2344
+ * - `page.first=<cursor>`: Go to first page. This is equivalent to querying the
2345
+ * first page without a cursor but `filter` and `sort` . Yet the `page.first`
2346
+ * cursor can be convenient at times as user code does not need to remember the
2347
+ * filter, sort, columns or page size configuration. All these information are
2348
+ * read from the cursor.
2349
+ * - `page.last=<cursor>`: Go to the end of the table. This is equivalent to querying the
2350
+ * last page with `page.before=end`, `filter`, and `sort` . Yet the
2351
+ * `page.last` cursor can be more convenient at times as user code does not
2352
+ * need to remember the filter, sort, columns or page size configuration. All
2353
+ * these information are read from the cursor.
2354
+ *
2355
+ * When using special cursors like `page.after="end"` or `page.before="end"`, we
2356
+ * still allow `filter` and `sort` to be set.
2357
+ *
2358
+ * Example of getting the last page:
2359
+ *
2360
+ * ```json
2361
+ * POST /db/demo:main/tables/table/query
2362
+ * {
2363
+ * "page": {
2364
+ * "size": 10,
2365
+ * "before": "end"
2366
+ * }
2367
+ * }
2368
+ * ```
2369
+ */
2370
+ declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2371
+ declare type SearchBranchPathParams = {
2372
+ dbBranchName: DBBranchName;
2373
+ workspace: string;
2374
+ };
2375
+ declare type SearchBranchError = ErrorWrapper<{
2376
+ status: 400;
2377
+ payload: BadRequestError;
2378
+ } | {
2379
+ status: 401;
2380
+ payload: AuthError;
2381
+ } | {
2382
+ status: 404;
2383
+ payload: SimpleError;
2384
+ }>;
2385
+ declare type SearchBranchRequestBody = {
2386
+ tables?: string[];
2387
+ query: string;
2388
+ fuzziness?: number;
2389
+ };
2390
+ declare type SearchBranchVariables = {
2391
+ body: SearchBranchRequestBody;
2392
+ pathParams: SearchBranchPathParams;
2393
+ } & FetcherExtraProps;
2394
+ /**
2395
+ * Run a free text search operation across the database branch.
2396
+ */
2397
+ declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
2398
+ declare const operationsByTag: {
2399
+ users: {
2400
+ getUser: (variables: GetUserVariables) => Promise<UserWithID>;
2401
+ updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
2402
+ deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
2403
+ getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
2404
+ createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
2405
+ deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
2406
+ };
2407
+ workspaces: {
2408
+ createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
2409
+ getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
2410
+ getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
2411
+ updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
2412
+ deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
2413
+ getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
2414
+ updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2415
+ removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2416
+ inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
2417
+ cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2418
+ resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2419
+ acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
2420
+ };
2421
+ database: {
2422
+ getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2423
+ createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2424
+ deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
2425
+ };
2426
+ branch: {
2427
+ getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2428
+ getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2429
+ createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
2430
+ deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2431
+ updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2432
+ getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
2433
+ getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2434
+ executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2435
+ getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2436
+ getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
2437
+ };
2438
+ table: {
2439
+ createTable: (variables: CreateTableVariables) => Promise<undefined>;
2440
+ deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2441
+ updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2442
+ getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
2443
+ setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
2444
+ getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
2445
+ addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
2446
+ getColumn: (variables: GetColumnVariables) => Promise<Column>;
2447
+ deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
2448
+ updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
2449
+ };
2450
+ records: {
2451
+ insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2452
+ insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2453
+ updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2454
+ upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2455
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
2456
+ getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2457
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2458
+ queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2459
+ searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
2460
+ };
2461
+ };
2462
+
2463
+ declare type HostAliases = 'production' | 'staging';
2464
+ declare type ProviderBuilder = {
2465
+ main: string;
2466
+ workspaces: string;
2467
+ };
2468
+ declare type HostProvider = HostAliases | ProviderBuilder;
2469
+
2470
+ interface XataApiClientOptions {
2471
+ fetch?: FetchImpl;
2472
+ apiKey?: string;
2473
+ host?: HostProvider;
2474
+ }
2475
+ declare class XataApiClient {
2476
+ #private;
2477
+ constructor(options?: XataApiClientOptions);
2478
+ get user(): UserApi;
2479
+ get workspaces(): WorkspaceApi;
2480
+ get databases(): DatabaseApi;
2481
+ get branches(): BranchApi;
2482
+ get tables(): TableApi;
2483
+ get records(): RecordsApi;
2484
+ }
2485
+ declare class UserApi {
2486
+ private extraProps;
2487
+ constructor(extraProps: FetcherExtraProps);
2488
+ getUser(): Promise<UserWithID>;
2489
+ updateUser(user: User): Promise<UserWithID>;
2490
+ deleteUser(): Promise<void>;
2491
+ getUserAPIKeys(): Promise<GetUserAPIKeysResponse>;
2492
+ createUserAPIKey(keyName: APIKeyName): Promise<CreateUserAPIKeyResponse>;
2493
+ deleteUserAPIKey(keyName: APIKeyName): Promise<void>;
2494
+ }
2495
+ declare class WorkspaceApi {
2496
+ private extraProps;
2497
+ constructor(extraProps: FetcherExtraProps);
2498
+ createWorkspace(workspaceMeta: WorkspaceMeta): Promise<Workspace>;
2499
+ getWorkspacesList(): Promise<GetWorkspacesListResponse>;
2500
+ getWorkspace(workspaceId: WorkspaceID): Promise<Workspace>;
2501
+ updateWorkspace(workspaceId: WorkspaceID, workspaceMeta: WorkspaceMeta): Promise<Workspace>;
2502
+ deleteWorkspace(workspaceId: WorkspaceID): Promise<void>;
2503
+ getWorkspaceMembersList(workspaceId: WorkspaceID): Promise<WorkspaceMembers>;
2504
+ updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2505
+ removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2506
+ inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
2507
+ cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2508
+ resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2509
+ acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
2510
+ }
2511
+ declare class DatabaseApi {
2512
+ private extraProps;
2513
+ constructor(extraProps: FetcherExtraProps);
2514
+ getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2515
+ createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2516
+ deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
2517
+ }
2518
+ declare class BranchApi {
2519
+ private extraProps;
2520
+ constructor(extraProps: FetcherExtraProps);
2521
+ getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2522
+ getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2523
+ createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<void>;
2524
+ deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2525
+ updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2526
+ getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
2527
+ getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
2528
+ executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
2529
+ getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
2530
+ getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
2531
+ }
2532
+ declare class TableApi {
2533
+ private extraProps;
2534
+ constructor(extraProps: FetcherExtraProps);
2535
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2536
+ deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2537
+ updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2538
+ getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
2539
+ setTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: SetTableSchemaRequestBody): Promise<void>;
2540
+ getTableColumns(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableColumnsResponse>;
2541
+ addTableColumn(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, column: Column): Promise<MigrationIdResponse>;
2542
+ getColumn(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, columnName: ColumnName): Promise<Column>;
2543
+ deleteColumn(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, columnName: ColumnName): Promise<MigrationIdResponse>;
2544
+ updateColumn(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, columnName: ColumnName, options: UpdateColumnRequestBody): Promise<MigrationIdResponse>;
2545
+ }
2546
+ declare class RecordsApi {
2547
+ private extraProps;
2548
+ constructor(extraProps: FetcherExtraProps);
2549
+ insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>): Promise<InsertRecordResponse>;
2550
+ insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2551
+ updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2552
+ upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2553
+ deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<void>;
2554
+ getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2555
+ bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
2556
+ queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2557
+ searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
2558
+ }
2559
+
2560
+ declare class XataApiPlugin implements XataPlugin {
2561
+ build(options: XataPluginOptions): Promise<XataApiClient>;
2562
+ }
2563
+
2564
+ declare type StringKeys<O> = Extract<keyof O, string>;
2565
+ declare type Values<O> = O[StringKeys<O>];
2566
+ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
2567
+ declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2568
+ declare type IsObject<T> = T extends Record<string, any> ? true : false;
2569
+ declare type IsArray<T> = T extends Array<any> ? true : false;
2570
+ declare type NonEmptyArray<T> = T[] & {
2571
+ 0: T;
2572
+ };
2573
+ declare type RequiredBy<T, K extends keyof T> = T & {
2574
+ [P in K]-?: NonNullable<T[P]>;
2575
+ };
2576
+ declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2577
+ declare type SingleOrArray<T> = T | T[];
2578
+ declare type Dictionary<T> = Record<string, T>;
2579
+
2580
+ declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2581
+ declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2582
+ [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
2583
+ }>>;
2584
+ declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends XataRecord ? (V extends SelectableColumn<O[K]> ? {
2585
+ V: ValueAtColumn<O[K], V>;
2586
+ } : never) : O[K]> : never : never;
2587
+ declare type MAX_RECURSION = 5;
2588
+ declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
2589
+ [K in DataProps<O>]: If<IsArray<NonNullable<O[K]>>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
2590
+ If<IsObject<NonNullable<O[K]>>, NonNullable<O[K]> extends XataRecord ? SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]> extends string ? K | `${K}.${SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]>}` : never : `${K}.${StringKeys<NonNullable<O[K]>> | '*'}`, // This allows usage of objects that are not links
2591
+ K>>;
2592
+ }>, never>;
2593
+ declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
2594
+ declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
2595
+ [K in N]: M extends SelectableColumn<NonNullable<O[K]>> ? NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], NestedValueAtColumn<NonNullable<O[K]>, M> & XataRecord> : ForwardNullable<O[K], NestedValueAtColumn<NonNullable<O[K]>, M>> : unknown;
2596
+ } : unknown : Key extends DataProps<O> ? {
2597
+ [K in Key]: NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], SelectedPick<NonNullable<O[K]>, ['*']>> : O[K];
2598
+ } : Key extends '*' ? {
2599
+ [K in StringKeys<O>]: NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], Link<NonNullable<O[K]>>> : O[K];
2600
+ } : unknown;
2601
+ declare type ForwardNullable<T, R> = T extends NonNullable<T> ? R : R | null;
2602
+
2603
+ /**
2604
+ * Represents an identifiable record from the database.
2605
+ */
2606
+ interface Identifiable {
2607
+ /**
2608
+ * Unique id of this record.
2609
+ */
2610
+ id: string;
2611
+ }
2612
+ interface BaseData {
2613
+ [key: string]: any;
2614
+ }
2615
+ /**
2616
+ * Represents a persisted record from the database.
2617
+ */
2618
+ interface XataRecord extends Identifiable {
2619
+ /**
2620
+ * Metadata of this record.
2621
+ */
2622
+ xata: {
2623
+ /**
2624
+ * Number that is increased every time the record is updated.
2625
+ */
2626
+ version: number;
2627
+ };
2628
+ /**
2629
+ * Retrieves a refreshed copy of the current record from the database.
2630
+ */
2631
+ read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
2632
+ /**
2633
+ * Performs a partial update of the current record. On success a new object is
2634
+ * returned and the current object is not mutated.
2635
+ * @param data The columns and their values that have to be updated.
2636
+ * @returns A new record containing the latest values for all the columns of the current record.
2637
+ */
2638
+ update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
2639
+ /**
2640
+ * Performs a deletion of the current record in the database.
2641
+ *
2642
+ * @throws If the record was already deleted or if an error happened while performing the deletion.
2643
+ */
2644
+ delete(): Promise<void>;
2645
+ }
2646
+ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
2647
+ /**
2648
+ * Retrieves a refreshed copy of the current record from the database.
2649
+ */
2650
+ read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
2651
+ /**
2652
+ * Performs a partial update of the current record. On success a new object is
2653
+ * returned and the current object is not mutated.
2654
+ * @param data The columns and their values that have to be updated.
2655
+ * @returns A new record containing the latest values for all the columns of the current record.
2656
+ */
2657
+ update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2658
+ };
2659
+ declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2660
+ declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2661
+ declare type EditableData<O extends BaseData> = {
2662
+ [K in keyof O]: O[K] extends XataRecord ? {
2663
+ id: string;
2664
+ } : NonNullable<O[K]> extends XataRecord ? {
2665
+ id: string;
2666
+ } | null | undefined : O[K];
2667
+ };
2668
+
2669
+ /**
2670
+ * PropertyMatchFilter
2671
+ * Example:
2672
+ {
2673
+ "filter": {
2674
+ "name": "value",
2675
+ "name": {
2676
+ "$is": "value",
2677
+ "$any": [ "value1", "value2" ],
2678
+ },
2679
+ "settings.plan": {"$any": ["free", "paid"]},
2680
+ "settings.plan": "free",
2681
+ "settings": {
2682
+ "plan": "free"
2683
+ },
2684
+ }
2685
+ }
2686
+ */
2687
+ declare type PropertyAccessFilter<Record> = {
2688
+ [key in SelectableColumn<Record>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
2689
+ };
2690
+ declare type PropertyFilter<T> = T | {
2691
+ $is: T;
2692
+ } | {
2693
+ $isNot: T;
2694
+ } | {
2695
+ $any: T[];
2696
+ } | {
2697
+ $none: T[];
2698
+ } | ValueTypeFilters<T>;
2699
+ declare type IncludesFilter<T> = PropertyFilter<T> | {
2700
+ [key in '$all' | '$none' | '$any']?: IncludesFilter<T> | Array<IncludesFilter<T> | {
2701
+ $not: IncludesFilter<T>;
2702
+ }>;
2703
+ };
2704
+ declare type StringTypeFilter = {
2705
+ [key in '$contains' | '$pattern' | '$startsWith' | '$endsWith']?: string;
2706
+ };
2707
+ declare type ComparableType = number | Date;
2708
+ declare type ComparableTypeFilter<T extends ComparableType> = {
2709
+ [key in '$gt' | '$lt' | '$ge' | '$le']?: T;
2710
+ };
2711
+ declare type ArrayFilter<T> = {
2712
+ [key in '$includes']?: SingleOrArray<PropertyFilter<T> | ValueTypeFilters<T>> | IncludesFilter<T>;
2713
+ } | {
2714
+ [key in '$includesAll' | '$includesNone' | '$includesAny']?: T | Array<PropertyFilter<T> | {
2715
+ $not: PropertyFilter<T>;
2716
+ }>;
2717
+ };
2718
+ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T extends number ? ComparableTypeFilter<number> : T extends Date ? ComparableTypeFilter<Date> : T extends Array<infer T> ? ArrayFilter<T> : never;
2719
+ /**
2720
+ * AggregatorFilter
2721
+ * Example:
2722
+ {
2723
+ "filter": {
2724
+ "$any": {
2725
+ "settings.dark": true,
2726
+ "settings.plan": "free"
2727
+ }
2728
+ },
2729
+ }
2730
+ {
2731
+ "filter": {
2732
+ "$any": [
2733
+ {
2734
+ "name": "r1",
2735
+ },
2736
+ {
2737
+ "name": "r2",
2738
+ },
2739
+ ],
2740
+ }
2741
+ */
2742
+ declare type AggregatorFilter<Record> = {
2743
+ [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<Record>>;
2744
+ };
2745
+ /**
2746
+ * Existance filter
2747
+ * Example: { filter: { $exists: "settings" } }
2748
+ */
2749
+ declare type ExistanceFilter<Record> = {
2750
+ [key in '$exists' | '$notExists']?: SelectableColumn<Record>;
2751
+ };
2752
+ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
2753
+ /**
2754
+ * Nested filter
2755
+ * Injects the Api filters on nested properties
2756
+ * Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
2757
+ */
2758
+ declare type NestedApiFilter<T> = T extends Record<string, any> ? {
2759
+ [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
2760
+ } : PropertyFilter<T>;
2761
+ declare type Filter<Record> = BaseApiFilter<Record> | NestedApiFilter<Record>;
2762
+
2763
+ declare type SortDirection = 'asc' | 'desc';
2764
+ declare type SortFilterExtended<T extends XataRecord> = {
2765
+ column: SelectableColumn<T>;
2766
+ direction?: SortDirection;
2767
+ };
2768
+ declare type SortFilter<T extends XataRecord> = SelectableColumn<T> | SortFilterExtended<T> | SortFilterBase<T>;
2769
+ declare type SortFilterBase<T extends XataRecord> = {
2770
+ [Key in StringKeys<T>]: SortDirection;
2771
+ };
2772
+
2773
+ declare type QueryOptions<T extends XataRecord> = {
2774
+ page?: PaginationOptions;
2775
+ columns?: NonEmptyArray<SelectableColumn<T>>;
2776
+ filter?: FilterExpression;
2777
+ sort?: SortFilter<T> | SortFilter<T>[];
2778
+ };
2779
+ /**
2780
+ * Query objects contain the information of all filters, sorting, etc. to be included in the database query.
2781
+ *
2782
+ * Query objects are immutable. Any method that adds more constraints or options to the query will return
2783
+ * a new Query object containing the both the previous and the new constraints and options.
2784
+ */
2785
+ declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
2786
+ #private;
2787
+ readonly meta: PaginationQueryMeta;
2788
+ readonly records: Result[];
2789
+ constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, parent?: Partial<QueryOptions<Record>>);
2790
+ getQueryOptions(): QueryOptions<Record>;
2791
+ /**
2792
+ * Builds a new query object representing a logical OR between the given subqueries.
2793
+ * @param queries An array of subqueries.
2794
+ * @returns A new Query object.
2795
+ */
2796
+ any(...queries: Query<Record, any>[]): Query<Record, Result>;
2797
+ /**
2798
+ * Builds a new query object representing a logical AND between the given subqueries.
2799
+ * @param queries An array of subqueries.
2800
+ * @returns A new Query object.
2801
+ */
2802
+ all(...queries: Query<Record, any>[]): Query<Record, Result>;
2803
+ /**
2804
+ * Builds a new query object representing a logical OR negating each subquery. In pseudo-code: !q1 OR !q2
2805
+ * @param queries An array of subqueries.
2806
+ * @returns A new Query object.
2807
+ */
2808
+ not(...queries: Query<Record, any>[]): Query<Record, Result>;
2809
+ /**
2810
+ * Builds a new query object representing a logical AND negating each subquery. In pseudo-code: !q1 AND !q2
2811
+ * @param queries An array of subqueries.
2812
+ * @returns A new Query object.
2813
+ */
2814
+ none(...queries: Query<Record, any>[]): Query<Record, Result>;
2815
+ /**
2816
+ * Builds a new query object adding one or more constraints. Examples:
2817
+ *
2818
+ * ```
2819
+ * query.filter("columnName", columnValue)
2820
+ * query.filter({
2821
+ * "columnName": columnValue
2822
+ * })
2823
+ * query.filter({
2824
+ * "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
2825
+ * })
2826
+ * ```
2827
+ *
2828
+ * @returns A new Query object.
2829
+ */
2830
+ filter(filters: Filter<Record>): Query<Record, Result>;
2831
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
2832
+ /**
2833
+ * Builds a new query with a new sort option.
2834
+ * @param column The column name.
2835
+ * @param direction The direction. Either ascending or descending.
2836
+ * @returns A new Query object.
2837
+ */
2838
+ sort<F extends SelectableColumn<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
2839
+ /**
2840
+ * Builds a new query specifying the set of columns to be returned in the query response.
2841
+ * @param columns Array of column names to be returned by the query.
2842
+ * @returns A new Query object.
2843
+ */
2844
+ select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
2845
+ getPaginated(): Promise<Page<Record, Result>>;
2846
+ getPaginated(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
2847
+ getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
2848
+ [Symbol.asyncIterator](): AsyncIterableIterator<Result>;
2849
+ getIterator(chunk: number): AsyncGenerator<Result[]>;
2850
+ getIterator(chunk: number, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): AsyncGenerator<Result[]>;
2851
+ getIterator<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number, options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
2852
+ /**
2853
+ * Performs the query in the database and returns a set of results.
2854
+ * @param options Additional options to be used when performing the query.
2855
+ * @returns An array of records from the database.
2856
+ */
2857
+ getMany(): Promise<Result[]>;
2858
+ getMany(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
2859
+ getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
2860
+ /**
2861
+ * Performs the query in the database and returns all the results.
2862
+ * Warning: If there are a large number of results, this method can have performance implications.
2863
+ * @param options Additional options to be used when performing the query.
2864
+ * @returns An array of records from the database.
2865
+ */
2866
+ getAll(chunk?: number): Promise<Result[]>;
2867
+ getAll(chunk: number | undefined, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result[]>;
2868
+ getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number | undefined, options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
2869
+ /**
2870
+ * Performs the query in the database and returns the first result.
2871
+ * @param options Additional options to be used when performing the query.
2872
+ * @returns The first record that matches the query, or null if no record matched the query.
2873
+ */
2874
+ getOne(): Promise<Result | null>;
2875
+ getOne(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
2876
+ getOne<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
2877
+ nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2878
+ previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2879
+ firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2880
+ lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2881
+ hasNextPage(): boolean;
2882
+ }
2883
+
2884
+ declare type PaginationQueryMeta = {
2885
+ page: {
2886
+ cursor: string;
2887
+ more: boolean;
2888
+ };
2889
+ };
2890
+ interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
2891
+ meta: PaginationQueryMeta;
2892
+ records: Result[];
2893
+ nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2894
+ previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2895
+ firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2896
+ lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2897
+ hasNextPage(): boolean;
2898
+ }
2899
+ /**
2900
+ * A Page contains a set of results from a query plus metadata about the retrieved
2901
+ * set of values such as the cursor, required to retrieve additional records.
2902
+ */
2903
+ declare class Page<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
2904
+ #private;
2905
+ /**
2906
+ * Page metadata, required to retrieve additional records.
2907
+ */
2908
+ readonly meta: PaginationQueryMeta;
2909
+ /**
2910
+ * The set of results for this page.
2911
+ */
2912
+ readonly records: Result[];
2913
+ constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
2914
+ /**
2915
+ * Retrieves the next page of results.
2916
+ * @param size Maximum number of results to be retrieved.
2917
+ * @param offset Number of results to skip when retrieving the results.
2918
+ * @returns The next page or results.
2919
+ */
2920
+ nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2921
+ /**
2922
+ * Retrieves the previous page of results.
2923
+ * @param size Maximum number of results to be retrieved.
2924
+ * @param offset Number of results to skip when retrieving the results.
2925
+ * @returns The previous page or results.
2926
+ */
2927
+ previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2928
+ /**
2929
+ * Retrieves the first page of results.
2930
+ * @param size Maximum number of results to be retrieved.
2931
+ * @param offset Number of results to skip when retrieving the results.
2932
+ * @returns The first page or results.
2933
+ */
2934
+ firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2935
+ /**
2936
+ * Retrieves the last page of results.
2937
+ * @param size Maximum number of results to be retrieved.
2938
+ * @param offset Number of results to skip when retrieving the results.
2939
+ * @returns The last page or results.
2940
+ */
2941
+ lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2942
+ /**
2943
+ * Shortcut method to check if there will be additional results if the next page of results is retrieved.
2944
+ * @returns Whether or not there will be additional results in the next page of results.
2945
+ */
2946
+ hasNextPage(): boolean;
2947
+ }
2948
+ declare type CursorNavigationOptions = {
2949
+ first?: string;
2950
+ } | {
2951
+ last?: string;
2952
+ } | {
2953
+ after?: string;
2954
+ before?: string;
2955
+ };
2956
+ declare type OffsetNavigationOptions = {
2957
+ size?: number;
2958
+ offset?: number;
2959
+ };
2960
+ declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
2961
+ declare const PAGINATION_MAX_SIZE = 200;
2962
+ declare const PAGINATION_DEFAULT_SIZE = 200;
2963
+ declare const PAGINATION_MAX_OFFSET = 800;
2964
+ declare const PAGINATION_DEFAULT_OFFSET = 0;
2965
+
2966
+ declare type TableLink = string[];
2967
+ declare type LinkDictionary = Dictionary<TableLink[]>;
2968
+ /**
2969
+ * Common interface for performing operations on a table.
2970
+ */
2971
+ declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
2972
+ abstract create(object: EditableData<Data> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2973
+ /**
2974
+ * Creates a single record in the table with a unique id.
2975
+ * @param id The unique id.
2976
+ * @param object Object containing the column names with their values to be stored in the table.
2977
+ * @returns The full persisted record.
2978
+ */
2979
+ abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2980
+ /**
2981
+ * Creates multiple records in the table.
2982
+ * @param objects Array of objects with the column names and the values to be stored in the table.
2983
+ * @returns Array of the persisted records.
2984
+ */
2985
+ abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
2986
+ /**
2987
+ * Queries a single record from the table given its unique id.
2988
+ * @param id The unique id.
2989
+ * @returns The persisted record for the given id or null if the record could not be found.
2990
+ */
2991
+ abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
2992
+ /**
2993
+ * Partially update a single record.
2994
+ * @param object An object with its id and the columns to be updated.
2995
+ * @returns The full persisted record.
2996
+ */
2997
+ abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2998
+ /**
2999
+ * Partially update a single record given its unique id.
3000
+ * @param id The unique id.
3001
+ * @param object The column names and their values that have to be updated.
3002
+ * @returns The full persisted record.
3003
+ */
3004
+ abstract update(id: string, object: Partial<EditableData<Data>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3005
+ /**
3006
+ * Partially updates multiple records.
3007
+ * @param objects An array of objects with their ids and columns to be updated.
3008
+ * @returns Array of the persisted records.
3009
+ */
3010
+ abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3011
+ /**
3012
+ * Creates or updates a single record. If a record exists with the given id,
3013
+ * it will be update, otherwise a new record will be created.
3014
+ * @param object Object containing the column names with their values to be persisted in the table.
3015
+ * @returns The full persisted record.
3016
+ */
3017
+ abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3018
+ /**
3019
+ * Creates or updates a single record. If a record exists with the given id,
3020
+ * it will be update, otherwise a new record will be created.
3021
+ * @param id A unique id.
3022
+ * @param object The column names and the values to be persisted.
3023
+ * @returns The full persisted record.
3024
+ */
3025
+ abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3026
+ /**
3027
+ * Creates or updates a single record. If a record exists with the given id,
3028
+ * it will be update, otherwise a new record will be created.
3029
+ * @param objects Array of objects with the column names and the values to be stored in the table.
3030
+ * @returns Array of the persisted records.
3031
+ */
3032
+ abstract createOrUpdate(objects: Array<EditableData<Data> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3033
+ /**
3034
+ * Deletes a record given its unique id.
3035
+ * @param id The unique id.
3036
+ * @throws If the record could not be found or there was an error while performing the deletion.
3037
+ */
3038
+ abstract delete(id: string): Promise<void>;
3039
+ /**
3040
+ * Deletes a record given its unique id.
3041
+ * @param id An object with a unique id.
3042
+ * @throws If the record could not be found or there was an error while performing the deletion.
3043
+ */
3044
+ abstract delete(id: Identifiable): Promise<void>;
3045
+ /**
3046
+ * Deletes a record given a list of unique ids.
3047
+ * @param ids The array of unique ids.
3048
+ * @throws If the record could not be found or there was an error while performing the deletion.
3049
+ */
3050
+ abstract delete(ids: string[]): Promise<void>;
3051
+ /**
3052
+ * Deletes a record given a list of unique ids.
3053
+ * @param ids An array of objects with unique ids.
3054
+ * @throws If the record could not be found or there was an error while performing the deletion.
3055
+ */
3056
+ abstract delete(ids: Identifiable[]): Promise<void>;
3057
+ /**
3058
+ * Search for records in the table.
3059
+ * @param query The query to search for.
3060
+ * @param options The options to search with (like: fuzziness)
3061
+ * @returns The found records.
3062
+ */
3063
+ abstract search(query: string, options?: {
3064
+ fuzziness?: number;
3065
+ }): Promise<SelectedPick<Record, ['*']>[]>;
3066
+ abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3067
+ }
3068
+ declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
3069
+ #private;
3070
+ db: SchemaPluginResult<any>;
3071
+ constructor(options: {
3072
+ table: string;
3073
+ links?: LinkDictionary;
3074
+ getFetchProps: () => Promise<FetcherExtraProps>;
3075
+ db: SchemaPluginResult<any>;
3076
+ });
3077
+ create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3078
+ create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3079
+ create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3080
+ read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
3081
+ update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3082
+ update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3083
+ update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3084
+ createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3085
+ createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3086
+ createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3087
+ delete(recordId: string | Identifiable | Array<string | Identifiable>): Promise<void>;
3088
+ search(query: string, options?: {
3089
+ fuzziness?: number;
3090
+ }): Promise<SelectedPick<Record, ['*']>[]>;
3091
+ query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3092
+ }
3093
+
3094
+ /**
3095
+ * Operator to restrict results to only values that are greater than the given value.
3096
+ */
3097
+ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3098
+ /**
3099
+ * Operator to restrict results to only values that are greater than or equal to the given value.
3100
+ */
3101
+ declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3102
+ /**
3103
+ * Operator to restrict results to only values that are greater than or equal to the given value.
3104
+ */
3105
+ declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3106
+ /**
3107
+ * Operator to restrict results to only values that are lower than the given value.
3108
+ */
3109
+ declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3110
+ /**
3111
+ * Operator to restrict results to only values that are lower than or equal to the given value.
3112
+ */
3113
+ declare const lte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3114
+ /**
3115
+ * Operator to restrict results to only values that are lower than or equal to the given value.
3116
+ */
3117
+ declare const le: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3118
+ /**
3119
+ * Operator to restrict results to only values that are not null.
3120
+ */
3121
+ declare const exists: <T>(column: SelectableColumn<T, []>) => ExistanceFilter<T>;
3122
+ /**
3123
+ * Operator to restrict results to only values that are null.
3124
+ */
3125
+ declare const notExists: <T>(column: SelectableColumn<T, []>) => ExistanceFilter<T>;
3126
+ /**
3127
+ * Operator to restrict results to only values that start with the given prefix.
3128
+ */
3129
+ declare const startsWith: (value: string) => StringTypeFilter;
3130
+ /**
3131
+ * Operator to restrict results to only values that end with the given suffix.
3132
+ */
3133
+ declare const endsWith: (value: string) => StringTypeFilter;
3134
+ /**
3135
+ * Operator to restrict results to only values that match the given pattern.
3136
+ */
3137
+ declare const pattern: (value: string) => StringTypeFilter;
3138
+ /**
3139
+ * Operator to restrict results to only values that are equal to the given value.
3140
+ */
3141
+ declare const is: <T>(value: T) => PropertyFilter<T>;
3142
+ /**
3143
+ * Operator to restrict results to only values that are not equal to the given value.
3144
+ */
3145
+ declare const isNot: <T>(value: T) => PropertyFilter<T>;
3146
+ /**
3147
+ * Operator to restrict results to only values that contain the given value.
3148
+ */
3149
+ declare const contains: (value: string) => StringTypeFilter;
3150
+ /**
3151
+ * Operator to restrict results if some array items match the predicate.
3152
+ */
3153
+ declare const includes: <T>(value: T) => ArrayFilter<T>;
3154
+ /**
3155
+ * Operator to restrict results if all array items match the predicate.
3156
+ */
3157
+ declare const includesAll: <T>(value: T) => ArrayFilter<T>;
3158
+ /**
3159
+ * Operator to restrict results if none array items match the predicate.
3160
+ */
3161
+ declare const includesNone: <T>(value: T) => ArrayFilter<T>;
3162
+ /**
3163
+ * Operator to restrict results if some array items match the predicate.
3164
+ */
3165
+ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3166
+
3167
+ declare type SchemaDefinition = {
3168
+ table: string;
3169
+ links?: LinkDictionary;
3170
+ };
3171
+ declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
3172
+ [Key in keyof Schemas]: Repository<Schemas[Key]>;
3173
+ };
3174
+ declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3175
+ #private;
3176
+ private links?;
3177
+ constructor(links?: LinkDictionary | undefined);
3178
+ build(options: XataPluginOptions): SchemaPluginResult<Schemas>;
3179
+ }
3180
+
3181
+ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3182
+ fuzziness?: number;
3183
+ tables?: Tables[];
3184
+ };
3185
+ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3186
+ all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3187
+ [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
3188
+ table: Model;
3189
+ record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3190
+ };
3191
+ }>[]>;
3192
+ byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3193
+ [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3194
+ }>;
3195
+ };
3196
+ declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3197
+ #private;
3198
+ private db;
3199
+ private links;
3200
+ constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
3201
+ build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3202
+ }
3203
+ declare type SearchXataRecord = XataRecord & {
3204
+ xata: {
3205
+ table: string;
3206
+ };
3207
+ };
3208
+
3209
+ declare type BranchStrategyValue = string | undefined | null;
3210
+ declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3211
+ declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
3212
+ declare type BranchStrategyOption = NonNullable<BranchStrategy | BranchStrategy[]>;
3213
+
3214
+ declare type BaseClientOptions = {
3215
+ fetch?: FetchImpl;
3216
+ apiKey?: string;
3217
+ databaseURL?: string;
3218
+ branch?: BranchStrategyOption;
3219
+ };
3220
+ declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3221
+ interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3222
+ new <Schemas extends Record<string, BaseData>>(options?: Partial<BaseClientOptions>, links?: LinkDictionary): Omit<{
3223
+ db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
3224
+ search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
3225
+ }, keyof Plugins> & {
3226
+ [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
3227
+ };
3228
+ }
3229
+ declare const BaseClient_base: ClientConstructor<{}>;
3230
+ declare class BaseClient extends BaseClient_base<Record<string, any>> {
3231
+ }
3232
+
3233
+ declare type BranchResolutionOptions = {
3234
+ databaseURL?: string;
3235
+ apiKey?: string;
3236
+ fetchImpl?: FetchImpl;
3237
+ };
3238
+ declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string | undefined>;
3239
+ declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
3240
+ declare function getDatabaseURL(): string | undefined;
3241
+
3242
+ declare function getAPIKey(): string | undefined;
3243
+
3244
+ declare class XataError extends Error {
2
3245
  readonly status: number;
3
3246
  constructor(message: string, status: number);
4
3247
  }
5
- export * from './api';
6
- export * from './plugins';
7
- export * from './client';
8
- export * from './schema';
9
- export * from './search';
10
- export * from './util/config';
3248
+
3249
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, LinkDictionary, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };