@xata.io/client 0.0.0-beta.18f8d57 → 0.0.0-beta.4e4e7fc

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 (41) hide show
  1. package/dist/api/client.d.ts +93 -0
  2. package/dist/api/client.js +229 -0
  3. package/dist/api/components.d.ts +1416 -0
  4. package/dist/api/components.js +988 -0
  5. package/dist/api/fetcher.d.ts +25 -0
  6. package/dist/api/fetcher.js +78 -0
  7. package/dist/api/index.d.ts +7 -0
  8. package/dist/api/index.js +21 -0
  9. package/dist/api/parameters.d.ts +15 -0
  10. package/dist/api/parameters.js +2 -0
  11. package/dist/api/providers.d.ts +8 -0
  12. package/dist/api/providers.js +29 -0
  13. package/dist/api/responses.d.ts +44 -0
  14. package/dist/api/responses.js +2 -0
  15. package/dist/api/schemas.d.ts +311 -0
  16. package/dist/api/schemas.js +2 -0
  17. package/dist/index.d.ts +2 -182
  18. package/dist/index.js +16 -499
  19. package/dist/schema/filters.d.ts +20 -0
  20. package/dist/schema/filters.js +24 -0
  21. package/dist/schema/index.d.ts +5 -0
  22. package/dist/schema/index.js +25 -0
  23. package/dist/schema/operators.d.ts +21 -0
  24. package/dist/schema/operators.js +40 -0
  25. package/dist/schema/pagination.d.ts +41 -0
  26. package/dist/schema/pagination.js +58 -0
  27. package/dist/schema/query.d.ts +45 -0
  28. package/dist/schema/query.js +190 -0
  29. package/dist/schema/record.d.ts +10 -0
  30. package/dist/schema/record.js +2 -0
  31. package/dist/schema/repository.d.ts +52 -0
  32. package/dist/schema/repository.js +260 -0
  33. package/dist/schema/selection.d.ts +14 -0
  34. package/dist/schema/selection.js +2 -0
  35. package/dist/util/lang.d.ts +2 -0
  36. package/dist/util/lang.js +10 -0
  37. package/dist/util/types.d.ts +3 -0
  38. package/dist/util/types.js +2 -0
  39. package/package.json +2 -2
  40. package/dist/util/errors.d.ts +0 -3
  41. package/dist/util/errors.js +0 -9
@@ -0,0 +1,1416 @@
1
+ /**
2
+ * Generated by @openapi-codegen
3
+ *
4
+ * @version 1.0
5
+ */
6
+ import { FetcherExtraProps } from './fetcher';
7
+ import type * as Schemas from './schemas';
8
+ import type * as Responses from './responses';
9
+ export declare type GetUserVariables = FetcherExtraProps;
10
+ /**
11
+ * Return details of the user making the request
12
+ */
13
+ export declare const getUser: (variables: GetUserVariables) => Promise<Schemas.UserWithID>;
14
+ export declare type UpdateUserVariables = {
15
+ body: Schemas.User;
16
+ } & FetcherExtraProps;
17
+ /**
18
+ * Update user info
19
+ */
20
+ export declare const updateUser: (variables: UpdateUserVariables) => Promise<Schemas.UserWithID>;
21
+ export declare type DeleteUserVariables = FetcherExtraProps;
22
+ /**
23
+ * Delete the user making the request
24
+ */
25
+ export declare const deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
26
+ export declare type GetUserAPIKeysResponse = {
27
+ keys: {
28
+ name: string;
29
+ createdAt: Schemas.DateTime;
30
+ }[];
31
+ };
32
+ export declare type GetUserAPIKeysVariables = FetcherExtraProps;
33
+ /**
34
+ * Retrieve a list of existing user API keys
35
+ */
36
+ export declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
37
+ export declare type CreateUserAPIKeyPathParams = {
38
+ keyName: Schemas.APIKeyName;
39
+ };
40
+ export declare type CreateUserAPIKeyResponse = {
41
+ name: string;
42
+ key: string;
43
+ createdAt: Schemas.DateTime;
44
+ };
45
+ export declare type CreateUserAPIKeyVariables = {
46
+ pathParams: CreateUserAPIKeyPathParams;
47
+ } & FetcherExtraProps;
48
+ /**
49
+ * Create and return new API key
50
+ */
51
+ export declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
52
+ export declare type DeleteUserAPIKeyPathParams = {
53
+ keyName: Schemas.APIKeyName;
54
+ };
55
+ export declare type DeleteUserAPIKeyVariables = {
56
+ pathParams: DeleteUserAPIKeyPathParams;
57
+ } & FetcherExtraProps;
58
+ /**
59
+ * Delete an existing API key
60
+ */
61
+ export declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
62
+ export declare type CreateWorkspaceVariables = {
63
+ body: Schemas.WorkspaceMeta;
64
+ } & FetcherExtraProps;
65
+ /**
66
+ * Creates a new workspace with the user requesting it as its single owner.
67
+ */
68
+ export declare const createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Schemas.Workspace>;
69
+ export declare type GetWorkspacesListResponse = {
70
+ workspaces: {
71
+ id: Schemas.WorkspaceID;
72
+ name: string;
73
+ slug: string;
74
+ role: Schemas.Role;
75
+ }[];
76
+ };
77
+ export declare type GetWorkspacesListVariables = FetcherExtraProps;
78
+ /**
79
+ * Retrieve the list of workspaces the user belongs to
80
+ */
81
+ export declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
82
+ export declare type GetWorkspacePathParams = {
83
+ workspaceId: Schemas.WorkspaceID;
84
+ };
85
+ export declare type GetWorkspaceVariables = {
86
+ pathParams: GetWorkspacePathParams;
87
+ } & FetcherExtraProps;
88
+ /**
89
+ * Retrieve workspace info from a workspace ID
90
+ */
91
+ export declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Schemas.Workspace>;
92
+ export declare type UpdateWorkspacePathParams = {
93
+ workspaceId: Schemas.WorkspaceID;
94
+ };
95
+ export declare type UpdateWorkspaceVariables = {
96
+ body: Schemas.WorkspaceMeta;
97
+ pathParams: UpdateWorkspacePathParams;
98
+ } & FetcherExtraProps;
99
+ /**
100
+ * Update workspace info
101
+ */
102
+ export declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Schemas.Workspace>;
103
+ export declare type DeleteWorkspacePathParams = {
104
+ workspaceId: Schemas.WorkspaceID;
105
+ };
106
+ export declare type DeleteWorkspaceVariables = {
107
+ pathParams: DeleteWorkspacePathParams;
108
+ } & FetcherExtraProps;
109
+ /**
110
+ * Delete the workspace with the provided ID
111
+ */
112
+ export declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
113
+ export declare type GetWorkspaceMembersListPathParams = {
114
+ workspaceId: Schemas.WorkspaceID;
115
+ };
116
+ export declare type GetWorkspaceMembersListVariables = {
117
+ pathParams: GetWorkspaceMembersListPathParams;
118
+ } & FetcherExtraProps;
119
+ /**
120
+ * Retrieve the list of members of the given workspace
121
+ */
122
+ export declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<Schemas.WorkspaceMembers>;
123
+ export declare type UpdateWorkspaceMemberRolePathParams = {
124
+ workspaceId: Schemas.WorkspaceID;
125
+ userId: Schemas.UserID;
126
+ };
127
+ export declare type UpdateWorkspaceMemberRoleRequestBody = {
128
+ role: Schemas.Role;
129
+ };
130
+ export declare type UpdateWorkspaceMemberRoleVariables = {
131
+ body: UpdateWorkspaceMemberRoleRequestBody;
132
+ pathParams: UpdateWorkspaceMemberRolePathParams;
133
+ } & FetcherExtraProps;
134
+ /**
135
+ * 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.
136
+ */
137
+ export declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
138
+ export declare type RemoveWorkspaceMemberPathParams = {
139
+ workspaceId: Schemas.WorkspaceID;
140
+ userId: Schemas.UserID;
141
+ };
142
+ export declare type RemoveWorkspaceMemberVariables = {
143
+ pathParams: RemoveWorkspaceMemberPathParams;
144
+ } & FetcherExtraProps;
145
+ /**
146
+ * Remove the member from the workspace
147
+ */
148
+ export declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
149
+ export declare type InviteWorkspaceMemberPathParams = {
150
+ workspaceId: Schemas.WorkspaceID;
151
+ };
152
+ export declare type InviteWorkspaceMemberRequestBody = {
153
+ email: string;
154
+ role: Schemas.Role;
155
+ };
156
+ export declare type InviteWorkspaceMemberVariables = {
157
+ body: InviteWorkspaceMemberRequestBody;
158
+ pathParams: InviteWorkspaceMemberPathParams;
159
+ } & FetcherExtraProps;
160
+ /**
161
+ * Invite some user to join the workspace with the given role
162
+ */
163
+ export declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<Schemas.WorkspaceInvite>;
164
+ export declare type AcceptWorkspaceMemberInvitePathParams = {
165
+ workspaceId: Schemas.WorkspaceID;
166
+ inviteKey: Schemas.InviteKey;
167
+ };
168
+ export declare type AcceptWorkspaceMemberInviteVariables = {
169
+ pathParams: AcceptWorkspaceMemberInvitePathParams;
170
+ } & FetcherExtraProps;
171
+ /**
172
+ * Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
173
+ */
174
+ export declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
175
+ export declare type GetDatabaseListPathParams = {
176
+ workspace: string;
177
+ };
178
+ export declare type GetDatabaseListVariables = {
179
+ pathParams: GetDatabaseListPathParams;
180
+ } & FetcherExtraProps;
181
+ /**
182
+ * List all databases available in your Workspace.
183
+ */
184
+ export declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<Schemas.ListDatabasesResponse>;
185
+ export declare type GetBranchListPathParams = {
186
+ dbName: Schemas.DBName;
187
+ workspace: string;
188
+ };
189
+ export declare type GetBranchListVariables = {
190
+ pathParams: GetBranchListPathParams;
191
+ } & FetcherExtraProps;
192
+ /**
193
+ * List all available Branches
194
+ */
195
+ export declare const getBranchList: (variables: GetBranchListVariables) => Promise<Schemas.ListBranchesResponse>;
196
+ export declare type CreateDatabasePathParams = {
197
+ dbName: Schemas.DBName;
198
+ workspace: string;
199
+ };
200
+ export declare type CreateDatabaseResponse = {
201
+ databaseName: string;
202
+ branchName?: string;
203
+ };
204
+ export declare type CreateDatabaseRequestBody = {
205
+ displayName?: string;
206
+ branchName?: string;
207
+ ui?: {
208
+ color?: string;
209
+ };
210
+ metadata?: Schemas.BranchMetadata;
211
+ };
212
+ export declare type CreateDatabaseVariables = {
213
+ body?: CreateDatabaseRequestBody;
214
+ pathParams: CreateDatabasePathParams;
215
+ } & FetcherExtraProps;
216
+ /**
217
+ * Create Database with identifier name
218
+ */
219
+ export declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
220
+ export declare type DeleteDatabasePathParams = {
221
+ dbName: Schemas.DBName;
222
+ workspace: string;
223
+ };
224
+ export declare type DeleteDatabaseVariables = {
225
+ pathParams: DeleteDatabasePathParams;
226
+ } & FetcherExtraProps;
227
+ /**
228
+ * Delete a database and all of its branches and tables permanently.
229
+ */
230
+ export declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
231
+ export declare type GetBranchDetailsPathParams = {
232
+ dbBranchName: Schemas.DBBranchName;
233
+ workspace: string;
234
+ };
235
+ export declare type GetBranchDetailsVariables = {
236
+ pathParams: GetBranchDetailsPathParams;
237
+ } & FetcherExtraProps;
238
+ export declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<Schemas.DBBranch>;
239
+ export declare type CreateBranchPathParams = {
240
+ dbBranchName: Schemas.DBBranchName;
241
+ workspace: string;
242
+ };
243
+ export declare type CreateBranchQueryParams = {
244
+ from?: string;
245
+ };
246
+ export declare type CreateBranchRequestBody = {
247
+ from?: string;
248
+ metadata?: Schemas.BranchMetadata;
249
+ };
250
+ export declare type CreateBranchVariables = {
251
+ body?: CreateBranchRequestBody;
252
+ pathParams: CreateBranchPathParams;
253
+ queryParams?: CreateBranchQueryParams;
254
+ } & FetcherExtraProps;
255
+ export declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
256
+ export declare type DeleteBranchPathParams = {
257
+ dbBranchName: Schemas.DBBranchName;
258
+ workspace: string;
259
+ };
260
+ export declare type DeleteBranchVariables = {
261
+ pathParams: DeleteBranchPathParams;
262
+ } & FetcherExtraProps;
263
+ /**
264
+ * Delete the branch in the database and all its resources
265
+ */
266
+ export declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
267
+ export declare type UpdateBranchMetadataPathParams = {
268
+ dbBranchName: Schemas.DBBranchName;
269
+ workspace: string;
270
+ };
271
+ export declare type UpdateBranchMetadataVariables = {
272
+ body?: Schemas.BranchMetadata;
273
+ pathParams: UpdateBranchMetadataPathParams;
274
+ } & FetcherExtraProps;
275
+ /**
276
+ * Update the branch metadata
277
+ */
278
+ export declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
279
+ export declare type GetBranchMetadataPathParams = {
280
+ dbBranchName: Schemas.DBBranchName;
281
+ workspace: string;
282
+ };
283
+ export declare type GetBranchMetadataVariables = {
284
+ pathParams: GetBranchMetadataPathParams;
285
+ } & FetcherExtraProps;
286
+ export declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<Schemas.BranchMetadata>;
287
+ export declare type GetBranchMigrationHistoryPathParams = {
288
+ dbBranchName: Schemas.DBBranchName;
289
+ workspace: string;
290
+ };
291
+ export declare type GetBranchMigrationHistoryResponse = {
292
+ startedFrom?: Schemas.StartedFromMetadata;
293
+ migrations?: Schemas.BranchMigration[];
294
+ };
295
+ export declare type GetBranchMigrationHistoryRequestBody = {
296
+ limit?: number;
297
+ startFrom?: string;
298
+ };
299
+ export declare type GetBranchMigrationHistoryVariables = {
300
+ body?: GetBranchMigrationHistoryRequestBody;
301
+ pathParams: GetBranchMigrationHistoryPathParams;
302
+ } & FetcherExtraProps;
303
+ export declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
304
+ export declare type ExecuteBranchMigrationPlanPathParams = {
305
+ dbBranchName: Schemas.DBBranchName;
306
+ workspace: string;
307
+ };
308
+ export declare type ExecuteBranchMigrationPlanRequestBody = {
309
+ version: number;
310
+ migration: Schemas.BranchMigration;
311
+ };
312
+ export declare type ExecuteBranchMigrationPlanVariables = {
313
+ body: ExecuteBranchMigrationPlanRequestBody;
314
+ pathParams: ExecuteBranchMigrationPlanPathParams;
315
+ } & FetcherExtraProps;
316
+ /**
317
+ * Apply a migration plan to the branch
318
+ */
319
+ export declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
320
+ export declare type GetBranchMigrationPlanPathParams = {
321
+ dbBranchName: Schemas.DBBranchName;
322
+ workspace: string;
323
+ };
324
+ export declare type GetBranchMigrationPlanVariables = {
325
+ body: Schemas.Schema;
326
+ pathParams: GetBranchMigrationPlanPathParams;
327
+ } & FetcherExtraProps;
328
+ /**
329
+ * Compute a migration plan from a target schema the branch should be migrated too.
330
+ */
331
+ export declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<Responses.BranchMigrationPlan>;
332
+ export declare type GetBranchStatsPathParams = {
333
+ dbBranchName: Schemas.DBBranchName;
334
+ workspace: string;
335
+ };
336
+ export declare type GetBranchStatsResponse = {
337
+ timestamp: string;
338
+ interval: string;
339
+ resolution: string;
340
+ numberOfRecords?: Schemas.MetricsDatapoint[];
341
+ writesOverTime?: Schemas.MetricsDatapoint[];
342
+ readsOverTime?: Schemas.MetricsDatapoint[];
343
+ readLatency?: Schemas.MetricsLatency;
344
+ writeLatency?: Schemas.MetricsLatency;
345
+ warning?: string;
346
+ };
347
+ export declare type GetBranchStatsVariables = {
348
+ pathParams: GetBranchStatsPathParams;
349
+ } & FetcherExtraProps;
350
+ /**
351
+ * Get branch usage metrics.
352
+ */
353
+ export declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
354
+ export declare type CreateTablePathParams = {
355
+ dbBranchName: Schemas.DBBranchName;
356
+ tableName: Schemas.TableName;
357
+ workspace: string;
358
+ };
359
+ export declare type CreateTableVariables = {
360
+ pathParams: CreateTablePathParams;
361
+ } & FetcherExtraProps;
362
+ /**
363
+ * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
364
+ */
365
+ export declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
366
+ export declare type DeleteTablePathParams = {
367
+ dbBranchName: Schemas.DBBranchName;
368
+ tableName: Schemas.TableName;
369
+ workspace: string;
370
+ };
371
+ export declare type DeleteTableVariables = {
372
+ pathParams: DeleteTablePathParams;
373
+ } & FetcherExtraProps;
374
+ /**
375
+ * Deletes the table with the given name.
376
+ */
377
+ export declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
378
+ export declare type UpdateTablePathParams = {
379
+ dbBranchName: Schemas.DBBranchName;
380
+ tableName: Schemas.TableName;
381
+ workspace: string;
382
+ };
383
+ export declare type UpdateTableRequestBody = {
384
+ name: string;
385
+ };
386
+ export declare type UpdateTableVariables = {
387
+ body: UpdateTableRequestBody;
388
+ pathParams: UpdateTablePathParams;
389
+ } & FetcherExtraProps;
390
+ /**
391
+ * Update table. Currently there is only one update operation supported: renaming the table by providing a new name.
392
+ *
393
+ * In the example below, we rename a table from “users” to “people”:
394
+ *
395
+ * ```jsx
396
+ * PATCH /db/test:main/tables/users
397
+ * {
398
+ * "name": "people"
399
+ * }
400
+ * ```
401
+ */
402
+ export declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
403
+ export declare type GetTableSchemaPathParams = {
404
+ dbBranchName: Schemas.DBBranchName;
405
+ tableName: Schemas.TableName;
406
+ workspace: string;
407
+ };
408
+ export declare type GetTableSchemaResponse = {
409
+ columns: Schemas.Column[];
410
+ };
411
+ export declare type GetTableSchemaVariables = {
412
+ pathParams: GetTableSchemaPathParams;
413
+ } & FetcherExtraProps;
414
+ export declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
415
+ export declare type SetTableSchemaPathParams = {
416
+ dbBranchName: Schemas.DBBranchName;
417
+ tableName: Schemas.TableName;
418
+ workspace: string;
419
+ };
420
+ export declare type SetTableSchemaRequestBody = {
421
+ columns: Schemas.Column[];
422
+ };
423
+ export declare type SetTableSchemaVariables = {
424
+ body: SetTableSchemaRequestBody;
425
+ pathParams: SetTableSchemaPathParams;
426
+ } & FetcherExtraProps;
427
+ export declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
428
+ export declare type GetTableColumnsPathParams = {
429
+ dbBranchName: Schemas.DBBranchName;
430
+ tableName: Schemas.TableName;
431
+ workspace: string;
432
+ };
433
+ export declare type GetTableColumnsResponse = {
434
+ columns: Schemas.Column[];
435
+ };
436
+ export declare type GetTableColumnsVariables = {
437
+ pathParams: GetTableColumnsPathParams;
438
+ } & FetcherExtraProps;
439
+ /**
440
+ * Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
441
+ * full dot-separated path (flattened).
442
+ */
443
+ export declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
444
+ export declare type AddTableColumnPathParams = {
445
+ dbBranchName: Schemas.DBBranchName;
446
+ tableName: Schemas.TableName;
447
+ workspace: string;
448
+ };
449
+ export declare type AddTableColumnVariables = {
450
+ body: Schemas.Column;
451
+ pathParams: AddTableColumnPathParams;
452
+ } & FetcherExtraProps;
453
+ /**
454
+ * 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
455
+ * contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
456
+ * passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
457
+ */
458
+ export declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<Responses.MigrationIdResponse>;
459
+ export declare type GetColumnPathParams = {
460
+ dbBranchName: Schemas.DBBranchName;
461
+ tableName: Schemas.TableName;
462
+ columnName: Schemas.ColumnName;
463
+ workspace: string;
464
+ };
465
+ export declare type GetColumnVariables = {
466
+ pathParams: GetColumnPathParams;
467
+ } & FetcherExtraProps;
468
+ /**
469
+ * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
470
+ */
471
+ export declare const getColumn: (variables: GetColumnVariables) => Promise<Schemas.Column>;
472
+ export declare type DeleteColumnPathParams = {
473
+ dbBranchName: Schemas.DBBranchName;
474
+ tableName: Schemas.TableName;
475
+ columnName: Schemas.ColumnName;
476
+ workspace: string;
477
+ };
478
+ export declare type DeleteColumnVariables = {
479
+ pathParams: DeleteColumnPathParams;
480
+ } & FetcherExtraProps;
481
+ /**
482
+ * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
483
+ */
484
+ export declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<Responses.MigrationIdResponse>;
485
+ export declare type UpdateColumnPathParams = {
486
+ dbBranchName: Schemas.DBBranchName;
487
+ tableName: Schemas.TableName;
488
+ columnName: Schemas.ColumnName;
489
+ workspace: string;
490
+ };
491
+ export declare type UpdateColumnRequestBody = {
492
+ name: string;
493
+ };
494
+ export declare type UpdateColumnVariables = {
495
+ body: UpdateColumnRequestBody;
496
+ pathParams: UpdateColumnPathParams;
497
+ } & FetcherExtraProps;
498
+ /**
499
+ * 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`.
500
+ */
501
+ export declare const updateColumn: (variables: UpdateColumnVariables) => Promise<Responses.MigrationIdResponse>;
502
+ export declare type InsertRecordPathParams = {
503
+ dbBranchName: Schemas.DBBranchName;
504
+ tableName: Schemas.TableName;
505
+ workspace: string;
506
+ };
507
+ export declare type InsertRecordResponse = {
508
+ id: string;
509
+ xata: {
510
+ version: number;
511
+ };
512
+ };
513
+ export declare type InsertRecordVariables = {
514
+ body?: Record<string, any>;
515
+ pathParams: InsertRecordPathParams;
516
+ } & FetcherExtraProps;
517
+ /**
518
+ * Insert a new Record into the Table
519
+ */
520
+ export declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
521
+ export declare type InsertRecordWithIDPathParams = {
522
+ dbBranchName: Schemas.DBBranchName;
523
+ tableName: Schemas.TableName;
524
+ recordId: Schemas.RecordID;
525
+ workspace: string;
526
+ };
527
+ export declare type InsertRecordWithIDQueryParams = {
528
+ createOnly?: boolean;
529
+ ifVersion?: number;
530
+ };
531
+ export declare type InsertRecordWithIDVariables = {
532
+ body?: Record<string, any>;
533
+ pathParams: InsertRecordWithIDPathParams;
534
+ queryParams?: InsertRecordWithIDQueryParams;
535
+ } & FetcherExtraProps;
536
+ /**
537
+ * 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.
538
+ */
539
+ export declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<Responses.RecordUpdateResponse>;
540
+ export declare type UpdateRecordWithIDPathParams = {
541
+ dbBranchName: Schemas.DBBranchName;
542
+ tableName: Schemas.TableName;
543
+ recordId: Schemas.RecordID;
544
+ workspace: string;
545
+ };
546
+ export declare type UpdateRecordWithIDQueryParams = {
547
+ ifVersion?: number;
548
+ };
549
+ export declare type UpdateRecordWithIDVariables = {
550
+ body?: Record<string, any>;
551
+ pathParams: UpdateRecordWithIDPathParams;
552
+ queryParams?: UpdateRecordWithIDQueryParams;
553
+ } & FetcherExtraProps;
554
+ export declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<Responses.RecordUpdateResponse>;
555
+ export declare type UpsertRecordWithIDPathParams = {
556
+ dbBranchName: Schemas.DBBranchName;
557
+ tableName: Schemas.TableName;
558
+ recordId: Schemas.RecordID;
559
+ workspace: string;
560
+ };
561
+ export declare type UpsertRecordWithIDQueryParams = {
562
+ ifVersion?: number;
563
+ };
564
+ export declare type UpsertRecordWithIDVariables = {
565
+ body?: Record<string, any>;
566
+ pathParams: UpsertRecordWithIDPathParams;
567
+ queryParams?: UpsertRecordWithIDQueryParams;
568
+ } & FetcherExtraProps;
569
+ export declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<Responses.RecordUpdateResponse>;
570
+ export declare type DeleteRecordPathParams = {
571
+ dbBranchName: Schemas.DBBranchName;
572
+ tableName: Schemas.TableName;
573
+ recordId: Schemas.RecordID;
574
+ workspace: string;
575
+ };
576
+ export declare type DeleteRecordVariables = {
577
+ pathParams: DeleteRecordPathParams;
578
+ } & FetcherExtraProps;
579
+ export declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
580
+ export declare type GetRecordPathParams = {
581
+ dbBranchName: Schemas.DBBranchName;
582
+ tableName: Schemas.TableName;
583
+ recordId: Schemas.RecordID;
584
+ workspace: string;
585
+ };
586
+ export declare type GetRecordRequestBody = {
587
+ columns?: Schemas.ColumnsFilter;
588
+ };
589
+ export declare type GetRecordVariables = {
590
+ body?: GetRecordRequestBody;
591
+ pathParams: GetRecordPathParams;
592
+ } & FetcherExtraProps;
593
+ /**
594
+ * Retrieve record by ID
595
+ */
596
+ export declare const getRecord: (variables: GetRecordVariables) => Promise<Schemas.XataRecord>;
597
+ export declare type BulkInsertTableRecordsPathParams = {
598
+ dbBranchName: Schemas.DBBranchName;
599
+ tableName: Schemas.TableName;
600
+ workspace: string;
601
+ };
602
+ export declare type BulkInsertTableRecordsResponse = {
603
+ recordIDs: string[];
604
+ };
605
+ export declare type BulkInsertTableRecordsRequestBody = {
606
+ records: Record<string, any>[];
607
+ };
608
+ export declare type BulkInsertTableRecordsVariables = {
609
+ body: BulkInsertTableRecordsRequestBody;
610
+ pathParams: BulkInsertTableRecordsPathParams;
611
+ } & FetcherExtraProps;
612
+ /**
613
+ * Bulk insert records
614
+ */
615
+ export declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
616
+ export declare type QueryTablePathParams = {
617
+ dbBranchName: Schemas.DBBranchName;
618
+ tableName: Schemas.TableName;
619
+ workspace: string;
620
+ };
621
+ export declare type QueryTableRequestBody = {
622
+ filter?: Schemas.FilterExpression;
623
+ sort?: Schemas.SortExpression;
624
+ page?: Schemas.PageConfig;
625
+ columns?: Schemas.ColumnsFilter;
626
+ };
627
+ export declare type QueryTableVariables = {
628
+ body?: QueryTableRequestBody;
629
+ pathParams: QueryTablePathParams;
630
+ } & FetcherExtraProps;
631
+ /**
632
+ * The Query Table API can be used to retrieve all records in a table.
633
+ * The API support filtering, sorting, selecting a subset of columns, and pagination.
634
+ *
635
+ * The overall structure of the request looks like this:
636
+ *
637
+ * ```json
638
+ * // POST /db/<dbname>:<branch>/tables/<table>/query
639
+ * {
640
+ * "columns": [...],
641
+ * "filter": {
642
+ * "$all": [...]
643
+ * "$any": [...]
644
+ * ...
645
+ * },
646
+ * "sort": {
647
+ * "multiple": [...]
648
+ * ...
649
+ * },
650
+ * "page": {
651
+ * ...
652
+ * }
653
+ * }
654
+ * ```
655
+ *
656
+ * ### Column selection
657
+ *
658
+ * If the `columns` array is not specified, all columns are included. For link
659
+ * fields, only the ID column of the linked records is included in the response.
660
+ *
661
+ * If the `columns` array is specified, only the selected columns are included.
662
+ * The `*` wildcard can be used to select all columns of the given array
663
+ *
664
+ * For objects and link fields, if the column name of the object is specified, we
665
+ * include all of its sub-keys. If only some sub-keys are specified (via dotted
666
+ * notation, e.g. `"settings.plan"` ), then only those sub-keys from the object
667
+ * are included.
668
+ *
669
+ * By the way of example, assuming two tables like this:
670
+ *
671
+ * ```json {"truncate": true}
672
+ * {
673
+ * "formatVersion": "1.0",
674
+ * "tables": [
675
+ * {
676
+ * "name": "teams",
677
+ * "columns": [
678
+ * {
679
+ * "name": "name",
680
+ * "type": "string"
681
+ * },
682
+ * {
683
+ * "name": "owner",
684
+ * "type": "link",
685
+ * "link": {
686
+ * "table": "users"
687
+ * }
688
+ * }
689
+ * ]
690
+ * },
691
+ * {
692
+ * "name": "users",
693
+ * "columns": [
694
+ * {
695
+ * "name": "email",
696
+ * "type": "email"
697
+ * },
698
+ * {
699
+ * "name": "full_name",
700
+ * "type": "string"
701
+ * },
702
+ * {
703
+ * "name": "address",
704
+ * "type": "object",
705
+ * "columns": [
706
+ * {
707
+ * "name": "street",
708
+ * "type": "string"
709
+ * },
710
+ * {
711
+ * "name": "number",
712
+ * "type": "int"
713
+ * },
714
+ * {
715
+ * "name": "zipcode",
716
+ * "type": "int"
717
+ * }
718
+ * ]
719
+ * },
720
+ * {
721
+ * "name": "team",
722
+ * "type": "link",
723
+ * "link": {
724
+ * "table": "teams"
725
+ * }
726
+ * }
727
+ * ]
728
+ * }
729
+ * ]
730
+ * }
731
+ * ```
732
+ *
733
+ * A query like this:
734
+ *
735
+ * ```json
736
+ * POST /db/<dbname>:<branch>/tables/<table>/query
737
+ * {
738
+ * "columns": [
739
+ * "name",
740
+ * "address.*"
741
+ * ]
742
+ * }
743
+ * ```
744
+ *
745
+ * returns objects like:
746
+ *
747
+ * ```json
748
+ * {
749
+ * "name": "Kilian",
750
+ * "address": {
751
+ * "street": "New street",
752
+ * "number": 41,
753
+ * "zipcode": 10407
754
+ * }
755
+ * }
756
+ * ```
757
+ *
758
+ * while a query like this:
759
+ *
760
+ * ```json
761
+ * POST /db/<dbname>:<branch>/tables/<table>/query
762
+ * {
763
+ * "columns": [
764
+ * "name",
765
+ * "address.street"
766
+ * ]
767
+ * }
768
+ * ```
769
+ *
770
+ * returns objects like:
771
+ *
772
+ * ```json
773
+ * {
774
+ * "name": "Kilian",
775
+ * "address": {
776
+ * "street": "New street",
777
+ * }
778
+ * }
779
+ * ```
780
+ *
781
+ * If you want to return all columns from the main table and selected columns from the linked table, you can do it like this:
782
+ *
783
+ * ```json
784
+ * {
785
+ * "columns": [
786
+ * "*",
787
+ * "team.name"
788
+ * ]
789
+ * }
790
+ * ```
791
+ *
792
+ * The `"*"` in the above means all columns, including columns of objects. This returns data like:
793
+ *
794
+ * ```json
795
+ * {
796
+ * "name": "Kilian",
797
+ * "email": "kilian@gmail.com",
798
+ * "address": {
799
+ * "street": "New street",
800
+ * "number": 41,
801
+ * "zipcode": 10407
802
+ * },
803
+ * "team": {
804
+ * "id": "XX",
805
+ * "xata": {
806
+ * "version": 0,
807
+ * },
808
+ * "name": "first team"
809
+ * }
810
+ * }
811
+ * ```
812
+ *
813
+ * If you want all columns of the linked table, you can do:
814
+ *
815
+ * ```json
816
+ * {
817
+ * "columns": [
818
+ * "*",
819
+ * "team.*"
820
+ * ]
821
+ * }
822
+ * ```
823
+ *
824
+ * This returns, for example:
825
+ *
826
+ * ```json
827
+ * {
828
+ * "name": "Kilian",
829
+ * "email": "kilian@gmail.com",
830
+ * "address": {
831
+ * "street": "New street",
832
+ * "number": 41,
833
+ * "zipcode": 10407
834
+ * },
835
+ * "team": {
836
+ * "id": "XX",
837
+ * "xata": {
838
+ * "version": 0,
839
+ * },
840
+ * "name": "first team",
841
+ * "code": "A1"
842
+ * }
843
+ * }
844
+ * ```
845
+ *
846
+ * ### Filtering
847
+ *
848
+ * There are two types of operators:
849
+ *
850
+ * - Operators that work on a single column: `$is`, `$contains`, `$pattern`,
851
+ * `$includes`, `$gt`, etc.
852
+ * - Control operators that combine multiple conditions: `$any`, `$all`, `$not` ,
853
+ * `$none`, etc.
854
+ *
855
+ * All operators start with an `$` to differentiate them from column names
856
+ * (which are not allowed to start with an underscore).
857
+ *
858
+ * #### Exact matching and control operators
859
+ *
860
+ * Filter by one column:
861
+ *
862
+ * ```json
863
+ * {
864
+ * "filter": {
865
+ * "<column_name>": "value"
866
+ * }
867
+ * }
868
+ * ```
869
+ *
870
+ * This is equivalent to using the `$is` operator:
871
+ *
872
+ * ```json
873
+ * {
874
+ * "filter": {
875
+ * "<column_name>": {
876
+ * "$is": "value"
877
+ * }
878
+ * }
879
+ * }
880
+ * ```
881
+ *
882
+ * For example:
883
+ *
884
+ * ```json
885
+ * {
886
+ * "filter": {
887
+ * "name": "r2",
888
+ * }
889
+ * }
890
+ * ```
891
+ *
892
+ * Or:
893
+ *
894
+ * ```json
895
+ * {
896
+ * "filter": {
897
+ * "name": {
898
+ * "$is": "r2"
899
+ * }
900
+ * }
901
+ * }
902
+ * ```
903
+ *
904
+ * For objects, both dots and nested versions work:
905
+ *
906
+ * ```json
907
+ * {
908
+ * "filter": {
909
+ * "settings.plan": "free",
910
+ * }
911
+ * }
912
+ * ```
913
+ *
914
+ * ```json
915
+ * {
916
+ * "filter": {
917
+ * "settings": {
918
+ * "plan": "free"
919
+ * },
920
+ * },
921
+ * }
922
+ * ```
923
+ *
924
+ * If you want to OR together multiple values, you can use an array of values:
925
+ *
926
+ * ```json
927
+ * {
928
+ * "filter": {
929
+ * "settings.plan": ["free", "paid"]
930
+ * },
931
+ * }
932
+ * ```
933
+ *
934
+ * Same query with `$is` operator:
935
+ *
936
+ * ```json
937
+ * {
938
+ * "filter": {
939
+ * "settings.plan": { "$is": ["free", "paid"]}
940
+ * },
941
+ * }
942
+ * ```
943
+ *
944
+ * Specifying multiple columns, ANDs them together:
945
+ *
946
+ * ```json
947
+ * {
948
+ * "filter": {
949
+ * "settings.dark": true,
950
+ * "settings.plan": "free",
951
+ * },
952
+ * }
953
+ * ```
954
+ *
955
+ * To be more explicit about it, you can use `$all` or `$any`:
956
+ *
957
+ * ```json
958
+ * {
959
+ * "filter": {
960
+ * "$any": {
961
+ * "settings.dark": true,
962
+ * "settings.plan": "free",
963
+ * }
964
+ * },
965
+ * }
966
+ * ```
967
+ *
968
+ * `$all` and `$any` can also receive an array of objects, which allows for repeating columns:
969
+ *
970
+ * ```json
971
+ * {
972
+ * "filter": {
973
+ * "$any": [
974
+ * {
975
+ * "name": "r1",
976
+ * },
977
+ * {
978
+ * "name": "r2",
979
+ * },
980
+ * ],
981
+ * }
982
+ * ```
983
+ *
984
+ * You can check for a value being not-null with `$exists`:
985
+ *
986
+ * ```json
987
+ * {
988
+ * "filter": {
989
+ * "$exists": "settings",
990
+ * },
991
+ * }
992
+ * ```
993
+ *
994
+ * This can be combined with `$all` or `$any` :
995
+ *
996
+ * ```json
997
+ * {
998
+ * "filter": {
999
+ * "$all": [
1000
+ * {
1001
+ * "$exists": "settings",
1002
+ * },
1003
+ * {
1004
+ * "$exists": "name",
1005
+ * },
1006
+ * ],
1007
+ * }
1008
+ * }
1009
+ * ```
1010
+ *
1011
+ * We can also make the negation version, `$notExists` :
1012
+ *
1013
+ * ```json
1014
+ * {
1015
+ * "filter": {
1016
+ * "$notExists": "settings",
1017
+ * },
1018
+ * }
1019
+ * ```
1020
+ *
1021
+ * #### Partial match
1022
+ *
1023
+ * `$contains` is the simplest operator for partial matching. We should generally
1024
+ * discourage overusing `$contains` because it typically can't make use of
1025
+ * indices.
1026
+ *
1027
+ * ```json
1028
+ * {
1029
+ * "filter": {
1030
+ * "<column_name>": {
1031
+ * "$contains": "value"
1032
+ * }
1033
+ * }
1034
+ * }
1035
+ * ```
1036
+ *
1037
+ * Wildcards are supported via the `$pattern` operator:
1038
+ *
1039
+ * ```json
1040
+ * {
1041
+ * "filter": {
1042
+ * "<column_name>": {
1043
+ * "$pattern": "v*alue*"
1044
+ * }
1045
+ * }
1046
+ * }
1047
+ * ```
1048
+ *
1049
+ * We could also have `$endsWith` and `$startsWith` operators:
1050
+ *
1051
+ * ```json
1052
+ * {
1053
+ * "filter": {
1054
+ * "<column_name>": {
1055
+ * "$endsWith": ".gz"
1056
+ * },
1057
+ * "<column_name>": {
1058
+ * "$startsWith": "tmp-"
1059
+ * }
1060
+ * }
1061
+ * }
1062
+ * ```
1063
+ *
1064
+ * #### Numeric/date ranges
1065
+ *
1066
+ * ```json
1067
+ * {
1068
+ * "filter": {
1069
+ * "<column_name>": {
1070
+ * "$ge": 0,
1071
+ * "$lt": 100
1072
+ * }
1073
+ * }
1074
+ * }
1075
+ * ```
1076
+ *
1077
+ * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
1078
+ *
1079
+ * Date ranges would support the same operators, with the date as string in RFC 3339:
1080
+ *
1081
+ * ```json
1082
+ * {
1083
+ * "filter": {
1084
+ * "<column_name>": {
1085
+ * "$gt": "2019-10-12T07:20:50.52Z",
1086
+ * "$lt": "2021-10-12T07:20:50.52Z"
1087
+ * }
1088
+ * }
1089
+ * }
1090
+ * ```
1091
+ *
1092
+ * #### Negations
1093
+ *
1094
+ * A general `$not` operator can inverse any operation.
1095
+ *
1096
+ * ```json
1097
+ * {
1098
+ * "filter": {
1099
+ * "$not": {
1100
+ * "<column_name1>": "value1",
1101
+ * "<column_name2>": "value1"
1102
+ * }
1103
+ * }
1104
+ * }
1105
+ * ```
1106
+ *
1107
+ * Note: in the above the two condition are AND together, so this does (NOT ( ...
1108
+ * AND ...))
1109
+ *
1110
+ * Or more complex:
1111
+ *
1112
+ * ```json
1113
+ * {
1114
+ * "filter": {
1115
+ * "$not": {
1116
+ * "$any": [{
1117
+ * "<column_name1>": "value1"
1118
+ * }, {
1119
+ * "$all": [{
1120
+ * "<column_name2>": "value2"
1121
+ * }, {
1122
+ * "<column_name3>": "value3"
1123
+ * }]
1124
+ * }]
1125
+ * }
1126
+ * }
1127
+ * }
1128
+ * ```
1129
+ *
1130
+ * The `$not: { $any: {}}` can be shorted using the `$none` operator:
1131
+ *
1132
+ * ```json
1133
+ * {
1134
+ * "filter": {
1135
+ * "$none": {
1136
+ * "<column_name1>": "value1",
1137
+ * "<column_name2>": "value1"
1138
+ * }
1139
+ * }
1140
+ * }
1141
+ * ```
1142
+ *
1143
+ * In addition, we can add specific operators like `$isNot` to simplify expressions:
1144
+ *
1145
+ * ```json
1146
+ * {
1147
+ * "filter": {
1148
+ * "<column_name>": {
1149
+ * "$isNot": "2019-10-12T07:20:50.52Z"
1150
+ * }
1151
+ * }
1152
+ * }
1153
+ * ```
1154
+ *
1155
+ * #### Working with arrays
1156
+ *
1157
+ * To test that an array contains a value, use `$includes`.
1158
+ *
1159
+ * ```json
1160
+ * {
1161
+ * "filter": {
1162
+ * "<array_name>": {
1163
+ * "$includes": "value"
1164
+ * }
1165
+ * }
1166
+ * }
1167
+ * ```
1168
+ *
1169
+ * The `$includes` operator accepts a custom predicate that will check if any
1170
+ * array values matches the predicate. For example a complex predicate can include
1171
+ * the `$all` , `$contains` and `$endsWith` operators:
1172
+ *
1173
+ * ```json
1174
+ * {
1175
+ * "filter": {
1176
+ * "<array name>": {
1177
+ * "$includes": {
1178
+ * "$all": [
1179
+ * {"$contains": "label"},
1180
+ * {"$not": {"$endsWith": "-debug"}}
1181
+ * ]
1182
+ * }
1183
+ * }
1184
+ * }
1185
+ * }
1186
+ * ```
1187
+ *
1188
+ * The `$includes` all operator succeeds if any column in the array matches the
1189
+ * predicate. The `$includesAll` operator succeeds if all array items match the
1190
+ * predicate. The `$includesNone` operator succeeds if no array item matches the
1191
+ * predicate. The `$includes` operator is a synonym for the `$includesAny`
1192
+ * operator.
1193
+ *
1194
+ * ### Sorting
1195
+ *
1196
+ * Sorting by one element:
1197
+ *
1198
+ * ```json
1199
+ * POST /db/demo:main/tables/table/query
1200
+ * {
1201
+ * "sort": {
1202
+ * "index": "asc"
1203
+ * }
1204
+ * }
1205
+ * ```
1206
+ *
1207
+ * or descendently:
1208
+ *
1209
+ * ```json
1210
+ * POST /db/demo:main/tables/table/query
1211
+ * {
1212
+ * "sort": {
1213
+ * "index": "desc"
1214
+ * }
1215
+ * }
1216
+ * ```
1217
+ *
1218
+ * Sorting by multiple fields:
1219
+ *
1220
+ * ```json
1221
+ * POST /db/demo:main/tables/table/query
1222
+ * {
1223
+ * "sort": [
1224
+ * {
1225
+ * "index": "desc"
1226
+ * },
1227
+ * {
1228
+ * "createdAt": "desc"
1229
+ * }
1230
+ * ]
1231
+ * }
1232
+ * ```
1233
+ *
1234
+ *
1235
+ * ### Pagination
1236
+ *
1237
+ * We offer cursor pagination and offset pagination. The offset pagination is limited
1238
+ * in the amount of data it can retrieve, so we recommend the cursor pagination if you have more than 1000 records.
1239
+ *
1240
+ * Example of size + offset pagination:
1241
+ *
1242
+ * ```json
1243
+ * POST /db/demo:main/tables/table/query
1244
+ * {
1245
+ * "page": {
1246
+ * "size": 100,
1247
+ * "offset": 200
1248
+ * }
1249
+ * }
1250
+ * ```
1251
+ *
1252
+ * 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.
1253
+ * 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.
1254
+ *
1255
+ * Example of cursor pagination:
1256
+ *
1257
+ * ```json
1258
+ * POST /db/demo:main/tables/table/query
1259
+ * {
1260
+ * "page": {
1261
+ * "after":"fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD"
1262
+ * }
1263
+ * }
1264
+ * ```
1265
+ *
1266
+ * 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:
1267
+ *
1268
+ * ```json
1269
+ * {
1270
+ * "meta": {
1271
+ * "page": {
1272
+ * "cursor": "fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD",
1273
+ * "more": true
1274
+ * }
1275
+ * },
1276
+ * "records": [...]
1277
+ * }
1278
+ * ```
1279
+ *
1280
+ * The `page` object might contain the follow keys, in addition to `size` and `offset` that were introduced before:
1281
+ *
1282
+ * - `after`: Return the next page 'after' the current cursor
1283
+ * - `before`: Return the previous page 'before' the current cursor.
1284
+ * - `first`: Return the first page in the table from a cursor.
1285
+ * - `last`: Return the last N records in the table from a cursor, where N is the `page.size` parameter.
1286
+ *
1287
+ * The request will fail if an invalid cursor value is given to `page.before`,
1288
+ * `page.after`, `page.first` , or `page.last`. No other cursor setting can be
1289
+ * used if `page.first` or `page.last` is set in a query.
1290
+ *
1291
+ * If both `page.before` and `page.after` parameters are present we treat the
1292
+ * request as a range query. The range query will return all entries after
1293
+ * `page.after`, but before `page.before`, up to `page.size` or the maximum
1294
+ * page size. This query requires both cursors to use the same filters and sort
1295
+ * settings, plus we require `page.after < page.before`. The range query returns
1296
+ * a new cursor. If the range encompass multiple pages the next page in the range
1297
+ * can be queried by update `page.after` to the returned cursor while keeping the
1298
+ * `page.before` cursor from the first range query.
1299
+ *
1300
+ * The `filter` , `columns`, `sort` , and `page.size` configuration will be
1301
+ * encoded with the cursor. The pagination request will be invalid if
1302
+ * `filter` or `sort` is set. The columns returned and page size can be changed
1303
+ * anytime by passing the `columns` or `page.size` settings to the next query.
1304
+ *
1305
+ * **Special cursors:**
1306
+ *
1307
+ * - `page.after=end`: Result points past the last entry. The list of records
1308
+ * returned is empty, but `page.meta.cursor` will include a cursor that can be
1309
+ * used to "tail" the table from the end waiting for new data to be inserted.
1310
+ * - `page.before=end`: This cursor returns the last page.
1311
+ * - `page.first=<cursor>`: Go to first page. This is equivalent to querying the
1312
+ * first page without a cursor but `filter` and `sort` . Yet the `page.first`
1313
+ * cursor can be convenient at times as user code does not need to remember the
1314
+ * filter, sort, columns or page size configuration. All these information are
1315
+ * read from the cursor.
1316
+ * - `page.last=<cursor>`: Go to the end of the table. This is equivalent to querying the
1317
+ * last page with `page.before=end`, `filter`, and `sort` . Yet the
1318
+ * `page.last` cursor can be more convenient at times as user code does not
1319
+ * need to remember the filter, sort, columns or page size configuration. All
1320
+ * these information are read from the cursor.
1321
+ *
1322
+ * When using special cursors like `page.after="end"` or `page.before="end"`, we
1323
+ * still allow `filter` and `sort` to be set.
1324
+ *
1325
+ * Example of getting the last page:
1326
+ *
1327
+ * ```json
1328
+ * POST /db/demo:main/tables/table/query
1329
+ * {
1330
+ * "page": {
1331
+ * "size": 10,
1332
+ * "before": "end"
1333
+ * }
1334
+ * }
1335
+ * ```
1336
+ */
1337
+ export declare const queryTable: (variables: QueryTableVariables) => Promise<Responses.QueryResponse>;
1338
+ export declare type SearchBranchPathParams = {
1339
+ dbBranchName: Schemas.DBBranchName;
1340
+ workspace: string;
1341
+ };
1342
+ export declare type SearchBranchRequestBody = {
1343
+ tables?: string[];
1344
+ query: string;
1345
+ fuzziness?: number;
1346
+ };
1347
+ export declare type SearchBranchVariables = {
1348
+ body: SearchBranchRequestBody;
1349
+ pathParams: SearchBranchPathParams;
1350
+ } & FetcherExtraProps;
1351
+ /**
1352
+ * Run a free text search operation across the database branch.
1353
+ */
1354
+ export declare const searchBranch: (variables: SearchBranchVariables) => Promise<Responses.SearchResponse>;
1355
+ export declare const operationsByTag: {
1356
+ users: {
1357
+ getUser: (variables: GetUserVariables) => Promise<Schemas.UserWithID>;
1358
+ updateUser: (variables: UpdateUserVariables) => Promise<Schemas.UserWithID>;
1359
+ deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
1360
+ getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
1361
+ createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
1362
+ deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
1363
+ };
1364
+ workspaces: {
1365
+ createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Schemas.Workspace>;
1366
+ getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
1367
+ getWorkspace: (variables: GetWorkspaceVariables) => Promise<Schemas.Workspace>;
1368
+ updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Schemas.Workspace>;
1369
+ deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
1370
+ getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<Schemas.WorkspaceMembers>;
1371
+ updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
1372
+ removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
1373
+ inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<Schemas.WorkspaceInvite>;
1374
+ acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
1375
+ };
1376
+ database: {
1377
+ getDatabaseList: (variables: GetDatabaseListVariables) => Promise<Schemas.ListDatabasesResponse>;
1378
+ createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
1379
+ deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1380
+ };
1381
+ branch: {
1382
+ getBranchList: (variables: GetBranchListVariables) => Promise<Schemas.ListBranchesResponse>;
1383
+ getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<Schemas.DBBranch>;
1384
+ createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
1385
+ deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1386
+ updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1387
+ getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<Schemas.BranchMetadata>;
1388
+ getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1389
+ executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
1390
+ getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<Responses.BranchMigrationPlan>;
1391
+ getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
1392
+ };
1393
+ table: {
1394
+ createTable: (variables: CreateTableVariables) => Promise<undefined>;
1395
+ deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
1396
+ updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
1397
+ getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
1398
+ setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
1399
+ getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
1400
+ addTableColumn: (variables: AddTableColumnVariables) => Promise<Responses.MigrationIdResponse>;
1401
+ getColumn: (variables: GetColumnVariables) => Promise<Schemas.Column>;
1402
+ deleteColumn: (variables: DeleteColumnVariables) => Promise<Responses.MigrationIdResponse>;
1403
+ updateColumn: (variables: UpdateColumnVariables) => Promise<Responses.MigrationIdResponse>;
1404
+ };
1405
+ records: {
1406
+ insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
1407
+ insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<Responses.RecordUpdateResponse>;
1408
+ updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<Responses.RecordUpdateResponse>;
1409
+ upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<Responses.RecordUpdateResponse>;
1410
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
1411
+ getRecord: (variables: GetRecordVariables) => Promise<Schemas.XataRecord>;
1412
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
1413
+ queryTable: (variables: QueryTableVariables) => Promise<Responses.QueryResponse>;
1414
+ searchBranch: (variables: SearchBranchVariables) => Promise<Responses.SearchResponse>;
1415
+ };
1416
+ };