@xata.io/client 0.0.0-alpha.vfbde008 → 0.0.0-alpha.vfc4a5e4

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
@@ -22,23 +22,22 @@ declare class SimpleCache implements CacheImpl {
22
22
  clear(): Promise<void>;
23
23
  }
24
24
 
25
+ declare abstract class XataPlugin {
26
+ abstract build(options: XataPluginOptions): unknown;
27
+ }
28
+ type XataPluginOptions = ApiExtraProps & {
29
+ cache: CacheImpl;
30
+ host: HostProvider;
31
+ };
32
+
25
33
  type AttributeDictionary = Record<string, string | number | boolean | undefined>;
26
34
  type TraceFunction = <T>(name: string, fn: (options: {
27
35
  name?: string;
28
36
  setAttributes: (attrs: AttributeDictionary) => void;
29
37
  }) => T, options?: AttributeDictionary) => Promise<T>;
30
38
 
31
- declare abstract class XataPlugin {
32
- abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
33
- }
34
- type XataPluginOptions = {
35
- getFetchProps: () => Promise<ApiExtraProps>;
36
- cache: CacheImpl;
37
- trace?: TraceFunction;
38
- };
39
-
40
39
  type RequestInit = {
41
- body?: string;
40
+ body?: any;
42
41
  headers?: Record<string, string>;
43
42
  method?: string;
44
43
  signal?: any;
@@ -48,6 +47,8 @@ type Response = {
48
47
  status: number;
49
48
  url: string;
50
49
  json(): Promise<any>;
50
+ text(): Promise<string>;
51
+ blob(): Promise<Blob>;
51
52
  headers?: {
52
53
  get(name: string): string | null;
53
54
  };
@@ -73,7 +74,7 @@ type FetcherExtraProps = {
73
74
  endpoint: 'controlPlane' | 'dataPlane';
74
75
  apiUrl: string;
75
76
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
76
- fetchImpl: FetchImpl;
77
+ fetch: FetchImpl;
77
78
  apiKey: string;
78
79
  trace: TraceFunction;
79
80
  signal?: AbortSignal;
@@ -82,12 +83,14 @@ type FetcherExtraProps = {
82
83
  clientName?: string;
83
84
  xataAgentExtra?: Record<string, string>;
84
85
  fetchOptions?: Record<string, unknown>;
86
+ rawResponse?: boolean;
87
+ headers?: Record<string, unknown>;
85
88
  };
86
89
 
87
90
  type ControlPlaneFetcherExtraProps = {
88
91
  apiUrl: string;
89
92
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
90
- fetchImpl: FetchImpl;
93
+ fetch: FetchImpl;
91
94
  apiKey: string;
92
95
  trace: TraceFunction;
93
96
  signal?: AbortSignal;
@@ -261,6 +264,7 @@ type DatabaseGithubSettings = {
261
264
  };
262
265
  type Region = {
263
266
  id: string;
267
+ name: string;
264
268
  };
265
269
  type ListRegionsResponse = {
266
270
  /**
@@ -954,6 +958,43 @@ type UpdateDatabaseMetadataVariables = {
954
958
  * Update the color of the selected database
955
959
  */
956
960
  declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
961
+ type RenameDatabasePathParams = {
962
+ /**
963
+ * Workspace ID
964
+ */
965
+ workspaceId: WorkspaceID;
966
+ /**
967
+ * The Database Name
968
+ */
969
+ dbName: DBName$1;
970
+ };
971
+ type RenameDatabaseError = ErrorWrapper$1<{
972
+ status: 400;
973
+ payload: BadRequestError$1;
974
+ } | {
975
+ status: 401;
976
+ payload: AuthError$1;
977
+ } | {
978
+ status: 422;
979
+ payload: SimpleError$1;
980
+ } | {
981
+ status: 423;
982
+ payload: SimpleError$1;
983
+ }>;
984
+ type RenameDatabaseRequestBody = {
985
+ /**
986
+ * @minLength 1
987
+ */
988
+ newName: string;
989
+ };
990
+ type RenameDatabaseVariables = {
991
+ body: RenameDatabaseRequestBody;
992
+ pathParams: RenameDatabasePathParams;
993
+ } & ControlPlaneFetcherExtraProps;
994
+ /**
995
+ * Change the name of an existing database
996
+ */
997
+ declare const renameDatabase: (variables: RenameDatabaseVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
957
998
  type GetDatabaseGithubSettingsPathParams = {
958
999
  /**
959
1000
  * Workspace ID
@@ -1135,11 +1176,16 @@ type ColumnVector = {
1135
1176
  */
1136
1177
  dimension: number;
1137
1178
  };
1179
+ type ColumnFile = {
1180
+ defaultPublicAccess?: boolean;
1181
+ };
1138
1182
  type Column = {
1139
1183
  name: string;
1140
- type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime' | 'vector';
1184
+ type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime' | 'vector' | 'file[]' | 'file';
1141
1185
  link?: ColumnLink;
1142
1186
  vector?: ColumnVector;
1187
+ file?: ColumnFile;
1188
+ ['file[]']?: ColumnFile;
1143
1189
  notNull?: boolean;
1144
1190
  defaultValue?: string;
1145
1191
  unique?: boolean;
@@ -1174,6 +1220,11 @@ type DBBranch = {
1174
1220
  schema: Schema;
1175
1221
  };
1176
1222
  type MigrationStatus = 'completed' | 'pending' | 'failed';
1223
+ type BranchWithCopyID = {
1224
+ branchName: BranchName;
1225
+ dbBranchID: string;
1226
+ copyID: string;
1227
+ };
1177
1228
  type MetricsDatapoint = {
1178
1229
  timestamp: string;
1179
1230
  value: number;
@@ -1289,7 +1340,7 @@ type FilterColumnIncludes = {
1289
1340
  $includesNone?: FilterPredicate;
1290
1341
  };
1291
1342
  type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
1292
- type SortOrder = 'asc' | 'desc';
1343
+ type SortOrder = 'asc' | 'desc' | 'random';
1293
1344
  type SortExpression = string[] | {
1294
1345
  [key: string]: SortOrder;
1295
1346
  } | {
@@ -1387,9 +1438,13 @@ type RecordsMetadata = {
1387
1438
  */
1388
1439
  cursor: string;
1389
1440
  /**
1390
- * true if more records can be fetch
1441
+ * true if more records can be fetched
1391
1442
  */
1392
1443
  more: boolean;
1444
+ /**
1445
+ * the number of records returned per page
1446
+ */
1447
+ size: number;
1393
1448
  };
1394
1449
  };
1395
1450
  type TableOpAdd = {
@@ -1438,10 +1493,9 @@ type Commit = {
1438
1493
  message?: string;
1439
1494
  id: string;
1440
1495
  parentID?: string;
1496
+ checksum: string;
1441
1497
  mergeParentID?: string;
1442
- status: MigrationStatus;
1443
1498
  createdAt: DateTime;
1444
- modifiedAt?: DateTime;
1445
1499
  operations: MigrationOp[];
1446
1500
  };
1447
1501
  type SchemaEditScript = {
@@ -1449,6 +1503,16 @@ type SchemaEditScript = {
1449
1503
  targetMigrationID?: string;
1450
1504
  operations: MigrationOp[];
1451
1505
  };
1506
+ type BranchOp = {
1507
+ id: string;
1508
+ parentID?: string;
1509
+ title?: string;
1510
+ message?: string;
1511
+ status: MigrationStatus;
1512
+ createdAt: DateTime;
1513
+ modifiedAt?: DateTime;
1514
+ migration?: Commit;
1515
+ };
1452
1516
  /**
1453
1517
  * Branch schema migration.
1454
1518
  */
@@ -1456,6 +1520,14 @@ type Migration = {
1456
1520
  parentID?: string;
1457
1521
  operations: MigrationOp[];
1458
1522
  };
1523
+ type MigrationObject = {
1524
+ title?: string;
1525
+ message?: string;
1526
+ id: string;
1527
+ parentID?: string;
1528
+ checksum: string;
1529
+ operations: MigrationOp[];
1530
+ };
1459
1531
  /**
1460
1532
  * @pattern [a-zA-Z0-9_\-~\.]+
1461
1533
  */
@@ -1529,9 +1601,27 @@ type TransactionUpdateOp = {
1529
1601
  columns?: string[];
1530
1602
  };
1531
1603
  /**
1532
- * A delete operation. The transaction will continue if no record matches the ID.
1604
+ * A delete operation. The transaction will continue if no record matches the ID by default. To override this behaviour, set failIfMissing to true.
1533
1605
  */
1534
1606
  type TransactionDeleteOp = {
1607
+ /**
1608
+ * The table name
1609
+ */
1610
+ table: string;
1611
+ id: RecordID;
1612
+ /**
1613
+ * If true, the transaction will fail when the record doesn't exist.
1614
+ */
1615
+ failIfMissing?: boolean;
1616
+ /**
1617
+ * If set, the call will return the requested fields as part of the response.
1618
+ */
1619
+ columns?: string[];
1620
+ };
1621
+ /**
1622
+ * Get by id operation.
1623
+ */
1624
+ type TransactionGetOp = {
1535
1625
  /**
1536
1626
  * The table name
1537
1627
  */
@@ -1551,6 +1641,8 @@ type TransactionOperation$1 = {
1551
1641
  update: TransactionUpdateOp;
1552
1642
  } | {
1553
1643
  ['delete']: TransactionDeleteOp;
1644
+ } | {
1645
+ get: TransactionGetOp;
1554
1646
  };
1555
1647
  /**
1556
1648
  * Fields to return in the transaction result.
@@ -1602,11 +1694,21 @@ type TransactionResultDelete = {
1602
1694
  rows: number;
1603
1695
  columns?: TransactionResultColumns;
1604
1696
  };
1697
+ /**
1698
+ * A result from a get operation.
1699
+ */
1700
+ type TransactionResultGet = {
1701
+ /**
1702
+ * The type of operation who's result is being returned.
1703
+ */
1704
+ operation: 'get';
1705
+ columns?: TransactionResultColumns;
1706
+ };
1605
1707
  /**
1606
1708
  * An ordered array of results from the submitted operations.
1607
1709
  */
1608
1710
  type TransactionSuccess = {
1609
- results: (TransactionResultInsert | TransactionResultUpdate | TransactionResultDelete)[];
1711
+ results: (TransactionResultInsert | TransactionResultUpdate | TransactionResultDelete | TransactionResultGet)[];
1610
1712
  };
1611
1713
  /**
1612
1714
  * An error message from a failing transaction operation
@@ -1622,7 +1724,7 @@ type TransactionError = {
1622
1724
  message: string;
1623
1725
  };
1624
1726
  /**
1625
- * An array of errors, with indicides, from the transaction.
1727
+ * An array of errors, with indices, from the transaction.
1626
1728
  */
1627
1729
  type TransactionFailure = {
1628
1730
  /**
@@ -1634,6 +1736,93 @@ type TransactionFailure = {
1634
1736
  */
1635
1737
  errors: TransactionError[];
1636
1738
  };
1739
+ /**
1740
+ * Object column value
1741
+ */
1742
+ type ObjectValue = {
1743
+ [key: string]: string | boolean | number | string[] | number[] | DateTime | ObjectValue;
1744
+ };
1745
+ /**
1746
+ * Unique file identifier
1747
+ *
1748
+ * @maxLength 255
1749
+ * @minLength 1
1750
+ * @pattern [a-zA-Z0-9_-~:]+
1751
+ */
1752
+ type FileItemID = string;
1753
+ /**
1754
+ * File name
1755
+ *
1756
+ * @maxLength 1024
1757
+ * @minLength 0
1758
+ * @pattern [0-9a-zA-Z!\-_\.\*'\(\)]*
1759
+ */
1760
+ type FileName = string;
1761
+ /**
1762
+ * Media type
1763
+ *
1764
+ * @maxLength 255
1765
+ * @minLength 3
1766
+ * @pattern ^\w+/[-+.\w]+$
1767
+ */
1768
+ type MediaType = string;
1769
+ /**
1770
+ * Object representing a file in an array
1771
+ */
1772
+ type InputFileEntry = {
1773
+ id?: FileItemID;
1774
+ name?: FileName;
1775
+ mediaType?: MediaType;
1776
+ /**
1777
+ * Base64 encoded content
1778
+ *
1779
+ * @maxLength 20971520
1780
+ */
1781
+ base64Content?: string;
1782
+ /**
1783
+ * Enable public access to the file
1784
+ */
1785
+ enablePublicUrl?: boolean;
1786
+ /**
1787
+ * Time to live for signed URLs
1788
+ */
1789
+ signedUrlTimeout?: number;
1790
+ };
1791
+ /**
1792
+ * Array of file entries
1793
+ *
1794
+ * @maxItems 50
1795
+ */
1796
+ type InputFileArray = InputFileEntry[];
1797
+ /**
1798
+ * Object representing a file
1799
+ *
1800
+ * @x-go-type file.InputFile
1801
+ */
1802
+ type InputFile = {
1803
+ name: FileName;
1804
+ mediaType?: MediaType;
1805
+ /**
1806
+ * Base64 encoded content
1807
+ *
1808
+ * @maxLength 20971520
1809
+ */
1810
+ base64Content?: string;
1811
+ /**
1812
+ * Enable public access to the file
1813
+ */
1814
+ enablePublicUrl?: boolean;
1815
+ /**
1816
+ * Time to live for signed URLs
1817
+ */
1818
+ signedUrlTimeout?: number;
1819
+ };
1820
+ /**
1821
+ * Xata input record
1822
+ */
1823
+ type DataInputRecord = {
1824
+ [key: string]: RecordID | string | boolean | number | string[] | number[] | DateTime | ObjectValue | InputFileArray | InputFile | null;
1825
+ };
1637
1826
  /**
1638
1827
  * Xata Table Record Metadata
1639
1828
  */
@@ -1644,6 +1833,14 @@ type RecordMeta = {
1644
1833
  * The record's version. Can be used for optimistic concurrency control.
1645
1834
  */
1646
1835
  version: number;
1836
+ /**
1837
+ * The time when the record was created.
1838
+ */
1839
+ createdAt?: string;
1840
+ /**
1841
+ * The time when the record was last updated.
1842
+ */
1843
+ updatedAt?: string;
1647
1844
  /**
1648
1845
  * The record's table name. APIs that return records from multiple tables will set this field accordingly.
1649
1846
  */
@@ -1666,6 +1863,47 @@ type RecordMeta = {
1666
1863
  warnings?: string[];
1667
1864
  };
1668
1865
  };
1866
+ /**
1867
+ * File metadata
1868
+ */
1869
+ type FileResponse = {
1870
+ id?: FileItemID;
1871
+ name: FileName;
1872
+ mediaType: MediaType;
1873
+ /**
1874
+ * @format int64
1875
+ */
1876
+ size: number;
1877
+ /**
1878
+ * @format int64
1879
+ */
1880
+ version: number;
1881
+ attributes?: Record<string, any>;
1882
+ };
1883
+ type QueryColumnsProjection = (string | ProjectionConfig)[];
1884
+ /**
1885
+ * A structured projection that allows for some configuration.
1886
+ */
1887
+ type ProjectionConfig = {
1888
+ /**
1889
+ * The name of the column to project or a reverse link specification, see [API Guide](https://xata.io/docs/concepts/data-model#links-and-relations).
1890
+ */
1891
+ name?: string;
1892
+ columns?: QueryColumnsProjection;
1893
+ /**
1894
+ * An alias for the projected field, this is how it will be returned in the response.
1895
+ */
1896
+ as?: string;
1897
+ sort?: SortExpression;
1898
+ /**
1899
+ * @default 20
1900
+ */
1901
+ limit?: number;
1902
+ /**
1903
+ * @default 0
1904
+ */
1905
+ offset?: number;
1906
+ };
1669
1907
  /**
1670
1908
  * The target expression is used to filter the search results by the target columns.
1671
1909
  */
@@ -1696,7 +1934,7 @@ type ValueBooster$1 = {
1696
1934
  */
1697
1935
  value: string | number | boolean;
1698
1936
  /**
1699
- * The factor with which to multiply the score of the record.
1937
+ * The factor with which to multiply the added boost.
1700
1938
  */
1701
1939
  factor: number;
1702
1940
  /**
@@ -1738,7 +1976,8 @@ type NumericBooster$1 = {
1738
1976
  /**
1739
1977
  * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
1740
1978
  * 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
1741
- * 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.
1979
+ * should be interpreted as: a record with a date 10 days before/after origin will be boosted 2 times less than a record with the date at origin.
1980
+ * The result of the exponential function is a boost between 0 and 1. The "factor" allows you to control how impactful this boost is, by multiplying it with a given value.
1742
1981
  */
1743
1982
  type DateBooster$1 = {
1744
1983
  /**
@@ -1751,7 +1990,7 @@ type DateBooster$1 = {
1751
1990
  */
1752
1991
  origin?: string;
1753
1992
  /**
1754
- * The duration at which distance from origin the score is decayed with factor, using an exponential function. It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
1993
+ * The duration at which distance from origin the score is decayed with factor, using an exponential function. It is formatted as number + units, for example: `5d`, `20m`, `10s`.
1755
1994
  *
1756
1995
  * @pattern ^(\d+)(d|h|m|s|ms)$
1757
1996
  */
@@ -1760,6 +1999,12 @@ type DateBooster$1 = {
1760
1999
  * The decay factor to expect at "scale" distance from the "origin".
1761
2000
  */
1762
2001
  decay: number;
2002
+ /**
2003
+ * The factor with which to multiply the added boost.
2004
+ *
2005
+ * @minimum 0
2006
+ */
2007
+ factor?: number;
1763
2008
  /**
1764
2009
  * Only apply this booster to the records for which the provided filter matches.
1765
2010
  */
@@ -1780,7 +2025,7 @@ type BoosterExpression = {
1780
2025
  /**
1781
2026
  * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
1782
2027
  * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
1783
- * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
2028
+ * character typos per word are tolerated by search. You can set it to 0 to remove the typo tolerance or set it to 2
1784
2029
  * to allow two typos in a word.
1785
2030
  *
1786
2031
  * @default 1
@@ -1821,6 +2066,12 @@ type SearchPageConfig = {
1821
2066
  */
1822
2067
  offset?: number;
1823
2068
  };
2069
+ /**
2070
+ * Xata Table SQL Record
2071
+ */
2072
+ type SQLRecord = {
2073
+ [key: string]: any;
2074
+ };
1824
2075
  /**
1825
2076
  * A summary expression is the description of a single summary operation. It consists of a single
1826
2077
  * key representing the operation, and a value representing the column to be operated on.
@@ -1927,7 +2178,7 @@ type UniqueCountAgg = {
1927
2178
  column: string;
1928
2179
  /**
1929
2180
  * The threshold under which the unique count is exact. If the number of unique
1930
- * values in the column is higher than this threshold, the results are approximative.
2181
+ * values in the column is higher than this threshold, the results are approximate.
1931
2182
  * Maximum value is 40,000, default value is 3000.
1932
2183
  */
1933
2184
  precisionThreshold?: number;
@@ -1950,7 +2201,7 @@ type DateHistogramAgg = {
1950
2201
  column: string;
1951
2202
  /**
1952
2203
  * The fixed interval to use when bucketing.
1953
- * It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
2204
+ * It is formatted as number + units, for example: `5d`, `20m`, `10s`.
1954
2205
  *
1955
2206
  * @pattern ^(\d+)(d|h|m|s|ms)$
1956
2207
  */
@@ -2005,7 +2256,7 @@ type NumericHistogramAgg = {
2005
2256
  interval: number;
2006
2257
  /**
2007
2258
  * By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
2008
- * boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
2259
+ * boundaries can be shifted by using the offset option. For example, if the `interval` is 100,
2009
2260
  * but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
2010
2261
  * to 50.
2011
2262
  *
@@ -2048,6 +2299,18 @@ type AggResponse$1 = (number | null) | {
2048
2299
  [key: string]: AggResponse$1;
2049
2300
  })[];
2050
2301
  };
2302
+ /**
2303
+ * File identifier in access URLs
2304
+ *
2305
+ * @maxLength 296
2306
+ * @minLength 88
2307
+ * @pattern [a-v0-9=]+
2308
+ */
2309
+ type FileAccessID = string;
2310
+ /**
2311
+ * File signature
2312
+ */
2313
+ type FileSignature = string;
2051
2314
  /**
2052
2315
  * Xata Table Record Metadata
2053
2316
  */
@@ -2093,12 +2356,19 @@ type SchemaCompareResponse = {
2093
2356
  target: Schema;
2094
2357
  edits: SchemaEditScript;
2095
2358
  };
2359
+ type RateLimitError = {
2360
+ id?: string;
2361
+ message: string;
2362
+ };
2096
2363
  type RecordUpdateResponse = XataRecord$1 | {
2097
2364
  id: string;
2098
2365
  xata: {
2099
2366
  version: number;
2367
+ createdAt: string;
2368
+ updatedAt: string;
2100
2369
  };
2101
2370
  };
2371
+ type PutFileResponse = FileResponse;
2102
2372
  type RecordResponse = XataRecord$1;
2103
2373
  type BulkInsertResponse = {
2104
2374
  recordIDs: string[];
@@ -2115,10 +2385,18 @@ type QueryResponse = {
2115
2385
  records: XataRecord$1[];
2116
2386
  meta: RecordsMetadata;
2117
2387
  };
2388
+ type ServiceUnavailableError = {
2389
+ id?: string;
2390
+ message: string;
2391
+ };
2118
2392
  type SearchResponse = {
2119
2393
  records: XataRecord$1[];
2120
2394
  warning?: string;
2121
2395
  };
2396
+ type SQLResponse = {
2397
+ records: SQLRecord[];
2398
+ warning?: string;
2399
+ };
2122
2400
  type SummarizeResponse = {
2123
2401
  summaries: Record<string, any>[];
2124
2402
  };
@@ -2134,7 +2412,7 @@ type AggResponse = {
2134
2412
  type DataPlaneFetcherExtraProps = {
2135
2413
  apiUrl: string;
2136
2414
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
2137
- fetchImpl: FetchImpl;
2415
+ fetch: FetchImpl;
2138
2416
  apiKey: string;
2139
2417
  trace: TraceFunction;
2140
2418
  signal?: AbortSignal;
@@ -2280,6 +2558,36 @@ type DeleteBranchVariables = {
2280
2558
  * Delete the branch in the database and all its resources
2281
2559
  */
2282
2560
  declare const deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<DeleteBranchResponse>;
2561
+ type CopyBranchPathParams = {
2562
+ /**
2563
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2564
+ */
2565
+ dbBranchName: DBBranchName;
2566
+ workspace: string;
2567
+ region: string;
2568
+ };
2569
+ type CopyBranchError = ErrorWrapper<{
2570
+ status: 400;
2571
+ payload: BadRequestError;
2572
+ } | {
2573
+ status: 401;
2574
+ payload: AuthError;
2575
+ } | {
2576
+ status: 404;
2577
+ payload: SimpleError;
2578
+ }>;
2579
+ type CopyBranchRequestBody = {
2580
+ destinationBranch: string;
2581
+ limit?: number;
2582
+ };
2583
+ type CopyBranchVariables = {
2584
+ body: CopyBranchRequestBody;
2585
+ pathParams: CopyBranchPathParams;
2586
+ } & DataPlaneFetcherExtraProps;
2587
+ /**
2588
+ * Create a copy of the branch
2589
+ */
2590
+ declare const copyBranch: (variables: CopyBranchVariables, signal?: AbortSignal) => Promise<BranchWithCopyID>;
2283
2591
  type UpdateBranchMetadataPathParams = {
2284
2592
  /**
2285
2593
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -2924,7 +3232,7 @@ type MergeMigrationRequestError = ErrorWrapper<{
2924
3232
  type MergeMigrationRequestVariables = {
2925
3233
  pathParams: MergeMigrationRequestPathParams;
2926
3234
  } & DataPlaneFetcherExtraProps;
2927
- declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
3235
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<BranchOp>;
2928
3236
  type GetBranchSchemaHistoryPathParams = {
2929
3237
  /**
2930
3238
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -3121,6 +3429,44 @@ type ApplyBranchSchemaEditVariables = {
3121
3429
  pathParams: ApplyBranchSchemaEditPathParams;
3122
3430
  } & DataPlaneFetcherExtraProps;
3123
3431
  declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3432
+ type PushBranchMigrationsPathParams = {
3433
+ /**
3434
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3435
+ */
3436
+ dbBranchName: DBBranchName;
3437
+ workspace: string;
3438
+ region: string;
3439
+ };
3440
+ type PushBranchMigrationsError = ErrorWrapper<{
3441
+ status: 400;
3442
+ payload: BadRequestError;
3443
+ } | {
3444
+ status: 401;
3445
+ payload: AuthError;
3446
+ } | {
3447
+ status: 404;
3448
+ payload: SimpleError;
3449
+ }>;
3450
+ type PushBranchMigrationsRequestBody = {
3451
+ migrations: MigrationObject[];
3452
+ };
3453
+ type PushBranchMigrationsVariables = {
3454
+ body: PushBranchMigrationsRequestBody;
3455
+ pathParams: PushBranchMigrationsPathParams;
3456
+ } & DataPlaneFetcherExtraProps;
3457
+ /**
3458
+ * The `schema/push` API accepts a list of migrations to be applied to the
3459
+ * current branch. A list of applicable migrations can be fetched using
3460
+ * the `schema/history` API from another branch or database.
3461
+ *
3462
+ * The most recent migration must be part of the list or referenced (via
3463
+ * `parentID`) by the first migration in the list of migrations to be pushed.
3464
+ *
3465
+ * Each migration in the list has an `id`, `parentID`, and `checksum`. The
3466
+ * checksum for migrations are generated and verified by xata. The
3467
+ * operation fails if any migration in the list has an invalid checksum.
3468
+ */
3469
+ declare const pushBranchMigrations: (variables: PushBranchMigrationsVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3124
3470
  type CreateTablePathParams = {
3125
3471
  /**
3126
3472
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -3361,9 +3707,7 @@ type AddTableColumnVariables = {
3361
3707
  pathParams: AddTableColumnPathParams;
3362
3708
  } & DataPlaneFetcherExtraProps;
3363
3709
  /**
3364
- * Adds a new column to the table. The body of the request should contain the column definition. In the column definition, the 'name' field should
3365
- * contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
3366
- * passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
3710
+ * Adds a new column to the table. The body of the request should contain the column definition.
3367
3711
  */
3368
3712
  declare const addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3369
3713
  type GetColumnPathParams = {
@@ -3396,7 +3740,7 @@ type GetColumnVariables = {
3396
3740
  pathParams: GetColumnPathParams;
3397
3741
  } & DataPlaneFetcherExtraProps;
3398
3742
  /**
3399
- * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3743
+ * Get the definition of a single column.
3400
3744
  */
3401
3745
  declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
3402
3746
  type UpdateColumnPathParams = {
@@ -3436,7 +3780,7 @@ type UpdateColumnVariables = {
3436
3780
  pathParams: UpdateColumnPathParams;
3437
3781
  } & DataPlaneFetcherExtraProps;
3438
3782
  /**
3439
- * Update column with partial data. Can be used for renaming the column by providing a new "name" field. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3783
+ * Update column with partial data. Can be used for renaming the column by providing a new "name" field.
3440
3784
  */
3441
3785
  declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3442
3786
  type DeleteColumnPathParams = {
@@ -3469,7 +3813,7 @@ type DeleteColumnVariables = {
3469
3813
  pathParams: DeleteColumnPathParams;
3470
3814
  } & DataPlaneFetcherExtraProps;
3471
3815
  /**
3472
- * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3816
+ * Deletes the specified column.
3473
3817
  */
3474
3818
  declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3475
3819
  type BranchTransactionPathParams = {
@@ -3489,6 +3833,9 @@ type BranchTransactionError = ErrorWrapper<{
3489
3833
  } | {
3490
3834
  status: 404;
3491
3835
  payload: SimpleError;
3836
+ } | {
3837
+ status: 429;
3838
+ payload: RateLimitError;
3492
3839
  }>;
3493
3840
  type BranchTransactionRequestBody = {
3494
3841
  operations: TransactionOperation$1[];
@@ -3527,7 +3874,7 @@ type InsertRecordError = ErrorWrapper<{
3527
3874
  payload: SimpleError;
3528
3875
  }>;
3529
3876
  type InsertRecordVariables = {
3530
- body?: Record<string, any>;
3877
+ body?: DataInputRecord;
3531
3878
  pathParams: InsertRecordPathParams;
3532
3879
  queryParams?: InsertRecordQueryParams;
3533
3880
  } & DataPlaneFetcherExtraProps;
@@ -3535,7 +3882,7 @@ type InsertRecordVariables = {
3535
3882
  * Insert a new Record into the Table
3536
3883
  */
3537
3884
  declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
3538
- type GetRecordPathParams = {
3885
+ type GetFileItemPathParams = {
3539
3886
  /**
3540
3887
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3541
3888
  */
@@ -3548,16 +3895,18 @@ type GetRecordPathParams = {
3548
3895
  * The Record name
3549
3896
  */
3550
3897
  recordId: RecordID;
3551
- workspace: string;
3552
- region: string;
3553
- };
3554
- type GetRecordQueryParams = {
3555
3898
  /**
3556
- * Column filters
3899
+ * The Column name
3557
3900
  */
3558
- columns?: ColumnsProjection;
3901
+ columnName: ColumnName;
3902
+ /**
3903
+ * The File Identifier
3904
+ */
3905
+ fileId: FileItemID;
3906
+ workspace: string;
3907
+ region: string;
3559
3908
  };
3560
- type GetRecordError = ErrorWrapper<{
3909
+ type GetFileItemError = ErrorWrapper<{
3561
3910
  status: 400;
3562
3911
  payload: BadRequestError;
3563
3912
  } | {
@@ -3567,15 +3916,255 @@ type GetRecordError = ErrorWrapper<{
3567
3916
  status: 404;
3568
3917
  payload: SimpleError;
3569
3918
  }>;
3570
- type GetRecordVariables = {
3571
- pathParams: GetRecordPathParams;
3572
- queryParams?: GetRecordQueryParams;
3919
+ type GetFileItemVariables = {
3920
+ pathParams: GetFileItemPathParams;
3573
3921
  } & DataPlaneFetcherExtraProps;
3574
3922
  /**
3575
- * Retrieve record by ID
3923
+ * Retrieves file content from an array by file ID
3576
3924
  */
3577
- declare const getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
3578
- type InsertRecordWithIDPathParams = {
3925
+ declare const getFileItem: (variables: GetFileItemVariables, signal?: AbortSignal) => Promise<Blob>;
3926
+ type PutFileItemPathParams = {
3927
+ /**
3928
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3929
+ */
3930
+ dbBranchName: DBBranchName;
3931
+ /**
3932
+ * The Table name
3933
+ */
3934
+ tableName: TableName;
3935
+ /**
3936
+ * The Record name
3937
+ */
3938
+ recordId: RecordID;
3939
+ /**
3940
+ * The Column name
3941
+ */
3942
+ columnName: ColumnName;
3943
+ /**
3944
+ * The File Identifier
3945
+ */
3946
+ fileId: FileItemID;
3947
+ workspace: string;
3948
+ region: string;
3949
+ };
3950
+ type PutFileItemError = ErrorWrapper<{
3951
+ status: 400;
3952
+ payload: BadRequestError;
3953
+ } | {
3954
+ status: 401;
3955
+ payload: AuthError;
3956
+ } | {
3957
+ status: 404;
3958
+ payload: SimpleError;
3959
+ } | {
3960
+ status: 422;
3961
+ payload: SimpleError;
3962
+ }>;
3963
+ type PutFileItemVariables = {
3964
+ body?: Blob;
3965
+ pathParams: PutFileItemPathParams;
3966
+ } & DataPlaneFetcherExtraProps;
3967
+ /**
3968
+ * Uploads the file content to an array given the file ID
3969
+ */
3970
+ declare const putFileItem: (variables: PutFileItemVariables, signal?: AbortSignal) => Promise<FileResponse>;
3971
+ type DeleteFileItemPathParams = {
3972
+ /**
3973
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3974
+ */
3975
+ dbBranchName: DBBranchName;
3976
+ /**
3977
+ * The Table name
3978
+ */
3979
+ tableName: TableName;
3980
+ /**
3981
+ * The Record name
3982
+ */
3983
+ recordId: RecordID;
3984
+ /**
3985
+ * The Column name
3986
+ */
3987
+ columnName: ColumnName;
3988
+ /**
3989
+ * The File Identifier
3990
+ */
3991
+ fileId: FileItemID;
3992
+ workspace: string;
3993
+ region: string;
3994
+ };
3995
+ type DeleteFileItemError = ErrorWrapper<{
3996
+ status: 400;
3997
+ payload: BadRequestError;
3998
+ } | {
3999
+ status: 401;
4000
+ payload: AuthError;
4001
+ } | {
4002
+ status: 404;
4003
+ payload: SimpleError;
4004
+ }>;
4005
+ type DeleteFileItemVariables = {
4006
+ pathParams: DeleteFileItemPathParams;
4007
+ } & DataPlaneFetcherExtraProps;
4008
+ /**
4009
+ * Deletes an item from an file array column given the file ID
4010
+ */
4011
+ declare const deleteFileItem: (variables: DeleteFileItemVariables, signal?: AbortSignal) => Promise<FileResponse>;
4012
+ type GetFilePathParams = {
4013
+ /**
4014
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4015
+ */
4016
+ dbBranchName: DBBranchName;
4017
+ /**
4018
+ * The Table name
4019
+ */
4020
+ tableName: TableName;
4021
+ /**
4022
+ * The Record name
4023
+ */
4024
+ recordId: RecordID;
4025
+ /**
4026
+ * The Column name
4027
+ */
4028
+ columnName: ColumnName;
4029
+ workspace: string;
4030
+ region: string;
4031
+ };
4032
+ type GetFileError = ErrorWrapper<{
4033
+ status: 400;
4034
+ payload: BadRequestError;
4035
+ } | {
4036
+ status: 401;
4037
+ payload: AuthError;
4038
+ } | {
4039
+ status: 404;
4040
+ payload: SimpleError;
4041
+ }>;
4042
+ type GetFileVariables = {
4043
+ pathParams: GetFilePathParams;
4044
+ } & DataPlaneFetcherExtraProps;
4045
+ /**
4046
+ * Retrieves the file content from a file column
4047
+ */
4048
+ declare const getFile: (variables: GetFileVariables, signal?: AbortSignal) => Promise<Blob>;
4049
+ type PutFilePathParams = {
4050
+ /**
4051
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4052
+ */
4053
+ dbBranchName: DBBranchName;
4054
+ /**
4055
+ * The Table name
4056
+ */
4057
+ tableName: TableName;
4058
+ /**
4059
+ * The Record name
4060
+ */
4061
+ recordId: RecordID;
4062
+ /**
4063
+ * The Column name
4064
+ */
4065
+ columnName: ColumnName;
4066
+ workspace: string;
4067
+ region: string;
4068
+ };
4069
+ type PutFileError = ErrorWrapper<{
4070
+ status: 400;
4071
+ payload: BadRequestError;
4072
+ } | {
4073
+ status: 401;
4074
+ payload: AuthError;
4075
+ } | {
4076
+ status: 404;
4077
+ payload: SimpleError;
4078
+ } | {
4079
+ status: 422;
4080
+ payload: SimpleError;
4081
+ }>;
4082
+ type PutFileVariables = {
4083
+ body?: Blob;
4084
+ pathParams: PutFilePathParams;
4085
+ } & DataPlaneFetcherExtraProps;
4086
+ /**
4087
+ * Uploads the file content to the given file column
4088
+ */
4089
+ declare const putFile: (variables: PutFileVariables, signal?: AbortSignal) => Promise<FileResponse>;
4090
+ type DeleteFilePathParams = {
4091
+ /**
4092
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4093
+ */
4094
+ dbBranchName: DBBranchName;
4095
+ /**
4096
+ * The Table name
4097
+ */
4098
+ tableName: TableName;
4099
+ /**
4100
+ * The Record name
4101
+ */
4102
+ recordId: RecordID;
4103
+ /**
4104
+ * The Column name
4105
+ */
4106
+ columnName: ColumnName;
4107
+ workspace: string;
4108
+ region: string;
4109
+ };
4110
+ type DeleteFileError = ErrorWrapper<{
4111
+ status: 400;
4112
+ payload: BadRequestError;
4113
+ } | {
4114
+ status: 401;
4115
+ payload: AuthError;
4116
+ } | {
4117
+ status: 404;
4118
+ payload: SimpleError;
4119
+ }>;
4120
+ type DeleteFileVariables = {
4121
+ pathParams: DeleteFilePathParams;
4122
+ } & DataPlaneFetcherExtraProps;
4123
+ /**
4124
+ * Deletes a file referred in a file column
4125
+ */
4126
+ declare const deleteFile: (variables: DeleteFileVariables, signal?: AbortSignal) => Promise<FileResponse>;
4127
+ type GetRecordPathParams = {
4128
+ /**
4129
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4130
+ */
4131
+ dbBranchName: DBBranchName;
4132
+ /**
4133
+ * The Table name
4134
+ */
4135
+ tableName: TableName;
4136
+ /**
4137
+ * The Record name
4138
+ */
4139
+ recordId: RecordID;
4140
+ workspace: string;
4141
+ region: string;
4142
+ };
4143
+ type GetRecordQueryParams = {
4144
+ /**
4145
+ * Column filters
4146
+ */
4147
+ columns?: ColumnsProjection;
4148
+ };
4149
+ type GetRecordError = ErrorWrapper<{
4150
+ status: 400;
4151
+ payload: BadRequestError;
4152
+ } | {
4153
+ status: 401;
4154
+ payload: AuthError;
4155
+ } | {
4156
+ status: 404;
4157
+ payload: SimpleError;
4158
+ }>;
4159
+ type GetRecordVariables = {
4160
+ pathParams: GetRecordPathParams;
4161
+ queryParams?: GetRecordQueryParams;
4162
+ } & DataPlaneFetcherExtraProps;
4163
+ /**
4164
+ * Retrieve record by ID
4165
+ */
4166
+ declare const getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
4167
+ type InsertRecordWithIDPathParams = {
3579
4168
  /**
3580
4169
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3581
4170
  */
@@ -3613,7 +4202,7 @@ type InsertRecordWithIDError = ErrorWrapper<{
3613
4202
  payload: SimpleError;
3614
4203
  }>;
3615
4204
  type InsertRecordWithIDVariables = {
3616
- body?: Record<string, any>;
4205
+ body?: DataInputRecord;
3617
4206
  pathParams: InsertRecordWithIDPathParams;
3618
4207
  queryParams?: InsertRecordWithIDQueryParams;
3619
4208
  } & DataPlaneFetcherExtraProps;
@@ -3658,7 +4247,7 @@ type UpdateRecordWithIDError = ErrorWrapper<{
3658
4247
  payload: SimpleError;
3659
4248
  }>;
3660
4249
  type UpdateRecordWithIDVariables = {
3661
- body?: Record<string, any>;
4250
+ body?: DataInputRecord;
3662
4251
  pathParams: UpdateRecordWithIDPathParams;
3663
4252
  queryParams?: UpdateRecordWithIDQueryParams;
3664
4253
  } & DataPlaneFetcherExtraProps;
@@ -3700,7 +4289,7 @@ type UpsertRecordWithIDError = ErrorWrapper<{
3700
4289
  payload: SimpleError;
3701
4290
  }>;
3702
4291
  type UpsertRecordWithIDVariables = {
3703
- body?: Record<string, any>;
4292
+ body?: DataInputRecord;
3704
4293
  pathParams: UpsertRecordWithIDPathParams;
3705
4294
  queryParams?: UpsertRecordWithIDQueryParams;
3706
4295
  } & DataPlaneFetcherExtraProps;
@@ -3774,7 +4363,7 @@ type BulkInsertTableRecordsError = ErrorWrapper<{
3774
4363
  payload: SimpleError;
3775
4364
  }>;
3776
4365
  type BulkInsertTableRecordsRequestBody = {
3777
- records: Record<string, any>[];
4366
+ records: DataInputRecord[];
3778
4367
  };
3779
4368
  type BulkInsertTableRecordsVariables = {
3780
4369
  body: BulkInsertTableRecordsRequestBody;
@@ -3806,12 +4395,15 @@ type QueryTableError = ErrorWrapper<{
3806
4395
  } | {
3807
4396
  status: 404;
3808
4397
  payload: SimpleError;
4398
+ } | {
4399
+ status: 503;
4400
+ payload: ServiceUnavailableError;
3809
4401
  }>;
3810
4402
  type QueryTableRequestBody = {
3811
4403
  filter?: FilterExpression;
3812
4404
  sort?: SortExpression;
3813
4405
  page?: PageConfig;
3814
- columns?: ColumnsProjection;
4406
+ columns?: QueryColumnsProjection;
3815
4407
  /**
3816
4408
  * The consistency level for this request.
3817
4409
  *
@@ -4475,25 +5067,40 @@ type QueryTableVariables = {
4475
5067
  * }
4476
5068
  * ```
4477
5069
  *
4478
- * ### Pagination
5070
+ * It is also possible to sort results randomly:
4479
5071
  *
4480
- * We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
4481
- * cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
5072
+ * ```json
5073
+ * POST /db/demo:main/tables/table/query
5074
+ * {
5075
+ * "sort": {
5076
+ * "*": "random"
5077
+ * }
5078
+ * }
5079
+ * ```
5080
+ *
5081
+ * Note that a random sort does not apply to a specific column, hence the special column name `"*"`.
4482
5082
  *
4483
- * Example of size + offset pagination:
5083
+ * A random sort can be combined with an ascending or descending sort on a specific column:
4484
5084
  *
4485
5085
  * ```json
4486
5086
  * POST /db/demo:main/tables/table/query
4487
5087
  * {
4488
- * "page": {
4489
- * "size": 100,
4490
- * "offset": 200
4491
- * }
5088
+ * "sort": [
5089
+ * {
5090
+ * "name": "desc"
5091
+ * },
5092
+ * {
5093
+ * "*": "random"
5094
+ * }
5095
+ * ]
4492
5096
  * }
4493
5097
  * ```
4494
5098
  *
4495
- * The `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.
4496
- * The `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.
5099
+ * This will sort on the `name` column, breaking ties randomly.
5100
+ *
5101
+ * ### Pagination
5102
+ *
5103
+ * We offer cursor pagination and offset pagination. The cursor pagination method can be used for sequential scrolling with unrestricted depth. The offset pagination can be used to skip pages and is limited to 1000 records.
4497
5104
  *
4498
5105
  * Example of cursor pagination:
4499
5106
  *
@@ -4547,6 +5154,34 @@ type QueryTableVariables = {
4547
5154
  * `filter` or `sort` is set. The columns returned and page size can be changed
4548
5155
  * anytime by passing the `columns` or `page.size` settings to the next query.
4549
5156
  *
5157
+ * In the following example of size + offset pagination we retrieve the third page of up to 100 results:
5158
+ *
5159
+ * ```json
5160
+ * POST /db/demo:main/tables/table/query
5161
+ * {
5162
+ * "page": {
5163
+ * "size": 100,
5164
+ * "offset": 200
5165
+ * }
5166
+ * }
5167
+ * ```
5168
+ *
5169
+ * The `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.
5170
+ * The `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.
5171
+ *
5172
+ * Cursor pagination also works in combination with offset pagination. For example, starting from a specific cursor position, using a page size of 200 and an offset of 800, you can skip up to 5 pages of 200 records forwards or backwards from the cursor's position:
5173
+ *
5174
+ * ```json
5175
+ * POST /db/demo:main/tables/table/query
5176
+ * {
5177
+ * "page": {
5178
+ * "size": 200,
5179
+ * "offset": 800,
5180
+ * "after": "fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD"
5181
+ * }
5182
+ * }
5183
+ * ```
5184
+ *
4550
5185
  * **Special cursors:**
4551
5186
  *
4552
5187
  * - `page.after=end`: Result points past the last entry. The list of records
@@ -4597,6 +5232,9 @@ type SearchBranchError = ErrorWrapper<{
4597
5232
  } | {
4598
5233
  status: 404;
4599
5234
  payload: SimpleError;
5235
+ } | {
5236
+ status: 503;
5237
+ payload: ServiceUnavailableError;
4600
5238
  }>;
4601
5239
  type SearchBranchRequestBody = {
4602
5240
  /**
@@ -4642,7 +5280,163 @@ type SearchTablePathParams = {
4642
5280
  workspace: string;
4643
5281
  region: string;
4644
5282
  };
4645
- type SearchTableError = ErrorWrapper<{
5283
+ type SearchTableError = ErrorWrapper<{
5284
+ status: 400;
5285
+ payload: BadRequestError;
5286
+ } | {
5287
+ status: 401;
5288
+ payload: AuthError;
5289
+ } | {
5290
+ status: 404;
5291
+ payload: SimpleError;
5292
+ }>;
5293
+ type SearchTableRequestBody = {
5294
+ /**
5295
+ * The query string.
5296
+ *
5297
+ * @minLength 1
5298
+ */
5299
+ query: string;
5300
+ fuzziness?: FuzzinessExpression;
5301
+ target?: TargetExpression;
5302
+ prefix?: PrefixExpression;
5303
+ filter?: FilterExpression;
5304
+ highlight?: HighlightExpression;
5305
+ boosters?: BoosterExpression[];
5306
+ page?: SearchPageConfig;
5307
+ };
5308
+ type SearchTableVariables = {
5309
+ body: SearchTableRequestBody;
5310
+ pathParams: SearchTablePathParams;
5311
+ } & DataPlaneFetcherExtraProps;
5312
+ /**
5313
+ * Run a free text search operation in a particular table.
5314
+ *
5315
+ * The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
5316
+ * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
5317
+ * * filtering on columns of type `multiple` is currently unsupported
5318
+ */
5319
+ declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
5320
+ type SqlQueryPathParams = {
5321
+ /**
5322
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
5323
+ */
5324
+ dbBranchName: DBBranchName;
5325
+ workspace: string;
5326
+ region: string;
5327
+ };
5328
+ type SqlQueryError = ErrorWrapper<{
5329
+ status: 400;
5330
+ payload: BadRequestError;
5331
+ } | {
5332
+ status: 401;
5333
+ payload: AuthError;
5334
+ } | {
5335
+ status: 404;
5336
+ payload: SimpleError;
5337
+ } | {
5338
+ status: 503;
5339
+ payload: ServiceUnavailableError;
5340
+ }>;
5341
+ type SqlQueryRequestBody = {
5342
+ /**
5343
+ * The query string.
5344
+ *
5345
+ * @minLength 1
5346
+ */
5347
+ query: string;
5348
+ /**
5349
+ * The query parameter list.
5350
+ */
5351
+ params?: any[] | null;
5352
+ /**
5353
+ * The consistency level for this request.
5354
+ *
5355
+ * @default strong
5356
+ */
5357
+ consistency?: 'strong' | 'eventual';
5358
+ };
5359
+ type SqlQueryVariables = {
5360
+ body: SqlQueryRequestBody;
5361
+ pathParams: SqlQueryPathParams;
5362
+ } & DataPlaneFetcherExtraProps;
5363
+ /**
5364
+ * Run an SQL query across the database branch.
5365
+ */
5366
+ declare const sqlQuery: (variables: SqlQueryVariables, signal?: AbortSignal) => Promise<SQLResponse>;
5367
+ type VectorSearchTablePathParams = {
5368
+ /**
5369
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
5370
+ */
5371
+ dbBranchName: DBBranchName;
5372
+ /**
5373
+ * The Table name
5374
+ */
5375
+ tableName: TableName;
5376
+ workspace: string;
5377
+ region: string;
5378
+ };
5379
+ type VectorSearchTableError = ErrorWrapper<{
5380
+ status: 400;
5381
+ payload: BadRequestError;
5382
+ } | {
5383
+ status: 401;
5384
+ payload: AuthError;
5385
+ } | {
5386
+ status: 404;
5387
+ payload: SimpleError;
5388
+ }>;
5389
+ type VectorSearchTableRequestBody = {
5390
+ /**
5391
+ * The vector to search for similarities. Must have the same dimension as
5392
+ * the vector column used.
5393
+ */
5394
+ queryVector: number[];
5395
+ /**
5396
+ * The vector column in which to search. It must be of type `vector`.
5397
+ */
5398
+ column: string;
5399
+ /**
5400
+ * The function used to measure the distance between two points. Can be one of:
5401
+ * `cosineSimilarity`, `l1`, `l2`. The default is `cosineSimilarity`.
5402
+ *
5403
+ * @default cosineSimilarity
5404
+ */
5405
+ similarityFunction?: string;
5406
+ /**
5407
+ * Number of results to return.
5408
+ *
5409
+ * @default 10
5410
+ * @maximum 100
5411
+ * @minimum 1
5412
+ */
5413
+ size?: number;
5414
+ filter?: FilterExpression;
5415
+ };
5416
+ type VectorSearchTableVariables = {
5417
+ body: VectorSearchTableRequestBody;
5418
+ pathParams: VectorSearchTablePathParams;
5419
+ } & DataPlaneFetcherExtraProps;
5420
+ /**
5421
+ * This endpoint can be used to perform vector-based similarity searches in a table.
5422
+ * It can be used for implementing semantic search and product recommendation. To use this
5423
+ * endpoint, you need a column of type vector. The input vector must have the same
5424
+ * dimension as the vector column.
5425
+ */
5426
+ declare const vectorSearchTable: (variables: VectorSearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
5427
+ type AskTablePathParams = {
5428
+ /**
5429
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
5430
+ */
5431
+ dbBranchName: DBBranchName;
5432
+ /**
5433
+ * The Table name
5434
+ */
5435
+ tableName: TableName;
5436
+ workspace: string;
5437
+ region: string;
5438
+ };
5439
+ type AskTableError = ErrorWrapper<{
4646
5440
  status: 400;
4647
5441
  payload: BadRequestError;
4648
5442
  } | {
@@ -4651,35 +5445,74 @@ type SearchTableError = ErrorWrapper<{
4651
5445
  } | {
4652
5446
  status: 404;
4653
5447
  payload: SimpleError;
5448
+ } | {
5449
+ status: 429;
5450
+ payload: RateLimitError;
4654
5451
  }>;
4655
- type SearchTableRequestBody = {
5452
+ type AskTableResponse = {
4656
5453
  /**
4657
- * The query string.
5454
+ * The answer to the input question
5455
+ */
5456
+ answer: string;
5457
+ /**
5458
+ * The session ID for the chat session. Only returned if the `session_type` is `chat`.
5459
+ */
5460
+ sessionID?: string;
5461
+ };
5462
+ type AskTableRequestBody = {
5463
+ /**
5464
+ * The question you'd like to ask.
4658
5465
  *
4659
- * @minLength 1
5466
+ * @minLength 3
5467
+ */
5468
+ question?: string;
5469
+ /**
5470
+ * The type of search to use. If set to `keyword` (the default), the search can be configured by passing
5471
+ * a `search` object with the following fields. For more details about each, see the Search endpoint documentation.
5472
+ * All fields are optional.
5473
+ * * fuzziness - typo tolerance
5474
+ * * target - columns to search into, and weights.
5475
+ * * prefix - prefix search type.
5476
+ * * filter - pre-filter before searching.
5477
+ * * boosters - control relevancy.
5478
+ * If set to `vector`, a `vectorSearch` object must be passed, with the following parameters. For more details, see the Vector
5479
+ * Search endpoint documentation. The `column` and `contentColumn` parameters are required.
5480
+ * * column - the vector column containing the embeddings.
5481
+ * * contentColumn - the column that contains the text from which the embeddings where computed.
5482
+ * * filter - pre-filter before searching.
5483
+ *
5484
+ * @default keyword
4660
5485
  */
4661
- query: string;
4662
- fuzziness?: FuzzinessExpression;
4663
- target?: TargetExpression;
4664
- prefix?: PrefixExpression;
4665
- filter?: FilterExpression;
4666
- highlight?: HighlightExpression;
4667
- boosters?: BoosterExpression[];
4668
- page?: SearchPageConfig;
5486
+ searchType?: 'keyword' | 'vector';
5487
+ search?: {
5488
+ fuzziness?: FuzzinessExpression;
5489
+ target?: TargetExpression;
5490
+ prefix?: PrefixExpression;
5491
+ filter?: FilterExpression;
5492
+ boosters?: BoosterExpression[];
5493
+ };
5494
+ vectorSearch?: {
5495
+ /**
5496
+ * The column to use for vector search. It must be of type `vector`.
5497
+ */
5498
+ column: string;
5499
+ /**
5500
+ * The column containing the text for vector search. Must be of type `text`.
5501
+ */
5502
+ contentColumn: string;
5503
+ filter?: FilterExpression;
5504
+ };
5505
+ rules?: string[];
4669
5506
  };
4670
- type SearchTableVariables = {
4671
- body: SearchTableRequestBody;
4672
- pathParams: SearchTablePathParams;
5507
+ type AskTableVariables = {
5508
+ body?: AskTableRequestBody;
5509
+ pathParams: AskTablePathParams;
4673
5510
  } & DataPlaneFetcherExtraProps;
4674
5511
  /**
4675
- * Run a free text search operation in a particular table.
4676
- *
4677
- * The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
4678
- * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
4679
- * * filtering on columns of type `multiple` is currently unsupported
5512
+ * Ask your table a question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.
4680
5513
  */
4681
- declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4682
- type VectorSearchTablePathParams = {
5514
+ declare const askTable: (variables: AskTableVariables, signal?: AbortSignal) => Promise<AskTableResponse>;
5515
+ type ChatSessionMessagePathParams = {
4683
5516
  /**
4684
5517
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4685
5518
  */
@@ -4688,10 +5521,15 @@ type VectorSearchTablePathParams = {
4688
5521
  * The Table name
4689
5522
  */
4690
5523
  tableName: TableName;
5524
+ /**
5525
+ * @maxLength 36
5526
+ * @minLength 36
5527
+ */
5528
+ sessionId: string;
4691
5529
  workspace: string;
4692
5530
  region: string;
4693
5531
  };
4694
- type VectorSearchTableError = ErrorWrapper<{
5532
+ type ChatSessionMessageError = ErrorWrapper<{
4695
5533
  status: 400;
4696
5534
  payload: BadRequestError;
4697
5535
  } | {
@@ -4700,45 +5538,35 @@ type VectorSearchTableError = ErrorWrapper<{
4700
5538
  } | {
4701
5539
  status: 404;
4702
5540
  payload: SimpleError;
5541
+ } | {
5542
+ status: 429;
5543
+ payload: RateLimitError;
5544
+ } | {
5545
+ status: 503;
5546
+ payload: ServiceUnavailableError;
4703
5547
  }>;
4704
- type VectorSearchTableRequestBody = {
4705
- /**
4706
- * The vector to search for similarities. Must have the same dimension as
4707
- * the vector column used.
4708
- */
4709
- queryVector: number[];
4710
- /**
4711
- * The vector column in which to search.
4712
- */
4713
- column: string;
5548
+ type ChatSessionMessageResponse = {
4714
5549
  /**
4715
- * The function used to measure the distance between two points. Can be one of:
4716
- * `cosineSimilarity`, `l1`, `l2`. The default is `cosineSimilarity`.
4717
- *
4718
- * @default cosineSimilarity
5550
+ * The answer to the input question
4719
5551
  */
4720
- similarityFunction?: string;
5552
+ answer?: string;
5553
+ };
5554
+ type ChatSessionMessageRequestBody = {
4721
5555
  /**
4722
- * Number of results to return.
5556
+ * The question you'd like to ask.
4723
5557
  *
4724
- * @default 10
4725
- * @maximum 100
4726
- * @minimum 1
5558
+ * @minLength 3
4727
5559
  */
4728
- size?: number;
4729
- filter?: FilterExpression;
5560
+ message?: string;
4730
5561
  };
4731
- type VectorSearchTableVariables = {
4732
- body: VectorSearchTableRequestBody;
4733
- pathParams: VectorSearchTablePathParams;
5562
+ type ChatSessionMessageVariables = {
5563
+ body?: ChatSessionMessageRequestBody;
5564
+ pathParams: ChatSessionMessagePathParams;
4734
5565
  } & DataPlaneFetcherExtraProps;
4735
5566
  /**
4736
- * This endpoint can be used to perform vector-based similarity searches in a table.
4737
- * It can be used for implementing semantic search and product recommendation. To use this
4738
- * endpoint, you need a column of type vector. The input vector must have the same
4739
- * dimension as the vector column.
5567
+ * Ask a follow-up question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.
4740
5568
  */
4741
- declare const vectorSearchTable: (variables: VectorSearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
5569
+ declare const chatSessionMessage: (variables: ChatSessionMessageVariables, signal?: AbortSignal) => Promise<ChatSessionMessageResponse>;
4742
5570
  type SummarizeTablePathParams = {
4743
5571
  /**
4744
5572
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -4885,7 +5713,7 @@ type AggregateTableVariables = {
4885
5713
  pathParams: AggregateTablePathParams;
4886
5714
  } & DataPlaneFetcherExtraProps;
4887
5715
  /**
4888
- * This endpoint allows you to run aggragations (analytics) on the data from one table.
5716
+ * This endpoint allows you to run aggregations (analytics) on the data from one table.
4889
5717
  * While the summary endpoint is served from a transactional store and the results are strongly
4890
5718
  * consistent, the aggregate endpoint is served from our columnar store and the results are
4891
5719
  * only eventually consistent. On the other hand, the aggregate endpoint uses a
@@ -4895,6 +5723,38 @@ type AggregateTableVariables = {
4895
5723
  * For usage, see the [API Guide](https://xata.io/docs/api-guide/aggregate).
4896
5724
  */
4897
5725
  declare const aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
5726
+ type FileAccessPathParams = {
5727
+ /**
5728
+ * The File Access Identifier
5729
+ */
5730
+ fileId: FileAccessID;
5731
+ workspace: string;
5732
+ region: string;
5733
+ };
5734
+ type FileAccessQueryParams = {
5735
+ /**
5736
+ * File access signature
5737
+ */
5738
+ verify?: FileSignature;
5739
+ };
5740
+ type FileAccessError = ErrorWrapper<{
5741
+ status: 400;
5742
+ payload: BadRequestError;
5743
+ } | {
5744
+ status: 401;
5745
+ payload: AuthError;
5746
+ } | {
5747
+ status: 404;
5748
+ payload: SimpleError;
5749
+ }>;
5750
+ type FileAccessVariables = {
5751
+ pathParams: FileAccessPathParams;
5752
+ queryParams?: FileAccessQueryParams;
5753
+ } & DataPlaneFetcherExtraProps;
5754
+ /**
5755
+ * Retrieve file content by access id
5756
+ */
5757
+ declare const fileAccess: (variables: FileAccessVariables, signal?: AbortSignal) => Promise<Blob>;
4898
5758
 
4899
5759
  declare const operationsByTag: {
4900
5760
  branch: {
@@ -4902,6 +5762,7 @@ declare const operationsByTag: {
4902
5762
  getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal | undefined) => Promise<DBBranch>;
4903
5763
  createBranch: (variables: CreateBranchVariables, signal?: AbortSignal | undefined) => Promise<CreateBranchResponse>;
4904
5764
  deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal | undefined) => Promise<DeleteBranchResponse>;
5765
+ copyBranch: (variables: CopyBranchVariables, signal?: AbortSignal | undefined) => Promise<BranchWithCopyID>;
4905
5766
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
4906
5767
  getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal | undefined) => Promise<BranchMetadata>;
4907
5768
  getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal | undefined) => Promise<GetBranchStatsResponse>;
@@ -4910,16 +5771,6 @@ declare const operationsByTag: {
4910
5771
  removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
4911
5772
  resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal | undefined) => Promise<ResolveBranchResponse>;
4912
5773
  };
4913
- records: {
4914
- branchTransaction: (variables: BranchTransactionVariables, signal?: AbortSignal | undefined) => Promise<TransactionSuccess>;
4915
- insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4916
- getRecord: (variables: GetRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
4917
- insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4918
- updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4919
- upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4920
- deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
4921
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal | undefined) => Promise<BulkInsertResponse>;
4922
- };
4923
5774
  migrations: {
4924
5775
  getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal | undefined) => Promise<GetBranchMigrationHistoryResponse>;
4925
5776
  getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal | undefined) => Promise<BranchMigrationPlan>;
@@ -4930,6 +5781,17 @@ declare const operationsByTag: {
4930
5781
  updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
4931
5782
  previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal | undefined) => Promise<PreviewBranchSchemaEditResponse>;
4932
5783
  applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
5784
+ pushBranchMigrations: (variables: PushBranchMigrationsVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
5785
+ };
5786
+ records: {
5787
+ branchTransaction: (variables: BranchTransactionVariables, signal?: AbortSignal | undefined) => Promise<TransactionSuccess>;
5788
+ insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5789
+ getRecord: (variables: GetRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
5790
+ insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5791
+ updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5792
+ upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5793
+ deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
5794
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal | undefined) => Promise<BulkInsertResponse>;
4933
5795
  };
4934
5796
  migrationRequests: {
4935
5797
  queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal | undefined) => Promise<QueryMigrationRequestsResponse>;
@@ -4939,7 +5801,7 @@ declare const operationsByTag: {
4939
5801
  listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal | undefined) => Promise<ListMigrationRequestsCommitsResponse>;
4940
5802
  compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal | undefined) => Promise<SchemaCompareResponse>;
4941
5803
  getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal | undefined) => Promise<GetMigrationRequestIsMergedResponse>;
4942
- mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal | undefined) => Promise<Commit>;
5804
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal | undefined) => Promise<BranchOp>;
4943
5805
  };
4944
5806
  table: {
4945
5807
  createTable: (variables: CreateTableVariables, signal?: AbortSignal | undefined) => Promise<CreateTableResponse>;
@@ -4953,11 +5815,23 @@ declare const operationsByTag: {
4953
5815
  updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
4954
5816
  deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
4955
5817
  };
5818
+ files: {
5819
+ getFileItem: (variables: GetFileItemVariables, signal?: AbortSignal | undefined) => Promise<Blob>;
5820
+ putFileItem: (variables: PutFileItemVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5821
+ deleteFileItem: (variables: DeleteFileItemVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5822
+ getFile: (variables: GetFileVariables, signal?: AbortSignal | undefined) => Promise<Blob>;
5823
+ putFile: (variables: PutFileVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5824
+ deleteFile: (variables: DeleteFileVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5825
+ fileAccess: (variables: FileAccessVariables, signal?: AbortSignal | undefined) => Promise<Blob>;
5826
+ };
4956
5827
  searchAndFilter: {
4957
5828
  queryTable: (variables: QueryTableVariables, signal?: AbortSignal | undefined) => Promise<QueryResponse>;
4958
5829
  searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal | undefined) => Promise<SearchResponse>;
4959
5830
  searchTable: (variables: SearchTableVariables, signal?: AbortSignal | undefined) => Promise<SearchResponse>;
5831
+ sqlQuery: (variables: SqlQueryVariables, signal?: AbortSignal | undefined) => Promise<SQLResponse>;
4960
5832
  vectorSearchTable: (variables: VectorSearchTableVariables, signal?: AbortSignal | undefined) => Promise<SearchResponse>;
5833
+ askTable: (variables: AskTableVariables, signal?: AbortSignal | undefined) => Promise<AskTableResponse>;
5834
+ chatSessionMessage: (variables: ChatSessionMessageVariables, signal?: AbortSignal | undefined) => Promise<ChatSessionMessageResponse>;
4961
5835
  summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal | undefined) => Promise<SummarizeResponse>;
4962
5836
  aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal | undefined) => Promise<AggResponse>;
4963
5837
  };
@@ -4994,6 +5868,7 @@ declare const operationsByTag: {
4994
5868
  deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal | undefined) => Promise<DeleteDatabaseResponse>;
4995
5869
  getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal | undefined) => Promise<DatabaseMetadata>;
4996
5870
  updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal | undefined) => Promise<DatabaseMetadata>;
5871
+ renameDatabase: (variables: RenameDatabaseVariables, signal?: AbortSignal | undefined) => Promise<DatabaseMetadata>;
4997
5872
  getDatabaseGithubSettings: (variables: GetDatabaseGithubSettingsVariables, signal?: AbortSignal | undefined) => Promise<DatabaseGithubSettings>;
4998
5873
  updateDatabaseGithubSettings: (variables: UpdateDatabaseGithubSettingsVariables, signal?: AbortSignal | undefined) => Promise<DatabaseGithubSettings>;
4999
5874
  deleteDatabaseGithubSettings: (variables: DeleteDatabaseGithubSettingsVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
@@ -5001,7 +5876,7 @@ declare const operationsByTag: {
5001
5876
  };
5002
5877
  };
5003
5878
 
5004
- type HostAliases = 'production' | 'staging';
5879
+ type HostAliases = 'production' | 'staging' | 'dev';
5005
5880
  type ProviderBuilder = {
5006
5881
  main: string;
5007
5882
  workspaces: string;
@@ -5011,6 +5886,7 @@ declare function getHostUrl(provider: HostProvider, type: keyof ProviderBuilder)
5011
5886
  declare function isHostProviderAlias(alias: HostProvider | string): alias is HostAliases;
5012
5887
  declare function isHostProviderBuilder(builder: HostProvider): builder is ProviderBuilder;
5013
5888
  declare function parseProviderString(provider?: string): HostProvider | null;
5889
+ declare function buildProviderString(provider: HostProvider): string;
5014
5890
  declare function parseWorkspacesUrlParts(url: string): {
5015
5891
  workspace: string;
5016
5892
  region: string;
@@ -5022,12 +5898,16 @@ type responses_BadRequestError = BadRequestError;
5022
5898
  type responses_BranchMigrationPlan = BranchMigrationPlan;
5023
5899
  type responses_BulkError = BulkError;
5024
5900
  type responses_BulkInsertResponse = BulkInsertResponse;
5901
+ type responses_PutFileResponse = PutFileResponse;
5025
5902
  type responses_QueryResponse = QueryResponse;
5903
+ type responses_RateLimitError = RateLimitError;
5026
5904
  type responses_RecordResponse = RecordResponse;
5027
5905
  type responses_RecordUpdateResponse = RecordUpdateResponse;
5906
+ type responses_SQLResponse = SQLResponse;
5028
5907
  type responses_SchemaCompareResponse = SchemaCompareResponse;
5029
5908
  type responses_SchemaUpdateResponse = SchemaUpdateResponse;
5030
5909
  type responses_SearchResponse = SearchResponse;
5910
+ type responses_ServiceUnavailableError = ServiceUnavailableError;
5031
5911
  type responses_SimpleError = SimpleError;
5032
5912
  type responses_SummarizeResponse = SummarizeResponse;
5033
5913
  declare namespace responses {
@@ -5038,12 +5918,16 @@ declare namespace responses {
5038
5918
  responses_BranchMigrationPlan as BranchMigrationPlan,
5039
5919
  responses_BulkError as BulkError,
5040
5920
  responses_BulkInsertResponse as BulkInsertResponse,
5921
+ responses_PutFileResponse as PutFileResponse,
5041
5922
  responses_QueryResponse as QueryResponse,
5923
+ responses_RateLimitError as RateLimitError,
5042
5924
  responses_RecordResponse as RecordResponse,
5043
5925
  responses_RecordUpdateResponse as RecordUpdateResponse,
5926
+ responses_SQLResponse as SQLResponse,
5044
5927
  responses_SchemaCompareResponse as SchemaCompareResponse,
5045
5928
  responses_SchemaUpdateResponse as SchemaUpdateResponse,
5046
5929
  responses_SearchResponse as SearchResponse,
5930
+ responses_ServiceUnavailableError as ServiceUnavailableError,
5047
5931
  responses_SimpleError as SimpleError,
5048
5932
  responses_SummarizeResponse as SummarizeResponse,
5049
5933
  };
@@ -5058,7 +5942,10 @@ type schemas_Branch = Branch;
5058
5942
  type schemas_BranchMetadata = BranchMetadata;
5059
5943
  type schemas_BranchMigration = BranchMigration;
5060
5944
  type schemas_BranchName = BranchName;
5945
+ type schemas_BranchOp = BranchOp;
5946
+ type schemas_BranchWithCopyID = BranchWithCopyID;
5061
5947
  type schemas_Column = Column;
5948
+ type schemas_ColumnFile = ColumnFile;
5062
5949
  type schemas_ColumnLink = ColumnLink;
5063
5950
  type schemas_ColumnMigration = ColumnMigration;
5064
5951
  type schemas_ColumnName = ColumnName;
@@ -5072,10 +5959,16 @@ type schemas_CountAgg = CountAgg;
5072
5959
  type schemas_DBBranch = DBBranch;
5073
5960
  type schemas_DBBranchName = DBBranchName;
5074
5961
  type schemas_DBName = DBName;
5962
+ type schemas_DataInputRecord = DataInputRecord;
5075
5963
  type schemas_DatabaseGithubSettings = DatabaseGithubSettings;
5076
5964
  type schemas_DatabaseMetadata = DatabaseMetadata;
5077
5965
  type schemas_DateHistogramAgg = DateHistogramAgg;
5078
5966
  type schemas_DateTime = DateTime;
5967
+ type schemas_FileAccessID = FileAccessID;
5968
+ type schemas_FileItemID = FileItemID;
5969
+ type schemas_FileName = FileName;
5970
+ type schemas_FileResponse = FileResponse;
5971
+ type schemas_FileSignature = FileSignature;
5079
5972
  type schemas_FilterColumn = FilterColumn;
5080
5973
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
5081
5974
  type schemas_FilterExpression = FilterExpression;
@@ -5087,6 +5980,9 @@ type schemas_FilterRangeValue = FilterRangeValue;
5087
5980
  type schemas_FilterValue = FilterValue;
5088
5981
  type schemas_FuzzinessExpression = FuzzinessExpression;
5089
5982
  type schemas_HighlightExpression = HighlightExpression;
5983
+ type schemas_InputFile = InputFile;
5984
+ type schemas_InputFileArray = InputFileArray;
5985
+ type schemas_InputFileEntry = InputFileEntry;
5090
5986
  type schemas_InviteID = InviteID;
5091
5987
  type schemas_InviteKey = InviteKey;
5092
5988
  type schemas_ListBranchesResponse = ListBranchesResponse;
@@ -5094,10 +5990,12 @@ type schemas_ListDatabasesResponse = ListDatabasesResponse;
5094
5990
  type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
5095
5991
  type schemas_ListRegionsResponse = ListRegionsResponse;
5096
5992
  type schemas_MaxAgg = MaxAgg;
5993
+ type schemas_MediaType = MediaType;
5097
5994
  type schemas_MetricsDatapoint = MetricsDatapoint;
5098
5995
  type schemas_MetricsLatency = MetricsLatency;
5099
5996
  type schemas_Migration = Migration;
5100
5997
  type schemas_MigrationColumnOp = MigrationColumnOp;
5998
+ type schemas_MigrationObject = MigrationObject;
5101
5999
  type schemas_MigrationOp = MigrationOp;
5102
6000
  type schemas_MigrationRequest = MigrationRequest;
5103
6001
  type schemas_MigrationRequestNumber = MigrationRequestNumber;
@@ -5105,14 +6003,18 @@ type schemas_MigrationStatus = MigrationStatus;
5105
6003
  type schemas_MigrationTableOp = MigrationTableOp;
5106
6004
  type schemas_MinAgg = MinAgg;
5107
6005
  type schemas_NumericHistogramAgg = NumericHistogramAgg;
6006
+ type schemas_ObjectValue = ObjectValue;
5108
6007
  type schemas_PageConfig = PageConfig;
5109
6008
  type schemas_PrefixExpression = PrefixExpression;
6009
+ type schemas_ProjectionConfig = ProjectionConfig;
6010
+ type schemas_QueryColumnsProjection = QueryColumnsProjection;
5110
6011
  type schemas_RecordID = RecordID;
5111
6012
  type schemas_RecordMeta = RecordMeta;
5112
6013
  type schemas_RecordsMetadata = RecordsMetadata;
5113
6014
  type schemas_Region = Region;
5114
6015
  type schemas_RevLink = RevLink;
5115
6016
  type schemas_Role = Role;
6017
+ type schemas_SQLRecord = SQLRecord;
5116
6018
  type schemas_Schema = Schema;
5117
6019
  type schemas_SchemaEditScript = SchemaEditScript;
5118
6020
  type schemas_SearchPageConfig = SearchPageConfig;
@@ -5134,9 +6036,11 @@ type schemas_TopValuesAgg = TopValuesAgg;
5134
6036
  type schemas_TransactionDeleteOp = TransactionDeleteOp;
5135
6037
  type schemas_TransactionError = TransactionError;
5136
6038
  type schemas_TransactionFailure = TransactionFailure;
6039
+ type schemas_TransactionGetOp = TransactionGetOp;
5137
6040
  type schemas_TransactionInsertOp = TransactionInsertOp;
5138
6041
  type schemas_TransactionResultColumns = TransactionResultColumns;
5139
6042
  type schemas_TransactionResultDelete = TransactionResultDelete;
6043
+ type schemas_TransactionResultGet = TransactionResultGet;
5140
6044
  type schemas_TransactionResultInsert = TransactionResultInsert;
5141
6045
  type schemas_TransactionResultUpdate = TransactionResultUpdate;
5142
6046
  type schemas_TransactionSuccess = TransactionSuccess;
@@ -5163,7 +6067,10 @@ declare namespace schemas {
5163
6067
  schemas_BranchMetadata as BranchMetadata,
5164
6068
  schemas_BranchMigration as BranchMigration,
5165
6069
  schemas_BranchName as BranchName,
6070
+ schemas_BranchOp as BranchOp,
6071
+ schemas_BranchWithCopyID as BranchWithCopyID,
5166
6072
  schemas_Column as Column,
6073
+ schemas_ColumnFile as ColumnFile,
5167
6074
  schemas_ColumnLink as ColumnLink,
5168
6075
  schemas_ColumnMigration as ColumnMigration,
5169
6076
  schemas_ColumnName as ColumnName,
@@ -5177,11 +6084,17 @@ declare namespace schemas {
5177
6084
  schemas_DBBranch as DBBranch,
5178
6085
  schemas_DBBranchName as DBBranchName,
5179
6086
  schemas_DBName as DBName,
6087
+ schemas_DataInputRecord as DataInputRecord,
5180
6088
  schemas_DatabaseGithubSettings as DatabaseGithubSettings,
5181
6089
  schemas_DatabaseMetadata as DatabaseMetadata,
5182
6090
  DateBooster$1 as DateBooster,
5183
6091
  schemas_DateHistogramAgg as DateHistogramAgg,
5184
6092
  schemas_DateTime as DateTime,
6093
+ schemas_FileAccessID as FileAccessID,
6094
+ schemas_FileItemID as FileItemID,
6095
+ schemas_FileName as FileName,
6096
+ schemas_FileResponse as FileResponse,
6097
+ schemas_FileSignature as FileSignature,
5185
6098
  schemas_FilterColumn as FilterColumn,
5186
6099
  schemas_FilterColumnIncludes as FilterColumnIncludes,
5187
6100
  schemas_FilterExpression as FilterExpression,
@@ -5193,6 +6106,9 @@ declare namespace schemas {
5193
6106
  schemas_FilterValue as FilterValue,
5194
6107
  schemas_FuzzinessExpression as FuzzinessExpression,
5195
6108
  schemas_HighlightExpression as HighlightExpression,
6109
+ schemas_InputFile as InputFile,
6110
+ schemas_InputFileArray as InputFileArray,
6111
+ schemas_InputFileEntry as InputFileEntry,
5196
6112
  schemas_InviteID as InviteID,
5197
6113
  schemas_InviteKey as InviteKey,
5198
6114
  schemas_ListBranchesResponse as ListBranchesResponse,
@@ -5200,10 +6116,12 @@ declare namespace schemas {
5200
6116
  schemas_ListGitBranchesResponse as ListGitBranchesResponse,
5201
6117
  schemas_ListRegionsResponse as ListRegionsResponse,
5202
6118
  schemas_MaxAgg as MaxAgg,
6119
+ schemas_MediaType as MediaType,
5203
6120
  schemas_MetricsDatapoint as MetricsDatapoint,
5204
6121
  schemas_MetricsLatency as MetricsLatency,
5205
6122
  schemas_Migration as Migration,
5206
6123
  schemas_MigrationColumnOp as MigrationColumnOp,
6124
+ schemas_MigrationObject as MigrationObject,
5207
6125
  schemas_MigrationOp as MigrationOp,
5208
6126
  schemas_MigrationRequest as MigrationRequest,
5209
6127
  schemas_MigrationRequestNumber as MigrationRequestNumber,
@@ -5212,14 +6130,18 @@ declare namespace schemas {
5212
6130
  schemas_MinAgg as MinAgg,
5213
6131
  NumericBooster$1 as NumericBooster,
5214
6132
  schemas_NumericHistogramAgg as NumericHistogramAgg,
6133
+ schemas_ObjectValue as ObjectValue,
5215
6134
  schemas_PageConfig as PageConfig,
5216
6135
  schemas_PrefixExpression as PrefixExpression,
6136
+ schemas_ProjectionConfig as ProjectionConfig,
6137
+ schemas_QueryColumnsProjection as QueryColumnsProjection,
5217
6138
  schemas_RecordID as RecordID,
5218
6139
  schemas_RecordMeta as RecordMeta,
5219
6140
  schemas_RecordsMetadata as RecordsMetadata,
5220
6141
  schemas_Region as Region,
5221
6142
  schemas_RevLink as RevLink,
5222
6143
  schemas_Role as Role,
6144
+ schemas_SQLRecord as SQLRecord,
5223
6145
  schemas_Schema as Schema,
5224
6146
  schemas_SchemaEditScript as SchemaEditScript,
5225
6147
  schemas_SearchPageConfig as SearchPageConfig,
@@ -5241,10 +6163,12 @@ declare namespace schemas {
5241
6163
  schemas_TransactionDeleteOp as TransactionDeleteOp,
5242
6164
  schemas_TransactionError as TransactionError,
5243
6165
  schemas_TransactionFailure as TransactionFailure,
6166
+ schemas_TransactionGetOp as TransactionGetOp,
5244
6167
  schemas_TransactionInsertOp as TransactionInsertOp,
5245
6168
  TransactionOperation$1 as TransactionOperation,
5246
6169
  schemas_TransactionResultColumns as TransactionResultColumns,
5247
6170
  schemas_TransactionResultDelete as TransactionResultDelete,
6171
+ schemas_TransactionResultGet as TransactionResultGet,
5248
6172
  schemas_TransactionResultInsert as TransactionResultInsert,
5249
6173
  schemas_TransactionResultUpdate as TransactionResultUpdate,
5250
6174
  schemas_TransactionSuccess as TransactionSuccess,
@@ -5286,6 +6210,7 @@ declare class XataApiClient {
5286
6210
  get migrationRequests(): MigrationRequestsApi;
5287
6211
  get tables(): TableApi;
5288
6212
  get records(): RecordsApi;
6213
+ get files(): FilesApi;
5289
6214
  get searchAndFilter(): SearchAndFilterApi;
5290
6215
  }
5291
6216
  declare class UserApi {
@@ -5392,6 +6317,14 @@ declare class BranchApi {
5392
6317
  database: DBName;
5393
6318
  branch: BranchName;
5394
6319
  }): Promise<DeleteBranchResponse>;
6320
+ copyBranch({ workspace, region, database, branch, destinationBranch, limit }: {
6321
+ workspace: WorkspaceID;
6322
+ region: string;
6323
+ database: DBName;
6324
+ branch: BranchName;
6325
+ destinationBranch: BranchName;
6326
+ limit?: number;
6327
+ }): Promise<BranchWithCopyID>;
5395
6328
  updateBranchMetadata({ workspace, region, database, branch, metadata }: {
5396
6329
  workspace: WorkspaceID;
5397
6330
  region: string;
@@ -5599,6 +6532,75 @@ declare class RecordsApi {
5599
6532
  operations: TransactionOperation$1[];
5600
6533
  }): Promise<TransactionSuccess>;
5601
6534
  }
6535
+ declare class FilesApi {
6536
+ private extraProps;
6537
+ constructor(extraProps: ApiExtraProps);
6538
+ getFileItem({ workspace, region, database, branch, table, record, column, fileId }: {
6539
+ workspace: WorkspaceID;
6540
+ region: string;
6541
+ database: DBName;
6542
+ branch: BranchName;
6543
+ table: TableName;
6544
+ record: RecordID;
6545
+ column: ColumnName;
6546
+ fileId: string;
6547
+ }): Promise<any>;
6548
+ putFileItem({ workspace, region, database, branch, table, record, column, fileId, file }: {
6549
+ workspace: WorkspaceID;
6550
+ region: string;
6551
+ database: DBName;
6552
+ branch: BranchName;
6553
+ table: TableName;
6554
+ record: RecordID;
6555
+ column: ColumnName;
6556
+ fileId: string;
6557
+ file: any;
6558
+ }): Promise<PutFileResponse>;
6559
+ deleteFileItem({ workspace, region, database, branch, table, record, column, fileId }: {
6560
+ workspace: WorkspaceID;
6561
+ region: string;
6562
+ database: DBName;
6563
+ branch: BranchName;
6564
+ table: TableName;
6565
+ record: RecordID;
6566
+ column: ColumnName;
6567
+ fileId: string;
6568
+ }): Promise<PutFileResponse>;
6569
+ getFile({ workspace, region, database, branch, table, record, column }: {
6570
+ workspace: WorkspaceID;
6571
+ region: string;
6572
+ database: DBName;
6573
+ branch: BranchName;
6574
+ table: TableName;
6575
+ record: RecordID;
6576
+ column: ColumnName;
6577
+ }): Promise<any>;
6578
+ putFile({ workspace, region, database, branch, table, record, column, file }: {
6579
+ workspace: WorkspaceID;
6580
+ region: string;
6581
+ database: DBName;
6582
+ branch: BranchName;
6583
+ table: TableName;
6584
+ record: RecordID;
6585
+ column: ColumnName;
6586
+ file: Blob;
6587
+ }): Promise<PutFileResponse>;
6588
+ deleteFile({ workspace, region, database, branch, table, record, column }: {
6589
+ workspace: WorkspaceID;
6590
+ region: string;
6591
+ database: DBName;
6592
+ branch: BranchName;
6593
+ table: TableName;
6594
+ record: RecordID;
6595
+ column: ColumnName;
6596
+ }): Promise<PutFileResponse>;
6597
+ fileAccess({ workspace, region, fileId, verify }: {
6598
+ workspace: WorkspaceID;
6599
+ region: string;
6600
+ fileId: string;
6601
+ verify?: FileSignature;
6602
+ }): Promise<any>;
6603
+ }
5602
6604
  declare class SearchAndFilterApi {
5603
6605
  private extraProps;
5604
6606
  constructor(extraProps: ApiExtraProps);
@@ -5644,6 +6646,35 @@ declare class SearchAndFilterApi {
5644
6646
  prefix?: PrefixExpression;
5645
6647
  highlight?: HighlightExpression;
5646
6648
  }): Promise<SearchResponse>;
6649
+ vectorSearchTable({ workspace, region, database, branch, table, queryVector, column, similarityFunction, size, filter }: {
6650
+ workspace: WorkspaceID;
6651
+ region: string;
6652
+ database: DBName;
6653
+ branch: BranchName;
6654
+ table: TableName;
6655
+ queryVector: number[];
6656
+ column: string;
6657
+ similarityFunction?: string;
6658
+ size?: number;
6659
+ filter?: FilterExpression;
6660
+ }): Promise<SearchResponse>;
6661
+ askTable({ workspace, region, database, branch, table, options }: {
6662
+ workspace: WorkspaceID;
6663
+ region: string;
6664
+ database: DBName;
6665
+ branch: BranchName;
6666
+ table: TableName;
6667
+ options: AskTableRequestBody;
6668
+ }): Promise<AskTableResponse>;
6669
+ chatSessionMessage({ workspace, region, database, branch, table, sessionId, message }: {
6670
+ workspace: WorkspaceID;
6671
+ region: string;
6672
+ database: DBName;
6673
+ branch: BranchName;
6674
+ table: TableName;
6675
+ sessionId: string;
6676
+ message: string;
6677
+ }): Promise<ChatSessionMessageResponse>;
5647
6678
  summarizeTable({ workspace, region, database, branch, table, filter, columns, summaries, sort, summariesFilter, page, consistency }: {
5648
6679
  workspace: WorkspaceID;
5649
6680
  region: string;
@@ -5729,7 +6760,7 @@ declare class MigrationRequestsApi {
5729
6760
  region: string;
5730
6761
  database: DBName;
5731
6762
  migrationRequest: MigrationRequestNumber;
5732
- }): Promise<Commit>;
6763
+ }): Promise<BranchOp>;
5733
6764
  }
5734
6765
  declare class MigrationsApi {
5735
6766
  private extraProps;
@@ -5808,6 +6839,13 @@ declare class MigrationsApi {
5808
6839
  branch: BranchName;
5809
6840
  edits: SchemaEditScript;
5810
6841
  }): Promise<SchemaUpdateResponse>;
6842
+ pushBranchMigrations({ workspace, region, database, branch, migrations }: {
6843
+ workspace: WorkspaceID;
6844
+ region: string;
6845
+ database: DBName;
6846
+ branch: BranchName;
6847
+ migrations: MigrationObject[];
6848
+ }): Promise<SchemaUpdateResponse>;
5811
6849
  }
5812
6850
  declare class DatabaseApi {
5813
6851
  private extraProps;
@@ -5833,6 +6871,11 @@ declare class DatabaseApi {
5833
6871
  database: DBName;
5834
6872
  metadata: DatabaseMetadata;
5835
6873
  }): Promise<DatabaseMetadata>;
6874
+ renameDatabase({ workspace, database, newName }: {
6875
+ workspace: WorkspaceID;
6876
+ database: DBName;
6877
+ newName: DBName;
6878
+ }): Promise<DatabaseMetadata>;
5836
6879
  getDatabaseGithubSettings({ workspace, database }: {
5837
6880
  workspace: WorkspaceID;
5838
6881
  database: DBName;
@@ -5852,7 +6895,7 @@ declare class DatabaseApi {
5852
6895
  }
5853
6896
 
5854
6897
  declare class XataApiPlugin implements XataPlugin {
5855
- build(options: XataPluginOptions): Promise<XataApiClient>;
6898
+ build(options: XataPluginOptions): XataApiClient;
5856
6899
  }
5857
6900
 
5858
6901
  type StringKeys<O> = Extract<keyof O, string>;
@@ -5888,7 +6931,7 @@ type Narrowable = string | number | bigint | boolean;
5888
6931
  type Try<A1, A2, Catch = never> = A1 extends A2 ? A1 : Catch;
5889
6932
  type Narrow<A> = Try<A, [], NarrowRaw<A>>;
5890
6933
 
5891
- type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
6934
+ type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | `xata.${'version' | 'createdAt' | 'updatedAt'}` | DataProps<O> | NestedColumns<O, RecursivePath>;
5892
6935
  type WildcardColumns<O> = Values<{
5893
6936
  [K in SelectableColumn<O>]: K extends `${string}*` ? K : never;
5894
6937
  }>;
@@ -5898,9 +6941,9 @@ type ColumnsByValue<O, Value> = Values<{
5898
6941
  type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
5899
6942
  [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
5900
6943
  }>>;
5901
- 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> ? {
6944
+ type ValueAtColumn<Object, Key> = Key extends '*' ? Values<Object> : Key extends 'id' ? string : Key extends 'xata.version' ? number : Key extends 'xata.createdAt' ? Date : Key extends 'xata.updatedAt' ? Date : Key extends keyof Object ? Object[Key] : Key extends `${infer K}.${infer V}` ? K extends keyof Object ? Values<NonNullable<Object[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
5902
6945
  V: ValueAtColumn<Item, V>;
5903
- } : never : O[K] : never> : never : never;
6946
+ } : never : Object[K] : never> : never : never;
5904
6947
  type MAX_RECURSION = 2;
5905
6948
  type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
5906
6949
  [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
@@ -5917,6 +6960,8 @@ type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${in
5917
6960
  } : unknown;
5918
6961
  type ForwardNullable<T, R> = T extends NonNullable<T> ? R : R | null;
5919
6962
 
6963
+ declare const RecordColumnTypes: readonly ["bool", "int", "float", "string", "text", "email", "multiple", "link", "object", "datetime", "vector", "file[]", "file"];
6964
+ type Identifier = string;
5920
6965
  /**
5921
6966
  * Represents an identifiable record from the database.
5922
6967
  */
@@ -5924,7 +6969,7 @@ interface Identifiable {
5924
6969
  /**
5925
6970
  * Unique id of this record.
5926
6971
  */
5927
- id: string;
6972
+ id: Identifier;
5928
6973
  }
5929
6974
  interface BaseData {
5930
6975
  [key: string]: any;
@@ -5933,8 +6978,13 @@ interface BaseData {
5933
6978
  * Represents a persisted record from the database.
5934
6979
  */
5935
6980
  interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
6981
+ /**
6982
+ * Metadata of this record.
6983
+ */
6984
+ xata: XataRecordMetadata;
5936
6985
  /**
5937
6986
  * Get metadata of this record.
6987
+ * @deprecated Use `xata` property instead.
5938
6988
  */
5939
6989
  getMetadata(): XataRecordMetadata;
5940
6990
  /**
@@ -6013,23 +7063,59 @@ type XataRecordMetadata = {
6013
7063
  * Number that is increased every time the record is updated.
6014
7064
  */
6015
7065
  version: number;
6016
- warnings?: string[];
7066
+ /**
7067
+ * Timestamp when the record was created.
7068
+ */
7069
+ createdAt: Date;
7070
+ /**
7071
+ * Timestamp when the record was last updated.
7072
+ */
7073
+ updatedAt: Date;
6017
7074
  };
6018
7075
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
6019
7076
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
7077
+ type NumericOperator = ExclusiveOr<{
7078
+ $increment?: number;
7079
+ }, ExclusiveOr<{
7080
+ $decrement?: number;
7081
+ }, ExclusiveOr<{
7082
+ $multiply?: number;
7083
+ }, {
7084
+ $divide?: number;
7085
+ }>>>;
6020
7086
  type EditableDataFields<T> = T extends XataRecord ? {
6021
- id: string;
6022
- } | string : NonNullable<T> extends XataRecord ? {
6023
- id: string;
6024
- } | string | null | undefined : T extends Date ? string | Date : NonNullable<T> extends Date ? string | Date | null | undefined : T;
7087
+ id: Identifier;
7088
+ } | Identifier : NonNullable<T> extends XataRecord ? {
7089
+ id: Identifier;
7090
+ } | Identifier | null | undefined : T extends Date ? string | Date : NonNullable<T> extends Date ? string | Date | null | undefined : T extends number ? number | NumericOperator : T;
6025
7091
  type EditableData<O extends XataRecord> = Identifiable & Partial<Omit<{
6026
7092
  [K in keyof O]: EditableDataFields<O[K]>;
6027
7093
  }, keyof XataRecord>>;
6028
7094
  type JSONDataFields<T> = T extends XataRecord ? string : NonNullable<T> extends XataRecord ? string | null | undefined : T extends Date ? string : NonNullable<T> extends Date ? string | null | undefined : T;
6029
- type JSONData<O> = Identifiable & Partial<Omit<{
7095
+ type JSONDataBase = Identifiable & {
7096
+ /**
7097
+ * Metadata about the record.
7098
+ */
7099
+ xata: {
7100
+ /**
7101
+ * Timestamp when the record was created.
7102
+ */
7103
+ createdAt: string;
7104
+ /**
7105
+ * Timestamp when the record was last updated.
7106
+ */
7107
+ updatedAt: string;
7108
+ /**
7109
+ * Number that is increased every time the record is updated.
7110
+ */
7111
+ version: number;
7112
+ };
7113
+ };
7114
+ type JSONData<O> = JSONDataBase & Partial<Omit<{
6030
7115
  [K in keyof O]: JSONDataFields<O[K]>;
6031
7116
  }, keyof XataRecord>>;
6032
7117
 
7118
+ type FilterColumns<T> = ColumnsByValue<T, any> | `xata.${keyof XataRecordMetadata}`;
6033
7119
  /**
6034
7120
  * PropertyMatchFilter
6035
7121
  * Example:
@@ -6049,7 +7135,7 @@ type JSONData<O> = Identifiable & Partial<Omit<{
6049
7135
  }
6050
7136
  */
6051
7137
  type PropertyAccessFilter<Record> = {
6052
- [key in ColumnsByValue<Record, any>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
7138
+ [key in FilterColumns<Record>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
6053
7139
  };
6054
7140
  type PropertyFilter<T> = T | {
6055
7141
  $is: T;
@@ -6111,7 +7197,7 @@ type AggregatorFilter<T> = {
6111
7197
  * Example: { filter: { $exists: "settings" } }
6112
7198
  */
6113
7199
  type ExistanceFilter<Record> = {
6114
- [key in '$exists' | '$notExists']?: ColumnsByValue<Record, any>;
7200
+ [key in '$exists' | '$notExists']?: FilterColumns<Record>;
6115
7201
  };
6116
7202
  type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
6117
7203
  /**
@@ -6128,6 +7214,12 @@ type DateBooster = {
6128
7214
  origin?: string;
6129
7215
  scale: string;
6130
7216
  decay: number;
7217
+ /**
7218
+ * The factor with which to multiply the added boost.
7219
+ *
7220
+ * @minimum 0
7221
+ */
7222
+ factor?: number;
6131
7223
  };
6132
7224
  type NumericBooster = {
6133
7225
  factor: number;
@@ -6244,7 +7336,7 @@ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends X
6244
7336
  #private;
6245
7337
  private db;
6246
7338
  constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Table[]);
6247
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
7339
+ build(pluginOptions: XataPluginOptions): SearchPluginResult<Schemas>;
6248
7340
  }
6249
7341
  type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
6250
7342
  getMetadata: () => XataRecordMetadata & SearchExtraProperties;
@@ -6434,13 +7526,55 @@ type ComplexAggregationResult = {
6434
7526
  }>;
6435
7527
  };
6436
7528
 
7529
+ type KeywordAskOptions<Record extends XataRecord> = {
7530
+ searchType: 'keyword';
7531
+ search?: {
7532
+ fuzziness?: FuzzinessExpression;
7533
+ target?: TargetColumn<Record>[];
7534
+ prefix?: PrefixExpression;
7535
+ filter?: Filter<Record>;
7536
+ boosters?: Boosters<Record>[];
7537
+ };
7538
+ };
7539
+ type VectorAskOptions<Record extends XataRecord> = {
7540
+ searchType: 'vector';
7541
+ vectorSearch?: {
7542
+ /**
7543
+ * The column to use for vector search. It must be of type `vector`.
7544
+ */
7545
+ column: string;
7546
+ /**
7547
+ * The column containing the text for vector search. Must be of type `text`.
7548
+ */
7549
+ contentColumn: string;
7550
+ filter?: Filter<Record>;
7551
+ };
7552
+ };
7553
+ type TypeAskOptions<Record extends XataRecord> = KeywordAskOptions<Record> | VectorAskOptions<Record>;
7554
+ type BaseAskOptions = {
7555
+ rules?: string[];
7556
+ };
7557
+ type AskOptions<Record extends XataRecord> = TypeAskOptions<Record> & BaseAskOptions;
7558
+ type AskResult = {
7559
+ answer?: string;
7560
+ records?: string[];
7561
+ };
7562
+
6437
7563
  type SortDirection = 'asc' | 'desc';
6438
- type SortFilterExtended<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = {
7564
+ type RandomFilter = {
7565
+ '*': 'random';
7566
+ };
7567
+ type RandomFilterExtended = {
7568
+ column: '*';
7569
+ direction: 'random';
7570
+ };
7571
+ type SortColumns<T extends XataRecord> = ColumnsByValue<T, any> | `xata.${keyof XataRecordMetadata}`;
7572
+ type SortFilterExtended<T extends XataRecord, Columns extends string = SortColumns<T>> = RandomFilterExtended | {
6439
7573
  column: Columns;
6440
7574
  direction?: SortDirection;
6441
7575
  };
6442
- type SortFilter<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = Columns | SortFilterExtended<T, Columns> | SortFilterBase<T, Columns>;
6443
- type SortFilterBase<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = Values<{
7576
+ type SortFilter<T extends XataRecord, Columns extends string = SortColumns<T>> = Columns | SortFilterExtended<T, Columns> | SortFilterBase<T, Columns> | RandomFilter;
7577
+ type SortFilterBase<T extends XataRecord, Columns extends string = SortColumns<T>> = Values<{
6444
7578
  [Key in Columns]: {
6445
7579
  [K in Key]: SortDirection;
6446
7580
  };
@@ -6571,7 +7705,9 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6571
7705
  * @param direction The direction. Either ascending or descending.
6572
7706
  * @returns A new Query object.
6573
7707
  */
6574
- sort<F extends ColumnsByValue<Record, any>>(column: F, direction?: SortDirection): Query<Record, Result>;
7708
+ sort<F extends ColumnsByValue<Record, any>>(column: F, direction: SortDirection): Query<Record, Result>;
7709
+ sort(column: '*', direction: 'random'): Query<Record, Result>;
7710
+ sort<F extends ColumnsByValue<Record, any>>(column: F): Query<Record, Result>;
6575
7711
  /**
6576
7712
  * Builds a new query specifying the set of columns to be returned in the query response.
6577
7713
  * @param columns Array of column names to be returned by the query.
@@ -6597,7 +7733,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6597
7733
  * @param options Pagination options
6598
7734
  * @returns A page of results
6599
7735
  */
6600
- getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
7736
+ getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, (typeof options)['columns']>>>;
6601
7737
  /**
6602
7738
  * Get results in an iterator
6603
7739
  *
@@ -6628,7 +7764,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6628
7764
  */
6629
7765
  getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
6630
7766
  batchSize?: number;
6631
- }>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
7767
+ }>(options: Options): AsyncGenerator<SelectedPick<Record, (typeof options)['columns']>[]>;
6632
7768
  /**
6633
7769
  * Performs the query in the database and returns a set of results.
6634
7770
  * @returns An array of records from the database.
@@ -6639,7 +7775,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6639
7775
  * @param options Additional options to be used when performing the query.
6640
7776
  * @returns An array of records from the database.
6641
7777
  */
6642
- getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
7778
+ getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, (typeof options)['columns']>>>;
6643
7779
  /**
6644
7780
  * Performs the query in the database and returns a set of results.
6645
7781
  * @param options Additional options to be used when performing the query.
@@ -6660,7 +7796,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6660
7796
  */
6661
7797
  getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
6662
7798
  batchSize?: number;
6663
- }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
7799
+ }>(options: Options): Promise<SelectedPick<Record, (typeof options)['columns']>[]>;
6664
7800
  /**
6665
7801
  * Performs the query in the database and returns all the results.
6666
7802
  * Warning: If there are a large number of results, this method can have performance implications.
@@ -6680,7 +7816,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6680
7816
  * @param options Additional options to be used when performing the query.
6681
7817
  * @returns The first record that matches the query, or null if no record matched the query.
6682
7818
  */
6683
- getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
7819
+ getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, (typeof options)['columns']> | null>;
6684
7820
  /**
6685
7821
  * Performs the query in the database and returns the first result.
6686
7822
  * @param options Additional options to be used when performing the query.
@@ -6699,7 +7835,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6699
7835
  * @returns The first record that matches the query, or null if no record matched the query.
6700
7836
  * @throws if there are no results.
6701
7837
  */
6702
- getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
7838
+ getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, (typeof options)['columns']>>;
6703
7839
  /**
6704
7840
  * Performs the query in the database and returns the first result.
6705
7841
  * @param options Additional options to be used when performing the query.
@@ -6748,6 +7884,7 @@ type PaginationQueryMeta = {
6748
7884
  page: {
6749
7885
  cursor: string;
6750
7886
  more: boolean;
7887
+ size: number;
6751
7888
  };
6752
7889
  };
6753
7890
  interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
@@ -6880,7 +8017,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6880
8017
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6881
8018
  * @returns The full persisted record.
6882
8019
  */
6883
- abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8020
+ abstract create<K extends SelectableColumn<Record>>(id: Identifier, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
6884
8021
  ifVersion?: number;
6885
8022
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6886
8023
  /**
@@ -6889,7 +8026,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6889
8026
  * @param object Object containing the column names with their values to be stored in the table.
6890
8027
  * @returns The full persisted record.
6891
8028
  */
6892
- abstract create(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8029
+ abstract create(id: Identifier, object: Omit<EditableData<Record>, 'id'>, options?: {
6893
8030
  ifVersion?: number;
6894
8031
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6895
8032
  /**
@@ -6911,26 +8048,26 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6911
8048
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6912
8049
  * @returns The persisted record for the given id or null if the record could not be found.
6913
8050
  */
6914
- abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
8051
+ abstract read<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
6915
8052
  /**
6916
8053
  * Queries a single record from the table given its unique id.
6917
8054
  * @param id The unique id.
6918
8055
  * @returns The persisted record for the given id or null if the record could not be found.
6919
8056
  */
6920
- abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
8057
+ abstract read(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
6921
8058
  /**
6922
8059
  * Queries multiple records from the table given their unique id.
6923
8060
  * @param ids The unique ids array.
6924
8061
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6925
8062
  * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
6926
8063
  */
6927
- abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8064
+ abstract read<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
6928
8065
  /**
6929
8066
  * Queries multiple records from the table given their unique id.
6930
8067
  * @param ids The unique ids array.
6931
8068
  * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
6932
8069
  */
6933
- abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8070
+ abstract read(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
6934
8071
  /**
6935
8072
  * Queries a single record from the table by the id in the object.
6936
8073
  * @param object Object containing the id of the record.
@@ -6964,14 +8101,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6964
8101
  * @returns The persisted record for the given id.
6965
8102
  * @throws If the record could not be found.
6966
8103
  */
6967
- abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8104
+ abstract readOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6968
8105
  /**
6969
8106
  * Queries a single record from the table given its unique id.
6970
8107
  * @param id The unique id.
6971
8108
  * @returns The persisted record for the given id.
6972
8109
  * @throws If the record could not be found.
6973
8110
  */
6974
- abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8111
+ abstract readOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6975
8112
  /**
6976
8113
  * Queries multiple records from the table given their unique id.
6977
8114
  * @param ids The unique ids array.
@@ -6979,14 +8116,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6979
8116
  * @returns The persisted records for the given ids in order.
6980
8117
  * @throws If one or more records could not be found.
6981
8118
  */
6982
- abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8119
+ abstract readOrThrow<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
6983
8120
  /**
6984
8121
  * Queries multiple records from the table given their unique id.
6985
8122
  * @param ids The unique ids array.
6986
8123
  * @returns The persisted records for the given ids in order.
6987
8124
  * @throws If one or more records could not be found.
6988
8125
  */
6989
- abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8126
+ abstract readOrThrow(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
6990
8127
  /**
6991
8128
  * Queries a single record from the table by the id in the object.
6992
8129
  * @param object Object containing the id of the record.
@@ -7041,7 +8178,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7041
8178
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7042
8179
  * @returns The full persisted record, null if the record could not be found.
7043
8180
  */
7044
- abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8181
+ abstract update<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
7045
8182
  ifVersion?: number;
7046
8183
  }): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7047
8184
  /**
@@ -7050,7 +8187,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7050
8187
  * @param object The column names and their values that have to be updated.
7051
8188
  * @returns The full persisted record, null if the record could not be found.
7052
8189
  */
7053
- abstract update(id: string, object: Partial<EditableData<Record>>, options?: {
8190
+ abstract update(id: Identifier, object: Partial<EditableData<Record>>, options?: {
7054
8191
  ifVersion?: number;
7055
8192
  }): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7056
8193
  /**
@@ -7093,7 +8230,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7093
8230
  * @returns The full persisted record.
7094
8231
  * @throws If the record could not be found.
7095
8232
  */
7096
- abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8233
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
7097
8234
  ifVersion?: number;
7098
8235
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7099
8236
  /**
@@ -7103,7 +8240,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7103
8240
  * @returns The full persisted record.
7104
8241
  * @throws If the record could not be found.
7105
8242
  */
7106
- abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>, options?: {
8243
+ abstract updateOrThrow(id: Identifier, object: Partial<EditableData<Record>>, options?: {
7107
8244
  ifVersion?: number;
7108
8245
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7109
8246
  /**
@@ -7128,7 +8265,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7128
8265
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7129
8266
  * @returns The full persisted record.
7130
8267
  */
7131
- abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8268
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[], options?: {
7132
8269
  ifVersion?: number;
7133
8270
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7134
8271
  /**
@@ -7137,7 +8274,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7137
8274
  * @param object Object containing the column names with their values to be persisted in the table.
7138
8275
  * @returns The full persisted record.
7139
8276
  */
7140
- abstract createOrUpdate(object: EditableData<Record> & Identifiable, options?: {
8277
+ abstract createOrUpdate(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, options?: {
7141
8278
  ifVersion?: number;
7142
8279
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7143
8280
  /**
@@ -7148,7 +8285,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7148
8285
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7149
8286
  * @returns The full persisted record.
7150
8287
  */
7151
- abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8288
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7152
8289
  ifVersion?: number;
7153
8290
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7154
8291
  /**
@@ -7158,7 +8295,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7158
8295
  * @param object The column names and the values to be persisted.
7159
8296
  * @returns The full persisted record.
7160
8297
  */
7161
- abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8298
+ abstract createOrUpdate(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, options?: {
7162
8299
  ifVersion?: number;
7163
8300
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7164
8301
  /**
@@ -7168,14 +8305,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7168
8305
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7169
8306
  * @returns Array of the persisted records.
7170
8307
  */
7171
- abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8308
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7172
8309
  /**
7173
8310
  * Creates or updates a single record. If a record exists with the given id,
7174
8311
  * it will be partially updated, otherwise a new record will be created.
7175
8312
  * @param objects Array of objects with the column names and the values to be stored in the table.
7176
8313
  * @returns Array of the persisted records.
7177
8314
  */
7178
- abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8315
+ abstract createOrUpdate(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7179
8316
  /**
7180
8317
  * Creates or replaces a single record. If a record exists with the given id,
7181
8318
  * it will be replaced, otherwise a new record will be created.
@@ -7183,7 +8320,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7183
8320
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7184
8321
  * @returns The full persisted record.
7185
8322
  */
7186
- abstract createOrReplace<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8323
+ abstract createOrReplace<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[], options?: {
7187
8324
  ifVersion?: number;
7188
8325
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7189
8326
  /**
@@ -7192,7 +8329,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7192
8329
  * @param object Object containing the column names with their values to be persisted in the table.
7193
8330
  * @returns The full persisted record.
7194
8331
  */
7195
- abstract createOrReplace(object: EditableData<Record> & Identifiable, options?: {
8332
+ abstract createOrReplace(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, options?: {
7196
8333
  ifVersion?: number;
7197
8334
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7198
8335
  /**
@@ -7203,7 +8340,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7203
8340
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7204
8341
  * @returns The full persisted record.
7205
8342
  */
7206
- abstract createOrReplace<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8343
+ abstract createOrReplace<K extends SelectableColumn<Record>>(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7207
8344
  ifVersion?: number;
7208
8345
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7209
8346
  /**
@@ -7213,7 +8350,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7213
8350
  * @param object The column names and the values to be persisted.
7214
8351
  * @returns The full persisted record.
7215
8352
  */
7216
- abstract createOrReplace(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8353
+ abstract createOrReplace(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, options?: {
7217
8354
  ifVersion?: number;
7218
8355
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7219
8356
  /**
@@ -7223,14 +8360,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7223
8360
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7224
8361
  * @returns Array of the persisted records.
7225
8362
  */
7226
- abstract createOrReplace<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8363
+ abstract createOrReplace<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7227
8364
  /**
7228
8365
  * Creates or replaces a single record. If a record exists with the given id,
7229
8366
  * it will be replaced, otherwise a new record will be created.
7230
8367
  * @param objects Array of objects with the column names and the values to be stored in the table.
7231
8368
  * @returns Array of the persisted records.
7232
8369
  */
7233
- abstract createOrReplace(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8370
+ abstract createOrReplace(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7234
8371
  /**
7235
8372
  * Deletes a record given its unique id.
7236
8373
  * @param object An object with a unique id.
@@ -7250,13 +8387,13 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7250
8387
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7251
8388
  * @returns The deleted record, null if the record could not be found.
7252
8389
  */
7253
- abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
8390
+ abstract delete<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7254
8391
  /**
7255
8392
  * Deletes a record given a unique id.
7256
8393
  * @param id The unique id.
7257
8394
  * @returns The deleted record, null if the record could not be found.
7258
8395
  */
7259
- abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
8396
+ abstract delete(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7260
8397
  /**
7261
8398
  * Deletes multiple records given an array of objects with ids.
7262
8399
  * @param objects An array of objects with unique ids.
@@ -7276,13 +8413,13 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7276
8413
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7277
8414
  * @returns Array of the deleted records in order (if a record could not be found null is returned).
7278
8415
  */
7279
- abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8416
+ abstract delete<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7280
8417
  /**
7281
8418
  * Deletes multiple records given an array of unique ids.
7282
8419
  * @param objects An array of ids.
7283
8420
  * @returns Array of the deleted records in order (if a record could not be found null is returned).
7284
8421
  */
7285
- abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8422
+ abstract delete(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7286
8423
  /**
7287
8424
  * Deletes a record given its unique id.
7288
8425
  * @param object An object with a unique id.
@@ -7305,14 +8442,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7305
8442
  * @returns The deleted record, null if the record could not be found.
7306
8443
  * @throws If the record could not be found.
7307
8444
  */
7308
- abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8445
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7309
8446
  /**
7310
8447
  * Deletes a record given a unique id.
7311
8448
  * @param id The unique id.
7312
8449
  * @returns The deleted record, null if the record could not be found.
7313
8450
  * @throws If the record could not be found.
7314
8451
  */
7315
- abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8452
+ abstract deleteOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7316
8453
  /**
7317
8454
  * Deletes multiple records given an array of objects with ids.
7318
8455
  * @param objects An array of objects with unique ids.
@@ -7335,14 +8472,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7335
8472
  * @returns Array of the deleted records in order (if a record could not be found null is returned).
7336
8473
  * @throws If one or more records could not be found.
7337
8474
  */
7338
- abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8475
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7339
8476
  /**
7340
8477
  * Deletes multiple records given an array of unique ids.
7341
8478
  * @param objects An array of ids.
7342
8479
  * @returns Array of the deleted records in order.
7343
8480
  * @throws If one or more records could not be found.
7344
8481
  */
7345
- abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8482
+ abstract deleteOrThrow(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7346
8483
  /**
7347
8484
  * Search for records in the table.
7348
8485
  * @param query The query to search for.
@@ -7389,6 +8526,16 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7389
8526
  * @returns The requested aggregations.
7390
8527
  */
7391
8528
  abstract aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(expression?: Expression, filter?: Filter<Record>): Promise<AggregationResult<Record, Expression>>;
8529
+ /**
8530
+ * Experimental: Ask the database to perform a natural language question.
8531
+ */
8532
+ abstract ask(question: string, options?: AskOptions<Record>): Promise<AskResult>;
8533
+ /**
8534
+ * Experimental: Ask the database to perform a natural language question.
8535
+ */
8536
+ abstract ask(question: string, options: AskOptions<Record> & {
8537
+ onMessage: (message: AskResult) => void;
8538
+ }): void;
7392
8539
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
7393
8540
  }
7394
8541
  declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
@@ -7405,26 +8552,26 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7405
8552
  create(object: EditableData<Record> & Partial<Identifiable>, options?: {
7406
8553
  ifVersion?: number;
7407
8554
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7408
- create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[], options?: {
8555
+ create<K extends SelectableColumn<Record>>(id: Identifier, object: EditableData<Record>, columns: K[], options?: {
7409
8556
  ifVersion?: number;
7410
8557
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7411
- create(id: string, object: EditableData<Record>, options?: {
8558
+ create(id: Identifier, object: EditableData<Record>, options?: {
7412
8559
  ifVersion?: number;
7413
8560
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7414
8561
  create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7415
8562
  create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7416
- read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
8563
+ read<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
7417
8564
  read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
7418
- read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7419
- read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8565
+ read<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8566
+ read(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7420
8567
  read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
7421
8568
  read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
7422
8569
  read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7423
8570
  read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7424
- readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7425
- readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7426
- readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7427
- readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8571
+ readOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8572
+ readOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8573
+ readOrThrow<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8574
+ readOrThrow(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7428
8575
  readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7429
8576
  readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7430
8577
  readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
@@ -7435,10 +8582,10 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7435
8582
  update(object: Partial<EditableData<Record>> & Identifiable, options?: {
7436
8583
  ifVersion?: number;
7437
8584
  }): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7438
- update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8585
+ update<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
7439
8586
  ifVersion?: number;
7440
8587
  }): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7441
- update(id: string, object: Partial<EditableData<Record>>, options?: {
8588
+ update(id: Identifier, object: Partial<EditableData<Record>>, options?: {
7442
8589
  ifVersion?: number;
7443
8590
  }): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7444
8591
  update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
@@ -7449,58 +8596,58 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7449
8596
  updateOrThrow(object: Partial<EditableData<Record>> & Identifiable, options?: {
7450
8597
  ifVersion?: number;
7451
8598
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7452
- updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8599
+ updateOrThrow<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
7453
8600
  ifVersion?: number;
7454
8601
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7455
- updateOrThrow(id: string, object: Partial<EditableData<Record>>, options?: {
8602
+ updateOrThrow(id: Identifier, object: Partial<EditableData<Record>>, options?: {
7456
8603
  ifVersion?: number;
7457
8604
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7458
8605
  updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7459
8606
  updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7460
- createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8607
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[], options?: {
7461
8608
  ifVersion?: number;
7462
8609
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7463
- createOrUpdate(object: EditableData<Record> & Identifiable, options?: {
8610
+ createOrUpdate(object: EditableData<Record> & Partial<Identifiable>, options?: {
7464
8611
  ifVersion?: number;
7465
8612
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7466
- createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8613
+ createOrUpdate<K extends SelectableColumn<Record>>(id: Identifier, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7467
8614
  ifVersion?: number;
7468
8615
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7469
- createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8616
+ createOrUpdate(id: Identifier, object: Omit<EditableData<Record>, 'id'>, options?: {
7470
8617
  ifVersion?: number;
7471
8618
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7472
- createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7473
- createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7474
- createOrReplace<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8619
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8620
+ createOrUpdate(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8621
+ createOrReplace<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[], options?: {
7475
8622
  ifVersion?: number;
7476
8623
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7477
- createOrReplace(object: EditableData<Record> & Identifiable, options?: {
8624
+ createOrReplace(object: EditableData<Record> & Partial<Identifiable>, options?: {
7478
8625
  ifVersion?: number;
7479
8626
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7480
- createOrReplace<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8627
+ createOrReplace<K extends SelectableColumn<Record>>(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7481
8628
  ifVersion?: number;
7482
8629
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7483
- createOrReplace(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8630
+ createOrReplace(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, options?: {
7484
8631
  ifVersion?: number;
7485
8632
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7486
- createOrReplace<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7487
- createOrReplace(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8633
+ createOrReplace<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8634
+ createOrReplace(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7488
8635
  delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7489
8636
  delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7490
- delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7491
- delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
8637
+ delete<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
8638
+ delete(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7492
8639
  delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7493
8640
  delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7494
- delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7495
- delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8641
+ delete<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8642
+ delete(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7496
8643
  deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7497
8644
  deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7498
- deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7499
- deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8645
+ deleteOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8646
+ deleteOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7500
8647
  deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7501
8648
  deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7502
- deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7503
- deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8649
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8650
+ deleteOrThrow(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7504
8651
  search(query: string, options?: {
7505
8652
  fuzziness?: FuzzinessExpression;
7506
8653
  prefix?: PrefixExpression;
@@ -7518,6 +8665,9 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7518
8665
  aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(aggs?: Expression, filter?: Filter<Record>): Promise<any>;
7519
8666
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
7520
8667
  summarizeTable<Result extends XataRecord>(query: Query<Record, Result>, summaries?: Dictionary<SummarizeExpression<Record>>, summariesFilter?: FilterExpression): Promise<SummarizeResponse>;
8668
+ ask(question: string, options?: AskOptions<Record> & {
8669
+ onMessage?: (message: AskResult) => void;
8670
+ }): any;
7521
8671
  }
7522
8672
 
7523
8673
  type BaseSchema = {
@@ -7631,11 +8781,11 @@ declare const le: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
7631
8781
  /**
7632
8782
  * Operator to restrict results to only values that are not null.
7633
8783
  */
7634
- declare const exists: <T>(column?: ColumnsByValue<T, any> | undefined) => ExistanceFilter<T>;
8784
+ declare const exists: <T>(column?: FilterColumns<T> | undefined) => ExistanceFilter<T>;
7635
8785
  /**
7636
8786
  * Operator to restrict results to only values that are null.
7637
8787
  */
7638
- declare const notExists: <T>(column?: ColumnsByValue<T, any> | undefined) => ExistanceFilter<T>;
8788
+ declare const notExists: <T>(column?: FilterColumns<T> | undefined) => ExistanceFilter<T>;
7639
8789
  /**
7640
8790
  * Operator to restrict results to only values that start with the given prefix.
7641
8791
  */
@@ -7725,6 +8875,7 @@ type UpdateTransactionOperation<O extends XataRecord> = {
7725
8875
  };
7726
8876
  type DeleteTransactionOperation = {
7727
8877
  id: string;
8878
+ failIfMissing?: boolean;
7728
8879
  };
7729
8880
  type TransactionOperationSingleResult<Schema extends Record<string, BaseData>, Table extends StringKeys<Schema>, Operation extends TransactionOperation<Schema, Table>> = Operation extends {
7730
8881
  insert: {
@@ -7771,19 +8922,15 @@ type TransactionPluginResult<Schemas extends Record<string, XataRecord>> = {
7771
8922
  run: <Tables extends StringKeys<Schemas>, Operations extends TransactionOperation<Schemas, Tables>[]>(operations: Narrow<Operations>) => Promise<TransactionResults<Schemas, Tables, Operations>>;
7772
8923
  };
7773
8924
  declare class TransactionPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
7774
- build({ getFetchProps }: XataPluginOptions): TransactionPluginResult<Schemas>;
8925
+ build(pluginOptions: XataPluginOptions): TransactionPluginResult<Schemas>;
7775
8926
  }
7776
8927
 
7777
- type BranchStrategyValue = string | undefined | null;
7778
- type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
7779
- type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
7780
- type BranchStrategyOption = NonNullable<BranchStrategy | BranchStrategy[]>;
7781
-
7782
8928
  type BaseClientOptions = {
7783
8929
  fetch?: FetchImpl;
8930
+ host?: HostProvider;
7784
8931
  apiKey?: string;
7785
8932
  databaseURL?: string;
7786
- branch?: BranchStrategyOption;
8933
+ branch?: string;
7787
8934
  cache?: CacheImpl;
7788
8935
  trace?: TraceFunction;
7789
8936
  enableBrowser?: boolean;
@@ -7825,35 +8972,31 @@ type SerializerResult<T> = T extends XataRecord ? Identifiable & Omit<{
7825
8972
  [K in keyof T]: SerializerResult<T[K]>;
7826
8973
  }, keyof XataRecord> : T extends any[] ? SerializerResult<T[number]>[] : T;
7827
8974
 
7828
- type BranchResolutionOptions = {
7829
- databaseURL?: string;
7830
- apiKey?: string;
7831
- fetchImpl?: FetchImpl;
7832
- clientName?: string;
7833
- xataAgentExtra?: Record<string, string>;
7834
- };
7835
- declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
7836
- declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
7837
8975
  declare function getDatabaseURL(): string | undefined;
7838
-
7839
8976
  declare function getAPIKey(): string | undefined;
8977
+ declare function getBranch(): string | undefined;
8978
+ declare function buildPreviewBranchName({ org, branch }: {
8979
+ org: string;
8980
+ branch: string;
8981
+ }): string;
8982
+ declare function getPreviewBranch(): string | undefined;
7840
8983
 
7841
8984
  interface Body {
7842
8985
  arrayBuffer(): Promise<ArrayBuffer>;
7843
- blob(): Promise<Blob>;
8986
+ blob(): Promise<Blob$1>;
7844
8987
  formData(): Promise<FormData>;
7845
8988
  json(): Promise<any>;
7846
8989
  text(): Promise<string>;
7847
8990
  }
7848
- interface Blob {
8991
+ interface Blob$1 {
7849
8992
  readonly size: number;
7850
8993
  readonly type: string;
7851
8994
  arrayBuffer(): Promise<ArrayBuffer>;
7852
- slice(start?: number, end?: number, contentType?: string): Blob;
8995
+ slice(start?: number, end?: number, contentType?: string): Blob$1;
7853
8996
  text(): Promise<string>;
7854
8997
  }
7855
8998
  /** Provides information about files and allows JavaScript in a web page to access their content. */
7856
- interface File extends Blob {
8999
+ interface File extends Blob$1 {
7857
9000
  readonly lastModified: number;
7858
9001
  readonly name: string;
7859
9002
  readonly webkitRelativePath: string;
@@ -7861,12 +9004,12 @@ interface File extends Blob {
7861
9004
  type FormDataEntryValue = File | string;
7862
9005
  /** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
7863
9006
  interface FormData {
7864
- append(name: string, value: string | Blob, fileName?: string): void;
9007
+ append(name: string, value: string | Blob$1, fileName?: string): void;
7865
9008
  delete(name: string): void;
7866
9009
  get(name: string): FormDataEntryValue | null;
7867
9010
  getAll(name: string): FormDataEntryValue[];
7868
9011
  has(name: string): boolean;
7869
- set(name: string, value: string | Blob, fileName?: string): void;
9012
+ set(name: string, value: string | Blob$1, fileName?: string): void;
7870
9013
  forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
7871
9014
  }
7872
9015
  /** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
@@ -7923,4 +9066,4 @@ declare class XataError extends Error {
7923
9066
  constructor(message: string, status: number);
7924
9067
  }
7925
9068
 
7926
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, AggregateTableError, AggregateTablePathParams, AggregateTableRequestBody, AggregateTableVariables, ApiExtraProps, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BranchTransactionError, BranchTransactionPathParams, BranchTransactionRequestBody, BranchTransactionVariables, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, ColumnsByValue, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasRequestBody, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchResponse, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabaseGithubSettingsError, DeleteDatabaseGithubSettingsPathParams, DeleteDatabaseGithubSettingsVariables, DeleteDatabasePathParams, DeleteDatabaseResponse, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableResponse, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, DeserializedType, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherError, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseGithubSettingsError, GetDatabaseGithubSettingsPathParams, GetDatabaseGithubSettingsVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, 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, HostProvider, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListRegionsError, ListRegionsPathParams, ListRegionsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, Query, QueryMigrationRequestsError, QueryMigrationRequestsPathParams, QueryMigrationRequestsRequestBody, QueryMigrationRequestsResponse, QueryMigrationRequestsVariables, 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, SerializedString, Serializer, SerializerResult, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, SummarizeTableError, SummarizeTablePathParams, SummarizeTableRequestBody, SummarizeTableVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateDatabaseGithubSettingsError, UpdateDatabaseGithubSettingsPathParams, UpdateDatabaseGithubSettingsVariables, UpdateDatabaseMetadataError, UpdateDatabaseMetadataPathParams, UpdateDatabaseMetadataRequestBody, UpdateDatabaseMetadataVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, 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, VectorSearchTableError, VectorSearchTablePathParams, VectorSearchTableRequestBody, VectorSearchTableVariables, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, branchTransaction, buildClient, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
9069
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, AggregateTableError, AggregateTablePathParams, AggregateTableRequestBody, AggregateTableVariables, ApiExtraProps, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditVariables, AskOptions, AskResult, AskTableError, AskTablePathParams, AskTableRequestBody, AskTableResponse, AskTableVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BranchTransactionError, BranchTransactionPathParams, BranchTransactionRequestBody, BranchTransactionVariables, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ChatSessionMessageError, ChatSessionMessagePathParams, ChatSessionMessageRequestBody, ChatSessionMessageResponse, ChatSessionMessageVariables, ClientConstructor, ColumnsByValue, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasRequestBody, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CopyBranchError, CopyBranchPathParams, CopyBranchRequestBody, CopyBranchVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchResponse, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabaseGithubSettingsError, DeleteDatabaseGithubSettingsPathParams, DeleteDatabaseGithubSettingsVariables, DeleteDatabasePathParams, DeleteDatabaseResponse, DeleteDatabaseVariables, DeleteFileError, DeleteFileItemError, DeleteFileItemPathParams, DeleteFileItemVariables, DeleteFilePathParams, DeleteFileVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableResponse, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, DeserializedType, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherError, FetcherExtraProps, FileAccessError, FileAccessPathParams, FileAccessQueryParams, FileAccessVariables, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseGithubSettingsError, GetDatabaseGithubSettingsPathParams, GetDatabaseGithubSettingsVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetFileError, GetFileItemError, GetFileItemPathParams, GetFileItemVariables, GetFilePathParams, GetFileVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, 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, HostProvider, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, JSONData, KeywordAskOptions, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListRegionsError, ListRegionsPathParams, ListRegionsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, PushBranchMigrationsError, PushBranchMigrationsPathParams, PushBranchMigrationsRequestBody, PushBranchMigrationsVariables, PutFileError, PutFileItemError, PutFileItemPathParams, PutFileItemVariables, PutFilePathParams, PutFileVariables, Query, QueryMigrationRequestsError, QueryMigrationRequestsPathParams, QueryMigrationRequestsRequestBody, QueryMigrationRequestsResponse, QueryMigrationRequestsVariables, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RecordColumnTypes, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, RenameDatabaseError, RenameDatabasePathParams, RenameDatabaseRequestBody, RenameDatabaseVariables, 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, SerializedString, Serializer, SerializerResult, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, SqlQueryError, SqlQueryPathParams, SqlQueryRequestBody, SqlQueryVariables, SummarizeTableError, SummarizeTablePathParams, SummarizeTableRequestBody, SummarizeTableVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateDatabaseGithubSettingsError, UpdateDatabaseGithubSettingsPathParams, UpdateDatabaseGithubSettingsVariables, UpdateDatabaseMetadataError, UpdateDatabaseMetadataPathParams, UpdateDatabaseMetadataRequestBody, UpdateDatabaseMetadataVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, 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, VectorAskOptions, VectorSearchTableError, VectorSearchTablePathParams, VectorSearchTableRequestBody, VectorSearchTableVariables, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, chatSessionMessage, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };