@xata.io/client 0.0.0-alpha.vf4b92f1 → 0.0.0-alpha.vf683143

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,22 +130,30 @@ 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
+ createdAt: DateTime;
139
+ numberOfBranches: number;
140
+ ui?: {
141
+ color?: string;
142
+ };
143
+ };
125
144
  declare type ListDatabasesResponse = {
126
- databases?: {
127
- name: string;
128
- displayName: string;
129
- createdAt: DateTime;
130
- numberOfBranches: number;
131
- ui?: {
132
- color?: string;
133
- };
134
- }[];
145
+ databases?: DatabaseMetadata[];
135
146
  };
136
147
  declare type ListBranchesResponse = {
137
148
  databaseName: string;
138
- displayName: string;
139
149
  branches: Branch[];
140
150
  };
151
+ declare type ListGitBranchesResponse = {
152
+ mapping: {
153
+ gitBranch: string;
154
+ xataBranch: string;
155
+ }[];
156
+ };
141
157
  declare type Branch = {
142
158
  name: string;
143
159
  createdAt: DateTime;
@@ -175,21 +191,39 @@ declare type Schema = {
175
191
  tables: Table[];
176
192
  tablesOrder?: string[];
177
193
  };
194
+ /**
195
+ * @x-internal true
196
+ */
197
+ declare type SchemaEditScript = {
198
+ sourceMigrationID?: string;
199
+ targetMigrationID?: string;
200
+ tables: TableEdit[];
201
+ };
178
202
  declare type Table = {
179
203
  id?: string;
180
204
  name: TableName;
181
205
  columns: Column[];
182
206
  revLinks?: RevLink[];
183
207
  };
208
+ /**
209
+ * @x-internal true
210
+ */
211
+ declare type TableEdit = {
212
+ oldName?: string;
213
+ newName?: string;
214
+ columns?: MigrationColumnOp[];
215
+ };
184
216
  /**
185
217
  * @x-go-type xata.Column
186
218
  */
187
219
  declare type Column = {
188
220
  name: string;
189
- type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
221
+ type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
190
222
  link?: {
191
223
  table: string;
192
224
  };
225
+ notNull?: boolean;
226
+ unique?: boolean;
193
227
  columns?: Column[];
194
228
  };
195
229
  declare type RevLink = {
@@ -256,12 +290,135 @@ declare type ColumnMigration = {
256
290
  old: Column;
257
291
  ['new']: Column;
258
292
  };
293
+ /**
294
+ * @x-internal true
295
+ */
296
+ declare type Commit = {
297
+ meta?: {
298
+ title?: string;
299
+ message?: string;
300
+ id: string;
301
+ parentID?: string;
302
+ mergeParentID?: string;
303
+ status: string;
304
+ createdAt: DateTime;
305
+ modifiedAt?: DateTime;
306
+ };
307
+ operations: MigrationOp[];
308
+ };
309
+ /**
310
+ * Branch schema migration.
311
+ *
312
+ * @x-internal true
313
+ */
314
+ declare type Migration = {
315
+ parentID?: string;
316
+ operations: MigrationOp[];
317
+ };
318
+ /**
319
+ * Branch schema migration operations.
320
+ *
321
+ * @x-internal true
322
+ */
323
+ declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
324
+ /**
325
+ * @x-internal true
326
+ */
327
+ declare type MigrationTableOp = {
328
+ addTable: TableOpAdd;
329
+ } | {
330
+ removeTable: TableOpRemove;
331
+ } | {
332
+ renameTable: TableOpRename;
333
+ };
334
+ /**
335
+ * @x-internal true
336
+ */
337
+ declare type MigrationColumnOp = {
338
+ addColumn: ColumnOpAdd;
339
+ } | {
340
+ removeColumn: ColumnOpRemove;
341
+ } | {
342
+ renameColumn: ColumnOpRename;
343
+ };
344
+ /**
345
+ * @x-internal true
346
+ */
347
+ declare type TableOpAdd = {
348
+ table: string;
349
+ };
350
+ /**
351
+ * @x-internal true
352
+ */
353
+ declare type TableOpRemove = {
354
+ table: string;
355
+ };
356
+ /**
357
+ * @x-internal true
358
+ */
359
+ declare type TableOpRename = {
360
+ oldName: string;
361
+ newName: string;
362
+ };
363
+ /**
364
+ * @x-internal true
365
+ */
366
+ declare type ColumnOpAdd = {
367
+ table?: string;
368
+ column: Column;
369
+ };
370
+ /**
371
+ * @x-internal true
372
+ */
373
+ declare type ColumnOpRemove = {
374
+ table?: string;
375
+ column: string;
376
+ };
377
+ /**
378
+ * @x-internal true
379
+ */
380
+ declare type ColumnOpRename = {
381
+ table?: string;
382
+ oldName: string;
383
+ newName: string;
384
+ };
385
+ declare type MigrationRequest = {
386
+ number: number;
387
+ createdAt: DateTime;
388
+ modifiedAt?: DateTime;
389
+ closedAt?: DateTime;
390
+ mergedAt?: DateTime;
391
+ status: 'open' | 'closed' | 'merging' | 'merged';
392
+ title: string;
393
+ body: string;
394
+ source: string;
395
+ target: string;
396
+ };
259
397
  declare type SortExpression = string[] | {
260
398
  [key: string]: SortOrder;
261
399
  } | {
262
400
  [key: string]: SortOrder;
263
401
  }[];
264
402
  declare type SortOrder = 'asc' | 'desc';
403
+ /**
404
+ * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
405
+ * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
406
+ * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
407
+ * to allow two typos in a word.
408
+ *
409
+ * @default 1
410
+ * @maximum 2
411
+ * @minimum 0
412
+ */
413
+ declare type FuzzinessExpression = number;
414
+ /**
415
+ * 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.
416
+ */
417
+ declare type PrefixExpression = 'phrase' | 'disabled';
418
+ /**
419
+ * The target expression is used to filter the search results by the target columns.
420
+ */
421
+ declare type TargetExpression = string[];
265
422
  /**
266
423
  * @minProperties 1
267
424
  */
@@ -275,6 +432,64 @@ declare type FilterExpression = {
275
432
  } & {
276
433
  [key: string]: FilterColumn;
277
434
  };
435
+ /**
436
+ * The full summary expression; the entire expression is a map of names to requests.
437
+ *
438
+ * @x-go-type xbquery.SummaryList
439
+ */
440
+ declare type SummaryExpressionList = {
441
+ [key: string]: SummaryExpression;
442
+ };
443
+ /**
444
+ * A single summary expression. The key represents an aggregation function; the value a column to aggregate.
445
+ *
446
+ * You may only call one aggregation per key.
447
+ *
448
+ * @x-go-type xbquery.Summary
449
+ */
450
+ declare type SummaryExpression = Record<string, any>;
451
+ declare type HighlightExpression = {
452
+ enabled?: boolean;
453
+ encodeHTML?: boolean;
454
+ };
455
+ /**
456
+ * Booster Expression
457
+ *
458
+ * @x-go-type xata.BoosterExpression
459
+ */
460
+ declare type BoosterExpression = {
461
+ valueBooster?: ValueBooster$1;
462
+ } | {
463
+ numericBooster?: NumericBooster$1;
464
+ } | {
465
+ dateBooster?: DateBooster$1;
466
+ };
467
+ /**
468
+ * Boost records with a particular value for a column.
469
+ */
470
+ declare type ValueBooster$1 = {
471
+ column: string;
472
+ value: string | number | boolean;
473
+ factor: number;
474
+ };
475
+ /**
476
+ * Boost records based on the value of a numeric column.
477
+ */
478
+ declare type NumericBooster$1 = {
479
+ column: string;
480
+ factor: number;
481
+ };
482
+ /**
483
+ * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
484
+ * 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
485
+ * 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.
486
+ */
487
+ declare type DateBooster$1 = {
488
+ column: string;
489
+ origin?: string;
490
+ scale: string;
491
+ decay: number;
492
+ };
278
493
  declare type FilterList = FilterExpression | FilterExpression[];
279
494
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
280
495
  /**
@@ -331,7 +546,24 @@ declare type PageConfig = {
331
546
  size?: number;
332
547
  offset?: number;
333
548
  };
334
- declare type ColumnsFilter = string[];
549
+ declare type ColumnsProjection = string[];
550
+ /**
551
+ * Xata Table Record Metadata
552
+ */
553
+ declare type RecordMeta = {
554
+ id: RecordID;
555
+ xata: {
556
+ version: number;
557
+ table?: string;
558
+ highlight?: {
559
+ [key: string]: string[] | {
560
+ [key: string]: any;
561
+ };
562
+ };
563
+ score?: number;
564
+ warnings?: string[];
565
+ };
566
+ };
335
567
  /**
336
568
  * @pattern [a-zA-Z0-9_-~:]+
337
569
  */
@@ -353,16 +585,9 @@ declare type RecordsMetadata = {
353
585
  };
354
586
  };
355
587
  /**
356
- * Xata Table Record
588
+ * Xata Table Record Metadata
357
589
  */
358
- declare type XataRecord$1 = {
359
- id: RecordID;
360
- xata: {
361
- version: number;
362
- table?: string;
363
- warnings?: string[];
364
- };
365
- } & {
590
+ declare type XataRecord$1 = RecordMeta & {
366
591
  [key: string]: any;
367
592
  };
368
593
 
@@ -380,14 +605,18 @@ type schemas_InviteID = InviteID;
380
605
  type schemas_WorkspaceInvite = WorkspaceInvite;
381
606
  type schemas_WorkspaceMembers = WorkspaceMembers;
382
607
  type schemas_InviteKey = InviteKey;
608
+ type schemas_DatabaseMetadata = DatabaseMetadata;
383
609
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
384
610
  type schemas_ListBranchesResponse = ListBranchesResponse;
611
+ type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
385
612
  type schemas_Branch = Branch;
386
613
  type schemas_BranchMetadata = BranchMetadata;
387
614
  type schemas_DBBranch = DBBranch;
388
615
  type schemas_StartedFromMetadata = StartedFromMetadata;
389
616
  type schemas_Schema = Schema;
617
+ type schemas_SchemaEditScript = SchemaEditScript;
390
618
  type schemas_Table = Table;
619
+ type schemas_TableEdit = TableEdit;
391
620
  type schemas_Column = Column;
392
621
  type schemas_RevLink = RevLink;
393
622
  type schemas_BranchName = BranchName;
@@ -400,9 +629,28 @@ type schemas_MetricsLatency = MetricsLatency;
400
629
  type schemas_BranchMigration = BranchMigration;
401
630
  type schemas_TableMigration = TableMigration;
402
631
  type schemas_ColumnMigration = ColumnMigration;
632
+ type schemas_Commit = Commit;
633
+ type schemas_Migration = Migration;
634
+ type schemas_MigrationOp = MigrationOp;
635
+ type schemas_MigrationTableOp = MigrationTableOp;
636
+ type schemas_MigrationColumnOp = MigrationColumnOp;
637
+ type schemas_TableOpAdd = TableOpAdd;
638
+ type schemas_TableOpRemove = TableOpRemove;
639
+ type schemas_TableOpRename = TableOpRename;
640
+ type schemas_ColumnOpAdd = ColumnOpAdd;
641
+ type schemas_ColumnOpRemove = ColumnOpRemove;
642
+ type schemas_ColumnOpRename = ColumnOpRename;
643
+ type schemas_MigrationRequest = MigrationRequest;
403
644
  type schemas_SortExpression = SortExpression;
404
645
  type schemas_SortOrder = SortOrder;
646
+ type schemas_FuzzinessExpression = FuzzinessExpression;
647
+ type schemas_PrefixExpression = PrefixExpression;
648
+ type schemas_TargetExpression = TargetExpression;
405
649
  type schemas_FilterExpression = FilterExpression;
650
+ type schemas_SummaryExpressionList = SummaryExpressionList;
651
+ type schemas_SummaryExpression = SummaryExpression;
652
+ type schemas_HighlightExpression = HighlightExpression;
653
+ type schemas_BoosterExpression = BoosterExpression;
406
654
  type schemas_FilterList = FilterList;
407
655
  type schemas_FilterColumn = FilterColumn;
408
656
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -412,7 +660,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
412
660
  type schemas_FilterRangeValue = FilterRangeValue;
413
661
  type schemas_FilterValue = FilterValue;
414
662
  type schemas_PageConfig = PageConfig;
415
- type schemas_ColumnsFilter = ColumnsFilter;
663
+ type schemas_ColumnsProjection = ColumnsProjection;
664
+ type schemas_RecordMeta = RecordMeta;
416
665
  type schemas_RecordID = RecordID;
417
666
  type schemas_TableRename = TableRename;
418
667
  type schemas_RecordsMetadata = RecordsMetadata;
@@ -432,14 +681,18 @@ declare namespace schemas {
432
681
  schemas_WorkspaceInvite as WorkspaceInvite,
433
682
  schemas_WorkspaceMembers as WorkspaceMembers,
434
683
  schemas_InviteKey as InviteKey,
684
+ schemas_DatabaseMetadata as DatabaseMetadata,
435
685
  schemas_ListDatabasesResponse as ListDatabasesResponse,
436
686
  schemas_ListBranchesResponse as ListBranchesResponse,
687
+ schemas_ListGitBranchesResponse as ListGitBranchesResponse,
437
688
  schemas_Branch as Branch,
438
689
  schemas_BranchMetadata as BranchMetadata,
439
690
  schemas_DBBranch as DBBranch,
440
691
  schemas_StartedFromMetadata as StartedFromMetadata,
441
692
  schemas_Schema as Schema,
693
+ schemas_SchemaEditScript as SchemaEditScript,
442
694
  schemas_Table as Table,
695
+ schemas_TableEdit as TableEdit,
443
696
  schemas_Column as Column,
444
697
  schemas_RevLink as RevLink,
445
698
  schemas_BranchName as BranchName,
@@ -452,9 +705,31 @@ declare namespace schemas {
452
705
  schemas_BranchMigration as BranchMigration,
453
706
  schemas_TableMigration as TableMigration,
454
707
  schemas_ColumnMigration as ColumnMigration,
708
+ schemas_Commit as Commit,
709
+ schemas_Migration as Migration,
710
+ schemas_MigrationOp as MigrationOp,
711
+ schemas_MigrationTableOp as MigrationTableOp,
712
+ schemas_MigrationColumnOp as MigrationColumnOp,
713
+ schemas_TableOpAdd as TableOpAdd,
714
+ schemas_TableOpRemove as TableOpRemove,
715
+ schemas_TableOpRename as TableOpRename,
716
+ schemas_ColumnOpAdd as ColumnOpAdd,
717
+ schemas_ColumnOpRemove as ColumnOpRemove,
718
+ schemas_ColumnOpRename as ColumnOpRename,
719
+ schemas_MigrationRequest as MigrationRequest,
455
720
  schemas_SortExpression as SortExpression,
456
721
  schemas_SortOrder as SortOrder,
722
+ schemas_FuzzinessExpression as FuzzinessExpression,
723
+ schemas_PrefixExpression as PrefixExpression,
724
+ schemas_TargetExpression as TargetExpression,
457
725
  schemas_FilterExpression as FilterExpression,
726
+ schemas_SummaryExpressionList as SummaryExpressionList,
727
+ schemas_SummaryExpression as SummaryExpression,
728
+ schemas_HighlightExpression as HighlightExpression,
729
+ schemas_BoosterExpression as BoosterExpression,
730
+ ValueBooster$1 as ValueBooster,
731
+ NumericBooster$1 as NumericBooster,
732
+ DateBooster$1 as DateBooster,
458
733
  schemas_FilterList as FilterList,
459
734
  schemas_FilterColumn as FilterColumn,
460
735
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -464,7 +739,8 @@ declare namespace schemas {
464
739
  schemas_FilterRangeValue as FilterRangeValue,
465
740
  schemas_FilterValue as FilterValue,
466
741
  schemas_PageConfig as PageConfig,
467
- schemas_ColumnsFilter as ColumnsFilter,
742
+ schemas_ColumnsProjection as ColumnsProjection,
743
+ schemas_RecordMeta as RecordMeta,
468
744
  schemas_RecordID as RecordID,
469
745
  schemas_TableRename as TableRename,
470
746
  schemas_RecordsMetadata as RecordsMetadata,
@@ -499,11 +775,22 @@ declare type BulkError = {
499
775
  status?: number;
500
776
  }[];
501
777
  };
778
+ declare type BulkInsertResponse = {
779
+ recordIDs: string[];
780
+ } | {
781
+ records: XataRecord$1[];
782
+ };
502
783
  declare type BranchMigrationPlan = {
503
784
  version: number;
504
785
  migration: BranchMigration;
505
786
  };
506
- declare type RecordUpdateResponse = {
787
+ declare type RecordResponse = XataRecord$1;
788
+ declare type SchemaCompareResponse = {
789
+ source: Schema;
790
+ target: Schema;
791
+ edits: SchemaEditScript;
792
+ };
793
+ declare type RecordUpdateResponse = XataRecord$1 | {
507
794
  id: string;
508
795
  xata: {
509
796
  version: number;
@@ -513,6 +800,9 @@ declare type QueryResponse = {
513
800
  records: XataRecord$1[];
514
801
  meta: RecordsMetadata;
515
802
  };
803
+ declare type SummarizeResponse = {
804
+ summary: Record<string, any>[];
805
+ };
516
806
  declare type SearchResponse = {
517
807
  records: XataRecord$1[];
518
808
  };
@@ -527,9 +817,13 @@ type responses_SimpleError = SimpleError;
527
817
  type responses_BadRequestError = BadRequestError;
528
818
  type responses_AuthError = AuthError;
529
819
  type responses_BulkError = BulkError;
820
+ type responses_BulkInsertResponse = BulkInsertResponse;
530
821
  type responses_BranchMigrationPlan = BranchMigrationPlan;
822
+ type responses_RecordResponse = RecordResponse;
823
+ type responses_SchemaCompareResponse = SchemaCompareResponse;
531
824
  type responses_RecordUpdateResponse = RecordUpdateResponse;
532
825
  type responses_QueryResponse = QueryResponse;
826
+ type responses_SummarizeResponse = SummarizeResponse;
533
827
  type responses_SearchResponse = SearchResponse;
534
828
  type responses_MigrationIdResponse = MigrationIdResponse;
535
829
  declare namespace responses {
@@ -538,9 +832,13 @@ declare namespace responses {
538
832
  responses_BadRequestError as BadRequestError,
539
833
  responses_AuthError as AuthError,
540
834
  responses_BulkError as BulkError,
835
+ responses_BulkInsertResponse as BulkInsertResponse,
541
836
  responses_BranchMigrationPlan as BranchMigrationPlan,
837
+ responses_RecordResponse as RecordResponse,
838
+ responses_SchemaCompareResponse as SchemaCompareResponse,
542
839
  responses_RecordUpdateResponse as RecordUpdateResponse,
543
840
  responses_QueryResponse as QueryResponse,
841
+ responses_SummarizeResponse as SummarizeResponse,
544
842
  responses_SearchResponse as SearchResponse,
545
843
  responses_MigrationIdResponse as MigrationIdResponse,
546
844
  };
@@ -844,6 +1142,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
844
1142
  } | {
845
1143
  status: 404;
846
1144
  payload: SimpleError;
1145
+ } | {
1146
+ status: 409;
1147
+ payload: SimpleError;
847
1148
  }>;
848
1149
  declare type InviteWorkspaceMemberRequestBody = {
849
1150
  email: string;
@@ -857,6 +1158,34 @@ declare type InviteWorkspaceMemberVariables = {
857
1158
  * Invite some user to join the workspace with the given role
858
1159
  */
859
1160
  declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
1161
+ declare type UpdateWorkspaceMemberInvitePathParams = {
1162
+ workspaceId: WorkspaceID;
1163
+ inviteId: InviteID;
1164
+ };
1165
+ declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
1166
+ status: 400;
1167
+ payload: BadRequestError;
1168
+ } | {
1169
+ status: 401;
1170
+ payload: AuthError;
1171
+ } | {
1172
+ status: 404;
1173
+ payload: SimpleError;
1174
+ } | {
1175
+ status: 422;
1176
+ payload: SimpleError;
1177
+ }>;
1178
+ declare type UpdateWorkspaceMemberInviteRequestBody = {
1179
+ role: Role;
1180
+ };
1181
+ declare type UpdateWorkspaceMemberInviteVariables = {
1182
+ body: UpdateWorkspaceMemberInviteRequestBody;
1183
+ pathParams: UpdateWorkspaceMemberInvitePathParams;
1184
+ } & FetcherExtraProps;
1185
+ /**
1186
+ * 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.
1187
+ */
1188
+ declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
860
1189
  declare type CancelWorkspaceMemberInvitePathParams = {
861
1190
  workspaceId: WorkspaceID;
862
1191
  inviteId: InviteID;
@@ -974,7 +1303,6 @@ declare type CreateDatabaseResponse = {
974
1303
  branchName?: string;
975
1304
  };
976
1305
  declare type CreateDatabaseRequestBody = {
977
- displayName?: string;
978
1306
  branchName?: string;
979
1307
  ui?: {
980
1308
  color?: string;
@@ -1010,11 +1338,11 @@ declare type DeleteDatabaseVariables = {
1010
1338
  * Delete a database and all of its branches and tables permanently.
1011
1339
  */
1012
1340
  declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1013
- declare type GetBranchDetailsPathParams = {
1014
- dbBranchName: DBBranchName;
1341
+ declare type GetDatabaseMetadataPathParams = {
1342
+ dbName: DBName;
1015
1343
  workspace: string;
1016
1344
  };
1017
- declare type GetBranchDetailsError = ErrorWrapper<{
1345
+ declare type GetDatabaseMetadataError = ErrorWrapper<{
1018
1346
  status: 400;
1019
1347
  payload: BadRequestError;
1020
1348
  } | {
@@ -1024,18 +1352,18 @@ declare type GetBranchDetailsError = ErrorWrapper<{
1024
1352
  status: 404;
1025
1353
  payload: SimpleError;
1026
1354
  }>;
1027
- declare type GetBranchDetailsVariables = {
1028
- pathParams: GetBranchDetailsPathParams;
1355
+ declare type GetDatabaseMetadataVariables = {
1356
+ pathParams: GetDatabaseMetadataPathParams;
1029
1357
  } & FetcherExtraProps;
1030
- declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
1031
- declare type CreateBranchPathParams = {
1032
- dbBranchName: DBBranchName;
1358
+ /**
1359
+ * Retrieve metadata of the given database
1360
+ */
1361
+ declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
1362
+ declare type UpdateDatabaseMetadataPathParams = {
1363
+ dbName: DBName;
1033
1364
  workspace: string;
1034
1365
  };
1035
- declare type CreateBranchQueryParams = {
1036
- from?: string;
1037
- };
1038
- declare type CreateBranchError = ErrorWrapper<{
1366
+ declare type UpdateDatabaseMetadataError = ErrorWrapper<{
1039
1367
  status: 400;
1040
1368
  payload: BadRequestError;
1041
1369
  } | {
@@ -1045,109 +1373,653 @@ declare type CreateBranchError = ErrorWrapper<{
1045
1373
  status: 404;
1046
1374
  payload: SimpleError;
1047
1375
  }>;
1048
- declare type CreateBranchRequestBody = {
1049
- from?: string;
1050
- metadata?: BranchMetadata;
1376
+ declare type UpdateDatabaseMetadataRequestBody = {
1377
+ ui?: {
1378
+ color?: string;
1379
+ };
1051
1380
  };
1052
- declare type CreateBranchVariables = {
1053
- body?: CreateBranchRequestBody;
1054
- pathParams: CreateBranchPathParams;
1055
- queryParams?: CreateBranchQueryParams;
1381
+ declare type UpdateDatabaseMetadataVariables = {
1382
+ body?: UpdateDatabaseMetadataRequestBody;
1383
+ pathParams: UpdateDatabaseMetadataPathParams;
1056
1384
  } & FetcherExtraProps;
1057
- declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
1058
- declare type DeleteBranchPathParams = {
1059
- dbBranchName: DBBranchName;
1385
+ /**
1386
+ * Update the color of the selected database
1387
+ */
1388
+ declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
1389
+ declare type GetGitBranchesMappingPathParams = {
1390
+ dbName: DBName;
1060
1391
  workspace: string;
1061
1392
  };
1062
- declare type DeleteBranchError = ErrorWrapper<{
1393
+ declare type GetGitBranchesMappingError = ErrorWrapper<{
1063
1394
  status: 400;
1064
1395
  payload: BadRequestError;
1065
1396
  } | {
1066
1397
  status: 401;
1067
1398
  payload: AuthError;
1068
- } | {
1069
- status: 404;
1070
- payload: SimpleError;
1071
1399
  }>;
1072
- declare type DeleteBranchVariables = {
1073
- pathParams: DeleteBranchPathParams;
1400
+ declare type GetGitBranchesMappingVariables = {
1401
+ pathParams: GetGitBranchesMappingPathParams;
1074
1402
  } & FetcherExtraProps;
1075
1403
  /**
1076
- * Delete the branch in the database and all its resources
1404
+ * Lists all the git branches in the mapping, and their associated Xata branches.
1405
+ *
1406
+ * Example response:
1407
+ *
1408
+ * ```json
1409
+ * {
1410
+ * "mappings": [
1411
+ * {
1412
+ * "gitBranch": "main",
1413
+ * "xataBranch": "main"
1414
+ * },
1415
+ * {
1416
+ * "gitBranch": "gitBranch1",
1417
+ * "xataBranch": "xataBranch1"
1418
+ * }
1419
+ * {
1420
+ * "gitBranch": "xataBranch2",
1421
+ * "xataBranch": "xataBranch2"
1422
+ * }
1423
+ * ]
1424
+ * }
1425
+ * ```
1077
1426
  */
1078
- declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1079
- declare type UpdateBranchMetadataPathParams = {
1080
- dbBranchName: DBBranchName;
1427
+ declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
1428
+ declare type AddGitBranchesEntryPathParams = {
1429
+ dbName: DBName;
1081
1430
  workspace: string;
1082
1431
  };
1083
- declare type UpdateBranchMetadataError = ErrorWrapper<{
1432
+ declare type AddGitBranchesEntryError = ErrorWrapper<{
1084
1433
  status: 400;
1085
1434
  payload: BadRequestError;
1086
1435
  } | {
1087
1436
  status: 401;
1088
1437
  payload: AuthError;
1089
- } | {
1090
- status: 404;
1091
- payload: SimpleError;
1092
1438
  }>;
1093
- declare type UpdateBranchMetadataVariables = {
1094
- body?: BranchMetadata;
1095
- pathParams: UpdateBranchMetadataPathParams;
1439
+ declare type AddGitBranchesEntryResponse = {
1440
+ warning?: string;
1441
+ };
1442
+ declare type AddGitBranchesEntryRequestBody = {
1443
+ gitBranch: string;
1444
+ xataBranch: BranchName;
1445
+ };
1446
+ declare type AddGitBranchesEntryVariables = {
1447
+ body: AddGitBranchesEntryRequestBody;
1448
+ pathParams: AddGitBranchesEntryPathParams;
1096
1449
  } & FetcherExtraProps;
1097
1450
  /**
1098
- * Update the branch metadata
1451
+ * Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.
1452
+ *
1453
+ * If the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.
1454
+ *
1455
+ * Example request:
1456
+ *
1457
+ * ```json
1458
+ * // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
1459
+ * {
1460
+ * "gitBranch": "fix/bug123",
1461
+ * "xataBranch": "fix_bug"
1462
+ * }
1463
+ * ```
1099
1464
  */
1100
- declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1101
- declare type GetBranchMetadataPathParams = {
1102
- dbBranchName: DBBranchName;
1465
+ declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
1466
+ declare type RemoveGitBranchesEntryPathParams = {
1467
+ dbName: DBName;
1103
1468
  workspace: string;
1104
1469
  };
1105
- declare type GetBranchMetadataError = ErrorWrapper<{
1470
+ declare type RemoveGitBranchesEntryQueryParams = {
1471
+ gitBranch: string;
1472
+ };
1473
+ declare type RemoveGitBranchesEntryError = ErrorWrapper<{
1106
1474
  status: 400;
1107
1475
  payload: BadRequestError;
1108
1476
  } | {
1109
1477
  status: 401;
1110
1478
  payload: AuthError;
1111
- } | {
1112
- status: 404;
1113
- payload: SimpleError;
1114
1479
  }>;
1115
- declare type GetBranchMetadataVariables = {
1116
- pathParams: GetBranchMetadataPathParams;
1480
+ declare type RemoveGitBranchesEntryVariables = {
1481
+ pathParams: RemoveGitBranchesEntryPathParams;
1482
+ queryParams: RemoveGitBranchesEntryQueryParams;
1117
1483
  } & FetcherExtraProps;
1118
- declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
1119
- declare type GetBranchMigrationHistoryPathParams = {
1120
- dbBranchName: DBBranchName;
1484
+ /**
1485
+ * Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
1486
+ *
1487
+ * Example request:
1488
+ *
1489
+ * ```json
1490
+ * // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
1491
+ * ```
1492
+ */
1493
+ declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
1494
+ declare type ResolveBranchPathParams = {
1495
+ dbName: DBName;
1121
1496
  workspace: string;
1122
1497
  };
1123
- declare type GetBranchMigrationHistoryError = ErrorWrapper<{
1498
+ declare type ResolveBranchQueryParams = {
1499
+ gitBranch?: string;
1500
+ fallbackBranch?: string;
1501
+ };
1502
+ declare type ResolveBranchError = ErrorWrapper<{
1124
1503
  status: 400;
1125
1504
  payload: BadRequestError;
1126
1505
  } | {
1127
1506
  status: 401;
1128
1507
  payload: AuthError;
1129
- } | {
1130
- status: 404;
1131
- payload: SimpleError;
1132
1508
  }>;
1133
- declare type GetBranchMigrationHistoryResponse = {
1134
- startedFrom?: StartedFromMetadata;
1135
- migrations?: BranchMigration[];
1509
+ declare type ResolveBranchResponse = {
1510
+ branch: string;
1511
+ reason: {
1512
+ code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
1513
+ message: string;
1514
+ };
1136
1515
  };
1137
- declare type GetBranchMigrationHistoryRequestBody = {
1138
- limit?: number;
1139
- startFrom?: string;
1516
+ declare type ResolveBranchVariables = {
1517
+ pathParams: ResolveBranchPathParams;
1518
+ queryParams?: ResolveBranchQueryParams;
1519
+ } & FetcherExtraProps;
1520
+ /**
1521
+ * In order to resolve the database branch, the following algorithm is used:
1522
+ * * 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
1523
+ * * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
1524
+ * * else, if `fallbackBranch` is provided and a branch with that name exists, return it
1525
+ * * else, return the default branch of the DB (`main` or the first branch)
1526
+ *
1527
+ * Example call:
1528
+ *
1529
+ * ```json
1530
+ * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
1531
+ * ```
1532
+ *
1533
+ * Example response:
1534
+ *
1535
+ * ```json
1536
+ * {
1537
+ * "branch": "main",
1538
+ * "reason": {
1539
+ * "code": "DEFAULT_BRANCH",
1540
+ * "message": "Default branch for this database (main)"
1541
+ * }
1542
+ * }
1543
+ * ```
1544
+ */
1545
+ declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
1546
+ declare type ListMigrationRequestsPathParams = {
1547
+ dbName: DBName;
1548
+ workspace: string;
1549
+ };
1550
+ declare type ListMigrationRequestsError = ErrorWrapper<{
1551
+ status: 400;
1552
+ payload: BadRequestError;
1553
+ } | {
1554
+ status: 401;
1555
+ payload: AuthError;
1556
+ } | {
1557
+ status: 404;
1558
+ payload: SimpleError;
1559
+ }>;
1560
+ declare type ListMigrationRequestsResponse = {
1561
+ migrationRequests: MigrationRequest[];
1562
+ meta: RecordsMetadata;
1563
+ };
1564
+ declare type ListMigrationRequestsRequestBody = {
1565
+ filter?: FilterExpression;
1566
+ sort?: SortExpression;
1567
+ page?: PageConfig;
1568
+ columns?: ColumnsProjection;
1569
+ };
1570
+ declare type ListMigrationRequestsVariables = {
1571
+ body?: ListMigrationRequestsRequestBody;
1572
+ pathParams: ListMigrationRequestsPathParams;
1573
+ } & FetcherExtraProps;
1574
+ declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
1575
+ declare type CreateMigrationRequestPathParams = {
1576
+ dbName: DBName;
1577
+ workspace: string;
1578
+ };
1579
+ declare type CreateMigrationRequestError = ErrorWrapper<{
1580
+ status: 400;
1581
+ payload: BadRequestError;
1582
+ } | {
1583
+ status: 401;
1584
+ payload: AuthError;
1585
+ } | {
1586
+ status: 404;
1587
+ payload: SimpleError;
1588
+ }>;
1589
+ declare type CreateMigrationRequestResponse = {
1590
+ number: number;
1591
+ };
1592
+ declare type CreateMigrationRequestRequestBody = {
1593
+ source: string;
1594
+ target: string;
1595
+ title: string;
1596
+ body?: string;
1597
+ };
1598
+ declare type CreateMigrationRequestVariables = {
1599
+ body: CreateMigrationRequestRequestBody;
1600
+ pathParams: CreateMigrationRequestPathParams;
1601
+ } & FetcherExtraProps;
1602
+ declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
1603
+ declare type GetMigrationRequestPathParams = {
1604
+ dbName: DBName;
1605
+ mrNumber: number;
1606
+ workspace: string;
1607
+ };
1608
+ declare type GetMigrationRequestError = ErrorWrapper<{
1609
+ status: 400;
1610
+ payload: BadRequestError;
1611
+ } | {
1612
+ status: 401;
1613
+ payload: AuthError;
1614
+ } | {
1615
+ status: 404;
1616
+ payload: SimpleError;
1617
+ }>;
1618
+ declare type GetMigrationRequestVariables = {
1619
+ pathParams: GetMigrationRequestPathParams;
1620
+ } & FetcherExtraProps;
1621
+ declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
1622
+ declare type UpdateMigrationRequestPathParams = {
1623
+ dbName: DBName;
1624
+ mrNumber: number;
1625
+ workspace: string;
1626
+ };
1627
+ declare type UpdateMigrationRequestError = ErrorWrapper<{
1628
+ status: 400;
1629
+ payload: BadRequestError;
1630
+ } | {
1631
+ status: 401;
1632
+ payload: AuthError;
1633
+ } | {
1634
+ status: 404;
1635
+ payload: SimpleError;
1636
+ }>;
1637
+ declare type UpdateMigrationRequestRequestBody = {
1638
+ title?: string;
1639
+ body?: string;
1640
+ status?: 'open' | 'closed';
1641
+ };
1642
+ declare type UpdateMigrationRequestVariables = {
1643
+ body?: UpdateMigrationRequestRequestBody;
1644
+ pathParams: UpdateMigrationRequestPathParams;
1645
+ } & FetcherExtraProps;
1646
+ declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
1647
+ declare type ListMigrationRequestsCommitsPathParams = {
1648
+ dbName: DBName;
1649
+ mrNumber: number;
1650
+ workspace: string;
1651
+ };
1652
+ declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
1653
+ status: 400;
1654
+ payload: BadRequestError;
1655
+ } | {
1656
+ status: 401;
1657
+ payload: AuthError;
1658
+ } | {
1659
+ status: 404;
1660
+ payload: SimpleError;
1661
+ }>;
1662
+ declare type ListMigrationRequestsCommitsResponse = {
1663
+ meta: {
1664
+ cursor: string;
1665
+ more: boolean;
1666
+ };
1667
+ logs: Commit[];
1668
+ };
1669
+ declare type ListMigrationRequestsCommitsRequestBody = {
1670
+ page?: {
1671
+ after?: string;
1672
+ before?: string;
1673
+ size?: number;
1674
+ };
1675
+ };
1676
+ declare type ListMigrationRequestsCommitsVariables = {
1677
+ body?: ListMigrationRequestsCommitsRequestBody;
1678
+ pathParams: ListMigrationRequestsCommitsPathParams;
1679
+ } & FetcherExtraProps;
1680
+ declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
1681
+ declare type CompareMigrationRequestPathParams = {
1682
+ dbName: DBName;
1683
+ mrNumber: number;
1684
+ workspace: string;
1685
+ };
1686
+ declare type CompareMigrationRequestError = ErrorWrapper<{
1687
+ status: 400;
1688
+ payload: BadRequestError;
1689
+ } | {
1690
+ status: 401;
1691
+ payload: AuthError;
1692
+ } | {
1693
+ status: 404;
1694
+ payload: SimpleError;
1695
+ }>;
1696
+ declare type CompareMigrationRequestVariables = {
1697
+ pathParams: CompareMigrationRequestPathParams;
1698
+ } & FetcherExtraProps;
1699
+ declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
1700
+ declare type GetMigrationRequestIsMergedPathParams = {
1701
+ dbName: DBName;
1702
+ mrNumber: number;
1703
+ workspace: string;
1704
+ };
1705
+ declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
1706
+ status: 400;
1707
+ payload: BadRequestError;
1708
+ } | {
1709
+ status: 401;
1710
+ payload: AuthError;
1711
+ } | {
1712
+ status: 404;
1713
+ payload: SimpleError;
1714
+ }>;
1715
+ declare type GetMigrationRequestIsMergedResponse = {
1716
+ merged?: boolean;
1717
+ };
1718
+ declare type GetMigrationRequestIsMergedVariables = {
1719
+ pathParams: GetMigrationRequestIsMergedPathParams;
1720
+ } & FetcherExtraProps;
1721
+ declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
1722
+ declare type MergeMigrationRequestPathParams = {
1723
+ dbName: DBName;
1724
+ mrNumber: number;
1725
+ workspace: string;
1726
+ };
1727
+ declare type MergeMigrationRequestError = ErrorWrapper<{
1728
+ status: 400;
1729
+ payload: BadRequestError;
1730
+ } | {
1731
+ status: 401;
1732
+ payload: AuthError;
1733
+ } | {
1734
+ status: 404;
1735
+ payload: SimpleError;
1736
+ }>;
1737
+ declare type MergeMigrationRequestVariables = {
1738
+ pathParams: MergeMigrationRequestPathParams;
1739
+ } & FetcherExtraProps;
1740
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
1741
+ declare type GetBranchDetailsPathParams = {
1742
+ dbBranchName: DBBranchName;
1743
+ workspace: string;
1744
+ };
1745
+ declare type GetBranchDetailsError = ErrorWrapper<{
1746
+ status: 400;
1747
+ payload: BadRequestError;
1748
+ } | {
1749
+ status: 401;
1750
+ payload: AuthError;
1751
+ } | {
1752
+ status: 404;
1753
+ payload: SimpleError;
1754
+ }>;
1755
+ declare type GetBranchDetailsVariables = {
1756
+ pathParams: GetBranchDetailsPathParams;
1757
+ } & FetcherExtraProps;
1758
+ declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
1759
+ declare type CreateBranchPathParams = {
1760
+ dbBranchName: DBBranchName;
1761
+ workspace: string;
1762
+ };
1763
+ declare type CreateBranchQueryParams = {
1764
+ from?: string;
1765
+ };
1766
+ declare type CreateBranchError = 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 CreateBranchResponse = {
1777
+ databaseName: string;
1778
+ branchName: string;
1779
+ };
1780
+ declare type CreateBranchRequestBody = {
1781
+ from?: string;
1782
+ metadata?: BranchMetadata;
1783
+ };
1784
+ declare type CreateBranchVariables = {
1785
+ body?: CreateBranchRequestBody;
1786
+ pathParams: CreateBranchPathParams;
1787
+ queryParams?: CreateBranchQueryParams;
1788
+ } & FetcherExtraProps;
1789
+ declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
1790
+ declare type DeleteBranchPathParams = {
1791
+ dbBranchName: DBBranchName;
1792
+ workspace: string;
1793
+ };
1794
+ declare type DeleteBranchError = ErrorWrapper<{
1795
+ status: 400;
1796
+ payload: BadRequestError;
1797
+ } | {
1798
+ status: 401;
1799
+ payload: AuthError;
1800
+ } | {
1801
+ status: 404;
1802
+ payload: SimpleError;
1803
+ }>;
1804
+ declare type DeleteBranchVariables = {
1805
+ pathParams: DeleteBranchPathParams;
1806
+ } & FetcherExtraProps;
1807
+ /**
1808
+ * Delete the branch in the database and all its resources
1809
+ */
1810
+ declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1811
+ declare type UpdateBranchMetadataPathParams = {
1812
+ dbBranchName: DBBranchName;
1813
+ workspace: string;
1814
+ };
1815
+ declare type UpdateBranchMetadataError = ErrorWrapper<{
1816
+ status: 400;
1817
+ payload: BadRequestError;
1818
+ } | {
1819
+ status: 401;
1820
+ payload: AuthError;
1821
+ } | {
1822
+ status: 404;
1823
+ payload: SimpleError;
1824
+ }>;
1825
+ declare type UpdateBranchMetadataVariables = {
1826
+ body?: BranchMetadata;
1827
+ pathParams: UpdateBranchMetadataPathParams;
1828
+ } & FetcherExtraProps;
1829
+ /**
1830
+ * Update the branch metadata
1831
+ */
1832
+ declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1833
+ declare type GetBranchMetadataPathParams = {
1834
+ dbBranchName: DBBranchName;
1835
+ workspace: string;
1836
+ };
1837
+ declare type GetBranchMetadataError = ErrorWrapper<{
1838
+ status: 400;
1839
+ payload: BadRequestError;
1840
+ } | {
1841
+ status: 401;
1842
+ payload: AuthError;
1843
+ } | {
1844
+ status: 404;
1845
+ payload: SimpleError;
1846
+ }>;
1847
+ declare type GetBranchMetadataVariables = {
1848
+ pathParams: GetBranchMetadataPathParams;
1849
+ } & FetcherExtraProps;
1850
+ declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
1851
+ declare type GetBranchMigrationHistoryPathParams = {
1852
+ dbBranchName: DBBranchName;
1853
+ workspace: string;
1854
+ };
1855
+ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
1856
+ status: 400;
1857
+ payload: BadRequestError;
1858
+ } | {
1859
+ status: 401;
1860
+ payload: AuthError;
1861
+ } | {
1862
+ status: 404;
1863
+ payload: SimpleError;
1864
+ }>;
1865
+ declare type GetBranchMigrationHistoryResponse = {
1866
+ startedFrom?: StartedFromMetadata;
1867
+ migrations?: BranchMigration[];
1868
+ };
1869
+ declare type GetBranchMigrationHistoryRequestBody = {
1870
+ limit?: number;
1871
+ startFrom?: string;
1872
+ };
1873
+ declare type GetBranchMigrationHistoryVariables = {
1874
+ body?: GetBranchMigrationHistoryRequestBody;
1875
+ pathParams: GetBranchMigrationHistoryPathParams;
1876
+ } & FetcherExtraProps;
1877
+ declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1878
+ declare type ExecuteBranchMigrationPlanPathParams = {
1879
+ dbBranchName: DBBranchName;
1880
+ workspace: string;
1881
+ };
1882
+ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
1883
+ status: 400;
1884
+ payload: BadRequestError;
1885
+ } | {
1886
+ status: 401;
1887
+ payload: AuthError;
1888
+ } | {
1889
+ status: 404;
1890
+ payload: SimpleError;
1891
+ }>;
1892
+ declare type ExecuteBranchMigrationPlanRequestBody = {
1893
+ version: number;
1894
+ migration: BranchMigration;
1895
+ };
1896
+ declare type ExecuteBranchMigrationPlanVariables = {
1897
+ body: ExecuteBranchMigrationPlanRequestBody;
1898
+ pathParams: ExecuteBranchMigrationPlanPathParams;
1899
+ } & FetcherExtraProps;
1900
+ /**
1901
+ * Apply a migration plan to the branch
1902
+ */
1903
+ declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
1904
+ declare type GetBranchMigrationPlanPathParams = {
1905
+ dbBranchName: DBBranchName;
1906
+ workspace: string;
1907
+ };
1908
+ declare type GetBranchMigrationPlanError = ErrorWrapper<{
1909
+ status: 400;
1910
+ payload: BadRequestError;
1911
+ } | {
1912
+ status: 401;
1913
+ payload: AuthError;
1914
+ } | {
1915
+ status: 404;
1916
+ payload: SimpleError;
1917
+ }>;
1918
+ declare type GetBranchMigrationPlanVariables = {
1919
+ body: Schema;
1920
+ pathParams: GetBranchMigrationPlanPathParams;
1921
+ } & FetcherExtraProps;
1922
+ /**
1923
+ * Compute a migration plan from a target schema the branch should be migrated too.
1924
+ */
1925
+ declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
1926
+ declare type CompareBranchWithUserSchemaPathParams = {
1927
+ dbBranchName: DBBranchName;
1928
+ workspace: string;
1929
+ };
1930
+ declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
1931
+ status: 400;
1932
+ payload: BadRequestError;
1933
+ } | {
1934
+ status: 401;
1935
+ payload: AuthError;
1936
+ } | {
1937
+ status: 404;
1938
+ payload: SimpleError;
1939
+ }>;
1940
+ declare type CompareBranchWithUserSchemaRequestBody = {
1941
+ schema: Schema;
1942
+ };
1943
+ declare type CompareBranchWithUserSchemaVariables = {
1944
+ body: CompareBranchWithUserSchemaRequestBody;
1945
+ pathParams: CompareBranchWithUserSchemaPathParams;
1946
+ } & FetcherExtraProps;
1947
+ declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
1948
+ declare type CompareBranchSchemasPathParams = {
1949
+ dbBranchName: DBBranchName;
1950
+ branchName: BranchName;
1951
+ workspace: string;
1952
+ };
1953
+ declare type CompareBranchSchemasError = ErrorWrapper<{
1954
+ status: 400;
1955
+ payload: BadRequestError;
1956
+ } | {
1957
+ status: 401;
1958
+ payload: AuthError;
1959
+ } | {
1960
+ status: 404;
1961
+ payload: SimpleError;
1962
+ }>;
1963
+ declare type CompareBranchSchemasVariables = {
1964
+ body?: Record<string, any>;
1965
+ pathParams: CompareBranchSchemasPathParams;
1966
+ } & FetcherExtraProps;
1967
+ declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
1968
+ declare type UpdateBranchSchemaPathParams = {
1969
+ dbBranchName: DBBranchName;
1970
+ workspace: string;
1971
+ };
1972
+ declare type UpdateBranchSchemaError = ErrorWrapper<{
1973
+ status: 400;
1974
+ payload: BadRequestError;
1975
+ } | {
1976
+ status: 401;
1977
+ payload: AuthError;
1978
+ } | {
1979
+ status: 404;
1980
+ payload: SimpleError;
1981
+ }>;
1982
+ declare type UpdateBranchSchemaResponse = {
1983
+ id: string;
1984
+ parentID: string;
1985
+ };
1986
+ declare type UpdateBranchSchemaVariables = {
1987
+ body: Migration;
1988
+ pathParams: UpdateBranchSchemaPathParams;
1989
+ } & FetcherExtraProps;
1990
+ declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
1991
+ declare type PreviewBranchSchemaEditPathParams = {
1992
+ dbBranchName: DBBranchName;
1993
+ workspace: string;
1140
1994
  };
1141
- declare type GetBranchMigrationHistoryVariables = {
1142
- body?: GetBranchMigrationHistoryRequestBody;
1143
- pathParams: GetBranchMigrationHistoryPathParams;
1995
+ declare type PreviewBranchSchemaEditError = ErrorWrapper<{
1996
+ status: 400;
1997
+ payload: BadRequestError;
1998
+ } | {
1999
+ status: 401;
2000
+ payload: AuthError;
2001
+ } | {
2002
+ status: 404;
2003
+ payload: SimpleError;
2004
+ }>;
2005
+ declare type PreviewBranchSchemaEditResponse = {
2006
+ original: Schema;
2007
+ updated: Schema;
2008
+ };
2009
+ declare type PreviewBranchSchemaEditRequestBody = {
2010
+ edits?: SchemaEditScript;
2011
+ operations?: MigrationOp[];
2012
+ };
2013
+ declare type PreviewBranchSchemaEditVariables = {
2014
+ body?: PreviewBranchSchemaEditRequestBody;
2015
+ pathParams: PreviewBranchSchemaEditPathParams;
1144
2016
  } & FetcherExtraProps;
1145
- declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1146
- declare type ExecuteBranchMigrationPlanPathParams = {
2017
+ declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
2018
+ declare type ApplyBranchSchemaEditPathParams = {
1147
2019
  dbBranchName: DBBranchName;
1148
2020
  workspace: string;
1149
2021
  };
1150
- declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
2022
+ declare type ApplyBranchSchemaEditError = ErrorWrapper<{
1151
2023
  status: 400;
1152
2024
  payload: BadRequestError;
1153
2025
  } | {
@@ -1157,23 +2029,23 @@ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
1157
2029
  status: 404;
1158
2030
  payload: SimpleError;
1159
2031
  }>;
1160
- declare type ExecuteBranchMigrationPlanRequestBody = {
1161
- version: number;
1162
- migration: BranchMigration;
2032
+ declare type ApplyBranchSchemaEditResponse = {
2033
+ id: string;
2034
+ parentID: string;
1163
2035
  };
1164
- declare type ExecuteBranchMigrationPlanVariables = {
1165
- body: ExecuteBranchMigrationPlanRequestBody;
1166
- pathParams: ExecuteBranchMigrationPlanPathParams;
2036
+ declare type ApplyBranchSchemaEditRequestBody = {
2037
+ edits: SchemaEditScript;
2038
+ };
2039
+ declare type ApplyBranchSchemaEditVariables = {
2040
+ body: ApplyBranchSchemaEditRequestBody;
2041
+ pathParams: ApplyBranchSchemaEditPathParams;
1167
2042
  } & FetcherExtraProps;
1168
- /**
1169
- * Apply a migration plan to the branch
1170
- */
1171
- declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
1172
- declare type GetBranchMigrationPlanPathParams = {
2043
+ declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
2044
+ declare type GetBranchSchemaHistoryPathParams = {
1173
2045
  dbBranchName: DBBranchName;
1174
2046
  workspace: string;
1175
2047
  };
1176
- declare type GetBranchMigrationPlanError = ErrorWrapper<{
2048
+ declare type GetBranchSchemaHistoryError = ErrorWrapper<{
1177
2049
  status: 400;
1178
2050
  payload: BadRequestError;
1179
2051
  } | {
@@ -1183,14 +2055,25 @@ declare type GetBranchMigrationPlanError = ErrorWrapper<{
1183
2055
  status: 404;
1184
2056
  payload: SimpleError;
1185
2057
  }>;
1186
- declare type GetBranchMigrationPlanVariables = {
1187
- body: Schema;
1188
- pathParams: GetBranchMigrationPlanPathParams;
2058
+ declare type GetBranchSchemaHistoryResponse = {
2059
+ meta: {
2060
+ cursor: string;
2061
+ more: boolean;
2062
+ };
2063
+ logs: Commit[];
2064
+ };
2065
+ declare type GetBranchSchemaHistoryRequestBody = {
2066
+ page?: {
2067
+ after?: string;
2068
+ before?: string;
2069
+ size?: number;
2070
+ };
2071
+ };
2072
+ declare type GetBranchSchemaHistoryVariables = {
2073
+ body?: GetBranchSchemaHistoryRequestBody;
2074
+ pathParams: GetBranchSchemaHistoryPathParams;
1189
2075
  } & FetcherExtraProps;
1190
- /**
1191
- * Compute a migration plan from a target schema the branch should be migrated too.
1192
- */
1193
- declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2076
+ declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
1194
2077
  declare type GetBranchStatsPathParams = {
1195
2078
  dbBranchName: DBBranchName;
1196
2079
  workspace: string;
@@ -1241,13 +2124,17 @@ declare type CreateTableError = ErrorWrapper<{
1241
2124
  status: 422;
1242
2125
  payload: SimpleError;
1243
2126
  }>;
2127
+ declare type CreateTableResponse = {
2128
+ branchName: string;
2129
+ tableName: string;
2130
+ };
1244
2131
  declare type CreateTableVariables = {
1245
2132
  pathParams: CreateTablePathParams;
1246
2133
  } & FetcherExtraProps;
1247
2134
  /**
1248
2135
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1249
2136
  */
1250
- declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
2137
+ declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
1251
2138
  declare type DeleteTablePathParams = {
1252
2139
  dbBranchName: DBBranchName;
1253
2140
  tableName: TableName;
@@ -1480,6 +2367,9 @@ declare type InsertRecordPathParams = {
1480
2367
  tableName: TableName;
1481
2368
  workspace: string;
1482
2369
  };
2370
+ declare type InsertRecordQueryParams = {
2371
+ columns?: ColumnsProjection;
2372
+ };
1483
2373
  declare type InsertRecordError = ErrorWrapper<{
1484
2374
  status: 400;
1485
2375
  payload: BadRequestError;
@@ -1490,20 +2380,15 @@ declare type InsertRecordError = ErrorWrapper<{
1490
2380
  status: 404;
1491
2381
  payload: SimpleError;
1492
2382
  }>;
1493
- declare type InsertRecordResponse = {
1494
- id: string;
1495
- xata: {
1496
- version: number;
1497
- };
1498
- };
1499
2383
  declare type InsertRecordVariables = {
1500
2384
  body?: Record<string, any>;
1501
2385
  pathParams: InsertRecordPathParams;
2386
+ queryParams?: InsertRecordQueryParams;
1502
2387
  } & FetcherExtraProps;
1503
2388
  /**
1504
2389
  * Insert a new Record into the Table
1505
2390
  */
1506
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2391
+ declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
1507
2392
  declare type InsertRecordWithIDPathParams = {
1508
2393
  dbBranchName: DBBranchName;
1509
2394
  tableName: TableName;
@@ -1511,6 +2396,7 @@ declare type InsertRecordWithIDPathParams = {
1511
2396
  workspace: string;
1512
2397
  };
1513
2398
  declare type InsertRecordWithIDQueryParams = {
2399
+ columns?: ColumnsProjection;
1514
2400
  createOnly?: boolean;
1515
2401
  ifVersion?: number;
1516
2402
  };
@@ -1543,6 +2429,7 @@ declare type UpdateRecordWithIDPathParams = {
1543
2429
  workspace: string;
1544
2430
  };
1545
2431
  declare type UpdateRecordWithIDQueryParams = {
2432
+ columns?: ColumnsProjection;
1546
2433
  ifVersion?: number;
1547
2434
  };
1548
2435
  declare type UpdateRecordWithIDError = ErrorWrapper<{
@@ -1571,6 +2458,7 @@ declare type UpsertRecordWithIDPathParams = {
1571
2458
  workspace: string;
1572
2459
  };
1573
2460
  declare type UpsertRecordWithIDQueryParams = {
2461
+ columns?: ColumnsProjection;
1574
2462
  ifVersion?: number;
1575
2463
  };
1576
2464
  declare type UpsertRecordWithIDError = ErrorWrapper<{
@@ -1598,6 +2486,9 @@ declare type DeleteRecordPathParams = {
1598
2486
  recordId: RecordID;
1599
2487
  workspace: string;
1600
2488
  };
2489
+ declare type DeleteRecordQueryParams = {
2490
+ columns?: ColumnsProjection;
2491
+ };
1601
2492
  declare type DeleteRecordError = ErrorWrapper<{
1602
2493
  status: 400;
1603
2494
  payload: BadRequestError;
@@ -1610,14 +2501,18 @@ declare type DeleteRecordError = ErrorWrapper<{
1610
2501
  }>;
1611
2502
  declare type DeleteRecordVariables = {
1612
2503
  pathParams: DeleteRecordPathParams;
2504
+ queryParams?: DeleteRecordQueryParams;
1613
2505
  } & FetcherExtraProps;
1614
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
2506
+ declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
1615
2507
  declare type GetRecordPathParams = {
1616
2508
  dbBranchName: DBBranchName;
1617
2509
  tableName: TableName;
1618
2510
  recordId: RecordID;
1619
2511
  workspace: string;
1620
2512
  };
2513
+ declare type GetRecordQueryParams = {
2514
+ columns?: ColumnsProjection;
2515
+ };
1621
2516
  declare type GetRecordError = ErrorWrapper<{
1622
2517
  status: 400;
1623
2518
  payload: BadRequestError;
@@ -1628,12 +2523,9 @@ declare type GetRecordError = ErrorWrapper<{
1628
2523
  status: 404;
1629
2524
  payload: SimpleError;
1630
2525
  }>;
1631
- declare type GetRecordRequestBody = {
1632
- columns?: ColumnsFilter;
1633
- };
1634
2526
  declare type GetRecordVariables = {
1635
- body?: GetRecordRequestBody;
1636
2527
  pathParams: GetRecordPathParams;
2528
+ queryParams?: GetRecordQueryParams;
1637
2529
  } & FetcherExtraProps;
1638
2530
  /**
1639
2531
  * Retrieve record by ID
@@ -1644,6 +2536,9 @@ declare type BulkInsertTableRecordsPathParams = {
1644
2536
  tableName: TableName;
1645
2537
  workspace: string;
1646
2538
  };
2539
+ declare type BulkInsertTableRecordsQueryParams = {
2540
+ columns?: ColumnsProjection;
2541
+ };
1647
2542
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
1648
2543
  status: 400;
1649
2544
  payload: BulkError;
@@ -1653,21 +2548,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1653
2548
  } | {
1654
2549
  status: 404;
1655
2550
  payload: SimpleError;
2551
+ } | {
2552
+ status: 422;
2553
+ payload: SimpleError;
1656
2554
  }>;
1657
- declare type BulkInsertTableRecordsResponse = {
1658
- recordIDs: string[];
1659
- };
1660
2555
  declare type BulkInsertTableRecordsRequestBody = {
1661
2556
  records: Record<string, any>[];
1662
2557
  };
1663
2558
  declare type BulkInsertTableRecordsVariables = {
1664
2559
  body: BulkInsertTableRecordsRequestBody;
1665
2560
  pathParams: BulkInsertTableRecordsPathParams;
2561
+ queryParams?: BulkInsertTableRecordsQueryParams;
1666
2562
  } & FetcherExtraProps;
1667
2563
  /**
1668
2564
  * Bulk insert records
1669
2565
  */
1670
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2566
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
1671
2567
  declare type QueryTablePathParams = {
1672
2568
  dbBranchName: DBBranchName;
1673
2569
  tableName: TableName;
@@ -1687,7 +2583,7 @@ declare type QueryTableRequestBody = {
1687
2583
  filter?: FilterExpression;
1688
2584
  sort?: SortExpression;
1689
2585
  page?: PageConfig;
1690
- columns?: ColumnsFilter;
2586
+ columns?: ColumnsProjection;
1691
2587
  };
1692
2588
  declare type QueryTableVariables = {
1693
2589
  body?: QueryTableRequestBody;
@@ -1750,7 +2646,11 @@ declare type QueryTableVariables = {
1750
2646
  * "link": {
1751
2647
  * "table": "users"
1752
2648
  * }
1753
- * }
2649
+ * },
2650
+ * {
2651
+ * "name": "foundedDate",
2652
+ * "type": "datetime"
2653
+ * },
1754
2654
  * ]
1755
2655
  * },
1756
2656
  * {
@@ -1897,7 +2797,8 @@ declare type QueryTableVariables = {
1897
2797
  * "version": 0
1898
2798
  * },
1899
2799
  * "name": "first team",
1900
- * "code": "A1"
2800
+ * "code": "A1",
2801
+ * "foundedDate": "2020-03-04T10:43:54.32Z"
1901
2802
  * }
1902
2803
  * }
1903
2804
  * ```
@@ -1912,7 +2813,7 @@ declare type QueryTableVariables = {
1912
2813
  * `$none`, etc.
1913
2814
  *
1914
2815
  * All operators start with an `$` to differentiate them from column names
1915
- * (which are not allowed to start with an dollar sign).
2816
+ * (which are not allowed to start with a dollar sign).
1916
2817
  *
1917
2818
  * #### Exact matching and control operators
1918
2819
  *
@@ -2092,12 +2993,18 @@ declare type QueryTableVariables = {
2092
2993
  * {
2093
2994
  * "filter": {
2094
2995
  * "<column_name>": {
2095
- * "$pattern": "v*alue*"
2996
+ * "$pattern": "v*alu?"
2096
2997
  * }
2097
2998
  * }
2098
2999
  * }
2099
3000
  * ```
2100
3001
  *
3002
+ * The `$pattern` operator accepts two wildcard characters:
3003
+ * * `*` matches zero or more characters
3004
+ * * `?` matches exactly one character
3005
+ *
3006
+ * 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.
3007
+ *
2101
3008
  * We could also have `$endsWith` and `$startsWith` operators:
2102
3009
  *
2103
3010
  * ```json
@@ -2113,7 +3020,7 @@ declare type QueryTableVariables = {
2113
3020
  * }
2114
3021
  * ```
2115
3022
  *
2116
- * #### Numeric ranges
3023
+ * #### Numeric or datetime ranges
2117
3024
  *
2118
3025
  * ```json
2119
3026
  * {
@@ -2125,7 +3032,18 @@ declare type QueryTableVariables = {
2125
3032
  * }
2126
3033
  * }
2127
3034
  * ```
2128
- *
3035
+ * Date ranges support the same operators, with the date using the format defined in
3036
+ * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
3037
+ * ```json
3038
+ * {
3039
+ * "filter": {
3040
+ * "<column_name>": {
3041
+ * "$gt": "2019-10-12T07:20:50.52Z",
3042
+ * "$lt": "2021-10-12T07:20:50.52Z"
3043
+ * }
3044
+ * }
3045
+ * }
3046
+ * ```
2129
3047
  * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
2130
3048
  *
2131
3049
  * #### Negations
@@ -2393,6 +3311,42 @@ declare type QueryTableVariables = {
2393
3311
  * ```
2394
3312
  */
2395
3313
  declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
3314
+ declare type SearchTablePathParams = {
3315
+ dbBranchName: DBBranchName;
3316
+ tableName: TableName;
3317
+ workspace: string;
3318
+ };
3319
+ declare type SearchTableError = ErrorWrapper<{
3320
+ status: 400;
3321
+ payload: BadRequestError;
3322
+ } | {
3323
+ status: 401;
3324
+ payload: AuthError;
3325
+ } | {
3326
+ status: 404;
3327
+ payload: SimpleError;
3328
+ }>;
3329
+ declare type SearchTableRequestBody = {
3330
+ query: string;
3331
+ fuzziness?: FuzzinessExpression;
3332
+ target?: TargetExpression;
3333
+ prefix?: PrefixExpression;
3334
+ filter?: FilterExpression;
3335
+ highlight?: HighlightExpression;
3336
+ boosters?: BoosterExpression[];
3337
+ };
3338
+ declare type SearchTableVariables = {
3339
+ body: SearchTableRequestBody;
3340
+ pathParams: SearchTablePathParams;
3341
+ } & FetcherExtraProps;
3342
+ /**
3343
+ * Run a free text search operation in a particular table.
3344
+ *
3345
+ * 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:
3346
+ * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
3347
+ * * filtering on columns of type `multiple` is currently unsupported
3348
+ */
3349
+ declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2396
3350
  declare type SearchBranchPathParams = {
2397
3351
  dbBranchName: DBBranchName;
2398
3352
  workspace: string;
@@ -2408,9 +3362,16 @@ declare type SearchBranchError = ErrorWrapper<{
2408
3362
  payload: SimpleError;
2409
3363
  }>;
2410
3364
  declare type SearchBranchRequestBody = {
2411
- tables?: string[];
3365
+ tables?: (string | {
3366
+ table: string;
3367
+ filter?: FilterExpression;
3368
+ target?: TargetExpression;
3369
+ boosters?: BoosterExpression[];
3370
+ })[];
2412
3371
  query: string;
2413
- fuzziness?: number;
3372
+ fuzziness?: FuzzinessExpression;
3373
+ prefix?: PrefixExpression;
3374
+ highlight?: HighlightExpression;
2414
3375
  };
2415
3376
  declare type SearchBranchVariables = {
2416
3377
  body: SearchBranchRequestBody;
@@ -2420,6 +3381,33 @@ declare type SearchBranchVariables = {
2420
3381
  * Run a free text search operation across the database branch.
2421
3382
  */
2422
3383
  declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
3384
+ declare type SummarizeTablePathParams = {
3385
+ dbBranchName: DBBranchName;
3386
+ tableName: TableName;
3387
+ workspace: string;
3388
+ };
3389
+ declare type SummarizeTableError = ErrorWrapper<{
3390
+ status: 400;
3391
+ payload: BadRequestError;
3392
+ } | {
3393
+ status: 401;
3394
+ payload: AuthError;
3395
+ } | {
3396
+ status: 404;
3397
+ payload: SimpleError;
3398
+ }>;
3399
+ declare type SummarizeTableRequestBody = {
3400
+ summaries?: SummaryExpressionList;
3401
+ columns?: ColumnsProjection;
3402
+ };
3403
+ declare type SummarizeTableVariables = {
3404
+ body?: SummarizeTableRequestBody;
3405
+ pathParams: SummarizeTablePathParams;
3406
+ } & FetcherExtraProps;
3407
+ /**
3408
+ * Summarize table
3409
+ */
3410
+ declare const summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
2423
3411
  declare const operationsByTag: {
2424
3412
  users: {
2425
3413
  getUser: (variables: GetUserVariables) => Promise<UserWithID>;
@@ -2439,6 +3427,7 @@ declare const operationsByTag: {
2439
3427
  updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2440
3428
  removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2441
3429
  inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
3430
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
2442
3431
  cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2443
3432
  resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2444
3433
  acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
@@ -2447,21 +3436,45 @@ declare const operationsByTag: {
2447
3436
  getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2448
3437
  createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2449
3438
  deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
3439
+ getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
3440
+ updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
3441
+ getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
3442
+ addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
3443
+ removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
3444
+ resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
2450
3445
  };
2451
3446
  branch: {
2452
3447
  getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2453
3448
  getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2454
- createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
3449
+ createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2455
3450
  deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2456
3451
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2457
3452
  getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
3453
+ getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
3454
+ };
3455
+ migrationRequests: {
3456
+ listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
3457
+ createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
3458
+ getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
3459
+ updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
3460
+ listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
3461
+ compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
3462
+ getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
3463
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
3464
+ };
3465
+ branchSchema: {
2458
3466
  getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2459
3467
  executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2460
3468
  getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2461
- getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
3469
+ compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
3470
+ compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
3471
+ updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
3472
+ previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
3473
+ applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
3474
+ getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
2462
3475
  };
2463
3476
  table: {
2464
- createTable: (variables: CreateTableVariables) => Promise<undefined>;
3477
+ createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2465
3478
  deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2466
3479
  updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2467
3480
  getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
@@ -2473,15 +3486,17 @@ declare const operationsByTag: {
2473
3486
  updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
2474
3487
  };
2475
3488
  records: {
2476
- insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
3489
+ insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
2477
3490
  insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2478
3491
  updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2479
3492
  upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2480
- deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
3493
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
2481
3494
  getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2482
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
3495
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
2483
3496
  queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
3497
+ searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2484
3498
  searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
3499
+ summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
2485
3500
  };
2486
3501
  };
2487
3502
 
@@ -2496,10 +3511,8 @@ interface XataApiClientOptions {
2496
3511
  fetch?: FetchImpl;
2497
3512
  apiKey?: string;
2498
3513
  host?: HostProvider;
3514
+ trace?: TraceFunction;
2499
3515
  }
2500
- /**
2501
- * @deprecated Use XataApiPlugin instead
2502
- */
2503
3516
  declare class XataApiClient {
2504
3517
  #private;
2505
3518
  constructor(options?: XataApiClientOptions);
@@ -2509,6 +3522,8 @@ declare class XataApiClient {
2509
3522
  get branches(): BranchApi;
2510
3523
  get tables(): TableApi;
2511
3524
  get records(): RecordsApi;
3525
+ get migrationRequests(): MigrationRequestsApi;
3526
+ get branchSchema(): BranchSchemaApi;
2512
3527
  }
2513
3528
  declare class UserApi {
2514
3529
  private extraProps;
@@ -2532,6 +3547,7 @@ declare class WorkspaceApi {
2532
3547
  updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2533
3548
  removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2534
3549
  inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
3550
+ updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
2535
3551
  cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2536
3552
  resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2537
3553
  acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
@@ -2542,25 +3558,28 @@ declare class DatabaseApi {
2542
3558
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2543
3559
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2544
3560
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
3561
+ getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
3562
+ updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
3563
+ getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
3564
+ addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
3565
+ removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
3566
+ resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
2545
3567
  }
2546
3568
  declare class BranchApi {
2547
3569
  private extraProps;
2548
3570
  constructor(extraProps: FetcherExtraProps);
2549
3571
  getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2550
3572
  getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2551
- createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<void>;
3573
+ createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
2552
3574
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2553
3575
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2554
3576
  getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
2555
- getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
2556
- executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
2557
- getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
2558
3577
  getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
2559
3578
  }
2560
3579
  declare class TableApi {
2561
3580
  private extraProps;
2562
3581
  constructor(extraProps: FetcherExtraProps);
2563
- createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
3582
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
2564
3583
  deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2565
3584
  updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2566
3585
  getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
@@ -2574,15 +3593,42 @@ declare class TableApi {
2574
3593
  declare class RecordsApi {
2575
3594
  private extraProps;
2576
3595
  constructor(extraProps: FetcherExtraProps);
2577
- insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>): Promise<InsertRecordResponse>;
3596
+ insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
2578
3597
  insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2579
3598
  updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2580
3599
  upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2581
- deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<void>;
2582
- getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2583
- bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
3600
+ deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
3601
+ getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
3602
+ bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
2584
3603
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
3604
+ searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2585
3605
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
3606
+ summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
3607
+ }
3608
+ declare class MigrationRequestsApi {
3609
+ private extraProps;
3610
+ constructor(extraProps: FetcherExtraProps);
3611
+ listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
3612
+ createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
3613
+ getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
3614
+ updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
3615
+ listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
3616
+ compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
3617
+ getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
3618
+ mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
3619
+ }
3620
+ declare class BranchSchemaApi {
3621
+ private extraProps;
3622
+ constructor(extraProps: FetcherExtraProps);
3623
+ getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
3624
+ executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
3625
+ getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
3626
+ compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
3627
+ compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
3628
+ updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
3629
+ previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
3630
+ applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
3631
+ getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
2586
3632
  }
2587
3633
 
2588
3634
  declare class XataApiPlugin implements XataPlugin {
@@ -2595,28 +3641,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
2595
3641
  declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2596
3642
  declare type IsObject<T> = T extends Record<string, any> ? true : false;
2597
3643
  declare type IsArray<T> = T extends Array<any> ? true : false;
2598
- declare type NonEmptyArray<T> = T[] & {
2599
- 0: T;
2600
- };
2601
3644
  declare type RequiredBy<T, K extends keyof T> = T & {
2602
3645
  [P in K]-?: NonNullable<T[P]>;
2603
3646
  };
2604
3647
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2605
3648
  declare type SingleOrArray<T> = T | T[];
2606
- declare type Dictionary<T> = Record<string, T>;
3649
+ declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
3650
+ declare type Without<T, U> = {
3651
+ [P in Exclude<keyof T, keyof U>]?: never;
3652
+ };
3653
+ declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
2607
3654
 
2608
3655
  declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2609
- declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2610
- [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
3656
+ declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
3657
+ [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
2611
3658
  }>>;
2612
- 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]> ? {
2613
- V: ValueAtColumn<O[K], V>;
2614
- } : never) : O[K]> : never : never;
3659
+ 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> ? {
3660
+ V: ValueAtColumn<Item, V>;
3661
+ } : never : O[K] : never> : never : never;
2615
3662
  declare type MAX_RECURSION = 5;
2616
3663
  declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
2617
- [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
2618
- 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
2619
- K>>;
3664
+ [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
3665
+ 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
3666
+ K>> : never;
2620
3667
  }>, never>;
2621
3668
  declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
2622
3669
  declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
@@ -2643,56 +3690,67 @@ interface BaseData {
2643
3690
  /**
2644
3691
  * Represents a persisted record from the database.
2645
3692
  */
2646
- interface XataRecord extends Identifiable {
3693
+ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
2647
3694
  /**
2648
- * Metadata of this record.
3695
+ * Get metadata of this record.
2649
3696
  */
2650
- xata: {
2651
- /**
2652
- * Number that is increased every time the record is updated.
2653
- */
2654
- version: number;
2655
- };
3697
+ getMetadata(): XataRecordMetadata;
3698
+ /**
3699
+ * Retrieves a refreshed copy of the current record from the database.
3700
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3701
+ * @returns The persisted record with the selected columns, null if not found.
3702
+ */
3703
+ read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2656
3704
  /**
2657
3705
  * Retrieves a refreshed copy of the current record from the database.
3706
+ * @returns The persisted record with all first level properties, null if not found.
3707
+ */
3708
+ read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
3709
+ /**
3710
+ * Performs a partial update of the current record. On success a new object is
3711
+ * returned and the current object is not mutated.
3712
+ * @param partialUpdate The columns and their values that have to be updated.
3713
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3714
+ * @returns The persisted record with the selected columns, null if not found.
2658
3715
  */
2659
- read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
3716
+ update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2660
3717
  /**
2661
3718
  * Performs a partial update of the current record. On success a new object is
2662
3719
  * returned and the current object is not mutated.
2663
- * @param data The columns and their values that have to be updated.
2664
- * @returns A new record containing the latest values for all the columns of the current record.
3720
+ * @param partialUpdate The columns and their values that have to be updated.
3721
+ * @returns The persisted record with all first level properties, null if not found.
2665
3722
  */
2666
- update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
3723
+ update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2667
3724
  /**
2668
3725
  * Performs a deletion of the current record in the database.
2669
- *
2670
- * @throws If the record was already deleted or if an error happened while performing the deletion.
3726
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3727
+ * @returns The deleted record, null if not found.
2671
3728
  */
2672
- delete(): Promise<void>;
2673
- }
2674
- declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
3729
+ delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2675
3730
  /**
2676
- * Retrieves a refreshed copy of the current record from the database.
3731
+ * Performs a deletion of the current record in the database.
3732
+ * @returns The deleted record, null if not found.
3733
+
2677
3734
  */
2678
- read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3735
+ delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
3736
+ }
3737
+ declare type Link<Record extends XataRecord> = XataRecord<Record>;
3738
+ declare type XataRecordMetadata = {
2679
3739
  /**
2680
- * Performs a partial update of the current record. On success a new object is
2681
- * returned and the current object is not mutated.
2682
- * @param data The columns and their values that have to be updated.
2683
- * @returns A new record containing the latest values for all the columns of the current record.
3740
+ * Number that is increased every time the record is updated.
2684
3741
  */
2685
- update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3742
+ version: number;
3743
+ warnings?: string[];
2686
3744
  };
2687
3745
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2688
3746
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2689
- declare type EditableData<O extends BaseData> = {
3747
+ declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
2690
3748
  [K in keyof O]: O[K] extends XataRecord ? {
2691
3749
  id: string;
2692
- } : NonNullable<O[K]> extends XataRecord ? {
3750
+ } | string : NonNullable<O[K]> extends XataRecord ? {
2693
3751
  id: string;
2694
- } | null | undefined : O[K];
2695
- };
3752
+ } | string | null | undefined : O[K];
3753
+ }, keyof XataRecord>;
2696
3754
 
2697
3755
  /**
2698
3756
  * PropertyMatchFilter
@@ -2767,8 +3825,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
2767
3825
  ],
2768
3826
  }
2769
3827
  */
2770
- declare type AggregatorFilter<Record> = {
2771
- [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<Record>>;
3828
+ declare type AggregatorFilter<T> = {
3829
+ [key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
2772
3830
  };
2773
3831
  /**
2774
3832
  * Existance filter
@@ -2783,10 +3841,88 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
2783
3841
  * Injects the Api filters on nested properties
2784
3842
  * Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
2785
3843
  */
2786
- declare type NestedApiFilter<T> = T extends Record<string, any> ? {
3844
+ declare type NestedApiFilter<T> = {
2787
3845
  [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
2788
- } : PropertyFilter<T>;
2789
- declare type Filter<Record> = BaseApiFilter<Record> | NestedApiFilter<Record>;
3846
+ };
3847
+ 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>;
3848
+
3849
+ declare type DateBooster = {
3850
+ origin?: string;
3851
+ scale: string;
3852
+ decay: number;
3853
+ };
3854
+ declare type NumericBooster = {
3855
+ factor: number;
3856
+ };
3857
+ declare type ValueBooster<T extends string | number | boolean> = {
3858
+ value: T;
3859
+ factor: number;
3860
+ };
3861
+ declare type Boosters<O extends XataRecord> = Values<{
3862
+ [K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
3863
+ dateBooster: {
3864
+ column: K;
3865
+ } & DateBooster;
3866
+ } : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
3867
+ numericBooster?: {
3868
+ column: K;
3869
+ } & NumericBooster;
3870
+ }, {
3871
+ valueBooster?: {
3872
+ column: K;
3873
+ } & ValueBooster<number>;
3874
+ }> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
3875
+ valueBooster: {
3876
+ column: K;
3877
+ } & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
3878
+ } : never;
3879
+ }>;
3880
+
3881
+ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3882
+ fuzziness?: FuzzinessExpression;
3883
+ prefix?: PrefixExpression;
3884
+ highlight?: HighlightExpression;
3885
+ tables?: Array<Tables | Values<{
3886
+ [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
3887
+ table: Model;
3888
+ filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
3889
+ boosters?: Boosters<Schemas[Model] & XataRecord>[];
3890
+ };
3891
+ }>>;
3892
+ };
3893
+ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3894
+ all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3895
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
3896
+ table: Model;
3897
+ record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
3898
+ };
3899
+ }>[]>;
3900
+ byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3901
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
3902
+ }>;
3903
+ };
3904
+ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3905
+ #private;
3906
+ private db;
3907
+ constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
3908
+ build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3909
+ }
3910
+ declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
3911
+ getMetadata: () => XataRecordMetadata & SearchExtraProperties;
3912
+ };
3913
+ declare type SearchExtraProperties = {
3914
+ table: string;
3915
+ highlight?: {
3916
+ [key: string]: string[] | {
3917
+ [key: string]: any;
3918
+ };
3919
+ };
3920
+ score?: number;
3921
+ };
3922
+ declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
3923
+ 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 {
3924
+ table: infer Table;
3925
+ } ? ReturnTable<Table, Tables> : never;
2790
3926
 
2791
3927
  declare type SortDirection = 'asc' | 'desc';
2792
3928
  declare type SortFilterExtended<T extends XataRecord> = {
@@ -2798,13 +3934,21 @@ declare type SortFilterBase<T extends XataRecord> = {
2798
3934
  [Key in StringKeys<T>]: SortDirection;
2799
3935
  };
2800
3936
 
2801
- declare type QueryOptions<T extends XataRecord> = {
2802
- page?: PaginationOptions;
2803
- columns?: NonEmptyArray<SelectableColumn<T>>;
3937
+ declare type BaseOptions<T extends XataRecord> = {
3938
+ columns?: SelectableColumn<T>[];
3939
+ cache?: number;
3940
+ };
3941
+ declare type CursorQueryOptions = {
3942
+ pagination?: CursorNavigationOptions & OffsetNavigationOptions;
3943
+ filter?: never;
3944
+ sort?: never;
3945
+ };
3946
+ declare type OffsetQueryOptions<T extends XataRecord> = {
3947
+ pagination?: OffsetNavigationOptions;
2804
3948
  filter?: FilterExpression;
2805
3949
  sort?: SortFilter<T> | SortFilter<T>[];
2806
- cache?: number;
2807
3950
  };
3951
+ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
2808
3952
  /**
2809
3953
  * Query objects contain the information of all filters, sorting, etc. to be included in the database query.
2810
3954
  *
@@ -2814,8 +3958,11 @@ declare type QueryOptions<T extends XataRecord> = {
2814
3958
  declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
2815
3959
  #private;
2816
3960
  readonly meta: PaginationQueryMeta;
2817
- readonly records: Result[];
2818
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, parent?: Partial<QueryOptions<Record>>);
3961
+ readonly records: RecordArray<Result>;
3962
+ constructor(repository: Repository<Record> | null, table: {
3963
+ name: string;
3964
+ schema?: Table;
3965
+ }, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
2819
3966
  getQueryOptions(): QueryOptions<Record>;
2820
3967
  key(): string;
2821
3968
  /**
@@ -2847,73 +3994,206 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
2847
3994
  *
2848
3995
  * ```
2849
3996
  * query.filter("columnName", columnValue)
2850
- * query.filter({
2851
- * "columnName": columnValue
2852
- * })
3997
+ * query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
3998
+ * ```
3999
+ *
4000
+ * @param column The name of the column to filter.
4001
+ * @param value The value to filter.
4002
+ * @returns A new Query object.
4003
+ */
4004
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
4005
+ /**
4006
+ * Builds a new query object adding one or more constraints. Examples:
4007
+ *
4008
+ * ```
4009
+ * query.filter({ "columnName": columnValue })
2853
4010
  * query.filter({
2854
4011
  * "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
2855
4012
  * })
2856
4013
  * ```
2857
4014
  *
4015
+ * @param filters A filter object
2858
4016
  * @returns A new Query object.
2859
4017
  */
2860
- filter(filters: Filter<Record>): Query<Record, Result>;
2861
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
4018
+ filter(filters?: Filter<Record>): Query<Record, Result>;
4019
+ defaultFilter<T>(column: string, value: T): T | {
4020
+ $includes: (T & string) | (T & string[]);
4021
+ };
2862
4022
  /**
2863
4023
  * Builds a new query with a new sort option.
2864
4024
  * @param column The column name.
2865
4025
  * @param direction The direction. Either ascending or descending.
2866
4026
  * @returns A new Query object.
2867
4027
  */
2868
- sort<F extends SelectableColumn<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
4028
+ sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
2869
4029
  /**
2870
4030
  * Builds a new query specifying the set of columns to be returned in the query response.
2871
4031
  * @param columns Array of column names to be returned by the query.
2872
4032
  * @returns A new Query object.
2873
4033
  */
2874
- select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
4034
+ select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
4035
+ /**
4036
+ * Get paginated results
4037
+ *
4038
+ * @returns A page of results
4039
+ */
2875
4040
  getPaginated(): Promise<Page<Record, Result>>;
2876
- getPaginated(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
4041
+ /**
4042
+ * Get paginated results
4043
+ *
4044
+ * @param options Pagination options
4045
+ * @returns A page of results
4046
+ */
4047
+ getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
4048
+ /**
4049
+ * Get paginated results
4050
+ *
4051
+ * @param options Pagination options
4052
+ * @returns A page of results
4053
+ */
2877
4054
  getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
4055
+ /**
4056
+ * Get results in an iterator
4057
+ *
4058
+ * @async
4059
+ * @returns Async interable of results
4060
+ */
2878
4061
  [Symbol.asyncIterator](): AsyncIterableIterator<Result>;
2879
- getIterator(chunk: number): AsyncGenerator<Result[]>;
2880
- getIterator(chunk: number, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): AsyncGenerator<Result[]>;
2881
- getIterator<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number, options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
2882
4062
  /**
2883
- * Performs the query in the database and returns a set of results.
4063
+ * Build an iterator of results
4064
+ *
4065
+ * @returns Async generator of results array
4066
+ */
4067
+ getIterator(): AsyncGenerator<Result[]>;
4068
+ /**
4069
+ * Build an iterator of results
4070
+ *
4071
+ * @param options Pagination options with batchSize
4072
+ * @returns Async generator of results array
4073
+ */
4074
+ getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
4075
+ batchSize?: number;
4076
+ }): AsyncGenerator<Result[]>;
4077
+ /**
4078
+ * Build an iterator of results
4079
+ *
4080
+ * @param options Pagination options with batchSize
4081
+ * @returns Async generator of results array
4082
+ */
4083
+ getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
4084
+ batchSize?: number;
4085
+ }>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
4086
+ /**
4087
+ * Performs the query in the database and returns a set of results.
4088
+ * @returns An array of records from the database.
4089
+ */
4090
+ getMany(): Promise<RecordArray<Result>>;
4091
+ /**
4092
+ * Performs the query in the database and returns a set of results.
4093
+ * @param options Additional options to be used when performing the query.
4094
+ * @returns An array of records from the database.
4095
+ */
4096
+ getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
4097
+ /**
4098
+ * Performs the query in the database and returns a set of results.
4099
+ * @param options Additional options to be used when performing the query.
4100
+ * @returns An array of records from the database.
4101
+ */
4102
+ getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
4103
+ /**
4104
+ * Performs the query in the database and returns all the results.
4105
+ * Warning: If there are a large number of results, this method can have performance implications.
4106
+ * @returns An array of records from the database.
4107
+ */
4108
+ getAll(): Promise<Result[]>;
4109
+ /**
4110
+ * Performs the query in the database and returns all the results.
4111
+ * Warning: If there are a large number of results, this method can have performance implications.
4112
+ * @param options Additional options to be used when performing the query.
4113
+ * @returns An array of records from the database.
4114
+ */
4115
+ getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
4116
+ batchSize?: number;
4117
+ }>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
4118
+ /**
4119
+ * Performs the query in the database and returns all the results.
4120
+ * Warning: If there are a large number of results, this method can have performance implications.
4121
+ * @param options Additional options to be used when performing the query.
4122
+ * @returns An array of records from the database.
4123
+ */
4124
+ getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
4125
+ batchSize?: number;
4126
+ }): Promise<Result[]>;
4127
+ /**
4128
+ * Performs the query in the database and returns the first result.
4129
+ * @returns The first record that matches the query, or null if no record matched the query.
4130
+ */
4131
+ getFirst(): Promise<Result | null>;
4132
+ /**
4133
+ * Performs the query in the database and returns the first result.
4134
+ * @param options Additional options to be used when performing the query.
4135
+ * @returns The first record that matches the query, or null if no record matched the query.
4136
+ */
4137
+ getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
4138
+ /**
4139
+ * Performs the query in the database and returns the first result.
2884
4140
  * @param options Additional options to be used when performing the query.
2885
- * @returns An array of records from the database.
4141
+ * @returns The first record that matches the query, or null if no record matched the query.
2886
4142
  */
2887
- getMany(): Promise<Result[]>;
2888
- getMany(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
2889
- getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
4143
+ getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
2890
4144
  /**
2891
- * Performs the query in the database and returns all the results.
2892
- * Warning: If there are a large number of results, this method can have performance implications.
4145
+ * Performs the query in the database and returns the first result.
4146
+ * @returns The first record that matches the query, or null if no record matched the query.
4147
+ * @throws if there are no results.
4148
+ */
4149
+ getFirstOrThrow(): Promise<Result>;
4150
+ /**
4151
+ * Performs the query in the database and returns the first result.
2893
4152
  * @param options Additional options to be used when performing the query.
2894
- * @returns An array of records from the database.
4153
+ * @returns The first record that matches the query, or null if no record matched the query.
4154
+ * @throws if there are no results.
2895
4155
  */
2896
- getAll(chunk?: number): Promise<Result[]>;
2897
- getAll(chunk: number | undefined, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result[]>;
2898
- getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number | undefined, options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
4156
+ getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
2899
4157
  /**
2900
4158
  * Performs the query in the database and returns the first result.
2901
4159
  * @param options Additional options to be used when performing the query.
2902
4160
  * @returns The first record that matches the query, or null if no record matched the query.
4161
+ * @throws if there are no results.
2903
4162
  */
2904
- getFirst(): Promise<Result | null>;
2905
- getFirst(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
2906
- getFirst<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
4163
+ getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
2907
4164
  /**
2908
4165
  * Builds a new query object adding a cache TTL in milliseconds.
2909
4166
  * @param ttl The cache TTL in milliseconds.
2910
4167
  * @returns A new Query object.
2911
4168
  */
2912
4169
  cache(ttl: number): Query<Record, Result>;
4170
+ /**
4171
+ * Retrieve next page of records
4172
+ *
4173
+ * @returns A new page object.
4174
+ */
2913
4175
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4176
+ /**
4177
+ * Retrieve previous page of records
4178
+ *
4179
+ * @returns A new page object
4180
+ */
2914
4181
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4182
+ /**
4183
+ * Retrieve first page of records
4184
+ *
4185
+ * @returns A new page object
4186
+ */
2915
4187
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4188
+ /**
4189
+ * Retrieve last page of records
4190
+ *
4191
+ * @returns A new page object
4192
+ */
2916
4193
  lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
4194
+ /**
4195
+ * @returns Boolean indicating if there is a next page
4196
+ */
2917
4197
  hasNextPage(): boolean;
2918
4198
  }
2919
4199
 
@@ -2925,7 +4205,7 @@ declare type PaginationQueryMeta = {
2925
4205
  };
2926
4206
  interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
2927
4207
  meta: PaginationQueryMeta;
2928
- records: Result[];
4208
+ records: RecordArray<Result>;
2929
4209
  nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2930
4210
  previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
2931
4211
  firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
@@ -2945,7 +4225,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
2945
4225
  /**
2946
4226
  * The set of results for this page.
2947
4227
  */
2948
- readonly records: Result[];
4228
+ readonly records: RecordArray<Result>;
2949
4229
  constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
2950
4230
  /**
2951
4231
  * Retrieves the next page of results.
@@ -2993,64 +4273,305 @@ declare type OffsetNavigationOptions = {
2993
4273
  size?: number;
2994
4274
  offset?: number;
2995
4275
  };
2996
- declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
2997
4276
  declare const PAGINATION_MAX_SIZE = 200;
2998
- declare const PAGINATION_DEFAULT_SIZE = 200;
4277
+ declare const PAGINATION_DEFAULT_SIZE = 20;
2999
4278
  declare const PAGINATION_MAX_OFFSET = 800;
3000
4279
  declare const PAGINATION_DEFAULT_OFFSET = 0;
4280
+ declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
4281
+ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
4282
+ #private;
4283
+ constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
4284
+ static parseConstructorParams(...args: any[]): any[];
4285
+ toArray(): Result[];
4286
+ map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
4287
+ /**
4288
+ * Retrieve next page of records
4289
+ *
4290
+ * @returns A new array of objects
4291
+ */
4292
+ nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4293
+ /**
4294
+ * Retrieve previous page of records
4295
+ *
4296
+ * @returns A new array of objects
4297
+ */
4298
+ previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4299
+ /**
4300
+ * Retrieve first page of records
4301
+ *
4302
+ * @returns A new array of objects
4303
+ */
4304
+ firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4305
+ /**
4306
+ * Retrieve last page of records
4307
+ *
4308
+ * @returns A new array of objects
4309
+ */
4310
+ lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
4311
+ /**
4312
+ * @returns Boolean indicating if there is a next page
4313
+ */
4314
+ hasNextPage(): boolean;
4315
+ }
3001
4316
 
3002
- declare type TableLink = string[];
3003
- declare type LinkDictionary = Dictionary<TableLink[]>;
3004
4317
  /**
3005
4318
  * Common interface for performing operations on a table.
3006
4319
  */
3007
- declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
3008
- abstract create(object: EditableData<Data> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4320
+ declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
4321
+ abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4322
+ abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4323
+ /**
4324
+ * Creates a single record in the table with a unique id.
4325
+ * @param id The unique id.
4326
+ * @param object Object containing the column names with their values to be stored in the table.
4327
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4328
+ * @returns The full persisted record.
4329
+ */
4330
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3009
4331
  /**
3010
4332
  * Creates a single record in the table with a unique id.
3011
4333
  * @param id The unique id.
3012
4334
  * @param object Object containing the column names with their values to be stored in the table.
3013
4335
  * @returns The full persisted record.
3014
4336
  */
3015
- abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4337
+ abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3016
4338
  /**
3017
4339
  * Creates multiple records in the table.
3018
4340
  * @param objects Array of objects with the column names and the values to be stored in the table.
3019
- * @returns Array of the persisted records.
4341
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4342
+ * @returns Array of the persisted records in order.
4343
+ */
4344
+ abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4345
+ /**
4346
+ * Creates multiple records in the table.
4347
+ * @param objects Array of objects with the column names and the values to be stored in the table.
4348
+ * @returns Array of the persisted records in order.
3020
4349
  */
3021
- abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4350
+ abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4351
+ /**
4352
+ * Queries a single record from the table given its unique id.
4353
+ * @param id The unique id.
4354
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4355
+ * @returns The persisted record for the given id or null if the record could not be found.
4356
+ */
4357
+ abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3022
4358
  /**
3023
4359
  * Queries a single record from the table given its unique id.
3024
4360
  * @param id The unique id.
3025
4361
  * @returns The persisted record for the given id or null if the record could not be found.
3026
4362
  */
3027
4363
  abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4364
+ /**
4365
+ * Queries multiple records from the table given their unique id.
4366
+ * @param ids The unique ids array.
4367
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4368
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4369
+ */
4370
+ abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4371
+ /**
4372
+ * Queries multiple records from the table given their unique id.
4373
+ * @param ids The unique ids array.
4374
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4375
+ */
4376
+ abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4377
+ /**
4378
+ * Queries a single record from the table by the id in the object.
4379
+ * @param object Object containing the id of the record.
4380
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4381
+ * @returns The persisted record for the given id or null if the record could not be found.
4382
+ */
4383
+ abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
4384
+ /**
4385
+ * Queries a single record from the table by the id in the object.
4386
+ * @param object Object containing the id of the record.
4387
+ * @returns The persisted record for the given id or null if the record could not be found.
4388
+ */
4389
+ abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4390
+ /**
4391
+ * Queries multiple records from the table by the ids in the objects.
4392
+ * @param objects Array of objects containing the ids of the records.
4393
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4394
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4395
+ */
4396
+ abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4397
+ /**
4398
+ * Queries multiple records from the table by the ids in the objects.
4399
+ * @param objects Array of objects containing the ids of the records.
4400
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
4401
+ */
4402
+ abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4403
+ /**
4404
+ * Queries a single record from the table given its unique id.
4405
+ * @param id The unique id.
4406
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4407
+ * @returns The persisted record for the given id.
4408
+ * @throws If the record could not be found.
4409
+ */
4410
+ abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4411
+ /**
4412
+ * Queries a single record from the table given its unique id.
4413
+ * @param id The unique id.
4414
+ * @returns The persisted record for the given id.
4415
+ * @throws If the record could not be found.
4416
+ */
4417
+ abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4418
+ /**
4419
+ * Queries multiple records from the table given their unique id.
4420
+ * @param ids The unique ids array.
4421
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4422
+ * @returns The persisted records for the given ids in order.
4423
+ * @throws If one or more records could not be found.
4424
+ */
4425
+ abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4426
+ /**
4427
+ * Queries multiple records from the table given their unique id.
4428
+ * @param ids The unique ids array.
4429
+ * @returns The persisted records for the given ids in order.
4430
+ * @throws If one or more records could not be found.
4431
+ */
4432
+ abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
4433
+ /**
4434
+ * Queries a single record from the table by the id in the object.
4435
+ * @param object Object containing the id of the record.
4436
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4437
+ * @returns The persisted record for the given id.
4438
+ * @throws If the record could not be found.
4439
+ */
4440
+ abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4441
+ /**
4442
+ * Queries a single record from the table by the id in the object.
4443
+ * @param object Object containing the id of the record.
4444
+ * @returns The persisted record for the given id.
4445
+ * @throws If the record could not be found.
4446
+ */
4447
+ abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4448
+ /**
4449
+ * Queries multiple records from the table by the ids in the objects.
4450
+ * @param objects Array of objects containing the ids of the records.
4451
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4452
+ * @returns The persisted records for the given ids in order.
4453
+ * @throws If one or more records could not be found.
4454
+ */
4455
+ abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4456
+ /**
4457
+ * Queries multiple records from the table by the ids in the objects.
4458
+ * @param objects Array of objects containing the ids of the records.
4459
+ * @returns The persisted records for the given ids in order.
4460
+ * @throws If one or more records could not be found.
4461
+ */
4462
+ abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
4463
+ /**
4464
+ * Partially update a single record.
4465
+ * @param object An object with its id and the columns to be updated.
4466
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4467
+ * @returns The full persisted record, null if the record could not be found.
4468
+ */
4469
+ abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4470
+ /**
4471
+ * Partially update a single record.
4472
+ * @param object An object with its id and the columns to be updated.
4473
+ * @returns The full persisted record, null if the record could not be found.
4474
+ */
4475
+ abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4476
+ /**
4477
+ * Partially update a single record given its unique id.
4478
+ * @param id The unique id.
4479
+ * @param object The column names and their values that have to be updated.
4480
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4481
+ * @returns The full persisted record, null if the record could not be found.
4482
+ */
4483
+ abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4484
+ /**
4485
+ * Partially update a single record given its unique id.
4486
+ * @param id The unique id.
4487
+ * @param object The column names and their values that have to be updated.
4488
+ * @returns The full persisted record, null if the record could not be found.
4489
+ */
4490
+ abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4491
+ /**
4492
+ * Partially updates multiple records.
4493
+ * @param objects An array of objects with their ids and columns to be updated.
4494
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4495
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
4496
+ */
4497
+ abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4498
+ /**
4499
+ * Partially updates multiple records.
4500
+ * @param objects An array of objects with their ids and columns to be updated.
4501
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
4502
+ */
4503
+ abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4504
+ /**
4505
+ * Partially update a single record.
4506
+ * @param object An object with its id and the columns to be updated.
4507
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4508
+ * @returns The full persisted record.
4509
+ * @throws If the record could not be found.
4510
+ */
4511
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3028
4512
  /**
3029
4513
  * Partially update a single record.
3030
4514
  * @param object An object with its id and the columns to be updated.
3031
4515
  * @returns The full persisted record.
4516
+ * @throws If the record could not be found.
4517
+ */
4518
+ abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4519
+ /**
4520
+ * Partially update a single record given its unique id.
4521
+ * @param id The unique id.
4522
+ * @param object The column names and their values that have to be updated.
4523
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4524
+ * @returns The full persisted record.
4525
+ * @throws If the record could not be found.
3032
4526
  */
3033
- abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4527
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3034
4528
  /**
3035
4529
  * Partially update a single record given its unique id.
3036
4530
  * @param id The unique id.
3037
4531
  * @param object The column names and their values that have to be updated.
3038
4532
  * @returns The full persisted record.
4533
+ * @throws If the record could not be found.
3039
4534
  */
3040
- abstract update(id: string, object: Partial<EditableData<Data>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4535
+ abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3041
4536
  /**
3042
4537
  * Partially updates multiple records.
3043
4538
  * @param objects An array of objects with their ids and columns to be updated.
3044
- * @returns Array of the persisted records.
4539
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4540
+ * @returns Array of the persisted records in order.
4541
+ * @throws If one or more records could not be found.
4542
+ */
4543
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4544
+ /**
4545
+ * Partially updates multiple records.
4546
+ * @param objects An array of objects with their ids and columns to be updated.
4547
+ * @returns Array of the persisted records in order.
4548
+ * @throws If one or more records could not be found.
4549
+ */
4550
+ abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4551
+ /**
4552
+ * Creates or updates a single record. If a record exists with the given id,
4553
+ * it will be update, otherwise a new record will be created.
4554
+ * @param object Object containing the column names with their values to be persisted in the table.
4555
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4556
+ * @returns The full persisted record.
3045
4557
  */
3046
- abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4558
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3047
4559
  /**
3048
4560
  * Creates or updates a single record. If a record exists with the given id,
3049
4561
  * it will be update, otherwise a new record will be created.
3050
4562
  * @param object Object containing the column names with their values to be persisted in the table.
3051
4563
  * @returns The full persisted record.
3052
4564
  */
3053
- abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4565
+ abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4566
+ /**
4567
+ * Creates or updates a single record. If a record exists with the given id,
4568
+ * it will be update, otherwise a new record will be created.
4569
+ * @param id A unique id.
4570
+ * @param object The column names and the values to be persisted.
4571
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4572
+ * @returns The full persisted record.
4573
+ */
4574
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3054
4575
  /**
3055
4576
  * Creates or updates a single record. If a record exists with the given id,
3056
4577
  * it will be update, otherwise a new record will be created.
@@ -3058,38 +4579,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3058
4579
  * @param object The column names and the values to be persisted.
3059
4580
  * @returns The full persisted record.
3060
4581
  */
3061
- abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4582
+ abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4583
+ /**
4584
+ * Creates or updates a single record. If a record exists with the given id,
4585
+ * it will be update, otherwise a new record will be created.
4586
+ * @param objects Array of objects with the column names and the values to be stored in the table.
4587
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4588
+ * @returns Array of the persisted records.
4589
+ */
4590
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3062
4591
  /**
3063
4592
  * Creates or updates a single record. If a record exists with the given id,
3064
4593
  * it will be update, otherwise a new record will be created.
3065
4594
  * @param objects Array of objects with the column names and the values to be stored in the table.
3066
4595
  * @returns Array of the persisted records.
3067
4596
  */
3068
- abstract createOrUpdate(objects: Array<EditableData<Data> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4597
+ abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3069
4598
  /**
3070
4599
  * Deletes a record given its unique id.
4600
+ * @param object An object with a unique id.
4601
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4602
+ * @returns The deleted record, null if the record could not be found.
4603
+ */
4604
+ abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4605
+ /**
4606
+ * Deletes a record given its unique id.
4607
+ * @param object An object with a unique id.
4608
+ * @returns The deleted record, null if the record could not be found.
4609
+ */
4610
+ abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4611
+ /**
4612
+ * Deletes a record given a unique id.
4613
+ * @param id The unique id.
4614
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4615
+ * @returns The deleted record, null if the record could not be found.
4616
+ */
4617
+ abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4618
+ /**
4619
+ * Deletes a record given a unique id.
3071
4620
  * @param id The unique id.
3072
- * @throws If the record could not be found or there was an error while performing the deletion.
4621
+ * @returns The deleted record, null if the record could not be found.
4622
+ */
4623
+ abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4624
+ /**
4625
+ * Deletes multiple records given an array of objects with ids.
4626
+ * @param objects An array of objects with unique ids.
4627
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4628
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4629
+ */
4630
+ abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4631
+ /**
4632
+ * Deletes multiple records given an array of objects with ids.
4633
+ * @param objects An array of objects with unique ids.
4634
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
3073
4635
  */
3074
- abstract delete(id: string): Promise<void>;
4636
+ abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4637
+ /**
4638
+ * Deletes multiple records given an array of unique ids.
4639
+ * @param objects An array of ids.
4640
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4641
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4642
+ */
4643
+ abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4644
+ /**
4645
+ * Deletes multiple records given an array of unique ids.
4646
+ * @param objects An array of ids.
4647
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4648
+ */
4649
+ abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3075
4650
  /**
3076
4651
  * Deletes a record given its unique id.
3077
- * @param id An object with a unique id.
3078
- * @throws If the record could not be found or there was an error while performing the deletion.
4652
+ * @param object An object with a unique id.
4653
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4654
+ * @returns The deleted record, null if the record could not be found.
4655
+ * @throws If the record could not be found.
4656
+ */
4657
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4658
+ /**
4659
+ * Deletes a record given its unique id.
4660
+ * @param object An object with a unique id.
4661
+ * @returns The deleted record, null if the record could not be found.
4662
+ * @throws If the record could not be found.
4663
+ */
4664
+ abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4665
+ /**
4666
+ * Deletes a record given a unique id.
4667
+ * @param id The unique id.
4668
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4669
+ * @returns The deleted record, null if the record could not be found.
4670
+ * @throws If the record could not be found.
4671
+ */
4672
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4673
+ /**
4674
+ * Deletes a record given a unique id.
4675
+ * @param id The unique id.
4676
+ * @returns The deleted record, null if the record could not be found.
4677
+ * @throws If the record could not be found.
4678
+ */
4679
+ abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4680
+ /**
4681
+ * Deletes multiple records given an array of objects with ids.
4682
+ * @param objects An array of objects with unique ids.
4683
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4684
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4685
+ * @throws If one or more records could not be found.
4686
+ */
4687
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4688
+ /**
4689
+ * Deletes multiple records given an array of objects with ids.
4690
+ * @param objects An array of objects with unique ids.
4691
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4692
+ * @throws If one or more records could not be found.
3079
4693
  */
3080
- abstract delete(id: Identifiable): Promise<void>;
4694
+ abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3081
4695
  /**
3082
- * Deletes a record given a list of unique ids.
3083
- * @param ids The array of unique ids.
3084
- * @throws If the record could not be found or there was an error while performing the deletion.
4696
+ * Deletes multiple records given an array of unique ids.
4697
+ * @param objects An array of ids.
4698
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
4699
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
4700
+ * @throws If one or more records could not be found.
3085
4701
  */
3086
- abstract delete(ids: string[]): Promise<void>;
4702
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3087
4703
  /**
3088
- * Deletes a record given a list of unique ids.
3089
- * @param ids An array of objects with unique ids.
3090
- * @throws If the record could not be found or there was an error while performing the deletion.
4704
+ * Deletes multiple records given an array of unique ids.
4705
+ * @param objects An array of ids.
4706
+ * @returns Array of the deleted records in order.
4707
+ * @throws If one or more records could not be found.
3091
4708
  */
3092
- abstract delete(ids: Identifiable[]): Promise<void>;
4709
+ abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3093
4710
  /**
3094
4711
  * Search for records in the table.
3095
4712
  * @param query The query to search for.
@@ -3097,36 +4714,152 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3097
4714
  * @returns The found records.
3098
4715
  */
3099
4716
  abstract search(query: string, options?: {
3100
- fuzziness?: number;
3101
- }): Promise<SelectedPick<Record, ['*']>[]>;
4717
+ fuzziness?: FuzzinessExpression;
4718
+ prefix?: PrefixExpression;
4719
+ highlight?: HighlightExpression;
4720
+ filter?: Filter<Record>;
4721
+ boosters?: Boosters<Record>[];
4722
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3102
4723
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3103
4724
  }
3104
- declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
4725
+ declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
3105
4726
  #private;
3106
- db: SchemaPluginResult<any>;
3107
4727
  constructor(options: {
3108
4728
  table: string;
3109
- links?: LinkDictionary;
3110
4729
  db: SchemaPluginResult<any>;
3111
4730
  pluginOptions: XataPluginOptions;
4731
+ schemaTables?: Table[];
3112
4732
  });
3113
- create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3114
- create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3115
- create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3116
- read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
3117
- update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3118
- update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3119
- update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3120
- createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3121
- createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3122
- createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3123
- delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
4733
+ create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4734
+ create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4735
+ create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4736
+ create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4737
+ create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4738
+ create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4739
+ read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
4740
+ read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4741
+ read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4742
+ read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4743
+ read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
4744
+ read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
4745
+ read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4746
+ read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4747
+ readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4748
+ readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4749
+ readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4750
+ readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
4751
+ readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4752
+ readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4753
+ readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4754
+ readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
4755
+ update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4756
+ update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4757
+ update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4758
+ update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4759
+ update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4760
+ update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4761
+ updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4762
+ updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4763
+ updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4764
+ updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4765
+ updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4766
+ updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4767
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4768
+ createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4769
+ createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4770
+ createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4771
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
4772
+ createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
4773
+ delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4774
+ delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4775
+ delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
4776
+ delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4777
+ delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4778
+ delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4779
+ delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
4780
+ delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
4781
+ deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4782
+ deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4783
+ deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
4784
+ deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4785
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4786
+ deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
4787
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
4788
+ deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3124
4789
  search(query: string, options?: {
3125
- fuzziness?: number;
3126
- }): Promise<SelectedPick<Record, ['*']>[]>;
4790
+ fuzziness?: FuzzinessExpression;
4791
+ prefix?: PrefixExpression;
4792
+ highlight?: HighlightExpression;
4793
+ filter?: Filter<Record>;
4794
+ boosters?: Boosters<Record>[];
4795
+ }): Promise<any>;
3127
4796
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3128
4797
  }
3129
4798
 
4799
+ declare type BaseSchema = {
4800
+ name: string;
4801
+ columns: readonly ({
4802
+ name: string;
4803
+ type: Column['type'];
4804
+ notNull?: boolean;
4805
+ } | {
4806
+ name: string;
4807
+ type: 'link';
4808
+ link: {
4809
+ table: string;
4810
+ };
4811
+ } | {
4812
+ name: string;
4813
+ type: 'object';
4814
+ columns: {
4815
+ name: string;
4816
+ type: string;
4817
+ }[];
4818
+ })[];
4819
+ };
4820
+ declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
4821
+ name: string;
4822
+ columns: readonly unknown[];
4823
+ } ? {
4824
+ [K in T[number]['name']]: TableType<T[number], K>;
4825
+ } : never : never;
4826
+ declare type TableType<Tables, TableName> = Tables & {
4827
+ name: TableName;
4828
+ } extends infer Table ? Table extends {
4829
+ name: string;
4830
+ columns: infer Columns;
4831
+ } ? Columns extends readonly unknown[] ? Columns[number] extends {
4832
+ name: string;
4833
+ type: string;
4834
+ } ? Identifiable & UnionToIntersection<Values<{
4835
+ [K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
4836
+ }>> : never : never : never : never;
4837
+ declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
4838
+ name: PropertyName;
4839
+ } extends infer Property ? Property extends {
4840
+ name: string;
4841
+ type: infer Type;
4842
+ link?: {
4843
+ table: infer LinkedTable;
4844
+ };
4845
+ columns?: infer ObjectColumns;
4846
+ notNull?: infer NotNull;
4847
+ } ? NotNull extends true ? {
4848
+ [K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
4849
+ } : {
4850
+ [K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
4851
+ } : never : never;
4852
+ declare type InnerType<Type, ObjectColumns, Tables, LinkedTable> = Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
4853
+ name: string;
4854
+ type: string;
4855
+ } ? UnionToIntersection<Values<{
4856
+ [K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
4857
+ }>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
4858
+
4859
+ /**
4860
+ * Operator to restrict results to only values that are greater than the given value.
4861
+ */
4862
+ declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3130
4863
  /**
3131
4864
  * Operator to restrict results to only values that are greater than the given value.
3132
4865
  */
@@ -3134,15 +4867,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
3134
4867
  /**
3135
4868
  * Operator to restrict results to only values that are greater than or equal to the given value.
3136
4869
  */
3137
- declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4870
+ declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4871
+ /**
4872
+ * Operator to restrict results to only values that are greater than or equal to the given value.
4873
+ */
4874
+ declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3138
4875
  /**
3139
4876
  * Operator to restrict results to only values that are greater than or equal to the given value.
3140
4877
  */
3141
4878
  declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4879
+ /**
4880
+ * Operator to restrict results to only values that are greater than or equal to the given value.
4881
+ */
4882
+ declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4883
+ /**
4884
+ * Operator to restrict results to only values that are lower than the given value.
4885
+ */
4886
+ declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3142
4887
  /**
3143
4888
  * Operator to restrict results to only values that are lower than the given value.
3144
4889
  */
3145
4890
  declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4891
+ /**
4892
+ * Operator to restrict results to only values that are lower than or equal to the given value.
4893
+ */
4894
+ declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
4895
+ /**
4896
+ * Operator to restrict results to only values that are lower than or equal to the given value.
4897
+ */
4898
+ declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3146
4899
  /**
3147
4900
  * Operator to restrict results to only values that are lower than or equal to the given value.
3148
4901
  */
@@ -3175,6 +4928,10 @@ declare const pattern: (value: string) => StringTypeFilter;
3175
4928
  * Operator to restrict results to only values that are equal to the given value.
3176
4929
  */
3177
4930
  declare const is: <T>(value: T) => PropertyFilter<T>;
4931
+ /**
4932
+ * Operator to restrict results to only values that are equal to the given value.
4933
+ */
4934
+ declare const equals: <T>(value: T) => PropertyFilter<T>;
3178
4935
  /**
3179
4936
  * Operator to restrict results to only values that are not equal to the given value.
3180
4937
  */
@@ -3202,49 +4959,16 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3202
4959
 
3203
4960
  declare type SchemaDefinition = {
3204
4961
  table: string;
3205
- links?: LinkDictionary;
3206
4962
  };
3207
- declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
4963
+ declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
3208
4964
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
3209
- } & {
3210
- [key: string]: Repository<XataRecord$1>;
3211
4965
  };
3212
- declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
4966
+ declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3213
4967
  #private;
3214
- private links?;
3215
- private tableNames?;
3216
- constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
4968
+ constructor(schemaTables?: Schemas.Table[]);
3217
4969
  build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3218
4970
  }
3219
4971
 
3220
- declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3221
- fuzziness?: number;
3222
- tables?: Tables[];
3223
- };
3224
- declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3225
- all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3226
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
3227
- table: Model;
3228
- record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3229
- };
3230
- }>[]>;
3231
- byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3232
- [Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3233
- }>;
3234
- };
3235
- declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3236
- #private;
3237
- private db;
3238
- private links;
3239
- constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
3240
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3241
- }
3242
- declare type SearchXataRecord = XataRecord & {
3243
- xata: {
3244
- table: string;
3245
- };
3246
- };
3247
-
3248
4972
  declare type BranchStrategyValue = string | undefined | null;
3249
4973
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3250
4974
  declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
@@ -3256,20 +4980,35 @@ declare type BaseClientOptions = {
3256
4980
  databaseURL?: string;
3257
4981
  branch?: BranchStrategyOption;
3258
4982
  cache?: CacheImpl;
4983
+ trace?: TraceFunction;
3259
4984
  };
3260
4985
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3261
4986
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3262
- new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, links?: LinkDictionary): Omit<{
4987
+ new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
3263
4988
  db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
3264
4989
  search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
3265
4990
  }, keyof Plugins> & {
3266
4991
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
4992
+ } & {
4993
+ getConfig(): Promise<{
4994
+ databaseURL: string;
4995
+ branch: string;
4996
+ }>;
3267
4997
  };
3268
4998
  }
3269
4999
  declare const BaseClient_base: ClientConstructor<{}>;
3270
5000
  declare class BaseClient extends BaseClient_base<Record<string, any>> {
3271
5001
  }
3272
5002
 
5003
+ declare class Serializer {
5004
+ classes: Record<string, any>;
5005
+ add(clazz: any): void;
5006
+ toJSON<T>(data: T): string;
5007
+ fromJSON<T>(json: string): T;
5008
+ }
5009
+ declare const serialize: <T>(data: T) => string;
5010
+ declare const deserialize: <T>(json: string) => T;
5011
+
3273
5012
  declare type BranchResolutionOptions = {
3274
5013
  databaseURL?: string;
3275
5014
  apiKey?: string;
@@ -3281,9 +5020,89 @@ declare function getDatabaseURL(): string | undefined;
3281
5020
 
3282
5021
  declare function getAPIKey(): string | undefined;
3283
5022
 
5023
+ interface Body {
5024
+ arrayBuffer(): Promise<ArrayBuffer>;
5025
+ blob(): Promise<Blob>;
5026
+ formData(): Promise<FormData>;
5027
+ json(): Promise<any>;
5028
+ text(): Promise<string>;
5029
+ }
5030
+ interface Blob {
5031
+ readonly size: number;
5032
+ readonly type: string;
5033
+ arrayBuffer(): Promise<ArrayBuffer>;
5034
+ slice(start?: number, end?: number, contentType?: string): Blob;
5035
+ text(): Promise<string>;
5036
+ }
5037
+ /** Provides information about files and allows JavaScript in a web page to access their content. */
5038
+ interface File extends Blob {
5039
+ readonly lastModified: number;
5040
+ readonly name: string;
5041
+ readonly webkitRelativePath: string;
5042
+ }
5043
+ declare type FormDataEntryValue = File | string;
5044
+ /** 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". */
5045
+ interface FormData {
5046
+ append(name: string, value: string | Blob, fileName?: string): void;
5047
+ delete(name: string): void;
5048
+ get(name: string): FormDataEntryValue | null;
5049
+ getAll(name: string): FormDataEntryValue[];
5050
+ has(name: string): boolean;
5051
+ set(name: string, value: string | Blob, fileName?: string): void;
5052
+ forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
5053
+ }
5054
+ /** 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. */
5055
+ interface Headers {
5056
+ append(name: string, value: string): void;
5057
+ delete(name: string): void;
5058
+ get(name: string): string | null;
5059
+ has(name: string): boolean;
5060
+ set(name: string, value: string): void;
5061
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
5062
+ }
5063
+ interface Request extends Body {
5064
+ /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
5065
+ readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
5066
+ /** 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. */
5067
+ readonly credentials: 'include' | 'omit' | 'same-origin';
5068
+ /** Returns the kind of resource requested by request, e.g., "document" or "script". */
5069
+ readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
5070
+ /** 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. */
5071
+ readonly headers: Headers;
5072
+ /** 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] */
5073
+ readonly integrity: string;
5074
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
5075
+ readonly keepalive: boolean;
5076
+ /** Returns request's HTTP method, which is "GET" by default. */
5077
+ readonly method: string;
5078
+ /** 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. */
5079
+ readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
5080
+ /** 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. */
5081
+ readonly redirect: 'error' | 'follow' | 'manual';
5082
+ /** 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. */
5083
+ readonly referrer: string;
5084
+ /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
5085
+ readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
5086
+ /** Returns the URL of request as a string. */
5087
+ readonly url: string;
5088
+ clone(): Request;
5089
+ }
5090
+
5091
+ declare type XataWorkerContext<XataClient> = {
5092
+ xata: XataClient;
5093
+ request: Request;
5094
+ env: Record<string, string | undefined>;
5095
+ };
5096
+ declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
5097
+ declare type WorkerRunnerConfig = {
5098
+ workspace: string;
5099
+ worker: string;
5100
+ };
5101
+ 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>>>;
5102
+
3284
5103
  declare class XataError extends Error {
3285
5104
  readonly status: number;
3286
5105
  constructor(message: string, status: number);
3287
5106
  }
3288
5107
 
3289
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, 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, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, LinkDictionary, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, 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, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
5108
+ 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, 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, SummarizeTableError, SummarizeTablePathParams, SummarizeTableRequestBody, SummarizeTableVariables, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaResponse, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateDatabaseMetadataError, UpdateDatabaseMetadataPathParams, UpdateDatabaseMetadataRequestBody, UpdateDatabaseMetadataVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, 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, pattern, previewBranchSchemaEdit, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };