@xata.io/client 0.0.0-alpha.vebf0406 → 0.0.0-alpha.vec92b09
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/.eslintrc.cjs +1 -2
- package/CHANGELOG.md +136 -0
- package/README.md +271 -1
- package/Usage.md +395 -0
- package/dist/index.cjs +649 -240
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +718 -160
- package/dist/index.mjs +642 -241
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -3
- package/tsconfig.json +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ declare type FetchImpl = (url: string, init?: {
|
|
|
6
6
|
ok: boolean;
|
|
7
7
|
status: number;
|
|
8
8
|
json(): Promise<any>;
|
|
9
|
+
headers?: {
|
|
10
|
+
get(name: string): string | null;
|
|
11
|
+
};
|
|
9
12
|
}>;
|
|
10
13
|
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
|
|
11
14
|
declare type FetcherExtraProps = {
|
|
@@ -19,11 +22,39 @@ declare type ErrorWrapper<TError> = TError | {
|
|
|
19
22
|
payload: string;
|
|
20
23
|
};
|
|
21
24
|
|
|
25
|
+
interface CacheImpl {
|
|
26
|
+
cacheRecords: boolean;
|
|
27
|
+
defaultQueryTTL: number;
|
|
28
|
+
getAll(): Promise<Record<string, unknown>>;
|
|
29
|
+
get: <T>(key: string) => Promise<T | null>;
|
|
30
|
+
set: <T>(key: string, value: T) => Promise<void>;
|
|
31
|
+
delete: (key: string) => Promise<void>;
|
|
32
|
+
clear: () => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
interface SimpleCacheOptions {
|
|
35
|
+
max?: number;
|
|
36
|
+
cacheRecords?: boolean;
|
|
37
|
+
defaultQueryTTL?: number;
|
|
38
|
+
}
|
|
39
|
+
declare class SimpleCache implements CacheImpl {
|
|
40
|
+
#private;
|
|
41
|
+
capacity: number;
|
|
42
|
+
cacheRecords: boolean;
|
|
43
|
+
defaultQueryTTL: number;
|
|
44
|
+
constructor(options?: SimpleCacheOptions);
|
|
45
|
+
getAll(): Promise<Record<string, unknown>>;
|
|
46
|
+
get<T>(key: string): Promise<T | null>;
|
|
47
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
48
|
+
delete(key: string): Promise<void>;
|
|
49
|
+
clear(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
|
|
22
52
|
declare abstract class XataPlugin {
|
|
23
53
|
abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
|
|
24
54
|
}
|
|
25
55
|
declare type XataPluginOptions = {
|
|
26
56
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
|
57
|
+
cache: CacheImpl;
|
|
27
58
|
};
|
|
28
59
|
|
|
29
60
|
/**
|
|
@@ -110,6 +141,12 @@ declare type ListBranchesResponse = {
|
|
|
110
141
|
displayName: string;
|
|
111
142
|
branches: Branch[];
|
|
112
143
|
};
|
|
144
|
+
declare type ListGitBranchesResponse = {
|
|
145
|
+
mapping: {
|
|
146
|
+
gitBranch: string;
|
|
147
|
+
xataBranch: string;
|
|
148
|
+
}[];
|
|
149
|
+
};
|
|
113
150
|
declare type Branch = {
|
|
114
151
|
name: string;
|
|
115
152
|
createdAt: DateTime;
|
|
@@ -158,7 +195,7 @@ declare type Table = {
|
|
|
158
195
|
*/
|
|
159
196
|
declare type Column = {
|
|
160
197
|
name: string;
|
|
161
|
-
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
|
|
198
|
+
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
|
|
162
199
|
link?: {
|
|
163
200
|
table: string;
|
|
164
201
|
};
|
|
@@ -234,6 +271,21 @@ declare type SortExpression = string[] | {
|
|
|
234
271
|
[key: string]: SortOrder;
|
|
235
272
|
}[];
|
|
236
273
|
declare type SortOrder = 'asc' | 'desc';
|
|
274
|
+
/**
|
|
275
|
+
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
|
276
|
+
* distance is the number of one charcter changes needed to make two strings equal. The default is 1, meaning that single
|
|
277
|
+
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
|
278
|
+
* to allow two typos in a word.
|
|
279
|
+
*
|
|
280
|
+
* @default 1
|
|
281
|
+
* @maximum 2
|
|
282
|
+
* @minimum 0
|
|
283
|
+
*/
|
|
284
|
+
declare type FuzzinessExpression = number;
|
|
285
|
+
/**
|
|
286
|
+
* If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
|
|
287
|
+
*/
|
|
288
|
+
declare type PrefixExpression = 'phrase' | 'disabled';
|
|
237
289
|
/**
|
|
238
290
|
* @minProperties 1
|
|
239
291
|
*/
|
|
@@ -247,6 +299,27 @@ declare type FilterExpression = {
|
|
|
247
299
|
} & {
|
|
248
300
|
[key: string]: FilterColumn;
|
|
249
301
|
};
|
|
302
|
+
declare type HighlightExpression = {
|
|
303
|
+
enabled?: boolean;
|
|
304
|
+
encodeHTML?: boolean;
|
|
305
|
+
};
|
|
306
|
+
declare type BoosterExpression = {
|
|
307
|
+
valueBooster?: {
|
|
308
|
+
column: string;
|
|
309
|
+
value: string | number | boolean;
|
|
310
|
+
factor: number;
|
|
311
|
+
};
|
|
312
|
+
numericBooster?: {
|
|
313
|
+
column: string;
|
|
314
|
+
factor: number;
|
|
315
|
+
};
|
|
316
|
+
dateBooster?: {
|
|
317
|
+
column: string;
|
|
318
|
+
origin?: string;
|
|
319
|
+
scale: string;
|
|
320
|
+
decay: number;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
250
323
|
declare type FilterList = FilterExpression | FilterExpression[];
|
|
251
324
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
|
252
325
|
/**
|
|
@@ -332,6 +405,12 @@ declare type XataRecord$1 = {
|
|
|
332
405
|
xata: {
|
|
333
406
|
version: number;
|
|
334
407
|
table?: string;
|
|
408
|
+
highlight?: {
|
|
409
|
+
[key: string]: string[] | {
|
|
410
|
+
[key: string]: any;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
score?: number;
|
|
335
414
|
warnings?: string[];
|
|
336
415
|
};
|
|
337
416
|
} & {
|
|
@@ -354,6 +433,7 @@ type schemas_WorkspaceMembers = WorkspaceMembers;
|
|
|
354
433
|
type schemas_InviteKey = InviteKey;
|
|
355
434
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
|
356
435
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
|
436
|
+
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
|
357
437
|
type schemas_Branch = Branch;
|
|
358
438
|
type schemas_BranchMetadata = BranchMetadata;
|
|
359
439
|
type schemas_DBBranch = DBBranch;
|
|
@@ -374,7 +454,11 @@ type schemas_TableMigration = TableMigration;
|
|
|
374
454
|
type schemas_ColumnMigration = ColumnMigration;
|
|
375
455
|
type schemas_SortExpression = SortExpression;
|
|
376
456
|
type schemas_SortOrder = SortOrder;
|
|
457
|
+
type schemas_FuzzinessExpression = FuzzinessExpression;
|
|
458
|
+
type schemas_PrefixExpression = PrefixExpression;
|
|
377
459
|
type schemas_FilterExpression = FilterExpression;
|
|
460
|
+
type schemas_HighlightExpression = HighlightExpression;
|
|
461
|
+
type schemas_BoosterExpression = BoosterExpression;
|
|
378
462
|
type schemas_FilterList = FilterList;
|
|
379
463
|
type schemas_FilterColumn = FilterColumn;
|
|
380
464
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
|
@@ -406,6 +490,7 @@ declare namespace schemas {
|
|
|
406
490
|
schemas_InviteKey as InviteKey,
|
|
407
491
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
|
408
492
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
|
493
|
+
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
|
409
494
|
schemas_Branch as Branch,
|
|
410
495
|
schemas_BranchMetadata as BranchMetadata,
|
|
411
496
|
schemas_DBBranch as DBBranch,
|
|
@@ -426,7 +511,11 @@ declare namespace schemas {
|
|
|
426
511
|
schemas_ColumnMigration as ColumnMigration,
|
|
427
512
|
schemas_SortExpression as SortExpression,
|
|
428
513
|
schemas_SortOrder as SortOrder,
|
|
514
|
+
schemas_FuzzinessExpression as FuzzinessExpression,
|
|
515
|
+
schemas_PrefixExpression as PrefixExpression,
|
|
429
516
|
schemas_FilterExpression as FilterExpression,
|
|
517
|
+
schemas_HighlightExpression as HighlightExpression,
|
|
518
|
+
schemas_BoosterExpression as BoosterExpression,
|
|
430
519
|
schemas_FilterList as FilterList,
|
|
431
520
|
schemas_FilterColumn as FilterColumn,
|
|
432
521
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
|
@@ -982,6 +1071,163 @@ declare type DeleteDatabaseVariables = {
|
|
|
982
1071
|
* Delete a database and all of its branches and tables permanently.
|
|
983
1072
|
*/
|
|
984
1073
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
1074
|
+
declare type GetGitBranchesMappingPathParams = {
|
|
1075
|
+
dbName: DBName;
|
|
1076
|
+
workspace: string;
|
|
1077
|
+
};
|
|
1078
|
+
declare type GetGitBranchesMappingError = ErrorWrapper<{
|
|
1079
|
+
status: 400;
|
|
1080
|
+
payload: BadRequestError;
|
|
1081
|
+
} | {
|
|
1082
|
+
status: 401;
|
|
1083
|
+
payload: AuthError;
|
|
1084
|
+
}>;
|
|
1085
|
+
declare type GetGitBranchesMappingVariables = {
|
|
1086
|
+
pathParams: GetGitBranchesMappingPathParams;
|
|
1087
|
+
} & FetcherExtraProps;
|
|
1088
|
+
/**
|
|
1089
|
+
* Lists all the git branches in the mapping, and their associated Xata branches.
|
|
1090
|
+
*
|
|
1091
|
+
* Example response:
|
|
1092
|
+
*
|
|
1093
|
+
* ```json
|
|
1094
|
+
* {
|
|
1095
|
+
* "mappings": [
|
|
1096
|
+
* {
|
|
1097
|
+
* "gitBranch": "main",
|
|
1098
|
+
* "xataBranch": "main"
|
|
1099
|
+
* },
|
|
1100
|
+
* {
|
|
1101
|
+
* "gitBranch": "gitBranch1",
|
|
1102
|
+
* "xataBranch": "xataBranch1"
|
|
1103
|
+
* }
|
|
1104
|
+
* {
|
|
1105
|
+
* "gitBranch": "xataBranch2",
|
|
1106
|
+
* "xataBranch": "xataBranch2"
|
|
1107
|
+
* }
|
|
1108
|
+
* ]
|
|
1109
|
+
* }
|
|
1110
|
+
* ```
|
|
1111
|
+
*/
|
|
1112
|
+
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
|
1113
|
+
declare type AddGitBranchesEntryPathParams = {
|
|
1114
|
+
dbName: DBName;
|
|
1115
|
+
workspace: string;
|
|
1116
|
+
};
|
|
1117
|
+
declare type AddGitBranchesEntryError = ErrorWrapper<{
|
|
1118
|
+
status: 400;
|
|
1119
|
+
payload: BadRequestError;
|
|
1120
|
+
} | {
|
|
1121
|
+
status: 401;
|
|
1122
|
+
payload: AuthError;
|
|
1123
|
+
}>;
|
|
1124
|
+
declare type AddGitBranchesEntryResponse = {
|
|
1125
|
+
warning?: string;
|
|
1126
|
+
};
|
|
1127
|
+
declare type AddGitBranchesEntryRequestBody = {
|
|
1128
|
+
gitBranch: string;
|
|
1129
|
+
xataBranch: BranchName;
|
|
1130
|
+
};
|
|
1131
|
+
declare type AddGitBranchesEntryVariables = {
|
|
1132
|
+
body: AddGitBranchesEntryRequestBody;
|
|
1133
|
+
pathParams: AddGitBranchesEntryPathParams;
|
|
1134
|
+
} & FetcherExtraProps;
|
|
1135
|
+
/**
|
|
1136
|
+
* 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.
|
|
1137
|
+
*
|
|
1138
|
+
* 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.
|
|
1139
|
+
*
|
|
1140
|
+
* Example request:
|
|
1141
|
+
*
|
|
1142
|
+
* ```json
|
|
1143
|
+
* // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
|
|
1144
|
+
* {
|
|
1145
|
+
* "gitBranch": "fix/bug123",
|
|
1146
|
+
* "xataBranch": "fix_bug"
|
|
1147
|
+
* }
|
|
1148
|
+
* ```
|
|
1149
|
+
*/
|
|
1150
|
+
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
|
1151
|
+
declare type RemoveGitBranchesEntryPathParams = {
|
|
1152
|
+
dbName: DBName;
|
|
1153
|
+
workspace: string;
|
|
1154
|
+
};
|
|
1155
|
+
declare type RemoveGitBranchesEntryQueryParams = {
|
|
1156
|
+
gitBranch: string;
|
|
1157
|
+
};
|
|
1158
|
+
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
|
1159
|
+
status: 400;
|
|
1160
|
+
payload: BadRequestError;
|
|
1161
|
+
} | {
|
|
1162
|
+
status: 401;
|
|
1163
|
+
payload: AuthError;
|
|
1164
|
+
}>;
|
|
1165
|
+
declare type RemoveGitBranchesEntryVariables = {
|
|
1166
|
+
pathParams: RemoveGitBranchesEntryPathParams;
|
|
1167
|
+
queryParams: RemoveGitBranchesEntryQueryParams;
|
|
1168
|
+
} & FetcherExtraProps;
|
|
1169
|
+
/**
|
|
1170
|
+
* 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.
|
|
1171
|
+
*
|
|
1172
|
+
* Example request:
|
|
1173
|
+
*
|
|
1174
|
+
* ```json
|
|
1175
|
+
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
|
1176
|
+
* ```
|
|
1177
|
+
*/
|
|
1178
|
+
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
|
1179
|
+
declare type ResolveBranchPathParams = {
|
|
1180
|
+
dbName: DBName;
|
|
1181
|
+
workspace: string;
|
|
1182
|
+
};
|
|
1183
|
+
declare type ResolveBranchQueryParams = {
|
|
1184
|
+
gitBranch?: string;
|
|
1185
|
+
fallbackBranch?: string;
|
|
1186
|
+
};
|
|
1187
|
+
declare type ResolveBranchError = ErrorWrapper<{
|
|
1188
|
+
status: 400;
|
|
1189
|
+
payload: BadRequestError;
|
|
1190
|
+
} | {
|
|
1191
|
+
status: 401;
|
|
1192
|
+
payload: AuthError;
|
|
1193
|
+
}>;
|
|
1194
|
+
declare type ResolveBranchResponse = {
|
|
1195
|
+
branch: string;
|
|
1196
|
+
reason: {
|
|
1197
|
+
code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
|
|
1198
|
+
message: string;
|
|
1199
|
+
};
|
|
1200
|
+
};
|
|
1201
|
+
declare type ResolveBranchVariables = {
|
|
1202
|
+
pathParams: ResolveBranchPathParams;
|
|
1203
|
+
queryParams?: ResolveBranchQueryParams;
|
|
1204
|
+
} & FetcherExtraProps;
|
|
1205
|
+
/**
|
|
1206
|
+
* In order to resolve the database branch, the following algorithm is used:
|
|
1207
|
+
* * 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
|
|
1208
|
+
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
|
1209
|
+
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
|
1210
|
+
* * else, return the default branch of the DB (`main` or the first branch)
|
|
1211
|
+
*
|
|
1212
|
+
* Example call:
|
|
1213
|
+
*
|
|
1214
|
+
* ```json
|
|
1215
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
|
1216
|
+
* ```
|
|
1217
|
+
*
|
|
1218
|
+
* Example response:
|
|
1219
|
+
*
|
|
1220
|
+
* ```json
|
|
1221
|
+
* {
|
|
1222
|
+
* "branch": "main",
|
|
1223
|
+
* "reason": {
|
|
1224
|
+
* "code": "DEFAULT_BRANCH",
|
|
1225
|
+
* "message": "Default branch for this database (main)"
|
|
1226
|
+
* }
|
|
1227
|
+
* }
|
|
1228
|
+
* ```
|
|
1229
|
+
*/
|
|
1230
|
+
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
|
985
1231
|
declare type GetBranchDetailsPathParams = {
|
|
986
1232
|
dbBranchName: DBBranchName;
|
|
987
1233
|
workspace: string;
|
|
@@ -1266,8 +1512,9 @@ declare type UpdateTableVariables = {
|
|
|
1266
1512
|
*
|
|
1267
1513
|
* In the example below, we rename a table from “users” to “people”:
|
|
1268
1514
|
*
|
|
1269
|
-
* ```
|
|
1270
|
-
* PATCH /db/test:main/tables/users
|
|
1515
|
+
* ```json
|
|
1516
|
+
* // PATCH /db/test:main/tables/users
|
|
1517
|
+
*
|
|
1271
1518
|
* {
|
|
1272
1519
|
* "name": "people"
|
|
1273
1520
|
* }
|
|
@@ -1675,7 +1922,7 @@ declare type QueryTableVariables = {
|
|
|
1675
1922
|
* {
|
|
1676
1923
|
* "columns": [...],
|
|
1677
1924
|
* "filter": {
|
|
1678
|
-
* "$all": [...]
|
|
1925
|
+
* "$all": [...],
|
|
1679
1926
|
* "$any": [...]
|
|
1680
1927
|
* ...
|
|
1681
1928
|
* },
|
|
@@ -1721,7 +1968,11 @@ declare type QueryTableVariables = {
|
|
|
1721
1968
|
* "link": {
|
|
1722
1969
|
* "table": "users"
|
|
1723
1970
|
* }
|
|
1724
|
-
* }
|
|
1971
|
+
* },
|
|
1972
|
+
* {
|
|
1973
|
+
* "name": "foundedDate",
|
|
1974
|
+
* "type": "datetime"
|
|
1975
|
+
* },
|
|
1725
1976
|
* ]
|
|
1726
1977
|
* },
|
|
1727
1978
|
* {
|
|
@@ -1809,7 +2060,7 @@ declare type QueryTableVariables = {
|
|
|
1809
2060
|
* {
|
|
1810
2061
|
* "name": "Kilian",
|
|
1811
2062
|
* "address": {
|
|
1812
|
-
* "street": "New street"
|
|
2063
|
+
* "street": "New street"
|
|
1813
2064
|
* }
|
|
1814
2065
|
* }
|
|
1815
2066
|
* ```
|
|
@@ -1818,10 +2069,7 @@ declare type QueryTableVariables = {
|
|
|
1818
2069
|
*
|
|
1819
2070
|
* ```json
|
|
1820
2071
|
* {
|
|
1821
|
-
* "columns": [
|
|
1822
|
-
* "*",
|
|
1823
|
-
* "team.name"
|
|
1824
|
-
* ]
|
|
2072
|
+
* "columns": ["*", "team.name"]
|
|
1825
2073
|
* }
|
|
1826
2074
|
* ```
|
|
1827
2075
|
*
|
|
@@ -1839,7 +2087,7 @@ declare type QueryTableVariables = {
|
|
|
1839
2087
|
* "team": {
|
|
1840
2088
|
* "id": "XX",
|
|
1841
2089
|
* "xata": {
|
|
1842
|
-
* "version": 0
|
|
2090
|
+
* "version": 0
|
|
1843
2091
|
* },
|
|
1844
2092
|
* "name": "first team"
|
|
1845
2093
|
* }
|
|
@@ -1850,10 +2098,7 @@ declare type QueryTableVariables = {
|
|
|
1850
2098
|
*
|
|
1851
2099
|
* ```json
|
|
1852
2100
|
* {
|
|
1853
|
-
* "columns": [
|
|
1854
|
-
* "*",
|
|
1855
|
-
* "team.*"
|
|
1856
|
-
* ]
|
|
2101
|
+
* "columns": ["*", "team.*"]
|
|
1857
2102
|
* }
|
|
1858
2103
|
* ```
|
|
1859
2104
|
*
|
|
@@ -1871,10 +2116,11 @@ declare type QueryTableVariables = {
|
|
|
1871
2116
|
* "team": {
|
|
1872
2117
|
* "id": "XX",
|
|
1873
2118
|
* "xata": {
|
|
1874
|
-
* "version": 0
|
|
2119
|
+
* "version": 0
|
|
1875
2120
|
* },
|
|
1876
2121
|
* "name": "first team",
|
|
1877
|
-
* "code": "A1"
|
|
2122
|
+
* "code": "A1",
|
|
2123
|
+
* "foundedDate": "2020-03-04T10:43:54.32Z"
|
|
1878
2124
|
* }
|
|
1879
2125
|
* }
|
|
1880
2126
|
* ```
|
|
@@ -1889,7 +2135,7 @@ declare type QueryTableVariables = {
|
|
|
1889
2135
|
* `$none`, etc.
|
|
1890
2136
|
*
|
|
1891
2137
|
* All operators start with an `$` to differentiate them from column names
|
|
1892
|
-
* (which are not allowed to start with
|
|
2138
|
+
* (which are not allowed to start with a dollar sign).
|
|
1893
2139
|
*
|
|
1894
2140
|
* #### Exact matching and control operators
|
|
1895
2141
|
*
|
|
@@ -1920,7 +2166,7 @@ declare type QueryTableVariables = {
|
|
|
1920
2166
|
* ```json
|
|
1921
2167
|
* {
|
|
1922
2168
|
* "filter": {
|
|
1923
|
-
*
|
|
2169
|
+
* "name": "r2"
|
|
1924
2170
|
* }
|
|
1925
2171
|
* }
|
|
1926
2172
|
* ```
|
|
@@ -1942,7 +2188,7 @@ declare type QueryTableVariables = {
|
|
|
1942
2188
|
* ```json
|
|
1943
2189
|
* {
|
|
1944
2190
|
* "filter": {
|
|
1945
|
-
*
|
|
2191
|
+
* "settings.plan": "free"
|
|
1946
2192
|
* }
|
|
1947
2193
|
* }
|
|
1948
2194
|
* ```
|
|
@@ -1952,8 +2198,8 @@ declare type QueryTableVariables = {
|
|
|
1952
2198
|
* "filter": {
|
|
1953
2199
|
* "settings": {
|
|
1954
2200
|
* "plan": "free"
|
|
1955
|
-
* }
|
|
1956
|
-
* }
|
|
2201
|
+
* }
|
|
2202
|
+
* }
|
|
1957
2203
|
* }
|
|
1958
2204
|
* ```
|
|
1959
2205
|
*
|
|
@@ -1962,8 +2208,8 @@ declare type QueryTableVariables = {
|
|
|
1962
2208
|
* ```json
|
|
1963
2209
|
* {
|
|
1964
2210
|
* "filter": {
|
|
1965
|
-
* "settings.plan": {"$any": ["free", "paid"]}
|
|
1966
|
-
* }
|
|
2211
|
+
* "settings.plan": { "$any": ["free", "paid"] }
|
|
2212
|
+
* }
|
|
1967
2213
|
* }
|
|
1968
2214
|
* ```
|
|
1969
2215
|
*
|
|
@@ -1972,9 +2218,9 @@ declare type QueryTableVariables = {
|
|
|
1972
2218
|
* ```json
|
|
1973
2219
|
* {
|
|
1974
2220
|
* "filter": {
|
|
1975
|
-
*
|
|
1976
|
-
*
|
|
1977
|
-
* }
|
|
2221
|
+
* "settings.dark": true,
|
|
2222
|
+
* "settings.plan": "free"
|
|
2223
|
+
* }
|
|
1978
2224
|
* }
|
|
1979
2225
|
* ```
|
|
1980
2226
|
*
|
|
@@ -1985,11 +2231,11 @@ declare type QueryTableVariables = {
|
|
|
1985
2231
|
* ```json
|
|
1986
2232
|
* {
|
|
1987
2233
|
* "filter": {
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
*
|
|
1991
|
-
*
|
|
1992
|
-
* }
|
|
2234
|
+
* "$any": {
|
|
2235
|
+
* "settings.dark": true,
|
|
2236
|
+
* "settings.plan": "free"
|
|
2237
|
+
* }
|
|
2238
|
+
* }
|
|
1993
2239
|
* }
|
|
1994
2240
|
* ```
|
|
1995
2241
|
*
|
|
@@ -2000,10 +2246,10 @@ declare type QueryTableVariables = {
|
|
|
2000
2246
|
* "filter": {
|
|
2001
2247
|
* "$any": [
|
|
2002
2248
|
* {
|
|
2003
|
-
* "name": "r1"
|
|
2249
|
+
* "name": "r1"
|
|
2004
2250
|
* },
|
|
2005
2251
|
* {
|
|
2006
|
-
* "name": "r2"
|
|
2252
|
+
* "name": "r2"
|
|
2007
2253
|
* }
|
|
2008
2254
|
* ]
|
|
2009
2255
|
* }
|
|
@@ -2015,7 +2261,7 @@ declare type QueryTableVariables = {
|
|
|
2015
2261
|
* ```json
|
|
2016
2262
|
* {
|
|
2017
2263
|
* "filter": {
|
|
2018
|
-
* "$exists": "settings"
|
|
2264
|
+
* "$exists": "settings"
|
|
2019
2265
|
* }
|
|
2020
2266
|
* }
|
|
2021
2267
|
* ```
|
|
@@ -2027,10 +2273,10 @@ declare type QueryTableVariables = {
|
|
|
2027
2273
|
* "filter": {
|
|
2028
2274
|
* "$all": [
|
|
2029
2275
|
* {
|
|
2030
|
-
* "$exists": "settings"
|
|
2276
|
+
* "$exists": "settings"
|
|
2031
2277
|
* },
|
|
2032
2278
|
* {
|
|
2033
|
-
* "$exists": "name"
|
|
2279
|
+
* "$exists": "name"
|
|
2034
2280
|
* }
|
|
2035
2281
|
* ]
|
|
2036
2282
|
* }
|
|
@@ -2042,7 +2288,7 @@ declare type QueryTableVariables = {
|
|
|
2042
2288
|
* ```json
|
|
2043
2289
|
* {
|
|
2044
2290
|
* "filter": {
|
|
2045
|
-
* "$notExists": "settings"
|
|
2291
|
+
* "$notExists": "settings"
|
|
2046
2292
|
* }
|
|
2047
2293
|
* }
|
|
2048
2294
|
* ```
|
|
@@ -2069,43 +2315,59 @@ declare type QueryTableVariables = {
|
|
|
2069
2315
|
* {
|
|
2070
2316
|
* "filter": {
|
|
2071
2317
|
* "<column_name>": {
|
|
2072
|
-
*
|
|
2318
|
+
* "$pattern": "v*alu?"
|
|
2073
2319
|
* }
|
|
2074
2320
|
* }
|
|
2075
2321
|
* }
|
|
2076
2322
|
* ```
|
|
2077
2323
|
*
|
|
2324
|
+
* The `$pattern` operator accepts two wildcard characters:
|
|
2325
|
+
* * `*` matches zero or more characters
|
|
2326
|
+
* * `?` matches exactly one character
|
|
2327
|
+
*
|
|
2328
|
+
* 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.
|
|
2329
|
+
*
|
|
2078
2330
|
* We could also have `$endsWith` and `$startsWith` operators:
|
|
2079
2331
|
*
|
|
2080
2332
|
* ```json
|
|
2081
2333
|
* {
|
|
2082
2334
|
* "filter": {
|
|
2083
2335
|
* "<column_name>": {
|
|
2084
|
-
*
|
|
2336
|
+
* "$endsWith": ".gz"
|
|
2085
2337
|
* },
|
|
2086
2338
|
* "<column_name>": {
|
|
2087
|
-
*
|
|
2339
|
+
* "$startsWith": "tmp-"
|
|
2088
2340
|
* }
|
|
2089
2341
|
* }
|
|
2090
2342
|
* }
|
|
2091
2343
|
* ```
|
|
2092
2344
|
*
|
|
2093
|
-
* #### Numeric ranges
|
|
2345
|
+
* #### Numeric or datetime ranges
|
|
2094
2346
|
*
|
|
2095
2347
|
* ```json
|
|
2096
2348
|
* {
|
|
2097
2349
|
* "filter": {
|
|
2098
|
-
*
|
|
2099
|
-
*
|
|
2100
|
-
*
|
|
2101
|
-
*
|
|
2350
|
+
* "<column_name>": {
|
|
2351
|
+
* "$ge": 0,
|
|
2352
|
+
* "$lt": 100
|
|
2353
|
+
* }
|
|
2354
|
+
* }
|
|
2355
|
+
* }
|
|
2356
|
+
* ```
|
|
2357
|
+
* Date ranges support the same operators, with the date using the format defined in
|
|
2358
|
+
* [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
|
|
2359
|
+
* ```json
|
|
2360
|
+
* {
|
|
2361
|
+
* "filter": {
|
|
2362
|
+
* "<column_name>": {
|
|
2363
|
+
* "$gt": "2019-10-12T07:20:50.52Z",
|
|
2364
|
+
* "$lt": "2021-10-12T07:20:50.52Z"
|
|
2365
|
+
* }
|
|
2102
2366
|
* }
|
|
2103
2367
|
* }
|
|
2104
2368
|
* ```
|
|
2105
|
-
*
|
|
2106
2369
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
|
2107
2370
|
*
|
|
2108
|
-
*
|
|
2109
2371
|
* #### Negations
|
|
2110
2372
|
*
|
|
2111
2373
|
* A general `$not` operator can inverse any operation.
|
|
@@ -2130,15 +2392,21 @@ declare type QueryTableVariables = {
|
|
|
2130
2392
|
* {
|
|
2131
2393
|
* "filter": {
|
|
2132
2394
|
* "$not": {
|
|
2133
|
-
* "$any": [
|
|
2134
|
-
*
|
|
2135
|
-
*
|
|
2136
|
-
*
|
|
2137
|
-
*
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2141
|
-
*
|
|
2395
|
+
* "$any": [
|
|
2396
|
+
* {
|
|
2397
|
+
* "<column_name1>": "value1"
|
|
2398
|
+
* },
|
|
2399
|
+
* {
|
|
2400
|
+
* "$all": [
|
|
2401
|
+
* {
|
|
2402
|
+
* "<column_name2>": "value2"
|
|
2403
|
+
* },
|
|
2404
|
+
* {
|
|
2405
|
+
* "<column_name3>": "value3"
|
|
2406
|
+
* }
|
|
2407
|
+
* ]
|
|
2408
|
+
* }
|
|
2409
|
+
* ]
|
|
2142
2410
|
* }
|
|
2143
2411
|
* }
|
|
2144
2412
|
* }
|
|
@@ -2193,8 +2461,8 @@ declare type QueryTableVariables = {
|
|
|
2193
2461
|
* "<array name>": {
|
|
2194
2462
|
* "$includes": {
|
|
2195
2463
|
* "$all": [
|
|
2196
|
-
* {"$contains": "label"},
|
|
2197
|
-
* {"$not": {"$endsWith": "-debug"}}
|
|
2464
|
+
* { "$contains": "label" },
|
|
2465
|
+
* { "$not": { "$endsWith": "-debug" } }
|
|
2198
2466
|
* ]
|
|
2199
2467
|
* }
|
|
2200
2468
|
* }
|
|
@@ -2214,9 +2482,7 @@ declare type QueryTableVariables = {
|
|
|
2214
2482
|
* {
|
|
2215
2483
|
* "filter": {
|
|
2216
2484
|
* "settings.labels": {
|
|
2217
|
-
* "$includesAll": [
|
|
2218
|
-
* {"$contains": "label"},
|
|
2219
|
-
* ]
|
|
2485
|
+
* "$includesAll": [{ "$contains": "label" }]
|
|
2220
2486
|
* }
|
|
2221
2487
|
* }
|
|
2222
2488
|
* }
|
|
@@ -2264,7 +2530,6 @@ declare type QueryTableVariables = {
|
|
|
2264
2530
|
* }
|
|
2265
2531
|
* ```
|
|
2266
2532
|
*
|
|
2267
|
-
*
|
|
2268
2533
|
* ### Pagination
|
|
2269
2534
|
*
|
|
2270
2535
|
* We offer cursor pagination and offset pagination. The offset pagination is limited
|
|
@@ -2330,8 +2595,8 @@ declare type QueryTableVariables = {
|
|
|
2330
2595
|
* can be queried by update `page.after` to the returned cursor while keeping the
|
|
2331
2596
|
* `page.before` cursor from the first range query.
|
|
2332
2597
|
*
|
|
2333
|
-
* The `filter` , `columns`,
|
|
2334
|
-
* encoded with the cursor.
|
|
2598
|
+
* The `filter` , `columns`, `sort` , and `page.size` configuration will be
|
|
2599
|
+
* encoded with the cursor. The pagination request will be invalid if
|
|
2335
2600
|
* `filter` or `sort` is set. The columns returned and page size can be changed
|
|
2336
2601
|
* anytime by passing the `columns` or `page.size` settings to the next query.
|
|
2337
2602
|
*
|
|
@@ -2368,6 +2633,41 @@ declare type QueryTableVariables = {
|
|
|
2368
2633
|
* ```
|
|
2369
2634
|
*/
|
|
2370
2635
|
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
2636
|
+
declare type SearchTablePathParams = {
|
|
2637
|
+
dbBranchName: DBBranchName;
|
|
2638
|
+
tableName: TableName;
|
|
2639
|
+
workspace: string;
|
|
2640
|
+
};
|
|
2641
|
+
declare type SearchTableError = ErrorWrapper<{
|
|
2642
|
+
status: 400;
|
|
2643
|
+
payload: BadRequestError;
|
|
2644
|
+
} | {
|
|
2645
|
+
status: 401;
|
|
2646
|
+
payload: AuthError;
|
|
2647
|
+
} | {
|
|
2648
|
+
status: 404;
|
|
2649
|
+
payload: SimpleError;
|
|
2650
|
+
}>;
|
|
2651
|
+
declare type SearchTableRequestBody = {
|
|
2652
|
+
query: string;
|
|
2653
|
+
fuzziness?: FuzzinessExpression;
|
|
2654
|
+
prefix?: PrefixExpression;
|
|
2655
|
+
filter?: FilterExpression;
|
|
2656
|
+
highlight?: HighlightExpression;
|
|
2657
|
+
boosters?: BoosterExpression[];
|
|
2658
|
+
};
|
|
2659
|
+
declare type SearchTableVariables = {
|
|
2660
|
+
body: SearchTableRequestBody;
|
|
2661
|
+
pathParams: SearchTablePathParams;
|
|
2662
|
+
} & FetcherExtraProps;
|
|
2663
|
+
/**
|
|
2664
|
+
* Run a free text search operation in a particular table.
|
|
2665
|
+
*
|
|
2666
|
+
* 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:
|
|
2667
|
+
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
|
2668
|
+
* * filtering on columns of type `multiple` is currently unsupported
|
|
2669
|
+
*/
|
|
2670
|
+
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
2371
2671
|
declare type SearchBranchPathParams = {
|
|
2372
2672
|
dbBranchName: DBBranchName;
|
|
2373
2673
|
workspace: string;
|
|
@@ -2383,9 +2683,14 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
|
2383
2683
|
payload: SimpleError;
|
|
2384
2684
|
}>;
|
|
2385
2685
|
declare type SearchBranchRequestBody = {
|
|
2386
|
-
tables?: string
|
|
2686
|
+
tables?: (string | {
|
|
2687
|
+
table: string;
|
|
2688
|
+
filter?: FilterExpression;
|
|
2689
|
+
boosters?: BoosterExpression[];
|
|
2690
|
+
})[];
|
|
2387
2691
|
query: string;
|
|
2388
|
-
fuzziness?:
|
|
2692
|
+
fuzziness?: FuzzinessExpression;
|
|
2693
|
+
highlight?: HighlightExpression;
|
|
2389
2694
|
};
|
|
2390
2695
|
declare type SearchBranchVariables = {
|
|
2391
2696
|
body: SearchBranchRequestBody;
|
|
@@ -2422,6 +2727,10 @@ declare const operationsByTag: {
|
|
|
2422
2727
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
|
2423
2728
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
|
2424
2729
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
2730
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
|
2731
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
|
2732
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
|
2733
|
+
resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
|
2425
2734
|
};
|
|
2426
2735
|
branch: {
|
|
2427
2736
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
|
@@ -2456,6 +2765,7 @@ declare const operationsByTag: {
|
|
|
2456
2765
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
|
2457
2766
|
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
|
|
2458
2767
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
2768
|
+
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
2459
2769
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
|
2460
2770
|
};
|
|
2461
2771
|
};
|
|
@@ -2472,6 +2782,9 @@ interface XataApiClientOptions {
|
|
|
2472
2782
|
apiKey?: string;
|
|
2473
2783
|
host?: HostProvider;
|
|
2474
2784
|
}
|
|
2785
|
+
/**
|
|
2786
|
+
* @deprecated Use XataApiPlugin instead
|
|
2787
|
+
*/
|
|
2475
2788
|
declare class XataApiClient {
|
|
2476
2789
|
#private;
|
|
2477
2790
|
constructor(options?: XataApiClientOptions);
|
|
@@ -2514,6 +2827,10 @@ declare class DatabaseApi {
|
|
|
2514
2827
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
|
2515
2828
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
|
2516
2829
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
|
2830
|
+
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
|
2831
|
+
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
|
2832
|
+
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
|
2833
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
|
2517
2834
|
}
|
|
2518
2835
|
declare class BranchApi {
|
|
2519
2836
|
private extraProps;
|
|
@@ -2554,6 +2871,7 @@ declare class RecordsApi {
|
|
|
2554
2871
|
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
|
|
2555
2872
|
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
|
|
2556
2873
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
|
2874
|
+
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
|
2557
2875
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
|
2558
2876
|
}
|
|
2559
2877
|
|
|
@@ -2575,20 +2893,24 @@ declare type RequiredBy<T, K extends keyof T> = T & {
|
|
|
2575
2893
|
};
|
|
2576
2894
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
|
2577
2895
|
declare type SingleOrArray<T> = T | T[];
|
|
2578
|
-
declare type
|
|
2896
|
+
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
|
2897
|
+
declare type Without<T, U> = {
|
|
2898
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
|
2899
|
+
};
|
|
2900
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
|
2579
2901
|
|
|
2580
2902
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
|
2581
2903
|
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
|
2582
2904
|
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
|
|
2583
2905
|
}>>;
|
|
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
|
|
2585
|
-
V: ValueAtColumn<
|
|
2586
|
-
} : never
|
|
2906
|
+
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
|
|
2907
|
+
V: ValueAtColumn<Item, V>;
|
|
2908
|
+
} : never : O[K] : never> : never : never;
|
|
2587
2909
|
declare type MAX_RECURSION = 5;
|
|
2588
2910
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
|
2589
|
-
[K in DataProps<O>]:
|
|
2590
|
-
If<IsObject<
|
|
2591
|
-
K
|
|
2911
|
+
[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
|
|
2912
|
+
If<IsObject<Item>, Item extends XataRecord ? SelectableColumn<Item, [...RecursivePath, Item]> extends infer Column ? Column extends string ? K | `${K}.${Column}` : never : never : Item extends Date ? K : `${K}.${StringKeys<Item> | '*'}`, // This allows usage of objects that are not links
|
|
2913
|
+
K>> : never;
|
|
2592
2914
|
}>, never>;
|
|
2593
2915
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
|
2594
2916
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
|
@@ -2615,16 +2937,11 @@ interface BaseData {
|
|
|
2615
2937
|
/**
|
|
2616
2938
|
* Represents a persisted record from the database.
|
|
2617
2939
|
*/
|
|
2618
|
-
interface XataRecord extends Identifiable {
|
|
2940
|
+
interface XataRecord<ExtraMetadata extends Record<string, unknown> = Record<string, unknown>> extends Identifiable {
|
|
2619
2941
|
/**
|
|
2620
|
-
*
|
|
2942
|
+
* Get metadata of this record.
|
|
2621
2943
|
*/
|
|
2622
|
-
|
|
2623
|
-
/**
|
|
2624
|
-
* Number that is increased every time the record is updated.
|
|
2625
|
-
*/
|
|
2626
|
-
version: number;
|
|
2627
|
-
};
|
|
2944
|
+
getMetadata(): XataRecordMetadata & ExtraMetadata;
|
|
2628
2945
|
/**
|
|
2629
2946
|
* Retrieves a refreshed copy of the current record from the database.
|
|
2630
2947
|
*/
|
|
@@ -2632,7 +2949,7 @@ interface XataRecord extends Identifiable {
|
|
|
2632
2949
|
/**
|
|
2633
2950
|
* Performs a partial update of the current record. On success a new object is
|
|
2634
2951
|
* returned and the current object is not mutated.
|
|
2635
|
-
* @param
|
|
2952
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
2636
2953
|
* @returns A new record containing the latest values for all the columns of the current record.
|
|
2637
2954
|
*/
|
|
2638
2955
|
update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
|
|
@@ -2651,19 +2968,26 @@ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update
|
|
|
2651
2968
|
/**
|
|
2652
2969
|
* Performs a partial update of the current record. On success a new object is
|
|
2653
2970
|
* returned and the current object is not mutated.
|
|
2654
|
-
* @param
|
|
2971
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
2655
2972
|
* @returns A new record containing the latest values for all the columns of the current record.
|
|
2656
2973
|
*/
|
|
2657
2974
|
update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
2658
2975
|
};
|
|
2976
|
+
declare type XataRecordMetadata = {
|
|
2977
|
+
/**
|
|
2978
|
+
* Number that is increased every time the record is updated.
|
|
2979
|
+
*/
|
|
2980
|
+
version: number;
|
|
2981
|
+
warnings?: string[];
|
|
2982
|
+
};
|
|
2659
2983
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
|
2660
2984
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
|
2661
2985
|
declare type EditableData<O extends BaseData> = {
|
|
2662
2986
|
[K in keyof O]: O[K] extends XataRecord ? {
|
|
2663
2987
|
id: string;
|
|
2664
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
|
2988
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
|
2665
2989
|
id: string;
|
|
2666
|
-
} | null | undefined : O[K];
|
|
2990
|
+
} | string | null | undefined : O[K];
|
|
2667
2991
|
};
|
|
2668
2992
|
|
|
2669
2993
|
/**
|
|
@@ -2739,8 +3063,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
|
2739
3063
|
],
|
|
2740
3064
|
}
|
|
2741
3065
|
*/
|
|
2742
|
-
declare type AggregatorFilter<
|
|
2743
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
|
3066
|
+
declare type AggregatorFilter<T> = {
|
|
3067
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
|
2744
3068
|
};
|
|
2745
3069
|
/**
|
|
2746
3070
|
* Existance filter
|
|
@@ -2755,10 +3079,86 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
|
2755
3079
|
* Injects the Api filters on nested properties
|
|
2756
3080
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
|
2757
3081
|
*/
|
|
2758
|
-
declare type NestedApiFilter<T> =
|
|
3082
|
+
declare type NestedApiFilter<T> = {
|
|
2759
3083
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
|
2760
|
-
}
|
|
2761
|
-
declare type Filter<
|
|
3084
|
+
};
|
|
3085
|
+
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
|
3086
|
+
|
|
3087
|
+
declare type DateBooster = {
|
|
3088
|
+
origin?: string;
|
|
3089
|
+
scale: string;
|
|
3090
|
+
decay: number;
|
|
3091
|
+
};
|
|
3092
|
+
declare type NumericBooster = {
|
|
3093
|
+
factor: number;
|
|
3094
|
+
};
|
|
3095
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
|
3096
|
+
value: T;
|
|
3097
|
+
factor: number;
|
|
3098
|
+
};
|
|
3099
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
|
3100
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
|
3101
|
+
dateBooster: {
|
|
3102
|
+
column: K;
|
|
3103
|
+
} & DateBooster;
|
|
3104
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
|
3105
|
+
numericBooster?: {
|
|
3106
|
+
column: K;
|
|
3107
|
+
} & NumericBooster;
|
|
3108
|
+
}, {
|
|
3109
|
+
valueBooster?: {
|
|
3110
|
+
column: K;
|
|
3111
|
+
} & ValueBooster<number>;
|
|
3112
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
|
3113
|
+
valueBooster: {
|
|
3114
|
+
column: K;
|
|
3115
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
|
3116
|
+
} : never;
|
|
3117
|
+
}>;
|
|
3118
|
+
|
|
3119
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
|
3120
|
+
fuzziness?: FuzzinessExpression;
|
|
3121
|
+
prefix?: PrefixExpression;
|
|
3122
|
+
highlight?: HighlightExpression;
|
|
3123
|
+
tables?: Array<Tables | Values<{
|
|
3124
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
|
3125
|
+
table: Model;
|
|
3126
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
|
3127
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
|
3128
|
+
};
|
|
3129
|
+
}>>;
|
|
3130
|
+
};
|
|
3131
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3132
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
|
3133
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
|
3134
|
+
table: Model;
|
|
3135
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
|
3136
|
+
};
|
|
3137
|
+
}>[]>;
|
|
3138
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
|
3139
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
|
3140
|
+
}>;
|
|
3141
|
+
};
|
|
3142
|
+
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
|
3143
|
+
#private;
|
|
3144
|
+
private db;
|
|
3145
|
+
constructor(db: SchemaPluginResult<Schemas>);
|
|
3146
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
|
3147
|
+
}
|
|
3148
|
+
declare type SearchXataRecord<T extends XataRecord> = Omit<T, 'getMetadata'> & XataRecord<SearchExtraProperties>;
|
|
3149
|
+
declare type SearchExtraProperties = {
|
|
3150
|
+
table: string;
|
|
3151
|
+
highlight?: {
|
|
3152
|
+
[key: string]: string[] | {
|
|
3153
|
+
[key: string]: any;
|
|
3154
|
+
};
|
|
3155
|
+
};
|
|
3156
|
+
score?: number;
|
|
3157
|
+
};
|
|
3158
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
|
3159
|
+
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 {
|
|
3160
|
+
table: infer Table;
|
|
3161
|
+
} ? ReturnTable<Table, Tables> : never;
|
|
2762
3162
|
|
|
2763
3163
|
declare type SortDirection = 'asc' | 'desc';
|
|
2764
3164
|
declare type SortFilterExtended<T extends XataRecord> = {
|
|
@@ -2770,12 +3170,21 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
|
2770
3170
|
[Key in StringKeys<T>]: SortDirection;
|
|
2771
3171
|
};
|
|
2772
3172
|
|
|
2773
|
-
declare type
|
|
2774
|
-
page?: PaginationOptions;
|
|
3173
|
+
declare type BaseOptions<T extends XataRecord> = {
|
|
2775
3174
|
columns?: NonEmptyArray<SelectableColumn<T>>;
|
|
3175
|
+
cache?: number;
|
|
3176
|
+
};
|
|
3177
|
+
declare type CursorQueryOptions = {
|
|
3178
|
+
pagination?: CursorNavigationOptions & OffsetNavigationOptions;
|
|
3179
|
+
filter?: never;
|
|
3180
|
+
sort?: never;
|
|
3181
|
+
};
|
|
3182
|
+
declare type OffsetQueryOptions<T extends XataRecord> = {
|
|
3183
|
+
pagination?: OffsetNavigationOptions;
|
|
2776
3184
|
filter?: FilterExpression;
|
|
2777
3185
|
sort?: SortFilter<T> | SortFilter<T>[];
|
|
2778
3186
|
};
|
|
3187
|
+
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
|
2779
3188
|
/**
|
|
2780
3189
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
|
2781
3190
|
*
|
|
@@ -2785,9 +3194,10 @@ declare type QueryOptions<T extends XataRecord> = {
|
|
|
2785
3194
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
|
2786
3195
|
#private;
|
|
2787
3196
|
readonly meta: PaginationQueryMeta;
|
|
2788
|
-
readonly records: Result
|
|
2789
|
-
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>,
|
|
3197
|
+
readonly records: RecordArray<Result>;
|
|
3198
|
+
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
|
2790
3199
|
getQueryOptions(): QueryOptions<Record>;
|
|
3200
|
+
key(): string;
|
|
2791
3201
|
/**
|
|
2792
3202
|
* Builds a new query object representing a logical OR between the given subqueries.
|
|
2793
3203
|
* @param queries An array of subqueries.
|
|
@@ -2817,18 +3227,28 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
2817
3227
|
*
|
|
2818
3228
|
* ```
|
|
2819
3229
|
* query.filter("columnName", columnValue)
|
|
2820
|
-
* query.filter(
|
|
2821
|
-
*
|
|
2822
|
-
*
|
|
3230
|
+
* query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
|
|
3231
|
+
* ```
|
|
3232
|
+
*
|
|
3233
|
+
* @param column The name of the column to filter.
|
|
3234
|
+
* @param value The value to filter.
|
|
3235
|
+
* @returns A new Query object.
|
|
3236
|
+
*/
|
|
3237
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
|
3238
|
+
/**
|
|
3239
|
+
* Builds a new query object adding one or more constraints. Examples:
|
|
3240
|
+
*
|
|
3241
|
+
* ```
|
|
3242
|
+
* query.filter({ "columnName": columnValue })
|
|
2823
3243
|
* query.filter({
|
|
2824
3244
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
|
2825
3245
|
* })
|
|
2826
3246
|
* ```
|
|
2827
3247
|
*
|
|
3248
|
+
* @param filters A filter object
|
|
2828
3249
|
* @returns A new Query object.
|
|
2829
3250
|
*/
|
|
2830
3251
|
filter(filters: Filter<Record>): Query<Record, Result>;
|
|
2831
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
|
2832
3252
|
/**
|
|
2833
3253
|
* Builds a new query with a new sort option.
|
|
2834
3254
|
* @param column The column name.
|
|
@@ -2842,42 +3262,148 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
2842
3262
|
* @returns A new Query object.
|
|
2843
3263
|
*/
|
|
2844
3264
|
select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
|
|
3265
|
+
/**
|
|
3266
|
+
* Get paginated results
|
|
3267
|
+
*
|
|
3268
|
+
* @returns A page of results
|
|
3269
|
+
*/
|
|
2845
3270
|
getPaginated(): Promise<Page<Record, Result>>;
|
|
2846
|
-
|
|
3271
|
+
/**
|
|
3272
|
+
* Get paginated results
|
|
3273
|
+
*
|
|
3274
|
+
* @param options Pagination options
|
|
3275
|
+
* @returns A page of results
|
|
3276
|
+
*/
|
|
3277
|
+
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
|
3278
|
+
/**
|
|
3279
|
+
* Get paginated results
|
|
3280
|
+
*
|
|
3281
|
+
* @param options Pagination options
|
|
3282
|
+
* @returns A page of results
|
|
3283
|
+
*/
|
|
2847
3284
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
|
3285
|
+
/**
|
|
3286
|
+
* Get results in an iterator
|
|
3287
|
+
*
|
|
3288
|
+
* @async
|
|
3289
|
+
* @returns Async interable of results
|
|
3290
|
+
*/
|
|
2848
3291
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
3292
|
+
/**
|
|
3293
|
+
* Build an iterator of results
|
|
3294
|
+
*
|
|
3295
|
+
* @returns Async generator of results array
|
|
3296
|
+
*/
|
|
3297
|
+
getIterator(): AsyncGenerator<Result[]>;
|
|
3298
|
+
/**
|
|
3299
|
+
* Build an iterator of results
|
|
3300
|
+
*
|
|
3301
|
+
* @param options Pagination options with batchSize
|
|
3302
|
+
* @returns Async generator of results array
|
|
3303
|
+
*/
|
|
3304
|
+
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
3305
|
+
batchSize?: number;
|
|
3306
|
+
}): AsyncGenerator<Result[]>;
|
|
3307
|
+
/**
|
|
3308
|
+
* Build an iterator of results
|
|
3309
|
+
*
|
|
3310
|
+
* @param options Pagination options with batchSize
|
|
3311
|
+
* @returns Async generator of results array
|
|
3312
|
+
*/
|
|
3313
|
+
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3314
|
+
batchSize?: number;
|
|
3315
|
+
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
|
3316
|
+
/**
|
|
3317
|
+
* Performs the query in the database and returns a set of results.
|
|
3318
|
+
* @returns An array of records from the database.
|
|
3319
|
+
*/
|
|
3320
|
+
getMany(): Promise<RecordArray<Result>>;
|
|
2852
3321
|
/**
|
|
2853
3322
|
* Performs the query in the database and returns a set of results.
|
|
2854
3323
|
* @param options Additional options to be used when performing the query.
|
|
2855
3324
|
* @returns An array of records from the database.
|
|
2856
3325
|
*/
|
|
2857
|
-
getMany(): Promise<Result
|
|
2858
|
-
|
|
2859
|
-
|
|
3326
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
|
3327
|
+
/**
|
|
3328
|
+
* Performs the query in the database and returns a set of results.
|
|
3329
|
+
* @param options Additional options to be used when performing the query.
|
|
3330
|
+
* @returns An array of records from the database.
|
|
3331
|
+
*/
|
|
3332
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
|
3333
|
+
/**
|
|
3334
|
+
* Performs the query in the database and returns all the results.
|
|
3335
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3336
|
+
* @returns An array of records from the database.
|
|
3337
|
+
*/
|
|
3338
|
+
getAll(): Promise<Result[]>;
|
|
3339
|
+
/**
|
|
3340
|
+
* Performs the query in the database and returns all the results.
|
|
3341
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3342
|
+
* @param options Additional options to be used when performing the query.
|
|
3343
|
+
* @returns An array of records from the database.
|
|
3344
|
+
*/
|
|
3345
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
3346
|
+
batchSize?: number;
|
|
3347
|
+
}): Promise<Result[]>;
|
|
2860
3348
|
/**
|
|
2861
3349
|
* Performs the query in the database and returns all the results.
|
|
2862
3350
|
* Warning: If there are a large number of results, this method can have performance implications.
|
|
2863
3351
|
* @param options Additional options to be used when performing the query.
|
|
2864
3352
|
* @returns An array of records from the database.
|
|
2865
3353
|
*/
|
|
2866
|
-
getAll
|
|
2867
|
-
|
|
2868
|
-
|
|
3354
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3355
|
+
batchSize?: number;
|
|
3356
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
|
3357
|
+
/**
|
|
3358
|
+
* Performs the query in the database and returns the first result.
|
|
3359
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3360
|
+
*/
|
|
3361
|
+
getFirst(): Promise<Result | null>;
|
|
2869
3362
|
/**
|
|
2870
3363
|
* Performs the query in the database and returns the first result.
|
|
2871
3364
|
* @param options Additional options to be used when performing the query.
|
|
2872
3365
|
* @returns The first record that matches the query, or null if no record matched the query.
|
|
2873
3366
|
*/
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
3367
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
|
3368
|
+
/**
|
|
3369
|
+
* Performs the query in the database and returns the first result.
|
|
3370
|
+
* @param options Additional options to be used when performing the query.
|
|
3371
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3372
|
+
*/
|
|
3373
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
|
3374
|
+
/**
|
|
3375
|
+
* Builds a new query object adding a cache TTL in milliseconds.
|
|
3376
|
+
* @param ttl The cache TTL in milliseconds.
|
|
3377
|
+
* @returns A new Query object.
|
|
3378
|
+
*/
|
|
3379
|
+
cache(ttl: number): Query<Record, Result>;
|
|
3380
|
+
/**
|
|
3381
|
+
* Retrieve next page of records
|
|
3382
|
+
*
|
|
3383
|
+
* @returns A new page object.
|
|
3384
|
+
*/
|
|
2877
3385
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3386
|
+
/**
|
|
3387
|
+
* Retrieve previous page of records
|
|
3388
|
+
*
|
|
3389
|
+
* @returns A new page object
|
|
3390
|
+
*/
|
|
2878
3391
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3392
|
+
/**
|
|
3393
|
+
* Retrieve first page of records
|
|
3394
|
+
*
|
|
3395
|
+
* @returns A new page object
|
|
3396
|
+
*/
|
|
2879
3397
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3398
|
+
/**
|
|
3399
|
+
* Retrieve last page of records
|
|
3400
|
+
*
|
|
3401
|
+
* @returns A new page object
|
|
3402
|
+
*/
|
|
2880
3403
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3404
|
+
/**
|
|
3405
|
+
* @returns Boolean indicating if there is a next page
|
|
3406
|
+
*/
|
|
2881
3407
|
hasNextPage(): boolean;
|
|
2882
3408
|
}
|
|
2883
3409
|
|
|
@@ -2889,7 +3415,7 @@ declare type PaginationQueryMeta = {
|
|
|
2889
3415
|
};
|
|
2890
3416
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
|
2891
3417
|
meta: PaginationQueryMeta;
|
|
2892
|
-
records: Result
|
|
3418
|
+
records: RecordArray<Result>;
|
|
2893
3419
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
2894
3420
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
2895
3421
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
@@ -2909,7 +3435,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
|
2909
3435
|
/**
|
|
2910
3436
|
* The set of results for this page.
|
|
2911
3437
|
*/
|
|
2912
|
-
readonly records: Result
|
|
3438
|
+
readonly records: RecordArray<Result>;
|
|
2913
3439
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
|
2914
3440
|
/**
|
|
2915
3441
|
* Retrieves the next page of results.
|
|
@@ -2957,14 +3483,45 @@ declare type OffsetNavigationOptions = {
|
|
|
2957
3483
|
size?: number;
|
|
2958
3484
|
offset?: number;
|
|
2959
3485
|
};
|
|
2960
|
-
declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
|
|
2961
3486
|
declare const PAGINATION_MAX_SIZE = 200;
|
|
2962
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
|
3487
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
|
2963
3488
|
declare const PAGINATION_MAX_OFFSET = 800;
|
|
2964
3489
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
|
3490
|
+
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
|
3491
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3492
|
+
#private;
|
|
3493
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
|
3494
|
+
static parseConstructorParams(...args: any[]): any[];
|
|
3495
|
+
/**
|
|
3496
|
+
* Retrieve next page of records
|
|
3497
|
+
*
|
|
3498
|
+
* @returns A new array of objects
|
|
3499
|
+
*/
|
|
3500
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3501
|
+
/**
|
|
3502
|
+
* Retrieve previous page of records
|
|
3503
|
+
*
|
|
3504
|
+
* @returns A new array of objects
|
|
3505
|
+
*/
|
|
3506
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3507
|
+
/**
|
|
3508
|
+
* Retrieve first page of records
|
|
3509
|
+
*
|
|
3510
|
+
* @returns A new array of objects
|
|
3511
|
+
*/
|
|
3512
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3513
|
+
/**
|
|
3514
|
+
* Retrieve last page of records
|
|
3515
|
+
*
|
|
3516
|
+
* @returns A new array of objects
|
|
3517
|
+
*/
|
|
3518
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3519
|
+
/**
|
|
3520
|
+
* @returns Boolean indicating if there is a next page
|
|
3521
|
+
*/
|
|
3522
|
+
hasNextPage(): boolean;
|
|
3523
|
+
}
|
|
2965
3524
|
|
|
2966
|
-
declare type TableLink = string[];
|
|
2967
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
|
2968
3525
|
/**
|
|
2969
3526
|
* Common interface for performing operations on a table.
|
|
2970
3527
|
*/
|
|
@@ -2989,6 +3546,24 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
2989
3546
|
* @returns The persisted record for the given id or null if the record could not be found.
|
|
2990
3547
|
*/
|
|
2991
3548
|
abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
3549
|
+
/**
|
|
3550
|
+
* Queries multiple records from the table given their unique id.
|
|
3551
|
+
* @param ids The unique ids array.
|
|
3552
|
+
* @returns The persisted records for the given ids (if a record could not be found it is not returned).
|
|
3553
|
+
*/
|
|
3554
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3555
|
+
/**
|
|
3556
|
+
* Queries a single record from the table by the id in the object.
|
|
3557
|
+
* @param object Object containing the id of the record.
|
|
3558
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
3559
|
+
*/
|
|
3560
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
3561
|
+
/**
|
|
3562
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
3563
|
+
* @param objects Array of objects containing the ids of the records.
|
|
3564
|
+
* @returns The persisted records for the given ids (if a record could not be found it is not returned).
|
|
3565
|
+
*/
|
|
3566
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
2992
3567
|
/**
|
|
2993
3568
|
* Partially update a single record.
|
|
2994
3569
|
* @param object An object with its id and the columns to be updated.
|
|
@@ -3061,8 +3636,12 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3061
3636
|
* @returns The found records.
|
|
3062
3637
|
*/
|
|
3063
3638
|
abstract search(query: string, options?: {
|
|
3064
|
-
fuzziness?:
|
|
3065
|
-
|
|
3639
|
+
fuzziness?: FuzzinessExpression;
|
|
3640
|
+
prefix?: PrefixExpression;
|
|
3641
|
+
highlight?: HighlightExpression;
|
|
3642
|
+
filter?: Filter<Record>;
|
|
3643
|
+
boosters?: Boosters<Record>[];
|
|
3644
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
|
3066
3645
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3067
3646
|
}
|
|
3068
3647
|
declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
|
|
@@ -3070,24 +3649,30 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
|
3070
3649
|
db: SchemaPluginResult<any>;
|
|
3071
3650
|
constructor(options: {
|
|
3072
3651
|
table: string;
|
|
3073
|
-
links?: LinkDictionary;
|
|
3074
|
-
getFetchProps: () => Promise<FetcherExtraProps>;
|
|
3075
3652
|
db: SchemaPluginResult<any>;
|
|
3653
|
+
pluginOptions: XataPluginOptions;
|
|
3076
3654
|
});
|
|
3077
3655
|
create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
|
3078
3656
|
create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
|
3079
3657
|
create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
|
|
3080
3658
|
read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
|
|
3659
|
+
read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3660
|
+
read(object: Identifiable): Promise<SelectedPick<Record, ['*']> | null>;
|
|
3661
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3081
3662
|
update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
|
|
3082
3663
|
update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
|
|
3083
3664
|
update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
|
|
3084
3665
|
createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
|
3085
3666
|
createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
|
3086
3667
|
createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
|
|
3087
|
-
delete(
|
|
3668
|
+
delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
|
|
3088
3669
|
search(query: string, options?: {
|
|
3089
|
-
fuzziness?:
|
|
3090
|
-
|
|
3670
|
+
fuzziness?: FuzzinessExpression;
|
|
3671
|
+
prefix?: PrefixExpression;
|
|
3672
|
+
highlight?: HighlightExpression;
|
|
3673
|
+
filter?: Filter<Record>;
|
|
3674
|
+
boosters?: Boosters<Record>[];
|
|
3675
|
+
}): Promise<any>;
|
|
3091
3676
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3092
3677
|
}
|
|
3093
3678
|
|
|
@@ -3166,47 +3751,19 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
|
3166
3751
|
|
|
3167
3752
|
declare type SchemaDefinition = {
|
|
3168
3753
|
table: string;
|
|
3169
|
-
links?: LinkDictionary;
|
|
3170
3754
|
};
|
|
3171
3755
|
declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3172
3756
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
|
3757
|
+
} & {
|
|
3758
|
+
[key: string]: Repository<XataRecord$1>;
|
|
3173
3759
|
};
|
|
3174
3760
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
|
3175
3761
|
#private;
|
|
3176
|
-
private links?;
|
|
3177
3762
|
private tableNames?;
|
|
3178
|
-
constructor(
|
|
3179
|
-
build(
|
|
3763
|
+
constructor(tableNames?: string[] | undefined);
|
|
3764
|
+
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
|
3180
3765
|
}
|
|
3181
3766
|
|
|
3182
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
|
3183
|
-
fuzziness?: number;
|
|
3184
|
-
tables?: Tables[];
|
|
3185
|
-
};
|
|
3186
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3187
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
|
3188
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
|
|
3189
|
-
table: Model;
|
|
3190
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
|
3191
|
-
};
|
|
3192
|
-
}>[]>;
|
|
3193
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
|
3194
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
|
3195
|
-
}>;
|
|
3196
|
-
};
|
|
3197
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
|
3198
|
-
#private;
|
|
3199
|
-
private db;
|
|
3200
|
-
private links;
|
|
3201
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
|
3202
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
|
3203
|
-
}
|
|
3204
|
-
declare type SearchXataRecord = XataRecord & {
|
|
3205
|
-
xata: {
|
|
3206
|
-
table: string;
|
|
3207
|
-
};
|
|
3208
|
-
};
|
|
3209
|
-
|
|
3210
3767
|
declare type BranchStrategyValue = string | undefined | null;
|
|
3211
3768
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
|
3212
3769
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
|
@@ -3217,10 +3774,11 @@ declare type BaseClientOptions = {
|
|
|
3217
3774
|
apiKey?: string;
|
|
3218
3775
|
databaseURL?: string;
|
|
3219
3776
|
branch?: BranchStrategyOption;
|
|
3777
|
+
cache?: CacheImpl;
|
|
3220
3778
|
};
|
|
3221
3779
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
|
3222
3780
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
|
3223
|
-
new <Schemas extends Record<string, BaseData
|
|
3781
|
+
new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, tables?: string[]): Omit<{
|
|
3224
3782
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
|
3225
3783
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
|
3226
3784
|
}, keyof Plugins> & {
|
|
@@ -3236,7 +3794,7 @@ declare type BranchResolutionOptions = {
|
|
|
3236
3794
|
apiKey?: string;
|
|
3237
3795
|
fetchImpl?: FetchImpl;
|
|
3238
3796
|
};
|
|
3239
|
-
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string
|
|
3797
|
+
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
|
|
3240
3798
|
declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
|
|
3241
3799
|
declare function getDatabaseURL(): string | undefined;
|
|
3242
3800
|
|
|
@@ -3247,4 +3805,4 @@ declare class XataError extends Error {
|
|
|
3247
3805
|
constructor(message: string, status: number);
|
|
3248
3806
|
}
|
|
3249
3807
|
|
|
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,
|
|
3808
|
+
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, RecordArray, 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, SearchXataRecord, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, 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 };
|