@xata.io/client 0.0.0-alpha.vff9649a → 0.0.0-alpha.vffe924c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -22,21 +22,20 @@ declare class SimpleCache implements CacheImpl {
22
22
  clear(): Promise<void>;
23
23
  }
24
24
 
25
+ declare abstract class XataPlugin {
26
+ abstract build(options: XataPluginOptions): unknown;
27
+ }
28
+ type XataPluginOptions = ApiExtraProps & {
29
+ cache: CacheImpl;
30
+ host: HostProvider;
31
+ };
32
+
25
33
  type AttributeDictionary = Record<string, string | number | boolean | undefined>;
26
34
  type TraceFunction = <T>(name: string, fn: (options: {
27
35
  name?: string;
28
36
  setAttributes: (attrs: AttributeDictionary) => void;
29
37
  }) => T, options?: AttributeDictionary) => Promise<T>;
30
38
 
31
- declare abstract class XataPlugin {
32
- abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
33
- }
34
- type XataPluginOptions = {
35
- getFetchProps: () => Promise<ApiExtraProps>;
36
- cache: CacheImpl;
37
- trace?: TraceFunction;
38
- };
39
-
40
39
  type RequestInit = {
41
40
  body?: string;
42
41
  headers?: Record<string, string>;
@@ -73,26 +72,28 @@ type FetcherExtraProps = {
73
72
  endpoint: 'controlPlane' | 'dataPlane';
74
73
  apiUrl: string;
75
74
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
76
- fetchImpl: FetchImpl;
75
+ fetch: FetchImpl;
77
76
  apiKey: string;
78
77
  trace: TraceFunction;
79
78
  signal?: AbortSignal;
80
79
  clientID?: string;
81
80
  sessionID?: string;
82
81
  clientName?: string;
82
+ xataAgentExtra?: Record<string, string>;
83
83
  fetchOptions?: Record<string, unknown>;
84
84
  };
85
85
 
86
86
  type ControlPlaneFetcherExtraProps = {
87
87
  apiUrl: string;
88
88
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
89
- fetchImpl: FetchImpl;
89
+ fetch: FetchImpl;
90
90
  apiKey: string;
91
91
  trace: TraceFunction;
92
92
  signal?: AbortSignal;
93
93
  clientID?: string;
94
94
  sessionID?: string;
95
95
  clientName?: string;
96
+ xataAgentExtra?: Record<string, string>;
96
97
  };
97
98
  type ErrorWrapper$1<TError> = TError | {
98
99
  status: 'unknown';
@@ -215,6 +216,18 @@ type ListDatabasesResponse = {
215
216
  */
216
217
  databases: DatabaseMetadata[];
217
218
  };
219
+ /**
220
+ * @maxLength 255
221
+ * @minLength 1
222
+ * @pattern [a-zA-Z0-9_\-~]+
223
+ */
224
+ type DBName$1 = string;
225
+ /**
226
+ * @maxLength 255
227
+ * @minLength 1
228
+ * @pattern [a-zA-Z0-9_\-~]+
229
+ */
230
+ type BranchName$1 = string;
218
231
  /**
219
232
  * @example {"repository":"github.com/my/repository","branch":"feature-login","stage":"testing","labels":["epic-100"]}
220
233
  * @x-go-type xata.BranchMetadata
@@ -231,38 +244,35 @@ type BranchMetadata$1 = {
231
244
  stage?: string;
232
245
  labels?: string[];
233
246
  };
247
+ type MigrationStatus$1 = 'completed' | 'pending' | 'failed';
234
248
  /**
235
- * @maxLength 255
236
- * @minLength 1
237
- * @pattern [a-zA-Z0-9_\-~]+
238
- */
239
- type BranchName$1 = string;
240
- /**
241
- * @maxLength 255
242
- * @minLength 1
243
- * @pattern [a-zA-Z0-9_\-~]+
249
+ * Github repository settings for this database (optional)
244
250
  */
245
- type DBName$1 = string;
246
- type MigrationStatus$1 = 'completed' | 'pending' | 'failed';
247
- type ListRegionsResponse = {
251
+ type DatabaseGithubSettings = {
248
252
  /**
249
- * A list of regions where databases can be created
253
+ * Repository owner (user or organization)
250
254
  */
251
- regions: Region[];
255
+ owner: string;
256
+ /**
257
+ * Repository name
258
+ */
259
+ repo: string;
252
260
  };
253
261
  type Region = {
254
262
  id: string;
255
263
  };
264
+ type ListRegionsResponse = {
265
+ /**
266
+ * A list of regions where databases can be created
267
+ */
268
+ regions: Region[];
269
+ };
256
270
 
257
271
  /**
258
272
  * Generated by @openapi-codegen
259
273
  *
260
274
  * @version 1.0
261
275
  */
262
- type SimpleError$1 = {
263
- id?: string;
264
- message: string;
265
- };
266
276
  type BadRequestError$1 = {
267
277
  id?: string;
268
278
  message: string;
@@ -274,6 +284,10 @@ type AuthError$1 = {
274
284
  id?: string;
275
285
  message: string;
276
286
  };
287
+ type SimpleError$1 = {
288
+ id?: string;
289
+ message: string;
290
+ };
277
291
 
278
292
  /**
279
293
  * Generated by @openapi-codegen
@@ -939,6 +953,128 @@ type UpdateDatabaseMetadataVariables = {
939
953
  * Update the color of the selected database
940
954
  */
941
955
  declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
956
+ type RenameDatabasePathParams = {
957
+ /**
958
+ * Workspace ID
959
+ */
960
+ workspaceId: WorkspaceID;
961
+ /**
962
+ * The Database Name
963
+ */
964
+ dbName: DBName$1;
965
+ };
966
+ type RenameDatabaseError = ErrorWrapper$1<{
967
+ status: 400;
968
+ payload: BadRequestError$1;
969
+ } | {
970
+ status: 401;
971
+ payload: AuthError$1;
972
+ } | {
973
+ status: 422;
974
+ payload: SimpleError$1;
975
+ } | {
976
+ status: 423;
977
+ payload: SimpleError$1;
978
+ }>;
979
+ type RenameDatabaseRequestBody = {
980
+ /**
981
+ * @minLength 1
982
+ */
983
+ newName: string;
984
+ };
985
+ type RenameDatabaseVariables = {
986
+ body: RenameDatabaseRequestBody;
987
+ pathParams: RenameDatabasePathParams;
988
+ } & ControlPlaneFetcherExtraProps;
989
+ /**
990
+ * Change the name of an existing database
991
+ */
992
+ declare const renameDatabase: (variables: RenameDatabaseVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
993
+ type GetDatabaseGithubSettingsPathParams = {
994
+ /**
995
+ * Workspace ID
996
+ */
997
+ workspaceId: WorkspaceID;
998
+ /**
999
+ * The Database Name
1000
+ */
1001
+ dbName: DBName$1;
1002
+ };
1003
+ type GetDatabaseGithubSettingsError = ErrorWrapper$1<{
1004
+ status: 400;
1005
+ payload: BadRequestError$1;
1006
+ } | {
1007
+ status: 401;
1008
+ payload: AuthError$1;
1009
+ } | {
1010
+ status: 404;
1011
+ payload: SimpleError$1;
1012
+ }>;
1013
+ type GetDatabaseGithubSettingsVariables = {
1014
+ pathParams: GetDatabaseGithubSettingsPathParams;
1015
+ } & ControlPlaneFetcherExtraProps;
1016
+ /**
1017
+ * Retrieve current Github database settings
1018
+ */
1019
+ declare const getDatabaseGithubSettings: (variables: GetDatabaseGithubSettingsVariables, signal?: AbortSignal) => Promise<DatabaseGithubSettings>;
1020
+ type UpdateDatabaseGithubSettingsPathParams = {
1021
+ /**
1022
+ * Workspace ID
1023
+ */
1024
+ workspaceId: WorkspaceID;
1025
+ /**
1026
+ * The Database Name
1027
+ */
1028
+ dbName: DBName$1;
1029
+ };
1030
+ type UpdateDatabaseGithubSettingsError = ErrorWrapper$1<{
1031
+ status: 400;
1032
+ payload: BadRequestError$1;
1033
+ } | {
1034
+ status: 401;
1035
+ payload: AuthError$1;
1036
+ } | {
1037
+ status: 422;
1038
+ payload: SimpleError$1;
1039
+ } | {
1040
+ status: 423;
1041
+ payload: SimpleError$1;
1042
+ }>;
1043
+ type UpdateDatabaseGithubSettingsVariables = {
1044
+ body: DatabaseGithubSettings;
1045
+ pathParams: UpdateDatabaseGithubSettingsPathParams;
1046
+ } & ControlPlaneFetcherExtraProps;
1047
+ /**
1048
+ * Map the database to a Github repository, Xata will create database branch previews for all new branches/PRs in the repo.
1049
+ */
1050
+ declare const updateDatabaseGithubSettings: (variables: UpdateDatabaseGithubSettingsVariables, signal?: AbortSignal) => Promise<DatabaseGithubSettings>;
1051
+ type DeleteDatabaseGithubSettingsPathParams = {
1052
+ /**
1053
+ * Workspace ID
1054
+ */
1055
+ workspaceId: WorkspaceID;
1056
+ /**
1057
+ * The Database Name
1058
+ */
1059
+ dbName: DBName$1;
1060
+ };
1061
+ type DeleteDatabaseGithubSettingsError = ErrorWrapper$1<{
1062
+ status: 400;
1063
+ payload: BadRequestError$1;
1064
+ } | {
1065
+ status: 401;
1066
+ payload: AuthError$1;
1067
+ } | {
1068
+ status: 404;
1069
+ payload: SimpleError$1;
1070
+ }>;
1071
+ type DeleteDatabaseGithubSettingsVariables = {
1072
+ pathParams: DeleteDatabaseGithubSettingsPathParams;
1073
+ } & ControlPlaneFetcherExtraProps;
1074
+ /**
1075
+ * Delete any existing database Github settings
1076
+ */
1077
+ declare const deleteDatabaseGithubSettings: (variables: DeleteDatabaseGithubSettingsVariables, signal?: AbortSignal) => Promise<undefined>;
942
1078
  type ListRegionsPathParams = {
943
1079
  /**
944
1080
  * Workspace ID
@@ -965,20 +1101,39 @@ declare const listRegions: (variables: ListRegionsVariables, signal?: AbortSigna
965
1101
  *
966
1102
  * @version 1.0
967
1103
  */
968
- type ListBranchesResponse = {
969
- databaseName: string;
970
- branches: Branch[];
971
- };
972
- type ListGitBranchesResponse = {
973
- mapping: {
974
- gitBranch: string;
975
- xataBranch: string;
976
- }[];
977
- };
1104
+ /**
1105
+ * @maxLength 255
1106
+ * @minLength 1
1107
+ * @pattern [a-zA-Z0-9_\-~]+
1108
+ */
1109
+ type DBName = string;
1110
+ /**
1111
+ * @format date-time
1112
+ * @x-go-type string
1113
+ */
1114
+ type DateTime = string;
978
1115
  type Branch = {
979
1116
  name: string;
980
1117
  createdAt: DateTime;
981
1118
  };
1119
+ type ListBranchesResponse = {
1120
+ databaseName: string;
1121
+ branches: Branch[];
1122
+ };
1123
+ /**
1124
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
1125
+ *
1126
+ * @maxLength 511
1127
+ * @minLength 1
1128
+ * @pattern [a-zA-Z0-9_\-~]+:[a-zA-Z0-9_\-~]+
1129
+ */
1130
+ type DBBranchName = string;
1131
+ /**
1132
+ * @maxLength 255
1133
+ * @minLength 1
1134
+ * @pattern [a-zA-Z0-9_\-~]+
1135
+ */
1136
+ type BranchName = string;
982
1137
  /**
983
1138
  * @example {"repository":"github.com/my/repository","branch":"feature-login","stage":"testing","labels":["epic-100"]}
984
1139
  * @x-go-type xata.BranchMetadata
@@ -995,86 +1150,71 @@ type BranchMetadata = {
995
1150
  stage?: string;
996
1151
  labels?: string[];
997
1152
  };
998
- type DBBranch = {
999
- databaseName: DBName;
1000
- branchName: BranchName;
1001
- createdAt: DateTime;
1002
- id: string;
1003
- version: number;
1004
- lastMigrationID: string;
1005
- metadata?: BranchMetadata;
1006
- startedFrom?: StartedFromMetadata;
1007
- schema: Schema;
1008
- };
1009
1153
  type StartedFromMetadata = {
1010
1154
  branchName: BranchName;
1011
1155
  dbBranchID: string;
1012
1156
  migrationID: string;
1013
1157
  };
1014
1158
  /**
1015
- * @x-go-type xata.Schema
1159
+ * @maxLength 255
1160
+ * @minLength 1
1161
+ * @pattern [a-zA-Z0-9_\-~]+
1016
1162
  */
1017
- type Schema = {
1018
- tables: Table[];
1019
- tablesOrder?: string[];
1020
- };
1021
- type SchemaEditScript = {
1022
- sourceMigrationID?: string;
1023
- targetMigrationID?: string;
1024
- operations: MigrationOp[];
1163
+ type TableName = string;
1164
+ type ColumnLink = {
1165
+ table: string;
1025
1166
  };
1026
- type Table = {
1027
- id?: string;
1028
- name: TableName;
1029
- columns: Column[];
1030
- revLinks?: RevLink[];
1167
+ type ColumnVector = {
1168
+ /**
1169
+ * @maximum 10000
1170
+ * @minimum 2
1171
+ */
1172
+ dimension: number;
1031
1173
  };
1032
1174
  type Column = {
1033
1175
  name: string;
1034
- type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
1176
+ type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime' | 'vector' | 'file[]' | 'file';
1035
1177
  link?: ColumnLink;
1178
+ vector?: ColumnVector;
1036
1179
  notNull?: boolean;
1037
1180
  defaultValue?: string;
1038
1181
  unique?: boolean;
1039
1182
  columns?: Column[];
1040
1183
  };
1041
- type ColumnLink = {
1042
- table: string;
1043
- };
1044
1184
  type RevLink = {
1045
1185
  linkID: string;
1046
1186
  table: string;
1047
1187
  };
1188
+ type Table = {
1189
+ id?: string;
1190
+ name: TableName;
1191
+ columns: Column[];
1192
+ revLinks?: RevLink[];
1193
+ };
1048
1194
  /**
1049
- * @maxLength 255
1050
- * @minLength 1
1051
- * @pattern [a-zA-Z0-9_\-~]+
1052
- */
1053
- type BranchName = string;
1054
- /**
1055
- * @maxLength 255
1056
- * @minLength 1
1057
- * @pattern [a-zA-Z0-9_\-~]+
1058
- */
1059
- type DBName = string;
1060
- /**
1061
- * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
1062
- *
1063
- * @maxLength 511
1064
- * @minLength 1
1065
- * @pattern [a-zA-Z0-9_\-~]+:[a-zA-Z0-9_\-~]+
1066
- */
1067
- type DBBranchName = string;
1068
- /**
1069
- * @maxLength 255
1070
- * @minLength 1
1071
- * @pattern [a-zA-Z0-9_\-~]+
1195
+ * @x-go-type xata.Schema
1072
1196
  */
1073
- type TableName = string;
1074
- /**
1075
- * @pattern [a-zA-Z0-9_\-~\.]+
1076
- */
1077
- type ColumnName = string;
1197
+ type Schema = {
1198
+ tables: Table[];
1199
+ tablesOrder?: string[];
1200
+ };
1201
+ type DBBranch = {
1202
+ databaseName: DBName;
1203
+ branchName: BranchName;
1204
+ createdAt: DateTime;
1205
+ id: string;
1206
+ version: number;
1207
+ lastMigrationID: string;
1208
+ metadata?: BranchMetadata;
1209
+ startedFrom?: StartedFromMetadata;
1210
+ schema: Schema;
1211
+ };
1212
+ type MigrationStatus = 'completed' | 'pending' | 'failed';
1213
+ type BranchWithCopyID = {
1214
+ branchName: BranchName;
1215
+ dbBranchID: string;
1216
+ copyID: string;
1217
+ };
1078
1218
  type MetricsDatapoint = {
1079
1219
  timestamp: string;
1080
1220
  value: number;
@@ -1083,6 +1223,37 @@ type MetricsLatency = {
1083
1223
  p50?: MetricsDatapoint[];
1084
1224
  p90?: MetricsDatapoint[];
1085
1225
  };
1226
+ type ListGitBranchesResponse = {
1227
+ mapping: {
1228
+ gitBranch: string;
1229
+ xataBranch: string;
1230
+ }[];
1231
+ };
1232
+ type ColumnMigration = {
1233
+ old: Column;
1234
+ ['new']: Column;
1235
+ };
1236
+ type TableMigration = {
1237
+ newColumns?: {
1238
+ [key: string]: Column;
1239
+ };
1240
+ removedColumns?: string[];
1241
+ modifiedColumns?: ColumnMigration[];
1242
+ newColumnOrder: string[];
1243
+ };
1244
+ /**
1245
+ * @example {"newName":"newName","oldName":"oldName"}
1246
+ */
1247
+ type TableRename = {
1248
+ /**
1249
+ * @minLength 1
1250
+ */
1251
+ newName: string;
1252
+ /**
1253
+ * @minLength 1
1254
+ */
1255
+ oldName: string;
1256
+ };
1086
1257
  type BranchMigration = {
1087
1258
  id?: string;
1088
1259
  parentID?: string;
@@ -1101,78 +1272,109 @@ type BranchMigration = {
1101
1272
  newTableOrder: string[];
1102
1273
  renamedTables?: TableRename[];
1103
1274
  };
1104
- type TableMigration = {
1105
- newColumns?: {
1106
- [key: string]: Column;
1107
- };
1108
- removedColumns?: string[];
1109
- modifiedColumns?: ColumnMigration[];
1110
- newColumnOrder: string[];
1111
- };
1112
- type ColumnMigration = {
1113
- old: Column;
1114
- ['new']: Column;
1275
+ /**
1276
+ * @minProperties 1
1277
+ */
1278
+ type FilterExpression = {
1279
+ $exists?: string;
1280
+ $existsNot?: string;
1281
+ $any?: FilterList;
1282
+ $all?: FilterList;
1283
+ $none?: FilterList;
1284
+ $not?: FilterList;
1285
+ } & {
1286
+ [key: string]: FilterColumn;
1115
1287
  };
1116
- type Commit = {
1117
- title?: string;
1118
- message?: string;
1119
- id: string;
1120
- parentID?: string;
1121
- mergeParentID?: string;
1122
- status: MigrationStatus;
1123
- createdAt: DateTime;
1124
- modifiedAt?: DateTime;
1125
- operations: MigrationOp[];
1288
+ type FilterList = FilterExpression | FilterExpression[];
1289
+ type FilterValue = number | string | boolean;
1290
+ type FilterPredicate = FilterValue | FilterPredicate[] | FilterPredicateOp | FilterPredicateRangeOp;
1291
+ type FilterRangeValue = number | string;
1292
+ /**
1293
+ * @maxProperties 1
1294
+ * @minProperties 1
1295
+ */
1296
+ type FilterPredicateOp = {
1297
+ $any?: FilterPredicate[];
1298
+ $all?: FilterPredicate[];
1299
+ $none?: FilterPredicate | FilterPredicate[];
1300
+ $not?: FilterPredicate | FilterPredicate[];
1301
+ $is?: FilterValue | FilterValue[];
1302
+ $isNot?: FilterValue | FilterValue[];
1303
+ $lt?: FilterRangeValue;
1304
+ $le?: FilterRangeValue;
1305
+ $gt?: FilterRangeValue;
1306
+ $ge?: FilterRangeValue;
1307
+ $contains?: string;
1308
+ $startsWith?: string;
1309
+ $endsWith?: string;
1310
+ $pattern?: string;
1126
1311
  };
1127
- type MigrationStatus = 'completed' | 'pending' | 'failed';
1128
1312
  /**
1129
- * Branch schema migration.
1313
+ * @maxProperties 2
1314
+ * @minProperties 2
1130
1315
  */
1131
- type Migration = {
1132
- parentID?: string;
1133
- operations: MigrationOp[];
1316
+ type FilterPredicateRangeOp = {
1317
+ $lt?: FilterRangeValue;
1318
+ $le?: FilterRangeValue;
1319
+ $gt?: FilterRangeValue;
1320
+ $ge?: FilterRangeValue;
1134
1321
  };
1135
1322
  /**
1136
- * Branch schema migration operations.
1323
+ * @maxProperties 1
1324
+ * @minProperties 1
1137
1325
  */
1138
- type MigrationOp = MigrationTableOp | MigrationColumnOp;
1139
- type MigrationTableOp = {
1140
- addTable: TableOpAdd;
1141
- } | {
1142
- removeTable: TableOpRemove;
1143
- } | {
1144
- renameTable: TableOpRename;
1326
+ type FilterColumnIncludes = {
1327
+ $includes?: FilterPredicate;
1328
+ $includesAny?: FilterPredicate;
1329
+ $includesAll?: FilterPredicate;
1330
+ $includesNone?: FilterPredicate;
1145
1331
  };
1146
- type MigrationColumnOp = {
1147
- addColumn: ColumnOpAdd;
1148
- } | {
1149
- removeColumn: ColumnOpRemove;
1332
+ type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
1333
+ type SortOrder = 'asc' | 'desc' | 'random';
1334
+ type SortExpression = string[] | {
1335
+ [key: string]: SortOrder;
1150
1336
  } | {
1151
- renameColumn: ColumnOpRename;
1152
- };
1153
- type TableOpAdd = {
1154
- table: string;
1155
- };
1156
- type TableOpRemove = {
1157
- table: string;
1158
- };
1159
- type TableOpRename = {
1160
- oldName: string;
1161
- newName: string;
1162
- };
1163
- type ColumnOpAdd = {
1164
- table: string;
1165
- column: Column;
1166
- };
1167
- type ColumnOpRemove = {
1168
- table: string;
1169
- column: string;
1170
- };
1171
- type ColumnOpRename = {
1172
- table: string;
1173
- oldName: string;
1174
- newName: string;
1337
+ [key: string]: SortOrder;
1338
+ }[];
1339
+ /**
1340
+ * Pagination settings.
1341
+ */
1342
+ type PageConfig = {
1343
+ /**
1344
+ * Query the next page that follow the cursor.
1345
+ */
1346
+ after?: string;
1347
+ /**
1348
+ * Query the previous page before the cursor.
1349
+ */
1350
+ before?: string;
1351
+ /**
1352
+ * Query the first page from the cursor.
1353
+ */
1354
+ start?: string;
1355
+ /**
1356
+ * Query the last page from the cursor.
1357
+ */
1358
+ end?: string;
1359
+ /**
1360
+ * Set page size. If the size is missing it is read from the cursor. If no cursor is given Xata will choose the default page size.
1361
+ *
1362
+ * @default 20
1363
+ */
1364
+ size?: number;
1365
+ /**
1366
+ * Use offset to skip entries. To skip pages set offset to a multiple of size.
1367
+ *
1368
+ * @default 0
1369
+ */
1370
+ offset?: number;
1175
1371
  };
1372
+ /**
1373
+ * @example name
1374
+ * @example email
1375
+ * @example created_at
1376
+ */
1377
+ type ColumnsProjection = string[];
1176
1378
  /**
1177
1379
  * The migration request number.
1178
1380
  *
@@ -1216,298 +1418,479 @@ type MigrationRequest = {
1216
1418
  */
1217
1419
  target?: string;
1218
1420
  };
1219
- type SortExpression = string[] | {
1220
- [key: string]: SortOrder;
1221
- } | {
1222
- [key: string]: SortOrder;
1223
- }[];
1224
- type SortOrder = 'asc' | 'desc';
1225
- /**
1226
- * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
1227
- * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
1228
- * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
1229
- * to allow two typos in a word.
1230
- *
1231
- * @default 1
1232
- * @maximum 2
1233
- * @minimum 0
1234
- */
1235
- type FuzzinessExpression = number;
1236
- /**
1237
- * 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.
1238
- */
1239
- type PrefixExpression = 'phrase' | 'disabled';
1240
- /**
1241
- * The target expression is used to filter the search results by the target columns.
1242
- */
1243
- type TargetExpression = (string | {
1244
- /**
1245
- * The name of the column.
1246
- */
1247
- column: string;
1248
- /**
1249
- * The weight of the column.
1250
- *
1251
- * @default 1
1252
- * @maximum 10
1253
- * @minimum 1
1254
- */
1255
- weight?: number;
1256
- })[];
1257
1421
  /**
1258
- * @minProperties 1
1422
+ * Records metadata
1259
1423
  */
1260
- type FilterExpression = {
1261
- $exists?: string;
1262
- $existsNot?: string;
1263
- $any?: FilterList;
1264
- $all?: FilterList;
1265
- $none?: FilterList;
1266
- $not?: FilterList;
1267
- } & {
1268
- [key: string]: FilterColumn;
1269
- };
1270
- /**
1271
- * The description of the summaries you wish to receive. Set each key to be the field name
1272
- * you'd like for the summary. These names must not collide with other columns you've
1273
- * requested from `columns`; including implicit requests like `settings.*`.
1274
- *
1275
- * The value for each key needs to be an object. This object should contain one key and one
1276
- * value only. In this object, the key should be set to the summary function you wish to use
1277
- * and the value set to the column name to be summarized.
1278
- *
1279
- * The column being summarized cannot be an internal column (id, xata.*), nor the base of
1280
- * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
1281
- * `settings.dark_mode` but not `settings` nor `settings.*`.
1282
- *
1283
- * @example {"all_users":{"count":"*"},"total_created":{"count":"created_at"},"min_cost":{"min":"cost"},"max_happiness":{"max":"happiness"},"total_revenue":{"sum":"revenue"},"average_speed":{"average":"speed"}}
1284
- * @x-go-type xbquery.SummaryList
1424
+ type RecordsMetadata = {
1425
+ page: {
1426
+ /**
1427
+ * last record id
1428
+ */
1429
+ cursor: string;
1430
+ /**
1431
+ * true if more records can be fetched
1432
+ */
1433
+ more: boolean;
1434
+ /**
1435
+ * the number of records returned per page
1436
+ */
1437
+ size: number;
1438
+ };
1439
+ };
1440
+ type TableOpAdd = {
1441
+ table: string;
1442
+ };
1443
+ type TableOpRemove = {
1444
+ table: string;
1445
+ };
1446
+ type TableOpRename = {
1447
+ oldName: string;
1448
+ newName: string;
1449
+ };
1450
+ type MigrationTableOp = {
1451
+ addTable: TableOpAdd;
1452
+ } | {
1453
+ removeTable: TableOpRemove;
1454
+ } | {
1455
+ renameTable: TableOpRename;
1456
+ };
1457
+ type ColumnOpAdd = {
1458
+ table: string;
1459
+ column: Column;
1460
+ };
1461
+ type ColumnOpRemove = {
1462
+ table: string;
1463
+ column: string;
1464
+ };
1465
+ type ColumnOpRename = {
1466
+ table: string;
1467
+ oldName: string;
1468
+ newName: string;
1469
+ };
1470
+ type MigrationColumnOp = {
1471
+ addColumn: ColumnOpAdd;
1472
+ } | {
1473
+ removeColumn: ColumnOpRemove;
1474
+ } | {
1475
+ renameColumn: ColumnOpRename;
1476
+ };
1477
+ /**
1478
+ * Branch schema migration operations.
1285
1479
  */
1286
- type SummaryExpressionList = {
1287
- [key: string]: SummaryExpression;
1480
+ type MigrationOp = MigrationTableOp | MigrationColumnOp;
1481
+ type Commit = {
1482
+ title?: string;
1483
+ message?: string;
1484
+ id: string;
1485
+ parentID?: string;
1486
+ checksum: string;
1487
+ mergeParentID?: string;
1488
+ createdAt: DateTime;
1489
+ operations: MigrationOp[];
1490
+ };
1491
+ type SchemaEditScript = {
1492
+ sourceMigrationID?: string;
1493
+ targetMigrationID?: string;
1494
+ operations: MigrationOp[];
1495
+ };
1496
+ type BranchOp = {
1497
+ id: string;
1498
+ parentID?: string;
1499
+ title?: string;
1500
+ message?: string;
1501
+ status: MigrationStatus;
1502
+ createdAt: DateTime;
1503
+ modifiedAt?: DateTime;
1504
+ migration?: Commit;
1288
1505
  };
1289
1506
  /**
1290
- * A summary expression is the description of a single summary operation. It consists of a single
1291
- * key representing the operation, and a value representing the column to be operated on.
1292
- *
1293
- * The column being summarized cannot be an internal column (id, xata.*), nor the base of
1294
- * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
1295
- * `settings.dark_mode` but not `settings` nor `settings.*`.
1296
- *
1297
- * We currently support several aggregation functions. Not all functions can be run on all column
1298
- * types.
1299
- *
1300
- * - `count` is used to count the number of records in each group. Use `{"count": "*"}` to count
1301
- * all columns present, otherwise `{"count": "<column_path>"}` to count the number of non-null
1302
- * values are present at column path.
1303
- *
1304
- * Count can be used on any column type, and always returns an int.
1305
- *
1306
- * - `min` calculates the minimum value in each group. `min` is compatible with most types;
1307
- * string, multiple, text, email, int, float, and datetime. It returns a value of the same
1308
- * type as operated on. This means that `{"lowest_latency": {"min": "latency"}}` where
1309
- * `latency` is an int, will always return an int.
1310
- *
1311
- * - `max` calculates the maximum value in each group. `max` shares the same compatibility as
1312
- * `min`.
1313
- *
1314
- * - `sum` adds up all values in a group. `sum` can be run on `int` and `float` types, and will
1315
- * return a value of the same type as requested.
1316
- *
1317
- * - `average` averages all values in a group. `average` can be run on `int` and `float` types, and
1318
- * always returns a float.
1319
- *
1320
- * @example {"count":"deleted_at"}
1321
- * @x-go-type xbquery.Summary
1507
+ * Branch schema migration.
1322
1508
  */
1323
- type SummaryExpression = Record<string, any>;
1509
+ type Migration = {
1510
+ parentID?: string;
1511
+ operations: MigrationOp[];
1512
+ };
1513
+ type MigrationObject = {
1514
+ title?: string;
1515
+ message?: string;
1516
+ id: string;
1517
+ parentID?: string;
1518
+ checksum: string;
1519
+ operations: MigrationOp[];
1520
+ };
1324
1521
  /**
1325
- * The description of the aggregations you wish to receive.
1326
- *
1327
- * @example {"totalCount":{"count":"*"},"dailyActiveUsers":{"dateHistogram":{"column":"date","interval":"1d","aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}}}}}
1522
+ * @pattern [a-zA-Z0-9_\-~\.]+
1328
1523
  */
1329
- type AggExpressionMap = {
1330
- [key: string]: AggExpression;
1524
+ type ColumnName = string;
1525
+ /**
1526
+ * Insert operation
1527
+ */
1528
+ type TransactionInsertOp = {
1529
+ /**
1530
+ * The table name
1531
+ */
1532
+ table: string;
1533
+ /**
1534
+ * The record to insert. The `id` field is optional; when specified, it will be used as the ID for the record.
1535
+ */
1536
+ record: {
1537
+ [key: string]: any;
1538
+ };
1539
+ /**
1540
+ * The version of the record you expect to be overwriting. Only valid with an
1541
+ * explicit ID is also set in the `record` key.
1542
+ */
1543
+ ifVersion?: number;
1544
+ /**
1545
+ * createOnly is used to change how Xata acts when an explicit ID is set in the `record` key.
1546
+ *
1547
+ * If `createOnly` is set to `true`, Xata will only attempt to insert the record. If there's a conflict, Xata
1548
+ * will cancel the transaction.
1549
+ *
1550
+ * If `createOnly` is set to `false`, Xata will attempt to insert the record. If there's no
1551
+ * conflict, the record is inserted. If there is a conflict, Xata will replace the record.
1552
+ */
1553
+ createOnly?: boolean;
1554
+ /**
1555
+ * If set, the call will return the requested fields as part of the response.
1556
+ */
1557
+ columns?: string[];
1331
1558
  };
1332
1559
  /**
1333
- * The description of a single aggregation operation. It is an object with only one key-value pair.
1334
- * The key represents the aggregation type, while the value is an object with the configuration of
1335
- * the aggregation.
1336
- *
1337
- * @x-go-type xata.AggExpression
1560
+ * @maxLength 255
1561
+ * @minLength 1
1562
+ * @pattern [a-zA-Z0-9_-~:]+
1338
1563
  */
1339
- type AggExpression = {
1340
- count?: CountAgg;
1341
- } | {
1342
- sum?: SumAgg;
1343
- } | {
1344
- max?: MaxAgg;
1345
- } | {
1346
- min?: MinAgg;
1347
- } | {
1348
- average?: AverageAgg;
1349
- } | {
1350
- uniqueCount?: UniqueCountAgg;
1564
+ type RecordID = string;
1565
+ /**
1566
+ * Update operation
1567
+ */
1568
+ type TransactionUpdateOp = {
1569
+ /**
1570
+ * The table name
1571
+ */
1572
+ table: string;
1573
+ id: RecordID;
1574
+ /**
1575
+ * The fields of the record you'd like to update
1576
+ */
1577
+ fields: {
1578
+ [key: string]: any;
1579
+ };
1580
+ /**
1581
+ * The version of the record you expect to be updating
1582
+ */
1583
+ ifVersion?: number;
1584
+ /**
1585
+ * Xata will insert this record if it cannot be found.
1586
+ */
1587
+ upsert?: boolean;
1588
+ /**
1589
+ * If set, the call will return the requested fields as part of the response.
1590
+ */
1591
+ columns?: string[];
1592
+ };
1593
+ /**
1594
+ * A delete operation. The transaction will continue if no record matches the ID by default. To override this behaviour, set failIfMissing to true.
1595
+ */
1596
+ type TransactionDeleteOp = {
1597
+ /**
1598
+ * The table name
1599
+ */
1600
+ table: string;
1601
+ id: RecordID;
1602
+ /**
1603
+ * If true, the transaction will fail when the record doesn't exist.
1604
+ */
1605
+ failIfMissing?: boolean;
1606
+ /**
1607
+ * If set, the call will return the requested fields as part of the response.
1608
+ */
1609
+ columns?: string[];
1610
+ };
1611
+ /**
1612
+ * Get by id operation.
1613
+ */
1614
+ type TransactionGetOp = {
1615
+ /**
1616
+ * The table name
1617
+ */
1618
+ table: string;
1619
+ id: RecordID;
1620
+ /**
1621
+ * If set, the call will return the requested fields as part of the response.
1622
+ */
1623
+ columns?: string[];
1624
+ };
1625
+ /**
1626
+ * A transaction operation
1627
+ */
1628
+ type TransactionOperation$1 = {
1629
+ insert: TransactionInsertOp;
1351
1630
  } | {
1352
- dateHistogram?: DateHistogramAgg;
1631
+ update: TransactionUpdateOp;
1353
1632
  } | {
1354
- topValues?: TopValuesAgg;
1633
+ ['delete']: TransactionDeleteOp;
1355
1634
  } | {
1356
- numericHistogram?: NumericHistogramAgg;
1635
+ get: TransactionGetOp;
1357
1636
  };
1358
1637
  /**
1359
- * Count the number of records with an optional filter.
1638
+ * Fields to return in the transaction result.
1360
1639
  */
1361
- type CountAgg = {
1362
- filter?: FilterExpression;
1363
- } | '*';
1640
+ type TransactionResultColumns = {
1641
+ [key: string]: any;
1642
+ };
1364
1643
  /**
1365
- * The sum of the numeric values in a particular column.
1644
+ * A result from an insert operation.
1366
1645
  */
1367
- type SumAgg = {
1646
+ type TransactionResultInsert = {
1368
1647
  /**
1369
- * The column on which to compute the sum. Must be a numeric type.
1648
+ * The type of operation who's result is being returned.
1370
1649
  */
1371
- column: string;
1650
+ operation: 'insert';
1651
+ /**
1652
+ * The number of affected rows
1653
+ */
1654
+ rows: number;
1655
+ id: RecordID;
1656
+ columns?: TransactionResultColumns;
1372
1657
  };
1373
1658
  /**
1374
- * The max of the numeric values in a particular column.
1659
+ * A result from an update operation.
1375
1660
  */
1376
- type MaxAgg = {
1661
+ type TransactionResultUpdate = {
1377
1662
  /**
1378
- * The column on which to compute the max. Must be a numeric type.
1663
+ * The type of operation who's result is being returned.
1379
1664
  */
1380
- column: string;
1665
+ operation: 'update';
1666
+ /**
1667
+ * The number of updated rows
1668
+ */
1669
+ rows: number;
1670
+ id: RecordID;
1671
+ columns?: TransactionResultColumns;
1672
+ };
1673
+ /**
1674
+ * A result from a delete operation.
1675
+ */
1676
+ type TransactionResultDelete = {
1677
+ /**
1678
+ * The type of operation who's result is being returned.
1679
+ */
1680
+ operation: 'delete';
1681
+ /**
1682
+ * The number of deleted rows
1683
+ */
1684
+ rows: number;
1685
+ columns?: TransactionResultColumns;
1381
1686
  };
1382
1687
  /**
1383
- * The min of the numeric values in a particular column.
1688
+ * A result from a get operation.
1384
1689
  */
1385
- type MinAgg = {
1690
+ type TransactionResultGet = {
1386
1691
  /**
1387
- * The column on which to compute the min. Must be a numeric type.
1692
+ * The type of operation who's result is being returned.
1388
1693
  */
1389
- column: string;
1694
+ operation: 'get';
1695
+ columns?: TransactionResultColumns;
1390
1696
  };
1391
1697
  /**
1392
- * The average of the numeric values in a particular column.
1698
+ * An ordered array of results from the submitted operations.
1393
1699
  */
1394
- type AverageAgg = {
1395
- /**
1396
- * The column on which to compute the average. Must be a numeric type.
1397
- */
1398
- column: string;
1700
+ type TransactionSuccess = {
1701
+ results: (TransactionResultInsert | TransactionResultUpdate | TransactionResultDelete | TransactionResultGet)[];
1399
1702
  };
1400
1703
  /**
1401
- * Count the number of distinct values in a particular column.
1704
+ * An error message from a failing transaction operation
1402
1705
  */
1403
- type UniqueCountAgg = {
1706
+ type TransactionError = {
1404
1707
  /**
1405
- * The column from where to count the unique values.
1708
+ * The index of the failing operation
1406
1709
  */
1407
- column: string;
1710
+ index: number;
1408
1711
  /**
1409
- * The threshold under which the unique count is exact. If the number of unique
1410
- * values in the column is higher than this threshold, the results are approximative.
1411
- * Maximum value is 40,000, default value is 3000.
1712
+ * The error message
1412
1713
  */
1413
- precisionThreshold?: number;
1714
+ message: string;
1414
1715
  };
1415
1716
  /**
1416
- * Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
1717
+ * An array of errors, with indices, from the transaction.
1417
1718
  */
1418
- type DateHistogramAgg = {
1419
- /**
1420
- * The column to use for bucketing. Must be of type datetime.
1421
- */
1422
- column: string;
1423
- /**
1424
- * The fixed interval to use when bucketing.
1425
- * It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
1426
- *
1427
- * @pattern ^(\d+)(d|h|m|s|ms)$
1428
- */
1429
- interval?: string;
1719
+ type TransactionFailure = {
1430
1720
  /**
1431
- * The calendar-aware interval to use when bucketing. Possible values are: `minute`,
1432
- * `hour`, `day`, `week`, `month`, `quarter`, `year`.
1721
+ * The request ID.
1433
1722
  */
1434
- calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1723
+ id: string;
1435
1724
  /**
1436
- * The timezone to use for bucketing. By default, UTC is assumed.
1437
- * The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
1438
- * `-08:00`.
1439
- *
1440
- * @pattern ^[+-][01]\d:[0-5]\d$
1725
+ * An array of errors from the submitted operations.
1441
1726
  */
1442
- timezone?: string;
1443
- aggs?: AggExpressionMap;
1727
+ errors: TransactionError[];
1444
1728
  };
1445
1729
  /**
1446
- * Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
1447
- * The top values as ordered by the number of records (`$count`) are returned.
1730
+ * Object column value
1448
1731
  */
1449
- type TopValuesAgg = {
1732
+ type ObjectValue = {
1733
+ [key: string]: string | boolean | number | string[] | number[] | DateTime | ObjectValue;
1734
+ };
1735
+ /**
1736
+ * Unique file identifier
1737
+ *
1738
+ * @maxLength 255
1739
+ * @minLength 1
1740
+ * @pattern [a-zA-Z0-9_-~:]+
1741
+ */
1742
+ type FileItemID = string;
1743
+ /**
1744
+ * File name
1745
+ *
1746
+ * @maxLength 1024
1747
+ * @minLength 0
1748
+ * @pattern [0-9a-zA-Z!\-_\.\*'\(\)]*
1749
+ */
1750
+ type FileName = string;
1751
+ /**
1752
+ * Media type
1753
+ *
1754
+ * @maxLength 255
1755
+ * @minLength 3
1756
+ * @pattern ^\w+/[-+.\w]+$
1757
+ */
1758
+ type MediaType = string;
1759
+ /**
1760
+ * Object representing a file in an array
1761
+ */
1762
+ type InputFileEntry = {
1763
+ id?: FileItemID;
1764
+ name?: FileName;
1765
+ mediaType?: MediaType;
1450
1766
  /**
1451
- * The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
1767
+ * Base64 encoded content
1768
+ *
1769
+ * @maxLength 20971520
1452
1770
  */
1453
- column: string;
1454
- aggs?: AggExpressionMap;
1771
+ base64Content?: string;
1455
1772
  /**
1456
- * The maximum number of unique values to return.
1457
- *
1458
- * @default 10
1459
- * @maximum 1000
1773
+ * Enable public access to the file
1460
1774
  */
1461
- size?: number;
1775
+ enablePublicUrl?: boolean;
1776
+ /**
1777
+ * Time to live for signed URLs
1778
+ */
1779
+ signedUrlTimeout?: number;
1462
1780
  };
1463
1781
  /**
1464
- * Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
1782
+ * Array of file entries
1783
+ *
1784
+ * @maxItems 50
1465
1785
  */
1466
- type NumericHistogramAgg = {
1786
+ type InputFileArray = InputFileEntry[];
1787
+ /**
1788
+ * Object representing a file
1789
+ *
1790
+ * @x-go-type file.InputFile
1791
+ */
1792
+ type InputFile = {
1793
+ name: FileName;
1794
+ mediaType?: MediaType;
1467
1795
  /**
1468
- * The column to use for bucketing. Must be of numeric type.
1796
+ * Base64 encoded content
1797
+ *
1798
+ * @maxLength 20971520
1469
1799
  */
1470
- column: string;
1800
+ base64Content?: string;
1471
1801
  /**
1472
- * The numeric interval to use for bucketing. The resulting buckets will be ranges
1473
- * with this value as size.
1474
- *
1475
- * @minimum 0
1802
+ * Enable public access to the file
1476
1803
  */
1477
- interval: number;
1804
+ enablePublicUrl?: boolean;
1478
1805
  /**
1479
- * By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
1480
- * boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
1481
- * but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
1482
- * to 50.
1483
- *
1484
- * @default 0
1806
+ * Time to live for signed URLs
1485
1807
  */
1486
- offset?: number;
1487
- aggs?: AggExpressionMap;
1808
+ signedUrlTimeout?: number;
1488
1809
  };
1489
- type HighlightExpression = {
1810
+ /**
1811
+ * Xata input record
1812
+ */
1813
+ type DataInputRecord = {
1814
+ [key: string]: RecordID | string | boolean | number | string[] | number[] | DateTime | ObjectValue | InputFileArray | InputFile | null;
1815
+ };
1816
+ /**
1817
+ * Xata Table Record Metadata
1818
+ */
1819
+ type RecordMeta = {
1820
+ id: RecordID;
1821
+ xata: {
1822
+ /**
1823
+ * The record's version. Can be used for optimistic concurrency control.
1824
+ */
1825
+ version: number;
1826
+ /**
1827
+ * The time when the record was created.
1828
+ */
1829
+ createdAt?: string;
1830
+ /**
1831
+ * The time when the record was last updated.
1832
+ */
1833
+ updatedAt?: string;
1834
+ /**
1835
+ * The record's table name. APIs that return records from multiple tables will set this field accordingly.
1836
+ */
1837
+ table?: string;
1838
+ /**
1839
+ * Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
1840
+ */
1841
+ highlight?: {
1842
+ [key: string]: string[] | {
1843
+ [key: string]: any;
1844
+ };
1845
+ };
1846
+ /**
1847
+ * The record's relevancy score. This is returned by the search APIs.
1848
+ */
1849
+ score?: number;
1850
+ /**
1851
+ * Encoding/Decoding errors
1852
+ */
1853
+ warnings?: string[];
1854
+ };
1855
+ };
1856
+ /**
1857
+ * File metadata
1858
+ */
1859
+ type FileResponse = {
1860
+ id?: FileItemID;
1861
+ name: FileName;
1862
+ mediaType: MediaType;
1490
1863
  /**
1491
- * Set to `false` to disable highlighting. By default it is `true`.
1864
+ * @format int64
1492
1865
  */
1493
- enabled?: boolean;
1866
+ size: number;
1494
1867
  /**
1495
- * Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
1868
+ * @format int64
1496
1869
  */
1497
- encodeHTML?: boolean;
1870
+ version: number;
1871
+ attributes?: Record<string, any>;
1872
+ };
1873
+ type ProjectionConfig = {
1874
+ name?: string;
1498
1875
  };
1876
+ type QueryColumnsProjection = (string | ProjectionConfig)[];
1499
1877
  /**
1500
- * Booster Expression
1501
- *
1502
- * @x-go-type xata.BoosterExpression
1878
+ * The target expression is used to filter the search results by the target columns.
1503
1879
  */
1504
- type BoosterExpression = {
1505
- valueBooster?: ValueBooster$1;
1506
- } | {
1507
- numericBooster?: NumericBooster$1;
1508
- } | {
1509
- dateBooster?: DateBooster$1;
1510
- };
1880
+ type TargetExpression = (string | {
1881
+ /**
1882
+ * The name of the column.
1883
+ */
1884
+ column: string;
1885
+ /**
1886
+ * The weight of the column.
1887
+ *
1888
+ * @default 1
1889
+ * @maximum 10
1890
+ * @minimum 1
1891
+ */
1892
+ weight?: number;
1893
+ })[];
1511
1894
  /**
1512
1895
  * Boost records with a particular value for a column.
1513
1896
  */
@@ -1521,7 +1904,7 @@ type ValueBooster$1 = {
1521
1904
  */
1522
1905
  value: string | number | boolean;
1523
1906
  /**
1524
- * The factor with which to multiply the score of the record.
1907
+ * The factor with which to multiply the added boost.
1525
1908
  */
1526
1909
  factor: number;
1527
1910
  /**
@@ -1563,7 +1946,8 @@ type NumericBooster$1 = {
1563
1946
  /**
1564
1947
  * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
1565
1948
  * the more the score is decayed. The decay function uses an exponential function. For example if origin is "now", and scale is 10 days and decay is 0.5, it
1566
- * should be interpreted as: a record with a date 10 days before/after origin will score 2 times less than a record with the date at origin.
1949
+ * should be interpreted as: a record with a date 10 days before/after origin will be boosted 2 times less than a record with the date at origin.
1950
+ * The result of the exponential function is a boost between 0 and 1. The "factor" allows you to control how impactful this boost is, by multiplying it with a given value.
1567
1951
  */
1568
1952
  type DateBooster$1 = {
1569
1953
  /**
@@ -1576,7 +1960,7 @@ type DateBooster$1 = {
1576
1960
  */
1577
1961
  origin?: string;
1578
1962
  /**
1579
- * The duration at which distance from origin the score is decayed with factor, using an exponential function. It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
1963
+ * The duration at which distance from origin the score is decayed with factor, using an exponential function. It is formatted as number + units, for example: `5d`, `20m`, `10s`.
1580
1964
  *
1581
1965
  * @pattern ^(\d+)(d|h|m|s|ms)$
1582
1966
  */
@@ -1585,88 +1969,53 @@ type DateBooster$1 = {
1585
1969
  * The decay factor to expect at "scale" distance from the "origin".
1586
1970
  */
1587
1971
  decay: number;
1972
+ /**
1973
+ * The factor with which to multiply the added boost.
1974
+ *
1975
+ * @minimum 0
1976
+ */
1977
+ factor?: number;
1588
1978
  /**
1589
1979
  * Only apply this booster to the records for which the provided filter matches.
1590
1980
  */
1591
1981
  ifMatchesFilter?: FilterExpression;
1592
1982
  };
1593
- type FilterList = FilterExpression | FilterExpression[];
1594
- type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
1595
- /**
1596
- * @maxProperties 1
1597
- * @minProperties 1
1598
- */
1599
- type FilterColumnIncludes = {
1600
- $includes?: FilterPredicate;
1601
- $includesAny?: FilterPredicate;
1602
- $includesAll?: FilterPredicate;
1603
- $includesNone?: FilterPredicate;
1604
- };
1605
- type FilterPredicate = FilterValue | FilterPredicate[] | FilterPredicateOp | FilterPredicateRangeOp;
1606
- /**
1607
- * @maxProperties 1
1608
- * @minProperties 1
1609
- */
1610
- type FilterPredicateOp = {
1611
- $any?: FilterPredicate[];
1612
- $all?: FilterPredicate[];
1613
- $none?: FilterPredicate | FilterPredicate[];
1614
- $not?: FilterPredicate | FilterPredicate[];
1615
- $is?: FilterValue | FilterValue[];
1616
- $isNot?: FilterValue | FilterValue[];
1617
- $lt?: FilterRangeValue;
1618
- $le?: FilterRangeValue;
1619
- $gt?: FilterRangeValue;
1620
- $ge?: FilterRangeValue;
1621
- $contains?: string;
1622
- $startsWith?: string;
1623
- $endsWith?: string;
1624
- $pattern?: string;
1625
- };
1626
1983
  /**
1627
- * @maxProperties 2
1628
- * @minProperties 2
1984
+ * Booster Expression
1985
+ *
1986
+ * @x-go-type xata.BoosterExpression
1629
1987
  */
1630
- type FilterPredicateRangeOp = {
1631
- $lt?: FilterRangeValue;
1632
- $le?: FilterRangeValue;
1633
- $gt?: FilterRangeValue;
1634
- $ge?: FilterRangeValue;
1988
+ type BoosterExpression = {
1989
+ valueBooster?: ValueBooster$1;
1990
+ } | {
1991
+ numericBooster?: NumericBooster$1;
1992
+ } | {
1993
+ dateBooster?: DateBooster$1;
1635
1994
  };
1636
- type FilterRangeValue = number | string;
1637
- type FilterValue = number | string | boolean;
1638
- /**
1639
- * Pagination settings.
1640
- */
1641
- type PageConfig = {
1642
- /**
1643
- * Query the next page that follow the cursor.
1644
- */
1645
- after?: string;
1646
- /**
1647
- * Query the previous page before the cursor.
1648
- */
1649
- before?: string;
1650
- /**
1651
- * Query the first page from the cursor.
1652
- */
1653
- start?: string;
1654
- /**
1655
- * Query the last page from the cursor.
1656
- */
1657
- end?: string;
1995
+ /**
1996
+ * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
1997
+ * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
1998
+ * character typos per word are tolerated by search. You can set it to 0 to remove the typo tolerance or set it to 2
1999
+ * to allow two typos in a word.
2000
+ *
2001
+ * @default 1
2002
+ * @maximum 2
2003
+ * @minimum 0
2004
+ */
2005
+ type FuzzinessExpression = number;
2006
+ /**
2007
+ * 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.
2008
+ */
2009
+ type PrefixExpression = 'phrase' | 'disabled';
2010
+ type HighlightExpression = {
1658
2011
  /**
1659
- * Set page size. If the size is missing it is read from the cursor. If no cursor is given Xata will choose the default page size.
1660
- *
1661
- * @default 20
2012
+ * Set to `false` to disable highlighting. By default it is `true`.
1662
2013
  */
1663
- size?: number;
2014
+ enabled?: boolean;
1664
2015
  /**
1665
- * Use offset to skip entries. To skip pages set offset to a multiple of size.
1666
- *
1667
- * @default 0
2016
+ * Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
1668
2017
  */
1669
- offset?: number;
2018
+ encodeHTML?: boolean;
1670
2019
  };
1671
2020
  /**
1672
2021
  * Pagination settings for the search endpoints.
@@ -1688,235 +2037,250 @@ type SearchPageConfig = {
1688
2037
  offset?: number;
1689
2038
  };
1690
2039
  /**
1691
- * @example name
1692
- * @example email
1693
- * @example created_at
1694
- */
1695
- type ColumnsProjection = string[];
1696
- /**
1697
- * Xata Table Record Metadata
2040
+ * Xata Table SQL Record
1698
2041
  */
1699
- type RecordMeta = {
1700
- id: RecordID;
1701
- xata: {
1702
- /**
1703
- * The record's version. Can be used for optimistic concurrency control.
1704
- */
1705
- version: number;
1706
- /**
1707
- * The record's table name. APIs that return records from multiple tables will set this field accordingly.
1708
- */
1709
- table?: string;
1710
- /**
1711
- * Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
1712
- */
1713
- highlight?: {
1714
- [key: string]: string[] | {
1715
- [key: string]: any;
1716
- };
1717
- };
1718
- /**
1719
- * The record's relevancy score. This is returned by the search APIs.
1720
- */
1721
- score?: number;
1722
- /**
1723
- * Encoding/Decoding errors
1724
- */
1725
- warnings?: string[];
1726
- };
2042
+ type SQLRecord = {
2043
+ [key: string]: any;
1727
2044
  };
1728
2045
  /**
1729
- * @pattern [a-zA-Z0-9_-~:]+
2046
+ * A summary expression is the description of a single summary operation. It consists of a single
2047
+ * key representing the operation, and a value representing the column to be operated on.
2048
+ *
2049
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
2050
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
2051
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
2052
+ *
2053
+ * We currently support several aggregation functions. Not all functions can be run on all column
2054
+ * types.
2055
+ *
2056
+ * - `count` is used to count the number of records in each group. Use `{"count": "*"}` to count
2057
+ * all columns present, otherwise `{"count": "<column_path>"}` to count the number of non-null
2058
+ * values are present at column path.
2059
+ *
2060
+ * Count can be used on any column type, and always returns an int.
2061
+ *
2062
+ * - `min` calculates the minimum value in each group. `min` is compatible with most types;
2063
+ * string, multiple, text, email, int, float, and datetime. It returns a value of the same
2064
+ * type as operated on. This means that `{"lowest_latency": {"min": "latency"}}` where
2065
+ * `latency` is an int, will always return an int.
2066
+ *
2067
+ * - `max` calculates the maximum value in each group. `max` shares the same compatibility as
2068
+ * `min`.
2069
+ *
2070
+ * - `sum` adds up all values in a group. `sum` can be run on `int` and `float` types, and will
2071
+ * return a value of the same type as requested.
2072
+ *
2073
+ * - `average` averages all values in a group. `average` can be run on `int` and `float` types, and
2074
+ * always returns a float.
2075
+ *
2076
+ * @example {"count":"deleted_at"}
2077
+ * @x-go-type xbquery.Summary
1730
2078
  */
1731
- type RecordID = string;
2079
+ type SummaryExpression = Record<string, any>;
1732
2080
  /**
1733
- * @example {"newName":"newName","oldName":"oldName"}
2081
+ * The description of the summaries you wish to receive. Set each key to be the field name
2082
+ * you'd like for the summary. These names must not collide with other columns you've
2083
+ * requested from `columns`; including implicit requests like `settings.*`.
2084
+ *
2085
+ * The value for each key needs to be an object. This object should contain one key and one
2086
+ * value only. In this object, the key should be set to the summary function you wish to use
2087
+ * and the value set to the column name to be summarized.
2088
+ *
2089
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
2090
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
2091
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
2092
+ *
2093
+ * @example {"all_users":{"count":"*"},"total_created":{"count":"created_at"},"min_cost":{"min":"cost"},"max_happiness":{"max":"happiness"},"total_revenue":{"sum":"revenue"},"average_speed":{"average":"speed"}}
2094
+ * @x-go-type xbquery.SummaryList
1734
2095
  */
1735
- type TableRename = {
1736
- /**
1737
- * @minLength 1
1738
- */
1739
- newName: string;
1740
- /**
1741
- * @minLength 1
1742
- */
1743
- oldName: string;
2096
+ type SummaryExpressionList = {
2097
+ [key: string]: SummaryExpression;
1744
2098
  };
1745
2099
  /**
1746
- * Records metadata
2100
+ * Count the number of records with an optional filter.
1747
2101
  */
1748
- type RecordsMetadata = {
1749
- page: {
1750
- /**
1751
- * last record id
1752
- */
1753
- cursor: string;
1754
- /**
1755
- * true if more records can be fetch
1756
- */
1757
- more: boolean;
1758
- };
1759
- };
1760
- type AggResponse$1 = (number | null) | {
1761
- values: ({
1762
- $key: string | number;
1763
- $count: number;
1764
- } & {
1765
- [key: string]: AggResponse$1;
1766
- })[];
1767
- };
2102
+ type CountAgg = {
2103
+ filter?: FilterExpression;
2104
+ } | '*';
1768
2105
  /**
1769
- * A transaction operation
2106
+ * The sum of the numeric values in a particular column.
1770
2107
  */
1771
- type TransactionOperation$1 = {
1772
- insert: TransactionInsertOp;
1773
- } | {
1774
- update: TransactionUpdateOp;
1775
- } | {
1776
- ['delete']: TransactionDeleteOp;
2108
+ type SumAgg = {
2109
+ /**
2110
+ * The column on which to compute the sum. Must be a numeric type.
2111
+ */
2112
+ column: string;
1777
2113
  };
1778
2114
  /**
1779
- * Insert operation
2115
+ * The max of the numeric values in a particular column.
1780
2116
  */
1781
- type TransactionInsertOp = {
1782
- /**
1783
- * The table name
1784
- */
1785
- table: string;
1786
- /**
1787
- * The record to insert. The `id` field is optional; when specified, it will be used as the ID for the record.
1788
- */
1789
- record: {
1790
- [key: string]: any;
1791
- };
1792
- /**
1793
- * The version of the record you expect to be overwriting. Only valid with an
1794
- * explicit ID is also set in the `record` key.
1795
- */
1796
- ifVersion?: number;
2117
+ type MaxAgg = {
1797
2118
  /**
1798
- * createOnly is used to change how Xata acts when an explicit ID is set in the `record` key.
1799
- *
1800
- * If `createOnly` is set to `true`, Xata will only attempt to insert the record. If there's a conflict, Xata
1801
- * will cancel the transaction.
1802
- *
1803
- * If `createOnly` is set to `false`, Xata will attempt to insert the record. If there's no
1804
- * conflict, the record is inserted. If there is a conflict, Xata will replace the record.
2119
+ * The column on which to compute the max. Must be a numeric type.
1805
2120
  */
1806
- createOnly?: boolean;
2121
+ column: string;
1807
2122
  };
1808
2123
  /**
1809
- * Update operation
2124
+ * The min of the numeric values in a particular column.
1810
2125
  */
1811
- type TransactionUpdateOp = {
1812
- /**
1813
- * The table name
1814
- */
1815
- table: string;
1816
- id: RecordID;
1817
- /**
1818
- * The fields of the record you'd like to update
1819
- */
1820
- fields: {
1821
- [key: string]: any;
1822
- };
2126
+ type MinAgg = {
1823
2127
  /**
1824
- * The version of the record you expect to be updating
2128
+ * The column on which to compute the min. Must be a numeric type.
1825
2129
  */
1826
- ifVersion?: number;
2130
+ column: string;
2131
+ };
2132
+ /**
2133
+ * The average of the numeric values in a particular column.
2134
+ */
2135
+ type AverageAgg = {
1827
2136
  /**
1828
- * Xata will insert this record if it cannot be found.
2137
+ * The column on which to compute the average. Must be a numeric type.
1829
2138
  */
1830
- upsert?: boolean;
2139
+ column: string;
1831
2140
  };
1832
2141
  /**
1833
- * A delete operation. The transaction will continue if no record matches the ID.
2142
+ * Count the number of distinct values in a particular column.
1834
2143
  */
1835
- type TransactionDeleteOp = {
2144
+ type UniqueCountAgg = {
1836
2145
  /**
1837
- * The table name
2146
+ * The column from where to count the unique values.
1838
2147
  */
1839
- table: string;
1840
- id: RecordID;
2148
+ column: string;
2149
+ /**
2150
+ * The threshold under which the unique count is exact. If the number of unique
2151
+ * values in the column is higher than this threshold, the results are approximate.
2152
+ * Maximum value is 40,000, default value is 3000.
2153
+ */
2154
+ precisionThreshold?: number;
1841
2155
  };
1842
2156
  /**
1843
- * An ordered array of results from the submitted operations.
2157
+ * The description of the aggregations you wish to receive.
2158
+ *
2159
+ * @example {"totalCount":{"count":"*"},"dailyActiveUsers":{"dateHistogram":{"column":"date","interval":"1d","aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}}}}}
1844
2160
  */
1845
- type TransactionSuccess = {
1846
- results: (TransactionResultInsert | TransactionResultUpdate | TransactionResultDelete)[];
2161
+ type AggExpressionMap = {
2162
+ [key: string]: AggExpression;
1847
2163
  };
1848
2164
  /**
1849
- * A result from an insert operation.
2165
+ * Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
1850
2166
  */
1851
- type TransactionResultInsert = {
2167
+ type DateHistogramAgg = {
1852
2168
  /**
1853
- * The type of operation who's result is being returned.
2169
+ * The column to use for bucketing. Must be of type datetime.
2170
+ */
2171
+ column: string;
2172
+ /**
2173
+ * The fixed interval to use when bucketing.
2174
+ * It is formatted as number + units, for example: `5d`, `20m`, `10s`.
2175
+ *
2176
+ * @pattern ^(\d+)(d|h|m|s|ms)$
2177
+ */
2178
+ interval?: string;
2179
+ /**
2180
+ * The calendar-aware interval to use when bucketing. Possible values are: `minute`,
2181
+ * `hour`, `day`, `week`, `month`, `quarter`, `year`.
1854
2182
  */
1855
- operation: 'insert';
2183
+ calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1856
2184
  /**
1857
- * The number of affected rows
2185
+ * The timezone to use for bucketing. By default, UTC is assumed.
2186
+ * The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
2187
+ * `-08:00`.
2188
+ *
2189
+ * @pattern ^[+-][01]\d:[0-5]\d$
1858
2190
  */
1859
- rows: number;
1860
- id: RecordID;
2191
+ timezone?: string;
2192
+ aggs?: AggExpressionMap;
1861
2193
  };
1862
2194
  /**
1863
- * A result from an update operation.
2195
+ * Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
2196
+ * The top values as ordered by the number of records (`$count`) are returned.
1864
2197
  */
1865
- type TransactionResultUpdate = {
2198
+ type TopValuesAgg = {
1866
2199
  /**
1867
- * The type of operation who's result is being returned.
2200
+ * The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
1868
2201
  */
1869
- operation: 'update';
2202
+ column: string;
2203
+ aggs?: AggExpressionMap;
1870
2204
  /**
1871
- * The number of updated rows
2205
+ * The maximum number of unique values to return.
2206
+ *
2207
+ * @default 10
2208
+ * @maximum 1000
1872
2209
  */
1873
- rows: number;
1874
- id: RecordID;
2210
+ size?: number;
1875
2211
  };
1876
2212
  /**
1877
- * A result from a delete operation.
2213
+ * Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
1878
2214
  */
1879
- type TransactionResultDelete = {
1880
- /**
1881
- * The type of operation who's result is being returned.
1882
- */
1883
- operation: 'delete';
2215
+ type NumericHistogramAgg = {
1884
2216
  /**
1885
- * The number of deleted rows
2217
+ * The column to use for bucketing. Must be of numeric type.
1886
2218
  */
1887
- rows: number;
1888
- };
1889
- /**
1890
- * An array of errors, with indicides, from the transaction.
1891
- */
1892
- type TransactionFailure = {
2219
+ column: string;
1893
2220
  /**
1894
- * The request ID.
2221
+ * The numeric interval to use for bucketing. The resulting buckets will be ranges
2222
+ * with this value as size.
2223
+ *
2224
+ * @minimum 0
1895
2225
  */
1896
- id: string;
2226
+ interval: number;
1897
2227
  /**
1898
- * An array of errors from the submitted operations.
2228
+ * By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
2229
+ * boundaries can be shifted by using the offset option. For example, if the `interval` is 100,
2230
+ * but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
2231
+ * to 50.
2232
+ *
2233
+ * @default 0
1899
2234
  */
1900
- errors: TransactionError[];
2235
+ offset?: number;
2236
+ aggs?: AggExpressionMap;
1901
2237
  };
1902
2238
  /**
1903
- * An error message from a failing transaction operation
2239
+ * The description of a single aggregation operation. It is an object with only one key-value pair.
2240
+ * The key represents the aggregation type, while the value is an object with the configuration of
2241
+ * the aggregation.
2242
+ *
2243
+ * @x-go-type xata.AggExpression
1904
2244
  */
1905
- type TransactionError = {
1906
- /**
1907
- * The index of the failing operation
1908
- */
1909
- index: number;
1910
- /**
1911
- * The error message
1912
- */
1913
- message: string;
2245
+ type AggExpression = {
2246
+ count?: CountAgg;
2247
+ } | {
2248
+ sum?: SumAgg;
2249
+ } | {
2250
+ max?: MaxAgg;
2251
+ } | {
2252
+ min?: MinAgg;
2253
+ } | {
2254
+ average?: AverageAgg;
2255
+ } | {
2256
+ uniqueCount?: UniqueCountAgg;
2257
+ } | {
2258
+ dateHistogram?: DateHistogramAgg;
2259
+ } | {
2260
+ topValues?: TopValuesAgg;
2261
+ } | {
2262
+ numericHistogram?: NumericHistogramAgg;
2263
+ };
2264
+ type AggResponse$1 = (number | null) | {
2265
+ values: ({
2266
+ $key: string | number;
2267
+ $count: number;
2268
+ } & {
2269
+ [key: string]: AggResponse$1;
2270
+ })[];
1914
2271
  };
1915
2272
  /**
1916
- * @format date-time
1917
- * @x-go-type string
2273
+ * File identifier in access URLs
2274
+ *
2275
+ * @maxLength 296
2276
+ * @minLength 88
2277
+ * @pattern [a-v0-9=]+
1918
2278
  */
1919
- type DateTime = string;
2279
+ type FileAccessID = string;
2280
+ /**
2281
+ * File signature
2282
+ */
2283
+ type FileSignature = string;
1920
2284
  /**
1921
2285
  * Xata Table Record Metadata
1922
2286
  */
@@ -1930,26 +2294,33 @@ type XataRecord$1 = RecordMeta & {
1930
2294
  * @version 1.0
1931
2295
  */
1932
2296
 
1933
- type SimpleError = {
2297
+ type BadRequestError = {
1934
2298
  id?: string;
1935
2299
  message: string;
1936
2300
  };
1937
- type BulkError = {
1938
- errors: {
1939
- message?: string;
1940
- status?: number;
1941
- }[];
2301
+ /**
2302
+ * @example {"message":"invalid API key"}
2303
+ */
2304
+ type AuthError = {
2305
+ id?: string;
2306
+ message: string;
1942
2307
  };
1943
- type BulkInsertResponse = {
1944
- recordIDs: string[];
1945
- } | {
1946
- records: XataRecord$1[];
2308
+ type SimpleError = {
2309
+ id?: string;
2310
+ message: string;
1947
2311
  };
1948
2312
  type BranchMigrationPlan = {
1949
2313
  version: number;
1950
2314
  migration: BranchMigration;
1951
2315
  };
1952
- type RecordResponse = XataRecord$1;
2316
+ type SchemaUpdateResponse = {
2317
+ /**
2318
+ * @minLength 1
2319
+ */
2320
+ migrationID: string;
2321
+ parentMigrationID: string;
2322
+ status: MigrationStatus;
2323
+ };
1953
2324
  type SchemaCompareResponse = {
1954
2325
  source: Schema;
1955
2326
  target: Schema;
@@ -1959,19 +2330,42 @@ type RecordUpdateResponse = XataRecord$1 | {
1959
2330
  id: string;
1960
2331
  xata: {
1961
2332
  version: number;
2333
+ createdAt: string;
2334
+ updatedAt: string;
1962
2335
  };
1963
2336
  };
2337
+ type PutFileResponse = FileResponse;
2338
+ type RecordResponse = XataRecord$1;
2339
+ type BulkInsertResponse = {
2340
+ recordIDs: string[];
2341
+ } | {
2342
+ records: XataRecord$1[];
2343
+ };
2344
+ type BulkError = {
2345
+ errors: {
2346
+ message?: string;
2347
+ status?: number;
2348
+ }[];
2349
+ };
1964
2350
  type QueryResponse = {
1965
2351
  records: XataRecord$1[];
1966
2352
  meta: RecordsMetadata;
1967
2353
  };
1968
- type SchemaUpdateResponse = {
1969
- /**
1970
- * @minLength 1
1971
- */
1972
- migrationID: string;
1973
- parentMigrationID: string;
1974
- status: MigrationStatus;
2354
+ type ServiceUnavailableError = {
2355
+ id?: string;
2356
+ message: string;
2357
+ };
2358
+ type SearchResponse = {
2359
+ records: XataRecord$1[];
2360
+ warning?: string;
2361
+ };
2362
+ type SQLResponse = {
2363
+ records: SQLRecord[];
2364
+ warning?: string;
2365
+ };
2366
+ type RateLimitError = {
2367
+ id?: string;
2368
+ message: string;
1975
2369
  };
1976
2370
  type SummarizeResponse = {
1977
2371
  summaries: Record<string, any>[];
@@ -1984,32 +2378,18 @@ type AggResponse = {
1984
2378
  [key: string]: AggResponse$1;
1985
2379
  };
1986
2380
  };
1987
- type SearchResponse = {
1988
- records: XataRecord$1[];
1989
- warning?: string;
1990
- };
1991
- type BadRequestError = {
1992
- id?: string;
1993
- message: string;
1994
- };
1995
- /**
1996
- * @example {"message":"invalid API key"}
1997
- */
1998
- type AuthError = {
1999
- id?: string;
2000
- message: string;
2001
- };
2002
2381
 
2003
2382
  type DataPlaneFetcherExtraProps = {
2004
2383
  apiUrl: string;
2005
2384
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
2006
- fetchImpl: FetchImpl;
2385
+ fetch: FetchImpl;
2007
2386
  apiKey: string;
2008
2387
  trace: TraceFunction;
2009
2388
  signal?: AbortSignal;
2010
2389
  clientID?: string;
2011
2390
  sessionID?: string;
2012
2391
  clientName?: string;
2392
+ xataAgentExtra?: Record<string, string>;
2013
2393
  };
2014
2394
  type ErrorWrapper<TError> = TError | {
2015
2395
  status: 'unknown';
@@ -2148,6 +2528,36 @@ type DeleteBranchVariables = {
2148
2528
  * Delete the branch in the database and all its resources
2149
2529
  */
2150
2530
  declare const deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<DeleteBranchResponse>;
2531
+ type CopyBranchPathParams = {
2532
+ /**
2533
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2534
+ */
2535
+ dbBranchName: DBBranchName;
2536
+ workspace: string;
2537
+ region: string;
2538
+ };
2539
+ type CopyBranchError = ErrorWrapper<{
2540
+ status: 400;
2541
+ payload: BadRequestError;
2542
+ } | {
2543
+ status: 401;
2544
+ payload: AuthError;
2545
+ } | {
2546
+ status: 404;
2547
+ payload: SimpleError;
2548
+ }>;
2549
+ type CopyBranchRequestBody = {
2550
+ destinationBranch: string;
2551
+ limit?: number;
2552
+ };
2553
+ type CopyBranchVariables = {
2554
+ body: CopyBranchRequestBody;
2555
+ pathParams: CopyBranchPathParams;
2556
+ } & DataPlaneFetcherExtraProps;
2557
+ /**
2558
+ * Create a copy of the branch
2559
+ */
2560
+ declare const copyBranch: (variables: CopyBranchVariables, signal?: AbortSignal) => Promise<BranchWithCopyID>;
2151
2561
  type UpdateBranchMetadataPathParams = {
2152
2562
  /**
2153
2563
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -2510,32 +2920,6 @@ type ExecuteBranchMigrationPlanVariables = {
2510
2920
  * Apply a migration plan to the branch
2511
2921
  */
2512
2922
  declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
2513
- type BranchTransactionPathParams = {
2514
- /**
2515
- * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2516
- */
2517
- dbBranchName: DBBranchName;
2518
- workspace: string;
2519
- region: string;
2520
- };
2521
- type BranchTransactionError = ErrorWrapper<{
2522
- status: 400;
2523
- payload: TransactionFailure;
2524
- } | {
2525
- status: 401;
2526
- payload: AuthError;
2527
- } | {
2528
- status: 404;
2529
- payload: SimpleError;
2530
- }>;
2531
- type BranchTransactionRequestBody = {
2532
- operations: TransactionOperation$1[];
2533
- };
2534
- type BranchTransactionVariables = {
2535
- body: BranchTransactionRequestBody;
2536
- pathParams: BranchTransactionPathParams;
2537
- } & DataPlaneFetcherExtraProps;
2538
- declare const branchTransaction: (variables: BranchTransactionVariables, signal?: AbortSignal) => Promise<TransactionSuccess>;
2539
2923
  type QueryMigrationRequestsPathParams = {
2540
2924
  /**
2541
2925
  * The Database Name
@@ -2818,7 +3202,7 @@ type MergeMigrationRequestError = ErrorWrapper<{
2818
3202
  type MergeMigrationRequestVariables = {
2819
3203
  pathParams: MergeMigrationRequestPathParams;
2820
3204
  } & DataPlaneFetcherExtraProps;
2821
- declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
3205
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<BranchOp>;
2822
3206
  type GetBranchSchemaHistoryPathParams = {
2823
3207
  /**
2824
3208
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -2867,6 +3251,10 @@ type GetBranchSchemaHistoryRequestBody = {
2867
3251
  */
2868
3252
  size?: number;
2869
3253
  };
3254
+ /**
3255
+ * Report only migrations that have been added since the given Migration ID.
3256
+ */
3257
+ since?: string;
2870
3258
  };
2871
3259
  type GetBranchSchemaHistoryVariables = {
2872
3260
  body?: GetBranchSchemaHistoryRequestBody;
@@ -2893,6 +3281,8 @@ type CompareBranchWithUserSchemaError = ErrorWrapper<{
2893
3281
  }>;
2894
3282
  type CompareBranchWithUserSchemaRequestBody = {
2895
3283
  schema: Schema;
3284
+ schemaOperations?: MigrationOp[];
3285
+ branchOperations?: MigrationOp[];
2896
3286
  };
2897
3287
  type CompareBranchWithUserSchemaVariables = {
2898
3288
  body: CompareBranchWithUserSchemaRequestBody;
@@ -2921,8 +3311,12 @@ type CompareBranchSchemasError = ErrorWrapper<{
2921
3311
  status: 404;
2922
3312
  payload: SimpleError;
2923
3313
  }>;
3314
+ type CompareBranchSchemasRequestBody = {
3315
+ sourceBranchOperations?: MigrationOp[];
3316
+ targetBranchOperations?: MigrationOp[];
3317
+ };
2924
3318
  type CompareBranchSchemasVariables = {
2925
- body?: Record<string, any>;
3319
+ body: CompareBranchSchemasRequestBody;
2926
3320
  pathParams: CompareBranchSchemasPathParams;
2927
3321
  } & DataPlaneFetcherExtraProps;
2928
3322
  declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
@@ -2978,8 +3372,34 @@ type PreviewBranchSchemaEditVariables = {
2978
3372
  body?: PreviewBranchSchemaEditRequestBody;
2979
3373
  pathParams: PreviewBranchSchemaEditPathParams;
2980
3374
  } & DataPlaneFetcherExtraProps;
2981
- declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
2982
- type ApplyBranchSchemaEditPathParams = {
3375
+ declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
3376
+ type ApplyBranchSchemaEditPathParams = {
3377
+ /**
3378
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3379
+ */
3380
+ dbBranchName: DBBranchName;
3381
+ workspace: string;
3382
+ region: string;
3383
+ };
3384
+ type ApplyBranchSchemaEditError = ErrorWrapper<{
3385
+ status: 400;
3386
+ payload: BadRequestError;
3387
+ } | {
3388
+ status: 401;
3389
+ payload: AuthError;
3390
+ } | {
3391
+ status: 404;
3392
+ payload: SimpleError;
3393
+ }>;
3394
+ type ApplyBranchSchemaEditRequestBody = {
3395
+ edits: SchemaEditScript;
3396
+ };
3397
+ type ApplyBranchSchemaEditVariables = {
3398
+ body: ApplyBranchSchemaEditRequestBody;
3399
+ pathParams: ApplyBranchSchemaEditPathParams;
3400
+ } & DataPlaneFetcherExtraProps;
3401
+ declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3402
+ type PushBranchMigrationsPathParams = {
2983
3403
  /**
2984
3404
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2985
3405
  */
@@ -2987,7 +3407,7 @@ type ApplyBranchSchemaEditPathParams = {
2987
3407
  workspace: string;
2988
3408
  region: string;
2989
3409
  };
2990
- type ApplyBranchSchemaEditError = ErrorWrapper<{
3410
+ type PushBranchMigrationsError = ErrorWrapper<{
2991
3411
  status: 400;
2992
3412
  payload: BadRequestError;
2993
3413
  } | {
@@ -2997,14 +3417,26 @@ type ApplyBranchSchemaEditError = ErrorWrapper<{
2997
3417
  status: 404;
2998
3418
  payload: SimpleError;
2999
3419
  }>;
3000
- type ApplyBranchSchemaEditRequestBody = {
3001
- edits: SchemaEditScript;
3420
+ type PushBranchMigrationsRequestBody = {
3421
+ migrations: MigrationObject[];
3002
3422
  };
3003
- type ApplyBranchSchemaEditVariables = {
3004
- body: ApplyBranchSchemaEditRequestBody;
3005
- pathParams: ApplyBranchSchemaEditPathParams;
3423
+ type PushBranchMigrationsVariables = {
3424
+ body: PushBranchMigrationsRequestBody;
3425
+ pathParams: PushBranchMigrationsPathParams;
3006
3426
  } & DataPlaneFetcherExtraProps;
3007
- declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3427
+ /**
3428
+ * The `schema/push` API accepts a list of migrations to be applied to the
3429
+ * current branch. A list of applicable migrations can be fetched using
3430
+ * the `schema/history` API from another branch or database.
3431
+ *
3432
+ * The most recent migration must be part of the list or referenced (via
3433
+ * `parentID`) by the first migration in the list of migrations to be pushed.
3434
+ *
3435
+ * Each migration in the list has an `id`, `parentID`, and `checksum`. The
3436
+ * checksum for migrations are generated and verified by xata. The
3437
+ * operation fails if any migration in the list has an invalid checksum.
3438
+ */
3439
+ declare const pushBranchMigrations: (variables: PushBranchMigrationsVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3008
3440
  type CreateTablePathParams = {
3009
3441
  /**
3010
3442
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -3258,15 +3690,278 @@ type GetColumnPathParams = {
3258
3690
  /**
3259
3691
  * The Table name
3260
3692
  */
3261
- tableName: TableName;
3693
+ tableName: TableName;
3694
+ /**
3695
+ * The Column name
3696
+ */
3697
+ columnName: ColumnName;
3698
+ workspace: string;
3699
+ region: string;
3700
+ };
3701
+ type GetColumnError = ErrorWrapper<{
3702
+ status: 400;
3703
+ payload: BadRequestError;
3704
+ } | {
3705
+ status: 401;
3706
+ payload: AuthError;
3707
+ } | {
3708
+ status: 404;
3709
+ payload: SimpleError;
3710
+ }>;
3711
+ type GetColumnVariables = {
3712
+ pathParams: GetColumnPathParams;
3713
+ } & DataPlaneFetcherExtraProps;
3714
+ /**
3715
+ * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3716
+ */
3717
+ declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
3718
+ type UpdateColumnPathParams = {
3719
+ /**
3720
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3721
+ */
3722
+ dbBranchName: DBBranchName;
3723
+ /**
3724
+ * The Table name
3725
+ */
3726
+ tableName: TableName;
3727
+ /**
3728
+ * The Column name
3729
+ */
3730
+ columnName: ColumnName;
3731
+ workspace: string;
3732
+ region: string;
3733
+ };
3734
+ type UpdateColumnError = ErrorWrapper<{
3735
+ status: 400;
3736
+ payload: BadRequestError;
3737
+ } | {
3738
+ status: 401;
3739
+ payload: AuthError;
3740
+ } | {
3741
+ status: 404;
3742
+ payload: SimpleError;
3743
+ }>;
3744
+ type UpdateColumnRequestBody = {
3745
+ /**
3746
+ * @minLength 1
3747
+ */
3748
+ name: string;
3749
+ };
3750
+ type UpdateColumnVariables = {
3751
+ body: UpdateColumnRequestBody;
3752
+ pathParams: UpdateColumnPathParams;
3753
+ } & DataPlaneFetcherExtraProps;
3754
+ /**
3755
+ * Update column with partial data. Can be used for renaming the column by providing a new "name" field. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3756
+ */
3757
+ declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3758
+ type DeleteColumnPathParams = {
3759
+ /**
3760
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3761
+ */
3762
+ dbBranchName: DBBranchName;
3763
+ /**
3764
+ * The Table name
3765
+ */
3766
+ tableName: TableName;
3767
+ /**
3768
+ * The Column name
3769
+ */
3770
+ columnName: ColumnName;
3771
+ workspace: string;
3772
+ region: string;
3773
+ };
3774
+ type DeleteColumnError = ErrorWrapper<{
3775
+ status: 400;
3776
+ payload: BadRequestError;
3777
+ } | {
3778
+ status: 401;
3779
+ payload: AuthError;
3780
+ } | {
3781
+ status: 404;
3782
+ payload: SimpleError;
3783
+ }>;
3784
+ type DeleteColumnVariables = {
3785
+ pathParams: DeleteColumnPathParams;
3786
+ } & DataPlaneFetcherExtraProps;
3787
+ /**
3788
+ * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3789
+ */
3790
+ declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3791
+ type BranchTransactionPathParams = {
3792
+ /**
3793
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3794
+ */
3795
+ dbBranchName: DBBranchName;
3796
+ workspace: string;
3797
+ region: string;
3798
+ };
3799
+ type BranchTransactionError = ErrorWrapper<{
3800
+ status: 400;
3801
+ payload: TransactionFailure;
3802
+ } | {
3803
+ status: 401;
3804
+ payload: AuthError;
3805
+ } | {
3806
+ status: 404;
3807
+ payload: SimpleError;
3808
+ }>;
3809
+ type BranchTransactionRequestBody = {
3810
+ operations: TransactionOperation$1[];
3811
+ };
3812
+ type BranchTransactionVariables = {
3813
+ body: BranchTransactionRequestBody;
3814
+ pathParams: BranchTransactionPathParams;
3815
+ } & DataPlaneFetcherExtraProps;
3816
+ declare const branchTransaction: (variables: BranchTransactionVariables, signal?: AbortSignal) => Promise<TransactionSuccess>;
3817
+ type InsertRecordPathParams = {
3818
+ /**
3819
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3820
+ */
3821
+ dbBranchName: DBBranchName;
3822
+ /**
3823
+ * The Table name
3824
+ */
3825
+ tableName: TableName;
3826
+ workspace: string;
3827
+ region: string;
3828
+ };
3829
+ type InsertRecordQueryParams = {
3830
+ /**
3831
+ * Column filters
3832
+ */
3833
+ columns?: ColumnsProjection;
3834
+ };
3835
+ type InsertRecordError = ErrorWrapper<{
3836
+ status: 400;
3837
+ payload: BadRequestError;
3838
+ } | {
3839
+ status: 401;
3840
+ payload: AuthError;
3841
+ } | {
3842
+ status: 404;
3843
+ payload: SimpleError;
3844
+ }>;
3845
+ type InsertRecordVariables = {
3846
+ body?: DataInputRecord;
3847
+ pathParams: InsertRecordPathParams;
3848
+ queryParams?: InsertRecordQueryParams;
3849
+ } & DataPlaneFetcherExtraProps;
3850
+ /**
3851
+ * Insert a new Record into the Table
3852
+ */
3853
+ declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
3854
+ type GetFileItemPathParams = {
3855
+ /**
3856
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3857
+ */
3858
+ dbBranchName: DBBranchName;
3859
+ /**
3860
+ * The Table name
3861
+ */
3862
+ tableName: TableName;
3863
+ /**
3864
+ * The Record name
3865
+ */
3866
+ recordId: RecordID;
3867
+ /**
3868
+ * The Column name
3869
+ */
3870
+ columnName: ColumnName;
3871
+ /**
3872
+ * The File Identifier
3873
+ */
3874
+ fileId: FileItemID;
3875
+ workspace: string;
3876
+ region: string;
3877
+ };
3878
+ type GetFileItemError = ErrorWrapper<{
3879
+ status: 400;
3880
+ payload: BadRequestError;
3881
+ } | {
3882
+ status: 401;
3883
+ payload: AuthError;
3884
+ } | {
3885
+ status: 404;
3886
+ payload: SimpleError;
3887
+ }>;
3888
+ type GetFileItemVariables = {
3889
+ pathParams: GetFileItemPathParams;
3890
+ } & DataPlaneFetcherExtraProps;
3891
+ /**
3892
+ * Retrieves file content from an array by file ID
3893
+ */
3894
+ declare const getFileItem: (variables: GetFileItemVariables, signal?: AbortSignal) => Promise<Blob>;
3895
+ type PutFileItemPathParams = {
3896
+ /**
3897
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3898
+ */
3899
+ dbBranchName: DBBranchName;
3900
+ /**
3901
+ * The Table name
3902
+ */
3903
+ tableName: TableName;
3904
+ /**
3905
+ * The Record name
3906
+ */
3907
+ recordId: RecordID;
3908
+ /**
3909
+ * The Column name
3910
+ */
3911
+ columnName: ColumnName;
3912
+ /**
3913
+ * The File Identifier
3914
+ */
3915
+ fileId: FileItemID;
3916
+ workspace: string;
3917
+ region: string;
3918
+ };
3919
+ type PutFileItemError = ErrorWrapper<{
3920
+ status: 400;
3921
+ payload: BadRequestError;
3922
+ } | {
3923
+ status: 401;
3924
+ payload: AuthError;
3925
+ } | {
3926
+ status: 404;
3927
+ payload: SimpleError;
3928
+ } | {
3929
+ status: 422;
3930
+ payload: SimpleError;
3931
+ }>;
3932
+ type PutFileItemVariables = {
3933
+ body?: Blob;
3934
+ pathParams: PutFileItemPathParams;
3935
+ } & DataPlaneFetcherExtraProps;
3936
+ /**
3937
+ * Uploads the file content to an array given the file ID
3938
+ */
3939
+ declare const putFileItem: (variables: PutFileItemVariables, signal?: AbortSignal) => Promise<FileResponse>;
3940
+ type DeleteFileItemPathParams = {
3941
+ /**
3942
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3943
+ */
3944
+ dbBranchName: DBBranchName;
3945
+ /**
3946
+ * The Table name
3947
+ */
3948
+ tableName: TableName;
3949
+ /**
3950
+ * The Record name
3951
+ */
3952
+ recordId: RecordID;
3262
3953
  /**
3263
3954
  * The Column name
3264
3955
  */
3265
3956
  columnName: ColumnName;
3957
+ /**
3958
+ * The File Identifier
3959
+ */
3960
+ fileId: FileItemID;
3266
3961
  workspace: string;
3267
3962
  region: string;
3268
3963
  };
3269
- type GetColumnError = ErrorWrapper<{
3964
+ type DeleteFileItemError = ErrorWrapper<{
3270
3965
  status: 400;
3271
3966
  payload: BadRequestError;
3272
3967
  } | {
@@ -3276,14 +3971,14 @@ type GetColumnError = ErrorWrapper<{
3276
3971
  status: 404;
3277
3972
  payload: SimpleError;
3278
3973
  }>;
3279
- type GetColumnVariables = {
3280
- pathParams: GetColumnPathParams;
3974
+ type DeleteFileItemVariables = {
3975
+ pathParams: DeleteFileItemPathParams;
3281
3976
  } & DataPlaneFetcherExtraProps;
3282
3977
  /**
3283
- * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
3978
+ * Deletes an item from an file array column given the file ID
3284
3979
  */
3285
- declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
3286
- type UpdateColumnPathParams = {
3980
+ declare const deleteFileItem: (variables: DeleteFileItemVariables, signal?: AbortSignal) => Promise<FileResponse>;
3981
+ type GetFilePathParams = {
3287
3982
  /**
3288
3983
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3289
3984
  */
@@ -3292,6 +3987,10 @@ type UpdateColumnPathParams = {
3292
3987
  * The Table name
3293
3988
  */
3294
3989
  tableName: TableName;
3990
+ /**
3991
+ * The Record name
3992
+ */
3993
+ recordId: RecordID;
3295
3994
  /**
3296
3995
  * The Column name
3297
3996
  */
@@ -3299,7 +3998,7 @@ type UpdateColumnPathParams = {
3299
3998
  workspace: string;
3300
3999
  region: string;
3301
4000
  };
3302
- type UpdateColumnError = ErrorWrapper<{
4001
+ type GetFileError = ErrorWrapper<{
3303
4002
  status: 400;
3304
4003
  payload: BadRequestError;
3305
4004
  } | {
@@ -3309,21 +4008,14 @@ type UpdateColumnError = ErrorWrapper<{
3309
4008
  status: 404;
3310
4009
  payload: SimpleError;
3311
4010
  }>;
3312
- type UpdateColumnRequestBody = {
3313
- /**
3314
- * @minLength 1
3315
- */
3316
- name: string;
3317
- };
3318
- type UpdateColumnVariables = {
3319
- body: UpdateColumnRequestBody;
3320
- pathParams: UpdateColumnPathParams;
4011
+ type GetFileVariables = {
4012
+ pathParams: GetFilePathParams;
3321
4013
  } & DataPlaneFetcherExtraProps;
3322
4014
  /**
3323
- * Update column with partial data. Can be used for renaming the column by providing a new "name" field. To refer to sub-objects, the column name can contain dots. For example `address.country`.
4015
+ * Retrieves the file content from a file column
3324
4016
  */
3325
- declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3326
- type DeleteColumnPathParams = {
4017
+ declare const getFile: (variables: GetFileVariables, signal?: AbortSignal) => Promise<Blob>;
4018
+ type PutFilePathParams = {
3327
4019
  /**
3328
4020
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3329
4021
  */
@@ -3332,6 +4024,10 @@ type DeleteColumnPathParams = {
3332
4024
  * The Table name
3333
4025
  */
3334
4026
  tableName: TableName;
4027
+ /**
4028
+ * The Record name
4029
+ */
4030
+ recordId: RecordID;
3335
4031
  /**
3336
4032
  * The Column name
3337
4033
  */
@@ -3339,7 +4035,7 @@ type DeleteColumnPathParams = {
3339
4035
  workspace: string;
3340
4036
  region: string;
3341
4037
  };
3342
- type DeleteColumnError = ErrorWrapper<{
4038
+ type PutFileError = ErrorWrapper<{
3343
4039
  status: 400;
3344
4040
  payload: BadRequestError;
3345
4041
  } | {
@@ -3348,15 +4044,19 @@ type DeleteColumnError = ErrorWrapper<{
3348
4044
  } | {
3349
4045
  status: 404;
3350
4046
  payload: SimpleError;
4047
+ } | {
4048
+ status: 422;
4049
+ payload: SimpleError;
3351
4050
  }>;
3352
- type DeleteColumnVariables = {
3353
- pathParams: DeleteColumnPathParams;
4051
+ type PutFileVariables = {
4052
+ body?: Blob;
4053
+ pathParams: PutFilePathParams;
3354
4054
  } & DataPlaneFetcherExtraProps;
3355
4055
  /**
3356
- * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
4056
+ * Uploads the file content to the given file column
3357
4057
  */
3358
- declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<SchemaUpdateResponse>;
3359
- type InsertRecordPathParams = {
4058
+ declare const putFile: (variables: PutFileVariables, signal?: AbortSignal) => Promise<FileResponse>;
4059
+ type DeleteFilePathParams = {
3360
4060
  /**
3361
4061
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3362
4062
  */
@@ -3365,16 +4065,18 @@ type InsertRecordPathParams = {
3365
4065
  * The Table name
3366
4066
  */
3367
4067
  tableName: TableName;
3368
- workspace: string;
3369
- region: string;
3370
- };
3371
- type InsertRecordQueryParams = {
3372
4068
  /**
3373
- * Column filters
4069
+ * The Record name
3374
4070
  */
3375
- columns?: ColumnsProjection;
4071
+ recordId: RecordID;
4072
+ /**
4073
+ * The Column name
4074
+ */
4075
+ columnName: ColumnName;
4076
+ workspace: string;
4077
+ region: string;
3376
4078
  };
3377
- type InsertRecordError = ErrorWrapper<{
4079
+ type DeleteFileError = ErrorWrapper<{
3378
4080
  status: 400;
3379
4081
  payload: BadRequestError;
3380
4082
  } | {
@@ -3384,15 +4086,13 @@ type InsertRecordError = ErrorWrapper<{
3384
4086
  status: 404;
3385
4087
  payload: SimpleError;
3386
4088
  }>;
3387
- type InsertRecordVariables = {
3388
- body?: Record<string, any>;
3389
- pathParams: InsertRecordPathParams;
3390
- queryParams?: InsertRecordQueryParams;
4089
+ type DeleteFileVariables = {
4090
+ pathParams: DeleteFilePathParams;
3391
4091
  } & DataPlaneFetcherExtraProps;
3392
4092
  /**
3393
- * Insert a new Record into the Table
4093
+ * Deletes a file referred in a file column
3394
4094
  */
3395
- declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4095
+ declare const deleteFile: (variables: DeleteFileVariables, signal?: AbortSignal) => Promise<FileResponse>;
3396
4096
  type GetRecordPathParams = {
3397
4097
  /**
3398
4098
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -3471,7 +4171,7 @@ type InsertRecordWithIDError = ErrorWrapper<{
3471
4171
  payload: SimpleError;
3472
4172
  }>;
3473
4173
  type InsertRecordWithIDVariables = {
3474
- body?: Record<string, any>;
4174
+ body?: DataInputRecord;
3475
4175
  pathParams: InsertRecordWithIDPathParams;
3476
4176
  queryParams?: InsertRecordWithIDQueryParams;
3477
4177
  } & DataPlaneFetcherExtraProps;
@@ -3516,7 +4216,7 @@ type UpdateRecordWithIDError = ErrorWrapper<{
3516
4216
  payload: SimpleError;
3517
4217
  }>;
3518
4218
  type UpdateRecordWithIDVariables = {
3519
- body?: Record<string, any>;
4219
+ body?: DataInputRecord;
3520
4220
  pathParams: UpdateRecordWithIDPathParams;
3521
4221
  queryParams?: UpdateRecordWithIDQueryParams;
3522
4222
  } & DataPlaneFetcherExtraProps;
@@ -3558,7 +4258,7 @@ type UpsertRecordWithIDError = ErrorWrapper<{
3558
4258
  payload: SimpleError;
3559
4259
  }>;
3560
4260
  type UpsertRecordWithIDVariables = {
3561
- body?: Record<string, any>;
4261
+ body?: DataInputRecord;
3562
4262
  pathParams: UpsertRecordWithIDPathParams;
3563
4263
  queryParams?: UpsertRecordWithIDQueryParams;
3564
4264
  } & DataPlaneFetcherExtraProps;
@@ -3632,7 +4332,7 @@ type BulkInsertTableRecordsError = ErrorWrapper<{
3632
4332
  payload: SimpleError;
3633
4333
  }>;
3634
4334
  type BulkInsertTableRecordsRequestBody = {
3635
- records: Record<string, any>[];
4335
+ records: DataInputRecord[];
3636
4336
  };
3637
4337
  type BulkInsertTableRecordsVariables = {
3638
4338
  body: BulkInsertTableRecordsRequestBody;
@@ -3664,12 +4364,15 @@ type QueryTableError = ErrorWrapper<{
3664
4364
  } | {
3665
4365
  status: 404;
3666
4366
  payload: SimpleError;
4367
+ } | {
4368
+ status: 503;
4369
+ payload: ServiceUnavailableError;
3667
4370
  }>;
3668
4371
  type QueryTableRequestBody = {
3669
4372
  filter?: FilterExpression;
3670
4373
  sort?: SortExpression;
3671
4374
  page?: PageConfig;
3672
- columns?: ColumnsProjection;
4375
+ columns?: QueryColumnsProjection;
3673
4376
  /**
3674
4377
  * The consistency level for this request.
3675
4378
  *
@@ -4333,25 +5036,40 @@ type QueryTableVariables = {
4333
5036
  * }
4334
5037
  * ```
4335
5038
  *
4336
- * ### Pagination
5039
+ * It is also possible to sort results randomly:
4337
5040
  *
4338
- * We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
4339
- * cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
5041
+ * ```json
5042
+ * POST /db/demo:main/tables/table/query
5043
+ * {
5044
+ * "sort": {
5045
+ * "*": "random"
5046
+ * }
5047
+ * }
5048
+ * ```
5049
+ *
5050
+ * Note that a random sort does not apply to a specific column, hence the special column name `"*"`.
4340
5051
  *
4341
- * Example of size + offset pagination:
5052
+ * A random sort can be combined with an ascending or descending sort on a specific column:
4342
5053
  *
4343
5054
  * ```json
4344
5055
  * POST /db/demo:main/tables/table/query
4345
5056
  * {
4346
- * "page": {
4347
- * "size": 100,
4348
- * "offset": 200
4349
- * }
5057
+ * "sort": [
5058
+ * {
5059
+ * "name": "desc"
5060
+ * },
5061
+ * {
5062
+ * "*": "random"
5063
+ * }
5064
+ * ]
4350
5065
  * }
4351
5066
  * ```
4352
5067
  *
4353
- * The `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.
4354
- * The `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.
5068
+ * This will sort on the `name` column, breaking ties randomly.
5069
+ *
5070
+ * ### Pagination
5071
+ *
5072
+ * We offer cursor pagination and offset pagination. The cursor pagination method can be used for sequential scrolling with unrestricted depth. The offset pagination can be used to skip pages and is limited to 1000 records.
4355
5073
  *
4356
5074
  * Example of cursor pagination:
4357
5075
  *
@@ -4405,6 +5123,34 @@ type QueryTableVariables = {
4405
5123
  * `filter` or `sort` is set. The columns returned and page size can be changed
4406
5124
  * anytime by passing the `columns` or `page.size` settings to the next query.
4407
5125
  *
5126
+ * In the following example of size + offset pagination we retrieve the third page of up to 100 results:
5127
+ *
5128
+ * ```json
5129
+ * POST /db/demo:main/tables/table/query
5130
+ * {
5131
+ * "page": {
5132
+ * "size": 100,
5133
+ * "offset": 200
5134
+ * }
5135
+ * }
5136
+ * ```
5137
+ *
5138
+ * The `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.
5139
+ * The `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.
5140
+ *
5141
+ * Cursor pagination also works in combination with offset pagination. For example, starting from a specific cursor position, using a page size of 200 and an offset of 800, you can skip up to 5 pages of 200 records forwards or backwards from the cursor's position:
5142
+ *
5143
+ * ```json
5144
+ * POST /db/demo:main/tables/table/query
5145
+ * {
5146
+ * "page": {
5147
+ * "size": 200,
5148
+ * "offset": 800,
5149
+ * "after": "fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD"
5150
+ * }
5151
+ * }
5152
+ * ```
5153
+ *
4408
5154
  * **Special cursors:**
4409
5155
  *
4410
5156
  * - `page.after=end`: Result points past the last entry. The list of records
@@ -4455,6 +5201,9 @@ type SearchBranchError = ErrorWrapper<{
4455
5201
  } | {
4456
5202
  status: 404;
4457
5203
  payload: SimpleError;
5204
+ } | {
5205
+ status: 503;
5206
+ payload: ServiceUnavailableError;
4458
5207
  }>;
4459
5208
  type SearchBranchRequestBody = {
4460
5209
  /**
@@ -4537,6 +5286,196 @@ type SearchTableVariables = {
4537
5286
  * * filtering on columns of type `multiple` is currently unsupported
4538
5287
  */
4539
5288
  declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
5289
+ type SqlQueryPathParams = {
5290
+ /**
5291
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
5292
+ */
5293
+ dbBranchName: DBBranchName;
5294
+ workspace: string;
5295
+ region: string;
5296
+ };
5297
+ type SqlQueryError = ErrorWrapper<{
5298
+ status: 400;
5299
+ payload: BadRequestError;
5300
+ } | {
5301
+ status: 401;
5302
+ payload: AuthError;
5303
+ } | {
5304
+ status: 404;
5305
+ payload: SimpleError;
5306
+ } | {
5307
+ status: 503;
5308
+ payload: ServiceUnavailableError;
5309
+ }>;
5310
+ type SqlQueryRequestBody = {
5311
+ /**
5312
+ * The query string.
5313
+ *
5314
+ * @minLength 1
5315
+ */
5316
+ query: string;
5317
+ /**
5318
+ * The consistency level for this request.
5319
+ *
5320
+ * @default strong
5321
+ */
5322
+ consistency?: 'strong' | 'eventual';
5323
+ };
5324
+ type SqlQueryVariables = {
5325
+ body: SqlQueryRequestBody;
5326
+ pathParams: SqlQueryPathParams;
5327
+ } & DataPlaneFetcherExtraProps;
5328
+ /**
5329
+ * Run an SQL query across the database branch.
5330
+ */
5331
+ declare const sqlQuery: (variables: SqlQueryVariables, signal?: AbortSignal) => Promise<SQLResponse>;
5332
+ type VectorSearchTablePathParams = {
5333
+ /**
5334
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
5335
+ */
5336
+ dbBranchName: DBBranchName;
5337
+ /**
5338
+ * The Table name
5339
+ */
5340
+ tableName: TableName;
5341
+ workspace: string;
5342
+ region: string;
5343
+ };
5344
+ type VectorSearchTableError = ErrorWrapper<{
5345
+ status: 400;
5346
+ payload: BadRequestError;
5347
+ } | {
5348
+ status: 401;
5349
+ payload: AuthError;
5350
+ } | {
5351
+ status: 404;
5352
+ payload: SimpleError;
5353
+ }>;
5354
+ type VectorSearchTableRequestBody = {
5355
+ /**
5356
+ * The vector to search for similarities. Must have the same dimension as
5357
+ * the vector column used.
5358
+ */
5359
+ queryVector: number[];
5360
+ /**
5361
+ * The vector column in which to search. It must be of type `vector`.
5362
+ */
5363
+ column: string;
5364
+ /**
5365
+ * The function used to measure the distance between two points. Can be one of:
5366
+ * `cosineSimilarity`, `l1`, `l2`. The default is `cosineSimilarity`.
5367
+ *
5368
+ * @default cosineSimilarity
5369
+ */
5370
+ similarityFunction?: string;
5371
+ /**
5372
+ * Number of results to return.
5373
+ *
5374
+ * @default 10
5375
+ * @maximum 100
5376
+ * @minimum 1
5377
+ */
5378
+ size?: number;
5379
+ filter?: FilterExpression;
5380
+ };
5381
+ type VectorSearchTableVariables = {
5382
+ body: VectorSearchTableRequestBody;
5383
+ pathParams: VectorSearchTablePathParams;
5384
+ } & DataPlaneFetcherExtraProps;
5385
+ /**
5386
+ * This endpoint can be used to perform vector-based similarity searches in a table.
5387
+ * It can be used for implementing semantic search and product recommendation. To use this
5388
+ * endpoint, you need a column of type vector. The input vector must have the same
5389
+ * dimension as the vector column.
5390
+ */
5391
+ declare const vectorSearchTable: (variables: VectorSearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
5392
+ type AskTablePathParams = {
5393
+ /**
5394
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
5395
+ */
5396
+ dbBranchName: DBBranchName;
5397
+ /**
5398
+ * The Table name
5399
+ */
5400
+ tableName: TableName;
5401
+ workspace: string;
5402
+ region: string;
5403
+ };
5404
+ type AskTableError = ErrorWrapper<{
5405
+ status: 400;
5406
+ payload: BadRequestError;
5407
+ } | {
5408
+ status: 401;
5409
+ payload: AuthError;
5410
+ } | {
5411
+ status: 404;
5412
+ payload: SimpleError;
5413
+ } | {
5414
+ status: 429;
5415
+ payload: RateLimitError;
5416
+ } | {
5417
+ status: 503;
5418
+ payload: ServiceUnavailableError;
5419
+ }>;
5420
+ type AskTableResponse = {
5421
+ /**
5422
+ * The answer to the input question
5423
+ */
5424
+ answer?: string;
5425
+ };
5426
+ type AskTableRequestBody = {
5427
+ /**
5428
+ * The question you'd like to ask.
5429
+ *
5430
+ * @minLength 3
5431
+ */
5432
+ question: string;
5433
+ /**
5434
+ * The type of search to use. If set to `keyword` (the default), the search can be configured by passing
5435
+ * a `search` object with the following fields. For more details about each, see the Search endpoint documentation.
5436
+ * All fields are optional.
5437
+ * * fuzziness - typo tolerance
5438
+ * * target - columns to search into, and weights.
5439
+ * * prefix - prefix search type.
5440
+ * * filter - pre-filter before searching.
5441
+ * * boosters - control relevancy.
5442
+ * If set to `vector`, a `vectorSearch` object must be passed, with the following parameters. For more details, see the Vector
5443
+ * Search endpoint documentation. The `column` and `contentColumn` parameters are required.
5444
+ * * column - the vector column containing the embeddings.
5445
+ * * contentColumn - the column that contains the text from which the embeddings where computed.
5446
+ * * filter - pre-filter before searching.
5447
+ *
5448
+ * @default keyword
5449
+ */
5450
+ searchType?: 'keyword' | 'vector';
5451
+ search?: {
5452
+ fuzziness?: FuzzinessExpression;
5453
+ target?: TargetExpression;
5454
+ prefix?: PrefixExpression;
5455
+ filter?: FilterExpression;
5456
+ boosters?: BoosterExpression[];
5457
+ };
5458
+ vectorSearch?: {
5459
+ /**
5460
+ * The column to use for vector search. It must be of type `vector`.
5461
+ */
5462
+ column: string;
5463
+ /**
5464
+ * The column containing the text for vector search. Must be of type `text`.
5465
+ */
5466
+ contentColumn: string;
5467
+ filter?: FilterExpression;
5468
+ };
5469
+ rules?: string[];
5470
+ };
5471
+ type AskTableVariables = {
5472
+ body: AskTableRequestBody;
5473
+ pathParams: AskTablePathParams;
5474
+ } & DataPlaneFetcherExtraProps;
5475
+ /**
5476
+ * Ask your table a question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.
5477
+ */
5478
+ declare const askTable: (variables: AskTableVariables, signal?: AbortSignal) => Promise<AskTableResponse>;
4540
5479
  type SummarizeTablePathParams = {
4541
5480
  /**
4542
5481
  * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
@@ -4683,16 +5622,48 @@ type AggregateTableVariables = {
4683
5622
  pathParams: AggregateTablePathParams;
4684
5623
  } & DataPlaneFetcherExtraProps;
4685
5624
  /**
4686
- * This endpoint allows you to run aggragations (analytics) on the data from one table.
4687
- * While the summary endpoint is served from a transactional store and the results are strongly
4688
- * consistent, the aggregate endpoint is served from our columnar store and the results are
4689
- * only eventually consistent. On the other hand, the aggregate endpoint uses a
4690
- * store that is more appropiate for analytics, makes use of approximative algorithms
4691
- * (e.g for cardinality), and is generally faster and can do more complex aggregations.
4692
- *
4693
- * For usage, see the [API Guide](https://xata.io/docs/api-guide/aggregate).
5625
+ * This endpoint allows you to run aggregations (analytics) on the data from one table.
5626
+ * While the summary endpoint is served from a transactional store and the results are strongly
5627
+ * consistent, the aggregate endpoint is served from our columnar store and the results are
5628
+ * only eventually consistent. On the other hand, the aggregate endpoint uses a
5629
+ * store that is more appropiate for analytics, makes use of approximative algorithms
5630
+ * (e.g for cardinality), and is generally faster and can do more complex aggregations.
5631
+ *
5632
+ * For usage, see the [API Guide](https://xata.io/docs/api-guide/aggregate).
5633
+ */
5634
+ declare const aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
5635
+ type FileAccessPathParams = {
5636
+ /**
5637
+ * The File Access Identifier
5638
+ */
5639
+ fileId: FileAccessID;
5640
+ workspace: string;
5641
+ region: string;
5642
+ };
5643
+ type FileAccessQueryParams = {
5644
+ /**
5645
+ * File access signature
5646
+ */
5647
+ verify?: FileSignature;
5648
+ };
5649
+ type FileAccessError = ErrorWrapper<{
5650
+ status: 400;
5651
+ payload: BadRequestError;
5652
+ } | {
5653
+ status: 401;
5654
+ payload: AuthError;
5655
+ } | {
5656
+ status: 404;
5657
+ payload: SimpleError;
5658
+ }>;
5659
+ type FileAccessVariables = {
5660
+ pathParams: FileAccessPathParams;
5661
+ queryParams?: FileAccessQueryParams;
5662
+ } & DataPlaneFetcherExtraProps;
5663
+ /**
5664
+ * Retrieve file content by access id
4694
5665
  */
4695
- declare const aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
5666
+ declare const fileAccess: (variables: FileAccessVariables, signal?: AbortSignal) => Promise<undefined>;
4696
5667
 
4697
5668
  declare const operationsByTag: {
4698
5669
  branch: {
@@ -4700,6 +5671,7 @@ declare const operationsByTag: {
4700
5671
  getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal | undefined) => Promise<DBBranch>;
4701
5672
  createBranch: (variables: CreateBranchVariables, signal?: AbortSignal | undefined) => Promise<CreateBranchResponse>;
4702
5673
  deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal | undefined) => Promise<DeleteBranchResponse>;
5674
+ copyBranch: (variables: CopyBranchVariables, signal?: AbortSignal | undefined) => Promise<BranchWithCopyID>;
4703
5675
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
4704
5676
  getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal | undefined) => Promise<BranchMetadata>;
4705
5677
  getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal | undefined) => Promise<GetBranchStatsResponse>;
@@ -4708,16 +5680,6 @@ declare const operationsByTag: {
4708
5680
  removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
4709
5681
  resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal | undefined) => Promise<ResolveBranchResponse>;
4710
5682
  };
4711
- records: {
4712
- branchTransaction: (variables: BranchTransactionVariables, signal?: AbortSignal | undefined) => Promise<TransactionSuccess>;
4713
- insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4714
- getRecord: (variables: GetRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
4715
- insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4716
- updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4717
- upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
4718
- deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
4719
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal | undefined) => Promise<BulkInsertResponse>;
4720
- };
4721
5683
  migrations: {
4722
5684
  getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal | undefined) => Promise<GetBranchMigrationHistoryResponse>;
4723
5685
  getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal | undefined) => Promise<BranchMigrationPlan>;
@@ -4728,6 +5690,17 @@ declare const operationsByTag: {
4728
5690
  updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
4729
5691
  previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal | undefined) => Promise<PreviewBranchSchemaEditResponse>;
4730
5692
  applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
5693
+ pushBranchMigrations: (variables: PushBranchMigrationsVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
5694
+ };
5695
+ records: {
5696
+ branchTransaction: (variables: BranchTransactionVariables, signal?: AbortSignal | undefined) => Promise<TransactionSuccess>;
5697
+ insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5698
+ getRecord: (variables: GetRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
5699
+ insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5700
+ updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5701
+ upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal | undefined) => Promise<RecordUpdateResponse>;
5702
+ deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal | undefined) => Promise<XataRecord$1>;
5703
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal | undefined) => Promise<BulkInsertResponse>;
4731
5704
  };
4732
5705
  migrationRequests: {
4733
5706
  queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal | undefined) => Promise<QueryMigrationRequestsResponse>;
@@ -4737,7 +5710,7 @@ declare const operationsByTag: {
4737
5710
  listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal | undefined) => Promise<ListMigrationRequestsCommitsResponse>;
4738
5711
  compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal | undefined) => Promise<SchemaCompareResponse>;
4739
5712
  getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal | undefined) => Promise<GetMigrationRequestIsMergedResponse>;
4740
- mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal | undefined) => Promise<Commit>;
5713
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal | undefined) => Promise<BranchOp>;
4741
5714
  };
4742
5715
  table: {
4743
5716
  createTable: (variables: CreateTableVariables, signal?: AbortSignal | undefined) => Promise<CreateTableResponse>;
@@ -4751,10 +5724,22 @@ declare const operationsByTag: {
4751
5724
  updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
4752
5725
  deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal | undefined) => Promise<SchemaUpdateResponse>;
4753
5726
  };
5727
+ files: {
5728
+ getFileItem: (variables: GetFileItemVariables, signal?: AbortSignal | undefined) => Promise<Blob>;
5729
+ putFileItem: (variables: PutFileItemVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5730
+ deleteFileItem: (variables: DeleteFileItemVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5731
+ getFile: (variables: GetFileVariables, signal?: AbortSignal | undefined) => Promise<Blob>;
5732
+ putFile: (variables: PutFileVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5733
+ deleteFile: (variables: DeleteFileVariables, signal?: AbortSignal | undefined) => Promise<FileResponse>;
5734
+ fileAccess: (variables: FileAccessVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
5735
+ };
4754
5736
  searchAndFilter: {
4755
5737
  queryTable: (variables: QueryTableVariables, signal?: AbortSignal | undefined) => Promise<QueryResponse>;
4756
5738
  searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal | undefined) => Promise<SearchResponse>;
4757
5739
  searchTable: (variables: SearchTableVariables, signal?: AbortSignal | undefined) => Promise<SearchResponse>;
5740
+ sqlQuery: (variables: SqlQueryVariables, signal?: AbortSignal | undefined) => Promise<SQLResponse>;
5741
+ vectorSearchTable: (variables: VectorSearchTableVariables, signal?: AbortSignal | undefined) => Promise<SearchResponse>;
5742
+ askTable: (variables: AskTableVariables, signal?: AbortSignal | undefined) => Promise<AskTableResponse>;
4758
5743
  summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal | undefined) => Promise<SummarizeResponse>;
4759
5744
  aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal | undefined) => Promise<AggResponse>;
4760
5745
  };
@@ -4791,11 +5776,15 @@ declare const operationsByTag: {
4791
5776
  deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal | undefined) => Promise<DeleteDatabaseResponse>;
4792
5777
  getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal | undefined) => Promise<DatabaseMetadata>;
4793
5778
  updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal | undefined) => Promise<DatabaseMetadata>;
5779
+ renameDatabase: (variables: RenameDatabaseVariables, signal?: AbortSignal | undefined) => Promise<DatabaseMetadata>;
5780
+ getDatabaseGithubSettings: (variables: GetDatabaseGithubSettingsVariables, signal?: AbortSignal | undefined) => Promise<DatabaseGithubSettings>;
5781
+ updateDatabaseGithubSettings: (variables: UpdateDatabaseGithubSettingsVariables, signal?: AbortSignal | undefined) => Promise<DatabaseGithubSettings>;
5782
+ deleteDatabaseGithubSettings: (variables: DeleteDatabaseGithubSettingsVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
4794
5783
  listRegions: (variables: ListRegionsVariables, signal?: AbortSignal | undefined) => Promise<ListRegionsResponse>;
4795
5784
  };
4796
5785
  };
4797
5786
 
4798
- type HostAliases = 'production' | 'staging';
5787
+ type HostAliases = 'production' | 'staging' | 'dev';
4799
5788
  type ProviderBuilder = {
4800
5789
  main: string;
4801
5790
  workspaces: string;
@@ -4805,250 +5794,303 @@ declare function getHostUrl(provider: HostProvider, type: keyof ProviderBuilder)
4805
5794
  declare function isHostProviderAlias(alias: HostProvider | string): alias is HostAliases;
4806
5795
  declare function isHostProviderBuilder(builder: HostProvider): builder is ProviderBuilder;
4807
5796
  declare function parseProviderString(provider?: string): HostProvider | null;
5797
+ declare function buildProviderString(provider: HostProvider): string;
4808
5798
  declare function parseWorkspacesUrlParts(url: string): {
4809
5799
  workspace: string;
4810
5800
  region: string;
4811
5801
  } | null;
4812
5802
 
5803
+ type responses_AggResponse = AggResponse;
4813
5804
  type responses_AuthError = AuthError;
4814
5805
  type responses_BadRequestError = BadRequestError;
4815
- type responses_SimpleError = SimpleError;
5806
+ type responses_BranchMigrationPlan = BranchMigrationPlan;
4816
5807
  type responses_BulkError = BulkError;
4817
5808
  type responses_BulkInsertResponse = BulkInsertResponse;
4818
- type responses_BranchMigrationPlan = BranchMigrationPlan;
5809
+ type responses_PutFileResponse = PutFileResponse;
5810
+ type responses_QueryResponse = QueryResponse;
5811
+ type responses_RateLimitError = RateLimitError;
4819
5812
  type responses_RecordResponse = RecordResponse;
4820
- type responses_SchemaCompareResponse = SchemaCompareResponse;
4821
5813
  type responses_RecordUpdateResponse = RecordUpdateResponse;
4822
- type responses_QueryResponse = QueryResponse;
5814
+ type responses_SQLResponse = SQLResponse;
5815
+ type responses_SchemaCompareResponse = SchemaCompareResponse;
4823
5816
  type responses_SchemaUpdateResponse = SchemaUpdateResponse;
4824
- type responses_SummarizeResponse = SummarizeResponse;
4825
- type responses_AggResponse = AggResponse;
4826
5817
  type responses_SearchResponse = SearchResponse;
5818
+ type responses_ServiceUnavailableError = ServiceUnavailableError;
5819
+ type responses_SimpleError = SimpleError;
5820
+ type responses_SummarizeResponse = SummarizeResponse;
4827
5821
  declare namespace responses {
4828
5822
  export {
5823
+ responses_AggResponse as AggResponse,
4829
5824
  responses_AuthError as AuthError,
4830
5825
  responses_BadRequestError as BadRequestError,
4831
- responses_SimpleError as SimpleError,
5826
+ responses_BranchMigrationPlan as BranchMigrationPlan,
4832
5827
  responses_BulkError as BulkError,
4833
5828
  responses_BulkInsertResponse as BulkInsertResponse,
4834
- responses_BranchMigrationPlan as BranchMigrationPlan,
5829
+ responses_PutFileResponse as PutFileResponse,
5830
+ responses_QueryResponse as QueryResponse,
5831
+ responses_RateLimitError as RateLimitError,
4835
5832
  responses_RecordResponse as RecordResponse,
4836
- responses_SchemaCompareResponse as SchemaCompareResponse,
4837
5833
  responses_RecordUpdateResponse as RecordUpdateResponse,
4838
- responses_QueryResponse as QueryResponse,
5834
+ responses_SQLResponse as SQLResponse,
5835
+ responses_SchemaCompareResponse as SchemaCompareResponse,
4839
5836
  responses_SchemaUpdateResponse as SchemaUpdateResponse,
4840
- responses_SummarizeResponse as SummarizeResponse,
4841
- responses_AggResponse as AggResponse,
4842
5837
  responses_SearchResponse as SearchResponse,
5838
+ responses_ServiceUnavailableError as ServiceUnavailableError,
5839
+ responses_SimpleError as SimpleError,
5840
+ responses_SummarizeResponse as SummarizeResponse,
4843
5841
  };
4844
5842
  }
4845
5843
 
5844
+ type schemas_APIKeyName = APIKeyName;
5845
+ type schemas_AggExpression = AggExpression;
5846
+ type schemas_AggExpressionMap = AggExpressionMap;
5847
+ type schemas_AverageAgg = AverageAgg;
5848
+ type schemas_BoosterExpression = BoosterExpression;
5849
+ type schemas_Branch = Branch;
4846
5850
  type schemas_BranchMetadata = BranchMetadata;
5851
+ type schemas_BranchMigration = BranchMigration;
4847
5852
  type schemas_BranchName = BranchName;
4848
- type schemas_DBName = DBName;
4849
- type schemas_DateTime = DateTime;
4850
- type schemas_MigrationStatus = MigrationStatus;
4851
- type schemas_ListBranchesResponse = ListBranchesResponse;
4852
- type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
4853
- type schemas_Branch = Branch;
4854
- type schemas_DBBranch = DBBranch;
4855
- type schemas_StartedFromMetadata = StartedFromMetadata;
4856
- type schemas_Schema = Schema;
4857
- type schemas_SchemaEditScript = SchemaEditScript;
4858
- type schemas_Table = Table;
5853
+ type schemas_BranchOp = BranchOp;
5854
+ type schemas_BranchWithCopyID = BranchWithCopyID;
4859
5855
  type schemas_Column = Column;
4860
5856
  type schemas_ColumnLink = ColumnLink;
4861
- type schemas_RevLink = RevLink;
4862
- type schemas_DBBranchName = DBBranchName;
4863
- type schemas_TableName = TableName;
4864
- type schemas_ColumnName = ColumnName;
4865
- type schemas_MetricsDatapoint = MetricsDatapoint;
4866
- type schemas_MetricsLatency = MetricsLatency;
4867
- type schemas_BranchMigration = BranchMigration;
4868
- type schemas_TableMigration = TableMigration;
4869
5857
  type schemas_ColumnMigration = ColumnMigration;
4870
- type schemas_Commit = Commit;
4871
- type schemas_Migration = Migration;
4872
- type schemas_MigrationOp = MigrationOp;
4873
- type schemas_MigrationTableOp = MigrationTableOp;
4874
- type schemas_MigrationColumnOp = MigrationColumnOp;
4875
- type schemas_TableOpAdd = TableOpAdd;
4876
- type schemas_TableOpRemove = TableOpRemove;
4877
- type schemas_TableOpRename = TableOpRename;
5858
+ type schemas_ColumnName = ColumnName;
4878
5859
  type schemas_ColumnOpAdd = ColumnOpAdd;
4879
5860
  type schemas_ColumnOpRemove = ColumnOpRemove;
4880
5861
  type schemas_ColumnOpRename = ColumnOpRename;
4881
- type schemas_MigrationRequestNumber = MigrationRequestNumber;
4882
- type schemas_MigrationRequest = MigrationRequest;
4883
- type schemas_SortExpression = SortExpression;
4884
- type schemas_SortOrder = SortOrder;
4885
- type schemas_FuzzinessExpression = FuzzinessExpression;
4886
- type schemas_PrefixExpression = PrefixExpression;
4887
- type schemas_TargetExpression = TargetExpression;
4888
- type schemas_FilterExpression = FilterExpression;
4889
- type schemas_SummaryExpressionList = SummaryExpressionList;
4890
- type schemas_SummaryExpression = SummaryExpression;
4891
- type schemas_AggExpressionMap = AggExpressionMap;
4892
- type schemas_AggExpression = AggExpression;
5862
+ type schemas_ColumnVector = ColumnVector;
5863
+ type schemas_ColumnsProjection = ColumnsProjection;
5864
+ type schemas_Commit = Commit;
4893
5865
  type schemas_CountAgg = CountAgg;
4894
- type schemas_SumAgg = SumAgg;
4895
- type schemas_MaxAgg = MaxAgg;
4896
- type schemas_MinAgg = MinAgg;
4897
- type schemas_AverageAgg = AverageAgg;
4898
- type schemas_UniqueCountAgg = UniqueCountAgg;
5866
+ type schemas_DBBranch = DBBranch;
5867
+ type schemas_DBBranchName = DBBranchName;
5868
+ type schemas_DBName = DBName;
5869
+ type schemas_DataInputRecord = DataInputRecord;
5870
+ type schemas_DatabaseGithubSettings = DatabaseGithubSettings;
5871
+ type schemas_DatabaseMetadata = DatabaseMetadata;
4899
5872
  type schemas_DateHistogramAgg = DateHistogramAgg;
4900
- type schemas_TopValuesAgg = TopValuesAgg;
4901
- type schemas_NumericHistogramAgg = NumericHistogramAgg;
4902
- type schemas_HighlightExpression = HighlightExpression;
4903
- type schemas_BoosterExpression = BoosterExpression;
4904
- type schemas_FilterList = FilterList;
5873
+ type schemas_DateTime = DateTime;
5874
+ type schemas_FileAccessID = FileAccessID;
5875
+ type schemas_FileItemID = FileItemID;
5876
+ type schemas_FileName = FileName;
5877
+ type schemas_FileResponse = FileResponse;
5878
+ type schemas_FileSignature = FileSignature;
4905
5879
  type schemas_FilterColumn = FilterColumn;
4906
5880
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
5881
+ type schemas_FilterExpression = FilterExpression;
5882
+ type schemas_FilterList = FilterList;
4907
5883
  type schemas_FilterPredicate = FilterPredicate;
4908
5884
  type schemas_FilterPredicateOp = FilterPredicateOp;
4909
5885
  type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
4910
5886
  type schemas_FilterRangeValue = FilterRangeValue;
4911
5887
  type schemas_FilterValue = FilterValue;
5888
+ type schemas_FuzzinessExpression = FuzzinessExpression;
5889
+ type schemas_HighlightExpression = HighlightExpression;
5890
+ type schemas_InputFile = InputFile;
5891
+ type schemas_InputFileArray = InputFileArray;
5892
+ type schemas_InputFileEntry = InputFileEntry;
5893
+ type schemas_InviteID = InviteID;
5894
+ type schemas_InviteKey = InviteKey;
5895
+ type schemas_ListBranchesResponse = ListBranchesResponse;
5896
+ type schemas_ListDatabasesResponse = ListDatabasesResponse;
5897
+ type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
5898
+ type schemas_ListRegionsResponse = ListRegionsResponse;
5899
+ type schemas_MaxAgg = MaxAgg;
5900
+ type schemas_MediaType = MediaType;
5901
+ type schemas_MetricsDatapoint = MetricsDatapoint;
5902
+ type schemas_MetricsLatency = MetricsLatency;
5903
+ type schemas_Migration = Migration;
5904
+ type schemas_MigrationColumnOp = MigrationColumnOp;
5905
+ type schemas_MigrationObject = MigrationObject;
5906
+ type schemas_MigrationOp = MigrationOp;
5907
+ type schemas_MigrationRequest = MigrationRequest;
5908
+ type schemas_MigrationRequestNumber = MigrationRequestNumber;
5909
+ type schemas_MigrationStatus = MigrationStatus;
5910
+ type schemas_MigrationTableOp = MigrationTableOp;
5911
+ type schemas_MinAgg = MinAgg;
5912
+ type schemas_NumericHistogramAgg = NumericHistogramAgg;
5913
+ type schemas_ObjectValue = ObjectValue;
4912
5914
  type schemas_PageConfig = PageConfig;
4913
- type schemas_SearchPageConfig = SearchPageConfig;
4914
- type schemas_ColumnsProjection = ColumnsProjection;
4915
- type schemas_RecordMeta = RecordMeta;
5915
+ type schemas_PrefixExpression = PrefixExpression;
5916
+ type schemas_ProjectionConfig = ProjectionConfig;
5917
+ type schemas_QueryColumnsProjection = QueryColumnsProjection;
4916
5918
  type schemas_RecordID = RecordID;
4917
- type schemas_TableRename = TableRename;
5919
+ type schemas_RecordMeta = RecordMeta;
4918
5920
  type schemas_RecordsMetadata = RecordsMetadata;
4919
- type schemas_TransactionInsertOp = TransactionInsertOp;
4920
- type schemas_TransactionUpdateOp = TransactionUpdateOp;
5921
+ type schemas_Region = Region;
5922
+ type schemas_RevLink = RevLink;
5923
+ type schemas_Role = Role;
5924
+ type schemas_SQLRecord = SQLRecord;
5925
+ type schemas_Schema = Schema;
5926
+ type schemas_SchemaEditScript = SchemaEditScript;
5927
+ type schemas_SearchPageConfig = SearchPageConfig;
5928
+ type schemas_SortExpression = SortExpression;
5929
+ type schemas_SortOrder = SortOrder;
5930
+ type schemas_StartedFromMetadata = StartedFromMetadata;
5931
+ type schemas_SumAgg = SumAgg;
5932
+ type schemas_SummaryExpression = SummaryExpression;
5933
+ type schemas_SummaryExpressionList = SummaryExpressionList;
5934
+ type schemas_Table = Table;
5935
+ type schemas_TableMigration = TableMigration;
5936
+ type schemas_TableName = TableName;
5937
+ type schemas_TableOpAdd = TableOpAdd;
5938
+ type schemas_TableOpRemove = TableOpRemove;
5939
+ type schemas_TableOpRename = TableOpRename;
5940
+ type schemas_TableRename = TableRename;
5941
+ type schemas_TargetExpression = TargetExpression;
5942
+ type schemas_TopValuesAgg = TopValuesAgg;
4921
5943
  type schemas_TransactionDeleteOp = TransactionDeleteOp;
4922
- type schemas_TransactionSuccess = TransactionSuccess;
5944
+ type schemas_TransactionError = TransactionError;
5945
+ type schemas_TransactionFailure = TransactionFailure;
5946
+ type schemas_TransactionGetOp = TransactionGetOp;
5947
+ type schemas_TransactionInsertOp = TransactionInsertOp;
5948
+ type schemas_TransactionResultColumns = TransactionResultColumns;
5949
+ type schemas_TransactionResultDelete = TransactionResultDelete;
5950
+ type schemas_TransactionResultGet = TransactionResultGet;
4923
5951
  type schemas_TransactionResultInsert = TransactionResultInsert;
4924
5952
  type schemas_TransactionResultUpdate = TransactionResultUpdate;
4925
- type schemas_TransactionResultDelete = TransactionResultDelete;
4926
- type schemas_TransactionFailure = TransactionFailure;
4927
- type schemas_TransactionError = TransactionError;
5953
+ type schemas_TransactionSuccess = TransactionSuccess;
5954
+ type schemas_TransactionUpdateOp = TransactionUpdateOp;
5955
+ type schemas_UniqueCountAgg = UniqueCountAgg;
4928
5956
  type schemas_User = User;
4929
5957
  type schemas_UserID = UserID;
4930
5958
  type schemas_UserWithID = UserWithID;
4931
- type schemas_APIKeyName = APIKeyName;
4932
- type schemas_WorkspaceID = WorkspaceID;
4933
- type schemas_Role = Role;
4934
- type schemas_WorkspaceMeta = WorkspaceMeta;
4935
5959
  type schemas_Workspace = Workspace;
4936
- type schemas_WorkspaceMember = WorkspaceMember;
4937
- type schemas_InviteID = InviteID;
5960
+ type schemas_WorkspaceID = WorkspaceID;
4938
5961
  type schemas_WorkspaceInvite = WorkspaceInvite;
5962
+ type schemas_WorkspaceMember = WorkspaceMember;
4939
5963
  type schemas_WorkspaceMembers = WorkspaceMembers;
4940
- type schemas_InviteKey = InviteKey;
4941
- type schemas_DatabaseMetadata = DatabaseMetadata;
4942
- type schemas_ListDatabasesResponse = ListDatabasesResponse;
4943
- type schemas_ListRegionsResponse = ListRegionsResponse;
4944
- type schemas_Region = Region;
5964
+ type schemas_WorkspaceMeta = WorkspaceMeta;
4945
5965
  declare namespace schemas {
4946
5966
  export {
4947
- schemas_BranchMetadata as BranchMetadata,
4948
- schemas_BranchName as BranchName,
4949
- schemas_DBName as DBName,
4950
- schemas_DateTime as DateTime,
4951
- schemas_MigrationStatus as MigrationStatus,
4952
- schemas_ListBranchesResponse as ListBranchesResponse,
4953
- schemas_ListGitBranchesResponse as ListGitBranchesResponse,
4954
- schemas_Branch as Branch,
4955
- schemas_DBBranch as DBBranch,
4956
- schemas_StartedFromMetadata as StartedFromMetadata,
4957
- schemas_Schema as Schema,
4958
- schemas_SchemaEditScript as SchemaEditScript,
4959
- schemas_Table as Table,
4960
- schemas_Column as Column,
4961
- schemas_ColumnLink as ColumnLink,
4962
- schemas_RevLink as RevLink,
4963
- schemas_DBBranchName as DBBranchName,
4964
- schemas_TableName as TableName,
4965
- schemas_ColumnName as ColumnName,
4966
- schemas_MetricsDatapoint as MetricsDatapoint,
4967
- schemas_MetricsLatency as MetricsLatency,
4968
- schemas_BranchMigration as BranchMigration,
4969
- schemas_TableMigration as TableMigration,
4970
- schemas_ColumnMigration as ColumnMigration,
4971
- schemas_Commit as Commit,
4972
- schemas_Migration as Migration,
4973
- schemas_MigrationOp as MigrationOp,
4974
- schemas_MigrationTableOp as MigrationTableOp,
4975
- schemas_MigrationColumnOp as MigrationColumnOp,
4976
- schemas_TableOpAdd as TableOpAdd,
4977
- schemas_TableOpRemove as TableOpRemove,
4978
- schemas_TableOpRename as TableOpRename,
4979
- schemas_ColumnOpAdd as ColumnOpAdd,
4980
- schemas_ColumnOpRemove as ColumnOpRemove,
4981
- schemas_ColumnOpRename as ColumnOpRename,
4982
- schemas_MigrationRequestNumber as MigrationRequestNumber,
4983
- schemas_MigrationRequest as MigrationRequest,
4984
- schemas_SortExpression as SortExpression,
4985
- schemas_SortOrder as SortOrder,
4986
- schemas_FuzzinessExpression as FuzzinessExpression,
4987
- schemas_PrefixExpression as PrefixExpression,
4988
- schemas_TargetExpression as TargetExpression,
4989
- schemas_FilterExpression as FilterExpression,
4990
- schemas_SummaryExpressionList as SummaryExpressionList,
4991
- schemas_SummaryExpression as SummaryExpression,
4992
- schemas_AggExpressionMap as AggExpressionMap,
5967
+ schemas_APIKeyName as APIKeyName,
4993
5968
  schemas_AggExpression as AggExpression,
4994
- schemas_CountAgg as CountAgg,
4995
- schemas_SumAgg as SumAgg,
4996
- schemas_MaxAgg as MaxAgg,
4997
- schemas_MinAgg as MinAgg,
5969
+ schemas_AggExpressionMap as AggExpressionMap,
5970
+ AggResponse$1 as AggResponse,
4998
5971
  schemas_AverageAgg as AverageAgg,
4999
- schemas_UniqueCountAgg as UniqueCountAgg,
5000
- schemas_DateHistogramAgg as DateHistogramAgg,
5001
- schemas_TopValuesAgg as TopValuesAgg,
5002
- schemas_NumericHistogramAgg as NumericHistogramAgg,
5003
- schemas_HighlightExpression as HighlightExpression,
5004
5972
  schemas_BoosterExpression as BoosterExpression,
5005
- ValueBooster$1 as ValueBooster,
5006
- NumericBooster$1 as NumericBooster,
5973
+ schemas_Branch as Branch,
5974
+ schemas_BranchMetadata as BranchMetadata,
5975
+ schemas_BranchMigration as BranchMigration,
5976
+ schemas_BranchName as BranchName,
5977
+ schemas_BranchOp as BranchOp,
5978
+ schemas_BranchWithCopyID as BranchWithCopyID,
5979
+ schemas_Column as Column,
5980
+ schemas_ColumnLink as ColumnLink,
5981
+ schemas_ColumnMigration as ColumnMigration,
5982
+ schemas_ColumnName as ColumnName,
5983
+ schemas_ColumnOpAdd as ColumnOpAdd,
5984
+ schemas_ColumnOpRemove as ColumnOpRemove,
5985
+ schemas_ColumnOpRename as ColumnOpRename,
5986
+ schemas_ColumnVector as ColumnVector,
5987
+ schemas_ColumnsProjection as ColumnsProjection,
5988
+ schemas_Commit as Commit,
5989
+ schemas_CountAgg as CountAgg,
5990
+ schemas_DBBranch as DBBranch,
5991
+ schemas_DBBranchName as DBBranchName,
5992
+ schemas_DBName as DBName,
5993
+ schemas_DataInputRecord as DataInputRecord,
5994
+ schemas_DatabaseGithubSettings as DatabaseGithubSettings,
5995
+ schemas_DatabaseMetadata as DatabaseMetadata,
5007
5996
  DateBooster$1 as DateBooster,
5008
- schemas_FilterList as FilterList,
5997
+ schemas_DateHistogramAgg as DateHistogramAgg,
5998
+ schemas_DateTime as DateTime,
5999
+ schemas_FileAccessID as FileAccessID,
6000
+ schemas_FileItemID as FileItemID,
6001
+ schemas_FileName as FileName,
6002
+ schemas_FileResponse as FileResponse,
6003
+ schemas_FileSignature as FileSignature,
5009
6004
  schemas_FilterColumn as FilterColumn,
5010
6005
  schemas_FilterColumnIncludes as FilterColumnIncludes,
6006
+ schemas_FilterExpression as FilterExpression,
6007
+ schemas_FilterList as FilterList,
5011
6008
  schemas_FilterPredicate as FilterPredicate,
5012
6009
  schemas_FilterPredicateOp as FilterPredicateOp,
5013
6010
  schemas_FilterPredicateRangeOp as FilterPredicateRangeOp,
5014
6011
  schemas_FilterRangeValue as FilterRangeValue,
5015
6012
  schemas_FilterValue as FilterValue,
6013
+ schemas_FuzzinessExpression as FuzzinessExpression,
6014
+ schemas_HighlightExpression as HighlightExpression,
6015
+ schemas_InputFile as InputFile,
6016
+ schemas_InputFileArray as InputFileArray,
6017
+ schemas_InputFileEntry as InputFileEntry,
6018
+ schemas_InviteID as InviteID,
6019
+ schemas_InviteKey as InviteKey,
6020
+ schemas_ListBranchesResponse as ListBranchesResponse,
6021
+ schemas_ListDatabasesResponse as ListDatabasesResponse,
6022
+ schemas_ListGitBranchesResponse as ListGitBranchesResponse,
6023
+ schemas_ListRegionsResponse as ListRegionsResponse,
6024
+ schemas_MaxAgg as MaxAgg,
6025
+ schemas_MediaType as MediaType,
6026
+ schemas_MetricsDatapoint as MetricsDatapoint,
6027
+ schemas_MetricsLatency as MetricsLatency,
6028
+ schemas_Migration as Migration,
6029
+ schemas_MigrationColumnOp as MigrationColumnOp,
6030
+ schemas_MigrationObject as MigrationObject,
6031
+ schemas_MigrationOp as MigrationOp,
6032
+ schemas_MigrationRequest as MigrationRequest,
6033
+ schemas_MigrationRequestNumber as MigrationRequestNumber,
6034
+ schemas_MigrationStatus as MigrationStatus,
6035
+ schemas_MigrationTableOp as MigrationTableOp,
6036
+ schemas_MinAgg as MinAgg,
6037
+ NumericBooster$1 as NumericBooster,
6038
+ schemas_NumericHistogramAgg as NumericHistogramAgg,
6039
+ schemas_ObjectValue as ObjectValue,
5016
6040
  schemas_PageConfig as PageConfig,
5017
- schemas_SearchPageConfig as SearchPageConfig,
5018
- schemas_ColumnsProjection as ColumnsProjection,
5019
- schemas_RecordMeta as RecordMeta,
6041
+ schemas_PrefixExpression as PrefixExpression,
6042
+ schemas_ProjectionConfig as ProjectionConfig,
6043
+ schemas_QueryColumnsProjection as QueryColumnsProjection,
5020
6044
  schemas_RecordID as RecordID,
5021
- schemas_TableRename as TableRename,
6045
+ schemas_RecordMeta as RecordMeta,
5022
6046
  schemas_RecordsMetadata as RecordsMetadata,
5023
- AggResponse$1 as AggResponse,
5024
- TransactionOperation$1 as TransactionOperation,
5025
- schemas_TransactionInsertOp as TransactionInsertOp,
5026
- schemas_TransactionUpdateOp as TransactionUpdateOp,
6047
+ schemas_Region as Region,
6048
+ schemas_RevLink as RevLink,
6049
+ schemas_Role as Role,
6050
+ schemas_SQLRecord as SQLRecord,
6051
+ schemas_Schema as Schema,
6052
+ schemas_SchemaEditScript as SchemaEditScript,
6053
+ schemas_SearchPageConfig as SearchPageConfig,
6054
+ schemas_SortExpression as SortExpression,
6055
+ schemas_SortOrder as SortOrder,
6056
+ schemas_StartedFromMetadata as StartedFromMetadata,
6057
+ schemas_SumAgg as SumAgg,
6058
+ schemas_SummaryExpression as SummaryExpression,
6059
+ schemas_SummaryExpressionList as SummaryExpressionList,
6060
+ schemas_Table as Table,
6061
+ schemas_TableMigration as TableMigration,
6062
+ schemas_TableName as TableName,
6063
+ schemas_TableOpAdd as TableOpAdd,
6064
+ schemas_TableOpRemove as TableOpRemove,
6065
+ schemas_TableOpRename as TableOpRename,
6066
+ schemas_TableRename as TableRename,
6067
+ schemas_TargetExpression as TargetExpression,
6068
+ schemas_TopValuesAgg as TopValuesAgg,
5027
6069
  schemas_TransactionDeleteOp as TransactionDeleteOp,
5028
- schemas_TransactionSuccess as TransactionSuccess,
6070
+ schemas_TransactionError as TransactionError,
6071
+ schemas_TransactionFailure as TransactionFailure,
6072
+ schemas_TransactionGetOp as TransactionGetOp,
6073
+ schemas_TransactionInsertOp as TransactionInsertOp,
6074
+ TransactionOperation$1 as TransactionOperation,
6075
+ schemas_TransactionResultColumns as TransactionResultColumns,
6076
+ schemas_TransactionResultDelete as TransactionResultDelete,
6077
+ schemas_TransactionResultGet as TransactionResultGet,
5029
6078
  schemas_TransactionResultInsert as TransactionResultInsert,
5030
6079
  schemas_TransactionResultUpdate as TransactionResultUpdate,
5031
- schemas_TransactionResultDelete as TransactionResultDelete,
5032
- schemas_TransactionFailure as TransactionFailure,
5033
- schemas_TransactionError as TransactionError,
5034
- XataRecord$1 as XataRecord,
6080
+ schemas_TransactionSuccess as TransactionSuccess,
6081
+ schemas_TransactionUpdateOp as TransactionUpdateOp,
6082
+ schemas_UniqueCountAgg as UniqueCountAgg,
5035
6083
  schemas_User as User,
5036
6084
  schemas_UserID as UserID,
5037
6085
  schemas_UserWithID as UserWithID,
5038
- schemas_APIKeyName as APIKeyName,
5039
- schemas_WorkspaceID as WorkspaceID,
5040
- schemas_Role as Role,
5041
- schemas_WorkspaceMeta as WorkspaceMeta,
6086
+ ValueBooster$1 as ValueBooster,
5042
6087
  schemas_Workspace as Workspace,
5043
- schemas_WorkspaceMember as WorkspaceMember,
5044
- schemas_InviteID as InviteID,
6088
+ schemas_WorkspaceID as WorkspaceID,
5045
6089
  schemas_WorkspaceInvite as WorkspaceInvite,
6090
+ schemas_WorkspaceMember as WorkspaceMember,
5046
6091
  schemas_WorkspaceMembers as WorkspaceMembers,
5047
- schemas_InviteKey as InviteKey,
5048
- schemas_DatabaseMetadata as DatabaseMetadata,
5049
- schemas_ListDatabasesResponse as ListDatabasesResponse,
5050
- schemas_ListRegionsResponse as ListRegionsResponse,
5051
- schemas_Region as Region,
6092
+ schemas_WorkspaceMeta as WorkspaceMeta,
6093
+ XataRecord$1 as XataRecord,
5052
6094
  };
5053
6095
  }
5054
6096
 
@@ -5059,6 +6101,7 @@ interface XataApiClientOptions {
5059
6101
  host?: HostProvider;
5060
6102
  trace?: TraceFunction;
5061
6103
  clientName?: string;
6104
+ xataAgentExtra?: Record<string, string>;
5062
6105
  }
5063
6106
  declare class XataApiClient {
5064
6107
  #private;
@@ -5073,6 +6116,7 @@ declare class XataApiClient {
5073
6116
  get migrationRequests(): MigrationRequestsApi;
5074
6117
  get tables(): TableApi;
5075
6118
  get records(): RecordsApi;
6119
+ get files(): FilesApi;
5076
6120
  get searchAndFilter(): SearchAndFilterApi;
5077
6121
  }
5078
6122
  declare class UserApi {
@@ -5179,6 +6223,14 @@ declare class BranchApi {
5179
6223
  database: DBName;
5180
6224
  branch: BranchName;
5181
6225
  }): Promise<DeleteBranchResponse>;
6226
+ copyBranch({ workspace, region, database, branch, destinationBranch, limit }: {
6227
+ workspace: WorkspaceID;
6228
+ region: string;
6229
+ database: DBName;
6230
+ branch: BranchName;
6231
+ destinationBranch: BranchName;
6232
+ limit?: number;
6233
+ }): Promise<BranchWithCopyID>;
5182
6234
  updateBranchMetadata({ workspace, region, database, branch, metadata }: {
5183
6235
  workspace: WorkspaceID;
5184
6236
  region: string;
@@ -5386,6 +6438,75 @@ declare class RecordsApi {
5386
6438
  operations: TransactionOperation$1[];
5387
6439
  }): Promise<TransactionSuccess>;
5388
6440
  }
6441
+ declare class FilesApi {
6442
+ private extraProps;
6443
+ constructor(extraProps: ApiExtraProps);
6444
+ getFileItem({ workspace, region, database, branch, table, record, column, fileId }: {
6445
+ workspace: WorkspaceID;
6446
+ region: string;
6447
+ database: DBName;
6448
+ branch: BranchName;
6449
+ table: TableName;
6450
+ record: RecordID;
6451
+ column: ColumnName;
6452
+ fileId: string;
6453
+ }): Promise<any>;
6454
+ putFileItem({ workspace, region, database, branch, table, record, column, fileId, file }: {
6455
+ workspace: WorkspaceID;
6456
+ region: string;
6457
+ database: DBName;
6458
+ branch: BranchName;
6459
+ table: TableName;
6460
+ record: RecordID;
6461
+ column: ColumnName;
6462
+ fileId: string;
6463
+ file: any;
6464
+ }): Promise<PutFileResponse>;
6465
+ deleteFileItem({ workspace, region, database, branch, table, record, column, fileId }: {
6466
+ workspace: WorkspaceID;
6467
+ region: string;
6468
+ database: DBName;
6469
+ branch: BranchName;
6470
+ table: TableName;
6471
+ record: RecordID;
6472
+ column: ColumnName;
6473
+ fileId: string;
6474
+ }): Promise<PutFileResponse>;
6475
+ getFile({ workspace, region, database, branch, table, record, column }: {
6476
+ workspace: WorkspaceID;
6477
+ region: string;
6478
+ database: DBName;
6479
+ branch: BranchName;
6480
+ table: TableName;
6481
+ record: RecordID;
6482
+ column: ColumnName;
6483
+ }): Promise<any>;
6484
+ putFile({ workspace, region, database, branch, table, record, column, file }: {
6485
+ workspace: WorkspaceID;
6486
+ region: string;
6487
+ database: DBName;
6488
+ branch: BranchName;
6489
+ table: TableName;
6490
+ record: RecordID;
6491
+ column: ColumnName;
6492
+ file: Blob;
6493
+ }): Promise<PutFileResponse>;
6494
+ deleteFile({ workspace, region, database, branch, table, record, column }: {
6495
+ workspace: WorkspaceID;
6496
+ region: string;
6497
+ database: DBName;
6498
+ branch: BranchName;
6499
+ table: TableName;
6500
+ record: RecordID;
6501
+ column: ColumnName;
6502
+ }): Promise<PutFileResponse>;
6503
+ fileAccess({ workspace, region, fileId, verify }: {
6504
+ workspace: WorkspaceID;
6505
+ region: string;
6506
+ fileId: string;
6507
+ verify?: FileSignature;
6508
+ }): Promise<any>;
6509
+ }
5389
6510
  declare class SearchAndFilterApi {
5390
6511
  private extraProps;
5391
6512
  constructor(extraProps: ApiExtraProps);
@@ -5431,6 +6552,26 @@ declare class SearchAndFilterApi {
5431
6552
  prefix?: PrefixExpression;
5432
6553
  highlight?: HighlightExpression;
5433
6554
  }): Promise<SearchResponse>;
6555
+ vectorSearchTable({ workspace, region, database, branch, table, queryVector, column, similarityFunction, size, filter }: {
6556
+ workspace: WorkspaceID;
6557
+ region: string;
6558
+ database: DBName;
6559
+ branch: BranchName;
6560
+ table: TableName;
6561
+ queryVector: number[];
6562
+ column: string;
6563
+ similarityFunction?: string;
6564
+ size?: number;
6565
+ filter?: FilterExpression;
6566
+ }): Promise<SearchResponse>;
6567
+ askTable({ workspace, region, database, branch, table, options }: {
6568
+ workspace: WorkspaceID;
6569
+ region: string;
6570
+ database: DBName;
6571
+ branch: BranchName;
6572
+ table: TableName;
6573
+ options: AskTableRequestBody;
6574
+ }): Promise<AskTableResponse>;
5434
6575
  summarizeTable({ workspace, region, database, branch, table, filter, columns, summaries, sort, summariesFilter, page, consistency }: {
5435
6576
  workspace: WorkspaceID;
5436
6577
  region: string;
@@ -5516,7 +6657,7 @@ declare class MigrationRequestsApi {
5516
6657
  region: string;
5517
6658
  database: DBName;
5518
6659
  migrationRequest: MigrationRequestNumber;
5519
- }): Promise<Commit>;
6660
+ }): Promise<BranchOp>;
5520
6661
  }
5521
6662
  declare class MigrationsApi {
5522
6663
  private extraProps;
@@ -5554,20 +6695,23 @@ declare class MigrationsApi {
5554
6695
  size?: number;
5555
6696
  };
5556
6697
  }): Promise<GetBranchSchemaHistoryResponse>;
5557
- compareBranchWithUserSchema({ workspace, region, database, branch, schema }: {
6698
+ compareBranchWithUserSchema({ workspace, region, database, branch, schema, schemaOperations, branchOperations }: {
5558
6699
  workspace: WorkspaceID;
5559
6700
  region: string;
5560
6701
  database: DBName;
5561
6702
  branch: BranchName;
5562
6703
  schema: Schema;
6704
+ schemaOperations?: MigrationOp[];
6705
+ branchOperations?: MigrationOp[];
5563
6706
  }): Promise<SchemaCompareResponse>;
5564
- compareBranchSchemas({ workspace, region, database, branch, compare, schema }: {
6707
+ compareBranchSchemas({ workspace, region, database, branch, compare, sourceBranchOperations, targetBranchOperations }: {
5565
6708
  workspace: WorkspaceID;
5566
6709
  region: string;
5567
6710
  database: DBName;
5568
6711
  branch: BranchName;
5569
6712
  compare: BranchName;
5570
- schema: Schema;
6713
+ sourceBranchOperations?: MigrationOp[];
6714
+ targetBranchOperations?: MigrationOp[];
5571
6715
  }): Promise<SchemaCompareResponse>;
5572
6716
  updateBranchSchema({ workspace, region, database, branch, migration }: {
5573
6717
  workspace: WorkspaceID;
@@ -5592,6 +6736,13 @@ declare class MigrationsApi {
5592
6736
  branch: BranchName;
5593
6737
  edits: SchemaEditScript;
5594
6738
  }): Promise<SchemaUpdateResponse>;
6739
+ pushBranchMigrations({ workspace, region, database, branch, migrations }: {
6740
+ workspace: WorkspaceID;
6741
+ region: string;
6742
+ database: DBName;
6743
+ branch: BranchName;
6744
+ migrations: MigrationObject[];
6745
+ }): Promise<SchemaUpdateResponse>;
5595
6746
  }
5596
6747
  declare class DatabaseApi {
5597
6748
  private extraProps;
@@ -5617,13 +6768,31 @@ declare class DatabaseApi {
5617
6768
  database: DBName;
5618
6769
  metadata: DatabaseMetadata;
5619
6770
  }): Promise<DatabaseMetadata>;
6771
+ renameDatabase({ workspace, database, newName }: {
6772
+ workspace: WorkspaceID;
6773
+ database: DBName;
6774
+ newName: DBName;
6775
+ }): Promise<DatabaseMetadata>;
6776
+ getDatabaseGithubSettings({ workspace, database }: {
6777
+ workspace: WorkspaceID;
6778
+ database: DBName;
6779
+ }): Promise<DatabaseGithubSettings>;
6780
+ updateDatabaseGithubSettings({ workspace, database, settings }: {
6781
+ workspace: WorkspaceID;
6782
+ database: DBName;
6783
+ settings: DatabaseGithubSettings;
6784
+ }): Promise<DatabaseGithubSettings>;
6785
+ deleteDatabaseGithubSettings({ workspace, database }: {
6786
+ workspace: WorkspaceID;
6787
+ database: DBName;
6788
+ }): Promise<void>;
5620
6789
  listRegions({ workspace }: {
5621
6790
  workspace: WorkspaceID;
5622
6791
  }): Promise<ListRegionsResponse>;
5623
6792
  }
5624
6793
 
5625
6794
  declare class XataApiPlugin implements XataPlugin {
5626
- build(options: XataPluginOptions): Promise<XataApiClient>;
6795
+ build(options: XataPluginOptions): XataApiClient;
5627
6796
  }
5628
6797
 
5629
6798
  type StringKeys<O> = Extract<keyof O, string>;
@@ -5659,7 +6828,7 @@ type Narrowable = string | number | bigint | boolean;
5659
6828
  type Try<A1, A2, Catch = never> = A1 extends A2 ? A1 : Catch;
5660
6829
  type Narrow<A> = Try<A, [], NarrowRaw<A>>;
5661
6830
 
5662
- type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
6831
+ type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | `xata.${'version' | 'createdAt' | 'updatedAt'}` | DataProps<O> | NestedColumns<O, RecursivePath>;
5663
6832
  type WildcardColumns<O> = Values<{
5664
6833
  [K in SelectableColumn<O>]: K extends `${string}*` ? K : never;
5665
6834
  }>;
@@ -5669,10 +6838,10 @@ type ColumnsByValue<O, Value> = Values<{
5669
6838
  type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
5670
6839
  [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
5671
6840
  }>>;
5672
- 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> ? {
6841
+ type ValueAtColumn<Object, Key> = Key extends '*' ? Values<Object> : Key extends 'id' ? string : Key extends 'xata.version' ? number : Key extends 'xata.createdAt' ? Date : Key extends 'xata.updatedAt' ? Date : Key extends keyof Object ? Object[Key] : Key extends `${infer K}.${infer V}` ? K extends keyof Object ? Values<NonNullable<Object[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
5673
6842
  V: ValueAtColumn<Item, V>;
5674
- } : never : O[K] : never> : never : never;
5675
- type MAX_RECURSION = 5;
6843
+ } : never : Object[K] : never> : never : never;
6844
+ type MAX_RECURSION = 2;
5676
6845
  type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
5677
6846
  [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
5678
6847
  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
@@ -5688,6 +6857,7 @@ type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${in
5688
6857
  } : unknown;
5689
6858
  type ForwardNullable<T, R> = T extends NonNullable<T> ? R : R | null;
5690
6859
 
6860
+ type Identifier = string;
5691
6861
  /**
5692
6862
  * Represents an identifiable record from the database.
5693
6863
  */
@@ -5695,7 +6865,7 @@ interface Identifiable {
5695
6865
  /**
5696
6866
  * Unique id of this record.
5697
6867
  */
5698
- id: string;
6868
+ id: Identifier;
5699
6869
  }
5700
6870
  interface BaseData {
5701
6871
  [key: string]: any;
@@ -5704,10 +6874,23 @@ interface BaseData {
5704
6874
  * Represents a persisted record from the database.
5705
6875
  */
5706
6876
  interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
6877
+ /**
6878
+ * Metadata of this record.
6879
+ */
6880
+ xata: XataRecordMetadata;
5707
6881
  /**
5708
6882
  * Get metadata of this record.
6883
+ * @deprecated Use `xata` property instead.
5709
6884
  */
5710
6885
  getMetadata(): XataRecordMetadata;
6886
+ /**
6887
+ * Get an object representation of this record.
6888
+ */
6889
+ toSerializable(): JSONData<OriginalRecord>;
6890
+ /**
6891
+ * Get a string representation of this record.
6892
+ */
6893
+ toString(): string;
5711
6894
  /**
5712
6895
  * Retrieves a refreshed copy of the current record from the database.
5713
6896
  * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
@@ -5776,19 +6959,59 @@ type XataRecordMetadata = {
5776
6959
  * Number that is increased every time the record is updated.
5777
6960
  */
5778
6961
  version: number;
5779
- warnings?: string[];
6962
+ /**
6963
+ * Timestamp when the record was created.
6964
+ */
6965
+ createdAt: Date;
6966
+ /**
6967
+ * Timestamp when the record was last updated.
6968
+ */
6969
+ updatedAt: Date;
5780
6970
  };
5781
6971
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
5782
6972
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
6973
+ type NumericOperator = ExclusiveOr<{
6974
+ $increment?: number;
6975
+ }, ExclusiveOr<{
6976
+ $decrement?: number;
6977
+ }, ExclusiveOr<{
6978
+ $multiply?: number;
6979
+ }, {
6980
+ $divide?: number;
6981
+ }>>>;
5783
6982
  type EditableDataFields<T> = T extends XataRecord ? {
5784
- id: string;
5785
- } | string : NonNullable<T> extends XataRecord ? {
5786
- id: string;
5787
- } | string | null | undefined : T extends Date ? string | Date : NonNullable<T> extends Date ? string | Date | null | undefined : T;
6983
+ id: Identifier;
6984
+ } | Identifier : NonNullable<T> extends XataRecord ? {
6985
+ id: Identifier;
6986
+ } | Identifier | null | undefined : T extends Date ? string | Date : NonNullable<T> extends Date ? string | Date | null | undefined : T extends number ? number | NumericOperator : T;
5788
6987
  type EditableData<O extends XataRecord> = Identifiable & Partial<Omit<{
5789
6988
  [K in keyof O]: EditableDataFields<O[K]>;
5790
6989
  }, keyof XataRecord>>;
6990
+ type JSONDataFields<T> = T extends XataRecord ? string : NonNullable<T> extends XataRecord ? string | null | undefined : T extends Date ? string : NonNullable<T> extends Date ? string | null | undefined : T;
6991
+ type JSONDataBase = Identifiable & {
6992
+ /**
6993
+ * Metadata about the record.
6994
+ */
6995
+ xata: {
6996
+ /**
6997
+ * Timestamp when the record was created.
6998
+ */
6999
+ createdAt: string;
7000
+ /**
7001
+ * Timestamp when the record was last updated.
7002
+ */
7003
+ updatedAt: string;
7004
+ /**
7005
+ * Number that is increased every time the record is updated.
7006
+ */
7007
+ version: number;
7008
+ };
7009
+ };
7010
+ type JSONData<O> = JSONDataBase & Partial<Omit<{
7011
+ [K in keyof O]: JSONDataFields<O[K]>;
7012
+ }, keyof XataRecord>>;
5791
7013
 
7014
+ type FilterColumns<T> = ColumnsByValue<T, any> | `xata.${keyof XataRecordMetadata}`;
5792
7015
  /**
5793
7016
  * PropertyMatchFilter
5794
7017
  * Example:
@@ -5808,7 +7031,7 @@ type EditableData<O extends XataRecord> = Identifiable & Partial<Omit<{
5808
7031
  }
5809
7032
  */
5810
7033
  type PropertyAccessFilter<Record> = {
5811
- [key in ColumnsByValue<Record, any>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
7034
+ [key in FilterColumns<Record>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
5812
7035
  };
5813
7036
  type PropertyFilter<T> = T | {
5814
7037
  $is: T;
@@ -5870,7 +7093,7 @@ type AggregatorFilter<T> = {
5870
7093
  * Example: { filter: { $exists: "settings" } }
5871
7094
  */
5872
7095
  type ExistanceFilter<Record> = {
5873
- [key in '$exists' | '$notExists']?: ColumnsByValue<Record, any>;
7096
+ [key in '$exists' | '$notExists']?: FilterColumns<Record>;
5874
7097
  };
5875
7098
  type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
5876
7099
  /**
@@ -5887,6 +7110,12 @@ type DateBooster = {
5887
7110
  origin?: string;
5888
7111
  scale: string;
5889
7112
  decay: number;
7113
+ /**
7114
+ * The factor with which to multiply the added boost.
7115
+ *
7116
+ * @minimum 0
7117
+ */
7118
+ factor?: number;
5890
7119
  };
5891
7120
  type NumericBooster = {
5892
7121
  factor: number;
@@ -6003,7 +7232,7 @@ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends X
6003
7232
  #private;
6004
7233
  private db;
6005
7234
  constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Table[]);
6006
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
7235
+ build(pluginOptions: XataPluginOptions): SearchPluginResult<Schemas>;
6007
7236
  }
6008
7237
  type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
6009
7238
  getMetadata: () => XataRecordMetadata & SearchExtraProperties;
@@ -6193,13 +7422,55 @@ type ComplexAggregationResult = {
6193
7422
  }>;
6194
7423
  };
6195
7424
 
7425
+ type KeywordAskOptions<Record extends XataRecord> = {
7426
+ searchType: 'keyword';
7427
+ search?: {
7428
+ fuzziness?: FuzzinessExpression;
7429
+ target?: TargetColumn<Record>[];
7430
+ prefix?: PrefixExpression;
7431
+ filter?: Filter<Record>;
7432
+ boosters?: Boosters<Record>[];
7433
+ };
7434
+ };
7435
+ type VectorAskOptions<Record extends XataRecord> = {
7436
+ searchType: 'vector';
7437
+ vectorSearch?: {
7438
+ /**
7439
+ * The column to use for vector search. It must be of type `vector`.
7440
+ */
7441
+ column: string;
7442
+ /**
7443
+ * The column containing the text for vector search. Must be of type `text`.
7444
+ */
7445
+ contentColumn: string;
7446
+ filter?: Filter<Record>;
7447
+ };
7448
+ };
7449
+ type TypeAskOptions<Record extends XataRecord> = KeywordAskOptions<Record> | VectorAskOptions<Record>;
7450
+ type BaseAskOptions = {
7451
+ rules?: string[];
7452
+ };
7453
+ type AskOptions<Record extends XataRecord> = TypeAskOptions<Record> & BaseAskOptions;
7454
+ type AskResult = {
7455
+ answer?: string;
7456
+ records?: string[];
7457
+ };
7458
+
6196
7459
  type SortDirection = 'asc' | 'desc';
6197
- type SortFilterExtended<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = {
7460
+ type RandomFilter = {
7461
+ '*': 'random';
7462
+ };
7463
+ type RandomFilterExtended = {
7464
+ column: '*';
7465
+ direction: 'random';
7466
+ };
7467
+ type SortColumns<T extends XataRecord> = ColumnsByValue<T, any> | `xata.${keyof XataRecordMetadata}`;
7468
+ type SortFilterExtended<T extends XataRecord, Columns extends string = SortColumns<T>> = RandomFilterExtended | {
6198
7469
  column: Columns;
6199
7470
  direction?: SortDirection;
6200
7471
  };
6201
- type SortFilter<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = Columns | SortFilterExtended<T, Columns> | SortFilterBase<T, Columns>;
6202
- type SortFilterBase<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = Values<{
7472
+ type SortFilter<T extends XataRecord, Columns extends string = SortColumns<T>> = Columns | SortFilterExtended<T, Columns> | SortFilterBase<T, Columns> | RandomFilter;
7473
+ type SortFilterBase<T extends XataRecord, Columns extends string = SortColumns<T>> = Values<{
6203
7474
  [Key in Columns]: {
6204
7475
  [K in Key]: SortDirection;
6205
7476
  };
@@ -6221,6 +7492,7 @@ type SummarizeParams<Record extends XataRecord, Expression extends Dictionary<Su
6221
7492
  pagination?: {
6222
7493
  size: number;
6223
7494
  };
7495
+ consistency?: 'strong' | 'eventual';
6224
7496
  };
6225
7497
  type SummarizeResult<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>, Columns extends SelectableColumn<Record>[]> = {
6226
7498
  summaries: SummarizeResultItem<Record, Expression, Columns>[];
@@ -6329,7 +7601,9 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6329
7601
  * @param direction The direction. Either ascending or descending.
6330
7602
  * @returns A new Query object.
6331
7603
  */
6332
- sort<F extends ColumnsByValue<Record, any>>(column: F, direction?: SortDirection): Query<Record, Result>;
7604
+ sort<F extends ColumnsByValue<Record, any>>(column: F, direction: SortDirection): Query<Record, Result>;
7605
+ sort(column: '*', direction: 'random'): Query<Record, Result>;
7606
+ sort<F extends ColumnsByValue<Record, any>>(column: F): Query<Record, Result>;
6333
7607
  /**
6334
7608
  * Builds a new query specifying the set of columns to be returned in the query response.
6335
7609
  * @param columns Array of column names to be returned by the query.
@@ -6355,7 +7629,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6355
7629
  * @param options Pagination options
6356
7630
  * @returns A page of results
6357
7631
  */
6358
- getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
7632
+ getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, (typeof options)['columns']>>>;
6359
7633
  /**
6360
7634
  * Get results in an iterator
6361
7635
  *
@@ -6386,7 +7660,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6386
7660
  */
6387
7661
  getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
6388
7662
  batchSize?: number;
6389
- }>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
7663
+ }>(options: Options): AsyncGenerator<SelectedPick<Record, (typeof options)['columns']>[]>;
6390
7664
  /**
6391
7665
  * Performs the query in the database and returns a set of results.
6392
7666
  * @returns An array of records from the database.
@@ -6397,7 +7671,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6397
7671
  * @param options Additional options to be used when performing the query.
6398
7672
  * @returns An array of records from the database.
6399
7673
  */
6400
- getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
7674
+ getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, (typeof options)['columns']>>>;
6401
7675
  /**
6402
7676
  * Performs the query in the database and returns a set of results.
6403
7677
  * @param options Additional options to be used when performing the query.
@@ -6418,7 +7692,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6418
7692
  */
6419
7693
  getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
6420
7694
  batchSize?: number;
6421
- }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
7695
+ }>(options: Options): Promise<SelectedPick<Record, (typeof options)['columns']>[]>;
6422
7696
  /**
6423
7697
  * Performs the query in the database and returns all the results.
6424
7698
  * Warning: If there are a large number of results, this method can have performance implications.
@@ -6438,7 +7712,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6438
7712
  * @param options Additional options to be used when performing the query.
6439
7713
  * @returns The first record that matches the query, or null if no record matched the query.
6440
7714
  */
6441
- getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
7715
+ getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, (typeof options)['columns']> | null>;
6442
7716
  /**
6443
7717
  * Performs the query in the database and returns the first result.
6444
7718
  * @param options Additional options to be used when performing the query.
@@ -6457,7 +7731,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
6457
7731
  * @returns The first record that matches the query, or null if no record matched the query.
6458
7732
  * @throws if there are no results.
6459
7733
  */
6460
- getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
7734
+ getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, (typeof options)['columns']>>;
6461
7735
  /**
6462
7736
  * Performs the query in the database and returns the first result.
6463
7737
  * @param options Additional options to be used when performing the query.
@@ -6506,6 +7780,7 @@ type PaginationQueryMeta = {
6506
7780
  page: {
6507
7781
  cursor: string;
6508
7782
  more: boolean;
7783
+ size: number;
6509
7784
  };
6510
7785
  };
6511
7786
  interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
@@ -6588,6 +7863,8 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
6588
7863
  constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
6589
7864
  static parseConstructorParams(...args: any[]): any[];
6590
7865
  toArray(): Result[];
7866
+ toSerializable(): JSONData<Result>[];
7867
+ toString(): string;
6591
7868
  map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
6592
7869
  /**
6593
7870
  * Retrieve next page of records
@@ -6636,7 +7913,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6636
7913
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6637
7914
  * @returns The full persisted record.
6638
7915
  */
6639
- abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7916
+ abstract create<K extends SelectableColumn<Record>>(id: Identifier, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
6640
7917
  ifVersion?: number;
6641
7918
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6642
7919
  /**
@@ -6645,7 +7922,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6645
7922
  * @param object Object containing the column names with their values to be stored in the table.
6646
7923
  * @returns The full persisted record.
6647
7924
  */
6648
- abstract create(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
7925
+ abstract create(id: Identifier, object: Omit<EditableData<Record>, 'id'>, options?: {
6649
7926
  ifVersion?: number;
6650
7927
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6651
7928
  /**
@@ -6667,26 +7944,26 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6667
7944
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6668
7945
  * @returns The persisted record for the given id or null if the record could not be found.
6669
7946
  */
6670
- abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
7947
+ abstract read<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
6671
7948
  /**
6672
7949
  * Queries a single record from the table given its unique id.
6673
7950
  * @param id The unique id.
6674
7951
  * @returns The persisted record for the given id or null if the record could not be found.
6675
7952
  */
6676
- abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
7953
+ abstract read(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
6677
7954
  /**
6678
7955
  * Queries multiple records from the table given their unique id.
6679
7956
  * @param ids The unique ids array.
6680
7957
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6681
7958
  * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
6682
7959
  */
6683
- abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7960
+ abstract read<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
6684
7961
  /**
6685
7962
  * Queries multiple records from the table given their unique id.
6686
7963
  * @param ids The unique ids array.
6687
7964
  * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
6688
7965
  */
6689
- abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7966
+ abstract read(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
6690
7967
  /**
6691
7968
  * Queries a single record from the table by the id in the object.
6692
7969
  * @param object Object containing the id of the record.
@@ -6720,14 +7997,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6720
7997
  * @returns The persisted record for the given id.
6721
7998
  * @throws If the record could not be found.
6722
7999
  */
6723
- abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8000
+ abstract readOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6724
8001
  /**
6725
8002
  * Queries a single record from the table given its unique id.
6726
8003
  * @param id The unique id.
6727
8004
  * @returns The persisted record for the given id.
6728
8005
  * @throws If the record could not be found.
6729
8006
  */
6730
- abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8007
+ abstract readOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6731
8008
  /**
6732
8009
  * Queries multiple records from the table given their unique id.
6733
8010
  * @param ids The unique ids array.
@@ -6735,14 +8012,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6735
8012
  * @returns The persisted records for the given ids in order.
6736
8013
  * @throws If one or more records could not be found.
6737
8014
  */
6738
- abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8015
+ abstract readOrThrow<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
6739
8016
  /**
6740
8017
  * Queries multiple records from the table given their unique id.
6741
8018
  * @param ids The unique ids array.
6742
8019
  * @returns The persisted records for the given ids in order.
6743
8020
  * @throws If one or more records could not be found.
6744
8021
  */
6745
- abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8022
+ abstract readOrThrow(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
6746
8023
  /**
6747
8024
  * Queries a single record from the table by the id in the object.
6748
8025
  * @param object Object containing the id of the record.
@@ -6797,7 +8074,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6797
8074
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6798
8075
  * @returns The full persisted record, null if the record could not be found.
6799
8076
  */
6800
- abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8077
+ abstract update<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
6801
8078
  ifVersion?: number;
6802
8079
  }): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
6803
8080
  /**
@@ -6806,7 +8083,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6806
8083
  * @param object The column names and their values that have to be updated.
6807
8084
  * @returns The full persisted record, null if the record could not be found.
6808
8085
  */
6809
- abstract update(id: string, object: Partial<EditableData<Record>>, options?: {
8086
+ abstract update(id: Identifier, object: Partial<EditableData<Record>>, options?: {
6810
8087
  ifVersion?: number;
6811
8088
  }): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
6812
8089
  /**
@@ -6849,7 +8126,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6849
8126
  * @returns The full persisted record.
6850
8127
  * @throws If the record could not be found.
6851
8128
  */
6852
- abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8129
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
6853
8130
  ifVersion?: number;
6854
8131
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6855
8132
  /**
@@ -6859,7 +8136,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6859
8136
  * @returns The full persisted record.
6860
8137
  * @throws If the record could not be found.
6861
8138
  */
6862
- abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>, options?: {
8139
+ abstract updateOrThrow(id: Identifier, object: Partial<EditableData<Record>>, options?: {
6863
8140
  ifVersion?: number;
6864
8141
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6865
8142
  /**
@@ -6884,7 +8161,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6884
8161
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6885
8162
  * @returns The full persisted record.
6886
8163
  */
6887
- abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8164
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[], options?: {
6888
8165
  ifVersion?: number;
6889
8166
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6890
8167
  /**
@@ -6893,7 +8170,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6893
8170
  * @param object Object containing the column names with their values to be persisted in the table.
6894
8171
  * @returns The full persisted record.
6895
8172
  */
6896
- abstract createOrUpdate(object: EditableData<Record> & Identifiable, options?: {
8173
+ abstract createOrUpdate(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, options?: {
6897
8174
  ifVersion?: number;
6898
8175
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6899
8176
  /**
@@ -6904,7 +8181,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6904
8181
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6905
8182
  * @returns The full persisted record.
6906
8183
  */
6907
- abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8184
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
6908
8185
  ifVersion?: number;
6909
8186
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6910
8187
  /**
@@ -6914,7 +8191,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6914
8191
  * @param object The column names and the values to be persisted.
6915
8192
  * @returns The full persisted record.
6916
8193
  */
6917
- abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8194
+ abstract createOrUpdate(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, options?: {
6918
8195
  ifVersion?: number;
6919
8196
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6920
8197
  /**
@@ -6924,14 +8201,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6924
8201
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6925
8202
  * @returns Array of the persisted records.
6926
8203
  */
6927
- abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8204
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
6928
8205
  /**
6929
8206
  * Creates or updates a single record. If a record exists with the given id,
6930
8207
  * it will be partially updated, otherwise a new record will be created.
6931
8208
  * @param objects Array of objects with the column names and the values to be stored in the table.
6932
8209
  * @returns Array of the persisted records.
6933
8210
  */
6934
- abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8211
+ abstract createOrUpdate(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
6935
8212
  /**
6936
8213
  * Creates or replaces a single record. If a record exists with the given id,
6937
8214
  * it will be replaced, otherwise a new record will be created.
@@ -6939,7 +8216,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6939
8216
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6940
8217
  * @returns The full persisted record.
6941
8218
  */
6942
- abstract createOrReplace<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8219
+ abstract createOrReplace<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[], options?: {
6943
8220
  ifVersion?: number;
6944
8221
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6945
8222
  /**
@@ -6948,7 +8225,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6948
8225
  * @param object Object containing the column names with their values to be persisted in the table.
6949
8226
  * @returns The full persisted record.
6950
8227
  */
6951
- abstract createOrReplace(object: EditableData<Record> & Identifiable, options?: {
8228
+ abstract createOrReplace(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, options?: {
6952
8229
  ifVersion?: number;
6953
8230
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6954
8231
  /**
@@ -6959,7 +8236,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6959
8236
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6960
8237
  * @returns The full persisted record.
6961
8238
  */
6962
- abstract createOrReplace<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8239
+ abstract createOrReplace<K extends SelectableColumn<Record>>(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
6963
8240
  ifVersion?: number;
6964
8241
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
6965
8242
  /**
@@ -6969,7 +8246,7 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6969
8246
  * @param object The column names and the values to be persisted.
6970
8247
  * @returns The full persisted record.
6971
8248
  */
6972
- abstract createOrReplace(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8249
+ abstract createOrReplace(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, options?: {
6973
8250
  ifVersion?: number;
6974
8251
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
6975
8252
  /**
@@ -6979,14 +8256,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
6979
8256
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
6980
8257
  * @returns Array of the persisted records.
6981
8258
  */
6982
- abstract createOrReplace<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8259
+ abstract createOrReplace<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
6983
8260
  /**
6984
8261
  * Creates or replaces a single record. If a record exists with the given id,
6985
8262
  * it will be replaced, otherwise a new record will be created.
6986
8263
  * @param objects Array of objects with the column names and the values to be stored in the table.
6987
8264
  * @returns Array of the persisted records.
6988
8265
  */
6989
- abstract createOrReplace(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8266
+ abstract createOrReplace(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
6990
8267
  /**
6991
8268
  * Deletes a record given its unique id.
6992
8269
  * @param object An object with a unique id.
@@ -7006,13 +8283,13 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7006
8283
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7007
8284
  * @returns The deleted record, null if the record could not be found.
7008
8285
  */
7009
- abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
8286
+ abstract delete<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7010
8287
  /**
7011
8288
  * Deletes a record given a unique id.
7012
8289
  * @param id The unique id.
7013
8290
  * @returns The deleted record, null if the record could not be found.
7014
8291
  */
7015
- abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
8292
+ abstract delete(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7016
8293
  /**
7017
8294
  * Deletes multiple records given an array of objects with ids.
7018
8295
  * @param objects An array of objects with unique ids.
@@ -7032,13 +8309,13 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7032
8309
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
7033
8310
  * @returns Array of the deleted records in order (if a record could not be found null is returned).
7034
8311
  */
7035
- abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8312
+ abstract delete<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7036
8313
  /**
7037
8314
  * Deletes multiple records given an array of unique ids.
7038
8315
  * @param objects An array of ids.
7039
8316
  * @returns Array of the deleted records in order (if a record could not be found null is returned).
7040
8317
  */
7041
- abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8318
+ abstract delete(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7042
8319
  /**
7043
8320
  * Deletes a record given its unique id.
7044
8321
  * @param object An object with a unique id.
@@ -7061,14 +8338,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7061
8338
  * @returns The deleted record, null if the record could not be found.
7062
8339
  * @throws If the record could not be found.
7063
8340
  */
7064
- abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8341
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7065
8342
  /**
7066
8343
  * Deletes a record given a unique id.
7067
8344
  * @param id The unique id.
7068
8345
  * @returns The deleted record, null if the record could not be found.
7069
8346
  * @throws If the record could not be found.
7070
8347
  */
7071
- abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8348
+ abstract deleteOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7072
8349
  /**
7073
8350
  * Deletes multiple records given an array of objects with ids.
7074
8351
  * @param objects An array of objects with unique ids.
@@ -7091,14 +8368,14 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7091
8368
  * @returns Array of the deleted records in order (if a record could not be found null is returned).
7092
8369
  * @throws If one or more records could not be found.
7093
8370
  */
7094
- abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8371
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7095
8372
  /**
7096
8373
  * Deletes multiple records given an array of unique ids.
7097
8374
  * @param objects An array of ids.
7098
8375
  * @returns Array of the deleted records in order.
7099
8376
  * @throws If one or more records could not be found.
7100
8377
  */
7101
- abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8378
+ abstract deleteOrThrow(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7102
8379
  /**
7103
8380
  * Search for records in the table.
7104
8381
  * @param query The query to search for.
@@ -7114,6 +8391,30 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7114
8391
  page?: SearchPageConfig;
7115
8392
  target?: TargetColumn<Record>[];
7116
8393
  }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
8394
+ /**
8395
+ * Search for vectors in the table.
8396
+ * @param column The column to search for.
8397
+ * @param query The vector to search for similarities. Must have the same dimension as the vector column used.
8398
+ * @param options The options to search with (like: spaceFunction)
8399
+ */
8400
+ abstract vectorSearch<F extends ColumnsByValue<Record, number[]>>(column: F, query: number[], options?: {
8401
+ /**
8402
+ * The function used to measure the distance between two points. Can be one of:
8403
+ * `cosineSimilarity`, `l1`, `l2`. The default is `cosineSimilarity`.
8404
+ *
8405
+ * @default cosineSimilarity
8406
+ */
8407
+ similarityFunction?: string;
8408
+ /**
8409
+ * Number of results to return.
8410
+ *
8411
+ * @default 10
8412
+ * @maximum 100
8413
+ * @minimum 1
8414
+ */
8415
+ size?: number;
8416
+ filter?: Filter<Record>;
8417
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
7117
8418
  /**
7118
8419
  * Aggregates records in the table.
7119
8420
  * @param expression The aggregations to perform.
@@ -7121,6 +8422,16 @@ declare abstract class Repository<Record extends XataRecord> extends Query<Recor
7121
8422
  * @returns The requested aggregations.
7122
8423
  */
7123
8424
  abstract aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(expression?: Expression, filter?: Filter<Record>): Promise<AggregationResult<Record, Expression>>;
8425
+ /**
8426
+ * Experimental: Ask the database to perform a natural language question.
8427
+ */
8428
+ abstract ask(question: string, options?: AskOptions<Record>): Promise<AskResult>;
8429
+ /**
8430
+ * Experimental: Ask the database to perform a natural language question.
8431
+ */
8432
+ abstract ask(question: string, options: AskOptions<Record> & {
8433
+ onMessage: (message: AskResult) => void;
8434
+ }): void;
7124
8435
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
7125
8436
  }
7126
8437
  declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
@@ -7137,26 +8448,26 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7137
8448
  create(object: EditableData<Record> & Partial<Identifiable>, options?: {
7138
8449
  ifVersion?: number;
7139
8450
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7140
- create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[], options?: {
8451
+ create<K extends SelectableColumn<Record>>(id: Identifier, object: EditableData<Record>, columns: K[], options?: {
7141
8452
  ifVersion?: number;
7142
8453
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7143
- create(id: string, object: EditableData<Record>, options?: {
8454
+ create(id: Identifier, object: EditableData<Record>, options?: {
7144
8455
  ifVersion?: number;
7145
8456
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7146
8457
  create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7147
8458
  create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7148
- read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
8459
+ read<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
7149
8460
  read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
7150
- read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7151
- read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8461
+ read<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8462
+ read(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7152
8463
  read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
7153
8464
  read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
7154
8465
  read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7155
8466
  read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7156
- readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7157
- readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7158
- readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7159
- readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8467
+ readOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8468
+ readOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8469
+ readOrThrow<K extends SelectableColumn<Record>>(ids: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8470
+ readOrThrow(ids: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7160
8471
  readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7161
8472
  readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7162
8473
  readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
@@ -7167,10 +8478,10 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7167
8478
  update(object: Partial<EditableData<Record>> & Identifiable, options?: {
7168
8479
  ifVersion?: number;
7169
8480
  }): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7170
- update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8481
+ update<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
7171
8482
  ifVersion?: number;
7172
8483
  }): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7173
- update(id: string, object: Partial<EditableData<Record>>, options?: {
8484
+ update(id: Identifier, object: Partial<EditableData<Record>>, options?: {
7174
8485
  ifVersion?: number;
7175
8486
  }): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7176
8487
  update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
@@ -7181,58 +8492,58 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7181
8492
  updateOrThrow(object: Partial<EditableData<Record>> & Identifiable, options?: {
7182
8493
  ifVersion?: number;
7183
8494
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7184
- updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[], options?: {
8495
+ updateOrThrow<K extends SelectableColumn<Record>>(id: Identifier, object: Partial<EditableData<Record>>, columns: K[], options?: {
7185
8496
  ifVersion?: number;
7186
8497
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7187
- updateOrThrow(id: string, object: Partial<EditableData<Record>>, options?: {
8498
+ updateOrThrow(id: Identifier, object: Partial<EditableData<Record>>, options?: {
7188
8499
  ifVersion?: number;
7189
8500
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7190
8501
  updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7191
8502
  updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7192
- createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8503
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[], options?: {
7193
8504
  ifVersion?: number;
7194
8505
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7195
- createOrUpdate(object: EditableData<Record> & Identifiable, options?: {
8506
+ createOrUpdate(object: EditableData<Record> & Partial<Identifiable>, options?: {
7196
8507
  ifVersion?: number;
7197
8508
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7198
- createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8509
+ createOrUpdate<K extends SelectableColumn<Record>>(id: Identifier, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7199
8510
  ifVersion?: number;
7200
8511
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7201
- createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8512
+ createOrUpdate(id: Identifier, object: Omit<EditableData<Record>, 'id'>, options?: {
7202
8513
  ifVersion?: number;
7203
8514
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7204
- createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7205
- createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7206
- createOrReplace<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[], options?: {
8515
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8516
+ createOrUpdate(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8517
+ createOrReplace<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[], options?: {
7207
8518
  ifVersion?: number;
7208
8519
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7209
- createOrReplace(object: EditableData<Record> & Identifiable, options?: {
8520
+ createOrReplace(object: EditableData<Record> & Partial<Identifiable>, options?: {
7210
8521
  ifVersion?: number;
7211
8522
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7212
- createOrReplace<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
8523
+ createOrReplace<K extends SelectableColumn<Record>>(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, columns: K[], options?: {
7213
8524
  ifVersion?: number;
7214
8525
  }): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7215
- createOrReplace(id: string, object: Omit<EditableData<Record>, 'id'>, options?: {
8526
+ createOrReplace(id: Identifier | undefined, object: Omit<EditableData<Record>, 'id'>, options?: {
7216
8527
  ifVersion?: number;
7217
8528
  }): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7218
- createOrReplace<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
7219
- createOrReplace(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
8529
+ createOrReplace<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
8530
+ createOrReplace(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
7220
8531
  delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7221
8532
  delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7222
- delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
7223
- delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
8533
+ delete<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
8534
+ delete(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
7224
8535
  delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7225
8536
  delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7226
- delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
7227
- delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
8537
+ delete<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
8538
+ delete(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
7228
8539
  deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7229
8540
  deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7230
- deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
7231
- deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
8541
+ deleteOrThrow<K extends SelectableColumn<Record>>(id: Identifier, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
8542
+ deleteOrThrow(id: Identifier): Promise<Readonly<SelectedPick<Record, ['*']>>>;
7232
8543
  deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7233
8544
  deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7234
- deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
7235
- deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
8545
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: Identifier[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
8546
+ deleteOrThrow(objects: Identifier[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
7236
8547
  search(query: string, options?: {
7237
8548
  fuzziness?: FuzzinessExpression;
7238
8549
  prefix?: PrefixExpression;
@@ -7242,9 +8553,17 @@ declare class RestRepository<Record extends XataRecord> extends Query<Record, Se
7242
8553
  page?: SearchPageConfig;
7243
8554
  target?: TargetColumn<Record>[];
7244
8555
  }): Promise<any>;
8556
+ vectorSearch<F extends ColumnsByValue<Record, number[]>>(column: F, query: number[], options?: {
8557
+ similarityFunction?: string | undefined;
8558
+ size?: number | undefined;
8559
+ filter?: Filter<Record> | undefined;
8560
+ } | undefined): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
7245
8561
  aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(aggs?: Expression, filter?: Filter<Record>): Promise<any>;
7246
8562
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
7247
8563
  summarizeTable<Result extends XataRecord>(query: Query<Record, Result>, summaries?: Dictionary<SummarizeExpression<Record>>, summariesFilter?: FilterExpression): Promise<SummarizeResponse>;
8564
+ ask(question: string, options?: AskOptions<Record> & {
8565
+ onMessage?: (message: AskResult) => void;
8566
+ }): any;
7248
8567
  }
7249
8568
 
7250
8569
  type BaseSchema = {
@@ -7300,7 +8619,7 @@ type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Proper
7300
8619
  } : {
7301
8620
  [K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
7302
8621
  } : never : never;
7303
- type InnerType<Type, ObjectColumns, Tables, LinkedTable> = 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 {
8622
+ type InnerType<Type, ObjectColumns, Tables, LinkedTable> = 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 'vector' ? number[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
7304
8623
  name: string;
7305
8624
  type: string;
7306
8625
  } ? UnionToIntersection<Values<{
@@ -7358,11 +8677,11 @@ declare const le: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
7358
8677
  /**
7359
8678
  * Operator to restrict results to only values that are not null.
7360
8679
  */
7361
- declare const exists: <T>(column?: ColumnsByValue<T, any> | undefined) => ExistanceFilter<T>;
8680
+ declare const exists: <T>(column?: FilterColumns<T> | undefined) => ExistanceFilter<T>;
7362
8681
  /**
7363
8682
  * Operator to restrict results to only values that are null.
7364
8683
  */
7365
- declare const notExists: <T>(column?: ColumnsByValue<T, any> | undefined) => ExistanceFilter<T>;
8684
+ declare const notExists: <T>(column?: FilterColumns<T> | undefined) => ExistanceFilter<T>;
7366
8685
  /**
7367
8686
  * Operator to restrict results to only values that start with the given prefix.
7368
8687
  */
@@ -7452,6 +8771,7 @@ type UpdateTransactionOperation<O extends XataRecord> = {
7452
8771
  };
7453
8772
  type DeleteTransactionOperation = {
7454
8773
  id: string;
8774
+ failIfMissing?: boolean;
7455
8775
  };
7456
8776
  type TransactionOperationSingleResult<Schema extends Record<string, BaseData>, Table extends StringKeys<Schema>, Operation extends TransactionOperation<Schema, Table>> = Operation extends {
7457
8777
  insert: {
@@ -7498,23 +8818,20 @@ type TransactionPluginResult<Schemas extends Record<string, XataRecord>> = {
7498
8818
  run: <Tables extends StringKeys<Schemas>, Operations extends TransactionOperation<Schemas, Tables>[]>(operations: Narrow<Operations>) => Promise<TransactionResults<Schemas, Tables, Operations>>;
7499
8819
  };
7500
8820
  declare class TransactionPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
7501
- build({ getFetchProps }: XataPluginOptions): TransactionPluginResult<Schemas>;
8821
+ build(pluginOptions: XataPluginOptions): TransactionPluginResult<Schemas>;
7502
8822
  }
7503
8823
 
7504
- type BranchStrategyValue = string | undefined | null;
7505
- type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
7506
- type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
7507
- type BranchStrategyOption = NonNullable<BranchStrategy | BranchStrategy[]>;
7508
-
7509
8824
  type BaseClientOptions = {
7510
8825
  fetch?: FetchImpl;
8826
+ host?: HostProvider;
7511
8827
  apiKey?: string;
7512
8828
  databaseURL?: string;
7513
- branch?: BranchStrategyOption;
8829
+ branch?: string;
7514
8830
  cache?: CacheImpl;
7515
8831
  trace?: TraceFunction;
7516
8832
  enableBrowser?: boolean;
7517
8833
  clientName?: string;
8834
+ xataAgentExtra?: Record<string, string>;
7518
8835
  };
7519
8836
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
7520
8837
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
@@ -7551,34 +8868,31 @@ type SerializerResult<T> = T extends XataRecord ? Identifiable & Omit<{
7551
8868
  [K in keyof T]: SerializerResult<T[K]>;
7552
8869
  }, keyof XataRecord> : T extends any[] ? SerializerResult<T[number]>[] : T;
7553
8870
 
7554
- type BranchResolutionOptions = {
7555
- databaseURL?: string;
7556
- apiKey?: string;
7557
- fetchImpl?: FetchImpl;
7558
- clientName?: string;
7559
- };
7560
- declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
7561
- declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
7562
8871
  declare function getDatabaseURL(): string | undefined;
7563
-
7564
8872
  declare function getAPIKey(): string | undefined;
8873
+ declare function getBranch(): string | undefined;
8874
+ declare function buildPreviewBranchName({ org, branch }: {
8875
+ org: string;
8876
+ branch: string;
8877
+ }): string;
8878
+ declare function getPreviewBranch(): string | undefined;
7565
8879
 
7566
8880
  interface Body {
7567
8881
  arrayBuffer(): Promise<ArrayBuffer>;
7568
- blob(): Promise<Blob>;
8882
+ blob(): Promise<Blob$1>;
7569
8883
  formData(): Promise<FormData>;
7570
8884
  json(): Promise<any>;
7571
8885
  text(): Promise<string>;
7572
8886
  }
7573
- interface Blob {
8887
+ interface Blob$1 {
7574
8888
  readonly size: number;
7575
8889
  readonly type: string;
7576
8890
  arrayBuffer(): Promise<ArrayBuffer>;
7577
- slice(start?: number, end?: number, contentType?: string): Blob;
8891
+ slice(start?: number, end?: number, contentType?: string): Blob$1;
7578
8892
  text(): Promise<string>;
7579
8893
  }
7580
8894
  /** Provides information about files and allows JavaScript in a web page to access their content. */
7581
- interface File extends Blob {
8895
+ interface File extends Blob$1 {
7582
8896
  readonly lastModified: number;
7583
8897
  readonly name: string;
7584
8898
  readonly webkitRelativePath: string;
@@ -7586,12 +8900,12 @@ interface File extends Blob {
7586
8900
  type FormDataEntryValue = File | string;
7587
8901
  /** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
7588
8902
  interface FormData {
7589
- append(name: string, value: string | Blob, fileName?: string): void;
8903
+ append(name: string, value: string | Blob$1, fileName?: string): void;
7590
8904
  delete(name: string): void;
7591
8905
  get(name: string): FormDataEntryValue | null;
7592
8906
  getAll(name: string): FormDataEntryValue[];
7593
8907
  has(name: string): boolean;
7594
- set(name: string, value: string | Blob, fileName?: string): void;
8908
+ set(name: string, value: string | Blob$1, fileName?: string): void;
7595
8909
  forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
7596
8910
  }
7597
8911
  /** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
@@ -7648,4 +8962,4 @@ declare class XataError extends Error {
7648
8962
  constructor(message: string, status: number);
7649
8963
  }
7650
8964
 
7651
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, AggregateTableError, AggregateTablePathParams, AggregateTableRequestBody, AggregateTableVariables, ApiExtraProps, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BranchTransactionError, BranchTransactionPathParams, BranchTransactionRequestBody, BranchTransactionVariables, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, ColumnsByValue, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchResponse, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseResponse, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableResponse, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, DeserializedType, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherError, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, HostProvider, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListRegionsError, ListRegionsPathParams, ListRegionsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, Query, QueryMigrationRequestsError, QueryMigrationRequestsPathParams, QueryMigrationRequestsRequestBody, QueryMigrationRequestsResponse, QueryMigrationRequestsVariables, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, SerializedString, Serializer, SerializerResult, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, SummarizeTableError, SummarizeTablePathParams, SummarizeTableRequestBody, SummarizeTableVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateDatabaseMetadataError, UpdateDatabaseMetadataPathParams, UpdateDatabaseMetadataRequestBody, UpdateDatabaseMetadataVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, branchTransaction, buildClient, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
8965
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, AggregateTableError, AggregateTablePathParams, AggregateTableRequestBody, AggregateTableVariables, ApiExtraProps, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditVariables, AskOptions, AskResult, AskTableError, AskTablePathParams, AskTableRequestBody, AskTableResponse, AskTableVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BranchTransactionError, BranchTransactionPathParams, BranchTransactionRequestBody, BranchTransactionVariables, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, ColumnsByValue, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasRequestBody, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CopyBranchError, CopyBranchPathParams, CopyBranchRequestBody, CopyBranchVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchResponse, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabaseGithubSettingsError, DeleteDatabaseGithubSettingsPathParams, DeleteDatabaseGithubSettingsVariables, DeleteDatabasePathParams, DeleteDatabaseResponse, DeleteDatabaseVariables, DeleteFileError, DeleteFileItemError, DeleteFileItemPathParams, DeleteFileItemVariables, DeleteFilePathParams, DeleteFileVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableResponse, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, DeserializedType, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherError, FetcherExtraProps, FileAccessError, FileAccessPathParams, FileAccessQueryParams, FileAccessVariables, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseGithubSettingsError, GetDatabaseGithubSettingsPathParams, GetDatabaseGithubSettingsVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetFileError, GetFileItemError, GetFileItemPathParams, GetFileItemVariables, GetFilePathParams, GetFileVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, HostProvider, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, JSONData, KeywordAskOptions, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListRegionsError, ListRegionsPathParams, ListRegionsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, PushBranchMigrationsError, PushBranchMigrationsPathParams, PushBranchMigrationsRequestBody, PushBranchMigrationsVariables, PutFileError, PutFileItemError, PutFileItemPathParams, PutFileItemVariables, PutFilePathParams, PutFileVariables, Query, QueryMigrationRequestsError, QueryMigrationRequestsPathParams, QueryMigrationRequestsRequestBody, QueryMigrationRequestsResponse, QueryMigrationRequestsVariables, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, RenameDatabaseError, RenameDatabasePathParams, RenameDatabaseRequestBody, RenameDatabaseVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, SerializedString, Serializer, SerializerResult, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, SqlQueryError, SqlQueryPathParams, SqlQueryRequestBody, SqlQueryVariables, SummarizeTableError, SummarizeTablePathParams, SummarizeTableRequestBody, SummarizeTableVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateDatabaseGithubSettingsError, UpdateDatabaseGithubSettingsPathParams, UpdateDatabaseGithubSettingsVariables, UpdateDatabaseMetadataError, UpdateDatabaseMetadataPathParams, UpdateDatabaseMetadataRequestBody, UpdateDatabaseMetadataVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, VectorAskOptions, VectorSearchTableError, VectorSearchTablePathParams, VectorSearchTableRequestBody, VectorSearchTableVariables, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };