@xata.io/client 0.8.2 → 0.9.0

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