@xata.io/client 0.0.0-alpha.ved00a04 → 0.0.0-alpha.ved669cc
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 +523 -265
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +652 -204
- package/dist/index.mjs +517 -263
- 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 = {
|
|
@@ -138,6 +141,12 @@ declare type ListBranchesResponse = {
|
|
|
138
141
|
displayName: string;
|
|
139
142
|
branches: Branch[];
|
|
140
143
|
};
|
|
144
|
+
declare type ListGitBranchesResponse = {
|
|
145
|
+
mapping: {
|
|
146
|
+
gitBranch: string;
|
|
147
|
+
xataBranch: string;
|
|
148
|
+
}[];
|
|
149
|
+
};
|
|
141
150
|
declare type Branch = {
|
|
142
151
|
name: string;
|
|
143
152
|
createdAt: DateTime;
|
|
@@ -186,7 +195,7 @@ declare type Table = {
|
|
|
186
195
|
*/
|
|
187
196
|
declare type Column = {
|
|
188
197
|
name: string;
|
|
189
|
-
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
|
|
198
|
+
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
|
|
190
199
|
link?: {
|
|
191
200
|
table: string;
|
|
192
201
|
};
|
|
@@ -262,6 +271,21 @@ declare type SortExpression = string[] | {
|
|
|
262
271
|
[key: string]: SortOrder;
|
|
263
272
|
}[];
|
|
264
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';
|
|
265
289
|
/**
|
|
266
290
|
* @minProperties 1
|
|
267
291
|
*/
|
|
@@ -275,6 +299,10 @@ declare type FilterExpression = {
|
|
|
275
299
|
} & {
|
|
276
300
|
[key: string]: FilterColumn;
|
|
277
301
|
};
|
|
302
|
+
declare type HighlightExpression = {
|
|
303
|
+
enabled?: boolean;
|
|
304
|
+
encodeHTML?: boolean;
|
|
305
|
+
};
|
|
278
306
|
declare type FilterList = FilterExpression | FilterExpression[];
|
|
279
307
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
|
280
308
|
/**
|
|
@@ -360,6 +388,11 @@ declare type XataRecord$1 = {
|
|
|
360
388
|
xata: {
|
|
361
389
|
version: number;
|
|
362
390
|
table?: string;
|
|
391
|
+
highlight?: {
|
|
392
|
+
[key: string]: string[] | {
|
|
393
|
+
[key: string]: any;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
363
396
|
warnings?: string[];
|
|
364
397
|
};
|
|
365
398
|
} & {
|
|
@@ -382,6 +415,7 @@ type schemas_WorkspaceMembers = WorkspaceMembers;
|
|
|
382
415
|
type schemas_InviteKey = InviteKey;
|
|
383
416
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
|
384
417
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
|
418
|
+
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
|
385
419
|
type schemas_Branch = Branch;
|
|
386
420
|
type schemas_BranchMetadata = BranchMetadata;
|
|
387
421
|
type schemas_DBBranch = DBBranch;
|
|
@@ -402,7 +436,10 @@ type schemas_TableMigration = TableMigration;
|
|
|
402
436
|
type schemas_ColumnMigration = ColumnMigration;
|
|
403
437
|
type schemas_SortExpression = SortExpression;
|
|
404
438
|
type schemas_SortOrder = SortOrder;
|
|
439
|
+
type schemas_FuzzinessExpression = FuzzinessExpression;
|
|
440
|
+
type schemas_PrefixExpression = PrefixExpression;
|
|
405
441
|
type schemas_FilterExpression = FilterExpression;
|
|
442
|
+
type schemas_HighlightExpression = HighlightExpression;
|
|
406
443
|
type schemas_FilterList = FilterList;
|
|
407
444
|
type schemas_FilterColumn = FilterColumn;
|
|
408
445
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
|
@@ -434,6 +471,7 @@ declare namespace schemas {
|
|
|
434
471
|
schemas_InviteKey as InviteKey,
|
|
435
472
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
|
436
473
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
|
474
|
+
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
|
437
475
|
schemas_Branch as Branch,
|
|
438
476
|
schemas_BranchMetadata as BranchMetadata,
|
|
439
477
|
schemas_DBBranch as DBBranch,
|
|
@@ -454,7 +492,10 @@ declare namespace schemas {
|
|
|
454
492
|
schemas_ColumnMigration as ColumnMigration,
|
|
455
493
|
schemas_SortExpression as SortExpression,
|
|
456
494
|
schemas_SortOrder as SortOrder,
|
|
495
|
+
schemas_FuzzinessExpression as FuzzinessExpression,
|
|
496
|
+
schemas_PrefixExpression as PrefixExpression,
|
|
457
497
|
schemas_FilterExpression as FilterExpression,
|
|
498
|
+
schemas_HighlightExpression as HighlightExpression,
|
|
458
499
|
schemas_FilterList as FilterList,
|
|
459
500
|
schemas_FilterColumn as FilterColumn,
|
|
460
501
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
|
@@ -1010,6 +1051,163 @@ declare type DeleteDatabaseVariables = {
|
|
|
1010
1051
|
* Delete a database and all of its branches and tables permanently.
|
|
1011
1052
|
*/
|
|
1012
1053
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
1054
|
+
declare type GetGitBranchesMappingPathParams = {
|
|
1055
|
+
dbName: DBName;
|
|
1056
|
+
workspace: string;
|
|
1057
|
+
};
|
|
1058
|
+
declare type GetGitBranchesMappingError = ErrorWrapper<{
|
|
1059
|
+
status: 400;
|
|
1060
|
+
payload: BadRequestError;
|
|
1061
|
+
} | {
|
|
1062
|
+
status: 401;
|
|
1063
|
+
payload: AuthError;
|
|
1064
|
+
}>;
|
|
1065
|
+
declare type GetGitBranchesMappingVariables = {
|
|
1066
|
+
pathParams: GetGitBranchesMappingPathParams;
|
|
1067
|
+
} & FetcherExtraProps;
|
|
1068
|
+
/**
|
|
1069
|
+
* Lists all the git branches in the mapping, and their associated Xata branches.
|
|
1070
|
+
*
|
|
1071
|
+
* Example response:
|
|
1072
|
+
*
|
|
1073
|
+
* ```json
|
|
1074
|
+
* {
|
|
1075
|
+
* "mappings": [
|
|
1076
|
+
* {
|
|
1077
|
+
* "gitBranch": "main",
|
|
1078
|
+
* "xataBranch": "main"
|
|
1079
|
+
* },
|
|
1080
|
+
* {
|
|
1081
|
+
* "gitBranch": "gitBranch1",
|
|
1082
|
+
* "xataBranch": "xataBranch1"
|
|
1083
|
+
* }
|
|
1084
|
+
* {
|
|
1085
|
+
* "gitBranch": "xataBranch2",
|
|
1086
|
+
* "xataBranch": "xataBranch2"
|
|
1087
|
+
* }
|
|
1088
|
+
* ]
|
|
1089
|
+
* }
|
|
1090
|
+
* ```
|
|
1091
|
+
*/
|
|
1092
|
+
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
|
1093
|
+
declare type AddGitBranchesEntryPathParams = {
|
|
1094
|
+
dbName: DBName;
|
|
1095
|
+
workspace: string;
|
|
1096
|
+
};
|
|
1097
|
+
declare type AddGitBranchesEntryError = ErrorWrapper<{
|
|
1098
|
+
status: 400;
|
|
1099
|
+
payload: BadRequestError;
|
|
1100
|
+
} | {
|
|
1101
|
+
status: 401;
|
|
1102
|
+
payload: AuthError;
|
|
1103
|
+
}>;
|
|
1104
|
+
declare type AddGitBranchesEntryResponse = {
|
|
1105
|
+
warning?: string;
|
|
1106
|
+
};
|
|
1107
|
+
declare type AddGitBranchesEntryRequestBody = {
|
|
1108
|
+
gitBranch: string;
|
|
1109
|
+
xataBranch: BranchName;
|
|
1110
|
+
};
|
|
1111
|
+
declare type AddGitBranchesEntryVariables = {
|
|
1112
|
+
body: AddGitBranchesEntryRequestBody;
|
|
1113
|
+
pathParams: AddGitBranchesEntryPathParams;
|
|
1114
|
+
} & FetcherExtraProps;
|
|
1115
|
+
/**
|
|
1116
|
+
* 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.
|
|
1117
|
+
*
|
|
1118
|
+
* 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.
|
|
1119
|
+
*
|
|
1120
|
+
* Example request:
|
|
1121
|
+
*
|
|
1122
|
+
* ```json
|
|
1123
|
+
* // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
|
|
1124
|
+
* {
|
|
1125
|
+
* "gitBranch": "fix/bug123",
|
|
1126
|
+
* "xataBranch": "fix_bug"
|
|
1127
|
+
* }
|
|
1128
|
+
* ```
|
|
1129
|
+
*/
|
|
1130
|
+
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
|
1131
|
+
declare type RemoveGitBranchesEntryPathParams = {
|
|
1132
|
+
dbName: DBName;
|
|
1133
|
+
workspace: string;
|
|
1134
|
+
};
|
|
1135
|
+
declare type RemoveGitBranchesEntryQueryParams = {
|
|
1136
|
+
gitBranch: string;
|
|
1137
|
+
};
|
|
1138
|
+
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
|
1139
|
+
status: 400;
|
|
1140
|
+
payload: BadRequestError;
|
|
1141
|
+
} | {
|
|
1142
|
+
status: 401;
|
|
1143
|
+
payload: AuthError;
|
|
1144
|
+
}>;
|
|
1145
|
+
declare type RemoveGitBranchesEntryVariables = {
|
|
1146
|
+
pathParams: RemoveGitBranchesEntryPathParams;
|
|
1147
|
+
queryParams: RemoveGitBranchesEntryQueryParams;
|
|
1148
|
+
} & FetcherExtraProps;
|
|
1149
|
+
/**
|
|
1150
|
+
* 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.
|
|
1151
|
+
*
|
|
1152
|
+
* Example request:
|
|
1153
|
+
*
|
|
1154
|
+
* ```json
|
|
1155
|
+
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
|
1156
|
+
* ```
|
|
1157
|
+
*/
|
|
1158
|
+
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
|
1159
|
+
declare type ResolveBranchPathParams = {
|
|
1160
|
+
dbName: DBName;
|
|
1161
|
+
workspace: string;
|
|
1162
|
+
};
|
|
1163
|
+
declare type ResolveBranchQueryParams = {
|
|
1164
|
+
gitBranch?: string;
|
|
1165
|
+
fallbackBranch?: string;
|
|
1166
|
+
};
|
|
1167
|
+
declare type ResolveBranchError = ErrorWrapper<{
|
|
1168
|
+
status: 400;
|
|
1169
|
+
payload: BadRequestError;
|
|
1170
|
+
} | {
|
|
1171
|
+
status: 401;
|
|
1172
|
+
payload: AuthError;
|
|
1173
|
+
}>;
|
|
1174
|
+
declare type ResolveBranchResponse = {
|
|
1175
|
+
branch: string;
|
|
1176
|
+
reason: {
|
|
1177
|
+
code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
|
|
1178
|
+
message: string;
|
|
1179
|
+
};
|
|
1180
|
+
};
|
|
1181
|
+
declare type ResolveBranchVariables = {
|
|
1182
|
+
pathParams: ResolveBranchPathParams;
|
|
1183
|
+
queryParams?: ResolveBranchQueryParams;
|
|
1184
|
+
} & FetcherExtraProps;
|
|
1185
|
+
/**
|
|
1186
|
+
* In order to resolve the database branch, the following algorithm is used:
|
|
1187
|
+
* * 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
|
|
1188
|
+
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
|
1189
|
+
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
|
1190
|
+
* * else, return the default branch of the DB (`main` or the first branch)
|
|
1191
|
+
*
|
|
1192
|
+
* Example call:
|
|
1193
|
+
*
|
|
1194
|
+
* ```json
|
|
1195
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
|
1196
|
+
* ```
|
|
1197
|
+
*
|
|
1198
|
+
* Example response:
|
|
1199
|
+
*
|
|
1200
|
+
* ```json
|
|
1201
|
+
* {
|
|
1202
|
+
* "branch": "main",
|
|
1203
|
+
* "reason": {
|
|
1204
|
+
* "code": "DEFAULT_BRANCH",
|
|
1205
|
+
* "message": "Default branch for this database (main)"
|
|
1206
|
+
* }
|
|
1207
|
+
* }
|
|
1208
|
+
* ```
|
|
1209
|
+
*/
|
|
1210
|
+
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
|
1013
1211
|
declare type GetBranchDetailsPathParams = {
|
|
1014
1212
|
dbBranchName: DBBranchName;
|
|
1015
1213
|
workspace: string;
|
|
@@ -1191,64 +1389,6 @@ declare type GetBranchMigrationPlanVariables = {
|
|
|
1191
1389
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
|
1192
1390
|
*/
|
|
1193
1391
|
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
|
1194
|
-
declare type CompareBranchSchemaPathParams = {
|
|
1195
|
-
dbBranchName: DBBranchName;
|
|
1196
|
-
branchName: BranchName;
|
|
1197
|
-
workspace: string;
|
|
1198
|
-
};
|
|
1199
|
-
declare type CompareBranchSchemaError = ErrorWrapper<{
|
|
1200
|
-
status: 400;
|
|
1201
|
-
payload: BadRequestError;
|
|
1202
|
-
} | {
|
|
1203
|
-
status: 401;
|
|
1204
|
-
payload: AuthError;
|
|
1205
|
-
} | {
|
|
1206
|
-
status: 404;
|
|
1207
|
-
payload: SimpleError;
|
|
1208
|
-
}>;
|
|
1209
|
-
declare type CompareBranchSchemaVariables = {
|
|
1210
|
-
body?: Record<string, any>;
|
|
1211
|
-
pathParams: CompareBranchSchemaPathParams;
|
|
1212
|
-
} & FetcherExtraProps;
|
|
1213
|
-
declare const compareBranchSchema: (variables: CompareBranchSchemaVariables) => Promise<Record<string, any>>;
|
|
1214
|
-
declare type UpdateBranchSchemaPathParams = {
|
|
1215
|
-
dbBranchName: DBBranchName;
|
|
1216
|
-
workspace: string;
|
|
1217
|
-
};
|
|
1218
|
-
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
|
1219
|
-
status: 400;
|
|
1220
|
-
payload: BadRequestError;
|
|
1221
|
-
} | {
|
|
1222
|
-
status: 401;
|
|
1223
|
-
payload: AuthError;
|
|
1224
|
-
} | {
|
|
1225
|
-
status: 404;
|
|
1226
|
-
payload: SimpleError;
|
|
1227
|
-
}>;
|
|
1228
|
-
declare type UpdateBranchSchemaVariables = {
|
|
1229
|
-
body?: Record<string, any>;
|
|
1230
|
-
pathParams: UpdateBranchSchemaPathParams;
|
|
1231
|
-
} & FetcherExtraProps;
|
|
1232
|
-
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<Record<string, any>>;
|
|
1233
|
-
declare type GetBranchSchemaHistoryPathParams = {
|
|
1234
|
-
dbBranchName: DBBranchName;
|
|
1235
|
-
workspace: string;
|
|
1236
|
-
};
|
|
1237
|
-
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
|
1238
|
-
status: 400;
|
|
1239
|
-
payload: BadRequestError;
|
|
1240
|
-
} | {
|
|
1241
|
-
status: 401;
|
|
1242
|
-
payload: AuthError;
|
|
1243
|
-
} | {
|
|
1244
|
-
status: 404;
|
|
1245
|
-
payload: SimpleError;
|
|
1246
|
-
}>;
|
|
1247
|
-
declare type GetBranchSchemaHistoryVariables = {
|
|
1248
|
-
body?: Record<string, any>;
|
|
1249
|
-
pathParams: GetBranchSchemaHistoryPathParams;
|
|
1250
|
-
} & FetcherExtraProps;
|
|
1251
|
-
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<Record<string, any>>;
|
|
1252
1392
|
declare type GetBranchStatsPathParams = {
|
|
1253
1393
|
dbBranchName: DBBranchName;
|
|
1254
1394
|
workspace: string;
|
|
@@ -1352,8 +1492,9 @@ declare type UpdateTableVariables = {
|
|
|
1352
1492
|
*
|
|
1353
1493
|
* In the example below, we rename a table from “users” to “people”:
|
|
1354
1494
|
*
|
|
1355
|
-
* ```
|
|
1356
|
-
* PATCH /db/test:main/tables/users
|
|
1495
|
+
* ```json
|
|
1496
|
+
* // PATCH /db/test:main/tables/users
|
|
1497
|
+
*
|
|
1357
1498
|
* {
|
|
1358
1499
|
* "name": "people"
|
|
1359
1500
|
* }
|
|
@@ -1761,7 +1902,7 @@ declare type QueryTableVariables = {
|
|
|
1761
1902
|
* {
|
|
1762
1903
|
* "columns": [...],
|
|
1763
1904
|
* "filter": {
|
|
1764
|
-
* "$all": [...]
|
|
1905
|
+
* "$all": [...],
|
|
1765
1906
|
* "$any": [...]
|
|
1766
1907
|
* ...
|
|
1767
1908
|
* },
|
|
@@ -1807,7 +1948,11 @@ declare type QueryTableVariables = {
|
|
|
1807
1948
|
* "link": {
|
|
1808
1949
|
* "table": "users"
|
|
1809
1950
|
* }
|
|
1810
|
-
* }
|
|
1951
|
+
* },
|
|
1952
|
+
* {
|
|
1953
|
+
* "name": "foundedDate",
|
|
1954
|
+
* "type": "datetime"
|
|
1955
|
+
* },
|
|
1811
1956
|
* ]
|
|
1812
1957
|
* },
|
|
1813
1958
|
* {
|
|
@@ -1895,7 +2040,7 @@ declare type QueryTableVariables = {
|
|
|
1895
2040
|
* {
|
|
1896
2041
|
* "name": "Kilian",
|
|
1897
2042
|
* "address": {
|
|
1898
|
-
* "street": "New street"
|
|
2043
|
+
* "street": "New street"
|
|
1899
2044
|
* }
|
|
1900
2045
|
* }
|
|
1901
2046
|
* ```
|
|
@@ -1904,10 +2049,7 @@ declare type QueryTableVariables = {
|
|
|
1904
2049
|
*
|
|
1905
2050
|
* ```json
|
|
1906
2051
|
* {
|
|
1907
|
-
* "columns": [
|
|
1908
|
-
* "*",
|
|
1909
|
-
* "team.name"
|
|
1910
|
-
* ]
|
|
2052
|
+
* "columns": ["*", "team.name"]
|
|
1911
2053
|
* }
|
|
1912
2054
|
* ```
|
|
1913
2055
|
*
|
|
@@ -1925,7 +2067,7 @@ declare type QueryTableVariables = {
|
|
|
1925
2067
|
* "team": {
|
|
1926
2068
|
* "id": "XX",
|
|
1927
2069
|
* "xata": {
|
|
1928
|
-
* "version": 0
|
|
2070
|
+
* "version": 0
|
|
1929
2071
|
* },
|
|
1930
2072
|
* "name": "first team"
|
|
1931
2073
|
* }
|
|
@@ -1936,10 +2078,7 @@ declare type QueryTableVariables = {
|
|
|
1936
2078
|
*
|
|
1937
2079
|
* ```json
|
|
1938
2080
|
* {
|
|
1939
|
-
* "columns": [
|
|
1940
|
-
* "*",
|
|
1941
|
-
* "team.*"
|
|
1942
|
-
* ]
|
|
2081
|
+
* "columns": ["*", "team.*"]
|
|
1943
2082
|
* }
|
|
1944
2083
|
* ```
|
|
1945
2084
|
*
|
|
@@ -1957,10 +2096,11 @@ declare type QueryTableVariables = {
|
|
|
1957
2096
|
* "team": {
|
|
1958
2097
|
* "id": "XX",
|
|
1959
2098
|
* "xata": {
|
|
1960
|
-
* "version": 0
|
|
2099
|
+
* "version": 0
|
|
1961
2100
|
* },
|
|
1962
2101
|
* "name": "first team",
|
|
1963
|
-
* "code": "A1"
|
|
2102
|
+
* "code": "A1",
|
|
2103
|
+
* "foundedDate": "2020-03-04T10:43:54.32Z"
|
|
1964
2104
|
* }
|
|
1965
2105
|
* }
|
|
1966
2106
|
* ```
|
|
@@ -1975,7 +2115,7 @@ declare type QueryTableVariables = {
|
|
|
1975
2115
|
* `$none`, etc.
|
|
1976
2116
|
*
|
|
1977
2117
|
* All operators start with an `$` to differentiate them from column names
|
|
1978
|
-
* (which are not allowed to start with
|
|
2118
|
+
* (which are not allowed to start with a dollar sign).
|
|
1979
2119
|
*
|
|
1980
2120
|
* #### Exact matching and control operators
|
|
1981
2121
|
*
|
|
@@ -2006,7 +2146,7 @@ declare type QueryTableVariables = {
|
|
|
2006
2146
|
* ```json
|
|
2007
2147
|
* {
|
|
2008
2148
|
* "filter": {
|
|
2009
|
-
*
|
|
2149
|
+
* "name": "r2"
|
|
2010
2150
|
* }
|
|
2011
2151
|
* }
|
|
2012
2152
|
* ```
|
|
@@ -2028,7 +2168,7 @@ declare type QueryTableVariables = {
|
|
|
2028
2168
|
* ```json
|
|
2029
2169
|
* {
|
|
2030
2170
|
* "filter": {
|
|
2031
|
-
*
|
|
2171
|
+
* "settings.plan": "free"
|
|
2032
2172
|
* }
|
|
2033
2173
|
* }
|
|
2034
2174
|
* ```
|
|
@@ -2038,8 +2178,8 @@ declare type QueryTableVariables = {
|
|
|
2038
2178
|
* "filter": {
|
|
2039
2179
|
* "settings": {
|
|
2040
2180
|
* "plan": "free"
|
|
2041
|
-
* }
|
|
2042
|
-
* }
|
|
2181
|
+
* }
|
|
2182
|
+
* }
|
|
2043
2183
|
* }
|
|
2044
2184
|
* ```
|
|
2045
2185
|
*
|
|
@@ -2048,8 +2188,8 @@ declare type QueryTableVariables = {
|
|
|
2048
2188
|
* ```json
|
|
2049
2189
|
* {
|
|
2050
2190
|
* "filter": {
|
|
2051
|
-
* "settings.plan": {"$any": ["free", "paid"]}
|
|
2052
|
-
* }
|
|
2191
|
+
* "settings.plan": { "$any": ["free", "paid"] }
|
|
2192
|
+
* }
|
|
2053
2193
|
* }
|
|
2054
2194
|
* ```
|
|
2055
2195
|
*
|
|
@@ -2058,9 +2198,9 @@ declare type QueryTableVariables = {
|
|
|
2058
2198
|
* ```json
|
|
2059
2199
|
* {
|
|
2060
2200
|
* "filter": {
|
|
2061
|
-
*
|
|
2062
|
-
*
|
|
2063
|
-
* }
|
|
2201
|
+
* "settings.dark": true,
|
|
2202
|
+
* "settings.plan": "free"
|
|
2203
|
+
* }
|
|
2064
2204
|
* }
|
|
2065
2205
|
* ```
|
|
2066
2206
|
*
|
|
@@ -2071,11 +2211,11 @@ declare type QueryTableVariables = {
|
|
|
2071
2211
|
* ```json
|
|
2072
2212
|
* {
|
|
2073
2213
|
* "filter": {
|
|
2074
|
-
*
|
|
2075
|
-
*
|
|
2076
|
-
*
|
|
2077
|
-
*
|
|
2078
|
-
* }
|
|
2214
|
+
* "$any": {
|
|
2215
|
+
* "settings.dark": true,
|
|
2216
|
+
* "settings.plan": "free"
|
|
2217
|
+
* }
|
|
2218
|
+
* }
|
|
2079
2219
|
* }
|
|
2080
2220
|
* ```
|
|
2081
2221
|
*
|
|
@@ -2086,10 +2226,10 @@ declare type QueryTableVariables = {
|
|
|
2086
2226
|
* "filter": {
|
|
2087
2227
|
* "$any": [
|
|
2088
2228
|
* {
|
|
2089
|
-
* "name": "r1"
|
|
2229
|
+
* "name": "r1"
|
|
2090
2230
|
* },
|
|
2091
2231
|
* {
|
|
2092
|
-
* "name": "r2"
|
|
2232
|
+
* "name": "r2"
|
|
2093
2233
|
* }
|
|
2094
2234
|
* ]
|
|
2095
2235
|
* }
|
|
@@ -2101,7 +2241,7 @@ declare type QueryTableVariables = {
|
|
|
2101
2241
|
* ```json
|
|
2102
2242
|
* {
|
|
2103
2243
|
* "filter": {
|
|
2104
|
-
* "$exists": "settings"
|
|
2244
|
+
* "$exists": "settings"
|
|
2105
2245
|
* }
|
|
2106
2246
|
* }
|
|
2107
2247
|
* ```
|
|
@@ -2113,10 +2253,10 @@ declare type QueryTableVariables = {
|
|
|
2113
2253
|
* "filter": {
|
|
2114
2254
|
* "$all": [
|
|
2115
2255
|
* {
|
|
2116
|
-
* "$exists": "settings"
|
|
2256
|
+
* "$exists": "settings"
|
|
2117
2257
|
* },
|
|
2118
2258
|
* {
|
|
2119
|
-
* "$exists": "name"
|
|
2259
|
+
* "$exists": "name"
|
|
2120
2260
|
* }
|
|
2121
2261
|
* ]
|
|
2122
2262
|
* }
|
|
@@ -2128,7 +2268,7 @@ declare type QueryTableVariables = {
|
|
|
2128
2268
|
* ```json
|
|
2129
2269
|
* {
|
|
2130
2270
|
* "filter": {
|
|
2131
|
-
* "$notExists": "settings"
|
|
2271
|
+
* "$notExists": "settings"
|
|
2132
2272
|
* }
|
|
2133
2273
|
* }
|
|
2134
2274
|
* ```
|
|
@@ -2155,43 +2295,59 @@ declare type QueryTableVariables = {
|
|
|
2155
2295
|
* {
|
|
2156
2296
|
* "filter": {
|
|
2157
2297
|
* "<column_name>": {
|
|
2158
|
-
*
|
|
2298
|
+
* "$pattern": "v*alu?"
|
|
2159
2299
|
* }
|
|
2160
2300
|
* }
|
|
2161
2301
|
* }
|
|
2162
2302
|
* ```
|
|
2163
2303
|
*
|
|
2304
|
+
* The `$pattern` operator accepts two wildcard characters:
|
|
2305
|
+
* * `*` matches zero or more characters
|
|
2306
|
+
* * `?` matches exactly one character
|
|
2307
|
+
*
|
|
2308
|
+
* 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.
|
|
2309
|
+
*
|
|
2164
2310
|
* We could also have `$endsWith` and `$startsWith` operators:
|
|
2165
2311
|
*
|
|
2166
2312
|
* ```json
|
|
2167
2313
|
* {
|
|
2168
2314
|
* "filter": {
|
|
2169
2315
|
* "<column_name>": {
|
|
2170
|
-
*
|
|
2316
|
+
* "$endsWith": ".gz"
|
|
2171
2317
|
* },
|
|
2172
2318
|
* "<column_name>": {
|
|
2173
|
-
*
|
|
2319
|
+
* "$startsWith": "tmp-"
|
|
2174
2320
|
* }
|
|
2175
2321
|
* }
|
|
2176
2322
|
* }
|
|
2177
2323
|
* ```
|
|
2178
2324
|
*
|
|
2179
|
-
* #### Numeric ranges
|
|
2325
|
+
* #### Numeric or datetime ranges
|
|
2180
2326
|
*
|
|
2181
2327
|
* ```json
|
|
2182
2328
|
* {
|
|
2183
2329
|
* "filter": {
|
|
2184
|
-
*
|
|
2185
|
-
*
|
|
2186
|
-
*
|
|
2187
|
-
*
|
|
2330
|
+
* "<column_name>": {
|
|
2331
|
+
* "$ge": 0,
|
|
2332
|
+
* "$lt": 100
|
|
2333
|
+
* }
|
|
2334
|
+
* }
|
|
2335
|
+
* }
|
|
2336
|
+
* ```
|
|
2337
|
+
* Date ranges support the same operators, with the date using the format defined in
|
|
2338
|
+
* [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
|
|
2339
|
+
* ```json
|
|
2340
|
+
* {
|
|
2341
|
+
* "filter": {
|
|
2342
|
+
* "<column_name>": {
|
|
2343
|
+
* "$gt": "2019-10-12T07:20:50.52Z",
|
|
2344
|
+
* "$lt": "2021-10-12T07:20:50.52Z"
|
|
2345
|
+
* }
|
|
2188
2346
|
* }
|
|
2189
2347
|
* }
|
|
2190
2348
|
* ```
|
|
2191
|
-
*
|
|
2192
2349
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
|
2193
2350
|
*
|
|
2194
|
-
*
|
|
2195
2351
|
* #### Negations
|
|
2196
2352
|
*
|
|
2197
2353
|
* A general `$not` operator can inverse any operation.
|
|
@@ -2216,15 +2372,21 @@ declare type QueryTableVariables = {
|
|
|
2216
2372
|
* {
|
|
2217
2373
|
* "filter": {
|
|
2218
2374
|
* "$not": {
|
|
2219
|
-
* "$any": [
|
|
2220
|
-
*
|
|
2221
|
-
*
|
|
2222
|
-
*
|
|
2223
|
-
*
|
|
2224
|
-
*
|
|
2225
|
-
*
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2375
|
+
* "$any": [
|
|
2376
|
+
* {
|
|
2377
|
+
* "<column_name1>": "value1"
|
|
2378
|
+
* },
|
|
2379
|
+
* {
|
|
2380
|
+
* "$all": [
|
|
2381
|
+
* {
|
|
2382
|
+
* "<column_name2>": "value2"
|
|
2383
|
+
* },
|
|
2384
|
+
* {
|
|
2385
|
+
* "<column_name3>": "value3"
|
|
2386
|
+
* }
|
|
2387
|
+
* ]
|
|
2388
|
+
* }
|
|
2389
|
+
* ]
|
|
2228
2390
|
* }
|
|
2229
2391
|
* }
|
|
2230
2392
|
* }
|
|
@@ -2279,8 +2441,8 @@ declare type QueryTableVariables = {
|
|
|
2279
2441
|
* "<array name>": {
|
|
2280
2442
|
* "$includes": {
|
|
2281
2443
|
* "$all": [
|
|
2282
|
-
* {"$contains": "label"},
|
|
2283
|
-
* {"$not": {"$endsWith": "-debug"}}
|
|
2444
|
+
* { "$contains": "label" },
|
|
2445
|
+
* { "$not": { "$endsWith": "-debug" } }
|
|
2284
2446
|
* ]
|
|
2285
2447
|
* }
|
|
2286
2448
|
* }
|
|
@@ -2300,9 +2462,7 @@ declare type QueryTableVariables = {
|
|
|
2300
2462
|
* {
|
|
2301
2463
|
* "filter": {
|
|
2302
2464
|
* "settings.labels": {
|
|
2303
|
-
* "$includesAll": [
|
|
2304
|
-
* {"$contains": "label"},
|
|
2305
|
-
* ]
|
|
2465
|
+
* "$includesAll": [{ "$contains": "label" }]
|
|
2306
2466
|
* }
|
|
2307
2467
|
* }
|
|
2308
2468
|
* }
|
|
@@ -2350,7 +2510,6 @@ declare type QueryTableVariables = {
|
|
|
2350
2510
|
* }
|
|
2351
2511
|
* ```
|
|
2352
2512
|
*
|
|
2353
|
-
*
|
|
2354
2513
|
* ### Pagination
|
|
2355
2514
|
*
|
|
2356
2515
|
* We offer cursor pagination and offset pagination. The offset pagination is limited
|
|
@@ -2416,8 +2575,8 @@ declare type QueryTableVariables = {
|
|
|
2416
2575
|
* can be queried by update `page.after` to the returned cursor while keeping the
|
|
2417
2576
|
* `page.before` cursor from the first range query.
|
|
2418
2577
|
*
|
|
2419
|
-
* The `filter` , `columns`,
|
|
2420
|
-
* encoded with the cursor.
|
|
2578
|
+
* The `filter` , `columns`, `sort` , and `page.size` configuration will be
|
|
2579
|
+
* encoded with the cursor. The pagination request will be invalid if
|
|
2421
2580
|
* `filter` or `sort` is set. The columns returned and page size can be changed
|
|
2422
2581
|
* anytime by passing the `columns` or `page.size` settings to the next query.
|
|
2423
2582
|
*
|
|
@@ -2454,6 +2613,40 @@ declare type QueryTableVariables = {
|
|
|
2454
2613
|
* ```
|
|
2455
2614
|
*/
|
|
2456
2615
|
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
2616
|
+
declare type SearchTablePathParams = {
|
|
2617
|
+
dbBranchName: DBBranchName;
|
|
2618
|
+
tableName: TableName;
|
|
2619
|
+
workspace: string;
|
|
2620
|
+
};
|
|
2621
|
+
declare type SearchTableError = ErrorWrapper<{
|
|
2622
|
+
status: 400;
|
|
2623
|
+
payload: BadRequestError;
|
|
2624
|
+
} | {
|
|
2625
|
+
status: 401;
|
|
2626
|
+
payload: AuthError;
|
|
2627
|
+
} | {
|
|
2628
|
+
status: 404;
|
|
2629
|
+
payload: SimpleError;
|
|
2630
|
+
}>;
|
|
2631
|
+
declare type SearchTableRequestBody = {
|
|
2632
|
+
query: string;
|
|
2633
|
+
fuzziness?: FuzzinessExpression;
|
|
2634
|
+
prefix?: PrefixExpression;
|
|
2635
|
+
filter?: FilterExpression;
|
|
2636
|
+
highlight?: HighlightExpression;
|
|
2637
|
+
};
|
|
2638
|
+
declare type SearchTableVariables = {
|
|
2639
|
+
body: SearchTableRequestBody;
|
|
2640
|
+
pathParams: SearchTablePathParams;
|
|
2641
|
+
} & FetcherExtraProps;
|
|
2642
|
+
/**
|
|
2643
|
+
* Run a free text search operation in a particular table.
|
|
2644
|
+
*
|
|
2645
|
+
* 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:
|
|
2646
|
+
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
|
2647
|
+
* * filtering on columns of type `multiple` is currently unsupported
|
|
2648
|
+
*/
|
|
2649
|
+
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
2457
2650
|
declare type SearchBranchPathParams = {
|
|
2458
2651
|
dbBranchName: DBBranchName;
|
|
2459
2652
|
workspace: string;
|
|
@@ -2469,9 +2662,13 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
|
2469
2662
|
payload: SimpleError;
|
|
2470
2663
|
}>;
|
|
2471
2664
|
declare type SearchBranchRequestBody = {
|
|
2472
|
-
tables?: string
|
|
2665
|
+
tables?: (string | {
|
|
2666
|
+
table: string;
|
|
2667
|
+
filter?: FilterExpression;
|
|
2668
|
+
})[];
|
|
2473
2669
|
query: string;
|
|
2474
|
-
fuzziness?:
|
|
2670
|
+
fuzziness?: FuzzinessExpression;
|
|
2671
|
+
highlight?: HighlightExpression;
|
|
2475
2672
|
};
|
|
2476
2673
|
declare type SearchBranchVariables = {
|
|
2477
2674
|
body: SearchBranchRequestBody;
|
|
@@ -2508,6 +2705,10 @@ declare const operationsByTag: {
|
|
|
2508
2705
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
|
2509
2706
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
|
2510
2707
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
2708
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
|
2709
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
|
2710
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
|
2711
|
+
resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
|
2511
2712
|
};
|
|
2512
2713
|
branch: {
|
|
2513
2714
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
|
@@ -2519,9 +2720,6 @@ declare const operationsByTag: {
|
|
|
2519
2720
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
|
2520
2721
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
|
2521
2722
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
|
2522
|
-
compareBranchSchema: (variables: CompareBranchSchemaVariables) => Promise<Record<string, any>>;
|
|
2523
|
-
updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<Record<string, any>>;
|
|
2524
|
-
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<Record<string, any>>;
|
|
2525
2723
|
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
|
2526
2724
|
};
|
|
2527
2725
|
table: {
|
|
@@ -2545,6 +2743,7 @@ declare const operationsByTag: {
|
|
|
2545
2743
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
|
2546
2744
|
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
|
|
2547
2745
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
2746
|
+
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
2548
2747
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
|
2549
2748
|
};
|
|
2550
2749
|
};
|
|
@@ -2561,6 +2760,9 @@ interface XataApiClientOptions {
|
|
|
2561
2760
|
apiKey?: string;
|
|
2562
2761
|
host?: HostProvider;
|
|
2563
2762
|
}
|
|
2763
|
+
/**
|
|
2764
|
+
* @deprecated Use XataApiPlugin instead
|
|
2765
|
+
*/
|
|
2564
2766
|
declare class XataApiClient {
|
|
2565
2767
|
#private;
|
|
2566
2768
|
constructor(options?: XataApiClientOptions);
|
|
@@ -2603,6 +2805,10 @@ declare class DatabaseApi {
|
|
|
2603
2805
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
|
2604
2806
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
|
2605
2807
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
|
2808
|
+
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
|
2809
|
+
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
|
2810
|
+
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
|
2811
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
|
2606
2812
|
}
|
|
2607
2813
|
declare class BranchApi {
|
|
2608
2814
|
private extraProps;
|
|
@@ -2643,6 +2849,7 @@ declare class RecordsApi {
|
|
|
2643
2849
|
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
|
|
2644
2850
|
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
|
|
2645
2851
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
|
2852
|
+
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
|
2646
2853
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
|
2647
2854
|
}
|
|
2648
2855
|
|
|
@@ -2664,20 +2871,20 @@ declare type RequiredBy<T, K extends keyof T> = T & {
|
|
|
2664
2871
|
};
|
|
2665
2872
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
|
2666
2873
|
declare type SingleOrArray<T> = T | T[];
|
|
2667
|
-
declare type
|
|
2874
|
+
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
|
2668
2875
|
|
|
2669
2876
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
|
2670
2877
|
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
|
2671
2878
|
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
|
|
2672
2879
|
}>>;
|
|
2673
|
-
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
|
|
2674
|
-
V: ValueAtColumn<
|
|
2675
|
-
} : never
|
|
2880
|
+
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> ? {
|
|
2881
|
+
V: ValueAtColumn<Item, V>;
|
|
2882
|
+
} : never : O[K] : never> : never : never;
|
|
2676
2883
|
declare type MAX_RECURSION = 5;
|
|
2677
2884
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
|
2678
|
-
[K in DataProps<O>]:
|
|
2679
|
-
If<IsObject<
|
|
2680
|
-
K
|
|
2885
|
+
[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
|
|
2886
|
+
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
|
|
2887
|
+
K>> : never;
|
|
2681
2888
|
}>, never>;
|
|
2682
2889
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
|
2683
2890
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
|
@@ -2704,16 +2911,11 @@ interface BaseData {
|
|
|
2704
2911
|
/**
|
|
2705
2912
|
* Represents a persisted record from the database.
|
|
2706
2913
|
*/
|
|
2707
|
-
interface XataRecord extends Identifiable {
|
|
2914
|
+
interface XataRecord<ExtraMetadata extends Record<string, unknown> = Record<string, unknown>> extends Identifiable {
|
|
2708
2915
|
/**
|
|
2709
|
-
*
|
|
2916
|
+
* Get metadata of this record.
|
|
2710
2917
|
*/
|
|
2711
|
-
|
|
2712
|
-
/**
|
|
2713
|
-
* Number that is increased every time the record is updated.
|
|
2714
|
-
*/
|
|
2715
|
-
version: number;
|
|
2716
|
-
};
|
|
2918
|
+
getMetadata(): XataRecordMetadata & ExtraMetadata;
|
|
2717
2919
|
/**
|
|
2718
2920
|
* Retrieves a refreshed copy of the current record from the database.
|
|
2719
2921
|
*/
|
|
@@ -2721,7 +2923,7 @@ interface XataRecord extends Identifiable {
|
|
|
2721
2923
|
/**
|
|
2722
2924
|
* Performs a partial update of the current record. On success a new object is
|
|
2723
2925
|
* returned and the current object is not mutated.
|
|
2724
|
-
* @param
|
|
2926
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
2725
2927
|
* @returns A new record containing the latest values for all the columns of the current record.
|
|
2726
2928
|
*/
|
|
2727
2929
|
update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
|
|
@@ -2740,19 +2942,26 @@ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update
|
|
|
2740
2942
|
/**
|
|
2741
2943
|
* Performs a partial update of the current record. On success a new object is
|
|
2742
2944
|
* returned and the current object is not mutated.
|
|
2743
|
-
* @param
|
|
2945
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
2744
2946
|
* @returns A new record containing the latest values for all the columns of the current record.
|
|
2745
2947
|
*/
|
|
2746
2948
|
update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
2747
2949
|
};
|
|
2950
|
+
declare type XataRecordMetadata = {
|
|
2951
|
+
/**
|
|
2952
|
+
* Number that is increased every time the record is updated.
|
|
2953
|
+
*/
|
|
2954
|
+
version: number;
|
|
2955
|
+
warnings?: string[];
|
|
2956
|
+
};
|
|
2748
2957
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
|
2749
2958
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
|
2750
2959
|
declare type EditableData<O extends BaseData> = {
|
|
2751
2960
|
[K in keyof O]: O[K] extends XataRecord ? {
|
|
2752
2961
|
id: string;
|
|
2753
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
|
2962
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
|
2754
2963
|
id: string;
|
|
2755
|
-
} | null | undefined : O[K];
|
|
2964
|
+
} | string | null | undefined : O[K];
|
|
2756
2965
|
};
|
|
2757
2966
|
|
|
2758
2967
|
/**
|
|
@@ -2828,8 +3037,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
|
2828
3037
|
],
|
|
2829
3038
|
}
|
|
2830
3039
|
*/
|
|
2831
|
-
declare type AggregatorFilter<
|
|
2832
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
|
3040
|
+
declare type AggregatorFilter<T> = {
|
|
3041
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
|
2833
3042
|
};
|
|
2834
3043
|
/**
|
|
2835
3044
|
* Existance filter
|
|
@@ -2844,10 +3053,10 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
|
2844
3053
|
* Injects the Api filters on nested properties
|
|
2845
3054
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
|
2846
3055
|
*/
|
|
2847
|
-
declare type NestedApiFilter<T> =
|
|
3056
|
+
declare type NestedApiFilter<T> = {
|
|
2848
3057
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
|
2849
|
-
}
|
|
2850
|
-
declare type Filter<
|
|
3058
|
+
};
|
|
3059
|
+
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
|
2851
3060
|
|
|
2852
3061
|
declare type SortDirection = 'asc' | 'desc';
|
|
2853
3062
|
declare type SortFilterExtended<T extends XataRecord> = {
|
|
@@ -2859,13 +3068,21 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
|
2859
3068
|
[Key in StringKeys<T>]: SortDirection;
|
|
2860
3069
|
};
|
|
2861
3070
|
|
|
2862
|
-
declare type
|
|
2863
|
-
page?: PaginationOptions;
|
|
3071
|
+
declare type BaseOptions<T extends XataRecord> = {
|
|
2864
3072
|
columns?: NonEmptyArray<SelectableColumn<T>>;
|
|
3073
|
+
cache?: number;
|
|
3074
|
+
};
|
|
3075
|
+
declare type CursorQueryOptions = {
|
|
3076
|
+
pagination?: CursorNavigationOptions & OffsetNavigationOptions;
|
|
3077
|
+
filter?: never;
|
|
3078
|
+
sort?: never;
|
|
3079
|
+
};
|
|
3080
|
+
declare type OffsetQueryOptions<T extends XataRecord> = {
|
|
3081
|
+
pagination?: OffsetNavigationOptions;
|
|
2865
3082
|
filter?: FilterExpression;
|
|
2866
3083
|
sort?: SortFilter<T> | SortFilter<T>[];
|
|
2867
|
-
cache?: number;
|
|
2868
3084
|
};
|
|
3085
|
+
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
|
2869
3086
|
/**
|
|
2870
3087
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
|
2871
3088
|
*
|
|
@@ -2875,8 +3092,8 @@ declare type QueryOptions<T extends XataRecord> = {
|
|
|
2875
3092
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
|
2876
3093
|
#private;
|
|
2877
3094
|
readonly meta: PaginationQueryMeta;
|
|
2878
|
-
readonly records: Result
|
|
2879
|
-
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>,
|
|
3095
|
+
readonly records: RecordArray<Result>;
|
|
3096
|
+
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
|
2880
3097
|
getQueryOptions(): QueryOptions<Record>;
|
|
2881
3098
|
key(): string;
|
|
2882
3099
|
/**
|
|
@@ -2908,18 +3125,28 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
2908
3125
|
*
|
|
2909
3126
|
* ```
|
|
2910
3127
|
* query.filter("columnName", columnValue)
|
|
2911
|
-
* query.filter(
|
|
2912
|
-
*
|
|
2913
|
-
*
|
|
3128
|
+
* query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
|
|
3129
|
+
* ```
|
|
3130
|
+
*
|
|
3131
|
+
* @param column The name of the column to filter.
|
|
3132
|
+
* @param value The value to filter.
|
|
3133
|
+
* @returns A new Query object.
|
|
3134
|
+
*/
|
|
3135
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
|
3136
|
+
/**
|
|
3137
|
+
* Builds a new query object adding one or more constraints. Examples:
|
|
3138
|
+
*
|
|
3139
|
+
* ```
|
|
3140
|
+
* query.filter({ "columnName": columnValue })
|
|
2914
3141
|
* query.filter({
|
|
2915
3142
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
|
2916
3143
|
* })
|
|
2917
3144
|
* ```
|
|
2918
3145
|
*
|
|
3146
|
+
* @param filters A filter object
|
|
2919
3147
|
* @returns A new Query object.
|
|
2920
3148
|
*/
|
|
2921
3149
|
filter(filters: Filter<Record>): Query<Record, Result>;
|
|
2922
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
|
2923
3150
|
/**
|
|
2924
3151
|
* Builds a new query with a new sort option.
|
|
2925
3152
|
* @param column The column name.
|
|
@@ -2933,48 +3160,148 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
2933
3160
|
* @returns A new Query object.
|
|
2934
3161
|
*/
|
|
2935
3162
|
select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
|
|
3163
|
+
/**
|
|
3164
|
+
* Get paginated results
|
|
3165
|
+
*
|
|
3166
|
+
* @returns A page of results
|
|
3167
|
+
*/
|
|
2936
3168
|
getPaginated(): Promise<Page<Record, Result>>;
|
|
2937
|
-
|
|
3169
|
+
/**
|
|
3170
|
+
* Get paginated results
|
|
3171
|
+
*
|
|
3172
|
+
* @param options Pagination options
|
|
3173
|
+
* @returns A page of results
|
|
3174
|
+
*/
|
|
3175
|
+
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
|
3176
|
+
/**
|
|
3177
|
+
* Get paginated results
|
|
3178
|
+
*
|
|
3179
|
+
* @param options Pagination options
|
|
3180
|
+
* @returns A page of results
|
|
3181
|
+
*/
|
|
2938
3182
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
|
3183
|
+
/**
|
|
3184
|
+
* Get results in an iterator
|
|
3185
|
+
*
|
|
3186
|
+
* @async
|
|
3187
|
+
* @returns Async interable of results
|
|
3188
|
+
*/
|
|
2939
3189
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
3190
|
+
/**
|
|
3191
|
+
* Build an iterator of results
|
|
3192
|
+
*
|
|
3193
|
+
* @returns Async generator of results array
|
|
3194
|
+
*/
|
|
3195
|
+
getIterator(): AsyncGenerator<Result[]>;
|
|
3196
|
+
/**
|
|
3197
|
+
* Build an iterator of results
|
|
3198
|
+
*
|
|
3199
|
+
* @param options Pagination options with batchSize
|
|
3200
|
+
* @returns Async generator of results array
|
|
3201
|
+
*/
|
|
3202
|
+
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
3203
|
+
batchSize?: number;
|
|
3204
|
+
}): AsyncGenerator<Result[]>;
|
|
3205
|
+
/**
|
|
3206
|
+
* Build an iterator of results
|
|
3207
|
+
*
|
|
3208
|
+
* @param options Pagination options with batchSize
|
|
3209
|
+
* @returns Async generator of results array
|
|
3210
|
+
*/
|
|
3211
|
+
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3212
|
+
batchSize?: number;
|
|
3213
|
+
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
|
3214
|
+
/**
|
|
3215
|
+
* Performs the query in the database and returns a set of results.
|
|
3216
|
+
* @returns An array of records from the database.
|
|
3217
|
+
*/
|
|
3218
|
+
getMany(): Promise<RecordArray<Result>>;
|
|
2943
3219
|
/**
|
|
2944
3220
|
* Performs the query in the database and returns a set of results.
|
|
2945
3221
|
* @param options Additional options to be used when performing the query.
|
|
2946
3222
|
* @returns An array of records from the database.
|
|
2947
3223
|
*/
|
|
2948
|
-
getMany(): Promise<
|
|
2949
|
-
|
|
2950
|
-
|
|
3224
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
|
3225
|
+
/**
|
|
3226
|
+
* Performs the query in the database and returns a set of results.
|
|
3227
|
+
* @param options Additional options to be used when performing the query.
|
|
3228
|
+
* @returns An array of records from the database.
|
|
3229
|
+
*/
|
|
3230
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
|
3231
|
+
/**
|
|
3232
|
+
* Performs the query in the database and returns all the results.
|
|
3233
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3234
|
+
* @returns An array of records from the database.
|
|
3235
|
+
*/
|
|
3236
|
+
getAll(): Promise<Result[]>;
|
|
3237
|
+
/**
|
|
3238
|
+
* Performs the query in the database and returns all the results.
|
|
3239
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3240
|
+
* @param options Additional options to be used when performing the query.
|
|
3241
|
+
* @returns An array of records from the database.
|
|
3242
|
+
*/
|
|
3243
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3244
|
+
batchSize?: number;
|
|
3245
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
|
2951
3246
|
/**
|
|
2952
3247
|
* Performs the query in the database and returns all the results.
|
|
2953
3248
|
* Warning: If there are a large number of results, this method can have performance implications.
|
|
2954
3249
|
* @param options Additional options to be used when performing the query.
|
|
2955
3250
|
* @returns An array of records from the database.
|
|
2956
3251
|
*/
|
|
2957
|
-
getAll(
|
|
2958
|
-
|
|
2959
|
-
|
|
3252
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
3253
|
+
batchSize?: number;
|
|
3254
|
+
}): Promise<Result[]>;
|
|
2960
3255
|
/**
|
|
2961
3256
|
* Performs the query in the database and returns the first result.
|
|
2962
|
-
* @param options Additional options to be used when performing the query.
|
|
2963
3257
|
* @returns The first record that matches the query, or null if no record matched the query.
|
|
2964
3258
|
*/
|
|
2965
3259
|
getFirst(): Promise<Result | null>;
|
|
2966
|
-
|
|
2967
|
-
|
|
3260
|
+
/**
|
|
3261
|
+
* Performs the query in the database and returns the first result.
|
|
3262
|
+
* @param options Additional options to be used when performing the query.
|
|
3263
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3264
|
+
*/
|
|
3265
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
|
3266
|
+
/**
|
|
3267
|
+
* Performs the query in the database and returns the first result.
|
|
3268
|
+
* @param options Additional options to be used when performing the query.
|
|
3269
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3270
|
+
*/
|
|
3271
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
|
2968
3272
|
/**
|
|
2969
3273
|
* Builds a new query object adding a cache TTL in milliseconds.
|
|
2970
3274
|
* @param ttl The cache TTL in milliseconds.
|
|
2971
3275
|
* @returns A new Query object.
|
|
2972
3276
|
*/
|
|
2973
3277
|
cache(ttl: number): Query<Record, Result>;
|
|
3278
|
+
/**
|
|
3279
|
+
* Retrieve next page of records
|
|
3280
|
+
*
|
|
3281
|
+
* @returns A new page object.
|
|
3282
|
+
*/
|
|
2974
3283
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3284
|
+
/**
|
|
3285
|
+
* Retrieve previous page of records
|
|
3286
|
+
*
|
|
3287
|
+
* @returns A new page object
|
|
3288
|
+
*/
|
|
2975
3289
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3290
|
+
/**
|
|
3291
|
+
* Retrieve first page of records
|
|
3292
|
+
*
|
|
3293
|
+
* @returns A new page object
|
|
3294
|
+
*/
|
|
2976
3295
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3296
|
+
/**
|
|
3297
|
+
* Retrieve last page of records
|
|
3298
|
+
*
|
|
3299
|
+
* @returns A new page object
|
|
3300
|
+
*/
|
|
2977
3301
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3302
|
+
/**
|
|
3303
|
+
* @returns Boolean indicating if there is a next page
|
|
3304
|
+
*/
|
|
2978
3305
|
hasNextPage(): boolean;
|
|
2979
3306
|
}
|
|
2980
3307
|
|
|
@@ -2986,7 +3313,7 @@ declare type PaginationQueryMeta = {
|
|
|
2986
3313
|
};
|
|
2987
3314
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
|
2988
3315
|
meta: PaginationQueryMeta;
|
|
2989
|
-
records: Result
|
|
3316
|
+
records: RecordArray<Result>;
|
|
2990
3317
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
2991
3318
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
2992
3319
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
@@ -3006,7 +3333,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
|
3006
3333
|
/**
|
|
3007
3334
|
* The set of results for this page.
|
|
3008
3335
|
*/
|
|
3009
|
-
readonly records: Result
|
|
3336
|
+
readonly records: RecordArray<Result>;
|
|
3010
3337
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
|
3011
3338
|
/**
|
|
3012
3339
|
* Retrieves the next page of results.
|
|
@@ -3054,14 +3381,45 @@ declare type OffsetNavigationOptions = {
|
|
|
3054
3381
|
size?: number;
|
|
3055
3382
|
offset?: number;
|
|
3056
3383
|
};
|
|
3057
|
-
declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
|
|
3058
3384
|
declare const PAGINATION_MAX_SIZE = 200;
|
|
3059
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
|
3385
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
|
3060
3386
|
declare const PAGINATION_MAX_OFFSET = 800;
|
|
3061
3387
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
|
3388
|
+
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
|
3389
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3390
|
+
#private;
|
|
3391
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
|
3392
|
+
static parseConstructorParams(...args: any[]): any[];
|
|
3393
|
+
/**
|
|
3394
|
+
* Retrieve next page of records
|
|
3395
|
+
*
|
|
3396
|
+
* @returns A new array of objects
|
|
3397
|
+
*/
|
|
3398
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3399
|
+
/**
|
|
3400
|
+
* Retrieve previous page of records
|
|
3401
|
+
*
|
|
3402
|
+
* @returns A new array of objects
|
|
3403
|
+
*/
|
|
3404
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3405
|
+
/**
|
|
3406
|
+
* Retrieve first page of records
|
|
3407
|
+
*
|
|
3408
|
+
* @returns A new array of objects
|
|
3409
|
+
*/
|
|
3410
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3411
|
+
/**
|
|
3412
|
+
* Retrieve last page of records
|
|
3413
|
+
*
|
|
3414
|
+
* @returns A new array of objects
|
|
3415
|
+
*/
|
|
3416
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
3417
|
+
/**
|
|
3418
|
+
* @returns Boolean indicating if there is a next page
|
|
3419
|
+
*/
|
|
3420
|
+
hasNextPage(): boolean;
|
|
3421
|
+
}
|
|
3062
3422
|
|
|
3063
|
-
declare type TableLink = string[];
|
|
3064
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
|
3065
3423
|
/**
|
|
3066
3424
|
* Common interface for performing operations on a table.
|
|
3067
3425
|
*/
|
|
@@ -3086,6 +3444,24 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3086
3444
|
* @returns The persisted record for the given id or null if the record could not be found.
|
|
3087
3445
|
*/
|
|
3088
3446
|
abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
3447
|
+
/**
|
|
3448
|
+
* Queries multiple records from the table given their unique id.
|
|
3449
|
+
* @param ids The unique ids array.
|
|
3450
|
+
* @returns The persisted records for the given ids (if a record could not be found it is not returned).
|
|
3451
|
+
*/
|
|
3452
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3453
|
+
/**
|
|
3454
|
+
* Queries a single record from the table by the id in the object.
|
|
3455
|
+
* @param object Object containing the id of the record.
|
|
3456
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
3457
|
+
*/
|
|
3458
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
3459
|
+
/**
|
|
3460
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
3461
|
+
* @param objects Array of objects containing the ids of the records.
|
|
3462
|
+
* @returns The persisted records for the given ids (if a record could not be found it is not returned).
|
|
3463
|
+
*/
|
|
3464
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3089
3465
|
/**
|
|
3090
3466
|
* Partially update a single record.
|
|
3091
3467
|
* @param object An object with its id and the columns to be updated.
|
|
@@ -3158,7 +3534,9 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3158
3534
|
* @returns The found records.
|
|
3159
3535
|
*/
|
|
3160
3536
|
abstract search(query: string, options?: {
|
|
3161
|
-
fuzziness?:
|
|
3537
|
+
fuzziness?: FuzzinessExpression;
|
|
3538
|
+
highlight?: HighlightExpression;
|
|
3539
|
+
filter?: Filter<Record>;
|
|
3162
3540
|
}): Promise<SelectedPick<Record, ['*']>[]>;
|
|
3163
3541
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3164
3542
|
}
|
|
@@ -3167,14 +3545,17 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
|
3167
3545
|
db: SchemaPluginResult<any>;
|
|
3168
3546
|
constructor(options: {
|
|
3169
3547
|
table: string;
|
|
3170
|
-
links?: LinkDictionary;
|
|
3171
3548
|
db: SchemaPluginResult<any>;
|
|
3172
3549
|
pluginOptions: XataPluginOptions;
|
|
3550
|
+
schemaTables?: Table[];
|
|
3173
3551
|
});
|
|
3174
|
-
create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
|
3175
|
-
create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
|
3176
|
-
create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']
|
|
3552
|
+
create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
3553
|
+
create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
3554
|
+
create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
3177
3555
|
read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
|
|
3556
|
+
read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3557
|
+
read(object: Identifiable): Promise<SelectedPick<Record, ['*']> | null>;
|
|
3558
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3178
3559
|
update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
|
|
3179
3560
|
update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
|
|
3180
3561
|
update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
|
|
@@ -3183,11 +3564,66 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
|
3183
3564
|
createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
|
|
3184
3565
|
delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
|
|
3185
3566
|
search(query: string, options?: {
|
|
3186
|
-
fuzziness?:
|
|
3567
|
+
fuzziness?: FuzzinessExpression;
|
|
3568
|
+
highlight?: HighlightExpression;
|
|
3569
|
+
filter?: Filter<Record>;
|
|
3187
3570
|
}): Promise<SelectedPick<Record, ['*']>[]>;
|
|
3188
3571
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3189
3572
|
}
|
|
3190
3573
|
|
|
3574
|
+
declare type BaseSchema = {
|
|
3575
|
+
name: string;
|
|
3576
|
+
columns: readonly ({
|
|
3577
|
+
name: string;
|
|
3578
|
+
type: Column['type'];
|
|
3579
|
+
} | {
|
|
3580
|
+
name: string;
|
|
3581
|
+
type: 'link';
|
|
3582
|
+
link: {
|
|
3583
|
+
table: string;
|
|
3584
|
+
};
|
|
3585
|
+
} | {
|
|
3586
|
+
name: string;
|
|
3587
|
+
type: 'object';
|
|
3588
|
+
columns: {
|
|
3589
|
+
name: string;
|
|
3590
|
+
type: string;
|
|
3591
|
+
}[];
|
|
3592
|
+
})[];
|
|
3593
|
+
};
|
|
3594
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
|
3595
|
+
name: string;
|
|
3596
|
+
columns: readonly unknown[];
|
|
3597
|
+
} ? {
|
|
3598
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
|
3599
|
+
} : never : never;
|
|
3600
|
+
declare type TableType<Tables, TableName> = Tables & {
|
|
3601
|
+
name: TableName;
|
|
3602
|
+
} extends infer Table ? Table extends {
|
|
3603
|
+
name: string;
|
|
3604
|
+
columns: infer Columns;
|
|
3605
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
|
3606
|
+
name: string;
|
|
3607
|
+
type: string;
|
|
3608
|
+
} ? {
|
|
3609
|
+
[K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
|
|
3610
|
+
} : never : never : never : never;
|
|
3611
|
+
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
|
3612
|
+
name: PropertyName;
|
|
3613
|
+
} extends infer Property ? Property extends {
|
|
3614
|
+
name: string;
|
|
3615
|
+
type: infer Type;
|
|
3616
|
+
link?: {
|
|
3617
|
+
table: infer LinkedTable;
|
|
3618
|
+
};
|
|
3619
|
+
columns?: infer ObjectColumns;
|
|
3620
|
+
} ? (Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
|
|
3621
|
+
name: string;
|
|
3622
|
+
type: string;
|
|
3623
|
+
} ? {
|
|
3624
|
+
[K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
|
|
3625
|
+
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
|
|
3626
|
+
|
|
3191
3627
|
/**
|
|
3192
3628
|
* Operator to restrict results to only values that are greater than the given value.
|
|
3193
3629
|
*/
|
|
@@ -3263,46 +3699,58 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
|
3263
3699
|
|
|
3264
3700
|
declare type SchemaDefinition = {
|
|
3265
3701
|
table: string;
|
|
3266
|
-
links?: LinkDictionary;
|
|
3267
3702
|
};
|
|
3268
3703
|
declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3269
3704
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
|
3705
|
+
} & {
|
|
3706
|
+
[key: string]: Repository<XataRecord$1>;
|
|
3270
3707
|
};
|
|
3271
3708
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
|
3272
3709
|
#private;
|
|
3273
|
-
|
|
3274
|
-
private tableNames?;
|
|
3275
|
-
constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
|
|
3710
|
+
constructor(schemaTables?: Schemas.Table[]);
|
|
3276
3711
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
|
3277
3712
|
}
|
|
3278
3713
|
|
|
3279
3714
|
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
|
3280
|
-
fuzziness?:
|
|
3281
|
-
|
|
3715
|
+
fuzziness?: FuzzinessExpression;
|
|
3716
|
+
highlight?: HighlightExpression;
|
|
3717
|
+
tables?: Array<Tables | Values<{
|
|
3718
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
|
3719
|
+
table: Model;
|
|
3720
|
+
filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
|
3721
|
+
};
|
|
3722
|
+
}>>;
|
|
3282
3723
|
};
|
|
3283
3724
|
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3284
3725
|
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
|
3285
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']
|
|
3726
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
|
3286
3727
|
table: Model;
|
|
3287
3728
|
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
|
3288
3729
|
};
|
|
3289
3730
|
}>[]>;
|
|
3290
3731
|
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
|
3291
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']
|
|
3732
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
|
3292
3733
|
}>;
|
|
3293
3734
|
};
|
|
3294
3735
|
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
|
3295
3736
|
#private;
|
|
3296
3737
|
private db;
|
|
3297
|
-
|
|
3298
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
|
3738
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
|
3299
3739
|
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
|
3300
3740
|
}
|
|
3301
|
-
declare type SearchXataRecord = XataRecord
|
|
3302
|
-
|
|
3303
|
-
|
|
3741
|
+
declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
|
|
3742
|
+
declare type SearchExtraProperties = {
|
|
3743
|
+
table: string;
|
|
3744
|
+
highlight?: {
|
|
3745
|
+
[key: string]: string[] | {
|
|
3746
|
+
[key: string]: any;
|
|
3747
|
+
};
|
|
3304
3748
|
};
|
|
3305
3749
|
};
|
|
3750
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
|
3751
|
+
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 {
|
|
3752
|
+
table: infer Table;
|
|
3753
|
+
} ? ReturnTable<Table, Tables> : never;
|
|
3306
3754
|
|
|
3307
3755
|
declare type BranchStrategyValue = string | undefined | null;
|
|
3308
3756
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
|
@@ -3318,15 +3766,15 @@ declare type BaseClientOptions = {
|
|
|
3318
3766
|
};
|
|
3319
3767
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
|
3320
3768
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
|
3321
|
-
new <
|
|
3322
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
|
3323
|
-
search: Awaited<ReturnType<SearchPlugin<
|
|
3769
|
+
new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
|
|
3770
|
+
db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
|
3771
|
+
search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
|
3324
3772
|
}, keyof Plugins> & {
|
|
3325
3773
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
|
3326
3774
|
};
|
|
3327
3775
|
}
|
|
3328
3776
|
declare const BaseClient_base: ClientConstructor<{}>;
|
|
3329
|
-
declare class BaseClient extends BaseClient_base<
|
|
3777
|
+
declare class BaseClient extends BaseClient_base<[]> {
|
|
3330
3778
|
}
|
|
3331
3779
|
|
|
3332
3780
|
declare type BranchResolutionOptions = {
|
|
@@ -3345,4 +3793,4 @@ declare class XataError extends Error {
|
|
|
3345
3793
|
constructor(message: string, status: number);
|
|
3346
3794
|
}
|
|
3347
3795
|
|
|
3348
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor,
|
|
3796
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, 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, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, 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 };
|