@xata.io/client 0.0.0-alpha.vf7b5320 → 0.0.0-alpha.vf87d751

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
@@ -1,3 +1,8 @@
1
+ declare type AttributeDictionary = Record<string, string | number | boolean | undefined>;
2
+ declare type TraceFunction = <T>(name: string, fn: (options: {
3
+ setAttributes: (attrs: AttributeDictionary) => void;
4
+ }) => T, options?: AttributeDictionary) => Promise<T>;
5
+
1
6
  declare type FetchImpl = (url: string, init?: {
2
7
  body?: string;
3
8
  headers?: Record<string, string>;
@@ -5,14 +10,19 @@ declare type FetchImpl = (url: string, init?: {
5
10
  }) => Promise<{
6
11
  ok: boolean;
7
12
  status: number;
13
+ url: string;
8
14
  json(): Promise<any>;
15
+ headers?: {
16
+ get(name: string): string | null;
17
+ };
9
18
  }>;
10
- declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
19
+ declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
11
20
  declare type FetcherExtraProps = {
12
21
  apiUrl: string;
13
22
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
14
23
  fetchImpl: FetchImpl;
15
24
  apiKey: string;
25
+ trace: TraceFunction;
16
26
  };
17
27
  declare type ErrorWrapper<TError> = TError | {
18
28
  status: 'unknown';
@@ -20,7 +30,6 @@ declare type ErrorWrapper<TError> = TError | {
20
30
  };
21
31
 
22
32
  interface CacheImpl {
23
- cacheRecords: boolean;
24
33
  defaultQueryTTL: number;
25
34
  getAll(): Promise<Record<string, unknown>>;
26
35
  get: <T>(key: string) => Promise<T | null>;
@@ -30,13 +39,11 @@ interface CacheImpl {
30
39
  }
31
40
  interface SimpleCacheOptions {
32
41
  max?: number;
33
- cacheRecords?: boolean;
34
42
  defaultQueryTTL?: number;
35
43
  }
36
44
  declare class SimpleCache implements CacheImpl {
37
45
  #private;
38
46
  capacity: number;
39
- cacheRecords: boolean;
40
47
  defaultQueryTTL: number;
41
48
  constructor(options?: SimpleCacheOptions);
42
49
  getAll(): Promise<Record<string, unknown>>;
@@ -52,6 +59,7 @@ declare abstract class XataPlugin {
52
59
  declare type XataPluginOptions = {
53
60
  getFetchProps: () => Promise<FetcherExtraProps>;
54
61
  cache: CacheImpl;
62
+ trace?: TraceFunction;
55
63
  };
56
64
 
57
65
  /**
@@ -91,7 +99,7 @@ declare type WorkspaceID = string;
91
99
  declare type Role = 'owner' | 'maintainer';
92
100
  declare type WorkspaceMeta = {
93
101
  name: string;
94
- slug: string;
102
+ slug?: string;
95
103
  };
96
104
  declare type Workspace = WorkspaceMeta & {
97
105
  id: WorkspaceID;
@@ -122,16 +130,20 @@ declare type WorkspaceMembers = {
122
130
  * @pattern ^ik_[a-zA-Z0-9]+
123
131
  */
124
132
  declare type InviteKey = string;
133
+ /**
134
+ * Metadata of databases
135
+ */
136
+ declare type DatabaseMetadata = {
137
+ name: string;
138
+ displayName: string;
139
+ createdAt: DateTime;
140
+ numberOfBranches: number;
141
+ ui?: {
142
+ color?: string;
143
+ };
144
+ };
125
145
  declare type ListDatabasesResponse = {
126
- databases?: {
127
- name: string;
128
- displayName: string;
129
- createdAt: DateTime;
130
- numberOfBranches: number;
131
- ui?: {
132
- color?: string;
133
- };
134
- }[];
146
+ databases?: DatabaseMetadata[];
135
147
  };
136
148
  declare type ListBranchesResponse = {
137
149
  databaseName: string;
@@ -181,12 +193,28 @@ declare type Schema = {
181
193
  tables: Table[];
182
194
  tablesOrder?: string[];
183
195
  };
196
+ /**
197
+ * @x-internal true
198
+ */
199
+ declare type SchemaEditScript = {
200
+ sourceMigrationID?: string;
201
+ targetMigrationID?: string;
202
+ tables: TableEdit[];
203
+ };
184
204
  declare type Table = {
185
205
  id?: string;
186
206
  name: TableName;
187
207
  columns: Column[];
188
208
  revLinks?: RevLink[];
189
209
  };
210
+ /**
211
+ * @x-internal true
212
+ */
213
+ declare type TableEdit = {
214
+ oldName?: string;
215
+ newName?: string;
216
+ columns?: MigrationColumnOp[];
217
+ };
190
218
  /**
191
219
  * @x-go-type xata.Column
192
220
  */
@@ -196,6 +224,8 @@ declare type Column = {
196
224
  link?: {
197
225
  table: string;
198
226
  };
227
+ notNull?: boolean;
228
+ unique?: boolean;
199
229
  columns?: Column[];
200
230
  };
201
231
  declare type RevLink = {
@@ -262,12 +292,131 @@ declare type ColumnMigration = {
262
292
  old: Column;
263
293
  ['new']: Column;
264
294
  };
295
+ /**
296
+ * @x-internal true
297
+ */
298
+ declare type Commit = {
299
+ meta?: {
300
+ title?: string;
301
+ message?: string;
302
+ id: string;
303
+ parentID?: string;
304
+ mergeParentID?: string;
305
+ status: string;
306
+ createdAt: DateTime;
307
+ modifiedAt?: DateTime;
308
+ };
309
+ operations: MigrationOp[];
310
+ };
311
+ /**
312
+ * Branch schema migration.
313
+ *
314
+ * @x-internal true
315
+ */
316
+ declare type Migration = {
317
+ parentID?: string;
318
+ operations: MigrationOp[];
319
+ };
320
+ /**
321
+ * Branch schema migration operations.
322
+ *
323
+ * @x-internal true
324
+ */
325
+ declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
326
+ /**
327
+ * @x-internal true
328
+ */
329
+ declare type MigrationTableOp = {
330
+ addTable: TableOpAdd;
331
+ } | {
332
+ removeTable: TableOpRemove;
333
+ } | {
334
+ renameTable: TableOpRename;
335
+ };
336
+ /**
337
+ * @x-internal true
338
+ */
339
+ declare type MigrationColumnOp = {
340
+ addColumn: ColumnOpAdd;
341
+ } | {
342
+ removeColumn: ColumnOpRemove;
343
+ } | {
344
+ renameColumn: ColumnOpRename;
345
+ };
346
+ /**
347
+ * @x-internal true
348
+ */
349
+ declare type TableOpAdd = {
350
+ table: string;
351
+ };
352
+ /**
353
+ * @x-internal true
354
+ */
355
+ declare type TableOpRemove = {
356
+ table: string;
357
+ };
358
+ /**
359
+ * @x-internal true
360
+ */
361
+ declare type TableOpRename = {
362
+ oldName: string;
363
+ newName: string;
364
+ };
365
+ /**
366
+ * @x-internal true
367
+ */
368
+ declare type ColumnOpAdd = {
369
+ table?: string;
370
+ column: Column;
371
+ };
372
+ /**
373
+ * @x-internal true
374
+ */
375
+ declare type ColumnOpRemove = {
376
+ table?: string;
377
+ column: string;
378
+ };
379
+ /**
380
+ * @x-internal true
381
+ */
382
+ declare type ColumnOpRename = {
383
+ table?: string;
384
+ oldName: string;
385
+ newName: string;
386
+ };
387
+ declare type MigrationRequest = {
388
+ number: number;
389
+ createdAt: DateTime;
390
+ modifiedAt?: DateTime;
391
+ closedAt?: DateTime;
392
+ mergedAt?: DateTime;
393
+ status: 'open' | 'closed' | 'merging' | 'merged';
394
+ title: string;
395
+ body: string;
396
+ source: string;
397
+ target: string;
398
+ };
265
399
  declare type SortExpression = string[] | {
266
400
  [key: string]: SortOrder;
267
401
  } | {
268
402
  [key: string]: SortOrder;
269
403
  }[];
270
404
  declare type SortOrder = 'asc' | 'desc';
405
+ /**
406
+ * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
407
+ * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
408
+ * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
409
+ * to allow two typos in a word.
410
+ *
411
+ * @default 1
412
+ * @maximum 2
413
+ * @minimum 0
414
+ */
415
+ declare type FuzzinessExpression = number;
416
+ /**
417
+ * 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.
418
+ */
419
+ declare type PrefixExpression = 'phrase' | 'disabled';
271
420
  /**
272
421
  * @minProperties 1
273
422
  */
@@ -281,6 +430,48 @@ declare type FilterExpression = {
281
430
  } & {
282
431
  [key: string]: FilterColumn;
283
432
  };
433
+ declare type HighlightExpression = {
434
+ enabled?: boolean;
435
+ encodeHTML?: boolean;
436
+ };
437
+ /**
438
+ * Booster Expression
439
+ *
440
+ * @x-go-type xata.BoosterExpression
441
+ */
442
+ declare type BoosterExpression = {
443
+ valueBooster?: ValueBooster$1;
444
+ } | {
445
+ numericBooster?: NumericBooster$1;
446
+ } | {
447
+ dateBooster?: DateBooster$1;
448
+ };
449
+ /**
450
+ * Boost records with a particular value for a column.
451
+ */
452
+ declare type ValueBooster$1 = {
453
+ column: string;
454
+ value: string | number | boolean;
455
+ factor: number;
456
+ };
457
+ /**
458
+ * Boost records based on the value of a numeric column.
459
+ */
460
+ declare type NumericBooster$1 = {
461
+ column: string;
462
+ factor: number;
463
+ };
464
+ /**
465
+ * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
466
+ * 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
467
+ * 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.
468
+ */
469
+ declare type DateBooster$1 = {
470
+ column: string;
471
+ origin?: string;
472
+ scale: string;
473
+ decay: number;
474
+ };
284
475
  declare type FilterList = FilterExpression | FilterExpression[];
285
476
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
286
477
  /**
@@ -337,7 +528,24 @@ declare type PageConfig = {
337
528
  size?: number;
338
529
  offset?: number;
339
530
  };
340
- declare type ColumnsFilter = string[];
531
+ declare type ColumnsProjection = string[];
532
+ /**
533
+ * Xata Table Record Metadata
534
+ */
535
+ declare type RecordMeta = {
536
+ id: RecordID;
537
+ xata: {
538
+ version: number;
539
+ table?: string;
540
+ highlight?: {
541
+ [key: string]: string[] | {
542
+ [key: string]: any;
543
+ };
544
+ };
545
+ score?: number;
546
+ warnings?: string[];
547
+ };
548
+ };
341
549
  /**
342
550
  * @pattern [a-zA-Z0-9_-~:]+
343
551
  */
@@ -359,16 +567,9 @@ declare type RecordsMetadata = {
359
567
  };
360
568
  };
361
569
  /**
362
- * Xata Table Record
570
+ * Xata Table Record Metadata
363
571
  */
364
- declare type XataRecord$1 = {
365
- id: RecordID;
366
- xata: {
367
- version: number;
368
- table?: string;
369
- warnings?: string[];
370
- };
371
- } & {
572
+ declare type XataRecord$1 = RecordMeta & {
372
573
  [key: string]: any;
373
574
  };
374
575
 
@@ -386,6 +587,7 @@ type schemas_InviteID = InviteID;
386
587
  type schemas_WorkspaceInvite = WorkspaceInvite;
387
588
  type schemas_WorkspaceMembers = WorkspaceMembers;
388
589
  type schemas_InviteKey = InviteKey;
590
+ type schemas_DatabaseMetadata = DatabaseMetadata;
389
591
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
390
592
  type schemas_ListBranchesResponse = ListBranchesResponse;
391
593
  type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
@@ -394,7 +596,9 @@ type schemas_BranchMetadata = BranchMetadata;
394
596
  type schemas_DBBranch = DBBranch;
395
597
  type schemas_StartedFromMetadata = StartedFromMetadata;
396
598
  type schemas_Schema = Schema;
599
+ type schemas_SchemaEditScript = SchemaEditScript;
397
600
  type schemas_Table = Table;
601
+ type schemas_TableEdit = TableEdit;
398
602
  type schemas_Column = Column;
399
603
  type schemas_RevLink = RevLink;
400
604
  type schemas_BranchName = BranchName;
@@ -407,9 +611,25 @@ type schemas_MetricsLatency = MetricsLatency;
407
611
  type schemas_BranchMigration = BranchMigration;
408
612
  type schemas_TableMigration = TableMigration;
409
613
  type schemas_ColumnMigration = ColumnMigration;
614
+ type schemas_Commit = Commit;
615
+ type schemas_Migration = Migration;
616
+ type schemas_MigrationOp = MigrationOp;
617
+ type schemas_MigrationTableOp = MigrationTableOp;
618
+ type schemas_MigrationColumnOp = MigrationColumnOp;
619
+ type schemas_TableOpAdd = TableOpAdd;
620
+ type schemas_TableOpRemove = TableOpRemove;
621
+ type schemas_TableOpRename = TableOpRename;
622
+ type schemas_ColumnOpAdd = ColumnOpAdd;
623
+ type schemas_ColumnOpRemove = ColumnOpRemove;
624
+ type schemas_ColumnOpRename = ColumnOpRename;
625
+ type schemas_MigrationRequest = MigrationRequest;
410
626
  type schemas_SortExpression = SortExpression;
411
627
  type schemas_SortOrder = SortOrder;
628
+ type schemas_FuzzinessExpression = FuzzinessExpression;
629
+ type schemas_PrefixExpression = PrefixExpression;
412
630
  type schemas_FilterExpression = FilterExpression;
631
+ type schemas_HighlightExpression = HighlightExpression;
632
+ type schemas_BoosterExpression = BoosterExpression;
413
633
  type schemas_FilterList = FilterList;
414
634
  type schemas_FilterColumn = FilterColumn;
415
635
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -419,7 +639,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
419
639
  type schemas_FilterRangeValue = FilterRangeValue;
420
640
  type schemas_FilterValue = FilterValue;
421
641
  type schemas_PageConfig = PageConfig;
422
- type schemas_ColumnsFilter = ColumnsFilter;
642
+ type schemas_ColumnsProjection = ColumnsProjection;
643
+ type schemas_RecordMeta = RecordMeta;
423
644
  type schemas_RecordID = RecordID;
424
645
  type schemas_TableRename = TableRename;
425
646
  type schemas_RecordsMetadata = RecordsMetadata;
@@ -439,6 +660,7 @@ declare namespace schemas {
439
660
  schemas_WorkspaceInvite as WorkspaceInvite,
440
661
  schemas_WorkspaceMembers as WorkspaceMembers,
441
662
  schemas_InviteKey as InviteKey,
663
+ schemas_DatabaseMetadata as DatabaseMetadata,
442
664
  schemas_ListDatabasesResponse as ListDatabasesResponse,
443
665
  schemas_ListBranchesResponse as ListBranchesResponse,
444
666
  schemas_ListGitBranchesResponse as ListGitBranchesResponse,
@@ -447,7 +669,9 @@ declare namespace schemas {
447
669
  schemas_DBBranch as DBBranch,
448
670
  schemas_StartedFromMetadata as StartedFromMetadata,
449
671
  schemas_Schema as Schema,
672
+ schemas_SchemaEditScript as SchemaEditScript,
450
673
  schemas_Table as Table,
674
+ schemas_TableEdit as TableEdit,
451
675
  schemas_Column as Column,
452
676
  schemas_RevLink as RevLink,
453
677
  schemas_BranchName as BranchName,
@@ -460,9 +684,28 @@ declare namespace schemas {
460
684
  schemas_BranchMigration as BranchMigration,
461
685
  schemas_TableMigration as TableMigration,
462
686
  schemas_ColumnMigration as ColumnMigration,
687
+ schemas_Commit as Commit,
688
+ schemas_Migration as Migration,
689
+ schemas_MigrationOp as MigrationOp,
690
+ schemas_MigrationTableOp as MigrationTableOp,
691
+ schemas_MigrationColumnOp as MigrationColumnOp,
692
+ schemas_TableOpAdd as TableOpAdd,
693
+ schemas_TableOpRemove as TableOpRemove,
694
+ schemas_TableOpRename as TableOpRename,
695
+ schemas_ColumnOpAdd as ColumnOpAdd,
696
+ schemas_ColumnOpRemove as ColumnOpRemove,
697
+ schemas_ColumnOpRename as ColumnOpRename,
698
+ schemas_MigrationRequest as MigrationRequest,
463
699
  schemas_SortExpression as SortExpression,
464
700
  schemas_SortOrder as SortOrder,
701
+ schemas_FuzzinessExpression as FuzzinessExpression,
702
+ schemas_PrefixExpression as PrefixExpression,
465
703
  schemas_FilterExpression as FilterExpression,
704
+ schemas_HighlightExpression as HighlightExpression,
705
+ schemas_BoosterExpression as BoosterExpression,
706
+ ValueBooster$1 as ValueBooster,
707
+ NumericBooster$1 as NumericBooster,
708
+ DateBooster$1 as DateBooster,
466
709
  schemas_FilterList as FilterList,
467
710
  schemas_FilterColumn as FilterColumn,
468
711
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -472,7 +715,8 @@ declare namespace schemas {
472
715
  schemas_FilterRangeValue as FilterRangeValue,
473
716
  schemas_FilterValue as FilterValue,
474
717
  schemas_PageConfig as PageConfig,
475
- schemas_ColumnsFilter as ColumnsFilter,
718
+ schemas_ColumnsProjection as ColumnsProjection,
719
+ schemas_RecordMeta as RecordMeta,
476
720
  schemas_RecordID as RecordID,
477
721
  schemas_TableRename as TableRename,
478
722
  schemas_RecordsMetadata as RecordsMetadata,
@@ -507,11 +751,22 @@ declare type BulkError = {
507
751
  status?: number;
508
752
  }[];
509
753
  };
754
+ declare type BulkInsertResponse = {
755
+ recordIDs: string[];
756
+ } | {
757
+ records: XataRecord$1[];
758
+ };
510
759
  declare type BranchMigrationPlan = {
511
760
  version: number;
512
761
  migration: BranchMigration;
513
762
  };
514
- declare type RecordUpdateResponse = {
763
+ declare type RecordResponse = XataRecord$1;
764
+ declare type SchemaCompareResponse = {
765
+ source: Schema;
766
+ target: Schema;
767
+ edits: SchemaEditScript;
768
+ };
769
+ declare type RecordUpdateResponse = XataRecord$1 | {
515
770
  id: string;
516
771
  xata: {
517
772
  version: number;
@@ -535,7 +790,10 @@ type responses_SimpleError = SimpleError;
535
790
  type responses_BadRequestError = BadRequestError;
536
791
  type responses_AuthError = AuthError;
537
792
  type responses_BulkError = BulkError;
793
+ type responses_BulkInsertResponse = BulkInsertResponse;
538
794
  type responses_BranchMigrationPlan = BranchMigrationPlan;
795
+ type responses_RecordResponse = RecordResponse;
796
+ type responses_SchemaCompareResponse = SchemaCompareResponse;
539
797
  type responses_RecordUpdateResponse = RecordUpdateResponse;
540
798
  type responses_QueryResponse = QueryResponse;
541
799
  type responses_SearchResponse = SearchResponse;
@@ -546,7 +804,10 @@ declare namespace responses {
546
804
  responses_BadRequestError as BadRequestError,
547
805
  responses_AuthError as AuthError,
548
806
  responses_BulkError as BulkError,
807
+ responses_BulkInsertResponse as BulkInsertResponse,
549
808
  responses_BranchMigrationPlan as BranchMigrationPlan,
809
+ responses_RecordResponse as RecordResponse,
810
+ responses_SchemaCompareResponse as SchemaCompareResponse,
550
811
  responses_RecordUpdateResponse as RecordUpdateResponse,
551
812
  responses_QueryResponse as QueryResponse,
552
813
  responses_SearchResponse as SearchResponse,
@@ -852,6 +1113,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
852
1113
  } | {
853
1114
  status: 404;
854
1115
  payload: SimpleError;
1116
+ } | {
1117
+ status: 409;
1118
+ payload: SimpleError;
855
1119
  }>;
856
1120
  declare type InviteWorkspaceMemberRequestBody = {
857
1121
  email: string;
@@ -865,6 +1129,34 @@ declare type InviteWorkspaceMemberVariables = {
865
1129
  * Invite some user to join the workspace with the given role
866
1130
  */
867
1131
  declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
1132
+ declare type UpdateWorkspaceMemberInvitePathParams = {
1133
+ workspaceId: WorkspaceID;
1134
+ inviteId: InviteID;
1135
+ };
1136
+ declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
1137
+ status: 400;
1138
+ payload: BadRequestError;
1139
+ } | {
1140
+ status: 401;
1141
+ payload: AuthError;
1142
+ } | {
1143
+ status: 404;
1144
+ payload: SimpleError;
1145
+ } | {
1146
+ status: 422;
1147
+ payload: SimpleError;
1148
+ }>;
1149
+ declare type UpdateWorkspaceMemberInviteRequestBody = {
1150
+ role: Role;
1151
+ };
1152
+ declare type UpdateWorkspaceMemberInviteVariables = {
1153
+ body: UpdateWorkspaceMemberInviteRequestBody;
1154
+ pathParams: UpdateWorkspaceMemberInvitePathParams;
1155
+ } & FetcherExtraProps;
1156
+ /**
1157
+ * This operation provides a way to update an existing invite. Updates are performed in-place; they do not change the invite link, the expiry time, nor do they re-notify the recipient of the invite.
1158
+ */
1159
+ declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
868
1160
  declare type CancelWorkspaceMemberInvitePathParams = {
869
1161
  workspaceId: WorkspaceID;
870
1162
  inviteId: InviteID;
@@ -1018,6 +1310,54 @@ declare type DeleteDatabaseVariables = {
1018
1310
  * Delete a database and all of its branches and tables permanently.
1019
1311
  */
1020
1312
  declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1313
+ declare type GetDatabaseMetadataPathParams = {
1314
+ dbName: DBName;
1315
+ workspace: string;
1316
+ };
1317
+ declare type GetDatabaseMetadataError = ErrorWrapper<{
1318
+ status: 400;
1319
+ payload: BadRequestError;
1320
+ } | {
1321
+ status: 401;
1322
+ payload: AuthError;
1323
+ } | {
1324
+ status: 404;
1325
+ payload: SimpleError;
1326
+ }>;
1327
+ declare type GetDatabaseMetadataVariables = {
1328
+ pathParams: GetDatabaseMetadataPathParams;
1329
+ } & FetcherExtraProps;
1330
+ /**
1331
+ * Retrieve metadata of the given database
1332
+ */
1333
+ declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
1334
+ declare type PatchDatabaseMetadataPathParams = {
1335
+ dbName: DBName;
1336
+ workspace: string;
1337
+ };
1338
+ declare type PatchDatabaseMetadataError = ErrorWrapper<{
1339
+ status: 400;
1340
+ payload: BadRequestError;
1341
+ } | {
1342
+ status: 401;
1343
+ payload: AuthError;
1344
+ } | {
1345
+ status: 404;
1346
+ payload: SimpleError;
1347
+ }>;
1348
+ declare type PatchDatabaseMetadataRequestBody = {
1349
+ ui?: {
1350
+ color?: string;
1351
+ };
1352
+ };
1353
+ declare type PatchDatabaseMetadataVariables = {
1354
+ body?: PatchDatabaseMetadataRequestBody;
1355
+ pathParams: PatchDatabaseMetadataPathParams;
1356
+ } & FetcherExtraProps;
1357
+ /**
1358
+ * Update the color of the selected database
1359
+ */
1360
+ declare const patchDatabaseMetadata: (variables: PatchDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
1021
1361
  declare type GetGitBranchesMappingPathParams = {
1022
1362
  dbName: DBName;
1023
1363
  workspace: string;
@@ -1151,14 +1491,15 @@ declare type ResolveBranchVariables = {
1151
1491
  } & FetcherExtraProps;
1152
1492
  /**
1153
1493
  * In order to resolve the database branch, the following algorithm is used:
1154
- * * if the `gitBranch` is found in the [git branches mapping](), the associated Xata branch is returned
1494
+ * * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
1155
1495
  * * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
1156
- * * else, return the default branch of the DB (currently `main` or the first branch)
1496
+ * * else, if `fallbackBranch` is provided and a branch with that name exists, return it
1497
+ * * else, return the default branch of the DB (`main` or the first branch)
1157
1498
  *
1158
1499
  * Example call:
1159
1500
  *
1160
1501
  * ```json
1161
- * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test?fallbackBranch=tsg
1502
+ * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
1162
1503
  * ```
1163
1504
  *
1164
1505
  * Example response:
@@ -1174,11 +1515,11 @@ declare type ResolveBranchVariables = {
1174
1515
  * ```
1175
1516
  */
1176
1517
  declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
1177
- declare type GetBranchDetailsPathParams = {
1178
- dbBranchName: DBBranchName;
1518
+ declare type ListMigrationRequestsPathParams = {
1519
+ dbName: DBName;
1179
1520
  workspace: string;
1180
1521
  };
1181
- declare type GetBranchDetailsError = ErrorWrapper<{
1522
+ declare type ListMigrationRequestsError = ErrorWrapper<{
1182
1523
  status: 400;
1183
1524
  payload: BadRequestError;
1184
1525
  } | {
@@ -1188,18 +1529,26 @@ declare type GetBranchDetailsError = ErrorWrapper<{
1188
1529
  status: 404;
1189
1530
  payload: SimpleError;
1190
1531
  }>;
1191
- declare type GetBranchDetailsVariables = {
1192
- pathParams: GetBranchDetailsPathParams;
1532
+ declare type ListMigrationRequestsResponse = {
1533
+ migrationRequests: MigrationRequest[];
1534
+ meta: RecordsMetadata;
1535
+ };
1536
+ declare type ListMigrationRequestsRequestBody = {
1537
+ filter?: FilterExpression;
1538
+ sort?: SortExpression;
1539
+ page?: PageConfig;
1540
+ columns?: ColumnsProjection;
1541
+ };
1542
+ declare type ListMigrationRequestsVariables = {
1543
+ body?: ListMigrationRequestsRequestBody;
1544
+ pathParams: ListMigrationRequestsPathParams;
1193
1545
  } & FetcherExtraProps;
1194
- declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
1195
- declare type CreateBranchPathParams = {
1196
- dbBranchName: DBBranchName;
1546
+ declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
1547
+ declare type CreateMigrationRequestPathParams = {
1548
+ dbName: DBName;
1197
1549
  workspace: string;
1198
1550
  };
1199
- declare type CreateBranchQueryParams = {
1200
- from?: string;
1201
- };
1202
- declare type CreateBranchError = ErrorWrapper<{
1551
+ declare type CreateMigrationRequestError = ErrorWrapper<{
1203
1552
  status: 400;
1204
1553
  payload: BadRequestError;
1205
1554
  } | {
@@ -1209,21 +1558,26 @@ declare type CreateBranchError = ErrorWrapper<{
1209
1558
  status: 404;
1210
1559
  payload: SimpleError;
1211
1560
  }>;
1212
- declare type CreateBranchRequestBody = {
1213
- from?: string;
1214
- metadata?: BranchMetadata;
1561
+ declare type CreateMigrationRequestResponse = {
1562
+ number: number;
1215
1563
  };
1216
- declare type CreateBranchVariables = {
1217
- body?: CreateBranchRequestBody;
1218
- pathParams: CreateBranchPathParams;
1219
- queryParams?: CreateBranchQueryParams;
1564
+ declare type CreateMigrationRequestRequestBody = {
1565
+ source: string;
1566
+ target: string;
1567
+ title: string;
1568
+ body?: string;
1569
+ };
1570
+ declare type CreateMigrationRequestVariables = {
1571
+ body: CreateMigrationRequestRequestBody;
1572
+ pathParams: CreateMigrationRequestPathParams;
1220
1573
  } & FetcherExtraProps;
1221
- declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
1222
- declare type DeleteBranchPathParams = {
1223
- dbBranchName: DBBranchName;
1574
+ declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
1575
+ declare type GetMigrationRequestPathParams = {
1576
+ dbName: DBName;
1577
+ mrNumber: number;
1224
1578
  workspace: string;
1225
1579
  };
1226
- declare type DeleteBranchError = ErrorWrapper<{
1580
+ declare type GetMigrationRequestError = ErrorWrapper<{
1227
1581
  status: 400;
1228
1582
  payload: BadRequestError;
1229
1583
  } | {
@@ -1233,18 +1587,16 @@ declare type DeleteBranchError = ErrorWrapper<{
1233
1587
  status: 404;
1234
1588
  payload: SimpleError;
1235
1589
  }>;
1236
- declare type DeleteBranchVariables = {
1237
- pathParams: DeleteBranchPathParams;
1590
+ declare type GetMigrationRequestVariables = {
1591
+ pathParams: GetMigrationRequestPathParams;
1238
1592
  } & FetcherExtraProps;
1239
- /**
1240
- * Delete the branch in the database and all its resources
1241
- */
1242
- declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1243
- declare type UpdateBranchMetadataPathParams = {
1244
- dbBranchName: DBBranchName;
1593
+ declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
1594
+ declare type UpdateMigrationRequestPathParams = {
1595
+ dbName: DBName;
1596
+ mrNumber: number;
1245
1597
  workspace: string;
1246
1598
  };
1247
- declare type UpdateBranchMetadataError = ErrorWrapper<{
1599
+ declare type UpdateMigrationRequestError = ErrorWrapper<{
1248
1600
  status: 400;
1249
1601
  payload: BadRequestError;
1250
1602
  } | {
@@ -1254,19 +1606,22 @@ declare type UpdateBranchMetadataError = ErrorWrapper<{
1254
1606
  status: 404;
1255
1607
  payload: SimpleError;
1256
1608
  }>;
1257
- declare type UpdateBranchMetadataVariables = {
1258
- body?: BranchMetadata;
1259
- pathParams: UpdateBranchMetadataPathParams;
1609
+ declare type UpdateMigrationRequestRequestBody = {
1610
+ title?: string;
1611
+ body?: string;
1612
+ status?: 'open' | 'closed';
1613
+ };
1614
+ declare type UpdateMigrationRequestVariables = {
1615
+ body?: UpdateMigrationRequestRequestBody;
1616
+ pathParams: UpdateMigrationRequestPathParams;
1260
1617
  } & FetcherExtraProps;
1261
- /**
1262
- * Update the branch metadata
1263
- */
1264
- declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1265
- declare type GetBranchMetadataPathParams = {
1266
- dbBranchName: DBBranchName;
1618
+ declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
1619
+ declare type ListMigrationRequestsCommitsPathParams = {
1620
+ dbName: DBName;
1621
+ mrNumber: number;
1267
1622
  workspace: string;
1268
1623
  };
1269
- declare type GetBranchMetadataError = ErrorWrapper<{
1624
+ declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
1270
1625
  status: 400;
1271
1626
  payload: BadRequestError;
1272
1627
  } | {
@@ -1276,15 +1631,31 @@ declare type GetBranchMetadataError = ErrorWrapper<{
1276
1631
  status: 404;
1277
1632
  payload: SimpleError;
1278
1633
  }>;
1279
- declare type GetBranchMetadataVariables = {
1280
- pathParams: GetBranchMetadataPathParams;
1634
+ declare type ListMigrationRequestsCommitsResponse = {
1635
+ meta: {
1636
+ cursor: string;
1637
+ more: boolean;
1638
+ };
1639
+ logs: Commit[];
1640
+ };
1641
+ declare type ListMigrationRequestsCommitsRequestBody = {
1642
+ page?: {
1643
+ after?: string;
1644
+ before?: string;
1645
+ size?: number;
1646
+ };
1647
+ };
1648
+ declare type ListMigrationRequestsCommitsVariables = {
1649
+ body?: ListMigrationRequestsCommitsRequestBody;
1650
+ pathParams: ListMigrationRequestsCommitsPathParams;
1281
1651
  } & FetcherExtraProps;
1282
- declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
1283
- declare type GetBranchMigrationHistoryPathParams = {
1284
- dbBranchName: DBBranchName;
1652
+ declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
1653
+ declare type CompareMigrationRequestPathParams = {
1654
+ dbName: DBName;
1655
+ mrNumber: number;
1285
1656
  workspace: string;
1286
1657
  };
1287
- declare type GetBranchMigrationHistoryError = ErrorWrapper<{
1658
+ declare type CompareMigrationRequestError = ErrorWrapper<{
1288
1659
  status: 400;
1289
1660
  payload: BadRequestError;
1290
1661
  } | {
@@ -1294,21 +1665,190 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
1294
1665
  status: 404;
1295
1666
  payload: SimpleError;
1296
1667
  }>;
1297
- declare type GetBranchMigrationHistoryResponse = {
1298
- startedFrom?: StartedFromMetadata;
1299
- migrations?: BranchMigration[];
1300
- };
1301
- declare type GetBranchMigrationHistoryRequestBody = {
1302
- limit?: number;
1303
- startFrom?: string;
1304
- };
1305
- declare type GetBranchMigrationHistoryVariables = {
1306
- body?: GetBranchMigrationHistoryRequestBody;
1307
- pathParams: GetBranchMigrationHistoryPathParams;
1668
+ declare type CompareMigrationRequestVariables = {
1669
+ pathParams: CompareMigrationRequestPathParams;
1308
1670
  } & FetcherExtraProps;
1309
- declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1310
- declare type ExecuteBranchMigrationPlanPathParams = {
1311
- dbBranchName: DBBranchName;
1671
+ declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
1672
+ declare type GetMigrationRequestIsMergedPathParams = {
1673
+ dbName: DBName;
1674
+ mrNumber: number;
1675
+ workspace: string;
1676
+ };
1677
+ declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
1678
+ status: 400;
1679
+ payload: BadRequestError;
1680
+ } | {
1681
+ status: 401;
1682
+ payload: AuthError;
1683
+ } | {
1684
+ status: 404;
1685
+ payload: SimpleError;
1686
+ }>;
1687
+ declare type GetMigrationRequestIsMergedResponse = {
1688
+ merged?: boolean;
1689
+ };
1690
+ declare type GetMigrationRequestIsMergedVariables = {
1691
+ pathParams: GetMigrationRequestIsMergedPathParams;
1692
+ } & FetcherExtraProps;
1693
+ declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
1694
+ declare type MergeMigrationRequestPathParams = {
1695
+ dbName: DBName;
1696
+ mrNumber: number;
1697
+ workspace: string;
1698
+ };
1699
+ declare type MergeMigrationRequestError = ErrorWrapper<{
1700
+ status: 400;
1701
+ payload: BadRequestError;
1702
+ } | {
1703
+ status: 401;
1704
+ payload: AuthError;
1705
+ } | {
1706
+ status: 404;
1707
+ payload: SimpleError;
1708
+ }>;
1709
+ declare type MergeMigrationRequestVariables = {
1710
+ pathParams: MergeMigrationRequestPathParams;
1711
+ } & FetcherExtraProps;
1712
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
1713
+ declare type GetBranchDetailsPathParams = {
1714
+ dbBranchName: DBBranchName;
1715
+ workspace: string;
1716
+ };
1717
+ declare type GetBranchDetailsError = ErrorWrapper<{
1718
+ status: 400;
1719
+ payload: BadRequestError;
1720
+ } | {
1721
+ status: 401;
1722
+ payload: AuthError;
1723
+ } | {
1724
+ status: 404;
1725
+ payload: SimpleError;
1726
+ }>;
1727
+ declare type GetBranchDetailsVariables = {
1728
+ pathParams: GetBranchDetailsPathParams;
1729
+ } & FetcherExtraProps;
1730
+ declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
1731
+ declare type CreateBranchPathParams = {
1732
+ dbBranchName: DBBranchName;
1733
+ workspace: string;
1734
+ };
1735
+ declare type CreateBranchQueryParams = {
1736
+ from?: string;
1737
+ };
1738
+ declare type CreateBranchError = ErrorWrapper<{
1739
+ status: 400;
1740
+ payload: BadRequestError;
1741
+ } | {
1742
+ status: 401;
1743
+ payload: AuthError;
1744
+ } | {
1745
+ status: 404;
1746
+ payload: SimpleError;
1747
+ }>;
1748
+ declare type CreateBranchResponse = {
1749
+ databaseName: string;
1750
+ branchName: string;
1751
+ };
1752
+ declare type CreateBranchRequestBody = {
1753
+ from?: string;
1754
+ metadata?: BranchMetadata;
1755
+ };
1756
+ declare type CreateBranchVariables = {
1757
+ body?: CreateBranchRequestBody;
1758
+ pathParams: CreateBranchPathParams;
1759
+ queryParams?: CreateBranchQueryParams;
1760
+ } & FetcherExtraProps;
1761
+ declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
1762
+ declare type DeleteBranchPathParams = {
1763
+ dbBranchName: DBBranchName;
1764
+ workspace: string;
1765
+ };
1766
+ declare type DeleteBranchError = ErrorWrapper<{
1767
+ status: 400;
1768
+ payload: BadRequestError;
1769
+ } | {
1770
+ status: 401;
1771
+ payload: AuthError;
1772
+ } | {
1773
+ status: 404;
1774
+ payload: SimpleError;
1775
+ }>;
1776
+ declare type DeleteBranchVariables = {
1777
+ pathParams: DeleteBranchPathParams;
1778
+ } & FetcherExtraProps;
1779
+ /**
1780
+ * Delete the branch in the database and all its resources
1781
+ */
1782
+ declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1783
+ declare type UpdateBranchMetadataPathParams = {
1784
+ dbBranchName: DBBranchName;
1785
+ workspace: string;
1786
+ };
1787
+ declare type UpdateBranchMetadataError = ErrorWrapper<{
1788
+ status: 400;
1789
+ payload: BadRequestError;
1790
+ } | {
1791
+ status: 401;
1792
+ payload: AuthError;
1793
+ } | {
1794
+ status: 404;
1795
+ payload: SimpleError;
1796
+ }>;
1797
+ declare type UpdateBranchMetadataVariables = {
1798
+ body?: BranchMetadata;
1799
+ pathParams: UpdateBranchMetadataPathParams;
1800
+ } & FetcherExtraProps;
1801
+ /**
1802
+ * Update the branch metadata
1803
+ */
1804
+ declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1805
+ declare type GetBranchMetadataPathParams = {
1806
+ dbBranchName: DBBranchName;
1807
+ workspace: string;
1808
+ };
1809
+ declare type GetBranchMetadataError = ErrorWrapper<{
1810
+ status: 400;
1811
+ payload: BadRequestError;
1812
+ } | {
1813
+ status: 401;
1814
+ payload: AuthError;
1815
+ } | {
1816
+ status: 404;
1817
+ payload: SimpleError;
1818
+ }>;
1819
+ declare type GetBranchMetadataVariables = {
1820
+ pathParams: GetBranchMetadataPathParams;
1821
+ } & FetcherExtraProps;
1822
+ declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
1823
+ declare type GetBranchMigrationHistoryPathParams = {
1824
+ dbBranchName: DBBranchName;
1825
+ workspace: string;
1826
+ };
1827
+ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
1828
+ status: 400;
1829
+ payload: BadRequestError;
1830
+ } | {
1831
+ status: 401;
1832
+ payload: AuthError;
1833
+ } | {
1834
+ status: 404;
1835
+ payload: SimpleError;
1836
+ }>;
1837
+ declare type GetBranchMigrationHistoryResponse = {
1838
+ startedFrom?: StartedFromMetadata;
1839
+ migrations?: BranchMigration[];
1840
+ };
1841
+ declare type GetBranchMigrationHistoryRequestBody = {
1842
+ limit?: number;
1843
+ startFrom?: string;
1844
+ };
1845
+ declare type GetBranchMigrationHistoryVariables = {
1846
+ body?: GetBranchMigrationHistoryRequestBody;
1847
+ pathParams: GetBranchMigrationHistoryPathParams;
1848
+ } & FetcherExtraProps;
1849
+ declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1850
+ declare type ExecuteBranchMigrationPlanPathParams = {
1851
+ dbBranchName: DBBranchName;
1312
1852
  workspace: string;
1313
1853
  };
1314
1854
  declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
@@ -1355,6 +1895,157 @@ declare type GetBranchMigrationPlanVariables = {
1355
1895
  * Compute a migration plan from a target schema the branch should be migrated too.
1356
1896
  */
1357
1897
  declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
1898
+ declare type CompareBranchWithUserSchemaPathParams = {
1899
+ dbBranchName: DBBranchName;
1900
+ workspace: string;
1901
+ };
1902
+ declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
1903
+ status: 400;
1904
+ payload: BadRequestError;
1905
+ } | {
1906
+ status: 401;
1907
+ payload: AuthError;
1908
+ } | {
1909
+ status: 404;
1910
+ payload: SimpleError;
1911
+ }>;
1912
+ declare type CompareBranchWithUserSchemaRequestBody = {
1913
+ schema: Schema;
1914
+ };
1915
+ declare type CompareBranchWithUserSchemaVariables = {
1916
+ body: CompareBranchWithUserSchemaRequestBody;
1917
+ pathParams: CompareBranchWithUserSchemaPathParams;
1918
+ } & FetcherExtraProps;
1919
+ declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
1920
+ declare type CompareBranchSchemasPathParams = {
1921
+ dbBranchName: DBBranchName;
1922
+ branchName: BranchName;
1923
+ workspace: string;
1924
+ };
1925
+ declare type CompareBranchSchemasError = ErrorWrapper<{
1926
+ status: 400;
1927
+ payload: BadRequestError;
1928
+ } | {
1929
+ status: 401;
1930
+ payload: AuthError;
1931
+ } | {
1932
+ status: 404;
1933
+ payload: SimpleError;
1934
+ }>;
1935
+ declare type CompareBranchSchemasVariables = {
1936
+ body?: Record<string, any>;
1937
+ pathParams: CompareBranchSchemasPathParams;
1938
+ } & FetcherExtraProps;
1939
+ declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
1940
+ declare type UpdateBranchSchemaPathParams = {
1941
+ dbBranchName: DBBranchName;
1942
+ workspace: string;
1943
+ };
1944
+ declare type UpdateBranchSchemaError = ErrorWrapper<{
1945
+ status: 400;
1946
+ payload: BadRequestError;
1947
+ } | {
1948
+ status: 401;
1949
+ payload: AuthError;
1950
+ } | {
1951
+ status: 404;
1952
+ payload: SimpleError;
1953
+ }>;
1954
+ declare type UpdateBranchSchemaResponse = {
1955
+ id: string;
1956
+ parentID: string;
1957
+ };
1958
+ declare type UpdateBranchSchemaVariables = {
1959
+ body: Migration;
1960
+ pathParams: UpdateBranchSchemaPathParams;
1961
+ } & FetcherExtraProps;
1962
+ declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
1963
+ declare type PreviewBranchSchemaEditPathParams = {
1964
+ dbBranchName: DBBranchName;
1965
+ workspace: string;
1966
+ };
1967
+ declare type PreviewBranchSchemaEditError = ErrorWrapper<{
1968
+ status: 400;
1969
+ payload: BadRequestError;
1970
+ } | {
1971
+ status: 401;
1972
+ payload: AuthError;
1973
+ } | {
1974
+ status: 404;
1975
+ payload: SimpleError;
1976
+ }>;
1977
+ declare type PreviewBranchSchemaEditResponse = {
1978
+ original: Schema;
1979
+ updated: Schema;
1980
+ };
1981
+ declare type PreviewBranchSchemaEditRequestBody = {
1982
+ edits?: SchemaEditScript;
1983
+ operations?: MigrationOp[];
1984
+ };
1985
+ declare type PreviewBranchSchemaEditVariables = {
1986
+ body?: PreviewBranchSchemaEditRequestBody;
1987
+ pathParams: PreviewBranchSchemaEditPathParams;
1988
+ } & FetcherExtraProps;
1989
+ declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
1990
+ declare type ApplyBranchSchemaEditPathParams = {
1991
+ dbBranchName: DBBranchName;
1992
+ workspace: string;
1993
+ };
1994
+ declare type ApplyBranchSchemaEditError = ErrorWrapper<{
1995
+ status: 400;
1996
+ payload: BadRequestError;
1997
+ } | {
1998
+ status: 401;
1999
+ payload: AuthError;
2000
+ } | {
2001
+ status: 404;
2002
+ payload: SimpleError;
2003
+ }>;
2004
+ declare type ApplyBranchSchemaEditResponse = {
2005
+ id: string;
2006
+ parentID: string;
2007
+ };
2008
+ declare type ApplyBranchSchemaEditRequestBody = {
2009
+ edits: SchemaEditScript;
2010
+ };
2011
+ declare type ApplyBranchSchemaEditVariables = {
2012
+ body: ApplyBranchSchemaEditRequestBody;
2013
+ pathParams: ApplyBranchSchemaEditPathParams;
2014
+ } & FetcherExtraProps;
2015
+ declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
2016
+ declare type GetBranchSchemaHistoryPathParams = {
2017
+ dbBranchName: DBBranchName;
2018
+ workspace: string;
2019
+ };
2020
+ declare type GetBranchSchemaHistoryError = ErrorWrapper<{
2021
+ status: 400;
2022
+ payload: BadRequestError;
2023
+ } | {
2024
+ status: 401;
2025
+ payload: AuthError;
2026
+ } | {
2027
+ status: 404;
2028
+ payload: SimpleError;
2029
+ }>;
2030
+ declare type GetBranchSchemaHistoryResponse = {
2031
+ meta: {
2032
+ cursor: string;
2033
+ more: boolean;
2034
+ };
2035
+ logs: Commit[];
2036
+ };
2037
+ declare type GetBranchSchemaHistoryRequestBody = {
2038
+ page?: {
2039
+ after?: string;
2040
+ before?: string;
2041
+ size?: number;
2042
+ };
2043
+ };
2044
+ declare type GetBranchSchemaHistoryVariables = {
2045
+ body?: GetBranchSchemaHistoryRequestBody;
2046
+ pathParams: GetBranchSchemaHistoryPathParams;
2047
+ } & FetcherExtraProps;
2048
+ declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
1358
2049
  declare type GetBranchStatsPathParams = {
1359
2050
  dbBranchName: DBBranchName;
1360
2051
  workspace: string;
@@ -1405,13 +2096,17 @@ declare type CreateTableError = ErrorWrapper<{
1405
2096
  status: 422;
1406
2097
  payload: SimpleError;
1407
2098
  }>;
2099
+ declare type CreateTableResponse = {
2100
+ branchName: string;
2101
+ tableName: string;
2102
+ };
1408
2103
  declare type CreateTableVariables = {
1409
2104
  pathParams: CreateTablePathParams;
1410
2105
  } & FetcherExtraProps;
1411
2106
  /**
1412
2107
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1413
2108
  */
1414
- declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
2109
+ declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
1415
2110
  declare type DeleteTablePathParams = {
1416
2111
  dbBranchName: DBBranchName;
1417
2112
  tableName: TableName;
@@ -1458,8 +2153,9 @@ declare type UpdateTableVariables = {
1458
2153
  *
1459
2154
  * In the example below, we rename a table from “users” to “people”:
1460
2155
  *
1461
- * ```jsx
1462
- * PATCH /db/test:main/tables/users
2156
+ * ```json
2157
+ * // PATCH /db/test:main/tables/users
2158
+ *
1463
2159
  * {
1464
2160
  * "name": "people"
1465
2161
  * }
@@ -1643,6 +2339,9 @@ declare type InsertRecordPathParams = {
1643
2339
  tableName: TableName;
1644
2340
  workspace: string;
1645
2341
  };
2342
+ declare type InsertRecordQueryParams = {
2343
+ columns?: ColumnsProjection;
2344
+ };
1646
2345
  declare type InsertRecordError = ErrorWrapper<{
1647
2346
  status: 400;
1648
2347
  payload: BadRequestError;
@@ -1653,20 +2352,15 @@ declare type InsertRecordError = ErrorWrapper<{
1653
2352
  status: 404;
1654
2353
  payload: SimpleError;
1655
2354
  }>;
1656
- declare type InsertRecordResponse = {
1657
- id: string;
1658
- xata: {
1659
- version: number;
1660
- };
1661
- };
1662
2355
  declare type InsertRecordVariables = {
1663
2356
  body?: Record<string, any>;
1664
2357
  pathParams: InsertRecordPathParams;
2358
+ queryParams?: InsertRecordQueryParams;
1665
2359
  } & FetcherExtraProps;
1666
2360
  /**
1667
2361
  * Insert a new Record into the Table
1668
2362
  */
1669
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2363
+ declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
1670
2364
  declare type InsertRecordWithIDPathParams = {
1671
2365
  dbBranchName: DBBranchName;
1672
2366
  tableName: TableName;
@@ -1674,6 +2368,7 @@ declare type InsertRecordWithIDPathParams = {
1674
2368
  workspace: string;
1675
2369
  };
1676
2370
  declare type InsertRecordWithIDQueryParams = {
2371
+ columns?: ColumnsProjection;
1677
2372
  createOnly?: boolean;
1678
2373
  ifVersion?: number;
1679
2374
  };
@@ -1706,6 +2401,7 @@ declare type UpdateRecordWithIDPathParams = {
1706
2401
  workspace: string;
1707
2402
  };
1708
2403
  declare type UpdateRecordWithIDQueryParams = {
2404
+ columns?: ColumnsProjection;
1709
2405
  ifVersion?: number;
1710
2406
  };
1711
2407
  declare type UpdateRecordWithIDError = ErrorWrapper<{
@@ -1734,6 +2430,7 @@ declare type UpsertRecordWithIDPathParams = {
1734
2430
  workspace: string;
1735
2431
  };
1736
2432
  declare type UpsertRecordWithIDQueryParams = {
2433
+ columns?: ColumnsProjection;
1737
2434
  ifVersion?: number;
1738
2435
  };
1739
2436
  declare type UpsertRecordWithIDError = ErrorWrapper<{
@@ -1761,6 +2458,9 @@ declare type DeleteRecordPathParams = {
1761
2458
  recordId: RecordID;
1762
2459
  workspace: string;
1763
2460
  };
2461
+ declare type DeleteRecordQueryParams = {
2462
+ columns?: ColumnsProjection;
2463
+ };
1764
2464
  declare type DeleteRecordError = ErrorWrapper<{
1765
2465
  status: 400;
1766
2466
  payload: BadRequestError;
@@ -1773,14 +2473,18 @@ declare type DeleteRecordError = ErrorWrapper<{
1773
2473
  }>;
1774
2474
  declare type DeleteRecordVariables = {
1775
2475
  pathParams: DeleteRecordPathParams;
2476
+ queryParams?: DeleteRecordQueryParams;
1776
2477
  } & FetcherExtraProps;
1777
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
2478
+ declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
1778
2479
  declare type GetRecordPathParams = {
1779
2480
  dbBranchName: DBBranchName;
1780
2481
  tableName: TableName;
1781
2482
  recordId: RecordID;
1782
2483
  workspace: string;
1783
2484
  };
2485
+ declare type GetRecordQueryParams = {
2486
+ columns?: ColumnsProjection;
2487
+ };
1784
2488
  declare type GetRecordError = ErrorWrapper<{
1785
2489
  status: 400;
1786
2490
  payload: BadRequestError;
@@ -1791,12 +2495,9 @@ declare type GetRecordError = ErrorWrapper<{
1791
2495
  status: 404;
1792
2496
  payload: SimpleError;
1793
2497
  }>;
1794
- declare type GetRecordRequestBody = {
1795
- columns?: ColumnsFilter;
1796
- };
1797
2498
  declare type GetRecordVariables = {
1798
- body?: GetRecordRequestBody;
1799
2499
  pathParams: GetRecordPathParams;
2500
+ queryParams?: GetRecordQueryParams;
1800
2501
  } & FetcherExtraProps;
1801
2502
  /**
1802
2503
  * Retrieve record by ID
@@ -1807,6 +2508,9 @@ declare type BulkInsertTableRecordsPathParams = {
1807
2508
  tableName: TableName;
1808
2509
  workspace: string;
1809
2510
  };
2511
+ declare type BulkInsertTableRecordsQueryParams = {
2512
+ columns?: ColumnsProjection;
2513
+ };
1810
2514
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
1811
2515
  status: 400;
1812
2516
  payload: BulkError;
@@ -1816,21 +2520,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1816
2520
  } | {
1817
2521
  status: 404;
1818
2522
  payload: SimpleError;
2523
+ } | {
2524
+ status: 422;
2525
+ payload: SimpleError;
1819
2526
  }>;
1820
- declare type BulkInsertTableRecordsResponse = {
1821
- recordIDs: string[];
1822
- };
1823
2527
  declare type BulkInsertTableRecordsRequestBody = {
1824
2528
  records: Record<string, any>[];
1825
2529
  };
1826
2530
  declare type BulkInsertTableRecordsVariables = {
1827
2531
  body: BulkInsertTableRecordsRequestBody;
1828
2532
  pathParams: BulkInsertTableRecordsPathParams;
2533
+ queryParams?: BulkInsertTableRecordsQueryParams;
1829
2534
  } & FetcherExtraProps;
1830
2535
  /**
1831
2536
  * Bulk insert records
1832
2537
  */
1833
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2538
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
1834
2539
  declare type QueryTablePathParams = {
1835
2540
  dbBranchName: DBBranchName;
1836
2541
  tableName: TableName;
@@ -1850,7 +2555,7 @@ declare type QueryTableRequestBody = {
1850
2555
  filter?: FilterExpression;
1851
2556
  sort?: SortExpression;
1852
2557
  page?: PageConfig;
1853
- columns?: ColumnsFilter;
2558
+ columns?: ColumnsProjection;
1854
2559
  };
1855
2560
  declare type QueryTableVariables = {
1856
2561
  body?: QueryTableRequestBody;
@@ -1867,7 +2572,7 @@ declare type QueryTableVariables = {
1867
2572
  * {
1868
2573
  * "columns": [...],
1869
2574
  * "filter": {
1870
- * "$all": [...]
2575
+ * "$all": [...],
1871
2576
  * "$any": [...]
1872
2577
  * ...
1873
2578
  * },
@@ -2005,7 +2710,7 @@ declare type QueryTableVariables = {
2005
2710
  * {
2006
2711
  * "name": "Kilian",
2007
2712
  * "address": {
2008
- * "street": "New street",
2713
+ * "street": "New street"
2009
2714
  * }
2010
2715
  * }
2011
2716
  * ```
@@ -2014,10 +2719,7 @@ declare type QueryTableVariables = {
2014
2719
  *
2015
2720
  * ```json
2016
2721
  * {
2017
- * "columns": [
2018
- * "*",
2019
- * "team.name"
2020
- * ]
2722
+ * "columns": ["*", "team.name"]
2021
2723
  * }
2022
2724
  * ```
2023
2725
  *
@@ -2035,7 +2737,7 @@ declare type QueryTableVariables = {
2035
2737
  * "team": {
2036
2738
  * "id": "XX",
2037
2739
  * "xata": {
2038
- * "version": 0,
2740
+ * "version": 0
2039
2741
  * },
2040
2742
  * "name": "first team"
2041
2743
  * }
@@ -2046,10 +2748,7 @@ declare type QueryTableVariables = {
2046
2748
  *
2047
2749
  * ```json
2048
2750
  * {
2049
- * "columns": [
2050
- * "*",
2051
- * "team.*"
2052
- * ]
2751
+ * "columns": ["*", "team.*"]
2053
2752
  * }
2054
2753
  * ```
2055
2754
  *
@@ -2067,7 +2766,7 @@ declare type QueryTableVariables = {
2067
2766
  * "team": {
2068
2767
  * "id": "XX",
2069
2768
  * "xata": {
2070
- * "version": 0,
2769
+ * "version": 0
2071
2770
  * },
2072
2771
  * "name": "first team",
2073
2772
  * "code": "A1",
@@ -2117,7 +2816,7 @@ declare type QueryTableVariables = {
2117
2816
  * ```json
2118
2817
  * {
2119
2818
  * "filter": {
2120
- * "name": "r2",
2819
+ * "name": "r2"
2121
2820
  * }
2122
2821
  * }
2123
2822
  * ```
@@ -2139,7 +2838,7 @@ declare type QueryTableVariables = {
2139
2838
  * ```json
2140
2839
  * {
2141
2840
  * "filter": {
2142
- * "settings.plan": "free",
2841
+ * "settings.plan": "free"
2143
2842
  * }
2144
2843
  * }
2145
2844
  * ```
@@ -2149,8 +2848,8 @@ declare type QueryTableVariables = {
2149
2848
  * "filter": {
2150
2849
  * "settings": {
2151
2850
  * "plan": "free"
2152
- * },
2153
- * },
2851
+ * }
2852
+ * }
2154
2853
  * }
2155
2854
  * ```
2156
2855
  *
@@ -2159,8 +2858,8 @@ declare type QueryTableVariables = {
2159
2858
  * ```json
2160
2859
  * {
2161
2860
  * "filter": {
2162
- * "settings.plan": {"$any": ["free", "paid"]}
2163
- * },
2861
+ * "settings.plan": { "$any": ["free", "paid"] }
2862
+ * }
2164
2863
  * }
2165
2864
  * ```
2166
2865
  *
@@ -2169,9 +2868,9 @@ declare type QueryTableVariables = {
2169
2868
  * ```json
2170
2869
  * {
2171
2870
  * "filter": {
2172
- * "settings.dark": true,
2173
- * "settings.plan": "free",
2174
- * },
2871
+ * "settings.dark": true,
2872
+ * "settings.plan": "free"
2873
+ * }
2175
2874
  * }
2176
2875
  * ```
2177
2876
  *
@@ -2182,11 +2881,11 @@ declare type QueryTableVariables = {
2182
2881
  * ```json
2183
2882
  * {
2184
2883
  * "filter": {
2185
- * "$any": {
2186
- * "settings.dark": true,
2187
- * "settings.plan": "free"
2188
- * }
2189
- * },
2884
+ * "$any": {
2885
+ * "settings.dark": true,
2886
+ * "settings.plan": "free"
2887
+ * }
2888
+ * }
2190
2889
  * }
2191
2890
  * ```
2192
2891
  *
@@ -2197,10 +2896,10 @@ declare type QueryTableVariables = {
2197
2896
  * "filter": {
2198
2897
  * "$any": [
2199
2898
  * {
2200
- * "name": "r1",
2899
+ * "name": "r1"
2201
2900
  * },
2202
2901
  * {
2203
- * "name": "r2",
2902
+ * "name": "r2"
2204
2903
  * }
2205
2904
  * ]
2206
2905
  * }
@@ -2212,7 +2911,7 @@ declare type QueryTableVariables = {
2212
2911
  * ```json
2213
2912
  * {
2214
2913
  * "filter": {
2215
- * "$exists": "settings",
2914
+ * "$exists": "settings"
2216
2915
  * }
2217
2916
  * }
2218
2917
  * ```
@@ -2224,10 +2923,10 @@ declare type QueryTableVariables = {
2224
2923
  * "filter": {
2225
2924
  * "$all": [
2226
2925
  * {
2227
- * "$exists": "settings",
2926
+ * "$exists": "settings"
2228
2927
  * },
2229
2928
  * {
2230
- * "$exists": "name",
2929
+ * "$exists": "name"
2231
2930
  * }
2232
2931
  * ]
2233
2932
  * }
@@ -2239,7 +2938,7 @@ declare type QueryTableVariables = {
2239
2938
  * ```json
2240
2939
  * {
2241
2940
  * "filter": {
2242
- * "$notExists": "settings",
2941
+ * "$notExists": "settings"
2243
2942
  * }
2244
2943
  * }
2245
2944
  * ```
@@ -2266,22 +2965,28 @@ declare type QueryTableVariables = {
2266
2965
  * {
2267
2966
  * "filter": {
2268
2967
  * "<column_name>": {
2269
- * "$pattern": "v*alue*"
2968
+ * "$pattern": "v*alu?"
2270
2969
  * }
2271
2970
  * }
2272
2971
  * }
2273
2972
  * ```
2274
2973
  *
2974
+ * The `$pattern` operator accepts two wildcard characters:
2975
+ * * `*` matches zero or more characters
2976
+ * * `?` matches exactly one character
2977
+ *
2978
+ * If you want to match a string that contains a wildcard character, you can escape them using a backslash (`\`). You can escape a backslash by usign another backslash.
2979
+ *
2275
2980
  * We could also have `$endsWith` and `$startsWith` operators:
2276
2981
  *
2277
2982
  * ```json
2278
2983
  * {
2279
2984
  * "filter": {
2280
2985
  * "<column_name>": {
2281
- * "$endsWith": ".gz"
2986
+ * "$endsWith": ".gz"
2282
2987
  * },
2283
2988
  * "<column_name>": {
2284
- * "$startsWith": "tmp-"
2989
+ * "$startsWith": "tmp-"
2285
2990
  * }
2286
2991
  * }
2287
2992
  * }
@@ -2292,10 +2997,10 @@ declare type QueryTableVariables = {
2292
2997
  * ```json
2293
2998
  * {
2294
2999
  * "filter": {
2295
- * "<column_name>": {
2296
- * "$ge": 0,
2297
- * "$lt": 100
2298
- * }
3000
+ * "<column_name>": {
3001
+ * "$ge": 0,
3002
+ * "$lt": 100
3003
+ * }
2299
3004
  * }
2300
3005
  * }
2301
3006
  * ```
@@ -2313,7 +3018,6 @@ declare type QueryTableVariables = {
2313
3018
  * ```
2314
3019
  * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
2315
3020
  *
2316
- *
2317
3021
  * #### Negations
2318
3022
  *
2319
3023
  * A general `$not` operator can inverse any operation.
@@ -2338,15 +3042,21 @@ declare type QueryTableVariables = {
2338
3042
  * {
2339
3043
  * "filter": {
2340
3044
  * "$not": {
2341
- * "$any": [{
2342
- * "<column_name1>": "value1"
2343
- * }, {
2344
- * "$all": [{
2345
- * "<column_name2>": "value2"
2346
- * }, {
2347
- * "<column_name3>": "value3"
2348
- * }]
2349
- * }]
3045
+ * "$any": [
3046
+ * {
3047
+ * "<column_name1>": "value1"
3048
+ * },
3049
+ * {
3050
+ * "$all": [
3051
+ * {
3052
+ * "<column_name2>": "value2"
3053
+ * },
3054
+ * {
3055
+ * "<column_name3>": "value3"
3056
+ * }
3057
+ * ]
3058
+ * }
3059
+ * ]
2350
3060
  * }
2351
3061
  * }
2352
3062
  * }
@@ -2401,8 +3111,8 @@ declare type QueryTableVariables = {
2401
3111
  * "<array name>": {
2402
3112
  * "$includes": {
2403
3113
  * "$all": [
2404
- * {"$contains": "label"},
2405
- * {"$not": {"$endsWith": "-debug"}}
3114
+ * { "$contains": "label" },
3115
+ * { "$not": { "$endsWith": "-debug" } }
2406
3116
  * ]
2407
3117
  * }
2408
3118
  * }
@@ -2422,9 +3132,7 @@ declare type QueryTableVariables = {
2422
3132
  * {
2423
3133
  * "filter": {
2424
3134
  * "settings.labels": {
2425
- * "$includesAll": [
2426
- * {"$contains": "label"},
2427
- * ]
3135
+ * "$includesAll": [{ "$contains": "label" }]
2428
3136
  * }
2429
3137
  * }
2430
3138
  * }
@@ -2472,7 +3180,6 @@ declare type QueryTableVariables = {
2472
3180
  * }
2473
3181
  * ```
2474
3182
  *
2475
- *
2476
3183
  * ### Pagination
2477
3184
  *
2478
3185
  * We offer cursor pagination and offset pagination. The offset pagination is limited
@@ -2538,8 +3245,8 @@ declare type QueryTableVariables = {
2538
3245
  * can be queried by update `page.after` to the returned cursor while keeping the
2539
3246
  * `page.before` cursor from the first range query.
2540
3247
  *
2541
- * The `filter` , `columns`, `sort` , and `page.size` configuration will be
2542
- * encoded with the cursor. The pagination request will be invalid if
3248
+ * The `filter` , `columns`, `sort` , and `page.size` configuration will be
3249
+ * encoded with the cursor. The pagination request will be invalid if
2543
3250
  * `filter` or `sort` is set. The columns returned and page size can be changed
2544
3251
  * anytime by passing the `columns` or `page.size` settings to the next query.
2545
3252
  *
@@ -2576,6 +3283,41 @@ declare type QueryTableVariables = {
2576
3283
  * ```
2577
3284
  */
2578
3285
  declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
3286
+ declare type SearchTablePathParams = {
3287
+ dbBranchName: DBBranchName;
3288
+ tableName: TableName;
3289
+ workspace: string;
3290
+ };
3291
+ declare type SearchTableError = ErrorWrapper<{
3292
+ status: 400;
3293
+ payload: BadRequestError;
3294
+ } | {
3295
+ status: 401;
3296
+ payload: AuthError;
3297
+ } | {
3298
+ status: 404;
3299
+ payload: SimpleError;
3300
+ }>;
3301
+ declare type SearchTableRequestBody = {
3302
+ query: string;
3303
+ fuzziness?: FuzzinessExpression;
3304
+ prefix?: PrefixExpression;
3305
+ filter?: FilterExpression;
3306
+ highlight?: HighlightExpression;
3307
+ boosters?: BoosterExpression[];
3308
+ };
3309
+ declare type SearchTableVariables = {
3310
+ body: SearchTableRequestBody;
3311
+ pathParams: SearchTablePathParams;
3312
+ } & FetcherExtraProps;
3313
+ /**
3314
+ * Run a free text search operation in a particular table.
3315
+ *
3316
+ * The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
3317
+ * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
3318
+ * * filtering on columns of type `multiple` is currently unsupported
3319
+ */
3320
+ declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2579
3321
  declare type SearchBranchPathParams = {
2580
3322
  dbBranchName: DBBranchName;
2581
3323
  workspace: string;
@@ -2591,9 +3333,15 @@ declare type SearchBranchError = ErrorWrapper<{
2591
3333
  payload: SimpleError;
2592
3334
  }>;
2593
3335
  declare type SearchBranchRequestBody = {
2594
- tables?: string[];
3336
+ tables?: (string | {
3337
+ table: string;
3338
+ filter?: FilterExpression;
3339
+ boosters?: BoosterExpression[];
3340
+ })[];
2595
3341
  query: string;
2596
- fuzziness?: number;
3342
+ fuzziness?: FuzzinessExpression;
3343
+ prefix?: PrefixExpression;
3344
+ highlight?: HighlightExpression;
2597
3345
  };
2598
3346
  declare type SearchBranchVariables = {
2599
3347
  body: SearchBranchRequestBody;
@@ -2622,6 +3370,7 @@ declare const operationsByTag: {
2622
3370
  updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2623
3371
  removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2624
3372
  inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
3373
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
2625
3374
  cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2626
3375
  resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2627
3376
  acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
@@ -2630,6 +3379,8 @@ declare const operationsByTag: {
2630
3379
  getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2631
3380
  createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2632
3381
  deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
3382
+ getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
3383
+ patchDatabaseMetadata: (variables: PatchDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
2633
3384
  getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
2634
3385
  addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2635
3386
  removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
@@ -2638,17 +3389,35 @@ declare const operationsByTag: {
2638
3389
  branch: {
2639
3390
  getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2640
3391
  getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2641
- createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
3392
+ createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2642
3393
  deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2643
3394
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2644
3395
  getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
3396
+ getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
3397
+ };
3398
+ migrationRequests: {
3399
+ listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
3400
+ createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
3401
+ getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
3402
+ updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
3403
+ listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
3404
+ compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
3405
+ getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
3406
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
3407
+ };
3408
+ branchSchema: {
2645
3409
  getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2646
3410
  executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2647
3411
  getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2648
- getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
3412
+ compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
3413
+ compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
3414
+ updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
3415
+ previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
3416
+ applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
3417
+ getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
2649
3418
  };
2650
3419
  table: {
2651
- createTable: (variables: CreateTableVariables) => Promise<undefined>;
3420
+ createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2652
3421
  deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2653
3422
  updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2654
3423
  getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
@@ -2660,14 +3429,15 @@ declare const operationsByTag: {
2660
3429
  updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
2661
3430
  };
2662
3431
  records: {
2663
- insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
3432
+ insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
2664
3433
  insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2665
3434
  updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2666
3435
  upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2667
- deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
3436
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
2668
3437
  getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2669
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
3438
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
2670
3439
  queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
3440
+ searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2671
3441
  searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
2672
3442
  };
2673
3443
  };
@@ -2683,10 +3453,8 @@ interface XataApiClientOptions {
2683
3453
  fetch?: FetchImpl;
2684
3454
  apiKey?: string;
2685
3455
  host?: HostProvider;
3456
+ trace?: TraceFunction;
2686
3457
  }
2687
- /**
2688
- * @deprecated Use XataApiPlugin instead
2689
- */
2690
3458
  declare class XataApiClient {
2691
3459
  #private;
2692
3460
  constructor(options?: XataApiClientOptions);
@@ -2696,6 +3464,8 @@ declare class XataApiClient {
2696
3464
  get branches(): BranchApi;
2697
3465
  get tables(): TableApi;
2698
3466
  get records(): RecordsApi;
3467
+ get migrationRequests(): MigrationRequestsApi;
3468
+ get branchSchema(): BranchSchemaApi;
2699
3469
  }
2700
3470
  declare class UserApi {
2701
3471
  private extraProps;
@@ -2719,6 +3489,7 @@ declare class WorkspaceApi {
2719
3489
  updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2720
3490
  removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2721
3491
  inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
3492
+ updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
2722
3493
  cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2723
3494
  resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2724
3495
  acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
@@ -2729,29 +3500,28 @@ declare class DatabaseApi {
2729
3500
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2730
3501
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2731
3502
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
3503
+ getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
3504
+ patchDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: PatchDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
2732
3505
  getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2733
3506
  addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2734
3507
  removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
2735
- resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<ResolveBranchResponse>;
3508
+ resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
2736
3509
  }
2737
3510
  declare class BranchApi {
2738
3511
  private extraProps;
2739
3512
  constructor(extraProps: FetcherExtraProps);
2740
3513
  getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2741
3514
  getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2742
- createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<void>;
3515
+ createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
2743
3516
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2744
3517
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2745
3518
  getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
2746
- getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
2747
- executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
2748
- getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
2749
3519
  getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
2750
3520
  }
2751
3521
  declare class TableApi {
2752
3522
  private extraProps;
2753
3523
  constructor(extraProps: FetcherExtraProps);
2754
- createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
3524
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
2755
3525
  deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2756
3526
  updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2757
3527
  getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
@@ -2765,16 +3535,42 @@ declare class TableApi {
2765
3535
  declare class RecordsApi {
2766
3536
  private extraProps;
2767
3537
  constructor(extraProps: FetcherExtraProps);
2768
- insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>): Promise<InsertRecordResponse>;
3538
+ insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
2769
3539
  insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2770
3540
  updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2771
3541
  upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2772
- deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<void>;
2773
- getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2774
- bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
3542
+ deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
3543
+ getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
3544
+ bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
2775
3545
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
3546
+ searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2776
3547
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
2777
3548
  }
3549
+ declare class MigrationRequestsApi {
3550
+ private extraProps;
3551
+ constructor(extraProps: FetcherExtraProps);
3552
+ listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
3553
+ createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
3554
+ getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
3555
+ updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
3556
+ listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
3557
+ compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
3558
+ getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
3559
+ mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
3560
+ }
3561
+ declare class BranchSchemaApi {
3562
+ private extraProps;
3563
+ constructor(extraProps: FetcherExtraProps);
3564
+ getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
3565
+ executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
3566
+ getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
3567
+ compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
3568
+ compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
3569
+ updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
3570
+ previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
3571
+ applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
3572
+ getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
3573
+ }
2778
3574
 
2779
3575
  declare class XataApiPlugin implements XataPlugin {
2780
3576
  build(options: XataPluginOptions): Promise<XataApiClient>;
@@ -2786,27 +3582,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
2786
3582
  declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2787
3583
  declare type IsObject<T> = T extends Record<string, any> ? true : false;
2788
3584
  declare type IsArray<T> = T extends Array<any> ? true : false;
2789
- declare type NonEmptyArray<T> = T[] & {
2790
- 0: T;
2791
- };
2792
3585
  declare type RequiredBy<T, K extends keyof T> = T & {
2793
3586
  [P in K]-?: NonNullable<T[P]>;
2794
3587
  };
2795
3588
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2796
3589
  declare type SingleOrArray<T> = T | T[];
3590
+ declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
3591
+ declare type Without<T, U> = {
3592
+ [P in Exclude<keyof T, keyof U>]?: never;
3593
+ };
3594
+ declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
2797
3595
 
2798
3596
  declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2799
- declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2800
- [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
3597
+ declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
3598
+ [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
2801
3599
  }>>;
2802
- declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends XataRecord ? (V extends SelectableColumn<O[K]> ? {
2803
- V: ValueAtColumn<O[K], V>;
2804
- } : never) : O[K]> : never : never;
3600
+ declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
3601
+ V: ValueAtColumn<Item, V>;
3602
+ } : never : O[K] : never> : never : never;
2805
3603
  declare type MAX_RECURSION = 5;
2806
3604
  declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
2807
- [K in DataProps<O>]: If<IsArray<NonNullable<O[K]>>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
2808
- If<IsObject<NonNullable<O[K]>>, NonNullable<O[K]> extends XataRecord ? SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]> extends string ? K | `${K}.${SelectableColumn<NonNullable<O[K]>, [...RecursivePath, O[K]]>}` : never : `${K}.${StringKeys<NonNullable<O[K]>> | '*'}`, // This allows usage of objects that are not links
2809
- K>>;
3605
+ [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
3606
+ 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
3607
+ K>> : never;
2810
3608
  }>, never>;
2811
3609
  declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
2812
3610
  declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
@@ -2833,56 +3631,85 @@ interface BaseData {
2833
3631
  /**
2834
3632
  * Represents a persisted record from the database.
2835
3633
  */
2836
- interface XataRecord extends Identifiable {
3634
+ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
2837
3635
  /**
2838
- * Metadata of this record.
3636
+ * Get metadata of this record.
2839
3637
  */
2840
- xata: {
2841
- /**
2842
- * Number that is increased every time the record is updated.
2843
- */
2844
- version: number;
2845
- };
3638
+ getMetadata(): XataRecordMetadata;
3639
+ /**
3640
+ * Retrieves a refreshed copy of the current record from the database.
3641
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3642
+ * @returns The persisted record with the selected columns, null if not found.
3643
+ */
3644
+ read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2846
3645
  /**
2847
3646
  * Retrieves a refreshed copy of the current record from the database.
3647
+ * @returns The persisted record with all first level properties, null if not found.
2848
3648
  */
2849
- read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
3649
+ read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2850
3650
  /**
2851
3651
  * Performs a partial update of the current record. On success a new object is
2852
3652
  * returned and the current object is not mutated.
2853
- * @param data The columns and their values that have to be updated.
2854
- * @returns A new record containing the latest values for all the columns of the current record.
3653
+ * @param partialUpdate The columns and their values that have to be updated.
3654
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3655
+ * @returns The persisted record with the selected columns, null if not found.
2855
3656
  */
2856
- update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
3657
+ update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
3658
+ /**
3659
+ * Performs a partial update of the current record. On success a new object is
3660
+ * returned and the current object is not mutated.
3661
+ * @param partialUpdate The columns and their values that have to be updated.
3662
+ * @returns The persisted record with all first level properties, null if not found.
3663
+ */
3664
+ update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2857
3665
  /**
2858
3666
  * Performs a deletion of the current record in the database.
2859
- *
2860
- * @throws If the record was already deleted or if an error happened while performing the deletion.
3667
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3668
+ * @returns The deleted record, null if not found.
2861
3669
  */
2862
- delete(): Promise<void>;
3670
+ delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
3671
+ /**
3672
+ * Performs a deletion of the current record in the database.
3673
+ * @returns The deleted record, null if not found.
3674
+
3675
+ */
3676
+ delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2863
3677
  }
2864
3678
  declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
2865
3679
  /**
2866
3680
  * Retrieves a refreshed copy of the current record from the database.
2867
3681
  */
2868
- read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3682
+ read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
2869
3683
  /**
2870
3684
  * Performs a partial update of the current record. On success a new object is
2871
3685
  * returned and the current object is not mutated.
2872
- * @param data The columns and their values that have to be updated.
3686
+ * @param partialUpdate The columns and their values that have to be updated.
2873
3687
  * @returns A new record containing the latest values for all the columns of the current record.
2874
3688
  */
2875
- update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3689
+ update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Record>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
3690
+ /**
3691
+ * Performs a deletion of the current record in the database.
3692
+ *
3693
+ * @throws If the record was already deleted or if an error happened while performing the deletion.
3694
+ */
3695
+ delete(): Promise<void>;
3696
+ };
3697
+ declare type XataRecordMetadata = {
3698
+ /**
3699
+ * Number that is increased every time the record is updated.
3700
+ */
3701
+ version: number;
3702
+ warnings?: string[];
2876
3703
  };
2877
3704
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2878
3705
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2879
- declare type EditableData<O extends BaseData> = {
3706
+ declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
2880
3707
  [K in keyof O]: O[K] extends XataRecord ? {
2881
3708
  id: string;
2882
- } : NonNullable<O[K]> extends XataRecord ? {
3709
+ } | string : NonNullable<O[K]> extends XataRecord ? {
2883
3710
  id: string;
2884
- } | null | undefined : O[K];
2885
- };
3711
+ } | string | null | undefined : O[K];
3712
+ }, keyof XataRecord>;
2886
3713
 
2887
3714
  /**
2888
3715
  * PropertyMatchFilter
@@ -2957,8 +3784,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
2957
3784
  ],
2958
3785
  }
2959
3786
  */
2960
- declare type AggregatorFilter<Record> = {
2961
- [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<Record>>;
3787
+ declare type AggregatorFilter<T> = {
3788
+ [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
2962
3789
  };
2963
3790
  /**
2964
3791
  * Existance filter
@@ -2967,16 +3794,94 @@ declare type AggregatorFilter<Record> = {
2967
3794
  declare type ExistanceFilter<Record> = {
2968
3795
  [key in '$exists' | '$notExists']?: SelectableColumn<Record>;
2969
3796
  };
2970
- declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
2971
- /**
2972
- * Nested filter
2973
- * Injects the Api filters on nested properties
2974
- * Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
2975
- */
2976
- declare type NestedApiFilter<T> = T extends Record<string, any> ? {
2977
- [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
2978
- } : PropertyFilter<T>;
2979
- declare type Filter<Record> = BaseApiFilter<Record> | NestedApiFilter<Record>;
3797
+ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
3798
+ /**
3799
+ * Nested filter
3800
+ * Injects the Api filters on nested properties
3801
+ * Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
3802
+ */
3803
+ declare type NestedApiFilter<T> = {
3804
+ [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
3805
+ };
3806
+ declare type Filter<T> = T extends Record<string, any> ? T extends (infer ArrayType)[] ? ArrayType | ArrayType[] | ArrayFilter<ArrayType> | ArrayFilter<ArrayType[]> : T extends Date ? PropertyFilter<T> : BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
3807
+
3808
+ declare type DateBooster = {
3809
+ origin?: string;
3810
+ scale: string;
3811
+ decay: number;
3812
+ };
3813
+ declare type NumericBooster = {
3814
+ factor: number;
3815
+ };
3816
+ declare type ValueBooster<T extends string | number | boolean> = {
3817
+ value: T;
3818
+ factor: number;
3819
+ };
3820
+ declare type Boosters<O extends XataRecord> = Values<{
3821
+ [K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
3822
+ dateBooster: {
3823
+ column: K;
3824
+ } & DateBooster;
3825
+ } : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
3826
+ numericBooster?: {
3827
+ column: K;
3828
+ } & NumericBooster;
3829
+ }, {
3830
+ valueBooster?: {
3831
+ column: K;
3832
+ } & ValueBooster<number>;
3833
+ }> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
3834
+ valueBooster: {
3835
+ column: K;
3836
+ } & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
3837
+ } : never;
3838
+ }>;
3839
+
3840
+ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3841
+ fuzziness?: FuzzinessExpression;
3842
+ prefix?: PrefixExpression;
3843
+ highlight?: HighlightExpression;
3844
+ tables?: Array<Tables | Values<{
3845
+ [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
3846
+ table: Model;
3847
+ filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
3848
+ boosters?: Boosters<Schemas[Model] & XataRecord>[];
3849
+ };
3850
+ }>>;
3851
+ };
3852
+ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3853
+ all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3854
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
3855
+ table: Model;
3856
+ record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
3857
+ };
3858
+ }>[]>;
3859
+ byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3860
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
3861
+ }>;
3862
+ };
3863
+ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3864
+ #private;
3865
+ private db;
3866
+ constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
3867
+ build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3868
+ }
3869
+ declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
3870
+ getMetadata: () => XataRecordMetadata & SearchExtraProperties;
3871
+ };
3872
+ declare type SearchExtraProperties = {
3873
+ table: string;
3874
+ highlight?: {
3875
+ [key: string]: string[] | {
3876
+ [key: string]: any;
3877
+ };
3878
+ };
3879
+ score?: number;
3880
+ };
3881
+ declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
3882
+ declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
3883
+ table: infer Table;
3884
+ } ? ReturnTable<Table, Tables> : never;
2980
3885
 
2981
3886
  declare type SortDirection = 'asc' | 'desc';
2982
3887
  declare type SortFilterExtended<T extends XataRecord> = {
@@ -2988,13 +3893,21 @@ declare type SortFilterBase<T extends XataRecord> = {
2988
3893
  [Key in StringKeys<T>]: SortDirection;
2989
3894
  };
2990
3895
 
2991
- declare type QueryOptions<T extends XataRecord> = {
2992
- pagination?: PaginationOptions;
2993
- columns?: NonEmptyArray<SelectableColumn<T>>;
3896
+ declare type BaseOptions<T extends XataRecord> = {
3897
+ columns?: SelectableColumn<T>[];
3898
+ cache?: number;
3899
+ };
3900
+ declare type CursorQueryOptions = {
3901
+ pagination?: CursorNavigationOptions & OffsetNavigationOptions;
3902
+ filter?: never;
3903
+ sort?: never;
3904
+ };
3905
+ declare type OffsetQueryOptions<T extends XataRecord> = {
3906
+ pagination?: OffsetNavigationOptions;
2994
3907
  filter?: FilterExpression;
2995
3908
  sort?: SortFilter<T> | SortFilter<T>[];
2996
- cache?: number;
2997
3909
  };
3910
+ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
2998
3911
  /**
2999
3912
  * Query objects contain the information of all filters, sorting, etc. to be included in the database query.
3000
3913
  *
@@ -3004,8 +3917,11 @@ declare type QueryOptions<T extends XataRecord> = {
3004
3917
  declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
3005
3918
  #private;
3006
3919
  readonly meta: PaginationQueryMeta;
3007
- readonly records: Result[];
3008
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, parent?: Partial<QueryOptions<Record>>);
3920
+ readonly records: RecordArray<Result>;
3921
+ constructor(repository: Repository<Record> | null, table: {
3922
+ name: string;
3923
+ schema?: Table;
3924
+ }, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
3009
3925
  getQueryOptions(): QueryOptions<Record>;
3010
3926
  key(): string;
3011
3927
  /**
@@ -3037,73 +3953,186 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3037
3953
  *
3038
3954
  * ```
3039
3955
  * query.filter("columnName", columnValue)
3040
- * query.filter({
3041
- * "columnName": columnValue
3042
- * })
3956
+ * query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
3957
+ * ```
3958
+ *
3959
+ * @param column The name of the column to filter.
3960
+ * @param value The value to filter.
3961
+ * @returns A new Query object.
3962
+ */
3963
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
3964
+ /**
3965
+ * Builds a new query object adding one or more constraints. Examples:
3966
+ *
3967
+ * ```
3968
+ * query.filter({ "columnName": columnValue })
3043
3969
  * query.filter({
3044
3970
  * "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
3045
3971
  * })
3046
3972
  * ```
3047
3973
  *
3974
+ * @param filters A filter object
3048
3975
  * @returns A new Query object.
3049
3976
  */
3050
- filter(filters: Filter<Record>): Query<Record, Result>;
3051
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
3977
+ filter(filters?: Filter<Record>): Query<Record, Result>;
3978
+ defaultFilter<T>(column: string, value: T): T | {
3979
+ $includes: (T & string) | (T & string[]);
3980
+ };
3052
3981
  /**
3053
3982
  * Builds a new query with a new sort option.
3054
3983
  * @param column The column name.
3055
3984
  * @param direction The direction. Either ascending or descending.
3056
3985
  * @returns A new Query object.
3057
3986
  */
3058
- sort<F extends SelectableColumn<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
3987
+ sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
3059
3988
  /**
3060
3989
  * Builds a new query specifying the set of columns to be returned in the query response.
3061
3990
  * @param columns Array of column names to be returned by the query.
3062
3991
  * @returns A new Query object.
3063
3992
  */
3064
- select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
3993
+ select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
3994
+ /**
3995
+ * Get paginated results
3996
+ *
3997
+ * @returns A page of results
3998
+ */
3065
3999
  getPaginated(): Promise<Page<Record, Result>>;
3066
- getPaginated(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
4000
+ /**
4001
+ * Get paginated results
4002
+ *
4003
+ * @param options Pagination options
4004
+ * @returns A page of results
4005
+ */
4006
+ getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
4007
+ /**
4008
+ * Get paginated results
4009
+ *
4010
+ * @param options Pagination options
4011
+ * @returns A page of results
4012
+ */
3067
4013
  getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
4014
+ /**
4015
+ * Get results in an iterator
4016
+ *
4017
+ * @async
4018
+ * @returns Async interable of results
4019
+ */
3068
4020
  [Symbol.asyncIterator](): AsyncIterableIterator<Result>;
3069
- getIterator(chunk: number): AsyncGenerator<Result[]>;
3070
- getIterator(chunk: number, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): AsyncGenerator<Result[]>;
3071
- getIterator<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number, options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
4021
+ /**
4022
+ * Build an iterator of results
4023
+ *
4024
+ * @returns Async generator of results array
4025
+ */
4026
+ getIterator(): AsyncGenerator<Result[]>;
4027
+ /**
4028
+ * Build an iterator of results
4029
+ *
4030
+ * @param options Pagination options with batchSize
4031
+ * @returns Async generator of results array
4032
+ */
4033
+ getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
4034
+ batchSize?: number;
4035
+ }): AsyncGenerator<Result[]>;
4036
+ /**
4037
+ * Build an iterator of results
4038
+ *
4039
+ * @param options Pagination options with batchSize
4040
+ * @returns Async generator of results array
4041
+ */
4042
+ getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
4043
+ batchSize?: number;
4044
+ }>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
4045
+ /**
4046
+ * Performs the query in the database and returns a set of results.
4047
+ * @returns An array of records from the database.
4048
+ */
4049
+ getMany(): Promise<RecordArray<Result>>;
4050
+ /**
4051
+ * Performs the query in the database and returns a set of results.
4052
+ * @param options Additional options to be used when performing the query.
4053
+ * @returns An array of records from the database.
4054
+ */
4055
+ getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
3072
4056
  /**
3073
4057
  * Performs the query in the database and returns a set of results.
3074
4058
  * @param options Additional options to be used when performing the query.
3075
4059
  * @returns An array of records from the database.
3076
4060
  */
3077
- getMany(): Promise<Result[]>;
3078
- getMany(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
3079
- getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
4061
+ getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
4062
+ /**
4063
+ * Performs the query in the database and returns all the results.
4064
+ * Warning: If there are a large number of results, this method can have performance implications.
4065
+ * @returns An array of records from the database.
4066
+ */
4067
+ getAll(): Promise<Result[]>;
3080
4068
  /**
3081
4069
  * Performs the query in the database and returns all the results.
3082
4070
  * Warning: If there are a large number of results, this method can have performance implications.
3083
4071
  * @param options Additional options to be used when performing the query.
3084
4072
  * @returns An array of records from the database.
3085
4073
  */
3086
- getAll(chunk?: number): Promise<Result[]>;
3087
- getAll(chunk: number | undefined, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result[]>;
3088
- getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number | undefined, options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
4074
+ getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
4075
+ batchSize?: number;
4076
+ }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
3089
4077
  /**
3090
- * Performs the query in the database and returns the first result.
4078
+ * Performs the query in the database and returns all the results.
4079
+ * Warning: If there are a large number of results, this method can have performance implications.
3091
4080
  * @param options Additional options to be used when performing the query.
4081
+ * @returns An array of records from the database.
4082
+ */
4083
+ getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
4084
+ batchSize?: number;
4085
+ }): Promise<Result[]>;
4086
+ /**
4087
+ * Performs the query in the database and returns the first result.
3092
4088
  * @returns The first record that matches the query, or null if no record matched the query.
3093
4089
  */
3094
4090
  getFirst(): Promise<Result | null>;
3095
- getFirst(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
3096
- getFirst<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
4091
+ /**
4092
+ * Performs the query in the database and returns the first result.
4093
+ * @param options Additional options to be used when performing the query.
4094
+ * @returns The first record that matches the query, or null if no record matched the query.
4095
+ */
4096
+ getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
4097
+ /**
4098
+ * Performs the query in the database and returns the first result.
4099
+ * @param options Additional options to be used when performing the query.
4100
+ * @returns The first record that matches the query, or null if no record matched the query.
4101
+ */
4102
+ getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
3097
4103
  /**
3098
4104
  * Builds a new query object adding a cache TTL in milliseconds.
3099
4105
  * @param ttl The cache TTL in milliseconds.
3100
4106
  * @returns A new Query object.
3101
4107
  */
3102
4108
  cache(ttl: number): Query<Record, Result>;
4109
+ /**
4110
+ * Retrieve next page of records
4111
+ *
4112
+ * @returns A new page object.
4113
+ */
3103
4114
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4115
+ /**
4116
+ * Retrieve previous page of records
4117
+ *
4118
+ * @returns A new page object
4119
+ */
3104
4120
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4121
+ /**
4122
+ * Retrieve first page of records
4123
+ *
4124
+ * @returns A new page object
4125
+ */
3105
4126
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4127
+ /**
4128
+ * Retrieve last page of records
4129
+ *
4130
+ * @returns A new page object
4131
+ */
3106
4132
  lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4133
+ /**
4134
+ * @returns Boolean indicating if there is a next page
4135
+ */
3107
4136
  hasNextPage(): boolean;
3108
4137
  }
3109
4138
 
@@ -3115,7 +4144,7 @@ declare type PaginationQueryMeta = {
3115
4144
  };
3116
4145
  interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
3117
4146
  meta: PaginationQueryMeta;
3118
- records: Result[];
4147
+ records: RecordArray<Result>;
3119
4148
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3120
4149
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
3121
4150
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
@@ -3135,7 +4164,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
3135
4164
  /**
3136
4165
  * The set of results for this page.
3137
4166
  */
3138
- readonly records: Result[];
4167
+ readonly records: RecordArray<Result>;
3139
4168
  constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
3140
4169
  /**
3141
4170
  * Retrieves the next page of results.
@@ -3183,62 +4212,198 @@ declare type OffsetNavigationOptions = {
3183
4212
  size?: number;
3184
4213
  offset?: number;
3185
4214
  };
3186
- declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
3187
4215
  declare const PAGINATION_MAX_SIZE = 200;
3188
- declare const PAGINATION_DEFAULT_SIZE = 200;
4216
+ declare const PAGINATION_DEFAULT_SIZE = 20;
3189
4217
  declare const PAGINATION_MAX_OFFSET = 800;
3190
4218
  declare const PAGINATION_DEFAULT_OFFSET = 0;
4219
+ declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
4220
+ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
4221
+ #private;
4222
+ constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
4223
+ static parseConstructorParams(...args: any[]): any[];
4224
+ toArray(): Result[];
4225
+ map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
4226
+ /**
4227
+ * Retrieve next page of records
4228
+ *
4229
+ * @returns A new array of objects
4230
+ */
4231
+ nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4232
+ /**
4233
+ * Retrieve previous page of records
4234
+ *
4235
+ * @returns A new array of objects
4236
+ */
4237
+ previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4238
+ /**
4239
+ * Retrieve first page of records
4240
+ *
4241
+ * @returns A new array of objects
4242
+ */
4243
+ firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4244
+ /**
4245
+ * Retrieve last page of records
4246
+ *
4247
+ * @returns A new array of objects
4248
+ */
4249
+ lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4250
+ /**
4251
+ * @returns Boolean indicating if there is a next page
4252
+ */
4253
+ hasNextPage(): boolean;
4254
+ }
3191
4255
 
3192
4256
  /**
3193
4257
  * Common interface for performing operations on a table.
3194
4258
  */
3195
- declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
3196
- abstract create(object: EditableData<Data> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4259
+ declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
4260
+ abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4261
+ abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4262
+ /**
4263
+ * Creates a single record in the table with a unique id.
4264
+ * @param id The unique id.
4265
+ * @param object Object containing the column names with their values to be stored in the table.
4266
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4267
+ * @returns The full persisted record.
4268
+ */
4269
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3197
4270
  /**
3198
4271
  * Creates a single record in the table with a unique id.
3199
4272
  * @param id The unique id.
3200
4273
  * @param object Object containing the column names with their values to be stored in the table.
3201
4274
  * @returns The full persisted record.
3202
4275
  */
3203
- abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4276
+ abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3204
4277
  /**
3205
4278
  * Creates multiple records in the table.
3206
4279
  * @param objects Array of objects with the column names and the values to be stored in the table.
3207
- * @returns Array of the persisted records.
4280
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4281
+ * @returns Array of the persisted records in order.
4282
+ */
4283
+ abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4284
+ /**
4285
+ * Creates multiple records in the table.
4286
+ * @param objects Array of objects with the column names and the values to be stored in the table.
4287
+ * @returns Array of the persisted records in order.
3208
4288
  */
3209
- abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4289
+ abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4290
+ /**
4291
+ * Queries a single record from the table given its unique id.
4292
+ * @param id The unique id.
4293
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4294
+ * @returns The persisted record for the given id or null if the record could not be found.
4295
+ */
4296
+ abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3210
4297
  /**
3211
4298
  * Queries a single record from the table given its unique id.
3212
4299
  * @param id The unique id.
3213
4300
  * @returns The persisted record for the given id or null if the record could not be found.
3214
4301
  */
3215
4302
  abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4303
+ /**
4304
+ * Queries multiple records from the table given their unique id.
4305
+ * @param ids The unique ids array.
4306
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4307
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4308
+ */
4309
+ abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4310
+ /**
4311
+ * Queries multiple records from the table given their unique id.
4312
+ * @param ids The unique ids array.
4313
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4314
+ */
4315
+ abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4316
+ /**
4317
+ * Queries a single record from the table by the id in the object.
4318
+ * @param object Object containing the id of the record.
4319
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4320
+ * @returns The persisted record for the given id or null if the record could not be found.
4321
+ */
4322
+ abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
4323
+ /**
4324
+ * Queries a single record from the table by the id in the object.
4325
+ * @param object Object containing the id of the record.
4326
+ * @returns The persisted record for the given id or null if the record could not be found.
4327
+ */
4328
+ abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4329
+ /**
4330
+ * Queries multiple records from the table by the ids in the objects.
4331
+ * @param objects Array of objects containing the ids of the records.
4332
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4333
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4334
+ */
4335
+ abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4336
+ /**
4337
+ * Queries multiple records from the table by the ids in the objects.
4338
+ * @param objects Array of objects containing the ids of the records.
4339
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4340
+ */
4341
+ abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3216
4342
  /**
3217
4343
  * Partially update a single record.
3218
4344
  * @param object An object with its id and the columns to be updated.
3219
- * @returns The full persisted record.
4345
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4346
+ * @returns The full persisted record, null if the record could not be found.
4347
+ */
4348
+ abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4349
+ /**
4350
+ * Partially update a single record.
4351
+ * @param object An object with its id and the columns to be updated.
4352
+ * @returns The full persisted record, null if the record could not be found.
3220
4353
  */
3221
- abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4354
+ abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3222
4355
  /**
3223
4356
  * Partially update a single record given its unique id.
3224
4357
  * @param id The unique id.
3225
4358
  * @param object The column names and their values that have to be updated.
3226
- * @returns The full persisted record.
4359
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4360
+ * @returns The full persisted record, null if the record could not be found.
4361
+ */
4362
+ abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4363
+ /**
4364
+ * Partially update a single record given its unique id.
4365
+ * @param id The unique id.
4366
+ * @param object The column names and their values that have to be updated.
4367
+ * @returns The full persisted record, null if the record could not be found.
3227
4368
  */
3228
- abstract update(id: string, object: Partial<EditableData<Data>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4369
+ abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3229
4370
  /**
3230
4371
  * Partially updates multiple records.
3231
4372
  * @param objects An array of objects with their ids and columns to be updated.
3232
- * @returns Array of the persisted records.
4373
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4374
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
4375
+ */
4376
+ abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4377
+ /**
4378
+ * Partially updates multiple records.
4379
+ * @param objects An array of objects with their ids and columns to be updated.
4380
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
4381
+ */
4382
+ abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4383
+ /**
4384
+ * Creates or updates a single record. If a record exists with the given id,
4385
+ * it will be update, otherwise a new record will be created.
4386
+ * @param object Object containing the column names with their values to be persisted in the table.
4387
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4388
+ * @returns The full persisted record.
3233
4389
  */
3234
- abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4390
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3235
4391
  /**
3236
4392
  * Creates or updates a single record. If a record exists with the given id,
3237
4393
  * it will be update, otherwise a new record will be created.
3238
4394
  * @param object Object containing the column names with their values to be persisted in the table.
3239
4395
  * @returns The full persisted record.
3240
4396
  */
3241
- abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4397
+ abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4398
+ /**
4399
+ * Creates or updates a single record. If a record exists with the given id,
4400
+ * it will be update, otherwise a new record will be created.
4401
+ * @param id A unique id.
4402
+ * @param object The column names and the values to be persisted.
4403
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4404
+ * @returns The full persisted record.
4405
+ */
4406
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3242
4407
  /**
3243
4408
  * Creates or updates a single record. If a record exists with the given id,
3244
4409
  * it will be update, otherwise a new record will be created.
@@ -3246,38 +4411,74 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3246
4411
  * @param object The column names and the values to be persisted.
3247
4412
  * @returns The full persisted record.
3248
4413
  */
3249
- abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4414
+ abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3250
4415
  /**
3251
4416
  * Creates or updates a single record. If a record exists with the given id,
3252
4417
  * it will be update, otherwise a new record will be created.
3253
4418
  * @param objects Array of objects with the column names and the values to be stored in the table.
4419
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3254
4420
  * @returns Array of the persisted records.
3255
4421
  */
3256
- abstract createOrUpdate(objects: Array<EditableData<Data> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4422
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4423
+ /**
4424
+ * Creates or updates a single record. If a record exists with the given id,
4425
+ * it will be update, otherwise a new record will be created.
4426
+ * @param objects Array of objects with the column names and the values to be stored in the table.
4427
+ * @returns Array of the persisted records.
4428
+ */
4429
+ abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3257
4430
  /**
3258
4431
  * Deletes a record given its unique id.
3259
- * @param id The unique id.
3260
- * @throws If the record could not be found or there was an error while performing the deletion.
4432
+ * @param object An object with a unique id.
4433
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4434
+ * @returns The deleted record, null if the record could not be found.
3261
4435
  */
3262
- abstract delete(id: string): Promise<void>;
4436
+ abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3263
4437
  /**
3264
4438
  * Deletes a record given its unique id.
3265
- * @param id An object with a unique id.
3266
- * @throws If the record could not be found or there was an error while performing the deletion.
4439
+ * @param object An object with a unique id.
4440
+ * @returns The deleted record, null if the record could not be found.
4441
+ */
4442
+ abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4443
+ /**
4444
+ * Deletes a record given a unique id.
4445
+ * @param id The unique id.
4446
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4447
+ * @returns The deleted record, null if the record could not be found.
4448
+ */
4449
+ abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4450
+ /**
4451
+ * Deletes a record given a unique id.
4452
+ * @param id The unique id.
4453
+ * @returns The deleted record, null if the record could not be found.
4454
+ */
4455
+ abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4456
+ /**
4457
+ * Deletes multiple records given an array of objects with ids.
4458
+ * @param objects An array of objects with unique ids.
4459
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4460
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4461
+ */
4462
+ abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4463
+ /**
4464
+ * Deletes multiple records given an array of objects with ids.
4465
+ * @param objects An array of objects with unique ids.
4466
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
3267
4467
  */
3268
- abstract delete(id: Identifiable): Promise<void>;
4468
+ abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3269
4469
  /**
3270
- * Deletes a record given a list of unique ids.
3271
- * @param ids The array of unique ids.
3272
- * @throws If the record could not be found or there was an error while performing the deletion.
4470
+ * Deletes multiple records given an array of unique ids.
4471
+ * @param objects An array of ids.
4472
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4473
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
3273
4474
  */
3274
- abstract delete(ids: string[]): Promise<void>;
4475
+ abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
3275
4476
  /**
3276
- * Deletes a record given a list of unique ids.
3277
- * @param ids An array of objects with unique ids.
3278
- * @throws If the record could not be found or there was an error while performing the deletion.
4477
+ * Deletes multiple records given an array of unique ids.
4478
+ * @param objects An array of ids.
4479
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
3279
4480
  */
3280
- abstract delete(ids: Identifiable[]): Promise<void>;
4481
+ abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3281
4482
  /**
3282
4483
  * Search for records in the table.
3283
4484
  * @param query The query to search for.
@@ -3285,35 +4486,123 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3285
4486
  * @returns The found records.
3286
4487
  */
3287
4488
  abstract search(query: string, options?: {
3288
- fuzziness?: number;
3289
- }): Promise<SelectedPick<Record, ['*']>[]>;
4489
+ fuzziness?: FuzzinessExpression;
4490
+ prefix?: PrefixExpression;
4491
+ highlight?: HighlightExpression;
4492
+ filter?: Filter<Record>;
4493
+ boosters?: Boosters<Record>[];
4494
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3290
4495
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3291
4496
  }
3292
- declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
4497
+ declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
3293
4498
  #private;
3294
- db: SchemaPluginResult<any>;
3295
4499
  constructor(options: {
3296
4500
  table: string;
3297
4501
  db: SchemaPluginResult<any>;
3298
4502
  pluginOptions: XataPluginOptions;
4503
+ schemaTables?: Table[];
3299
4504
  });
3300
- create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3301
- create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3302
- create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3303
- read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
3304
- update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3305
- update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3306
- update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3307
- createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3308
- createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3309
- createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3310
- delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
4505
+ create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4506
+ create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4507
+ create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4508
+ create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4509
+ create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4510
+ create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4511
+ read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
4512
+ read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4513
+ read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4514
+ read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4515
+ read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
4516
+ read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4517
+ read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4518
+ read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4519
+ update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4520
+ update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4521
+ update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4522
+ update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4523
+ update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4524
+ update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4525
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4526
+ createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4527
+ createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4528
+ createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4529
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4530
+ createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4531
+ delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4532
+ delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4533
+ delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4534
+ delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4535
+ delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4536
+ delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4537
+ delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4538
+ delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3311
4539
  search(query: string, options?: {
3312
- fuzziness?: number;
3313
- }): Promise<SelectedPick<Record, ['*']>[]>;
4540
+ fuzziness?: FuzzinessExpression;
4541
+ prefix?: PrefixExpression;
4542
+ highlight?: HighlightExpression;
4543
+ filter?: Filter<Record>;
4544
+ boosters?: Boosters<Record>[];
4545
+ }): Promise<any>;
3314
4546
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3315
4547
  }
3316
4548
 
4549
+ declare type BaseSchema = {
4550
+ name: string;
4551
+ columns: readonly ({
4552
+ name: string;
4553
+ type: Column['type'];
4554
+ } | {
4555
+ name: string;
4556
+ type: 'link';
4557
+ link: {
4558
+ table: string;
4559
+ };
4560
+ } | {
4561
+ name: string;
4562
+ type: 'object';
4563
+ columns: {
4564
+ name: string;
4565
+ type: string;
4566
+ }[];
4567
+ })[];
4568
+ };
4569
+ declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
4570
+ name: string;
4571
+ columns: readonly unknown[];
4572
+ } ? {
4573
+ [K in T[number]['name']]: TableType<T[number], K>;
4574
+ } : never : never;
4575
+ declare type TableType<Tables, TableName> = Tables & {
4576
+ name: TableName;
4577
+ } extends infer Table ? Table extends {
4578
+ name: string;
4579
+ columns: infer Columns;
4580
+ } ? Columns extends readonly unknown[] ? Columns[number] extends {
4581
+ name: string;
4582
+ type: string;
4583
+ } ? Identifiable & {
4584
+ [K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
4585
+ } : never : never : never : never;
4586
+ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
4587
+ name: PropertyName;
4588
+ } extends infer Property ? Property extends {
4589
+ name: string;
4590
+ type: infer Type;
4591
+ link?: {
4592
+ table: infer LinkedTable;
4593
+ };
4594
+ columns?: infer ObjectColumns;
4595
+ } ? (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 {
4596
+ name: string;
4597
+ type: string;
4598
+ } ? {
4599
+ [K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
4600
+ } : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
4601
+
4602
+ /**
4603
+ * Operator to restrict results to only values that are greater than the given value.
4604
+ */
4605
+ declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3317
4606
  /**
3318
4607
  * Operator to restrict results to only values that are greater than the given value.
3319
4608
  */
@@ -3321,15 +4610,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
3321
4610
  /**
3322
4611
  * Operator to restrict results to only values that are greater than or equal to the given value.
3323
4612
  */
3324
- declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4613
+ declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4614
+ /**
4615
+ * Operator to restrict results to only values that are greater than or equal to the given value.
4616
+ */
4617
+ declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3325
4618
  /**
3326
4619
  * Operator to restrict results to only values that are greater than or equal to the given value.
3327
4620
  */
3328
4621
  declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4622
+ /**
4623
+ * Operator to restrict results to only values that are greater than or equal to the given value.
4624
+ */
4625
+ declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4626
+ /**
4627
+ * Operator to restrict results to only values that are lower than the given value.
4628
+ */
4629
+ declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3329
4630
  /**
3330
4631
  * Operator to restrict results to only values that are lower than the given value.
3331
4632
  */
3332
4633
  declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4634
+ /**
4635
+ * Operator to restrict results to only values that are lower than or equal to the given value.
4636
+ */
4637
+ declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4638
+ /**
4639
+ * Operator to restrict results to only values that are lower than or equal to the given value.
4640
+ */
4641
+ declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3333
4642
  /**
3334
4643
  * Operator to restrict results to only values that are lower than or equal to the given value.
3335
4644
  */
@@ -3362,6 +4671,10 @@ declare const pattern: (value: string) => StringTypeFilter;
3362
4671
  * Operator to restrict results to only values that are equal to the given value.
3363
4672
  */
3364
4673
  declare const is: <T>(value: T) => PropertyFilter<T>;
4674
+ /**
4675
+ * Operator to restrict results to only values that are equal to the given value.
4676
+ */
4677
+ declare const equals: <T>(value: T) => PropertyFilter<T>;
3365
4678
  /**
3366
4679
  * Operator to restrict results to only values that are not equal to the given value.
3367
4680
  */
@@ -3390,45 +4703,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3390
4703
  declare type SchemaDefinition = {
3391
4704
  table: string;
3392
4705
  };
3393
- declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
4706
+ declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
3394
4707
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
3395
- } & {
3396
- [key: string]: Repository<XataRecord$1>;
3397
4708
  };
3398
- declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
4709
+ declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3399
4710
  #private;
3400
- private tableNames?;
3401
- constructor(tableNames?: string[] | undefined);
4711
+ constructor(schemaTables?: Schemas.Table[]);
3402
4712
  build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3403
4713
  }
3404
4714
 
3405
- declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3406
- fuzziness?: number;
3407
- tables?: Tables[];
3408
- };
3409
- declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3410
- all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3411
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
3412
- table: Model;
3413
- record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3414
- };
3415
- }>[]>;
3416
- byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3417
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3418
- }>;
3419
- };
3420
- declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3421
- #private;
3422
- private db;
3423
- constructor(db: SchemaPluginResult<Schemas>);
3424
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3425
- }
3426
- declare type SearchXataRecord = XataRecord & {
3427
- xata: {
3428
- table: string;
3429
- };
3430
- };
3431
-
3432
4715
  declare type BranchStrategyValue = string | undefined | null;
3433
4716
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3434
4717
  declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
@@ -3440,20 +4723,35 @@ declare type BaseClientOptions = {
3440
4723
  databaseURL?: string;
3441
4724
  branch?: BranchStrategyOption;
3442
4725
  cache?: CacheImpl;
4726
+ trace?: TraceFunction;
3443
4727
  };
3444
4728
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3445
4729
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3446
- new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, tables?: string[]): Omit<{
4730
+ new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
3447
4731
  db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
3448
4732
  search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
3449
4733
  }, keyof Plugins> & {
3450
4734
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
4735
+ } & {
4736
+ getConfig(): Promise<{
4737
+ databaseURL: string;
4738
+ branch: string;
4739
+ }>;
3451
4740
  };
3452
4741
  }
3453
4742
  declare const BaseClient_base: ClientConstructor<{}>;
3454
4743
  declare class BaseClient extends BaseClient_base<Record<string, any>> {
3455
4744
  }
3456
4745
 
4746
+ declare class Serializer {
4747
+ classes: Record<string, any>;
4748
+ add(clazz: any): void;
4749
+ toJSON<T>(data: T): string;
4750
+ fromJSON<T>(json: string): T;
4751
+ }
4752
+ declare const serialize: <T>(data: T) => string;
4753
+ declare const deserialize: <T>(json: string) => T;
4754
+
3457
4755
  declare type BranchResolutionOptions = {
3458
4756
  databaseURL?: string;
3459
4757
  apiKey?: string;
@@ -3465,9 +4763,89 @@ declare function getDatabaseURL(): string | undefined;
3465
4763
 
3466
4764
  declare function getAPIKey(): string | undefined;
3467
4765
 
4766
+ interface Body {
4767
+ arrayBuffer(): Promise<ArrayBuffer>;
4768
+ blob(): Promise<Blob>;
4769
+ formData(): Promise<FormData>;
4770
+ json(): Promise<any>;
4771
+ text(): Promise<string>;
4772
+ }
4773
+ interface Blob {
4774
+ readonly size: number;
4775
+ readonly type: string;
4776
+ arrayBuffer(): Promise<ArrayBuffer>;
4777
+ slice(start?: number, end?: number, contentType?: string): Blob;
4778
+ text(): Promise<string>;
4779
+ }
4780
+ /** Provides information about files and allows JavaScript in a web page to access their content. */
4781
+ interface File extends Blob {
4782
+ readonly lastModified: number;
4783
+ readonly name: string;
4784
+ readonly webkitRelativePath: string;
4785
+ }
4786
+ declare type FormDataEntryValue = File | string;
4787
+ /** 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". */
4788
+ interface FormData {
4789
+ append(name: string, value: string | Blob, fileName?: string): void;
4790
+ delete(name: string): void;
4791
+ get(name: string): FormDataEntryValue | null;
4792
+ getAll(name: string): FormDataEntryValue[];
4793
+ has(name: string): boolean;
4794
+ set(name: string, value: string | Blob, fileName?: string): void;
4795
+ forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
4796
+ }
4797
+ /** 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. */
4798
+ interface Headers {
4799
+ append(name: string, value: string): void;
4800
+ delete(name: string): void;
4801
+ get(name: string): string | null;
4802
+ has(name: string): boolean;
4803
+ set(name: string, value: string): void;
4804
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
4805
+ }
4806
+ interface Request extends Body {
4807
+ /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
4808
+ readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
4809
+ /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. */
4810
+ readonly credentials: 'include' | 'omit' | 'same-origin';
4811
+ /** Returns the kind of resource requested by request, e.g., "document" or "script". */
4812
+ readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
4813
+ /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header. */
4814
+ readonly headers: Headers;
4815
+ /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */
4816
+ readonly integrity: string;
4817
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
4818
+ readonly keepalive: boolean;
4819
+ /** Returns request's HTTP method, which is "GET" by default. */
4820
+ readonly method: string;
4821
+ /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. */
4822
+ readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
4823
+ /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. */
4824
+ readonly redirect: 'error' | 'follow' | 'manual';
4825
+ /** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made. */
4826
+ readonly referrer: string;
4827
+ /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
4828
+ readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
4829
+ /** Returns the URL of request as a string. */
4830
+ readonly url: string;
4831
+ clone(): Request;
4832
+ }
4833
+
4834
+ declare type XataWorkerContext<XataClient> = {
4835
+ xata: XataClient;
4836
+ request: Request;
4837
+ env: Record<string, string | undefined>;
4838
+ };
4839
+ declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
4840
+ declare type WorkerRunnerConfig = {
4841
+ workspace: string;
4842
+ worker: string;
4843
+ };
4844
+ declare function buildWorkerRunner<XataClient>(config: WorkerRunnerConfig): <WorkerFunction extends (ctx: XataWorkerContext<XataClient>, ...args: any[]) => any>(name: string, _worker: WorkerFunction) => (...args: RemoveFirst<Parameters<WorkerFunction>>) => Promise<Awaited<ReturnType<WorkerFunction>>>;
4845
+
3468
4846
  declare class XataError extends Error {
3469
4847
  readonly status: number;
3470
4848
  constructor(message: string, status: number);
3471
4849
  }
3472
4850
 
3473
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
4851
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditResponse, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, 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, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, 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, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListMigrationRequestsError, ListMigrationRequestsPathParams, ListMigrationRequestsRequestBody, ListMigrationRequestsResponse, ListMigrationRequestsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PatchDatabaseMetadataError, PatchDatabaseMetadataPathParams, PatchDatabaseMetadataRequestBody, PatchDatabaseMetadataVariables, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, Serializer, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaResponse, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, 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, applyBranchSchemaEdit, 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, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequests, listMigrationRequestsCommits, lt, lte, mergeMigrationRequest, notExists, operationsByTag, patchDatabaseMetadata, pattern, previewBranchSchemaEdit, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, updateBranchMetadata, updateBranchSchema, updateColumn, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };