@xata.io/client 0.0.0-alpha.vf38f30b → 0.0.0-alpha.vf6c3bd7

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
@@ -19,11 +19,39 @@ declare type ErrorWrapper<TError> = TError | {
19
19
  payload: string;
20
20
  };
21
21
 
22
+ interface CacheImpl {
23
+ cacheRecords: boolean;
24
+ defaultQueryTTL: number;
25
+ getAll(): Promise<Record<string, unknown>>;
26
+ get: <T>(key: string) => Promise<T | null>;
27
+ set: <T>(key: string, value: T) => Promise<void>;
28
+ delete: (key: string) => Promise<void>;
29
+ clear: () => Promise<void>;
30
+ }
31
+ interface SimpleCacheOptions {
32
+ max?: number;
33
+ cacheRecords?: boolean;
34
+ defaultQueryTTL?: number;
35
+ }
36
+ declare class SimpleCache implements CacheImpl {
37
+ #private;
38
+ capacity: number;
39
+ cacheRecords: boolean;
40
+ defaultQueryTTL: number;
41
+ constructor(options?: SimpleCacheOptions);
42
+ getAll(): Promise<Record<string, unknown>>;
43
+ get<T>(key: string): Promise<T | null>;
44
+ set<T>(key: string, value: T): Promise<void>;
45
+ delete(key: string): Promise<void>;
46
+ clear(): Promise<void>;
47
+ }
48
+
22
49
  declare abstract class XataPlugin {
23
50
  abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
24
51
  }
25
52
  declare type XataPluginOptions = {
26
53
  getFetchProps: () => Promise<FetcherExtraProps>;
54
+ cache: CacheImpl;
27
55
  };
28
56
 
29
57
  /**
@@ -110,6 +138,12 @@ declare type ListBranchesResponse = {
110
138
  displayName: string;
111
139
  branches: Branch[];
112
140
  };
141
+ declare type ListGitBranchesResponse = {
142
+ mapping: {
143
+ gitBranch: string;
144
+ xataBranch: string;
145
+ }[];
146
+ };
113
147
  declare type Branch = {
114
148
  name: string;
115
149
  createdAt: DateTime;
@@ -158,7 +192,7 @@ declare type Table = {
158
192
  */
159
193
  declare type Column = {
160
194
  name: string;
161
- type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
195
+ type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
162
196
  link?: {
163
197
  table: string;
164
198
  };
@@ -234,6 +268,17 @@ declare type SortExpression = string[] | {
234
268
  [key: string]: SortOrder;
235
269
  }[];
236
270
  declare type SortOrder = 'asc' | 'desc';
271
+ /**
272
+ * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
273
+ * distance is the number of one charcter changes needed to make two strings equal. The default is 1, meaning that single
274
+ * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
275
+ * to allow two typos in a word.
276
+ *
277
+ * @default 1
278
+ * @maximum 2
279
+ * @minimum 0
280
+ */
281
+ declare type FuzzinessExpression = number;
237
282
  /**
238
283
  * @minProperties 1
239
284
  */
@@ -247,6 +292,10 @@ declare type FilterExpression = {
247
292
  } & {
248
293
  [key: string]: FilterColumn;
249
294
  };
295
+ declare type HighlightExpression = {
296
+ enabled?: boolean;
297
+ encodeHTML?: boolean;
298
+ };
250
299
  declare type FilterList = FilterExpression | FilterExpression[];
251
300
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
252
301
  /**
@@ -332,6 +381,11 @@ declare type XataRecord$1 = {
332
381
  xata: {
333
382
  version: number;
334
383
  table?: string;
384
+ highlight?: {
385
+ [key: string]: string[] | {
386
+ [key: string]: any;
387
+ };
388
+ };
335
389
  warnings?: string[];
336
390
  };
337
391
  } & {
@@ -354,6 +408,7 @@ type schemas_WorkspaceMembers = WorkspaceMembers;
354
408
  type schemas_InviteKey = InviteKey;
355
409
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
356
410
  type schemas_ListBranchesResponse = ListBranchesResponse;
411
+ type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
357
412
  type schemas_Branch = Branch;
358
413
  type schemas_BranchMetadata = BranchMetadata;
359
414
  type schemas_DBBranch = DBBranch;
@@ -374,7 +429,9 @@ type schemas_TableMigration = TableMigration;
374
429
  type schemas_ColumnMigration = ColumnMigration;
375
430
  type schemas_SortExpression = SortExpression;
376
431
  type schemas_SortOrder = SortOrder;
432
+ type schemas_FuzzinessExpression = FuzzinessExpression;
377
433
  type schemas_FilterExpression = FilterExpression;
434
+ type schemas_HighlightExpression = HighlightExpression;
378
435
  type schemas_FilterList = FilterList;
379
436
  type schemas_FilterColumn = FilterColumn;
380
437
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -406,6 +463,7 @@ declare namespace schemas {
406
463
  schemas_InviteKey as InviteKey,
407
464
  schemas_ListDatabasesResponse as ListDatabasesResponse,
408
465
  schemas_ListBranchesResponse as ListBranchesResponse,
466
+ schemas_ListGitBranchesResponse as ListGitBranchesResponse,
409
467
  schemas_Branch as Branch,
410
468
  schemas_BranchMetadata as BranchMetadata,
411
469
  schemas_DBBranch as DBBranch,
@@ -426,7 +484,9 @@ declare namespace schemas {
426
484
  schemas_ColumnMigration as ColumnMigration,
427
485
  schemas_SortExpression as SortExpression,
428
486
  schemas_SortOrder as SortOrder,
487
+ schemas_FuzzinessExpression as FuzzinessExpression,
429
488
  schemas_FilterExpression as FilterExpression,
489
+ schemas_HighlightExpression as HighlightExpression,
430
490
  schemas_FilterList as FilterList,
431
491
  schemas_FilterColumn as FilterColumn,
432
492
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -982,6 +1042,163 @@ declare type DeleteDatabaseVariables = {
982
1042
  * Delete a database and all of its branches and tables permanently.
983
1043
  */
984
1044
  declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1045
+ declare type GetGitBranchesMappingPathParams = {
1046
+ dbName: DBName;
1047
+ workspace: string;
1048
+ };
1049
+ declare type GetGitBranchesMappingError = ErrorWrapper<{
1050
+ status: 400;
1051
+ payload: BadRequestError;
1052
+ } | {
1053
+ status: 401;
1054
+ payload: AuthError;
1055
+ }>;
1056
+ declare type GetGitBranchesMappingVariables = {
1057
+ pathParams: GetGitBranchesMappingPathParams;
1058
+ } & FetcherExtraProps;
1059
+ /**
1060
+ * Lists all the git branches in the mapping, and their associated Xata branches.
1061
+ *
1062
+ * Example response:
1063
+ *
1064
+ * ```json
1065
+ * {
1066
+ * "mappings": [
1067
+ * {
1068
+ * "gitBranch": "main",
1069
+ * "xataBranch": "main"
1070
+ * },
1071
+ * {
1072
+ * "gitBranch": "gitBranch1",
1073
+ * "xataBranch": "xataBranch1"
1074
+ * }
1075
+ * {
1076
+ * "gitBranch": "xataBranch2",
1077
+ * "xataBranch": "xataBranch2"
1078
+ * }
1079
+ * ]
1080
+ * }
1081
+ * ```
1082
+ */
1083
+ declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
1084
+ declare type AddGitBranchesEntryPathParams = {
1085
+ dbName: DBName;
1086
+ workspace: string;
1087
+ };
1088
+ declare type AddGitBranchesEntryError = ErrorWrapper<{
1089
+ status: 400;
1090
+ payload: BadRequestError;
1091
+ } | {
1092
+ status: 401;
1093
+ payload: AuthError;
1094
+ }>;
1095
+ declare type AddGitBranchesEntryResponse = {
1096
+ warning?: string;
1097
+ };
1098
+ declare type AddGitBranchesEntryRequestBody = {
1099
+ gitBranch: string;
1100
+ xataBranch: BranchName;
1101
+ };
1102
+ declare type AddGitBranchesEntryVariables = {
1103
+ body: AddGitBranchesEntryRequestBody;
1104
+ pathParams: AddGitBranchesEntryPathParams;
1105
+ } & FetcherExtraProps;
1106
+ /**
1107
+ * Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.
1108
+ *
1109
+ * If the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.
1110
+ *
1111
+ * Example request:
1112
+ *
1113
+ * ```json
1114
+ * // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
1115
+ * {
1116
+ * "gitBranch": "fix/bug123",
1117
+ * "xataBranch": "fix_bug"
1118
+ * }
1119
+ * ```
1120
+ */
1121
+ declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
1122
+ declare type RemoveGitBranchesEntryPathParams = {
1123
+ dbName: DBName;
1124
+ workspace: string;
1125
+ };
1126
+ declare type RemoveGitBranchesEntryQueryParams = {
1127
+ gitBranch: string;
1128
+ };
1129
+ declare type RemoveGitBranchesEntryError = ErrorWrapper<{
1130
+ status: 400;
1131
+ payload: BadRequestError;
1132
+ } | {
1133
+ status: 401;
1134
+ payload: AuthError;
1135
+ }>;
1136
+ declare type RemoveGitBranchesEntryVariables = {
1137
+ pathParams: RemoveGitBranchesEntryPathParams;
1138
+ queryParams: RemoveGitBranchesEntryQueryParams;
1139
+ } & FetcherExtraProps;
1140
+ /**
1141
+ * Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
1142
+ *
1143
+ * Example request:
1144
+ *
1145
+ * ```json
1146
+ * // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
1147
+ * ```
1148
+ */
1149
+ declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
1150
+ declare type ResolveBranchPathParams = {
1151
+ dbName: DBName;
1152
+ workspace: string;
1153
+ };
1154
+ declare type ResolveBranchQueryParams = {
1155
+ gitBranch?: string;
1156
+ fallbackBranch?: string;
1157
+ };
1158
+ declare type ResolveBranchError = ErrorWrapper<{
1159
+ status: 400;
1160
+ payload: BadRequestError;
1161
+ } | {
1162
+ status: 401;
1163
+ payload: AuthError;
1164
+ }>;
1165
+ declare type ResolveBranchResponse = {
1166
+ branch: string;
1167
+ reason: {
1168
+ code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
1169
+ message: string;
1170
+ };
1171
+ };
1172
+ declare type ResolveBranchVariables = {
1173
+ pathParams: ResolveBranchPathParams;
1174
+ queryParams?: ResolveBranchQueryParams;
1175
+ } & FetcherExtraProps;
1176
+ /**
1177
+ * In order to resolve the database branch, the following algorithm is used:
1178
+ * * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
1179
+ * * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
1180
+ * * else, if `fallbackBranch` is provided and a branch with that name exists, return it
1181
+ * * else, return the default branch of the DB (`main` or the first branch)
1182
+ *
1183
+ * Example call:
1184
+ *
1185
+ * ```json
1186
+ * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
1187
+ * ```
1188
+ *
1189
+ * Example response:
1190
+ *
1191
+ * ```json
1192
+ * {
1193
+ * "branch": "main",
1194
+ * "reason": {
1195
+ * "code": "DEFAULT_BRANCH",
1196
+ * "message": "Default branch for this database (main)"
1197
+ * }
1198
+ * }
1199
+ * ```
1200
+ */
1201
+ declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
985
1202
  declare type GetBranchDetailsPathParams = {
986
1203
  dbBranchName: DBBranchName;
987
1204
  workspace: string;
@@ -1266,8 +1483,9 @@ declare type UpdateTableVariables = {
1266
1483
  *
1267
1484
  * In the example below, we rename a table from “users” to “people”:
1268
1485
  *
1269
- * ```jsx
1270
- * PATCH /db/test:main/tables/users
1486
+ * ```json
1487
+ * // PATCH /db/test:main/tables/users
1488
+ *
1271
1489
  * {
1272
1490
  * "name": "people"
1273
1491
  * }
@@ -1675,7 +1893,7 @@ declare type QueryTableVariables = {
1675
1893
  * {
1676
1894
  * "columns": [...],
1677
1895
  * "filter": {
1678
- * "$all": [...]
1896
+ * "$all": [...],
1679
1897
  * "$any": [...]
1680
1898
  * ...
1681
1899
  * },
@@ -1721,7 +1939,11 @@ declare type QueryTableVariables = {
1721
1939
  * "link": {
1722
1940
  * "table": "users"
1723
1941
  * }
1724
- * }
1942
+ * },
1943
+ * {
1944
+ * "name": "foundedDate",
1945
+ * "type": "datetime"
1946
+ * },
1725
1947
  * ]
1726
1948
  * },
1727
1949
  * {
@@ -1809,7 +2031,7 @@ declare type QueryTableVariables = {
1809
2031
  * {
1810
2032
  * "name": "Kilian",
1811
2033
  * "address": {
1812
- * "street": "New street",
2034
+ * "street": "New street"
1813
2035
  * }
1814
2036
  * }
1815
2037
  * ```
@@ -1818,10 +2040,7 @@ declare type QueryTableVariables = {
1818
2040
  *
1819
2041
  * ```json
1820
2042
  * {
1821
- * "columns": [
1822
- * "*",
1823
- * "team.name"
1824
- * ]
2043
+ * "columns": ["*", "team.name"]
1825
2044
  * }
1826
2045
  * ```
1827
2046
  *
@@ -1839,7 +2058,7 @@ declare type QueryTableVariables = {
1839
2058
  * "team": {
1840
2059
  * "id": "XX",
1841
2060
  * "xata": {
1842
- * "version": 0,
2061
+ * "version": 0
1843
2062
  * },
1844
2063
  * "name": "first team"
1845
2064
  * }
@@ -1850,10 +2069,7 @@ declare type QueryTableVariables = {
1850
2069
  *
1851
2070
  * ```json
1852
2071
  * {
1853
- * "columns": [
1854
- * "*",
1855
- * "team.*"
1856
- * ]
2072
+ * "columns": ["*", "team.*"]
1857
2073
  * }
1858
2074
  * ```
1859
2075
  *
@@ -1871,10 +2087,11 @@ declare type QueryTableVariables = {
1871
2087
  * "team": {
1872
2088
  * "id": "XX",
1873
2089
  * "xata": {
1874
- * "version": 0,
2090
+ * "version": 0
1875
2091
  * },
1876
2092
  * "name": "first team",
1877
- * "code": "A1"
2093
+ * "code": "A1",
2094
+ * "foundedDate": "2020-03-04T10:43:54.32Z"
1878
2095
  * }
1879
2096
  * }
1880
2097
  * ```
@@ -1889,7 +2106,7 @@ declare type QueryTableVariables = {
1889
2106
  * `$none`, etc.
1890
2107
  *
1891
2108
  * All operators start with an `$` to differentiate them from column names
1892
- * (which are not allowed to start with an dollar sign).
2109
+ * (which are not allowed to start with a dollar sign).
1893
2110
  *
1894
2111
  * #### Exact matching and control operators
1895
2112
  *
@@ -1920,7 +2137,7 @@ declare type QueryTableVariables = {
1920
2137
  * ```json
1921
2138
  * {
1922
2139
  * "filter": {
1923
- * "name": "r2",
2140
+ * "name": "r2"
1924
2141
  * }
1925
2142
  * }
1926
2143
  * ```
@@ -1942,7 +2159,7 @@ declare type QueryTableVariables = {
1942
2159
  * ```json
1943
2160
  * {
1944
2161
  * "filter": {
1945
- * "settings.plan": "free",
2162
+ * "settings.plan": "free"
1946
2163
  * }
1947
2164
  * }
1948
2165
  * ```
@@ -1952,8 +2169,8 @@ declare type QueryTableVariables = {
1952
2169
  * "filter": {
1953
2170
  * "settings": {
1954
2171
  * "plan": "free"
1955
- * },
1956
- * },
2172
+ * }
2173
+ * }
1957
2174
  * }
1958
2175
  * ```
1959
2176
  *
@@ -1962,8 +2179,8 @@ declare type QueryTableVariables = {
1962
2179
  * ```json
1963
2180
  * {
1964
2181
  * "filter": {
1965
- * "settings.plan": {"$any": ["free", "paid"]}
1966
- * },
2182
+ * "settings.plan": { "$any": ["free", "paid"] }
2183
+ * }
1967
2184
  * }
1968
2185
  * ```
1969
2186
  *
@@ -1972,9 +2189,9 @@ declare type QueryTableVariables = {
1972
2189
  * ```json
1973
2190
  * {
1974
2191
  * "filter": {
1975
- * "settings.dark": true,
1976
- * "settings.plan": "free",
1977
- * },
2192
+ * "settings.dark": true,
2193
+ * "settings.plan": "free"
2194
+ * }
1978
2195
  * }
1979
2196
  * ```
1980
2197
  *
@@ -1985,11 +2202,11 @@ declare type QueryTableVariables = {
1985
2202
  * ```json
1986
2203
  * {
1987
2204
  * "filter": {
1988
- * "$any": {
1989
- * "settings.dark": true,
1990
- * "settings.plan": "free"
1991
- * }
1992
- * },
2205
+ * "$any": {
2206
+ * "settings.dark": true,
2207
+ * "settings.plan": "free"
2208
+ * }
2209
+ * }
1993
2210
  * }
1994
2211
  * ```
1995
2212
  *
@@ -2000,10 +2217,10 @@ declare type QueryTableVariables = {
2000
2217
  * "filter": {
2001
2218
  * "$any": [
2002
2219
  * {
2003
- * "name": "r1",
2220
+ * "name": "r1"
2004
2221
  * },
2005
2222
  * {
2006
- * "name": "r2",
2223
+ * "name": "r2"
2007
2224
  * }
2008
2225
  * ]
2009
2226
  * }
@@ -2015,7 +2232,7 @@ declare type QueryTableVariables = {
2015
2232
  * ```json
2016
2233
  * {
2017
2234
  * "filter": {
2018
- * "$exists": "settings",
2235
+ * "$exists": "settings"
2019
2236
  * }
2020
2237
  * }
2021
2238
  * ```
@@ -2027,10 +2244,10 @@ declare type QueryTableVariables = {
2027
2244
  * "filter": {
2028
2245
  * "$all": [
2029
2246
  * {
2030
- * "$exists": "settings",
2247
+ * "$exists": "settings"
2031
2248
  * },
2032
2249
  * {
2033
- * "$exists": "name",
2250
+ * "$exists": "name"
2034
2251
  * }
2035
2252
  * ]
2036
2253
  * }
@@ -2042,7 +2259,7 @@ declare type QueryTableVariables = {
2042
2259
  * ```json
2043
2260
  * {
2044
2261
  * "filter": {
2045
- * "$notExists": "settings",
2262
+ * "$notExists": "settings"
2046
2263
  * }
2047
2264
  * }
2048
2265
  * ```
@@ -2069,43 +2286,59 @@ declare type QueryTableVariables = {
2069
2286
  * {
2070
2287
  * "filter": {
2071
2288
  * "<column_name>": {
2072
- * "$pattern": "v*alue*"
2289
+ * "$pattern": "v*alu?"
2073
2290
  * }
2074
2291
  * }
2075
2292
  * }
2076
2293
  * ```
2077
2294
  *
2295
+ * The `$pattern` operator accepts two wildcard characters:
2296
+ * * `*` matches zero or more characters
2297
+ * * `?` matches exactly one character
2298
+ *
2299
+ * If you want to match a string that contains a wildcard character, you can escape them using a backslash (`\`). You can escape a backslash by usign another backslash.
2300
+ *
2078
2301
  * We could also have `$endsWith` and `$startsWith` operators:
2079
2302
  *
2080
2303
  * ```json
2081
2304
  * {
2082
2305
  * "filter": {
2083
2306
  * "<column_name>": {
2084
- * "$endsWith": ".gz"
2307
+ * "$endsWith": ".gz"
2085
2308
  * },
2086
2309
  * "<column_name>": {
2087
- * "$startsWith": "tmp-"
2310
+ * "$startsWith": "tmp-"
2088
2311
  * }
2089
2312
  * }
2090
2313
  * }
2091
2314
  * ```
2092
2315
  *
2093
- * #### Numeric ranges
2316
+ * #### Numeric or datetime ranges
2094
2317
  *
2095
2318
  * ```json
2096
2319
  * {
2097
2320
  * "filter": {
2098
- * "<column_name>": {
2099
- * "$ge": 0,
2100
- * "$lt": 100
2101
- * }
2321
+ * "<column_name>": {
2322
+ * "$ge": 0,
2323
+ * "$lt": 100
2324
+ * }
2325
+ * }
2326
+ * }
2327
+ * ```
2328
+ * Date ranges support the same operators, with the date using the format defined in
2329
+ * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
2330
+ * ```json
2331
+ * {
2332
+ * "filter": {
2333
+ * "<column_name>": {
2334
+ * "$gt": "2019-10-12T07:20:50.52Z",
2335
+ * "$lt": "2021-10-12T07:20:50.52Z"
2336
+ * }
2102
2337
  * }
2103
2338
  * }
2104
2339
  * ```
2105
- *
2106
2340
  * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
2107
2341
  *
2108
- *
2109
2342
  * #### Negations
2110
2343
  *
2111
2344
  * A general `$not` operator can inverse any operation.
@@ -2130,15 +2363,21 @@ declare type QueryTableVariables = {
2130
2363
  * {
2131
2364
  * "filter": {
2132
2365
  * "$not": {
2133
- * "$any": [{
2134
- * "<column_name1>": "value1"
2135
- * }, {
2136
- * "$all": [{
2137
- * "<column_name2>": "value2"
2138
- * }, {
2139
- * "<column_name3>": "value3"
2140
- * }]
2141
- * }]
2366
+ * "$any": [
2367
+ * {
2368
+ * "<column_name1>": "value1"
2369
+ * },
2370
+ * {
2371
+ * "$all": [
2372
+ * {
2373
+ * "<column_name2>": "value2"
2374
+ * },
2375
+ * {
2376
+ * "<column_name3>": "value3"
2377
+ * }
2378
+ * ]
2379
+ * }
2380
+ * ]
2142
2381
  * }
2143
2382
  * }
2144
2383
  * }
@@ -2193,8 +2432,8 @@ declare type QueryTableVariables = {
2193
2432
  * "<array name>": {
2194
2433
  * "$includes": {
2195
2434
  * "$all": [
2196
- * {"$contains": "label"},
2197
- * {"$not": {"$endsWith": "-debug"}}
2435
+ * { "$contains": "label" },
2436
+ * { "$not": { "$endsWith": "-debug" } }
2198
2437
  * ]
2199
2438
  * }
2200
2439
  * }
@@ -2214,9 +2453,7 @@ declare type QueryTableVariables = {
2214
2453
  * {
2215
2454
  * "filter": {
2216
2455
  * "settings.labels": {
2217
- * "$includesAll": [
2218
- * {"$contains": "label"},
2219
- * ]
2456
+ * "$includesAll": [{ "$contains": "label" }]
2220
2457
  * }
2221
2458
  * }
2222
2459
  * }
@@ -2264,7 +2501,6 @@ declare type QueryTableVariables = {
2264
2501
  * }
2265
2502
  * ```
2266
2503
  *
2267
- *
2268
2504
  * ### Pagination
2269
2505
  *
2270
2506
  * We offer cursor pagination and offset pagination. The offset pagination is limited
@@ -2330,8 +2566,8 @@ declare type QueryTableVariables = {
2330
2566
  * can be queried by update `page.after` to the returned cursor while keeping the
2331
2567
  * `page.before` cursor from the first range query.
2332
2568
  *
2333
- * The `filter` , `columns`, `sort` , and `page.size` configuration will be
2334
- * encoded with the cursor. The pagination request will be invalid if
2569
+ * The `filter` , `columns`, `sort` , and `page.size` configuration will be
2570
+ * encoded with the cursor. The pagination request will be invalid if
2335
2571
  * `filter` or `sort` is set. The columns returned and page size can be changed
2336
2572
  * anytime by passing the `columns` or `page.size` settings to the next query.
2337
2573
  *
@@ -2368,6 +2604,39 @@ declare type QueryTableVariables = {
2368
2604
  * ```
2369
2605
  */
2370
2606
  declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2607
+ declare type SearchTablePathParams = {
2608
+ dbBranchName: DBBranchName;
2609
+ tableName: TableName;
2610
+ workspace: string;
2611
+ };
2612
+ declare type SearchTableError = ErrorWrapper<{
2613
+ status: 400;
2614
+ payload: BadRequestError;
2615
+ } | {
2616
+ status: 401;
2617
+ payload: AuthError;
2618
+ } | {
2619
+ status: 404;
2620
+ payload: SimpleError;
2621
+ }>;
2622
+ declare type SearchTableRequestBody = {
2623
+ query: string;
2624
+ fuzziness?: FuzzinessExpression;
2625
+ filter?: FilterExpression;
2626
+ highlight?: HighlightExpression;
2627
+ };
2628
+ declare type SearchTableVariables = {
2629
+ body: SearchTableRequestBody;
2630
+ pathParams: SearchTablePathParams;
2631
+ } & FetcherExtraProps;
2632
+ /**
2633
+ * Run a free text search operation in a particular table.
2634
+ *
2635
+ * 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:
2636
+ * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
2637
+ * * filtering on columns of type `multiple` is currently unsupported
2638
+ */
2639
+ declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2371
2640
  declare type SearchBranchPathParams = {
2372
2641
  dbBranchName: DBBranchName;
2373
2642
  workspace: string;
@@ -2383,9 +2652,13 @@ declare type SearchBranchError = ErrorWrapper<{
2383
2652
  payload: SimpleError;
2384
2653
  }>;
2385
2654
  declare type SearchBranchRequestBody = {
2386
- tables?: string[];
2655
+ tables?: (string | {
2656
+ table: string;
2657
+ filter?: FilterExpression;
2658
+ })[];
2387
2659
  query: string;
2388
- fuzziness?: number;
2660
+ fuzziness?: FuzzinessExpression;
2661
+ highlight?: HighlightExpression;
2389
2662
  };
2390
2663
  declare type SearchBranchVariables = {
2391
2664
  body: SearchBranchRequestBody;
@@ -2422,6 +2695,10 @@ declare const operationsByTag: {
2422
2695
  getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2423
2696
  createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2424
2697
  deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
2698
+ getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
2699
+ addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2700
+ removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
2701
+ resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
2425
2702
  };
2426
2703
  branch: {
2427
2704
  getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
@@ -2456,6 +2733,7 @@ declare const operationsByTag: {
2456
2733
  getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2457
2734
  bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2458
2735
  queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2736
+ searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2459
2737
  searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
2460
2738
  };
2461
2739
  };
@@ -2472,6 +2750,9 @@ interface XataApiClientOptions {
2472
2750
  apiKey?: string;
2473
2751
  host?: HostProvider;
2474
2752
  }
2753
+ /**
2754
+ * @deprecated Use XataApiPlugin instead
2755
+ */
2475
2756
  declare class XataApiClient {
2476
2757
  #private;
2477
2758
  constructor(options?: XataApiClientOptions);
@@ -2514,6 +2795,10 @@ declare class DatabaseApi {
2514
2795
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2515
2796
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2516
2797
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
2798
+ getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2799
+ addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2800
+ removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
2801
+ resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<ResolveBranchResponse>;
2517
2802
  }
2518
2803
  declare class BranchApi {
2519
2804
  private extraProps;
@@ -2554,6 +2839,7 @@ declare class RecordsApi {
2554
2839
  getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2555
2840
  bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
2556
2841
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2842
+ searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2557
2843
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
2558
2844
  }
2559
2845
 
@@ -2575,30 +2861,31 @@ declare type RequiredBy<T, K extends keyof T> = T & {
2575
2861
  };
2576
2862
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2577
2863
  declare type SingleOrArray<T> = T | T[];
2578
- declare type Dictionary<T> = Record<string, T>;
2864
+ declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
2579
2865
 
2580
2866
  declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2581
2867
  declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2582
2868
  [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
2583
2869
  }>>;
2584
- declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends XataRecord ? (V extends SelectableColumn<O[K]> ? {
2585
- V: ValueAtColumn<O[K], V>;
2586
- } : never) : O[K]> : never : never;
2870
+ declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<RemoveNullable<O[K]> extends Record<string, any> ? V extends SelectableColumn<RemoveNullable<O[K]>> ? {
2871
+ V: ValueAtColumn<RemoveNullable<O[K]>, V>;
2872
+ } : never : O[K]> : never : never;
2587
2873
  declare type MAX_RECURSION = 5;
2588
2874
  declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
2589
- [K in DataProps<O>]: If<IsArray<NonNullable<O[K]>>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
2590
- If<IsObject<NonNullable<O[K]>>, NonNullable<O[K]> extends XataRecord ? SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]> extends string ? K | `${K}.${SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]>}` : never : `${K}.${StringKeys<NonNullable<O[K]>> | '*'}`, // This allows usage of objects that are not links
2875
+ [K in DataProps<O>]: If<IsArray<RemoveNullable<O[K]>>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
2876
+ If<IsObject<RemoveNullable<O[K]>>, RemoveNullable<O[K]> extends XataRecord ? SelectableColumn<RemoveNullable<O[K]>, [...RecursivePath, O[K]]> extends string ? K | `${K}.${SelectableColumn<RemoveNullable<O[K]>, [...RecursivePath, O[K]]>}` : never : `${K}.${StringKeys<RemoveNullable<O[K]>> | '*'}`, // This allows usage of objects that are not links
2591
2877
  K>>;
2592
2878
  }>, never>;
2593
2879
  declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
2594
2880
  declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
2595
- [K in N]: M extends SelectableColumn<NonNullable<O[K]>> ? NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], NestedValueAtColumn<NonNullable<O[K]>, M> & XataRecord> : ForwardNullable<O[K], NestedValueAtColumn<NonNullable<O[K]>, M>> : unknown;
2881
+ [K in N]: M extends SelectableColumn<RemoveNullable<O[K]>> ? RemoveNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], NestedValueAtColumn<RemoveNullable<O[K]>, M> & XataRecord> : ForwardNullable<O[K], NestedValueAtColumn<RemoveNullable<O[K]>, M>> : unknown;
2596
2882
  } : unknown : Key extends DataProps<O> ? {
2597
- [K in Key]: NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], SelectedPick<NonNullable<O[K]>, ['*']>> : O[K];
2883
+ [K in Key]: RemoveNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], SelectedPick<RemoveNullable<O[K]>, ['*']>> : O[K];
2598
2884
  } : Key extends '*' ? {
2599
- [K in StringKeys<O>]: NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], Link<NonNullable<O[K]>>> : O[K];
2885
+ [K in StringKeys<O>]: RemoveNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], Link<RemoveNullable<O[K]>>> : O[K];
2600
2886
  } : unknown;
2601
- declare type ForwardNullable<T, R> = T extends NonNullable<T> ? R : R | null;
2887
+ declare type RemoveNullable<T> = T extends null | undefined ? never : T;
2888
+ declare type ForwardNullable<T, R> = T extends RemoveNullable<T> ? R : R | null;
2602
2889
 
2603
2890
  /**
2604
2891
  * Represents an identifiable record from the database.
@@ -2739,8 +3026,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
2739
3026
  ],
2740
3027
  }
2741
3028
  */
2742
- declare type AggregatorFilter<Record> = {
2743
- [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<Record>>;
3029
+ declare type AggregatorFilter<T> = {
3030
+ [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
2744
3031
  };
2745
3032
  /**
2746
3033
  * Existance filter
@@ -2755,10 +3042,10 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
2755
3042
  * Injects the Api filters on nested properties
2756
3043
  * Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
2757
3044
  */
2758
- declare type NestedApiFilter<T> = T extends Record<string, any> ? {
3045
+ declare type NestedApiFilter<T> = {
2759
3046
  [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
2760
- } : PropertyFilter<T>;
2761
- declare type Filter<Record> = BaseApiFilter<Record> | NestedApiFilter<Record>;
3047
+ };
3048
+ declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
2762
3049
 
2763
3050
  declare type SortDirection = 'asc' | 'desc';
2764
3051
  declare type SortFilterExtended<T extends XataRecord> = {
@@ -2770,12 +3057,21 @@ declare type SortFilterBase<T extends XataRecord> = {
2770
3057
  [Key in StringKeys<T>]: SortDirection;
2771
3058
  };
2772
3059
 
2773
- declare type QueryOptions<T extends XataRecord> = {
2774
- page?: PaginationOptions;
3060
+ declare type BaseOptions<T extends XataRecord> = {
2775
3061
  columns?: NonEmptyArray<SelectableColumn<T>>;
3062
+ cache?: number;
3063
+ };
3064
+ declare type CursorQueryOptions = {
3065
+ pagination?: CursorNavigationOptions & OffsetNavigationOptions;
3066
+ filter?: never;
3067
+ sort?: never;
3068
+ };
3069
+ declare type OffsetQueryOptions<T extends XataRecord> = {
3070
+ pagination?: OffsetNavigationOptions;
2776
3071
  filter?: FilterExpression;
2777
3072
  sort?: SortFilter<T> | SortFilter<T>[];
2778
3073
  };
3074
+ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
2779
3075
  /**
2780
3076
  * Query objects contain the information of all filters, sorting, etc. to be included in the database query.
2781
3077
  *
@@ -2786,8 +3082,9 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
2786
3082
  #private;
2787
3083
  readonly meta: PaginationQueryMeta;
2788
3084
  readonly records: Result[];
2789
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, parent?: Partial<QueryOptions<Record>>);
3085
+ constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
2790
3086
  getQueryOptions(): QueryOptions<Record>;
3087
+ key(): string;
2791
3088
  /**
2792
3089
  * Builds a new query object representing a logical OR between the given subqueries.
2793
3090
  * @param queries An array of subqueries.
@@ -2817,18 +3114,28 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
2817
3114
  *
2818
3115
  * ```
2819
3116
  * query.filter("columnName", columnValue)
2820
- * query.filter({
2821
- * "columnName": columnValue
2822
- * })
3117
+ * query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
3118
+ * ```
3119
+ *
3120
+ * @param column The name of the column to filter.
3121
+ * @param value The value to filter.
3122
+ * @returns A new Query object.
3123
+ */
3124
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
3125
+ /**
3126
+ * Builds a new query object adding one or more constraints. Examples:
3127
+ *
3128
+ * ```
3129
+ * query.filter({ "columnName": columnValue })
2823
3130
  * query.filter({
2824
3131
  * "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
2825
3132
  * })
2826
3133
  * ```
2827
3134
  *
3135
+ * @param filters A filter object
2828
3136
  * @returns A new Query object.
2829
3137
  */
2830
3138
  filter(filters: Filter<Record>): Query<Record, Result>;
2831
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
2832
3139
  /**
2833
3140
  * Builds a new query with a new sort option.
2834
3141
  * @param column The column name.
@@ -2842,42 +3149,148 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
2842
3149
  * @returns A new Query object.
2843
3150
  */
2844
3151
  select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
3152
+ /**
3153
+ * Get paginated results
3154
+ *
3155
+ * @returns A page of results
3156
+ */
2845
3157
  getPaginated(): Promise<Page<Record, Result>>;
2846
- getPaginated(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
3158
+ /**
3159
+ * Get paginated results
3160
+ *
3161
+ * @param options Pagination options
3162
+ * @returns A page of results
3163
+ */
3164
+ getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
3165
+ /**
3166
+ * Get paginated results
3167
+ *
3168
+ * @param options Pagination options
3169
+ * @returns A page of results
3170
+ */
2847
3171
  getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
3172
+ /**
3173
+ * Get results in an iterator
3174
+ *
3175
+ * @async
3176
+ * @returns Async interable of results
3177
+ */
2848
3178
  [Symbol.asyncIterator](): AsyncIterableIterator<Result>;
2849
- getIterator(chunk: number): AsyncGenerator<Result[]>;
2850
- getIterator(chunk: number, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): AsyncGenerator<Result[]>;
2851
- getIterator<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number, options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
3179
+ /**
3180
+ * Build an iterator of results
3181
+ *
3182
+ * @returns Async generator of results array
3183
+ */
3184
+ getIterator(): AsyncGenerator<Result[]>;
3185
+ /**
3186
+ * Build an iterator of results
3187
+ *
3188
+ * @param options Pagination options with batchSize
3189
+ * @returns Async generator of results array
3190
+ */
3191
+ getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
3192
+ batchSize?: number;
3193
+ }): AsyncGenerator<Result[]>;
3194
+ /**
3195
+ * Build an iterator of results
3196
+ *
3197
+ * @param options Pagination options with batchSize
3198
+ * @returns Async generator of results array
3199
+ */
3200
+ getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
3201
+ batchSize?: number;
3202
+ }>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
2852
3203
  /**
2853
3204
  * Performs the query in the database and returns a set of results.
2854
- * @param options Additional options to be used when performing the query.
2855
3205
  * @returns An array of records from the database.
2856
3206
  */
2857
3207
  getMany(): Promise<Result[]>;
2858
- getMany(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
3208
+ /**
3209
+ * Performs the query in the database and returns a set of results.
3210
+ * @param options Additional options to be used when performing the query.
3211
+ * @returns An array of records from the database.
3212
+ */
3213
+ getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
3214
+ /**
3215
+ * Performs the query in the database and returns a set of results.
3216
+ * @param options Additional options to be used when performing the query.
3217
+ * @returns An array of records from the database.
3218
+ */
2859
3219
  getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3220
+ /**
3221
+ * Performs the query in the database and returns all the results.
3222
+ * Warning: If there are a large number of results, this method can have performance implications.
3223
+ * @returns An array of records from the database.
3224
+ */
3225
+ getAll(): Promise<Result[]>;
3226
+ /**
3227
+ * Performs the query in the database and returns all the results.
3228
+ * Warning: If there are a large number of results, this method can have performance implications.
3229
+ * @param options Additional options to be used when performing the query.
3230
+ * @returns An array of records from the database.
3231
+ */
3232
+ getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
3233
+ batchSize?: number;
3234
+ }): Promise<Result[]>;
2860
3235
  /**
2861
3236
  * Performs the query in the database and returns all the results.
2862
3237
  * Warning: If there are a large number of results, this method can have performance implications.
2863
3238
  * @param options Additional options to be used when performing the query.
2864
3239
  * @returns An array of records from the database.
2865
3240
  */
2866
- getAll(chunk?: number): Promise<Result[]>;
2867
- getAll(chunk: number | undefined, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result[]>;
2868
- getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number | undefined, options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3241
+ getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
3242
+ batchSize?: number;
3243
+ }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3244
+ /**
3245
+ * Performs the query in the database and returns the first result.
3246
+ * @returns The first record that matches the query, or null if no record matched the query.
3247
+ */
3248
+ getFirst(): Promise<Result | null>;
2869
3249
  /**
2870
3250
  * Performs the query in the database and returns the first result.
2871
3251
  * @param options Additional options to be used when performing the query.
2872
3252
  * @returns The first record that matches the query, or null if no record matched the query.
2873
3253
  */
2874
- getOne(): Promise<Result | null>;
2875
- getOne(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
2876
- getOne<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
3254
+ getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
3255
+ /**
3256
+ * Performs the query in the database and returns the first result.
3257
+ * @param options Additional options to be used when performing the query.
3258
+ * @returns The first record that matches the query, or null if no record matched the query.
3259
+ */
3260
+ getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
3261
+ /**
3262
+ * Builds a new query object adding a cache TTL in milliseconds.
3263
+ * @param ttl The cache TTL in milliseconds.
3264
+ * @returns A new Query object.
3265
+ */
3266
+ cache(ttl: number): Query<Record, Result>;
3267
+ /**
3268
+ * Retrieve next page of records
3269
+ *
3270
+ * @returns A new page object.
3271
+ */
2877
3272
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3273
+ /**
3274
+ * Retrieve previous page of records
3275
+ *
3276
+ * @returns A new page object
3277
+ */
2878
3278
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3279
+ /**
3280
+ * Retrieve first page of records
3281
+ *
3282
+ * @returns A new page object
3283
+ */
2879
3284
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3285
+ /**
3286
+ * Retrieve last page of records
3287
+ *
3288
+ * @returns A new page object
3289
+ */
2880
3290
  lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3291
+ /**
3292
+ * @returns Boolean indicating if there is a next page
3293
+ */
2881
3294
  hasNextPage(): boolean;
2882
3295
  }
2883
3296
 
@@ -2957,14 +3370,12 @@ declare type OffsetNavigationOptions = {
2957
3370
  size?: number;
2958
3371
  offset?: number;
2959
3372
  };
2960
- declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
2961
3373
  declare const PAGINATION_MAX_SIZE = 200;
2962
3374
  declare const PAGINATION_DEFAULT_SIZE = 200;
2963
3375
  declare const PAGINATION_MAX_OFFSET = 800;
2964
3376
  declare const PAGINATION_DEFAULT_OFFSET = 0;
3377
+ declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
2965
3378
 
2966
- declare type TableLink = string[];
2967
- declare type LinkDictionary = Dictionary<TableLink[]>;
2968
3379
  /**
2969
3380
  * Common interface for performing operations on a table.
2970
3381
  */
@@ -2989,6 +3400,12 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
2989
3400
  * @returns The persisted record for the given id or null if the record could not be found.
2990
3401
  */
2991
3402
  abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
3403
+ /**
3404
+ * Queries multiple records from the table given their unique id.
3405
+ * @param ids The unique ids array.
3406
+ * @returns The persisted records for the given ids (if a record could not be found it is not returned).
3407
+ */
3408
+ abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
2992
3409
  /**
2993
3410
  * Partially update a single record.
2994
3411
  * @param object An object with its id and the columns to be updated.
@@ -3061,7 +3478,9 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3061
3478
  * @returns The found records.
3062
3479
  */
3063
3480
  abstract search(query: string, options?: {
3064
- fuzziness?: number;
3481
+ fuzziness?: FuzzinessExpression;
3482
+ highlight?: HighlightExpression;
3483
+ filter?: Filter<Record>;
3065
3484
  }): Promise<SelectedPick<Record, ['*']>[]>;
3066
3485
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3067
3486
  }
@@ -3070,23 +3489,25 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
3070
3489
  db: SchemaPluginResult<any>;
3071
3490
  constructor(options: {
3072
3491
  table: string;
3073
- links?: LinkDictionary;
3074
- getFetchProps: () => Promise<FetcherExtraProps>;
3075
3492
  db: SchemaPluginResult<any>;
3493
+ pluginOptions: XataPluginOptions;
3076
3494
  });
3077
3495
  create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3078
3496
  create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3079
3497
  create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3080
3498
  read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
3499
+ read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3081
3500
  update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3082
3501
  update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3083
3502
  update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3084
3503
  createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3085
3504
  createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3086
3505
  createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3087
- delete(recordId: string | Identifiable | Array<string | Identifiable>): Promise<void>;
3506
+ delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
3088
3507
  search(query: string, options?: {
3089
- fuzziness?: number;
3508
+ fuzziness?: FuzzinessExpression;
3509
+ highlight?: HighlightExpression;
3510
+ filter?: Filter<Record>;
3090
3511
  }): Promise<SelectedPick<Record, ['*']>[]>;
3091
3512
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3092
3513
  }
@@ -3166,46 +3587,60 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3166
3587
 
3167
3588
  declare type SchemaDefinition = {
3168
3589
  table: string;
3169
- links?: LinkDictionary;
3170
3590
  };
3171
3591
  declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
3172
3592
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
3593
+ } & {
3594
+ [key: string]: Repository<XataRecord$1>;
3173
3595
  };
3174
3596
  declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3175
3597
  #private;
3176
- private links?;
3177
3598
  private tableNames?;
3178
- constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
3179
- build(options: XataPluginOptions): SchemaPluginResult<Schemas>;
3599
+ constructor(tableNames?: string[] | undefined);
3600
+ build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3180
3601
  }
3181
3602
 
3182
3603
  declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3183
- fuzziness?: number;
3184
- tables?: Tables[];
3604
+ fuzziness?: FuzzinessExpression;
3605
+ highlight?: HighlightExpression;
3606
+ tables?: Array<Tables | Values<{
3607
+ [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
3608
+ table: Model;
3609
+ filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3610
+ };
3611
+ }>>;
3185
3612
  };
3186
3613
  declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3187
3614
  all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3188
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
3615
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
3189
3616
  table: Model;
3190
3617
  record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3191
3618
  };
3192
3619
  }>[]>;
3193
3620
  byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3194
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3621
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3195
3622
  }>;
3196
3623
  };
3197
3624
  declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3198
3625
  #private;
3199
3626
  private db;
3200
- private links;
3201
- constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
3627
+ constructor(db: SchemaPluginResult<Schemas>);
3202
3628
  build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3203
3629
  }
3204
3630
  declare type SearchXataRecord = XataRecord & {
3205
3631
  xata: {
3206
- table: string;
3632
+ table?: string;
3633
+ highlight?: {
3634
+ [key: string]: string[] | {
3635
+ [key: string]: any;
3636
+ };
3637
+ };
3207
3638
  };
3208
3639
  };
3640
+ declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
3641
+ declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
3642
+ table: infer Table;
3643
+ } ? ReturnTable<Table, Tables> : never;
3209
3644
 
3210
3645
  declare type BranchStrategyValue = string | undefined | null;
3211
3646
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
@@ -3217,10 +3652,11 @@ declare type BaseClientOptions = {
3217
3652
  apiKey?: string;
3218
3653
  databaseURL?: string;
3219
3654
  branch?: BranchStrategyOption;
3655
+ cache?: CacheImpl;
3220
3656
  };
3221
3657
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3222
3658
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3223
- new <Schemas extends Record<string, BaseData>>(options?: Partial<BaseClientOptions>, links?: LinkDictionary): Omit<{
3659
+ new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, tables?: string[]): Omit<{
3224
3660
  db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
3225
3661
  search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
3226
3662
  }, keyof Plugins> & {
@@ -3236,7 +3672,7 @@ declare type BranchResolutionOptions = {
3236
3672
  apiKey?: string;
3237
3673
  fetchImpl?: FetchImpl;
3238
3674
  };
3239
- declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string | undefined>;
3675
+ declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
3240
3676
  declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
3241
3677
  declare function getDatabaseURL(): string | undefined;
3242
3678
 
@@ -3247,4 +3683,4 @@ declare class XataError extends Error {
3247
3683
  constructor(message: string, status: number);
3248
3684
  }
3249
3685
 
3250
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, LinkDictionary, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
3686
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };