@xata.io/client 0.0.0-alpha.vfee45b2 → 0.0.0-alpha.vfef462e

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 = {
@@ -20,7 +23,6 @@ declare type ErrorWrapper<TError> = TError | {
20
23
  };
21
24
 
22
25
  interface CacheImpl {
23
- cacheRecords: boolean;
24
26
  defaultQueryTTL: number;
25
27
  getAll(): Promise<Record<string, unknown>>;
26
28
  get: <T>(key: string) => Promise<T | null>;
@@ -30,13 +32,11 @@ interface CacheImpl {
30
32
  }
31
33
  interface SimpleCacheOptions {
32
34
  max?: number;
33
- cacheRecords?: boolean;
34
35
  defaultQueryTTL?: number;
35
36
  }
36
37
  declare class SimpleCache implements CacheImpl {
37
38
  #private;
38
39
  capacity: number;
39
- cacheRecords: boolean;
40
40
  defaultQueryTTL: number;
41
41
  constructor(options?: SimpleCacheOptions);
42
42
  getAll(): Promise<Record<string, unknown>>;
@@ -279,6 +279,10 @@ declare type SortOrder = 'asc' | 'desc';
279
279
  * @minimum 0
280
280
  */
281
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';
282
286
  /**
283
287
  * @minProperties 1
284
288
  */
@@ -296,6 +300,44 @@ declare type HighlightExpression = {
296
300
  enabled?: boolean;
297
301
  encodeHTML?: boolean;
298
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
+ };
299
341
  declare type FilterList = FilterExpression | FilterExpression[];
300
342
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
301
343
  /**
@@ -352,7 +394,24 @@ declare type PageConfig = {
352
394
  size?: number;
353
395
  offset?: number;
354
396
  };
355
- 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
+ };
356
415
  /**
357
416
  * @pattern [a-zA-Z0-9_-~:]+
358
417
  */
@@ -374,21 +433,9 @@ declare type RecordsMetadata = {
374
433
  };
375
434
  };
376
435
  /**
377
- * Xata Table Record
436
+ * Xata Table Record Metadata
378
437
  */
379
- declare type XataRecord$1 = {
380
- id: RecordID;
381
- xata: {
382
- version: number;
383
- table?: string;
384
- highlight?: {
385
- [key: string]: string[] | {
386
- [key: string]: any;
387
- };
388
- };
389
- warnings?: string[];
390
- };
391
- } & {
438
+ declare type XataRecord$1 = RecordMeta & {
392
439
  [key: string]: any;
393
440
  };
394
441
 
@@ -430,8 +477,10 @@ type schemas_ColumnMigration = ColumnMigration;
430
477
  type schemas_SortExpression = SortExpression;
431
478
  type schemas_SortOrder = SortOrder;
432
479
  type schemas_FuzzinessExpression = FuzzinessExpression;
480
+ type schemas_PrefixExpression = PrefixExpression;
433
481
  type schemas_FilterExpression = FilterExpression;
434
482
  type schemas_HighlightExpression = HighlightExpression;
483
+ type schemas_BoosterExpression = BoosterExpression;
435
484
  type schemas_FilterList = FilterList;
436
485
  type schemas_FilterColumn = FilterColumn;
437
486
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -441,7 +490,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
441
490
  type schemas_FilterRangeValue = FilterRangeValue;
442
491
  type schemas_FilterValue = FilterValue;
443
492
  type schemas_PageConfig = PageConfig;
444
- type schemas_ColumnsFilter = ColumnsFilter;
493
+ type schemas_ColumnsProjection = ColumnsProjection;
494
+ type schemas_RecordMeta = RecordMeta;
445
495
  type schemas_RecordID = RecordID;
446
496
  type schemas_TableRename = TableRename;
447
497
  type schemas_RecordsMetadata = RecordsMetadata;
@@ -485,8 +535,13 @@ declare namespace schemas {
485
535
  schemas_SortExpression as SortExpression,
486
536
  schemas_SortOrder as SortOrder,
487
537
  schemas_FuzzinessExpression as FuzzinessExpression,
538
+ schemas_PrefixExpression as PrefixExpression,
488
539
  schemas_FilterExpression as FilterExpression,
489
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,
490
545
  schemas_FilterList as FilterList,
491
546
  schemas_FilterColumn as FilterColumn,
492
547
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -496,7 +551,8 @@ declare namespace schemas {
496
551
  schemas_FilterRangeValue as FilterRangeValue,
497
552
  schemas_FilterValue as FilterValue,
498
553
  schemas_PageConfig as PageConfig,
499
- schemas_ColumnsFilter as ColumnsFilter,
554
+ schemas_ColumnsProjection as ColumnsProjection,
555
+ schemas_RecordMeta as RecordMeta,
500
556
  schemas_RecordID as RecordID,
501
557
  schemas_TableRename as TableRename,
502
558
  schemas_RecordsMetadata as RecordsMetadata,
@@ -531,11 +587,17 @@ declare type BulkError = {
531
587
  status?: number;
532
588
  }[];
533
589
  };
590
+ declare type BulkInsertResponse = {
591
+ recordIDs: string[];
592
+ } | {
593
+ records: XataRecord$1[];
594
+ };
534
595
  declare type BranchMigrationPlan = {
535
596
  version: number;
536
597
  migration: BranchMigration;
537
598
  };
538
- declare type RecordUpdateResponse = {
599
+ declare type RecordResponse = XataRecord$1;
600
+ declare type RecordUpdateResponse = XataRecord$1 | {
539
601
  id: string;
540
602
  xata: {
541
603
  version: number;
@@ -559,7 +621,9 @@ type responses_SimpleError = SimpleError;
559
621
  type responses_BadRequestError = BadRequestError;
560
622
  type responses_AuthError = AuthError;
561
623
  type responses_BulkError = BulkError;
624
+ type responses_BulkInsertResponse = BulkInsertResponse;
562
625
  type responses_BranchMigrationPlan = BranchMigrationPlan;
626
+ type responses_RecordResponse = RecordResponse;
563
627
  type responses_RecordUpdateResponse = RecordUpdateResponse;
564
628
  type responses_QueryResponse = QueryResponse;
565
629
  type responses_SearchResponse = SearchResponse;
@@ -570,7 +634,9 @@ declare namespace responses {
570
634
  responses_BadRequestError as BadRequestError,
571
635
  responses_AuthError as AuthError,
572
636
  responses_BulkError as BulkError,
637
+ responses_BulkInsertResponse as BulkInsertResponse,
573
638
  responses_BranchMigrationPlan as BranchMigrationPlan,
639
+ responses_RecordResponse as RecordResponse,
574
640
  responses_RecordUpdateResponse as RecordUpdateResponse,
575
641
  responses_QueryResponse as QueryResponse,
576
642
  responses_SearchResponse as SearchResponse,
@@ -876,6 +942,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
876
942
  } | {
877
943
  status: 404;
878
944
  payload: SimpleError;
945
+ } | {
946
+ status: 409;
947
+ payload: SimpleError;
879
948
  }>;
880
949
  declare type InviteWorkspaceMemberRequestBody = {
881
950
  email: string;
@@ -889,6 +958,34 @@ declare type InviteWorkspaceMemberVariables = {
889
958
  * Invite some user to join the workspace with the given role
890
959
  */
891
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>;
892
989
  declare type CancelWorkspaceMemberInvitePathParams = {
893
990
  workspaceId: WorkspaceID;
894
991
  inviteId: InviteID;
@@ -1234,6 +1331,10 @@ declare type CreateBranchError = ErrorWrapper<{
1234
1331
  status: 404;
1235
1332
  payload: SimpleError;
1236
1333
  }>;
1334
+ declare type CreateBranchResponse = {
1335
+ databaseName: string;
1336
+ branchName: string;
1337
+ };
1237
1338
  declare type CreateBranchRequestBody = {
1238
1339
  from?: string;
1239
1340
  metadata?: BranchMetadata;
@@ -1243,7 +1344,7 @@ declare type CreateBranchVariables = {
1243
1344
  pathParams: CreateBranchPathParams;
1244
1345
  queryParams?: CreateBranchQueryParams;
1245
1346
  } & FetcherExtraProps;
1246
- declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
1347
+ declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
1247
1348
  declare type DeleteBranchPathParams = {
1248
1349
  dbBranchName: DBBranchName;
1249
1350
  workspace: string;
@@ -1430,13 +1531,17 @@ declare type CreateTableError = ErrorWrapper<{
1430
1531
  status: 422;
1431
1532
  payload: SimpleError;
1432
1533
  }>;
1534
+ declare type CreateTableResponse = {
1535
+ branchName: string;
1536
+ tableName: string;
1537
+ };
1433
1538
  declare type CreateTableVariables = {
1434
1539
  pathParams: CreateTablePathParams;
1435
1540
  } & FetcherExtraProps;
1436
1541
  /**
1437
1542
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1438
1543
  */
1439
- declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
1544
+ declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
1440
1545
  declare type DeleteTablePathParams = {
1441
1546
  dbBranchName: DBBranchName;
1442
1547
  tableName: TableName;
@@ -1669,6 +1774,9 @@ declare type InsertRecordPathParams = {
1669
1774
  tableName: TableName;
1670
1775
  workspace: string;
1671
1776
  };
1777
+ declare type InsertRecordQueryParams = {
1778
+ columns?: ColumnsProjection;
1779
+ };
1672
1780
  declare type InsertRecordError = ErrorWrapper<{
1673
1781
  status: 400;
1674
1782
  payload: BadRequestError;
@@ -1679,20 +1787,15 @@ declare type InsertRecordError = ErrorWrapper<{
1679
1787
  status: 404;
1680
1788
  payload: SimpleError;
1681
1789
  }>;
1682
- declare type InsertRecordResponse = {
1683
- id: string;
1684
- xata: {
1685
- version: number;
1686
- };
1687
- };
1688
1790
  declare type InsertRecordVariables = {
1689
1791
  body?: Record<string, any>;
1690
1792
  pathParams: InsertRecordPathParams;
1793
+ queryParams?: InsertRecordQueryParams;
1691
1794
  } & FetcherExtraProps;
1692
1795
  /**
1693
1796
  * Insert a new Record into the Table
1694
1797
  */
1695
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
1798
+ declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
1696
1799
  declare type InsertRecordWithIDPathParams = {
1697
1800
  dbBranchName: DBBranchName;
1698
1801
  tableName: TableName;
@@ -1700,6 +1803,7 @@ declare type InsertRecordWithIDPathParams = {
1700
1803
  workspace: string;
1701
1804
  };
1702
1805
  declare type InsertRecordWithIDQueryParams = {
1806
+ columns?: ColumnsProjection;
1703
1807
  createOnly?: boolean;
1704
1808
  ifVersion?: number;
1705
1809
  };
@@ -1732,6 +1836,7 @@ declare type UpdateRecordWithIDPathParams = {
1732
1836
  workspace: string;
1733
1837
  };
1734
1838
  declare type UpdateRecordWithIDQueryParams = {
1839
+ columns?: ColumnsProjection;
1735
1840
  ifVersion?: number;
1736
1841
  };
1737
1842
  declare type UpdateRecordWithIDError = ErrorWrapper<{
@@ -1760,6 +1865,7 @@ declare type UpsertRecordWithIDPathParams = {
1760
1865
  workspace: string;
1761
1866
  };
1762
1867
  declare type UpsertRecordWithIDQueryParams = {
1868
+ columns?: ColumnsProjection;
1763
1869
  ifVersion?: number;
1764
1870
  };
1765
1871
  declare type UpsertRecordWithIDError = ErrorWrapper<{
@@ -1787,6 +1893,9 @@ declare type DeleteRecordPathParams = {
1787
1893
  recordId: RecordID;
1788
1894
  workspace: string;
1789
1895
  };
1896
+ declare type DeleteRecordQueryParams = {
1897
+ columns?: ColumnsProjection;
1898
+ };
1790
1899
  declare type DeleteRecordError = ErrorWrapper<{
1791
1900
  status: 400;
1792
1901
  payload: BadRequestError;
@@ -1799,14 +1908,18 @@ declare type DeleteRecordError = ErrorWrapper<{
1799
1908
  }>;
1800
1909
  declare type DeleteRecordVariables = {
1801
1910
  pathParams: DeleteRecordPathParams;
1911
+ queryParams?: DeleteRecordQueryParams;
1802
1912
  } & FetcherExtraProps;
1803
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
1913
+ declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
1804
1914
  declare type GetRecordPathParams = {
1805
1915
  dbBranchName: DBBranchName;
1806
1916
  tableName: TableName;
1807
1917
  recordId: RecordID;
1808
1918
  workspace: string;
1809
1919
  };
1920
+ declare type GetRecordQueryParams = {
1921
+ columns?: ColumnsProjection;
1922
+ };
1810
1923
  declare type GetRecordError = ErrorWrapper<{
1811
1924
  status: 400;
1812
1925
  payload: BadRequestError;
@@ -1817,12 +1930,9 @@ declare type GetRecordError = ErrorWrapper<{
1817
1930
  status: 404;
1818
1931
  payload: SimpleError;
1819
1932
  }>;
1820
- declare type GetRecordRequestBody = {
1821
- columns?: ColumnsFilter;
1822
- };
1823
1933
  declare type GetRecordVariables = {
1824
- body?: GetRecordRequestBody;
1825
1934
  pathParams: GetRecordPathParams;
1935
+ queryParams?: GetRecordQueryParams;
1826
1936
  } & FetcherExtraProps;
1827
1937
  /**
1828
1938
  * Retrieve record by ID
@@ -1833,6 +1943,9 @@ declare type BulkInsertTableRecordsPathParams = {
1833
1943
  tableName: TableName;
1834
1944
  workspace: string;
1835
1945
  };
1946
+ declare type BulkInsertTableRecordsQueryParams = {
1947
+ columns?: ColumnsProjection;
1948
+ };
1836
1949
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
1837
1950
  status: 400;
1838
1951
  payload: BulkError;
@@ -1842,21 +1955,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1842
1955
  } | {
1843
1956
  status: 404;
1844
1957
  payload: SimpleError;
1958
+ } | {
1959
+ status: 422;
1960
+ payload: SimpleError;
1845
1961
  }>;
1846
- declare type BulkInsertTableRecordsResponse = {
1847
- recordIDs: string[];
1848
- };
1849
1962
  declare type BulkInsertTableRecordsRequestBody = {
1850
1963
  records: Record<string, any>[];
1851
1964
  };
1852
1965
  declare type BulkInsertTableRecordsVariables = {
1853
1966
  body: BulkInsertTableRecordsRequestBody;
1854
1967
  pathParams: BulkInsertTableRecordsPathParams;
1968
+ queryParams?: BulkInsertTableRecordsQueryParams;
1855
1969
  } & FetcherExtraProps;
1856
1970
  /**
1857
1971
  * Bulk insert records
1858
1972
  */
1859
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
1973
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
1860
1974
  declare type QueryTablePathParams = {
1861
1975
  dbBranchName: DBBranchName;
1862
1976
  tableName: TableName;
@@ -1876,7 +1990,7 @@ declare type QueryTableRequestBody = {
1876
1990
  filter?: FilterExpression;
1877
1991
  sort?: SortExpression;
1878
1992
  page?: PageConfig;
1879
- columns?: ColumnsFilter;
1993
+ columns?: ColumnsProjection;
1880
1994
  };
1881
1995
  declare type QueryTableVariables = {
1882
1996
  body?: QueryTableRequestBody;
@@ -2622,8 +2736,10 @@ declare type SearchTableError = ErrorWrapper<{
2622
2736
  declare type SearchTableRequestBody = {
2623
2737
  query: string;
2624
2738
  fuzziness?: FuzzinessExpression;
2739
+ prefix?: PrefixExpression;
2625
2740
  filter?: FilterExpression;
2626
2741
  highlight?: HighlightExpression;
2742
+ boosters?: BoosterExpression[];
2627
2743
  };
2628
2744
  declare type SearchTableVariables = {
2629
2745
  body: SearchTableRequestBody;
@@ -2655,6 +2771,7 @@ declare type SearchBranchRequestBody = {
2655
2771
  tables?: (string | {
2656
2772
  table: string;
2657
2773
  filter?: FilterExpression;
2774
+ boosters?: BoosterExpression[];
2658
2775
  })[];
2659
2776
  query: string;
2660
2777
  fuzziness?: FuzzinessExpression;
@@ -2687,6 +2804,7 @@ declare const operationsByTag: {
2687
2804
  updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2688
2805
  removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2689
2806
  inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
2807
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
2690
2808
  cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2691
2809
  resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2692
2810
  acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
@@ -2703,7 +2821,7 @@ declare const operationsByTag: {
2703
2821
  branch: {
2704
2822
  getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2705
2823
  getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2706
- createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
2824
+ createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2707
2825
  deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2708
2826
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2709
2827
  getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
@@ -2713,7 +2831,7 @@ declare const operationsByTag: {
2713
2831
  getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
2714
2832
  };
2715
2833
  table: {
2716
- createTable: (variables: CreateTableVariables) => Promise<undefined>;
2834
+ createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2717
2835
  deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2718
2836
  updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2719
2837
  getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
@@ -2725,13 +2843,13 @@ declare const operationsByTag: {
2725
2843
  updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
2726
2844
  };
2727
2845
  records: {
2728
- insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2846
+ insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
2729
2847
  insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2730
2848
  updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2731
2849
  upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2732
- deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
2850
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
2733
2851
  getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2734
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2852
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
2735
2853
  queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2736
2854
  searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2737
2855
  searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
@@ -2785,6 +2903,7 @@ declare class WorkspaceApi {
2785
2903
  updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2786
2904
  removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2787
2905
  inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
2906
+ updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
2788
2907
  cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2789
2908
  resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2790
2909
  acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
@@ -2798,14 +2917,14 @@ declare class DatabaseApi {
2798
2917
  getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2799
2918
  addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2800
2919
  removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
2801
- resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<ResolveBranchResponse>;
2920
+ resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
2802
2921
  }
2803
2922
  declare class BranchApi {
2804
2923
  private extraProps;
2805
2924
  constructor(extraProps: FetcherExtraProps);
2806
2925
  getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2807
2926
  getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2808
- 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>;
2809
2928
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2810
2929
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2811
2930
  getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
@@ -2817,7 +2936,7 @@ declare class BranchApi {
2817
2936
  declare class TableApi {
2818
2937
  private extraProps;
2819
2938
  constructor(extraProps: FetcherExtraProps);
2820
- createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2939
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
2821
2940
  deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2822
2941
  updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2823
2942
  getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
@@ -2831,13 +2950,13 @@ declare class TableApi {
2831
2950
  declare class RecordsApi {
2832
2951
  private extraProps;
2833
2952
  constructor(extraProps: FetcherExtraProps);
2834
- 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>;
2835
2954
  insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2836
2955
  updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2837
2956
  upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2838
- deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<void>;
2839
- getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2840
- 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>;
2841
2960
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2842
2961
  searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2843
2962
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
@@ -2853,28 +2972,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
2853
2972
  declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2854
2973
  declare type IsObject<T> = T extends Record<string, any> ? true : false;
2855
2974
  declare type IsArray<T> = T extends Array<any> ? true : false;
2856
- declare type NonEmptyArray<T> = T[] & {
2857
- 0: T;
2858
- };
2859
2975
  declare type RequiredBy<T, K extends keyof T> = T & {
2860
2976
  [P in K]-?: NonNullable<T[P]>;
2861
2977
  };
2862
2978
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2863
2979
  declare type SingleOrArray<T> = T | T[];
2864
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;
2865
2985
 
2866
2986
  declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2867
- declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2868
- [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>;
2869
2989
  }>>;
2870
- 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 Record<string, any> ? V extends SelectableColumn<NonNullable<O[K]>> ? {
2871
- V: ValueAtColumn<NonNullable<O[K]>, V>;
2872
- } : 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;
2873
2993
  declare type MAX_RECURSION = 5;
2874
2994
  declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
2875
- [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
2876
- 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
2877
- 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;
2878
2998
  }>, never>;
2879
2999
  declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
2880
3000
  declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
@@ -2901,27 +3021,37 @@ interface BaseData {
2901
3021
  /**
2902
3022
  * Represents a persisted record from the database.
2903
3023
  */
2904
- interface XataRecord extends Identifiable {
3024
+ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
2905
3025
  /**
2906
- * Metadata of this record.
3026
+ * Get metadata of this record.
2907
3027
  */
2908
- xata: {
2909
- /**
2910
- * Number that is increased every time the record is updated.
2911
- */
2912
- version: number;
2913
- };
3028
+ getMetadata(): XataRecordMetadata;
2914
3029
  /**
2915
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.
2916
3033
  */
2917
- read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
3034
+ read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
3035
+ /**
3036
+ * Retrieves a refreshed copy of the current record from the database.
3037
+ * @returns The persisted record with all first level properties.
3038
+ */
3039
+ read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2918
3040
  /**
2919
3041
  * Performs a partial update of the current record. On success a new object is
2920
3042
  * returned and the current object is not mutated.
2921
- * @param data The columns and their values that have to be updated.
2922
- * @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.
2923
3046
  */
2924
- update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
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.
3053
+ */
3054
+ update(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>>>;
2925
3055
  /**
2926
3056
  * Performs a deletion of the current record in the database.
2927
3057
  *
@@ -2933,23 +3063,36 @@ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update
2933
3063
  /**
2934
3064
  * Retrieves a refreshed copy of the current record from the database.
2935
3065
  */
2936
- 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>;
2937
3067
  /**
2938
3068
  * Performs a partial update of the current record. On success a new object is
2939
3069
  * returned and the current object is not mutated.
2940
- * @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.
2941
3071
  * @returns A new record containing the latest values for all the columns of the current record.
2942
3072
  */
2943
- 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[];
2944
3087
  };
2945
3088
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2946
3089
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2947
3090
  declare type EditableData<O extends BaseData> = {
2948
3091
  [K in keyof O]: O[K] extends XataRecord ? {
2949
3092
  id: string;
2950
- } : NonNullable<O[K]> extends XataRecord ? {
3093
+ } | string : NonNullable<O[K]> extends XataRecord ? {
2951
3094
  id: string;
2952
- } | null | undefined : O[K];
3095
+ } | string | null | undefined : O[K];
2953
3096
  };
2954
3097
 
2955
3098
  /**
@@ -3046,6 +3189,84 @@ declare type NestedApiFilter<T> = {
3046
3189
  };
3047
3190
  declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
3048
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;
3269
+
3049
3270
  declare type SortDirection = 'asc' | 'desc';
3050
3271
  declare type SortFilterExtended<T extends XataRecord> = {
3051
3272
  column: SelectableColumn<T>;
@@ -3057,7 +3278,7 @@ declare type SortFilterBase<T extends XataRecord> = {
3057
3278
  };
3058
3279
 
3059
3280
  declare type BaseOptions<T extends XataRecord> = {
3060
- columns?: NonEmptyArray<SelectableColumn<T>>;
3281
+ columns?: SelectableColumn<T>[];
3061
3282
  cache?: number;
3062
3283
  };
3063
3284
  declare type CursorQueryOptions = {
@@ -3080,7 +3301,7 @@ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryO
3080
3301
  declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
3081
3302
  #private;
3082
3303
  readonly meta: PaginationQueryMeta;
3083
- readonly records: Result[];
3304
+ readonly records: RecordArray<Result>;
3084
3305
  constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
3085
3306
  getQueryOptions(): QueryOptions<Record>;
3086
3307
  key(): string;
@@ -3113,17 +3334,27 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3113
3334
  *
3114
3335
  * ```
3115
3336
  * query.filter("columnName", columnValue)
3116
- * query.filter({
3117
- * "columnName": columnValue
3118
- * })
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 })
3119
3350
  * query.filter({
3120
3351
  * "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
3121
3352
  * })
3122
3353
  * ```
3123
3354
  *
3355
+ * @param filters A filter object
3124
3356
  * @returns A new Query object.
3125
3357
  */
3126
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
3127
3358
  filter(filters: Filter<Record>): Query<Record, Result>;
3128
3359
  /**
3129
3360
  * Builds a new query with a new sort option.
@@ -3137,57 +3368,149 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3137
3368
  * @param columns Array of column names to be returned by the query.
3138
3369
  * @returns A new Query object.
3139
3370
  */
3140
- 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
+ */
3141
3377
  getPaginated(): Promise<Page<Record, Result>>;
3378
+ /**
3379
+ * Get paginated results
3380
+ *
3381
+ * @param options Pagination options
3382
+ * @returns A page of results
3383
+ */
3142
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
+ */
3143
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
+ */
3144
3398
  [Symbol.asyncIterator](): AsyncIterableIterator<Result>;
3399
+ /**
3400
+ * Build an iterator of results
3401
+ *
3402
+ * @returns Async generator of results array
3403
+ */
3145
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
+ */
3146
3411
  getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
3147
3412
  batchSize?: number;
3148
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
+ */
3149
3420
  getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
3150
3421
  batchSize?: number;
3151
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>>;
3152
3428
  /**
3153
3429
  * Performs the query in the database and returns a set of results.
3154
3430
  * @param options Additional options to be used when performing the query.
3155
3431
  * @returns An array of records from the database.
3156
3432
  */
3157
- getMany(): Promise<Result[]>;
3158
- getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
3159
- 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>>;
3160
3440
  /**
3161
3441
  * Performs the query in the database and returns all the results.
3162
3442
  * Warning: If there are a large number of results, this method can have performance implications.
3163
- * @param options Additional options to be used when performing the query.
3164
3443
  * @returns An array of records from the database.
3165
3444
  */
3166
3445
  getAll(): Promise<Result[]>;
3167
- getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
3168
- batchSize?: number;
3169
- }): 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
+ */
3170
3452
  getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
3171
3453
  batchSize?: number;
3172
3454
  }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3173
3455
  /**
3174
- * Performs the query in the database and returns the first result.
3456
+ * Performs the query in the database and returns all the results.
3457
+ * Warning: If there are a large number of results, this method can have performance implications.
3175
3458
  * @param options Additional options to be used when performing the query.
3459
+ * @returns An array of records from the database.
3460
+ */
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.
3176
3466
  * @returns The first record that matches the query, or null if no record matched the query.
3177
3467
  */
3178
3468
  getFirst(): Promise<Result | null>;
3179
- getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): 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
+ */
3180
3474
  getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
3475
+ /**
3476
+ * Performs the query in the database and returns the first result.
3477
+ * @param options Additional options to be used when performing the query.
3478
+ * @returns The first record that matches the query, or null if no record matched the query.
3479
+ */
3480
+ getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
3181
3481
  /**
3182
3482
  * Builds a new query object adding a cache TTL in milliseconds.
3183
3483
  * @param ttl The cache TTL in milliseconds.
3184
3484
  * @returns A new Query object.
3185
3485
  */
3186
3486
  cache(ttl: number): Query<Record, Result>;
3487
+ /**
3488
+ * Retrieve next page of records
3489
+ *
3490
+ * @returns A new page object.
3491
+ */
3187
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
+ */
3188
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
+ */
3189
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
+ */
3190
3510
  lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3511
+ /**
3512
+ * @returns Boolean indicating if there is a next page
3513
+ */
3191
3514
  hasNextPage(): boolean;
3192
3515
  }
3193
3516
 
@@ -3199,7 +3522,7 @@ declare type PaginationQueryMeta = {
3199
3522
  };
3200
3523
  interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
3201
3524
  meta: PaginationQueryMeta;
3202
- records: Result[];
3525
+ records: RecordArray<Result>;
3203
3526
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3204
3527
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3205
3528
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
@@ -3219,7 +3542,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
3219
3542
  /**
3220
3543
  * The set of results for this page.
3221
3544
  */
3222
- readonly records: Result[];
3545
+ readonly records: RecordArray<Result>;
3223
3546
  constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
3224
3547
  /**
3225
3548
  * Retrieves the next page of results.
@@ -3268,41 +3591,153 @@ declare type OffsetNavigationOptions = {
3268
3591
  offset?: number;
3269
3592
  };
3270
3593
  declare const PAGINATION_MAX_SIZE = 200;
3271
- declare const PAGINATION_DEFAULT_SIZE = 200;
3594
+ declare const PAGINATION_DEFAULT_SIZE = 20;
3272
3595
  declare const PAGINATION_MAX_OFFSET = 800;
3273
3596
  declare const PAGINATION_DEFAULT_OFFSET = 0;
3274
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
+ }
3275
3633
 
3276
3634
  /**
3277
3635
  * Common interface for performing operations on a table.
3278
3636
  */
3279
3637
  declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
3280
- 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, ['*']>>>;
3281
3640
  /**
3282
3641
  * Creates a single record in the table with a unique id.
3283
3642
  * @param id The unique id.
3284
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.
3285
3645
  * @returns The full persisted record.
3286
3646
  */
3287
- abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3647
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3648
+ /**
3649
+ * Creates a single record in the table with a unique id.
3650
+ * @param id The unique id.
3651
+ * @param object Object containing the column names with their values to be stored in the table.
3652
+ * @returns The full persisted record.
3653
+ */
3654
+ abstract create(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3288
3655
  /**
3289
3656
  * Creates multiple records in the table.
3290
3657
  * @param objects Array of objects with the column names and the values to be stored in the table.
3291
- * @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.
3660
+ */
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.
3292
3673
  */
3293
- abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3674
+ abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3294
3675
  /**
3295
3676
  * Queries a single record from the table given its unique id.
3296
3677
  * @param id The unique id.
3297
3678
  * @returns The persisted record for the given id or null if the record could not be found.
3298
3679
  */
3299
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>>>;
3300
3727
  /**
3301
3728
  * Partially update a single record.
3302
3729
  * @param object An object with its id and the columns to be updated.
3303
3730
  * @returns The full persisted record.
3304
3731
  */
3305
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>>>;
3306
3741
  /**
3307
3742
  * Partially update a single record given its unique id.
3308
3743
  * @param id The unique id.
@@ -3313,9 +3748,24 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3313
3748
  /**
3314
3749
  * Partially updates multiple records.
3315
3750
  * @param objects An array of objects with their ids and columns to be updated.
3316
- * @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.
3317
3759
  */
3318
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>>>;
3319
3769
  /**
3320
3770
  * Creates or updates a single record. If a record exists with the given id,
3321
3771
  * it will be update, otherwise a new record will be created.
@@ -3323,6 +3773,15 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3323
3773
  * @returns The full persisted record.
3324
3774
  */
3325
3775
  abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3776
+ /**
3777
+ * Creates or updates a single record. If a record exists with the given id,
3778
+ * it will be update, otherwise a new record will be created.
3779
+ * @param id A unique id.
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.
3782
+ * @returns The full persisted record.
3783
+ */
3784
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3326
3785
  /**
3327
3786
  * Creates or updates a single record. If a record exists with the given id,
3328
3787
  * it will be update, otherwise a new record will be created.
@@ -3330,7 +3789,15 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3330
3789
  * @param object The column names and the values to be persisted.
3331
3790
  * @returns The full persisted record.
3332
3791
  */
3333
- abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
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>>[]>;
3334
3801
  /**
3335
3802
  * Creates or updates a single record. If a record exists with the given id,
3336
3803
  * it will be update, otherwise a new record will be created.
@@ -3369,37 +3836,112 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3369
3836
  * @returns The found records.
3370
3837
  */
3371
3838
  abstract search(query: string, options?: {
3372
- fuzziness?: number;
3839
+ fuzziness?: FuzzinessExpression;
3840
+ prefix?: PrefixExpression;
3841
+ highlight?: HighlightExpression;
3373
3842
  filter?: Filter<Record>;
3374
- }): Promise<SelectedPick<Record, ['*']>[]>;
3843
+ boosters?: Boosters<Record>[];
3844
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3375
3845
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3376
3846
  }
3377
3847
  declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
3378
3848
  #private;
3379
- db: SchemaPluginResult<any>;
3380
3849
  constructor(options: {
3381
3850
  table: string;
3382
3851
  db: SchemaPluginResult<any>;
3383
3852
  pluginOptions: XataPluginOptions;
3853
+ schemaTables?: Table[];
3384
3854
  });
3385
- create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3386
- create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3387
- create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3388
- 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>>>>;
3389
3869
  update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3390
3870
  update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3391
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>[]>;
3392
3875
  createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3393
3876
  createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3394
3877
  createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
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>[]>;
3395
3881
  delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
3396
3882
  search(query: string, options?: {
3397
- fuzziness?: number;
3883
+ fuzziness?: FuzzinessExpression;
3884
+ prefix?: PrefixExpression;
3885
+ highlight?: HighlightExpression;
3398
3886
  filter?: Filter<Record>;
3399
- }): Promise<SelectedPick<Record, ['*']>[]>;
3887
+ boosters?: Boosters<Record>[];
3888
+ }): Promise<any>;
3400
3889
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3401
3890
  }
3402
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
+
3403
3945
  /**
3404
3946
  * Operator to restrict results to only values that are greater than the given value.
3405
3947
  */
@@ -3483,38 +4025,10 @@ declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
3483
4025
  };
3484
4026
  declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3485
4027
  #private;
3486
- private tableNames?;
3487
- constructor(tableNames?: string[] | undefined);
4028
+ constructor(schemaTables?: Schemas.Table[]);
3488
4029
  build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3489
4030
  }
3490
4031
 
3491
- declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3492
- fuzziness?: number;
3493
- tables?: Tables[];
3494
- };
3495
- declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3496
- all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3497
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
3498
- table: Model;
3499
- record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3500
- };
3501
- }>[]>;
3502
- byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3503
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3504
- }>;
3505
- };
3506
- declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3507
- #private;
3508
- private db;
3509
- constructor(db: SchemaPluginResult<Schemas>);
3510
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3511
- }
3512
- declare type SearchXataRecord = XataRecord & {
3513
- xata: {
3514
- table: string;
3515
- };
3516
- };
3517
-
3518
4032
  declare type BranchStrategyValue = string | undefined | null;
3519
4033
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3520
4034
  declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
@@ -3529,15 +4043,20 @@ declare type BaseClientOptions = {
3529
4043
  };
3530
4044
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3531
4045
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3532
- new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, tables?: string[]): Omit<{
3533
- db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
3534
- 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']>>;
3535
4049
  }, keyof Plugins> & {
3536
4050
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
4051
+ } & {
4052
+ getConfig(): Promise<{
4053
+ databaseURL: string;
4054
+ branch: string;
4055
+ }>;
3537
4056
  };
3538
4057
  }
3539
4058
  declare const BaseClient_base: ClientConstructor<{}>;
3540
- declare class BaseClient extends BaseClient_base<Record<string, any>> {
4059
+ declare class BaseClient extends BaseClient_base<[]> {
3541
4060
  }
3542
4061
 
3543
4062
  declare type BranchResolutionOptions = {
@@ -3556,4 +4075,4 @@ declare class XataError extends Error {
3556
4075
  constructor(message: string, status: number);
3557
4076
  }
3558
4077
 
3559
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, 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, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, 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, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, 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, 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, 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 };