@xata.io/client 0.0.0-alpha.vebf0406 → 0.0.0-alpha.vec0bff6

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.
package/dist/index.d.ts CHANGED
@@ -6,6 +6,9 @@ declare type FetchImpl = (url: string, init?: {
6
6
  ok: boolean;
7
7
  status: number;
8
8
  json(): Promise<any>;
9
+ headers?: {
10
+ get(name: string): string | null;
11
+ };
9
12
  }>;
10
13
  declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
11
14
  declare type FetcherExtraProps = {
@@ -19,11 +22,36 @@ declare type ErrorWrapper<TError> = TError | {
19
22
  payload: string;
20
23
  };
21
24
 
25
+ interface CacheImpl {
26
+ defaultQueryTTL: number;
27
+ getAll(): Promise<Record<string, unknown>>;
28
+ get: <T>(key: string) => Promise<T | null>;
29
+ set: <T>(key: string, value: T) => Promise<void>;
30
+ delete: (key: string) => Promise<void>;
31
+ clear: () => Promise<void>;
32
+ }
33
+ interface SimpleCacheOptions {
34
+ max?: number;
35
+ defaultQueryTTL?: number;
36
+ }
37
+ declare class SimpleCache implements CacheImpl {
38
+ #private;
39
+ capacity: number;
40
+ defaultQueryTTL: number;
41
+ constructor(options?: SimpleCacheOptions);
42
+ getAll(): Promise<Record<string, unknown>>;
43
+ get<T>(key: string): Promise<T | null>;
44
+ set<T>(key: string, value: T): Promise<void>;
45
+ delete(key: string): Promise<void>;
46
+ clear(): Promise<void>;
47
+ }
48
+
22
49
  declare abstract class XataPlugin {
23
50
  abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
24
51
  }
25
52
  declare type XataPluginOptions = {
26
53
  getFetchProps: () => Promise<FetcherExtraProps>;
54
+ cache: CacheImpl;
27
55
  };
28
56
 
29
57
  /**
@@ -110,6 +138,12 @@ declare type ListBranchesResponse = {
110
138
  displayName: string;
111
139
  branches: Branch[];
112
140
  };
141
+ declare type ListGitBranchesResponse = {
142
+ mapping: {
143
+ gitBranch: string;
144
+ xataBranch: string;
145
+ }[];
146
+ };
113
147
  declare type Branch = {
114
148
  name: string;
115
149
  createdAt: DateTime;
@@ -158,7 +192,7 @@ declare type Table = {
158
192
  */
159
193
  declare type Column = {
160
194
  name: string;
161
- type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
195
+ type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
162
196
  link?: {
163
197
  table: string;
164
198
  };
@@ -234,6 +268,21 @@ declare type SortExpression = string[] | {
234
268
  [key: string]: SortOrder;
235
269
  }[];
236
270
  declare type SortOrder = 'asc' | 'desc';
271
+ /**
272
+ * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
273
+ * distance is the number of one charcter changes needed to make two strings equal. The default is 1, meaning that single
274
+ * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
275
+ * to allow two typos in a word.
276
+ *
277
+ * @default 1
278
+ * @maximum 2
279
+ * @minimum 0
280
+ */
281
+ declare type FuzzinessExpression = number;
282
+ /**
283
+ * If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
284
+ */
285
+ declare type PrefixExpression = 'phrase' | 'disabled';
237
286
  /**
238
287
  * @minProperties 1
239
288
  */
@@ -247,6 +296,48 @@ declare type FilterExpression = {
247
296
  } & {
248
297
  [key: string]: FilterColumn;
249
298
  };
299
+ declare type HighlightExpression = {
300
+ enabled?: boolean;
301
+ encodeHTML?: boolean;
302
+ };
303
+ /**
304
+ * Booster Expression
305
+ *
306
+ * @x-go-type xata.BoosterExpression
307
+ */
308
+ declare type BoosterExpression = {
309
+ valueBooster?: ValueBooster$1;
310
+ } | {
311
+ numericBooster?: NumericBooster$1;
312
+ } | {
313
+ dateBooster?: DateBooster$1;
314
+ };
315
+ /**
316
+ * Boost records with a particular value for a column.
317
+ */
318
+ declare type ValueBooster$1 = {
319
+ column: string;
320
+ value: string | number | boolean;
321
+ factor: number;
322
+ };
323
+ /**
324
+ * Boost records based on the value of a numeric column.
325
+ */
326
+ declare type NumericBooster$1 = {
327
+ column: string;
328
+ factor: number;
329
+ };
330
+ /**
331
+ * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
332
+ * the more the score is decayed. The decay function uses an exponential function. For example if origin is "now", and scale is 10 days and decay is 0.5, it
333
+ * should be interpreted as: a record with a date 10 days before/after origin will score 2 times less than a record with the date at origin.
334
+ */
335
+ declare type DateBooster$1 = {
336
+ column: string;
337
+ origin?: string;
338
+ scale: string;
339
+ decay: number;
340
+ };
250
341
  declare type FilterList = FilterExpression | FilterExpression[];
251
342
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
252
343
  /**
@@ -303,7 +394,24 @@ declare type PageConfig = {
303
394
  size?: number;
304
395
  offset?: number;
305
396
  };
306
- declare type ColumnsFilter = string[];
397
+ declare type ColumnsProjection = string[];
398
+ /**
399
+ * Xata Table Record Metadata
400
+ */
401
+ declare type RecordMeta = {
402
+ id: RecordID;
403
+ xata: {
404
+ version: number;
405
+ table?: string;
406
+ highlight?: {
407
+ [key: string]: string[] | {
408
+ [key: string]: any;
409
+ };
410
+ };
411
+ score?: number;
412
+ warnings?: string[];
413
+ };
414
+ };
307
415
  /**
308
416
  * @pattern [a-zA-Z0-9_-~:]+
309
417
  */
@@ -325,16 +433,9 @@ declare type RecordsMetadata = {
325
433
  };
326
434
  };
327
435
  /**
328
- * Xata Table Record
436
+ * Xata Table Record Metadata
329
437
  */
330
- declare type XataRecord$1 = {
331
- id: RecordID;
332
- xata: {
333
- version: number;
334
- table?: string;
335
- warnings?: string[];
336
- };
337
- } & {
438
+ declare type XataRecord$1 = RecordMeta & {
338
439
  [key: string]: any;
339
440
  };
340
441
 
@@ -354,6 +455,7 @@ type schemas_WorkspaceMembers = WorkspaceMembers;
354
455
  type schemas_InviteKey = InviteKey;
355
456
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
356
457
  type schemas_ListBranchesResponse = ListBranchesResponse;
458
+ type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
357
459
  type schemas_Branch = Branch;
358
460
  type schemas_BranchMetadata = BranchMetadata;
359
461
  type schemas_DBBranch = DBBranch;
@@ -374,7 +476,11 @@ type schemas_TableMigration = TableMigration;
374
476
  type schemas_ColumnMigration = ColumnMigration;
375
477
  type schemas_SortExpression = SortExpression;
376
478
  type schemas_SortOrder = SortOrder;
479
+ type schemas_FuzzinessExpression = FuzzinessExpression;
480
+ type schemas_PrefixExpression = PrefixExpression;
377
481
  type schemas_FilterExpression = FilterExpression;
482
+ type schemas_HighlightExpression = HighlightExpression;
483
+ type schemas_BoosterExpression = BoosterExpression;
378
484
  type schemas_FilterList = FilterList;
379
485
  type schemas_FilterColumn = FilterColumn;
380
486
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -384,7 +490,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
384
490
  type schemas_FilterRangeValue = FilterRangeValue;
385
491
  type schemas_FilterValue = FilterValue;
386
492
  type schemas_PageConfig = PageConfig;
387
- type schemas_ColumnsFilter = ColumnsFilter;
493
+ type schemas_ColumnsProjection = ColumnsProjection;
494
+ type schemas_RecordMeta = RecordMeta;
388
495
  type schemas_RecordID = RecordID;
389
496
  type schemas_TableRename = TableRename;
390
497
  type schemas_RecordsMetadata = RecordsMetadata;
@@ -406,6 +513,7 @@ declare namespace schemas {
406
513
  schemas_InviteKey as InviteKey,
407
514
  schemas_ListDatabasesResponse as ListDatabasesResponse,
408
515
  schemas_ListBranchesResponse as ListBranchesResponse,
516
+ schemas_ListGitBranchesResponse as ListGitBranchesResponse,
409
517
  schemas_Branch as Branch,
410
518
  schemas_BranchMetadata as BranchMetadata,
411
519
  schemas_DBBranch as DBBranch,
@@ -426,7 +534,14 @@ declare namespace schemas {
426
534
  schemas_ColumnMigration as ColumnMigration,
427
535
  schemas_SortExpression as SortExpression,
428
536
  schemas_SortOrder as SortOrder,
537
+ schemas_FuzzinessExpression as FuzzinessExpression,
538
+ schemas_PrefixExpression as PrefixExpression,
429
539
  schemas_FilterExpression as FilterExpression,
540
+ schemas_HighlightExpression as HighlightExpression,
541
+ schemas_BoosterExpression as BoosterExpression,
542
+ ValueBooster$1 as ValueBooster,
543
+ NumericBooster$1 as NumericBooster,
544
+ DateBooster$1 as DateBooster,
430
545
  schemas_FilterList as FilterList,
431
546
  schemas_FilterColumn as FilterColumn,
432
547
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -436,7 +551,8 @@ declare namespace schemas {
436
551
  schemas_FilterRangeValue as FilterRangeValue,
437
552
  schemas_FilterValue as FilterValue,
438
553
  schemas_PageConfig as PageConfig,
439
- schemas_ColumnsFilter as ColumnsFilter,
554
+ schemas_ColumnsProjection as ColumnsProjection,
555
+ schemas_RecordMeta as RecordMeta,
440
556
  schemas_RecordID as RecordID,
441
557
  schemas_TableRename as TableRename,
442
558
  schemas_RecordsMetadata as RecordsMetadata,
@@ -471,11 +587,17 @@ declare type BulkError = {
471
587
  status?: number;
472
588
  }[];
473
589
  };
590
+ declare type BulkInsertResponse = {
591
+ recordIDs: string[];
592
+ } | {
593
+ records: XataRecord$1[];
594
+ };
474
595
  declare type BranchMigrationPlan = {
475
596
  version: number;
476
597
  migration: BranchMigration;
477
598
  };
478
- declare type RecordUpdateResponse = {
599
+ declare type RecordResponse = XataRecord$1;
600
+ declare type RecordUpdateResponse = XataRecord$1 | {
479
601
  id: string;
480
602
  xata: {
481
603
  version: number;
@@ -499,7 +621,9 @@ type responses_SimpleError = SimpleError;
499
621
  type responses_BadRequestError = BadRequestError;
500
622
  type responses_AuthError = AuthError;
501
623
  type responses_BulkError = BulkError;
624
+ type responses_BulkInsertResponse = BulkInsertResponse;
502
625
  type responses_BranchMigrationPlan = BranchMigrationPlan;
626
+ type responses_RecordResponse = RecordResponse;
503
627
  type responses_RecordUpdateResponse = RecordUpdateResponse;
504
628
  type responses_QueryResponse = QueryResponse;
505
629
  type responses_SearchResponse = SearchResponse;
@@ -510,7 +634,9 @@ declare namespace responses {
510
634
  responses_BadRequestError as BadRequestError,
511
635
  responses_AuthError as AuthError,
512
636
  responses_BulkError as BulkError,
637
+ responses_BulkInsertResponse as BulkInsertResponse,
513
638
  responses_BranchMigrationPlan as BranchMigrationPlan,
639
+ responses_RecordResponse as RecordResponse,
514
640
  responses_RecordUpdateResponse as RecordUpdateResponse,
515
641
  responses_QueryResponse as QueryResponse,
516
642
  responses_SearchResponse as SearchResponse,
@@ -816,6 +942,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
816
942
  } | {
817
943
  status: 404;
818
944
  payload: SimpleError;
945
+ } | {
946
+ status: 409;
947
+ payload: SimpleError;
819
948
  }>;
820
949
  declare type InviteWorkspaceMemberRequestBody = {
821
950
  email: string;
@@ -829,6 +958,34 @@ declare type InviteWorkspaceMemberVariables = {
829
958
  * Invite some user to join the workspace with the given role
830
959
  */
831
960
  declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
961
+ declare type UpdateWorkspaceMemberInvitePathParams = {
962
+ workspaceId: WorkspaceID;
963
+ inviteId: InviteID;
964
+ };
965
+ declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
966
+ status: 400;
967
+ payload: BadRequestError;
968
+ } | {
969
+ status: 401;
970
+ payload: AuthError;
971
+ } | {
972
+ status: 404;
973
+ payload: SimpleError;
974
+ } | {
975
+ status: 422;
976
+ payload: SimpleError;
977
+ }>;
978
+ declare type UpdateWorkspaceMemberInviteRequestBody = {
979
+ role: Role;
980
+ };
981
+ declare type UpdateWorkspaceMemberInviteVariables = {
982
+ body: UpdateWorkspaceMemberInviteRequestBody;
983
+ pathParams: UpdateWorkspaceMemberInvitePathParams;
984
+ } & FetcherExtraProps;
985
+ /**
986
+ * This operation provides a way to update an existing invite. Updates are performed in-place; they do not change the invite link, the expiry time, nor do they re-notify the recipient of the invite.
987
+ */
988
+ declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
832
989
  declare type CancelWorkspaceMemberInvitePathParams = {
833
990
  workspaceId: WorkspaceID;
834
991
  inviteId: InviteID;
@@ -982,6 +1139,163 @@ declare type DeleteDatabaseVariables = {
982
1139
  * Delete a database and all of its branches and tables permanently.
983
1140
  */
984
1141
  declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1142
+ declare type GetGitBranchesMappingPathParams = {
1143
+ dbName: DBName;
1144
+ workspace: string;
1145
+ };
1146
+ declare type GetGitBranchesMappingError = ErrorWrapper<{
1147
+ status: 400;
1148
+ payload: BadRequestError;
1149
+ } | {
1150
+ status: 401;
1151
+ payload: AuthError;
1152
+ }>;
1153
+ declare type GetGitBranchesMappingVariables = {
1154
+ pathParams: GetGitBranchesMappingPathParams;
1155
+ } & FetcherExtraProps;
1156
+ /**
1157
+ * Lists all the git branches in the mapping, and their associated Xata branches.
1158
+ *
1159
+ * Example response:
1160
+ *
1161
+ * ```json
1162
+ * {
1163
+ * "mappings": [
1164
+ * {
1165
+ * "gitBranch": "main",
1166
+ * "xataBranch": "main"
1167
+ * },
1168
+ * {
1169
+ * "gitBranch": "gitBranch1",
1170
+ * "xataBranch": "xataBranch1"
1171
+ * }
1172
+ * {
1173
+ * "gitBranch": "xataBranch2",
1174
+ * "xataBranch": "xataBranch2"
1175
+ * }
1176
+ * ]
1177
+ * }
1178
+ * ```
1179
+ */
1180
+ declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
1181
+ declare type AddGitBranchesEntryPathParams = {
1182
+ dbName: DBName;
1183
+ workspace: string;
1184
+ };
1185
+ declare type AddGitBranchesEntryError = ErrorWrapper<{
1186
+ status: 400;
1187
+ payload: BadRequestError;
1188
+ } | {
1189
+ status: 401;
1190
+ payload: AuthError;
1191
+ }>;
1192
+ declare type AddGitBranchesEntryResponse = {
1193
+ warning?: string;
1194
+ };
1195
+ declare type AddGitBranchesEntryRequestBody = {
1196
+ gitBranch: string;
1197
+ xataBranch: BranchName;
1198
+ };
1199
+ declare type AddGitBranchesEntryVariables = {
1200
+ body: AddGitBranchesEntryRequestBody;
1201
+ pathParams: AddGitBranchesEntryPathParams;
1202
+ } & FetcherExtraProps;
1203
+ /**
1204
+ * Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.
1205
+ *
1206
+ * If the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.
1207
+ *
1208
+ * Example request:
1209
+ *
1210
+ * ```json
1211
+ * // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
1212
+ * {
1213
+ * "gitBranch": "fix/bug123",
1214
+ * "xataBranch": "fix_bug"
1215
+ * }
1216
+ * ```
1217
+ */
1218
+ declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
1219
+ declare type RemoveGitBranchesEntryPathParams = {
1220
+ dbName: DBName;
1221
+ workspace: string;
1222
+ };
1223
+ declare type RemoveGitBranchesEntryQueryParams = {
1224
+ gitBranch: string;
1225
+ };
1226
+ declare type RemoveGitBranchesEntryError = ErrorWrapper<{
1227
+ status: 400;
1228
+ payload: BadRequestError;
1229
+ } | {
1230
+ status: 401;
1231
+ payload: AuthError;
1232
+ }>;
1233
+ declare type RemoveGitBranchesEntryVariables = {
1234
+ pathParams: RemoveGitBranchesEntryPathParams;
1235
+ queryParams: RemoveGitBranchesEntryQueryParams;
1236
+ } & FetcherExtraProps;
1237
+ /**
1238
+ * Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
1239
+ *
1240
+ * Example request:
1241
+ *
1242
+ * ```json
1243
+ * // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
1244
+ * ```
1245
+ */
1246
+ declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
1247
+ declare type ResolveBranchPathParams = {
1248
+ dbName: DBName;
1249
+ workspace: string;
1250
+ };
1251
+ declare type ResolveBranchQueryParams = {
1252
+ gitBranch?: string;
1253
+ fallbackBranch?: string;
1254
+ };
1255
+ declare type ResolveBranchError = ErrorWrapper<{
1256
+ status: 400;
1257
+ payload: BadRequestError;
1258
+ } | {
1259
+ status: 401;
1260
+ payload: AuthError;
1261
+ }>;
1262
+ declare type ResolveBranchResponse = {
1263
+ branch: string;
1264
+ reason: {
1265
+ code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
1266
+ message: string;
1267
+ };
1268
+ };
1269
+ declare type ResolveBranchVariables = {
1270
+ pathParams: ResolveBranchPathParams;
1271
+ queryParams?: ResolveBranchQueryParams;
1272
+ } & FetcherExtraProps;
1273
+ /**
1274
+ * In order to resolve the database branch, the following algorithm is used:
1275
+ * * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
1276
+ * * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
1277
+ * * else, if `fallbackBranch` is provided and a branch with that name exists, return it
1278
+ * * else, return the default branch of the DB (`main` or the first branch)
1279
+ *
1280
+ * Example call:
1281
+ *
1282
+ * ```json
1283
+ * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
1284
+ * ```
1285
+ *
1286
+ * Example response:
1287
+ *
1288
+ * ```json
1289
+ * {
1290
+ * "branch": "main",
1291
+ * "reason": {
1292
+ * "code": "DEFAULT_BRANCH",
1293
+ * "message": "Default branch for this database (main)"
1294
+ * }
1295
+ * }
1296
+ * ```
1297
+ */
1298
+ declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
985
1299
  declare type GetBranchDetailsPathParams = {
986
1300
  dbBranchName: DBBranchName;
987
1301
  workspace: string;
@@ -1017,6 +1331,10 @@ declare type CreateBranchError = ErrorWrapper<{
1017
1331
  status: 404;
1018
1332
  payload: SimpleError;
1019
1333
  }>;
1334
+ declare type CreateBranchResponse = {
1335
+ databaseName: string;
1336
+ branchName: string;
1337
+ };
1020
1338
  declare type CreateBranchRequestBody = {
1021
1339
  from?: string;
1022
1340
  metadata?: BranchMetadata;
@@ -1026,7 +1344,7 @@ declare type CreateBranchVariables = {
1026
1344
  pathParams: CreateBranchPathParams;
1027
1345
  queryParams?: CreateBranchQueryParams;
1028
1346
  } & FetcherExtraProps;
1029
- declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
1347
+ declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
1030
1348
  declare type DeleteBranchPathParams = {
1031
1349
  dbBranchName: DBBranchName;
1032
1350
  workspace: string;
@@ -1213,13 +1531,17 @@ declare type CreateTableError = ErrorWrapper<{
1213
1531
  status: 422;
1214
1532
  payload: SimpleError;
1215
1533
  }>;
1534
+ declare type CreateTableResponse = {
1535
+ branchName: string;
1536
+ tableName: string;
1537
+ };
1216
1538
  declare type CreateTableVariables = {
1217
1539
  pathParams: CreateTablePathParams;
1218
1540
  } & FetcherExtraProps;
1219
1541
  /**
1220
1542
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1221
1543
  */
1222
- declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
1544
+ declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
1223
1545
  declare type DeleteTablePathParams = {
1224
1546
  dbBranchName: DBBranchName;
1225
1547
  tableName: TableName;
@@ -1266,8 +1588,9 @@ declare type UpdateTableVariables = {
1266
1588
  *
1267
1589
  * In the example below, we rename a table from “users” to “people”:
1268
1590
  *
1269
- * ```jsx
1270
- * PATCH /db/test:main/tables/users
1591
+ * ```json
1592
+ * // PATCH /db/test:main/tables/users
1593
+ *
1271
1594
  * {
1272
1595
  * "name": "people"
1273
1596
  * }
@@ -1451,6 +1774,9 @@ declare type InsertRecordPathParams = {
1451
1774
  tableName: TableName;
1452
1775
  workspace: string;
1453
1776
  };
1777
+ declare type InsertRecordQueryParams = {
1778
+ columns?: ColumnsProjection;
1779
+ };
1454
1780
  declare type InsertRecordError = ErrorWrapper<{
1455
1781
  status: 400;
1456
1782
  payload: BadRequestError;
@@ -1461,20 +1787,15 @@ declare type InsertRecordError = ErrorWrapper<{
1461
1787
  status: 404;
1462
1788
  payload: SimpleError;
1463
1789
  }>;
1464
- declare type InsertRecordResponse = {
1465
- id: string;
1466
- xata: {
1467
- version: number;
1468
- };
1469
- };
1470
1790
  declare type InsertRecordVariables = {
1471
1791
  body?: Record<string, any>;
1472
1792
  pathParams: InsertRecordPathParams;
1793
+ queryParams?: InsertRecordQueryParams;
1473
1794
  } & FetcherExtraProps;
1474
1795
  /**
1475
1796
  * Insert a new Record into the Table
1476
1797
  */
1477
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
1798
+ declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
1478
1799
  declare type InsertRecordWithIDPathParams = {
1479
1800
  dbBranchName: DBBranchName;
1480
1801
  tableName: TableName;
@@ -1482,6 +1803,7 @@ declare type InsertRecordWithIDPathParams = {
1482
1803
  workspace: string;
1483
1804
  };
1484
1805
  declare type InsertRecordWithIDQueryParams = {
1806
+ columns?: ColumnsProjection;
1485
1807
  createOnly?: boolean;
1486
1808
  ifVersion?: number;
1487
1809
  };
@@ -1514,6 +1836,7 @@ declare type UpdateRecordWithIDPathParams = {
1514
1836
  workspace: string;
1515
1837
  };
1516
1838
  declare type UpdateRecordWithIDQueryParams = {
1839
+ columns?: ColumnsProjection;
1517
1840
  ifVersion?: number;
1518
1841
  };
1519
1842
  declare type UpdateRecordWithIDError = ErrorWrapper<{
@@ -1542,6 +1865,7 @@ declare type UpsertRecordWithIDPathParams = {
1542
1865
  workspace: string;
1543
1866
  };
1544
1867
  declare type UpsertRecordWithIDQueryParams = {
1868
+ columns?: ColumnsProjection;
1545
1869
  ifVersion?: number;
1546
1870
  };
1547
1871
  declare type UpsertRecordWithIDError = ErrorWrapper<{
@@ -1569,6 +1893,9 @@ declare type DeleteRecordPathParams = {
1569
1893
  recordId: RecordID;
1570
1894
  workspace: string;
1571
1895
  };
1896
+ declare type DeleteRecordQueryParams = {
1897
+ columns?: ColumnsProjection;
1898
+ };
1572
1899
  declare type DeleteRecordError = ErrorWrapper<{
1573
1900
  status: 400;
1574
1901
  payload: BadRequestError;
@@ -1581,14 +1908,18 @@ declare type DeleteRecordError = ErrorWrapper<{
1581
1908
  }>;
1582
1909
  declare type DeleteRecordVariables = {
1583
1910
  pathParams: DeleteRecordPathParams;
1911
+ queryParams?: DeleteRecordQueryParams;
1584
1912
  } & FetcherExtraProps;
1585
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
1913
+ declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
1586
1914
  declare type GetRecordPathParams = {
1587
1915
  dbBranchName: DBBranchName;
1588
1916
  tableName: TableName;
1589
1917
  recordId: RecordID;
1590
1918
  workspace: string;
1591
1919
  };
1920
+ declare type GetRecordQueryParams = {
1921
+ columns?: ColumnsProjection;
1922
+ };
1592
1923
  declare type GetRecordError = ErrorWrapper<{
1593
1924
  status: 400;
1594
1925
  payload: BadRequestError;
@@ -1599,12 +1930,9 @@ declare type GetRecordError = ErrorWrapper<{
1599
1930
  status: 404;
1600
1931
  payload: SimpleError;
1601
1932
  }>;
1602
- declare type GetRecordRequestBody = {
1603
- columns?: ColumnsFilter;
1604
- };
1605
1933
  declare type GetRecordVariables = {
1606
- body?: GetRecordRequestBody;
1607
1934
  pathParams: GetRecordPathParams;
1935
+ queryParams?: GetRecordQueryParams;
1608
1936
  } & FetcherExtraProps;
1609
1937
  /**
1610
1938
  * Retrieve record by ID
@@ -1615,6 +1943,9 @@ declare type BulkInsertTableRecordsPathParams = {
1615
1943
  tableName: TableName;
1616
1944
  workspace: string;
1617
1945
  };
1946
+ declare type BulkInsertTableRecordsQueryParams = {
1947
+ columns?: ColumnsProjection;
1948
+ };
1618
1949
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
1619
1950
  status: 400;
1620
1951
  payload: BulkError;
@@ -1624,21 +1955,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1624
1955
  } | {
1625
1956
  status: 404;
1626
1957
  payload: SimpleError;
1958
+ } | {
1959
+ status: 422;
1960
+ payload: SimpleError;
1627
1961
  }>;
1628
- declare type BulkInsertTableRecordsResponse = {
1629
- recordIDs: string[];
1630
- };
1631
1962
  declare type BulkInsertTableRecordsRequestBody = {
1632
1963
  records: Record<string, any>[];
1633
1964
  };
1634
1965
  declare type BulkInsertTableRecordsVariables = {
1635
1966
  body: BulkInsertTableRecordsRequestBody;
1636
1967
  pathParams: BulkInsertTableRecordsPathParams;
1968
+ queryParams?: BulkInsertTableRecordsQueryParams;
1637
1969
  } & FetcherExtraProps;
1638
1970
  /**
1639
1971
  * Bulk insert records
1640
1972
  */
1641
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
1973
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
1642
1974
  declare type QueryTablePathParams = {
1643
1975
  dbBranchName: DBBranchName;
1644
1976
  tableName: TableName;
@@ -1658,7 +1990,7 @@ declare type QueryTableRequestBody = {
1658
1990
  filter?: FilterExpression;
1659
1991
  sort?: SortExpression;
1660
1992
  page?: PageConfig;
1661
- columns?: ColumnsFilter;
1993
+ columns?: ColumnsProjection;
1662
1994
  };
1663
1995
  declare type QueryTableVariables = {
1664
1996
  body?: QueryTableRequestBody;
@@ -1675,7 +2007,7 @@ declare type QueryTableVariables = {
1675
2007
  * {
1676
2008
  * "columns": [...],
1677
2009
  * "filter": {
1678
- * "$all": [...]
2010
+ * "$all": [...],
1679
2011
  * "$any": [...]
1680
2012
  * ...
1681
2013
  * },
@@ -1721,7 +2053,11 @@ declare type QueryTableVariables = {
1721
2053
  * "link": {
1722
2054
  * "table": "users"
1723
2055
  * }
1724
- * }
2056
+ * },
2057
+ * {
2058
+ * "name": "foundedDate",
2059
+ * "type": "datetime"
2060
+ * },
1725
2061
  * ]
1726
2062
  * },
1727
2063
  * {
@@ -1809,7 +2145,7 @@ declare type QueryTableVariables = {
1809
2145
  * {
1810
2146
  * "name": "Kilian",
1811
2147
  * "address": {
1812
- * "street": "New street",
2148
+ * "street": "New street"
1813
2149
  * }
1814
2150
  * }
1815
2151
  * ```
@@ -1818,10 +2154,7 @@ declare type QueryTableVariables = {
1818
2154
  *
1819
2155
  * ```json
1820
2156
  * {
1821
- * "columns": [
1822
- * "*",
1823
- * "team.name"
1824
- * ]
2157
+ * "columns": ["*", "team.name"]
1825
2158
  * }
1826
2159
  * ```
1827
2160
  *
@@ -1839,7 +2172,7 @@ declare type QueryTableVariables = {
1839
2172
  * "team": {
1840
2173
  * "id": "XX",
1841
2174
  * "xata": {
1842
- * "version": 0,
2175
+ * "version": 0
1843
2176
  * },
1844
2177
  * "name": "first team"
1845
2178
  * }
@@ -1850,10 +2183,7 @@ declare type QueryTableVariables = {
1850
2183
  *
1851
2184
  * ```json
1852
2185
  * {
1853
- * "columns": [
1854
- * "*",
1855
- * "team.*"
1856
- * ]
2186
+ * "columns": ["*", "team.*"]
1857
2187
  * }
1858
2188
  * ```
1859
2189
  *
@@ -1871,10 +2201,11 @@ declare type QueryTableVariables = {
1871
2201
  * "team": {
1872
2202
  * "id": "XX",
1873
2203
  * "xata": {
1874
- * "version": 0,
2204
+ * "version": 0
1875
2205
  * },
1876
2206
  * "name": "first team",
1877
- * "code": "A1"
2207
+ * "code": "A1",
2208
+ * "foundedDate": "2020-03-04T10:43:54.32Z"
1878
2209
  * }
1879
2210
  * }
1880
2211
  * ```
@@ -1889,7 +2220,7 @@ declare type QueryTableVariables = {
1889
2220
  * `$none`, etc.
1890
2221
  *
1891
2222
  * All operators start with an `$` to differentiate them from column names
1892
- * (which are not allowed to start with an dollar sign).
2223
+ * (which are not allowed to start with a dollar sign).
1893
2224
  *
1894
2225
  * #### Exact matching and control operators
1895
2226
  *
@@ -1920,7 +2251,7 @@ declare type QueryTableVariables = {
1920
2251
  * ```json
1921
2252
  * {
1922
2253
  * "filter": {
1923
- * "name": "r2",
2254
+ * "name": "r2"
1924
2255
  * }
1925
2256
  * }
1926
2257
  * ```
@@ -1942,7 +2273,7 @@ declare type QueryTableVariables = {
1942
2273
  * ```json
1943
2274
  * {
1944
2275
  * "filter": {
1945
- * "settings.plan": "free",
2276
+ * "settings.plan": "free"
1946
2277
  * }
1947
2278
  * }
1948
2279
  * ```
@@ -1952,8 +2283,8 @@ declare type QueryTableVariables = {
1952
2283
  * "filter": {
1953
2284
  * "settings": {
1954
2285
  * "plan": "free"
1955
- * },
1956
- * },
2286
+ * }
2287
+ * }
1957
2288
  * }
1958
2289
  * ```
1959
2290
  *
@@ -1962,8 +2293,8 @@ declare type QueryTableVariables = {
1962
2293
  * ```json
1963
2294
  * {
1964
2295
  * "filter": {
1965
- * "settings.plan": {"$any": ["free", "paid"]}
1966
- * },
2296
+ * "settings.plan": { "$any": ["free", "paid"] }
2297
+ * }
1967
2298
  * }
1968
2299
  * ```
1969
2300
  *
@@ -1972,9 +2303,9 @@ declare type QueryTableVariables = {
1972
2303
  * ```json
1973
2304
  * {
1974
2305
  * "filter": {
1975
- * "settings.dark": true,
1976
- * "settings.plan": "free",
1977
- * },
2306
+ * "settings.dark": true,
2307
+ * "settings.plan": "free"
2308
+ * }
1978
2309
  * }
1979
2310
  * ```
1980
2311
  *
@@ -1985,11 +2316,11 @@ declare type QueryTableVariables = {
1985
2316
  * ```json
1986
2317
  * {
1987
2318
  * "filter": {
1988
- * "$any": {
1989
- * "settings.dark": true,
1990
- * "settings.plan": "free"
1991
- * }
1992
- * },
2319
+ * "$any": {
2320
+ * "settings.dark": true,
2321
+ * "settings.plan": "free"
2322
+ * }
2323
+ * }
1993
2324
  * }
1994
2325
  * ```
1995
2326
  *
@@ -2000,10 +2331,10 @@ declare type QueryTableVariables = {
2000
2331
  * "filter": {
2001
2332
  * "$any": [
2002
2333
  * {
2003
- * "name": "r1",
2334
+ * "name": "r1"
2004
2335
  * },
2005
2336
  * {
2006
- * "name": "r2",
2337
+ * "name": "r2"
2007
2338
  * }
2008
2339
  * ]
2009
2340
  * }
@@ -2015,7 +2346,7 @@ declare type QueryTableVariables = {
2015
2346
  * ```json
2016
2347
  * {
2017
2348
  * "filter": {
2018
- * "$exists": "settings",
2349
+ * "$exists": "settings"
2019
2350
  * }
2020
2351
  * }
2021
2352
  * ```
@@ -2027,10 +2358,10 @@ declare type QueryTableVariables = {
2027
2358
  * "filter": {
2028
2359
  * "$all": [
2029
2360
  * {
2030
- * "$exists": "settings",
2361
+ * "$exists": "settings"
2031
2362
  * },
2032
2363
  * {
2033
- * "$exists": "name",
2364
+ * "$exists": "name"
2034
2365
  * }
2035
2366
  * ]
2036
2367
  * }
@@ -2042,7 +2373,7 @@ declare type QueryTableVariables = {
2042
2373
  * ```json
2043
2374
  * {
2044
2375
  * "filter": {
2045
- * "$notExists": "settings",
2376
+ * "$notExists": "settings"
2046
2377
  * }
2047
2378
  * }
2048
2379
  * ```
@@ -2069,43 +2400,59 @@ declare type QueryTableVariables = {
2069
2400
  * {
2070
2401
  * "filter": {
2071
2402
  * "<column_name>": {
2072
- * "$pattern": "v*alue*"
2403
+ * "$pattern": "v*alu?"
2073
2404
  * }
2074
2405
  * }
2075
2406
  * }
2076
2407
  * ```
2077
2408
  *
2409
+ * The `$pattern` operator accepts two wildcard characters:
2410
+ * * `*` matches zero or more characters
2411
+ * * `?` matches exactly one character
2412
+ *
2413
+ * If you want to match a string that contains a wildcard character, you can escape them using a backslash (`\`). You can escape a backslash by usign another backslash.
2414
+ *
2078
2415
  * We could also have `$endsWith` and `$startsWith` operators:
2079
2416
  *
2080
2417
  * ```json
2081
2418
  * {
2082
2419
  * "filter": {
2083
2420
  * "<column_name>": {
2084
- * "$endsWith": ".gz"
2421
+ * "$endsWith": ".gz"
2085
2422
  * },
2086
2423
  * "<column_name>": {
2087
- * "$startsWith": "tmp-"
2424
+ * "$startsWith": "tmp-"
2088
2425
  * }
2089
2426
  * }
2090
2427
  * }
2091
2428
  * ```
2092
2429
  *
2093
- * #### Numeric ranges
2430
+ * #### Numeric or datetime ranges
2094
2431
  *
2095
2432
  * ```json
2096
2433
  * {
2097
2434
  * "filter": {
2098
- * "<column_name>": {
2099
- * "$ge": 0,
2100
- * "$lt": 100
2101
- * }
2435
+ * "<column_name>": {
2436
+ * "$ge": 0,
2437
+ * "$lt": 100
2438
+ * }
2439
+ * }
2440
+ * }
2441
+ * ```
2442
+ * Date ranges support the same operators, with the date using the format defined in
2443
+ * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
2444
+ * ```json
2445
+ * {
2446
+ * "filter": {
2447
+ * "<column_name>": {
2448
+ * "$gt": "2019-10-12T07:20:50.52Z",
2449
+ * "$lt": "2021-10-12T07:20:50.52Z"
2450
+ * }
2102
2451
  * }
2103
2452
  * }
2104
2453
  * ```
2105
- *
2106
2454
  * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
2107
2455
  *
2108
- *
2109
2456
  * #### Negations
2110
2457
  *
2111
2458
  * A general `$not` operator can inverse any operation.
@@ -2130,15 +2477,21 @@ declare type QueryTableVariables = {
2130
2477
  * {
2131
2478
  * "filter": {
2132
2479
  * "$not": {
2133
- * "$any": [{
2134
- * "<column_name1>": "value1"
2135
- * }, {
2136
- * "$all": [{
2137
- * "<column_name2>": "value2"
2138
- * }, {
2139
- * "<column_name3>": "value3"
2140
- * }]
2141
- * }]
2480
+ * "$any": [
2481
+ * {
2482
+ * "<column_name1>": "value1"
2483
+ * },
2484
+ * {
2485
+ * "$all": [
2486
+ * {
2487
+ * "<column_name2>": "value2"
2488
+ * },
2489
+ * {
2490
+ * "<column_name3>": "value3"
2491
+ * }
2492
+ * ]
2493
+ * }
2494
+ * ]
2142
2495
  * }
2143
2496
  * }
2144
2497
  * }
@@ -2193,8 +2546,8 @@ declare type QueryTableVariables = {
2193
2546
  * "<array name>": {
2194
2547
  * "$includes": {
2195
2548
  * "$all": [
2196
- * {"$contains": "label"},
2197
- * {"$not": {"$endsWith": "-debug"}}
2549
+ * { "$contains": "label" },
2550
+ * { "$not": { "$endsWith": "-debug" } }
2198
2551
  * ]
2199
2552
  * }
2200
2553
  * }
@@ -2214,9 +2567,7 @@ declare type QueryTableVariables = {
2214
2567
  * {
2215
2568
  * "filter": {
2216
2569
  * "settings.labels": {
2217
- * "$includesAll": [
2218
- * {"$contains": "label"},
2219
- * ]
2570
+ * "$includesAll": [{ "$contains": "label" }]
2220
2571
  * }
2221
2572
  * }
2222
2573
  * }
@@ -2264,7 +2615,6 @@ declare type QueryTableVariables = {
2264
2615
  * }
2265
2616
  * ```
2266
2617
  *
2267
- *
2268
2618
  * ### Pagination
2269
2619
  *
2270
2620
  * We offer cursor pagination and offset pagination. The offset pagination is limited
@@ -2330,8 +2680,8 @@ declare type QueryTableVariables = {
2330
2680
  * can be queried by update `page.after` to the returned cursor while keeping the
2331
2681
  * `page.before` cursor from the first range query.
2332
2682
  *
2333
- * The `filter` , `columns`, `sort` , and `page.size` configuration will be
2334
- * encoded with the cursor. The pagination request will be invalid if
2683
+ * The `filter` , `columns`, `sort` , and `page.size` configuration will be
2684
+ * encoded with the cursor. The pagination request will be invalid if
2335
2685
  * `filter` or `sort` is set. The columns returned and page size can be changed
2336
2686
  * anytime by passing the `columns` or `page.size` settings to the next query.
2337
2687
  *
@@ -2368,6 +2718,41 @@ declare type QueryTableVariables = {
2368
2718
  * ```
2369
2719
  */
2370
2720
  declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2721
+ declare type SearchTablePathParams = {
2722
+ dbBranchName: DBBranchName;
2723
+ tableName: TableName;
2724
+ workspace: string;
2725
+ };
2726
+ declare type SearchTableError = ErrorWrapper<{
2727
+ status: 400;
2728
+ payload: BadRequestError;
2729
+ } | {
2730
+ status: 401;
2731
+ payload: AuthError;
2732
+ } | {
2733
+ status: 404;
2734
+ payload: SimpleError;
2735
+ }>;
2736
+ declare type SearchTableRequestBody = {
2737
+ query: string;
2738
+ fuzziness?: FuzzinessExpression;
2739
+ prefix?: PrefixExpression;
2740
+ filter?: FilterExpression;
2741
+ highlight?: HighlightExpression;
2742
+ boosters?: BoosterExpression[];
2743
+ };
2744
+ declare type SearchTableVariables = {
2745
+ body: SearchTableRequestBody;
2746
+ pathParams: SearchTablePathParams;
2747
+ } & FetcherExtraProps;
2748
+ /**
2749
+ * Run a free text search operation in a particular table.
2750
+ *
2751
+ * The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
2752
+ * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
2753
+ * * filtering on columns of type `multiple` is currently unsupported
2754
+ */
2755
+ declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2371
2756
  declare type SearchBranchPathParams = {
2372
2757
  dbBranchName: DBBranchName;
2373
2758
  workspace: string;
@@ -2383,9 +2768,14 @@ declare type SearchBranchError = ErrorWrapper<{
2383
2768
  payload: SimpleError;
2384
2769
  }>;
2385
2770
  declare type SearchBranchRequestBody = {
2386
- tables?: string[];
2771
+ tables?: (string | {
2772
+ table: string;
2773
+ filter?: FilterExpression;
2774
+ boosters?: BoosterExpression[];
2775
+ })[];
2387
2776
  query: string;
2388
- fuzziness?: number;
2777
+ fuzziness?: FuzzinessExpression;
2778
+ highlight?: HighlightExpression;
2389
2779
  };
2390
2780
  declare type SearchBranchVariables = {
2391
2781
  body: SearchBranchRequestBody;
@@ -2414,6 +2804,7 @@ declare const operationsByTag: {
2414
2804
  updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2415
2805
  removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2416
2806
  inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
2807
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
2417
2808
  cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2418
2809
  resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2419
2810
  acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
@@ -2422,11 +2813,15 @@ declare const operationsByTag: {
2422
2813
  getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2423
2814
  createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2424
2815
  deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
2816
+ getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
2817
+ addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2818
+ removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
2819
+ resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
2425
2820
  };
2426
2821
  branch: {
2427
2822
  getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2428
2823
  getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2429
- createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
2824
+ createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2430
2825
  deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2431
2826
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2432
2827
  getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
@@ -2436,7 +2831,7 @@ declare const operationsByTag: {
2436
2831
  getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
2437
2832
  };
2438
2833
  table: {
2439
- createTable: (variables: CreateTableVariables) => Promise<undefined>;
2834
+ createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2440
2835
  deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2441
2836
  updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2442
2837
  getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
@@ -2448,14 +2843,15 @@ declare const operationsByTag: {
2448
2843
  updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
2449
2844
  };
2450
2845
  records: {
2451
- insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2846
+ insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
2452
2847
  insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2453
2848
  updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2454
2849
  upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2455
- deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
2850
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
2456
2851
  getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2457
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2852
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
2458
2853
  queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2854
+ searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2459
2855
  searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
2460
2856
  };
2461
2857
  };
@@ -2472,6 +2868,9 @@ interface XataApiClientOptions {
2472
2868
  apiKey?: string;
2473
2869
  host?: HostProvider;
2474
2870
  }
2871
+ /**
2872
+ * @deprecated Use XataApiPlugin instead
2873
+ */
2475
2874
  declare class XataApiClient {
2476
2875
  #private;
2477
2876
  constructor(options?: XataApiClientOptions);
@@ -2504,6 +2903,7 @@ declare class WorkspaceApi {
2504
2903
  updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2505
2904
  removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2506
2905
  inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
2906
+ updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
2507
2907
  cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2508
2908
  resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2509
2909
  acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
@@ -2514,13 +2914,17 @@ declare class DatabaseApi {
2514
2914
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2515
2915
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2516
2916
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
2917
+ getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2918
+ addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2919
+ removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
2920
+ resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
2517
2921
  }
2518
2922
  declare class BranchApi {
2519
2923
  private extraProps;
2520
2924
  constructor(extraProps: FetcherExtraProps);
2521
2925
  getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2522
2926
  getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2523
- createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<void>;
2927
+ createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
2524
2928
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2525
2929
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2526
2930
  getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
@@ -2532,7 +2936,7 @@ declare class BranchApi {
2532
2936
  declare class TableApi {
2533
2937
  private extraProps;
2534
2938
  constructor(extraProps: FetcherExtraProps);
2535
- createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2939
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
2536
2940
  deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2537
2941
  updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2538
2942
  getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
@@ -2546,14 +2950,15 @@ declare class TableApi {
2546
2950
  declare class RecordsApi {
2547
2951
  private extraProps;
2548
2952
  constructor(extraProps: FetcherExtraProps);
2549
- insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>): Promise<InsertRecordResponse>;
2953
+ insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
2550
2954
  insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2551
2955
  updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2552
2956
  upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2553
- deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<void>;
2554
- getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2555
- bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
2957
+ deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
2958
+ getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
2959
+ bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
2556
2960
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2961
+ searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2557
2962
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
2558
2963
  }
2559
2964
 
@@ -2567,28 +2972,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
2567
2972
  declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2568
2973
  declare type IsObject<T> = T extends Record<string, any> ? true : false;
2569
2974
  declare type IsArray<T> = T extends Array<any> ? true : false;
2570
- declare type NonEmptyArray<T> = T[] & {
2571
- 0: T;
2572
- };
2573
2975
  declare type RequiredBy<T, K extends keyof T> = T & {
2574
2976
  [P in K]-?: NonNullable<T[P]>;
2575
2977
  };
2576
2978
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2577
2979
  declare type SingleOrArray<T> = T | T[];
2578
- declare type Dictionary<T> = Record<string, T>;
2980
+ declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
2981
+ declare type Without<T, U> = {
2982
+ [P in Exclude<keyof T, keyof U>]?: never;
2983
+ };
2984
+ declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
2579
2985
 
2580
2986
  declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2581
- declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2582
- [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
2987
+ declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
2988
+ [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
2583
2989
  }>>;
2584
- declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends XataRecord ? (V extends SelectableColumn<O[K]> ? {
2585
- V: ValueAtColumn<O[K], V>;
2586
- } : never) : O[K]> : never : never;
2990
+ declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
2991
+ V: ValueAtColumn<Item, V>;
2992
+ } : never : O[K] : never> : never : never;
2587
2993
  declare type MAX_RECURSION = 5;
2588
2994
  declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
2589
- [K in DataProps<O>]: If<IsArray<NonNullable<O[K]>>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
2590
- If<IsObject<NonNullable<O[K]>>, NonNullable<O[K]> extends XataRecord ? SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]> extends string ? K | `${K}.${SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]>}` : never : `${K}.${StringKeys<NonNullable<O[K]>> | '*'}`, // This allows usage of objects that are not links
2591
- K>>;
2995
+ [K in DataProps<O>]: NonNullable<O[K]> extends infer Item ? If<IsArray<Item>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
2996
+ If<IsObject<Item>, Item extends XataRecord ? SelectableColumn<Item, [...RecursivePath, Item]> extends infer Column ? Column extends string ? K | `${K}.${Column}` : never : never : Item extends Date ? K : `${K}.${StringKeys<Item> | '*'}`, // This allows usage of objects that are not links
2997
+ K>> : never;
2592
2998
  }>, never>;
2593
2999
  declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
2594
3000
  declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
@@ -2615,27 +3021,37 @@ interface BaseData {
2615
3021
  /**
2616
3022
  * Represents a persisted record from the database.
2617
3023
  */
2618
- interface XataRecord extends Identifiable {
3024
+ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
2619
3025
  /**
2620
- * Metadata of this record.
3026
+ * Get metadata of this record.
2621
3027
  */
2622
- xata: {
2623
- /**
2624
- * Number that is increased every time the record is updated.
2625
- */
2626
- version: number;
2627
- };
3028
+ getMetadata(): XataRecordMetadata;
3029
+ /**
3030
+ * Retrieves a refreshed copy of the current record from the database.
3031
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3032
+ * @returns The persisted record with the selected columns.
3033
+ */
3034
+ read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2628
3035
  /**
2629
3036
  * Retrieves a refreshed copy of the current record from the database.
3037
+ * @returns The persisted record with all first level properties.
2630
3038
  */
2631
- read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
3039
+ read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2632
3040
  /**
2633
3041
  * Performs a partial update of the current record. On success a new object is
2634
3042
  * returned and the current object is not mutated.
2635
- * @param data The columns and their values that have to be updated.
2636
- * @returns A new record containing the latest values for all the columns of the current record.
3043
+ * @param partialUpdate The columns and their values that have to be updated.
3044
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3045
+ * @returns The persisted record with the selected columns.
3046
+ */
3047
+ update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>>>;
3048
+ /**
3049
+ * Performs a partial update of the current record. On success a new object is
3050
+ * returned and the current object is not mutated.
3051
+ * @param partialUpdate The columns and their values that have to be updated.
3052
+ * @returns The persisted record with all first level properties.
2637
3053
  */
2638
- update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
3054
+ update(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>>>;
2639
3055
  /**
2640
3056
  * Performs a deletion of the current record in the database.
2641
3057
  *
@@ -2647,23 +3063,36 @@ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update
2647
3063
  /**
2648
3064
  * Retrieves a refreshed copy of the current record from the database.
2649
3065
  */
2650
- read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3066
+ read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
2651
3067
  /**
2652
3068
  * Performs a partial update of the current record. On success a new object is
2653
3069
  * returned and the current object is not mutated.
2654
- * @param data The columns and their values that have to be updated.
3070
+ * @param partialUpdate The columns and their values that have to be updated.
2655
3071
  * @returns A new record containing the latest values for all the columns of the current record.
2656
3072
  */
2657
- update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3073
+ update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
3074
+ /**
3075
+ * Performs a deletion of the current record in the database.
3076
+ *
3077
+ * @throws If the record was already deleted or if an error happened while performing the deletion.
3078
+ */
3079
+ delete(): Promise<void>;
3080
+ };
3081
+ declare type XataRecordMetadata = {
3082
+ /**
3083
+ * Number that is increased every time the record is updated.
3084
+ */
3085
+ version: number;
3086
+ warnings?: string[];
2658
3087
  };
2659
3088
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2660
3089
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2661
3090
  declare type EditableData<O extends BaseData> = {
2662
3091
  [K in keyof O]: O[K] extends XataRecord ? {
2663
3092
  id: string;
2664
- } : NonNullable<O[K]> extends XataRecord ? {
3093
+ } | string : NonNullable<O[K]> extends XataRecord ? {
2665
3094
  id: string;
2666
- } | null | undefined : O[K];
3095
+ } | string | null | undefined : O[K];
2667
3096
  };
2668
3097
 
2669
3098
  /**
@@ -2739,8 +3168,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
2739
3168
  ],
2740
3169
  }
2741
3170
  */
2742
- declare type AggregatorFilter<Record> = {
2743
- [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<Record>>;
3171
+ declare type AggregatorFilter<T> = {
3172
+ [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
2744
3173
  };
2745
3174
  /**
2746
3175
  * Existance filter
@@ -2755,10 +3184,88 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
2755
3184
  * Injects the Api filters on nested properties
2756
3185
  * Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
2757
3186
  */
2758
- declare type NestedApiFilter<T> = T extends Record<string, any> ? {
3187
+ declare type NestedApiFilter<T> = {
2759
3188
  [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
2760
- } : PropertyFilter<T>;
2761
- declare type Filter<Record> = BaseApiFilter<Record> | NestedApiFilter<Record>;
3189
+ };
3190
+ declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
3191
+
3192
+ declare type DateBooster = {
3193
+ origin?: string;
3194
+ scale: string;
3195
+ decay: number;
3196
+ };
3197
+ declare type NumericBooster = {
3198
+ factor: number;
3199
+ };
3200
+ declare type ValueBooster<T extends string | number | boolean> = {
3201
+ value: T;
3202
+ factor: number;
3203
+ };
3204
+ declare type Boosters<O extends XataRecord> = Values<{
3205
+ [K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
3206
+ dateBooster: {
3207
+ column: K;
3208
+ } & DateBooster;
3209
+ } : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
3210
+ numericBooster?: {
3211
+ column: K;
3212
+ } & NumericBooster;
3213
+ }, {
3214
+ valueBooster?: {
3215
+ column: K;
3216
+ } & ValueBooster<number>;
3217
+ }> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
3218
+ valueBooster: {
3219
+ column: K;
3220
+ } & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
3221
+ } : never;
3222
+ }>;
3223
+
3224
+ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3225
+ fuzziness?: FuzzinessExpression;
3226
+ prefix?: PrefixExpression;
3227
+ highlight?: HighlightExpression;
3228
+ tables?: Array<Tables | Values<{
3229
+ [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
3230
+ table: Model;
3231
+ filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
3232
+ boosters?: Boosters<Schemas[Model] & XataRecord>[];
3233
+ };
3234
+ }>>;
3235
+ };
3236
+ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3237
+ all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3238
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
3239
+ table: Model;
3240
+ record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
3241
+ };
3242
+ }>[]>;
3243
+ byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3244
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
3245
+ }>;
3246
+ };
3247
+ declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3248
+ #private;
3249
+ private db;
3250
+ constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
3251
+ build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3252
+ }
3253
+ declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
3254
+ getMetadata: () => XataRecordMetadata & SearchExtraProperties;
3255
+ };
3256
+ declare type SearchExtraProperties = {
3257
+ table: string;
3258
+ highlight?: {
3259
+ [key: string]: string[] | {
3260
+ [key: string]: any;
3261
+ };
3262
+ };
3263
+ score?: number;
3264
+ };
3265
+ declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
3266
+ declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
3267
+ table: infer Table;
3268
+ } ? ReturnTable<Table, Tables> : never;
2762
3269
 
2763
3270
  declare type SortDirection = 'asc' | 'desc';
2764
3271
  declare type SortFilterExtended<T extends XataRecord> = {
@@ -2770,12 +3277,21 @@ declare type SortFilterBase<T extends XataRecord> = {
2770
3277
  [Key in StringKeys<T>]: SortDirection;
2771
3278
  };
2772
3279
 
2773
- declare type QueryOptions<T extends XataRecord> = {
2774
- page?: PaginationOptions;
2775
- columns?: NonEmptyArray<SelectableColumn<T>>;
3280
+ declare type BaseOptions<T extends XataRecord> = {
3281
+ columns?: SelectableColumn<T>[];
3282
+ cache?: number;
3283
+ };
3284
+ declare type CursorQueryOptions = {
3285
+ pagination?: CursorNavigationOptions & OffsetNavigationOptions;
3286
+ filter?: never;
3287
+ sort?: never;
3288
+ };
3289
+ declare type OffsetQueryOptions<T extends XataRecord> = {
3290
+ pagination?: OffsetNavigationOptions;
2776
3291
  filter?: FilterExpression;
2777
3292
  sort?: SortFilter<T> | SortFilter<T>[];
2778
3293
  };
3294
+ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
2779
3295
  /**
2780
3296
  * Query objects contain the information of all filters, sorting, etc. to be included in the database query.
2781
3297
  *
@@ -2785,9 +3301,10 @@ declare type QueryOptions<T extends XataRecord> = {
2785
3301
  declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
2786
3302
  #private;
2787
3303
  readonly meta: PaginationQueryMeta;
2788
- readonly records: Result[];
2789
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, parent?: Partial<QueryOptions<Record>>);
3304
+ readonly records: RecordArray<Result>;
3305
+ constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
2790
3306
  getQueryOptions(): QueryOptions<Record>;
3307
+ key(): string;
2791
3308
  /**
2792
3309
  * Builds a new query object representing a logical OR between the given subqueries.
2793
3310
  * @param queries An array of subqueries.
@@ -2817,18 +3334,28 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
2817
3334
  *
2818
3335
  * ```
2819
3336
  * query.filter("columnName", columnValue)
2820
- * query.filter({
2821
- * "columnName": columnValue
2822
- * })
3337
+ * query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
3338
+ * ```
3339
+ *
3340
+ * @param column The name of the column to filter.
3341
+ * @param value The value to filter.
3342
+ * @returns A new Query object.
3343
+ */
3344
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
3345
+ /**
3346
+ * Builds a new query object adding one or more constraints. Examples:
3347
+ *
3348
+ * ```
3349
+ * query.filter({ "columnName": columnValue })
2823
3350
  * query.filter({
2824
3351
  * "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
2825
3352
  * })
2826
3353
  * ```
2827
3354
  *
3355
+ * @param filters A filter object
2828
3356
  * @returns A new Query object.
2829
3357
  */
2830
3358
  filter(filters: Filter<Record>): Query<Record, Result>;
2831
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
2832
3359
  /**
2833
3360
  * Builds a new query with a new sort option.
2834
3361
  * @param column The column name.
@@ -2841,43 +3368,149 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
2841
3368
  * @param columns Array of column names to be returned by the query.
2842
3369
  * @returns A new Query object.
2843
3370
  */
2844
- select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
3371
+ select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
3372
+ /**
3373
+ * Get paginated results
3374
+ *
3375
+ * @returns A page of results
3376
+ */
2845
3377
  getPaginated(): Promise<Page<Record, Result>>;
2846
- getPaginated(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
3378
+ /**
3379
+ * Get paginated results
3380
+ *
3381
+ * @param options Pagination options
3382
+ * @returns A page of results
3383
+ */
3384
+ getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
3385
+ /**
3386
+ * Get paginated results
3387
+ *
3388
+ * @param options Pagination options
3389
+ * @returns A page of results
3390
+ */
2847
3391
  getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
3392
+ /**
3393
+ * Get results in an iterator
3394
+ *
3395
+ * @async
3396
+ * @returns Async interable of results
3397
+ */
2848
3398
  [Symbol.asyncIterator](): AsyncIterableIterator<Result>;
2849
- getIterator(chunk: number): AsyncGenerator<Result[]>;
2850
- getIterator(chunk: number, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): AsyncGenerator<Result[]>;
2851
- getIterator<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number, options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
3399
+ /**
3400
+ * Build an iterator of results
3401
+ *
3402
+ * @returns Async generator of results array
3403
+ */
3404
+ getIterator(): AsyncGenerator<Result[]>;
3405
+ /**
3406
+ * Build an iterator of results
3407
+ *
3408
+ * @param options Pagination options with batchSize
3409
+ * @returns Async generator of results array
3410
+ */
3411
+ getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
3412
+ batchSize?: number;
3413
+ }): AsyncGenerator<Result[]>;
3414
+ /**
3415
+ * Build an iterator of results
3416
+ *
3417
+ * @param options Pagination options with batchSize
3418
+ * @returns Async generator of results array
3419
+ */
3420
+ getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
3421
+ batchSize?: number;
3422
+ }>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
3423
+ /**
3424
+ * Performs the query in the database and returns a set of results.
3425
+ * @returns An array of records from the database.
3426
+ */
3427
+ getMany(): Promise<RecordArray<Result>>;
2852
3428
  /**
2853
3429
  * Performs the query in the database and returns a set of results.
2854
3430
  * @param options Additional options to be used when performing the query.
2855
3431
  * @returns An array of records from the database.
2856
3432
  */
2857
- getMany(): Promise<Result[]>;
2858
- getMany(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
2859
- getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3433
+ getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
3434
+ /**
3435
+ * Performs the query in the database and returns a set of results.
3436
+ * @param options Additional options to be used when performing the query.
3437
+ * @returns An array of records from the database.
3438
+ */
3439
+ getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
3440
+ /**
3441
+ * Performs the query in the database and returns all the results.
3442
+ * Warning: If there are a large number of results, this method can have performance implications.
3443
+ * @returns An array of records from the database.
3444
+ */
3445
+ getAll(): Promise<Result[]>;
3446
+ /**
3447
+ * Performs the query in the database and returns all the results.
3448
+ * Warning: If there are a large number of results, this method can have performance implications.
3449
+ * @param options Additional options to be used when performing the query.
3450
+ * @returns An array of records from the database.
3451
+ */
3452
+ getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
3453
+ batchSize?: number;
3454
+ }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
2860
3455
  /**
2861
3456
  * Performs the query in the database and returns all the results.
2862
3457
  * Warning: If there are a large number of results, this method can have performance implications.
2863
3458
  * @param options Additional options to be used when performing the query.
2864
3459
  * @returns An array of records from the database.
2865
3460
  */
2866
- getAll(chunk?: number): Promise<Result[]>;
2867
- getAll(chunk: number | undefined, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result[]>;
2868
- getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number | undefined, options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3461
+ getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
3462
+ batchSize?: number;
3463
+ }): Promise<Result[]>;
3464
+ /**
3465
+ * Performs the query in the database and returns the first result.
3466
+ * @returns The first record that matches the query, or null if no record matched the query.
3467
+ */
3468
+ getFirst(): Promise<Result | null>;
3469
+ /**
3470
+ * Performs the query in the database and returns the first result.
3471
+ * @param options Additional options to be used when performing the query.
3472
+ * @returns The first record that matches the query, or null if no record matched the query.
3473
+ */
3474
+ getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
2869
3475
  /**
2870
3476
  * Performs the query in the database and returns the first result.
2871
3477
  * @param options Additional options to be used when performing the query.
2872
3478
  * @returns The first record that matches the query, or null if no record matched the query.
2873
3479
  */
2874
- getOne(): Promise<Result | null>;
2875
- getOne(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
2876
- getOne<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
3480
+ getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
3481
+ /**
3482
+ * Builds a new query object adding a cache TTL in milliseconds.
3483
+ * @param ttl The cache TTL in milliseconds.
3484
+ * @returns A new Query object.
3485
+ */
3486
+ cache(ttl: number): Query<Record, Result>;
3487
+ /**
3488
+ * Retrieve next page of records
3489
+ *
3490
+ * @returns A new page object.
3491
+ */
2877
3492
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3493
+ /**
3494
+ * Retrieve previous page of records
3495
+ *
3496
+ * @returns A new page object
3497
+ */
2878
3498
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3499
+ /**
3500
+ * Retrieve first page of records
3501
+ *
3502
+ * @returns A new page object
3503
+ */
2879
3504
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3505
+ /**
3506
+ * Retrieve last page of records
3507
+ *
3508
+ * @returns A new page object
3509
+ */
2880
3510
  lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3511
+ /**
3512
+ * @returns Boolean indicating if there is a next page
3513
+ */
2881
3514
  hasNextPage(): boolean;
2882
3515
  }
2883
3516
 
@@ -2889,7 +3522,7 @@ declare type PaginationQueryMeta = {
2889
3522
  };
2890
3523
  interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
2891
3524
  meta: PaginationQueryMeta;
2892
- records: Result[];
3525
+ records: RecordArray<Result>;
2893
3526
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2894
3527
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2895
3528
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
@@ -2909,7 +3542,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
2909
3542
  /**
2910
3543
  * The set of results for this page.
2911
3544
  */
2912
- readonly records: Result[];
3545
+ readonly records: RecordArray<Result>;
2913
3546
  constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
2914
3547
  /**
2915
3548
  * Retrieves the next page of results.
@@ -2957,44 +3590,154 @@ declare type OffsetNavigationOptions = {
2957
3590
  size?: number;
2958
3591
  offset?: number;
2959
3592
  };
2960
- declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
2961
3593
  declare const PAGINATION_MAX_SIZE = 200;
2962
- declare const PAGINATION_DEFAULT_SIZE = 200;
3594
+ declare const PAGINATION_DEFAULT_SIZE = 20;
2963
3595
  declare const PAGINATION_MAX_OFFSET = 800;
2964
3596
  declare const PAGINATION_DEFAULT_OFFSET = 0;
3597
+ declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
3598
+ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
3599
+ #private;
3600
+ constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
3601
+ static parseConstructorParams(...args: any[]): any[];
3602
+ toArray(): Result[];
3603
+ map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
3604
+ /**
3605
+ * Retrieve next page of records
3606
+ *
3607
+ * @returns A new array of objects
3608
+ */
3609
+ nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
3610
+ /**
3611
+ * Retrieve previous page of records
3612
+ *
3613
+ * @returns A new array of objects
3614
+ */
3615
+ previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
3616
+ /**
3617
+ * Retrieve first page of records
3618
+ *
3619
+ * @returns A new array of objects
3620
+ */
3621
+ firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
3622
+ /**
3623
+ * Retrieve last page of records
3624
+ *
3625
+ * @returns A new array of objects
3626
+ */
3627
+ lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
3628
+ /**
3629
+ * @returns Boolean indicating if there is a next page
3630
+ */
3631
+ hasNextPage(): boolean;
3632
+ }
2965
3633
 
2966
- declare type TableLink = string[];
2967
- declare type LinkDictionary = Dictionary<TableLink[]>;
2968
3634
  /**
2969
3635
  * Common interface for performing operations on a table.
2970
3636
  */
2971
3637
  declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
2972
- abstract create(object: EditableData<Data> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3638
+ abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Data>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3639
+ abstract create(object: Omit<EditableData<Data>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3640
+ /**
3641
+ * Creates a single record in the table with a unique id.
3642
+ * @param id The unique id.
3643
+ * @param object Object containing the column names with their values to be stored in the table.
3644
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3645
+ * @returns The full persisted record.
3646
+ */
3647
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
2973
3648
  /**
2974
3649
  * Creates a single record in the table with a unique id.
2975
3650
  * @param id The unique id.
2976
3651
  * @param object Object containing the column names with their values to be stored in the table.
2977
3652
  * @returns The full persisted record.
2978
3653
  */
2979
- abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3654
+ abstract create(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2980
3655
  /**
2981
3656
  * Creates multiple records in the table.
2982
3657
  * @param objects Array of objects with the column names and the values to be stored in the table.
2983
- * @returns Array of the persisted records.
3658
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3659
+ * @returns Array of the persisted records in order.
2984
3660
  */
2985
- abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3661
+ abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Data>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3662
+ /**
3663
+ * Creates multiple records in the table.
3664
+ * @param objects Array of objects with the column names and the values to be stored in the table.
3665
+ * @returns Array of the persisted records in order.
3666
+ */
3667
+ abstract create(objects: Array<Omit<EditableData<Data>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3668
+ /**
3669
+ * Queries a single record from the table given its unique id.
3670
+ * @param id The unique id.
3671
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3672
+ * @returns The persisted record for the given id or null if the record could not be found.
3673
+ */
3674
+ abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
2986
3675
  /**
2987
3676
  * Queries a single record from the table given its unique id.
2988
3677
  * @param id The unique id.
2989
3678
  * @returns The persisted record for the given id or null if the record could not be found.
2990
3679
  */
2991
3680
  abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
3681
+ /**
3682
+ * Queries multiple records from the table given their unique id.
3683
+ * @param ids The unique ids array.
3684
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3685
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
3686
+ */
3687
+ abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
3688
+ /**
3689
+ * Queries multiple records from the table given their unique id.
3690
+ * @param ids The unique ids array.
3691
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
3692
+ */
3693
+ abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3694
+ /**
3695
+ * Queries a single record from the table by the id in the object.
3696
+ * @param object Object containing the id of the record.
3697
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3698
+ * @returns The persisted record for the given id or null if the record could not be found.
3699
+ */
3700
+ abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3701
+ /**
3702
+ * Queries a single record from the table by the id in the object.
3703
+ * @param object Object containing the id of the record.
3704
+ * @returns The persisted record for the given id or null if the record could not be found.
3705
+ */
3706
+ abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
3707
+ /**
3708
+ * Queries multiple records from the table by the ids in the objects.
3709
+ * @param objects Array of objects containing the ids of the records.
3710
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3711
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
3712
+ */
3713
+ abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
3714
+ /**
3715
+ * Queries multiple records from the table by the ids in the objects.
3716
+ * @param objects Array of objects containing the ids of the records.
3717
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
3718
+ */
3719
+ abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3720
+ /**
3721
+ * Partially update a single record.
3722
+ * @param object An object with its id and the columns to be updated.
3723
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3724
+ * @returns The full persisted record.
3725
+ */
3726
+ abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
2992
3727
  /**
2993
3728
  * Partially update a single record.
2994
3729
  * @param object An object with its id and the columns to be updated.
2995
3730
  * @returns The full persisted record.
2996
3731
  */
2997
3732
  abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3733
+ /**
3734
+ * Partially update a single record given its unique id.
3735
+ * @param id The unique id.
3736
+ * @param object The column names and their values that have to be updated.
3737
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3738
+ * @returns The full persisted record.
3739
+ */
3740
+ abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
2998
3741
  /**
2999
3742
  * Partially update a single record given its unique id.
3000
3743
  * @param id The unique id.
@@ -3005,9 +3748,24 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3005
3748
  /**
3006
3749
  * Partially updates multiple records.
3007
3750
  * @param objects An array of objects with their ids and columns to be updated.
3008
- * @returns Array of the persisted records.
3751
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3752
+ * @returns Array of the persisted records in order.
3753
+ */
3754
+ abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3755
+ /**
3756
+ * Partially updates multiple records.
3757
+ * @param objects An array of objects with their ids and columns to be updated.
3758
+ * @returns Array of the persisted records in order.
3009
3759
  */
3010
3760
  abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3761
+ /**
3762
+ * Creates or updates a single record. If a record exists with the given id,
3763
+ * it will be update, otherwise a new record will be created.
3764
+ * @param object Object containing the column names with their values to be persisted in the table.
3765
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3766
+ * @returns The full persisted record.
3767
+ */
3768
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3011
3769
  /**
3012
3770
  * Creates or updates a single record. If a record exists with the given id,
3013
3771
  * it will be update, otherwise a new record will be created.
@@ -3020,9 +3778,26 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3020
3778
  * it will be update, otherwise a new record will be created.
3021
3779
  * @param id A unique id.
3022
3780
  * @param object The column names and the values to be persisted.
3781
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3023
3782
  * @returns The full persisted record.
3024
3783
  */
3025
- abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3784
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3785
+ /**
3786
+ * Creates or updates a single record. If a record exists with the given id,
3787
+ * it will be update, otherwise a new record will be created.
3788
+ * @param id A unique id.
3789
+ * @param object The column names and the values to be persisted.
3790
+ * @returns The full persisted record.
3791
+ */
3792
+ abstract createOrUpdate(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3793
+ /**
3794
+ * Creates or updates a single record. If a record exists with the given id,
3795
+ * it will be update, otherwise a new record will be created.
3796
+ * @param objects Array of objects with the column names and the values to be stored in the table.
3797
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3798
+ * @returns Array of the persisted records.
3799
+ */
3800
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Data> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3026
3801
  /**
3027
3802
  * Creates or updates a single record. If a record exists with the given id,
3028
3803
  * it will be update, otherwise a new record will be created.
@@ -3061,36 +3836,112 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3061
3836
  * @returns The found records.
3062
3837
  */
3063
3838
  abstract search(query: string, options?: {
3064
- fuzziness?: number;
3065
- }): Promise<SelectedPick<Record, ['*']>[]>;
3839
+ fuzziness?: FuzzinessExpression;
3840
+ prefix?: PrefixExpression;
3841
+ highlight?: HighlightExpression;
3842
+ filter?: Filter<Record>;
3843
+ boosters?: Boosters<Record>[];
3844
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3066
3845
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3067
3846
  }
3068
3847
  declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
3069
3848
  #private;
3070
- db: SchemaPluginResult<any>;
3071
3849
  constructor(options: {
3072
3850
  table: string;
3073
- links?: LinkDictionary;
3074
- getFetchProps: () => Promise<FetcherExtraProps>;
3075
3851
  db: SchemaPluginResult<any>;
3852
+ pluginOptions: XataPluginOptions;
3853
+ schemaTables?: Table[];
3076
3854
  });
3077
- create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3078
- create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3079
- create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3080
- read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
3855
+ create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3856
+ create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3857
+ create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3858
+ create<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3859
+ create<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3860
+ create<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3861
+ read(recordId: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3862
+ read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3863
+ read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3864
+ read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3865
+ read<K extends SelectableColumn<Record>>(recordId: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3866
+ read<K extends SelectableColumn<Record>>(recordIds: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3867
+ read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3868
+ read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3081
3869
  update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3082
3870
  update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3083
3871
  update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3872
+ update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3873
+ update<K extends SelectableColumn<Record>>(recordId: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3874
+ update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
3084
3875
  createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3085
3876
  createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3086
3877
  createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3087
- delete(recordId: string | Identifiable | Array<string | Identifiable>): Promise<void>;
3878
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3879
+ createOrUpdate<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3880
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
3881
+ delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
3088
3882
  search(query: string, options?: {
3089
- fuzziness?: number;
3090
- }): Promise<SelectedPick<Record, ['*']>[]>;
3883
+ fuzziness?: FuzzinessExpression;
3884
+ prefix?: PrefixExpression;
3885
+ highlight?: HighlightExpression;
3886
+ filter?: Filter<Record>;
3887
+ boosters?: Boosters<Record>[];
3888
+ }): Promise<any>;
3091
3889
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3092
3890
  }
3093
3891
 
3892
+ declare type BaseSchema = {
3893
+ name: string;
3894
+ columns: readonly ({
3895
+ name: string;
3896
+ type: Column['type'];
3897
+ } | {
3898
+ name: string;
3899
+ type: 'link';
3900
+ link: {
3901
+ table: string;
3902
+ };
3903
+ } | {
3904
+ name: string;
3905
+ type: 'object';
3906
+ columns: {
3907
+ name: string;
3908
+ type: string;
3909
+ }[];
3910
+ })[];
3911
+ };
3912
+ declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
3913
+ name: string;
3914
+ columns: readonly unknown[];
3915
+ } ? {
3916
+ [K in T[number]['name']]: TableType<T[number], K>;
3917
+ } : never : never;
3918
+ declare type TableType<Tables, TableName> = Tables & {
3919
+ name: TableName;
3920
+ } extends infer Table ? Table extends {
3921
+ name: string;
3922
+ columns: infer Columns;
3923
+ } ? Columns extends readonly unknown[] ? Columns[number] extends {
3924
+ name: string;
3925
+ type: string;
3926
+ } ? Identifiable & {
3927
+ [K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
3928
+ } : never : never : never : never;
3929
+ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
3930
+ name: PropertyName;
3931
+ } extends infer Property ? Property extends {
3932
+ name: string;
3933
+ type: infer Type;
3934
+ link?: {
3935
+ table: infer LinkedTable;
3936
+ };
3937
+ columns?: infer ObjectColumns;
3938
+ } ? (Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
3939
+ name: string;
3940
+ type: string;
3941
+ } ? {
3942
+ [K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
3943
+ } : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
3944
+
3094
3945
  /**
3095
3946
  * Operator to restrict results to only values that are greater than the given value.
3096
3947
  */
@@ -3166,47 +4017,18 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3166
4017
 
3167
4018
  declare type SchemaDefinition = {
3168
4019
  table: string;
3169
- links?: LinkDictionary;
3170
4020
  };
3171
4021
  declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
3172
4022
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
4023
+ } & {
4024
+ [key: string]: Repository<XataRecord$1>;
3173
4025
  };
3174
4026
  declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3175
4027
  #private;
3176
- private links?;
3177
- private tableNames?;
3178
- constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
3179
- build(options: XataPluginOptions): SchemaPluginResult<Schemas>;
4028
+ constructor(schemaTables?: Schemas.Table[]);
4029
+ build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3180
4030
  }
3181
4031
 
3182
- declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3183
- fuzziness?: number;
3184
- tables?: Tables[];
3185
- };
3186
- declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3187
- all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3188
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
3189
- table: Model;
3190
- record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3191
- };
3192
- }>[]>;
3193
- byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3194
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3195
- }>;
3196
- };
3197
- declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3198
- #private;
3199
- private db;
3200
- private links;
3201
- constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
3202
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3203
- }
3204
- declare type SearchXataRecord = XataRecord & {
3205
- xata: {
3206
- table: string;
3207
- };
3208
- };
3209
-
3210
4032
  declare type BranchStrategyValue = string | undefined | null;
3211
4033
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3212
4034
  declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
@@ -3217,18 +4039,24 @@ declare type BaseClientOptions = {
3217
4039
  apiKey?: string;
3218
4040
  databaseURL?: string;
3219
4041
  branch?: BranchStrategyOption;
4042
+ cache?: CacheImpl;
3220
4043
  };
3221
4044
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3222
4045
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3223
- new <Schemas extends Record<string, BaseData>>(options?: Partial<BaseClientOptions>, links?: LinkDictionary): Omit<{
3224
- db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
3225
- search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
4046
+ new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
4047
+ db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
4048
+ search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
3226
4049
  }, keyof Plugins> & {
3227
4050
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
4051
+ } & {
4052
+ getConfig(): Promise<{
4053
+ databaseURL: string;
4054
+ branch: string;
4055
+ }>;
3228
4056
  };
3229
4057
  }
3230
4058
  declare const BaseClient_base: ClientConstructor<{}>;
3231
- declare class BaseClient extends BaseClient_base<Record<string, any>> {
4059
+ declare class BaseClient extends BaseClient_base<[]> {
3232
4060
  }
3233
4061
 
3234
4062
  declare type BranchResolutionOptions = {
@@ -3236,7 +4064,7 @@ declare type BranchResolutionOptions = {
3236
4064
  apiKey?: string;
3237
4065
  fetchImpl?: FetchImpl;
3238
4066
  };
3239
- declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string | undefined>;
4067
+ declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
3240
4068
  declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
3241
4069
  declare function getDatabaseURL(): string | undefined;
3242
4070
 
@@ -3247,4 +4075,4 @@ declare class XataError extends Error {
3247
4075
  constructor(message: string, status: number);
3248
4076
  }
3249
4077
 
3250
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, LinkDictionary, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
4078
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };