@xata.io/client 0.0.0-alpha.vfe4ae98 → 0.0.0-alpha.vfe9bed6

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,17 +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>;
9
15
  headers?: {
10
16
  get(name: string): string | null;
11
17
  };
12
18
  }>;
13
- declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
19
+ declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
14
20
  declare type FetcherExtraProps = {
15
21
  apiUrl: string;
16
22
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
17
23
  fetchImpl: FetchImpl;
18
24
  apiKey: string;
25
+ trace: TraceFunction;
19
26
  };
20
27
  declare type ErrorWrapper<TError> = TError | {
21
28
  status: 'unknown';
@@ -23,7 +30,6 @@ declare type ErrorWrapper<TError> = TError | {
23
30
  };
24
31
 
25
32
  interface CacheImpl {
26
- cacheRecords: boolean;
27
33
  defaultQueryTTL: number;
28
34
  getAll(): Promise<Record<string, unknown>>;
29
35
  get: <T>(key: string) => Promise<T | null>;
@@ -33,13 +39,11 @@ interface CacheImpl {
33
39
  }
34
40
  interface SimpleCacheOptions {
35
41
  max?: number;
36
- cacheRecords?: boolean;
37
42
  defaultQueryTTL?: number;
38
43
  }
39
44
  declare class SimpleCache implements CacheImpl {
40
45
  #private;
41
46
  capacity: number;
42
- cacheRecords: boolean;
43
47
  defaultQueryTTL: number;
44
48
  constructor(options?: SimpleCacheOptions);
45
49
  getAll(): Promise<Record<string, unknown>>;
@@ -55,6 +59,7 @@ declare abstract class XataPlugin {
55
59
  declare type XataPluginOptions = {
56
60
  getFetchProps: () => Promise<FetcherExtraProps>;
57
61
  cache: CacheImpl;
62
+ trace?: TraceFunction;
58
63
  };
59
64
 
60
65
  /**
@@ -63,6 +68,9 @@ declare type XataPluginOptions = {
63
68
  * @version 1.0
64
69
  */
65
70
  declare type User = {
71
+ /**
72
+ * @format email
73
+ */
66
74
  email: string;
67
75
  fullname: string;
68
76
  image: string;
@@ -94,7 +102,7 @@ declare type WorkspaceID = string;
94
102
  declare type Role = 'owner' | 'maintainer';
95
103
  declare type WorkspaceMeta = {
96
104
  name: string;
97
- slug: string;
105
+ slug?: string;
98
106
  };
99
107
  declare type Workspace = WorkspaceMeta & {
100
108
  id: WorkspaceID;
@@ -104,6 +112,9 @@ declare type Workspace = WorkspaceMeta & {
104
112
  declare type WorkspaceMember = {
105
113
  userId: UserID;
106
114
  fullname: string;
115
+ /**
116
+ * @format email
117
+ */
107
118
  email: string;
108
119
  role: Role;
109
120
  };
@@ -113,7 +124,13 @@ declare type WorkspaceMember = {
113
124
  declare type InviteID = string;
114
125
  declare type WorkspaceInvite = {
115
126
  inviteId: InviteID;
127
+ /**
128
+ * @format email
129
+ */
116
130
  email: string;
131
+ /**
132
+ * @format date-time
133
+ */
117
134
  expires: string;
118
135
  role: Role;
119
136
  };
@@ -125,20 +142,40 @@ declare type WorkspaceMembers = {
125
142
  * @pattern ^ik_[a-zA-Z0-9]+
126
143
  */
127
144
  declare type InviteKey = string;
145
+ /**
146
+ * Metadata of databases
147
+ */
148
+ declare type DatabaseMetadata = {
149
+ /**
150
+ * The machine-readable name of a database
151
+ */
152
+ name: string;
153
+ /**
154
+ * The time this database was created
155
+ */
156
+ createdAt: DateTime;
157
+ /**
158
+ * The number of branches the database has
159
+ */
160
+ numberOfBranches: number;
161
+ /**
162
+ * Metadata about the database for display in Xata user interfaces
163
+ */
164
+ ui?: {
165
+ /**
166
+ * The user-selected color for this database across interfaces
167
+ */
168
+ color?: string;
169
+ };
170
+ };
128
171
  declare type ListDatabasesResponse = {
129
- databases?: {
130
- name: string;
131
- displayName: string;
132
- createdAt: DateTime;
133
- numberOfBranches: number;
134
- ui?: {
135
- color?: string;
136
- };
137
- }[];
172
+ /**
173
+ * A list of databases in a Xata workspace
174
+ */
175
+ databases?: DatabaseMetadata[];
138
176
  };
139
177
  declare type ListBranchesResponse = {
140
178
  databaseName: string;
141
- displayName: string;
142
179
  branches: Branch[];
143
180
  };
144
181
  declare type ListGitBranchesResponse = {
@@ -156,8 +193,14 @@ declare type Branch = {
156
193
  * @x-go-type xata.BranchMetadata
157
194
  */
158
195
  declare type BranchMetadata = {
196
+ /**
197
+ * @minLength 1
198
+ */
159
199
  repository?: string;
160
200
  branch?: BranchName;
201
+ /**
202
+ * @minLength 1
203
+ */
161
204
  stage?: string;
162
205
  labels?: string[];
163
206
  };
@@ -184,12 +227,28 @@ declare type Schema = {
184
227
  tables: Table[];
185
228
  tablesOrder?: string[];
186
229
  };
230
+ /**
231
+ * @x-internal true
232
+ */
233
+ declare type SchemaEditScript = {
234
+ sourceMigrationID?: string;
235
+ targetMigrationID?: string;
236
+ tables: TableEdit[];
237
+ };
187
238
  declare type Table = {
188
239
  id?: string;
189
240
  name: TableName;
190
241
  columns: Column[];
191
242
  revLinks?: RevLink[];
192
243
  };
244
+ /**
245
+ * @x-internal true
246
+ */
247
+ declare type TableEdit = {
248
+ oldName?: string;
249
+ newName?: string;
250
+ columns?: MigrationColumnOp[];
251
+ };
193
252
  /**
194
253
  * @x-go-type xata.Column
195
254
  */
@@ -199,6 +258,8 @@ declare type Column = {
199
258
  link?: {
200
259
  table: string;
201
260
  };
261
+ notNull?: boolean;
262
+ unique?: boolean;
202
263
  columns?: Column[];
203
264
  };
204
265
  declare type RevLink = {
@@ -265,6 +326,137 @@ declare type ColumnMigration = {
265
326
  old: Column;
266
327
  ['new']: Column;
267
328
  };
329
+ /**
330
+ * @x-internal true
331
+ */
332
+ declare type Commit = {
333
+ meta?: {
334
+ title?: string;
335
+ message?: string;
336
+ id: string;
337
+ parentID?: string;
338
+ mergeParentID?: string;
339
+ status: string;
340
+ createdAt: DateTime;
341
+ modifiedAt?: DateTime;
342
+ };
343
+ operations: MigrationOp[];
344
+ };
345
+ /**
346
+ * Branch schema migration.
347
+ *
348
+ * @x-internal true
349
+ */
350
+ declare type Migration = {
351
+ parentID?: string;
352
+ operations: MigrationOp[];
353
+ };
354
+ /**
355
+ * Branch schema migration operations.
356
+ *
357
+ * @x-internal true
358
+ */
359
+ declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
360
+ /**
361
+ * @x-internal true
362
+ */
363
+ declare type MigrationTableOp = {
364
+ addTable: TableOpAdd;
365
+ } | {
366
+ removeTable: TableOpRemove;
367
+ } | {
368
+ renameTable: TableOpRename;
369
+ };
370
+ /**
371
+ * @x-internal true
372
+ */
373
+ declare type MigrationColumnOp = {
374
+ addColumn: ColumnOpAdd;
375
+ } | {
376
+ removeColumn: ColumnOpRemove;
377
+ } | {
378
+ renameColumn: ColumnOpRename;
379
+ };
380
+ /**
381
+ * @x-internal true
382
+ */
383
+ declare type TableOpAdd = {
384
+ table: string;
385
+ };
386
+ /**
387
+ * @x-internal true
388
+ */
389
+ declare type TableOpRemove = {
390
+ table: string;
391
+ };
392
+ /**
393
+ * @x-internal true
394
+ */
395
+ declare type TableOpRename = {
396
+ oldName: string;
397
+ newName: string;
398
+ };
399
+ /**
400
+ * @x-internal true
401
+ */
402
+ declare type ColumnOpAdd = {
403
+ table?: string;
404
+ column: Column;
405
+ };
406
+ /**
407
+ * @x-internal true
408
+ */
409
+ declare type ColumnOpRemove = {
410
+ table?: string;
411
+ column: string;
412
+ };
413
+ /**
414
+ * @x-internal true
415
+ */
416
+ declare type ColumnOpRename = {
417
+ table?: string;
418
+ oldName: string;
419
+ newName: string;
420
+ };
421
+ declare type MigrationRequest = {
422
+ /**
423
+ * The migration request number.
424
+ */
425
+ number: number;
426
+ /**
427
+ * Migration request creation timestamp.
428
+ */
429
+ createdAt: DateTime;
430
+ /**
431
+ * Last modified timestamp.
432
+ */
433
+ modifiedAt?: DateTime;
434
+ /**
435
+ * Timestamp when the migration request was closed.
436
+ */
437
+ closedAt?: DateTime;
438
+ /**
439
+ * Timestamp when the migration request was merged.
440
+ */
441
+ mergedAt?: DateTime;
442
+ status: 'open' | 'closed' | 'merging' | 'merged';
443
+ /**
444
+ * The migration request title.
445
+ */
446
+ title: string;
447
+ /**
448
+ * The migration request body with detailed description.
449
+ */
450
+ body: string;
451
+ /**
452
+ * Name of the source branch.
453
+ */
454
+ source: string;
455
+ /**
456
+ * Name of the target branch.
457
+ */
458
+ target: string;
459
+ };
268
460
  declare type SortExpression = string[] | {
269
461
  [key: string]: SortOrder;
270
462
  } | {
@@ -273,7 +465,7 @@ declare type SortExpression = string[] | {
273
465
  declare type SortOrder = 'asc' | 'desc';
274
466
  /**
275
467
  * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
276
- * distance is the number of one charcter changes needed to make two strings equal. The default is 1, meaning that single
468
+ * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
277
469
  * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
278
470
  * to allow two typos in a word.
279
471
  *
@@ -299,10 +491,122 @@ declare type FilterExpression = {
299
491
  } & {
300
492
  [key: string]: FilterColumn;
301
493
  };
494
+ /**
495
+ * The description of the summaries you wish to receive. Set each key to be the field name
496
+ * you'd like for the summary. These names must not collide with other columns you've
497
+ * requested from `columns`; including implicit requests like `settings.*`.
498
+ *
499
+ * The value for each key needs to be an object. This object should contain one key and one
500
+ * value only. In this object, the key should be set to the summary function you wish to use
501
+ * and the value set to the column name to be summarized.
502
+ *
503
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
504
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
505
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
506
+ *
507
+ * @example {"all_users":{"count":"*"}}
508
+ * @example {"total_created":{"count":"created_at"}}
509
+ * @x-go-type xbquery.SummaryList
510
+ */
511
+ declare type SummaryExpressionList = {
512
+ [key: string]: SummaryExpression;
513
+ };
514
+ /**
515
+ * A summary expression is the description of a single summary operation. It consists of a single
516
+ * key representing the operation, and a value representing the column to be operated on.
517
+ *
518
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
519
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
520
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
521
+ *
522
+ * We currently support the `count` operation. When using `count`, one can set a column name
523
+ * as the value. Xata will return the total number times this column is non-null in each group.
524
+ *
525
+ * Alternately, if you'd like to count the total rows in each group - irregardless of null/not null
526
+ * status - you can set `count` to `*` to count everything.
527
+ *
528
+ * @example {"count":"deleted_at"}
529
+ * @x-go-type xbquery.Summary
530
+ */
531
+ declare type SummaryExpression = Record<string, any>;
302
532
  declare type HighlightExpression = {
533
+ /**
534
+ * Set to `false` to disable highlighting. By default it is `true`.
535
+ */
303
536
  enabled?: boolean;
537
+ /**
538
+ * Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
539
+ */
304
540
  encodeHTML?: boolean;
305
541
  };
542
+ /**
543
+ * Booster Expression
544
+ *
545
+ * @x-go-type xata.BoosterExpression
546
+ */
547
+ declare type BoosterExpression = {
548
+ valueBooster?: ValueBooster$1;
549
+ } | {
550
+ numericBooster?: NumericBooster$1;
551
+ } | {
552
+ dateBooster?: DateBooster$1;
553
+ };
554
+ /**
555
+ * Boost records with a particular value for a column.
556
+ */
557
+ declare type ValueBooster$1 = {
558
+ /**
559
+ * The column in which to look for the value.
560
+ */
561
+ column: string;
562
+ /**
563
+ * The exact value to boost.
564
+ */
565
+ value: string | number | boolean;
566
+ /**
567
+ * The factor with which to multiply the score of the record.
568
+ */
569
+ factor: number;
570
+ };
571
+ /**
572
+ * Boost records based on the value of a numeric column.
573
+ */
574
+ declare type NumericBooster$1 = {
575
+ /**
576
+ * The column in which to look for the value.
577
+ */
578
+ column: string;
579
+ /**
580
+ * The factor with which to multiply the value of the column before adding it to the item score.
581
+ */
582
+ factor: number;
583
+ };
584
+ /**
585
+ * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
586
+ * 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
587
+ * 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.
588
+ */
589
+ declare type DateBooster$1 = {
590
+ /**
591
+ * The column in which to look for the value.
592
+ */
593
+ column: string;
594
+ /**
595
+ * The datetime (formatted as RFC3339) from where to apply the score decay function. The maximum boost will be applied for records with values at this time.
596
+ * If it is not specified, the current date and time is used.
597
+ */
598
+ origin?: string;
599
+ /**
600
+ * The duration at which distance from origin the score is decayed with factor, using an exponential function. It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
601
+ *
602
+ * @pattern ^(\d+)(d|h|m|s|ms)$
603
+ */
604
+ scale: string;
605
+ /**
606
+ * The decay factor to expect at "scale" distance from the "origin".
607
+ */
608
+ decay: number;
609
+ };
306
610
  declare type FilterList = FilterExpression | FilterExpression[];
307
611
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
308
612
  /**
@@ -352,14 +656,73 @@ declare type FilterValue = number | string | boolean;
352
656
  * Pagination settings.
353
657
  */
354
658
  declare type PageConfig = {
659
+ /**
660
+ * Query the next page that follow the cursor.
661
+ */
355
662
  after?: string;
663
+ /**
664
+ * Query the previous page before the cursor.
665
+ */
356
666
  before?: string;
667
+ /**
668
+ * Query the first page from the cursor.
669
+ */
357
670
  first?: string;
671
+ /**
672
+ * Query the last page from the cursor.
673
+ */
358
674
  last?: string;
675
+ /**
676
+ * Set page size. If the size is missing it is read from the cursor. If no cursor is given xata will choose the default page size.
677
+ *
678
+ * @default 20
679
+ */
359
680
  size?: number;
681
+ /**
682
+ * Use offset to skip entries. To skip pages set offset to a multiple of size.
683
+ *
684
+ * @default 0
685
+ */
360
686
  offset?: number;
361
687
  };
362
- declare type ColumnsFilter = string[];
688
+ /**
689
+ * @example name
690
+ * @example email
691
+ * @example created_at
692
+ */
693
+ declare type ColumnsProjection = string[];
694
+ /**
695
+ * Xata Table Record Metadata
696
+ */
697
+ declare type RecordMeta = {
698
+ id: RecordID;
699
+ xata: {
700
+ /**
701
+ * The record's version. Can be used for optimistic concurrency control.
702
+ */
703
+ version: number;
704
+ /**
705
+ * The record's table name. APIs that return records from multiple tables will set this field accordingly.
706
+ */
707
+ table?: string;
708
+ /**
709
+ * Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
710
+ */
711
+ highlight?: {
712
+ [key: string]: string[] | {
713
+ [key: string]: any;
714
+ };
715
+ };
716
+ /**
717
+ * The record's relevancy score. This is returned by the search APIs.
718
+ */
719
+ score?: number;
720
+ /**
721
+ * Encoding/Decoding errors
722
+ */
723
+ warnings?: string[];
724
+ };
725
+ };
363
726
  /**
364
727
  * @pattern [a-zA-Z0-9_-~:]+
365
728
  */
@@ -368,7 +731,13 @@ declare type RecordID = string;
368
731
  * @example {"newName":"newName","oldName":"oldName"}
369
732
  */
370
733
  declare type TableRename = {
734
+ /**
735
+ * @minLength 1
736
+ */
371
737
  newName: string;
738
+ /**
739
+ * @minLength 1
740
+ */
372
741
  oldName: string;
373
742
  };
374
743
  /**
@@ -376,26 +745,20 @@ declare type TableRename = {
376
745
  */
377
746
  declare type RecordsMetadata = {
378
747
  page: {
748
+ /**
749
+ * last record id
750
+ */
379
751
  cursor: string;
752
+ /**
753
+ * true if more records can be fetch
754
+ */
380
755
  more: boolean;
381
756
  };
382
757
  };
383
758
  /**
384
- * Xata Table Record
759
+ * Xata Table Record Metadata
385
760
  */
386
- declare type XataRecord$1 = {
387
- id: RecordID;
388
- xata: {
389
- version: number;
390
- table?: string;
391
- highlight?: {
392
- [key: string]: string[] | {
393
- [key: string]: any;
394
- };
395
- };
396
- warnings?: string[];
397
- };
398
- } & {
761
+ declare type XataRecord$1 = RecordMeta & {
399
762
  [key: string]: any;
400
763
  };
401
764
 
@@ -413,6 +776,7 @@ type schemas_InviteID = InviteID;
413
776
  type schemas_WorkspaceInvite = WorkspaceInvite;
414
777
  type schemas_WorkspaceMembers = WorkspaceMembers;
415
778
  type schemas_InviteKey = InviteKey;
779
+ type schemas_DatabaseMetadata = DatabaseMetadata;
416
780
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
417
781
  type schemas_ListBranchesResponse = ListBranchesResponse;
418
782
  type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
@@ -421,7 +785,9 @@ type schemas_BranchMetadata = BranchMetadata;
421
785
  type schemas_DBBranch = DBBranch;
422
786
  type schemas_StartedFromMetadata = StartedFromMetadata;
423
787
  type schemas_Schema = Schema;
788
+ type schemas_SchemaEditScript = SchemaEditScript;
424
789
  type schemas_Table = Table;
790
+ type schemas_TableEdit = TableEdit;
425
791
  type schemas_Column = Column;
426
792
  type schemas_RevLink = RevLink;
427
793
  type schemas_BranchName = BranchName;
@@ -434,12 +800,27 @@ type schemas_MetricsLatency = MetricsLatency;
434
800
  type schemas_BranchMigration = BranchMigration;
435
801
  type schemas_TableMigration = TableMigration;
436
802
  type schemas_ColumnMigration = ColumnMigration;
803
+ type schemas_Commit = Commit;
804
+ type schemas_Migration = Migration;
805
+ type schemas_MigrationOp = MigrationOp;
806
+ type schemas_MigrationTableOp = MigrationTableOp;
807
+ type schemas_MigrationColumnOp = MigrationColumnOp;
808
+ type schemas_TableOpAdd = TableOpAdd;
809
+ type schemas_TableOpRemove = TableOpRemove;
810
+ type schemas_TableOpRename = TableOpRename;
811
+ type schemas_ColumnOpAdd = ColumnOpAdd;
812
+ type schemas_ColumnOpRemove = ColumnOpRemove;
813
+ type schemas_ColumnOpRename = ColumnOpRename;
814
+ type schemas_MigrationRequest = MigrationRequest;
437
815
  type schemas_SortExpression = SortExpression;
438
816
  type schemas_SortOrder = SortOrder;
439
817
  type schemas_FuzzinessExpression = FuzzinessExpression;
440
818
  type schemas_PrefixExpression = PrefixExpression;
441
819
  type schemas_FilterExpression = FilterExpression;
820
+ type schemas_SummaryExpressionList = SummaryExpressionList;
821
+ type schemas_SummaryExpression = SummaryExpression;
442
822
  type schemas_HighlightExpression = HighlightExpression;
823
+ type schemas_BoosterExpression = BoosterExpression;
443
824
  type schemas_FilterList = FilterList;
444
825
  type schemas_FilterColumn = FilterColumn;
445
826
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -449,7 +830,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
449
830
  type schemas_FilterRangeValue = FilterRangeValue;
450
831
  type schemas_FilterValue = FilterValue;
451
832
  type schemas_PageConfig = PageConfig;
452
- type schemas_ColumnsFilter = ColumnsFilter;
833
+ type schemas_ColumnsProjection = ColumnsProjection;
834
+ type schemas_RecordMeta = RecordMeta;
453
835
  type schemas_RecordID = RecordID;
454
836
  type schemas_TableRename = TableRename;
455
837
  type schemas_RecordsMetadata = RecordsMetadata;
@@ -469,6 +851,7 @@ declare namespace schemas {
469
851
  schemas_WorkspaceInvite as WorkspaceInvite,
470
852
  schemas_WorkspaceMembers as WorkspaceMembers,
471
853
  schemas_InviteKey as InviteKey,
854
+ schemas_DatabaseMetadata as DatabaseMetadata,
472
855
  schemas_ListDatabasesResponse as ListDatabasesResponse,
473
856
  schemas_ListBranchesResponse as ListBranchesResponse,
474
857
  schemas_ListGitBranchesResponse as ListGitBranchesResponse,
@@ -477,7 +860,9 @@ declare namespace schemas {
477
860
  schemas_DBBranch as DBBranch,
478
861
  schemas_StartedFromMetadata as StartedFromMetadata,
479
862
  schemas_Schema as Schema,
863
+ schemas_SchemaEditScript as SchemaEditScript,
480
864
  schemas_Table as Table,
865
+ schemas_TableEdit as TableEdit,
481
866
  schemas_Column as Column,
482
867
  schemas_RevLink as RevLink,
483
868
  schemas_BranchName as BranchName,
@@ -490,12 +875,30 @@ declare namespace schemas {
490
875
  schemas_BranchMigration as BranchMigration,
491
876
  schemas_TableMigration as TableMigration,
492
877
  schemas_ColumnMigration as ColumnMigration,
878
+ schemas_Commit as Commit,
879
+ schemas_Migration as Migration,
880
+ schemas_MigrationOp as MigrationOp,
881
+ schemas_MigrationTableOp as MigrationTableOp,
882
+ schemas_MigrationColumnOp as MigrationColumnOp,
883
+ schemas_TableOpAdd as TableOpAdd,
884
+ schemas_TableOpRemove as TableOpRemove,
885
+ schemas_TableOpRename as TableOpRename,
886
+ schemas_ColumnOpAdd as ColumnOpAdd,
887
+ schemas_ColumnOpRemove as ColumnOpRemove,
888
+ schemas_ColumnOpRename as ColumnOpRename,
889
+ schemas_MigrationRequest as MigrationRequest,
493
890
  schemas_SortExpression as SortExpression,
494
891
  schemas_SortOrder as SortOrder,
495
892
  schemas_FuzzinessExpression as FuzzinessExpression,
496
893
  schemas_PrefixExpression as PrefixExpression,
497
894
  schemas_FilterExpression as FilterExpression,
895
+ schemas_SummaryExpressionList as SummaryExpressionList,
896
+ schemas_SummaryExpression as SummaryExpression,
498
897
  schemas_HighlightExpression as HighlightExpression,
898
+ schemas_BoosterExpression as BoosterExpression,
899
+ ValueBooster$1 as ValueBooster,
900
+ NumericBooster$1 as NumericBooster,
901
+ DateBooster$1 as DateBooster,
499
902
  schemas_FilterList as FilterList,
500
903
  schemas_FilterColumn as FilterColumn,
501
904
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -505,7 +908,8 @@ declare namespace schemas {
505
908
  schemas_FilterRangeValue as FilterRangeValue,
506
909
  schemas_FilterValue as FilterValue,
507
910
  schemas_PageConfig as PageConfig,
508
- schemas_ColumnsFilter as ColumnsFilter,
911
+ schemas_ColumnsProjection as ColumnsProjection,
912
+ schemas_RecordMeta as RecordMeta,
509
913
  schemas_RecordID as RecordID,
510
914
  schemas_TableRename as TableRename,
511
915
  schemas_RecordsMetadata as RecordsMetadata,
@@ -540,11 +944,22 @@ declare type BulkError = {
540
944
  status?: number;
541
945
  }[];
542
946
  };
947
+ declare type BulkInsertResponse = {
948
+ recordIDs: string[];
949
+ } | {
950
+ records: XataRecord$1[];
951
+ };
543
952
  declare type BranchMigrationPlan = {
544
953
  version: number;
545
954
  migration: BranchMigration;
546
955
  };
547
- declare type RecordUpdateResponse = {
956
+ declare type RecordResponse = XataRecord$1;
957
+ declare type SchemaCompareResponse = {
958
+ source: Schema;
959
+ target: Schema;
960
+ edits: SchemaEditScript;
961
+ };
962
+ declare type RecordUpdateResponse = XataRecord$1 | {
548
963
  id: string;
549
964
  xata: {
550
965
  version: number;
@@ -554,6 +969,9 @@ declare type QueryResponse = {
554
969
  records: XataRecord$1[];
555
970
  meta: RecordsMetadata;
556
971
  };
972
+ declare type SummarizeResponse = {
973
+ summary: Record<string, any>[];
974
+ };
557
975
  declare type SearchResponse = {
558
976
  records: XataRecord$1[];
559
977
  };
@@ -561,6 +979,9 @@ declare type SearchResponse = {
561
979
  * @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
562
980
  */
563
981
  declare type MigrationIdResponse = {
982
+ /**
983
+ * @minLength 1
984
+ */
564
985
  migrationID: string;
565
986
  };
566
987
 
@@ -568,9 +989,13 @@ type responses_SimpleError = SimpleError;
568
989
  type responses_BadRequestError = BadRequestError;
569
990
  type responses_AuthError = AuthError;
570
991
  type responses_BulkError = BulkError;
992
+ type responses_BulkInsertResponse = BulkInsertResponse;
571
993
  type responses_BranchMigrationPlan = BranchMigrationPlan;
994
+ type responses_RecordResponse = RecordResponse;
995
+ type responses_SchemaCompareResponse = SchemaCompareResponse;
572
996
  type responses_RecordUpdateResponse = RecordUpdateResponse;
573
997
  type responses_QueryResponse = QueryResponse;
998
+ type responses_SummarizeResponse = SummarizeResponse;
574
999
  type responses_SearchResponse = SearchResponse;
575
1000
  type responses_MigrationIdResponse = MigrationIdResponse;
576
1001
  declare namespace responses {
@@ -579,9 +1004,13 @@ declare namespace responses {
579
1004
  responses_BadRequestError as BadRequestError,
580
1005
  responses_AuthError as AuthError,
581
1006
  responses_BulkError as BulkError,
1007
+ responses_BulkInsertResponse as BulkInsertResponse,
582
1008
  responses_BranchMigrationPlan as BranchMigrationPlan,
1009
+ responses_RecordResponse as RecordResponse,
1010
+ responses_SchemaCompareResponse as SchemaCompareResponse,
583
1011
  responses_RecordUpdateResponse as RecordUpdateResponse,
584
1012
  responses_QueryResponse as QueryResponse,
1013
+ responses_SummarizeResponse as SummarizeResponse,
585
1014
  responses_SearchResponse as SearchResponse,
586
1015
  responses_MigrationIdResponse as MigrationIdResponse,
587
1016
  };
@@ -662,6 +1091,9 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
662
1091
  */
663
1092
  declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
664
1093
  declare type CreateUserAPIKeyPathParams = {
1094
+ /**
1095
+ * API Key name
1096
+ */
665
1097
  keyName: APIKeyName;
666
1098
  };
667
1099
  declare type CreateUserAPIKeyError = ErrorWrapper<{
@@ -687,6 +1119,9 @@ declare type CreateUserAPIKeyVariables = {
687
1119
  */
688
1120
  declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
689
1121
  declare type DeleteUserAPIKeyPathParams = {
1122
+ /**
1123
+ * API Key name
1124
+ */
690
1125
  keyName: APIKeyName;
691
1126
  };
692
1127
  declare type DeleteUserAPIKeyError = ErrorWrapper<{
@@ -747,6 +1182,9 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
747
1182
  */
748
1183
  declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
749
1184
  declare type GetWorkspacePathParams = {
1185
+ /**
1186
+ * Workspace name
1187
+ */
750
1188
  workspaceId: WorkspaceID;
751
1189
  };
752
1190
  declare type GetWorkspaceError = ErrorWrapper<{
@@ -767,6 +1205,9 @@ declare type GetWorkspaceVariables = {
767
1205
  */
768
1206
  declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
769
1207
  declare type UpdateWorkspacePathParams = {
1208
+ /**
1209
+ * Workspace name
1210
+ */
770
1211
  workspaceId: WorkspaceID;
771
1212
  };
772
1213
  declare type UpdateWorkspaceError = ErrorWrapper<{
@@ -788,6 +1229,9 @@ declare type UpdateWorkspaceVariables = {
788
1229
  */
789
1230
  declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
790
1231
  declare type DeleteWorkspacePathParams = {
1232
+ /**
1233
+ * Workspace name
1234
+ */
791
1235
  workspaceId: WorkspaceID;
792
1236
  };
793
1237
  declare type DeleteWorkspaceError = ErrorWrapper<{
@@ -808,6 +1252,9 @@ declare type DeleteWorkspaceVariables = {
808
1252
  */
809
1253
  declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
810
1254
  declare type GetWorkspaceMembersListPathParams = {
1255
+ /**
1256
+ * Workspace name
1257
+ */
811
1258
  workspaceId: WorkspaceID;
812
1259
  };
813
1260
  declare type GetWorkspaceMembersListError = ErrorWrapper<{
@@ -828,7 +1275,13 @@ declare type GetWorkspaceMembersListVariables = {
828
1275
  */
829
1276
  declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
830
1277
  declare type UpdateWorkspaceMemberRolePathParams = {
1278
+ /**
1279
+ * Workspace name
1280
+ */
831
1281
  workspaceId: WorkspaceID;
1282
+ /**
1283
+ * UserID
1284
+ */
832
1285
  userId: UserID;
833
1286
  };
834
1287
  declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
@@ -853,7 +1306,13 @@ declare type UpdateWorkspaceMemberRoleVariables = {
853
1306
  */
854
1307
  declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
855
1308
  declare type RemoveWorkspaceMemberPathParams = {
1309
+ /**
1310
+ * Workspace name
1311
+ */
856
1312
  workspaceId: WorkspaceID;
1313
+ /**
1314
+ * UserID
1315
+ */
857
1316
  userId: UserID;
858
1317
  };
859
1318
  declare type RemoveWorkspaceMemberError = ErrorWrapper<{
@@ -874,6 +1333,9 @@ declare type RemoveWorkspaceMemberVariables = {
874
1333
  */
875
1334
  declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
876
1335
  declare type InviteWorkspaceMemberPathParams = {
1336
+ /**
1337
+ * Workspace name
1338
+ */
877
1339
  workspaceId: WorkspaceID;
878
1340
  };
879
1341
  declare type InviteWorkspaceMemberError = ErrorWrapper<{
@@ -885,8 +1347,14 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
885
1347
  } | {
886
1348
  status: 404;
887
1349
  payload: SimpleError;
1350
+ } | {
1351
+ status: 409;
1352
+ payload: SimpleError;
888
1353
  }>;
889
1354
  declare type InviteWorkspaceMemberRequestBody = {
1355
+ /**
1356
+ * @format email
1357
+ */
890
1358
  email: string;
891
1359
  role: Role;
892
1360
  };
@@ -898,11 +1366,17 @@ declare type InviteWorkspaceMemberVariables = {
898
1366
  * Invite some user to join the workspace with the given role
899
1367
  */
900
1368
  declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
901
- declare type CancelWorkspaceMemberInvitePathParams = {
1369
+ declare type UpdateWorkspaceMemberInvitePathParams = {
1370
+ /**
1371
+ * Workspace name
1372
+ */
902
1373
  workspaceId: WorkspaceID;
1374
+ /**
1375
+ * Invite identifier
1376
+ */
903
1377
  inviteId: InviteID;
904
1378
  };
905
- declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
1379
+ declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
906
1380
  status: 400;
907
1381
  payload: BadRequestError;
908
1382
  } | {
@@ -911,16 +1385,56 @@ declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
911
1385
  } | {
912
1386
  status: 404;
913
1387
  payload: SimpleError;
1388
+ } | {
1389
+ status: 422;
1390
+ payload: SimpleError;
914
1391
  }>;
915
- declare type CancelWorkspaceMemberInviteVariables = {
916
- pathParams: CancelWorkspaceMemberInvitePathParams;
1392
+ declare type UpdateWorkspaceMemberInviteRequestBody = {
1393
+ role: Role;
1394
+ };
1395
+ declare type UpdateWorkspaceMemberInviteVariables = {
1396
+ body: UpdateWorkspaceMemberInviteRequestBody;
1397
+ pathParams: UpdateWorkspaceMemberInvitePathParams;
917
1398
  } & FetcherExtraProps;
918
1399
  /**
919
- * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
1400
+ * 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.
920
1401
  */
921
- declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
1402
+ declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
1403
+ declare type CancelWorkspaceMemberInvitePathParams = {
1404
+ /**
1405
+ * Workspace name
1406
+ */
1407
+ workspaceId: WorkspaceID;
1408
+ /**
1409
+ * Invite identifier
1410
+ */
1411
+ inviteId: InviteID;
1412
+ };
1413
+ declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
1414
+ status: 400;
1415
+ payload: BadRequestError;
1416
+ } | {
1417
+ status: 401;
1418
+ payload: AuthError;
1419
+ } | {
1420
+ status: 404;
1421
+ payload: SimpleError;
1422
+ }>;
1423
+ declare type CancelWorkspaceMemberInviteVariables = {
1424
+ pathParams: CancelWorkspaceMemberInvitePathParams;
1425
+ } & FetcherExtraProps;
1426
+ /**
1427
+ * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
1428
+ */
1429
+ declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
922
1430
  declare type ResendWorkspaceMemberInvitePathParams = {
1431
+ /**
1432
+ * Workspace name
1433
+ */
923
1434
  workspaceId: WorkspaceID;
1435
+ /**
1436
+ * Invite identifier
1437
+ */
924
1438
  inviteId: InviteID;
925
1439
  };
926
1440
  declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
@@ -941,7 +1455,13 @@ declare type ResendWorkspaceMemberInviteVariables = {
941
1455
  */
942
1456
  declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
943
1457
  declare type AcceptWorkspaceMemberInvitePathParams = {
1458
+ /**
1459
+ * Workspace name
1460
+ */
944
1461
  workspaceId: WorkspaceID;
1462
+ /**
1463
+ * Invite Key (secret) for the invited user
1464
+ */
945
1465
  inviteKey: InviteKey;
946
1466
  };
947
1467
  declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
@@ -979,6 +1499,9 @@ declare type GetDatabaseListVariables = {
979
1499
  */
980
1500
  declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
981
1501
  declare type GetBranchListPathParams = {
1502
+ /**
1503
+ * The Database Name
1504
+ */
982
1505
  dbName: DBName;
983
1506
  workspace: string;
984
1507
  };
@@ -1000,6 +1523,9 @@ declare type GetBranchListVariables = {
1000
1523
  */
1001
1524
  declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
1002
1525
  declare type CreateDatabasePathParams = {
1526
+ /**
1527
+ * The Database Name
1528
+ */
1003
1529
  dbName: DBName;
1004
1530
  workspace: string;
1005
1531
  };
@@ -1011,11 +1537,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
1011
1537
  payload: AuthError;
1012
1538
  }>;
1013
1539
  declare type CreateDatabaseResponse = {
1540
+ /**
1541
+ * @minLength 1
1542
+ */
1014
1543
  databaseName: string;
1015
1544
  branchName?: string;
1016
1545
  };
1017
1546
  declare type CreateDatabaseRequestBody = {
1018
- displayName?: string;
1547
+ /**
1548
+ * @minLength 1
1549
+ */
1019
1550
  branchName?: string;
1020
1551
  ui?: {
1021
1552
  color?: string;
@@ -1031,6 +1562,9 @@ declare type CreateDatabaseVariables = {
1031
1562
  */
1032
1563
  declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
1033
1564
  declare type DeleteDatabasePathParams = {
1565
+ /**
1566
+ * The Database Name
1567
+ */
1034
1568
  dbName: DBName;
1035
1569
  workspace: string;
1036
1570
  };
@@ -1051,7 +1585,67 @@ declare type DeleteDatabaseVariables = {
1051
1585
  * Delete a database and all of its branches and tables permanently.
1052
1586
  */
1053
1587
  declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1588
+ declare type GetDatabaseMetadataPathParams = {
1589
+ /**
1590
+ * The Database Name
1591
+ */
1592
+ dbName: DBName;
1593
+ workspace: string;
1594
+ };
1595
+ declare type GetDatabaseMetadataError = ErrorWrapper<{
1596
+ status: 400;
1597
+ payload: BadRequestError;
1598
+ } | {
1599
+ status: 401;
1600
+ payload: AuthError;
1601
+ } | {
1602
+ status: 404;
1603
+ payload: SimpleError;
1604
+ }>;
1605
+ declare type GetDatabaseMetadataVariables = {
1606
+ pathParams: GetDatabaseMetadataPathParams;
1607
+ } & FetcherExtraProps;
1608
+ /**
1609
+ * Retrieve metadata of the given database
1610
+ */
1611
+ declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
1612
+ declare type UpdateDatabaseMetadataPathParams = {
1613
+ /**
1614
+ * The Database Name
1615
+ */
1616
+ dbName: DBName;
1617
+ workspace: string;
1618
+ };
1619
+ declare type UpdateDatabaseMetadataError = ErrorWrapper<{
1620
+ status: 400;
1621
+ payload: BadRequestError;
1622
+ } | {
1623
+ status: 401;
1624
+ payload: AuthError;
1625
+ } | {
1626
+ status: 404;
1627
+ payload: SimpleError;
1628
+ }>;
1629
+ declare type UpdateDatabaseMetadataRequestBody = {
1630
+ ui?: {
1631
+ /**
1632
+ * @minLength 1
1633
+ */
1634
+ color?: string;
1635
+ };
1636
+ };
1637
+ declare type UpdateDatabaseMetadataVariables = {
1638
+ body?: UpdateDatabaseMetadataRequestBody;
1639
+ pathParams: UpdateDatabaseMetadataPathParams;
1640
+ } & FetcherExtraProps;
1641
+ /**
1642
+ * Update the color of the selected database
1643
+ */
1644
+ declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
1054
1645
  declare type GetGitBranchesMappingPathParams = {
1646
+ /**
1647
+ * The Database Name
1648
+ */
1055
1649
  dbName: DBName;
1056
1650
  workspace: string;
1057
1651
  };
@@ -1091,6 +1685,9 @@ declare type GetGitBranchesMappingVariables = {
1091
1685
  */
1092
1686
  declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
1093
1687
  declare type AddGitBranchesEntryPathParams = {
1688
+ /**
1689
+ * The Database Name
1690
+ */
1094
1691
  dbName: DBName;
1095
1692
  workspace: string;
1096
1693
  };
@@ -1102,10 +1699,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
1102
1699
  payload: AuthError;
1103
1700
  }>;
1104
1701
  declare type AddGitBranchesEntryResponse = {
1702
+ /**
1703
+ * Warning message
1704
+ */
1105
1705
  warning?: string;
1106
1706
  };
1107
1707
  declare type AddGitBranchesEntryRequestBody = {
1708
+ /**
1709
+ * The name of the Git branch.
1710
+ */
1108
1711
  gitBranch: string;
1712
+ /**
1713
+ * The name of the Xata branch.
1714
+ */
1109
1715
  xataBranch: BranchName;
1110
1716
  };
1111
1717
  declare type AddGitBranchesEntryVariables = {
@@ -1129,10 +1735,16 @@ declare type AddGitBranchesEntryVariables = {
1129
1735
  */
1130
1736
  declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
1131
1737
  declare type RemoveGitBranchesEntryPathParams = {
1738
+ /**
1739
+ * The Database Name
1740
+ */
1132
1741
  dbName: DBName;
1133
1742
  workspace: string;
1134
1743
  };
1135
1744
  declare type RemoveGitBranchesEntryQueryParams = {
1745
+ /**
1746
+ * The Git Branch to remove from the mapping
1747
+ */
1136
1748
  gitBranch: string;
1137
1749
  };
1138
1750
  declare type RemoveGitBranchesEntryError = ErrorWrapper<{
@@ -1157,11 +1769,20 @@ declare type RemoveGitBranchesEntryVariables = {
1157
1769
  */
1158
1770
  declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
1159
1771
  declare type ResolveBranchPathParams = {
1772
+ /**
1773
+ * The Database Name
1774
+ */
1160
1775
  dbName: DBName;
1161
1776
  workspace: string;
1162
1777
  };
1163
1778
  declare type ResolveBranchQueryParams = {
1779
+ /**
1780
+ * The Git Branch
1781
+ */
1164
1782
  gitBranch?: string;
1783
+ /**
1784
+ * Default branch to fallback to
1785
+ */
1165
1786
  fallbackBranch?: string;
1166
1787
  };
1167
1788
  declare type ResolveBranchError = ErrorWrapper<{
@@ -1208,7 +1829,285 @@ declare type ResolveBranchVariables = {
1208
1829
  * ```
1209
1830
  */
1210
1831
  declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
1832
+ declare type ListMigrationRequestsPathParams = {
1833
+ /**
1834
+ * The Database Name
1835
+ */
1836
+ dbName: DBName;
1837
+ workspace: string;
1838
+ };
1839
+ declare type ListMigrationRequestsError = ErrorWrapper<{
1840
+ status: 400;
1841
+ payload: BadRequestError;
1842
+ } | {
1843
+ status: 401;
1844
+ payload: AuthError;
1845
+ } | {
1846
+ status: 404;
1847
+ payload: SimpleError;
1848
+ }>;
1849
+ declare type ListMigrationRequestsResponse = {
1850
+ migrationRequests: MigrationRequest[];
1851
+ meta: RecordsMetadata;
1852
+ };
1853
+ declare type ListMigrationRequestsRequestBody = {
1854
+ filter?: FilterExpression;
1855
+ sort?: SortExpression;
1856
+ page?: PageConfig;
1857
+ columns?: ColumnsProjection;
1858
+ };
1859
+ declare type ListMigrationRequestsVariables = {
1860
+ body?: ListMigrationRequestsRequestBody;
1861
+ pathParams: ListMigrationRequestsPathParams;
1862
+ } & FetcherExtraProps;
1863
+ declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
1864
+ declare type CreateMigrationRequestPathParams = {
1865
+ /**
1866
+ * The Database Name
1867
+ */
1868
+ dbName: DBName;
1869
+ workspace: string;
1870
+ };
1871
+ declare type CreateMigrationRequestError = ErrorWrapper<{
1872
+ status: 400;
1873
+ payload: BadRequestError;
1874
+ } | {
1875
+ status: 401;
1876
+ payload: AuthError;
1877
+ } | {
1878
+ status: 404;
1879
+ payload: SimpleError;
1880
+ }>;
1881
+ declare type CreateMigrationRequestResponse = {
1882
+ number: number;
1883
+ };
1884
+ declare type CreateMigrationRequestRequestBody = {
1885
+ /**
1886
+ * The source branch.
1887
+ */
1888
+ source: string;
1889
+ /**
1890
+ * The target branch.
1891
+ */
1892
+ target: string;
1893
+ /**
1894
+ * The title.
1895
+ */
1896
+ title: string;
1897
+ /**
1898
+ * Optional migration request description.
1899
+ */
1900
+ body?: string;
1901
+ };
1902
+ declare type CreateMigrationRequestVariables = {
1903
+ body: CreateMigrationRequestRequestBody;
1904
+ pathParams: CreateMigrationRequestPathParams;
1905
+ } & FetcherExtraProps;
1906
+ declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
1907
+ declare type GetMigrationRequestPathParams = {
1908
+ /**
1909
+ * The Database Name
1910
+ */
1911
+ dbName: DBName;
1912
+ /**
1913
+ * The migration request number.
1914
+ */
1915
+ mrNumber: number;
1916
+ workspace: string;
1917
+ };
1918
+ declare type GetMigrationRequestError = ErrorWrapper<{
1919
+ status: 400;
1920
+ payload: BadRequestError;
1921
+ } | {
1922
+ status: 401;
1923
+ payload: AuthError;
1924
+ } | {
1925
+ status: 404;
1926
+ payload: SimpleError;
1927
+ }>;
1928
+ declare type GetMigrationRequestVariables = {
1929
+ pathParams: GetMigrationRequestPathParams;
1930
+ } & FetcherExtraProps;
1931
+ declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
1932
+ declare type UpdateMigrationRequestPathParams = {
1933
+ /**
1934
+ * The Database Name
1935
+ */
1936
+ dbName: DBName;
1937
+ /**
1938
+ * The migration request number.
1939
+ */
1940
+ mrNumber: number;
1941
+ workspace: string;
1942
+ };
1943
+ declare type UpdateMigrationRequestError = ErrorWrapper<{
1944
+ status: 400;
1945
+ payload: BadRequestError;
1946
+ } | {
1947
+ status: 401;
1948
+ payload: AuthError;
1949
+ } | {
1950
+ status: 404;
1951
+ payload: SimpleError;
1952
+ }>;
1953
+ declare type UpdateMigrationRequestRequestBody = {
1954
+ /**
1955
+ * New migration request title.
1956
+ */
1957
+ title?: string;
1958
+ /**
1959
+ * New migration request description.
1960
+ */
1961
+ body?: string;
1962
+ /**
1963
+ * Change the migration request status.
1964
+ */
1965
+ status?: 'open' | 'closed';
1966
+ };
1967
+ declare type UpdateMigrationRequestVariables = {
1968
+ body?: UpdateMigrationRequestRequestBody;
1969
+ pathParams: UpdateMigrationRequestPathParams;
1970
+ } & FetcherExtraProps;
1971
+ declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
1972
+ declare type ListMigrationRequestsCommitsPathParams = {
1973
+ /**
1974
+ * The Database Name
1975
+ */
1976
+ dbName: DBName;
1977
+ /**
1978
+ * The migration request number.
1979
+ */
1980
+ mrNumber: number;
1981
+ workspace: string;
1982
+ };
1983
+ declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
1984
+ status: 400;
1985
+ payload: BadRequestError;
1986
+ } | {
1987
+ status: 401;
1988
+ payload: AuthError;
1989
+ } | {
1990
+ status: 404;
1991
+ payload: SimpleError;
1992
+ }>;
1993
+ declare type ListMigrationRequestsCommitsResponse = {
1994
+ meta: {
1995
+ /**
1996
+ * last record id
1997
+ */
1998
+ cursor: string;
1999
+ /**
2000
+ * true if more records can be fetch
2001
+ */
2002
+ more: boolean;
2003
+ };
2004
+ logs: Commit[];
2005
+ };
2006
+ declare type ListMigrationRequestsCommitsRequestBody = {
2007
+ page?: {
2008
+ /**
2009
+ * Query the next page that follow the cursor.
2010
+ */
2011
+ after?: string;
2012
+ /**
2013
+ * Query the previous page before the cursor.
2014
+ */
2015
+ before?: string;
2016
+ /**
2017
+ * Set page size. If the size is missing it is read from the cursor. If no cursor is given xata will choose the default page size.
2018
+ *
2019
+ * @default 20
2020
+ */
2021
+ size?: number;
2022
+ };
2023
+ };
2024
+ declare type ListMigrationRequestsCommitsVariables = {
2025
+ body?: ListMigrationRequestsCommitsRequestBody;
2026
+ pathParams: ListMigrationRequestsCommitsPathParams;
2027
+ } & FetcherExtraProps;
2028
+ declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
2029
+ declare type CompareMigrationRequestPathParams = {
2030
+ /**
2031
+ * The Database Name
2032
+ */
2033
+ dbName: DBName;
2034
+ /**
2035
+ * The migration request number.
2036
+ */
2037
+ mrNumber: number;
2038
+ workspace: string;
2039
+ };
2040
+ declare type CompareMigrationRequestError = ErrorWrapper<{
2041
+ status: 400;
2042
+ payload: BadRequestError;
2043
+ } | {
2044
+ status: 401;
2045
+ payload: AuthError;
2046
+ } | {
2047
+ status: 404;
2048
+ payload: SimpleError;
2049
+ }>;
2050
+ declare type CompareMigrationRequestVariables = {
2051
+ pathParams: CompareMigrationRequestPathParams;
2052
+ } & FetcherExtraProps;
2053
+ declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
2054
+ declare type GetMigrationRequestIsMergedPathParams = {
2055
+ /**
2056
+ * The Database Name
2057
+ */
2058
+ dbName: DBName;
2059
+ /**
2060
+ * The migration request number.
2061
+ */
2062
+ mrNumber: number;
2063
+ workspace: string;
2064
+ };
2065
+ declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
2066
+ status: 400;
2067
+ payload: BadRequestError;
2068
+ } | {
2069
+ status: 401;
2070
+ payload: AuthError;
2071
+ } | {
2072
+ status: 404;
2073
+ payload: SimpleError;
2074
+ }>;
2075
+ declare type GetMigrationRequestIsMergedResponse = {
2076
+ merged?: boolean;
2077
+ };
2078
+ declare type GetMigrationRequestIsMergedVariables = {
2079
+ pathParams: GetMigrationRequestIsMergedPathParams;
2080
+ } & FetcherExtraProps;
2081
+ declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
2082
+ declare type MergeMigrationRequestPathParams = {
2083
+ /**
2084
+ * The Database Name
2085
+ */
2086
+ dbName: DBName;
2087
+ /**
2088
+ * The migration request number.
2089
+ */
2090
+ mrNumber: number;
2091
+ workspace: string;
2092
+ };
2093
+ declare type MergeMigrationRequestError = ErrorWrapper<{
2094
+ status: 400;
2095
+ payload: BadRequestError;
2096
+ } | {
2097
+ status: 401;
2098
+ payload: AuthError;
2099
+ } | {
2100
+ status: 404;
2101
+ payload: SimpleError;
2102
+ }>;
2103
+ declare type MergeMigrationRequestVariables = {
2104
+ pathParams: MergeMigrationRequestPathParams;
2105
+ } & FetcherExtraProps;
2106
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
1211
2107
  declare type GetBranchDetailsPathParams = {
2108
+ /**
2109
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2110
+ */
1212
2111
  dbBranchName: DBBranchName;
1213
2112
  workspace: string;
1214
2113
  };
@@ -1227,10 +2126,16 @@ declare type GetBranchDetailsVariables = {
1227
2126
  } & FetcherExtraProps;
1228
2127
  declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
1229
2128
  declare type CreateBranchPathParams = {
2129
+ /**
2130
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2131
+ */
1230
2132
  dbBranchName: DBBranchName;
1231
2133
  workspace: string;
1232
2134
  };
1233
2135
  declare type CreateBranchQueryParams = {
2136
+ /**
2137
+ * Name of source branch to branch the new schema from
2138
+ */
1234
2139
  from?: string;
1235
2140
  };
1236
2141
  declare type CreateBranchError = ErrorWrapper<{
@@ -1243,7 +2148,17 @@ declare type CreateBranchError = ErrorWrapper<{
1243
2148
  status: 404;
1244
2149
  payload: SimpleError;
1245
2150
  }>;
2151
+ declare type CreateBranchResponse = {
2152
+ /**
2153
+ * @minLength 1
2154
+ */
2155
+ databaseName: string;
2156
+ branchName: string;
2157
+ };
1246
2158
  declare type CreateBranchRequestBody = {
2159
+ /**
2160
+ * Select the branch to fork from. Defaults to 'main'
2161
+ */
1247
2162
  from?: string;
1248
2163
  metadata?: BranchMetadata;
1249
2164
  };
@@ -1252,8 +2167,11 @@ declare type CreateBranchVariables = {
1252
2167
  pathParams: CreateBranchPathParams;
1253
2168
  queryParams?: CreateBranchQueryParams;
1254
2169
  } & FetcherExtraProps;
1255
- declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
2170
+ declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
1256
2171
  declare type DeleteBranchPathParams = {
2172
+ /**
2173
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2174
+ */
1257
2175
  dbBranchName: DBBranchName;
1258
2176
  workspace: string;
1259
2177
  };
@@ -1275,6 +2193,9 @@ declare type DeleteBranchVariables = {
1275
2193
  */
1276
2194
  declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
1277
2195
  declare type UpdateBranchMetadataPathParams = {
2196
+ /**
2197
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2198
+ */
1278
2199
  dbBranchName: DBBranchName;
1279
2200
  workspace: string;
1280
2201
  };
@@ -1297,6 +2218,9 @@ declare type UpdateBranchMetadataVariables = {
1297
2218
  */
1298
2219
  declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
1299
2220
  declare type GetBranchMetadataPathParams = {
2221
+ /**
2222
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2223
+ */
1300
2224
  dbBranchName: DBBranchName;
1301
2225
  workspace: string;
1302
2226
  };
@@ -1315,6 +2239,9 @@ declare type GetBranchMetadataVariables = {
1315
2239
  } & FetcherExtraProps;
1316
2240
  declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
1317
2241
  declare type GetBranchMigrationHistoryPathParams = {
2242
+ /**
2243
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2244
+ */
1318
2245
  dbBranchName: DBBranchName;
1319
2246
  workspace: string;
1320
2247
  };
@@ -1342,6 +2269,9 @@ declare type GetBranchMigrationHistoryVariables = {
1342
2269
  } & FetcherExtraProps;
1343
2270
  declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
1344
2271
  declare type ExecuteBranchMigrationPlanPathParams = {
2272
+ /**
2273
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2274
+ */
1345
2275
  dbBranchName: DBBranchName;
1346
2276
  workspace: string;
1347
2277
  };
@@ -1359,19 +2289,183 @@ declare type ExecuteBranchMigrationPlanRequestBody = {
1359
2289
  version: number;
1360
2290
  migration: BranchMigration;
1361
2291
  };
1362
- declare type ExecuteBranchMigrationPlanVariables = {
1363
- body: ExecuteBranchMigrationPlanRequestBody;
1364
- pathParams: ExecuteBranchMigrationPlanPathParams;
2292
+ declare type ExecuteBranchMigrationPlanVariables = {
2293
+ body: ExecuteBranchMigrationPlanRequestBody;
2294
+ pathParams: ExecuteBranchMigrationPlanPathParams;
2295
+ } & FetcherExtraProps;
2296
+ /**
2297
+ * Apply a migration plan to the branch
2298
+ */
2299
+ declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2300
+ declare type GetBranchMigrationPlanPathParams = {
2301
+ /**
2302
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2303
+ */
2304
+ dbBranchName: DBBranchName;
2305
+ workspace: string;
2306
+ };
2307
+ declare type GetBranchMigrationPlanError = ErrorWrapper<{
2308
+ status: 400;
2309
+ payload: BadRequestError;
2310
+ } | {
2311
+ status: 401;
2312
+ payload: AuthError;
2313
+ } | {
2314
+ status: 404;
2315
+ payload: SimpleError;
2316
+ }>;
2317
+ declare type GetBranchMigrationPlanVariables = {
2318
+ body: Schema;
2319
+ pathParams: GetBranchMigrationPlanPathParams;
2320
+ } & FetcherExtraProps;
2321
+ /**
2322
+ * Compute a migration plan from a target schema the branch should be migrated too.
2323
+ */
2324
+ declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2325
+ declare type CompareBranchWithUserSchemaPathParams = {
2326
+ /**
2327
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2328
+ */
2329
+ dbBranchName: DBBranchName;
2330
+ workspace: string;
2331
+ };
2332
+ declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
2333
+ status: 400;
2334
+ payload: BadRequestError;
2335
+ } | {
2336
+ status: 401;
2337
+ payload: AuthError;
2338
+ } | {
2339
+ status: 404;
2340
+ payload: SimpleError;
2341
+ }>;
2342
+ declare type CompareBranchWithUserSchemaRequestBody = {
2343
+ schema: Schema;
2344
+ };
2345
+ declare type CompareBranchWithUserSchemaVariables = {
2346
+ body: CompareBranchWithUserSchemaRequestBody;
2347
+ pathParams: CompareBranchWithUserSchemaPathParams;
2348
+ } & FetcherExtraProps;
2349
+ declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
2350
+ declare type CompareBranchSchemasPathParams = {
2351
+ /**
2352
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2353
+ */
2354
+ dbBranchName: DBBranchName;
2355
+ /**
2356
+ * The Database Name
2357
+ */
2358
+ branchName: BranchName;
2359
+ workspace: string;
2360
+ };
2361
+ declare type CompareBranchSchemasError = ErrorWrapper<{
2362
+ status: 400;
2363
+ payload: BadRequestError;
2364
+ } | {
2365
+ status: 401;
2366
+ payload: AuthError;
2367
+ } | {
2368
+ status: 404;
2369
+ payload: SimpleError;
2370
+ }>;
2371
+ declare type CompareBranchSchemasVariables = {
2372
+ body?: Record<string, any>;
2373
+ pathParams: CompareBranchSchemasPathParams;
2374
+ } & FetcherExtraProps;
2375
+ declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
2376
+ declare type UpdateBranchSchemaPathParams = {
2377
+ /**
2378
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2379
+ */
2380
+ dbBranchName: DBBranchName;
2381
+ workspace: string;
2382
+ };
2383
+ declare type UpdateBranchSchemaError = ErrorWrapper<{
2384
+ status: 400;
2385
+ payload: BadRequestError;
2386
+ } | {
2387
+ status: 401;
2388
+ payload: AuthError;
2389
+ } | {
2390
+ status: 404;
2391
+ payload: SimpleError;
2392
+ }>;
2393
+ declare type UpdateBranchSchemaResponse = {
2394
+ id: string;
2395
+ parentID: string;
2396
+ };
2397
+ declare type UpdateBranchSchemaVariables = {
2398
+ body: Migration;
2399
+ pathParams: UpdateBranchSchemaPathParams;
2400
+ } & FetcherExtraProps;
2401
+ declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
2402
+ declare type PreviewBranchSchemaEditPathParams = {
2403
+ /**
2404
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2405
+ */
2406
+ dbBranchName: DBBranchName;
2407
+ workspace: string;
2408
+ };
2409
+ declare type PreviewBranchSchemaEditError = ErrorWrapper<{
2410
+ status: 400;
2411
+ payload: BadRequestError;
2412
+ } | {
2413
+ status: 401;
2414
+ payload: AuthError;
2415
+ } | {
2416
+ status: 404;
2417
+ payload: SimpleError;
2418
+ }>;
2419
+ declare type PreviewBranchSchemaEditResponse = {
2420
+ original: Schema;
2421
+ updated: Schema;
2422
+ };
2423
+ declare type PreviewBranchSchemaEditRequestBody = {
2424
+ edits?: SchemaEditScript;
2425
+ operations?: MigrationOp[];
2426
+ };
2427
+ declare type PreviewBranchSchemaEditVariables = {
2428
+ body?: PreviewBranchSchemaEditRequestBody;
2429
+ pathParams: PreviewBranchSchemaEditPathParams;
2430
+ } & FetcherExtraProps;
2431
+ declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
2432
+ declare type ApplyBranchSchemaEditPathParams = {
2433
+ /**
2434
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2435
+ */
2436
+ dbBranchName: DBBranchName;
2437
+ workspace: string;
2438
+ };
2439
+ declare type ApplyBranchSchemaEditError = ErrorWrapper<{
2440
+ status: 400;
2441
+ payload: BadRequestError;
2442
+ } | {
2443
+ status: 401;
2444
+ payload: AuthError;
2445
+ } | {
2446
+ status: 404;
2447
+ payload: SimpleError;
2448
+ }>;
2449
+ declare type ApplyBranchSchemaEditResponse = {
2450
+ id: string;
2451
+ parentID: string;
2452
+ };
2453
+ declare type ApplyBranchSchemaEditRequestBody = {
2454
+ edits: SchemaEditScript;
2455
+ };
2456
+ declare type ApplyBranchSchemaEditVariables = {
2457
+ body: ApplyBranchSchemaEditRequestBody;
2458
+ pathParams: ApplyBranchSchemaEditPathParams;
1365
2459
  } & FetcherExtraProps;
1366
- /**
1367
- * Apply a migration plan to the branch
1368
- */
1369
- declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
1370
- declare type GetBranchMigrationPlanPathParams = {
2460
+ declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
2461
+ declare type GetBranchSchemaHistoryPathParams = {
2462
+ /**
2463
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2464
+ */
1371
2465
  dbBranchName: DBBranchName;
1372
2466
  workspace: string;
1373
2467
  };
1374
- declare type GetBranchMigrationPlanError = ErrorWrapper<{
2468
+ declare type GetBranchSchemaHistoryError = ErrorWrapper<{
1375
2469
  status: 400;
1376
2470
  payload: BadRequestError;
1377
2471
  } | {
@@ -1381,15 +2475,46 @@ declare type GetBranchMigrationPlanError = ErrorWrapper<{
1381
2475
  status: 404;
1382
2476
  payload: SimpleError;
1383
2477
  }>;
1384
- declare type GetBranchMigrationPlanVariables = {
1385
- body: Schema;
1386
- pathParams: GetBranchMigrationPlanPathParams;
2478
+ declare type GetBranchSchemaHistoryResponse = {
2479
+ meta: {
2480
+ /**
2481
+ * last record id
2482
+ */
2483
+ cursor: string;
2484
+ /**
2485
+ * true if more records can be fetch
2486
+ */
2487
+ more: boolean;
2488
+ };
2489
+ logs: Commit[];
2490
+ };
2491
+ declare type GetBranchSchemaHistoryRequestBody = {
2492
+ page?: {
2493
+ /**
2494
+ * Query the next page that follow the cursor.
2495
+ */
2496
+ after?: string;
2497
+ /**
2498
+ * Query the previous page before the cursor.
2499
+ */
2500
+ before?: string;
2501
+ /**
2502
+ * Set page size. If the size is missing it is read from the cursor. If no cursor is given xata will choose the default page size.
2503
+ *
2504
+ * @default 20
2505
+ */
2506
+ size?: number;
2507
+ };
2508
+ };
2509
+ declare type GetBranchSchemaHistoryVariables = {
2510
+ body?: GetBranchSchemaHistoryRequestBody;
2511
+ pathParams: GetBranchSchemaHistoryPathParams;
1387
2512
  } & FetcherExtraProps;
1388
- /**
1389
- * Compute a migration plan from a target schema the branch should be migrated too.
1390
- */
1391
- declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2513
+ declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
1392
2514
  declare type GetBranchStatsPathParams = {
2515
+ /**
2516
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2517
+ */
1393
2518
  dbBranchName: DBBranchName;
1394
2519
  workspace: string;
1395
2520
  };
@@ -1422,7 +2547,13 @@ declare type GetBranchStatsVariables = {
1422
2547
  */
1423
2548
  declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
1424
2549
  declare type CreateTablePathParams = {
2550
+ /**
2551
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2552
+ */
1425
2553
  dbBranchName: DBBranchName;
2554
+ /**
2555
+ * The Table name
2556
+ */
1426
2557
  tableName: TableName;
1427
2558
  workspace: string;
1428
2559
  };
@@ -1439,15 +2570,28 @@ declare type CreateTableError = ErrorWrapper<{
1439
2570
  status: 422;
1440
2571
  payload: SimpleError;
1441
2572
  }>;
2573
+ declare type CreateTableResponse = {
2574
+ branchName: string;
2575
+ /**
2576
+ * @minLength 1
2577
+ */
2578
+ tableName: string;
2579
+ };
1442
2580
  declare type CreateTableVariables = {
1443
2581
  pathParams: CreateTablePathParams;
1444
2582
  } & FetcherExtraProps;
1445
2583
  /**
1446
2584
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1447
2585
  */
1448
- declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
2586
+ declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
1449
2587
  declare type DeleteTablePathParams = {
2588
+ /**
2589
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2590
+ */
1450
2591
  dbBranchName: DBBranchName;
2592
+ /**
2593
+ * The Table name
2594
+ */
1451
2595
  tableName: TableName;
1452
2596
  workspace: string;
1453
2597
  };
@@ -1466,7 +2610,13 @@ declare type DeleteTableVariables = {
1466
2610
  */
1467
2611
  declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
1468
2612
  declare type UpdateTablePathParams = {
2613
+ /**
2614
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2615
+ */
1469
2616
  dbBranchName: DBBranchName;
2617
+ /**
2618
+ * The Table name
2619
+ */
1470
2620
  tableName: TableName;
1471
2621
  workspace: string;
1472
2622
  };
@@ -1481,6 +2631,9 @@ declare type UpdateTableError = ErrorWrapper<{
1481
2631
  payload: SimpleError;
1482
2632
  }>;
1483
2633
  declare type UpdateTableRequestBody = {
2634
+ /**
2635
+ * @minLength 1
2636
+ */
1484
2637
  name: string;
1485
2638
  };
1486
2639
  declare type UpdateTableVariables = {
@@ -1502,7 +2655,13 @@ declare type UpdateTableVariables = {
1502
2655
  */
1503
2656
  declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
1504
2657
  declare type GetTableSchemaPathParams = {
2658
+ /**
2659
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2660
+ */
1505
2661
  dbBranchName: DBBranchName;
2662
+ /**
2663
+ * The Table name
2664
+ */
1506
2665
  tableName: TableName;
1507
2666
  workspace: string;
1508
2667
  };
@@ -1524,7 +2683,13 @@ declare type GetTableSchemaVariables = {
1524
2683
  } & FetcherExtraProps;
1525
2684
  declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
1526
2685
  declare type SetTableSchemaPathParams = {
2686
+ /**
2687
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2688
+ */
1527
2689
  dbBranchName: DBBranchName;
2690
+ /**
2691
+ * The Table name
2692
+ */
1528
2693
  tableName: TableName;
1529
2694
  workspace: string;
1530
2695
  };
@@ -1550,7 +2715,13 @@ declare type SetTableSchemaVariables = {
1550
2715
  } & FetcherExtraProps;
1551
2716
  declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
1552
2717
  declare type GetTableColumnsPathParams = {
2718
+ /**
2719
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2720
+ */
1553
2721
  dbBranchName: DBBranchName;
2722
+ /**
2723
+ * The Table name
2724
+ */
1554
2725
  tableName: TableName;
1555
2726
  workspace: string;
1556
2727
  };
@@ -1576,7 +2747,13 @@ declare type GetTableColumnsVariables = {
1576
2747
  */
1577
2748
  declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
1578
2749
  declare type AddTableColumnPathParams = {
2750
+ /**
2751
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2752
+ */
1579
2753
  dbBranchName: DBBranchName;
2754
+ /**
2755
+ * The Table name
2756
+ */
1580
2757
  tableName: TableName;
1581
2758
  workspace: string;
1582
2759
  };
@@ -1601,8 +2778,17 @@ declare type AddTableColumnVariables = {
1601
2778
  */
1602
2779
  declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
1603
2780
  declare type GetColumnPathParams = {
2781
+ /**
2782
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2783
+ */
1604
2784
  dbBranchName: DBBranchName;
2785
+ /**
2786
+ * The Table name
2787
+ */
1605
2788
  tableName: TableName;
2789
+ /**
2790
+ * The Column name
2791
+ */
1606
2792
  columnName: ColumnName;
1607
2793
  workspace: string;
1608
2794
  };
@@ -1624,8 +2810,17 @@ declare type GetColumnVariables = {
1624
2810
  */
1625
2811
  declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
1626
2812
  declare type DeleteColumnPathParams = {
2813
+ /**
2814
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2815
+ */
1627
2816
  dbBranchName: DBBranchName;
2817
+ /**
2818
+ * The Table name
2819
+ */
1628
2820
  tableName: TableName;
2821
+ /**
2822
+ * The Column name
2823
+ */
1629
2824
  columnName: ColumnName;
1630
2825
  workspace: string;
1631
2826
  };
@@ -1647,8 +2842,17 @@ declare type DeleteColumnVariables = {
1647
2842
  */
1648
2843
  declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
1649
2844
  declare type UpdateColumnPathParams = {
2845
+ /**
2846
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2847
+ */
1650
2848
  dbBranchName: DBBranchName;
2849
+ /**
2850
+ * The Table name
2851
+ */
1651
2852
  tableName: TableName;
2853
+ /**
2854
+ * The Column name
2855
+ */
1652
2856
  columnName: ColumnName;
1653
2857
  workspace: string;
1654
2858
  };
@@ -1663,6 +2867,9 @@ declare type UpdateColumnError = ErrorWrapper<{
1663
2867
  payload: SimpleError;
1664
2868
  }>;
1665
2869
  declare type UpdateColumnRequestBody = {
2870
+ /**
2871
+ * @minLength 1
2872
+ */
1666
2873
  name: string;
1667
2874
  };
1668
2875
  declare type UpdateColumnVariables = {
@@ -1674,10 +2881,22 @@ declare type UpdateColumnVariables = {
1674
2881
  */
1675
2882
  declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
1676
2883
  declare type InsertRecordPathParams = {
2884
+ /**
2885
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2886
+ */
1677
2887
  dbBranchName: DBBranchName;
2888
+ /**
2889
+ * The Table name
2890
+ */
1678
2891
  tableName: TableName;
1679
2892
  workspace: string;
1680
2893
  };
2894
+ declare type InsertRecordQueryParams = {
2895
+ /**
2896
+ * Column filters
2897
+ */
2898
+ columns?: ColumnsProjection;
2899
+ };
1681
2900
  declare type InsertRecordError = ErrorWrapper<{
1682
2901
  status: 400;
1683
2902
  payload: BadRequestError;
@@ -1688,27 +2907,35 @@ declare type InsertRecordError = ErrorWrapper<{
1688
2907
  status: 404;
1689
2908
  payload: SimpleError;
1690
2909
  }>;
1691
- declare type InsertRecordResponse = {
1692
- id: string;
1693
- xata: {
1694
- version: number;
1695
- };
1696
- };
1697
2910
  declare type InsertRecordVariables = {
1698
2911
  body?: Record<string, any>;
1699
2912
  pathParams: InsertRecordPathParams;
2913
+ queryParams?: InsertRecordQueryParams;
1700
2914
  } & FetcherExtraProps;
1701
2915
  /**
1702
2916
  * Insert a new Record into the Table
1703
2917
  */
1704
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2918
+ declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
1705
2919
  declare type InsertRecordWithIDPathParams = {
2920
+ /**
2921
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2922
+ */
1706
2923
  dbBranchName: DBBranchName;
2924
+ /**
2925
+ * The Table name
2926
+ */
1707
2927
  tableName: TableName;
2928
+ /**
2929
+ * The Record name
2930
+ */
1708
2931
  recordId: RecordID;
1709
2932
  workspace: string;
1710
2933
  };
1711
2934
  declare type InsertRecordWithIDQueryParams = {
2935
+ /**
2936
+ * Column filters
2937
+ */
2938
+ columns?: ColumnsProjection;
1712
2939
  createOnly?: boolean;
1713
2940
  ifVersion?: number;
1714
2941
  };
@@ -1735,12 +2962,25 @@ declare type InsertRecordWithIDVariables = {
1735
2962
  */
1736
2963
  declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
1737
2964
  declare type UpdateRecordWithIDPathParams = {
2965
+ /**
2966
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2967
+ */
1738
2968
  dbBranchName: DBBranchName;
2969
+ /**
2970
+ * The Table name
2971
+ */
1739
2972
  tableName: TableName;
2973
+ /**
2974
+ * The Record name
2975
+ */
1740
2976
  recordId: RecordID;
1741
2977
  workspace: string;
1742
2978
  };
1743
2979
  declare type UpdateRecordWithIDQueryParams = {
2980
+ /**
2981
+ * Column filters
2982
+ */
2983
+ columns?: ColumnsProjection;
1744
2984
  ifVersion?: number;
1745
2985
  };
1746
2986
  declare type UpdateRecordWithIDError = ErrorWrapper<{
@@ -1763,12 +3003,25 @@ declare type UpdateRecordWithIDVariables = {
1763
3003
  } & FetcherExtraProps;
1764
3004
  declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
1765
3005
  declare type UpsertRecordWithIDPathParams = {
3006
+ /**
3007
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3008
+ */
1766
3009
  dbBranchName: DBBranchName;
3010
+ /**
3011
+ * The Table name
3012
+ */
1767
3013
  tableName: TableName;
3014
+ /**
3015
+ * The Record name
3016
+ */
1768
3017
  recordId: RecordID;
1769
3018
  workspace: string;
1770
3019
  };
1771
3020
  declare type UpsertRecordWithIDQueryParams = {
3021
+ /**
3022
+ * Column filters
3023
+ */
3024
+ columns?: ColumnsProjection;
1772
3025
  ifVersion?: number;
1773
3026
  };
1774
3027
  declare type UpsertRecordWithIDError = ErrorWrapper<{
@@ -1791,11 +3044,26 @@ declare type UpsertRecordWithIDVariables = {
1791
3044
  } & FetcherExtraProps;
1792
3045
  declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
1793
3046
  declare type DeleteRecordPathParams = {
3047
+ /**
3048
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3049
+ */
1794
3050
  dbBranchName: DBBranchName;
3051
+ /**
3052
+ * The Table name
3053
+ */
1795
3054
  tableName: TableName;
3055
+ /**
3056
+ * The Record name
3057
+ */
1796
3058
  recordId: RecordID;
1797
3059
  workspace: string;
1798
3060
  };
3061
+ declare type DeleteRecordQueryParams = {
3062
+ /**
3063
+ * Column filters
3064
+ */
3065
+ columns?: ColumnsProjection;
3066
+ };
1799
3067
  declare type DeleteRecordError = ErrorWrapper<{
1800
3068
  status: 400;
1801
3069
  payload: BadRequestError;
@@ -1808,14 +3076,30 @@ declare type DeleteRecordError = ErrorWrapper<{
1808
3076
  }>;
1809
3077
  declare type DeleteRecordVariables = {
1810
3078
  pathParams: DeleteRecordPathParams;
3079
+ queryParams?: DeleteRecordQueryParams;
1811
3080
  } & FetcherExtraProps;
1812
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
3081
+ declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
1813
3082
  declare type GetRecordPathParams = {
3083
+ /**
3084
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3085
+ */
1814
3086
  dbBranchName: DBBranchName;
3087
+ /**
3088
+ * The Table name
3089
+ */
1815
3090
  tableName: TableName;
3091
+ /**
3092
+ * The Record name
3093
+ */
1816
3094
  recordId: RecordID;
1817
3095
  workspace: string;
1818
3096
  };
3097
+ declare type GetRecordQueryParams = {
3098
+ /**
3099
+ * Column filters
3100
+ */
3101
+ columns?: ColumnsProjection;
3102
+ };
1819
3103
  declare type GetRecordError = ErrorWrapper<{
1820
3104
  status: 400;
1821
3105
  payload: BadRequestError;
@@ -1826,22 +3110,31 @@ declare type GetRecordError = ErrorWrapper<{
1826
3110
  status: 404;
1827
3111
  payload: SimpleError;
1828
3112
  }>;
1829
- declare type GetRecordRequestBody = {
1830
- columns?: ColumnsFilter;
1831
- };
1832
3113
  declare type GetRecordVariables = {
1833
- body?: GetRecordRequestBody;
1834
3114
  pathParams: GetRecordPathParams;
3115
+ queryParams?: GetRecordQueryParams;
1835
3116
  } & FetcherExtraProps;
1836
3117
  /**
1837
3118
  * Retrieve record by ID
1838
3119
  */
1839
3120
  declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
1840
3121
  declare type BulkInsertTableRecordsPathParams = {
3122
+ /**
3123
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3124
+ */
1841
3125
  dbBranchName: DBBranchName;
3126
+ /**
3127
+ * The Table name
3128
+ */
1842
3129
  tableName: TableName;
1843
3130
  workspace: string;
1844
3131
  };
3132
+ declare type BulkInsertTableRecordsQueryParams = {
3133
+ /**
3134
+ * Column filters
3135
+ */
3136
+ columns?: ColumnsProjection;
3137
+ };
1845
3138
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
1846
3139
  status: 400;
1847
3140
  payload: BulkError;
@@ -1851,23 +3144,30 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1851
3144
  } | {
1852
3145
  status: 404;
1853
3146
  payload: SimpleError;
3147
+ } | {
3148
+ status: 422;
3149
+ payload: SimpleError;
1854
3150
  }>;
1855
- declare type BulkInsertTableRecordsResponse = {
1856
- recordIDs: string[];
1857
- };
1858
3151
  declare type BulkInsertTableRecordsRequestBody = {
1859
3152
  records: Record<string, any>[];
1860
3153
  };
1861
3154
  declare type BulkInsertTableRecordsVariables = {
1862
3155
  body: BulkInsertTableRecordsRequestBody;
1863
3156
  pathParams: BulkInsertTableRecordsPathParams;
3157
+ queryParams?: BulkInsertTableRecordsQueryParams;
1864
3158
  } & FetcherExtraProps;
1865
3159
  /**
1866
3160
  * Bulk insert records
1867
3161
  */
1868
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
3162
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
1869
3163
  declare type QueryTablePathParams = {
3164
+ /**
3165
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3166
+ */
1870
3167
  dbBranchName: DBBranchName;
3168
+ /**
3169
+ * The Table name
3170
+ */
1871
3171
  tableName: TableName;
1872
3172
  workspace: string;
1873
3173
  };
@@ -1885,7 +3185,7 @@ declare type QueryTableRequestBody = {
1885
3185
  filter?: FilterExpression;
1886
3186
  sort?: SortExpression;
1887
3187
  page?: PageConfig;
1888
- columns?: ColumnsFilter;
3188
+ columns?: ColumnsProjection;
1889
3189
  };
1890
3190
  declare type QueryTableVariables = {
1891
3191
  body?: QueryTableRequestBody;
@@ -1921,8 +3221,9 @@ declare type QueryTableVariables = {
1921
3221
  * If the `columns` array is not specified, all columns are included. For link
1922
3222
  * fields, only the ID column of the linked records is included in the response.
1923
3223
  *
1924
- * If the `columns` array is specified, only the selected columns are included.
1925
- * The `*` wildcard can be used to select all columns of the given array
3224
+ * If the `columns` array is specified, only the selected and internal
3225
+ * columns `id` and `xata` are included. The `*` wildcard can be used to
3226
+ * select all columns.
1926
3227
  *
1927
3228
  * For objects and link fields, if the column name of the object is specified, we
1928
3229
  * include all of its sub-keys. If only some sub-keys are specified (via dotted
@@ -2038,6 +3339,10 @@ declare type QueryTableVariables = {
2038
3339
  *
2039
3340
  * ```json
2040
3341
  * {
3342
+ * "id": "id1"
3343
+ * "xata": {
3344
+ * "version": 0
3345
+ * }
2041
3346
  * "name": "Kilian",
2042
3347
  * "address": {
2043
3348
  * "street": "New street"
@@ -2057,6 +3362,10 @@ declare type QueryTableVariables = {
2057
3362
  *
2058
3363
  * ```json
2059
3364
  * {
3365
+ * "id": "id1"
3366
+ * "xata": {
3367
+ * "version": 0
3368
+ * }
2060
3369
  * "name": "Kilian",
2061
3370
  * "email": "kilian@gmail.com",
2062
3371
  * "address": {
@@ -2086,6 +3395,10 @@ declare type QueryTableVariables = {
2086
3395
  *
2087
3396
  * ```json
2088
3397
  * {
3398
+ * "id": "id1"
3399
+ * "xata": {
3400
+ * "version": 0
3401
+ * }
2089
3402
  * "name": "Kilian",
2090
3403
  * "email": "kilian@gmail.com",
2091
3404
  * "address": {
@@ -2614,7 +3927,13 @@ declare type QueryTableVariables = {
2614
3927
  */
2615
3928
  declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2616
3929
  declare type SearchTablePathParams = {
3930
+ /**
3931
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3932
+ */
2617
3933
  dbBranchName: DBBranchName;
3934
+ /**
3935
+ * The Table name
3936
+ */
2618
3937
  tableName: TableName;
2619
3938
  workspace: string;
2620
3939
  };
@@ -2629,11 +3948,17 @@ declare type SearchTableError = ErrorWrapper<{
2629
3948
  payload: SimpleError;
2630
3949
  }>;
2631
3950
  declare type SearchTableRequestBody = {
3951
+ /**
3952
+ * The query string.
3953
+ *
3954
+ * @minLength 1
3955
+ */
2632
3956
  query: string;
2633
3957
  fuzziness?: FuzzinessExpression;
2634
3958
  prefix?: PrefixExpression;
2635
3959
  filter?: FilterExpression;
2636
3960
  highlight?: HighlightExpression;
3961
+ boosters?: BoosterExpression[];
2637
3962
  };
2638
3963
  declare type SearchTableVariables = {
2639
3964
  body: SearchTableRequestBody;
@@ -2648,6 +3973,9 @@ declare type SearchTableVariables = {
2648
3973
  */
2649
3974
  declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2650
3975
  declare type SearchBranchPathParams = {
3976
+ /**
3977
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3978
+ */
2651
3979
  dbBranchName: DBBranchName;
2652
3980
  workspace: string;
2653
3981
  };
@@ -2662,12 +3990,25 @@ declare type SearchBranchError = ErrorWrapper<{
2662
3990
  payload: SimpleError;
2663
3991
  }>;
2664
3992
  declare type SearchBranchRequestBody = {
3993
+ /**
3994
+ * An array with the tables in which to search. By default, all tables are included. Optionally, filters can be included that apply to each table.
3995
+ */
2665
3996
  tables?: (string | {
3997
+ /**
3998
+ * The name of the table.
3999
+ */
2666
4000
  table: string;
2667
4001
  filter?: FilterExpression;
4002
+ boosters?: BoosterExpression[];
2668
4003
  })[];
4004
+ /**
4005
+ * The query string.
4006
+ *
4007
+ * @minLength 1
4008
+ */
2669
4009
  query: string;
2670
4010
  fuzziness?: FuzzinessExpression;
4011
+ prefix?: PrefixExpression;
2671
4012
  highlight?: HighlightExpression;
2672
4013
  };
2673
4014
  declare type SearchBranchVariables = {
@@ -2678,6 +4019,77 @@ declare type SearchBranchVariables = {
2678
4019
  * Run a free text search operation across the database branch.
2679
4020
  */
2680
4021
  declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
4022
+ declare type SummarizeTablePathParams = {
4023
+ /**
4024
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4025
+ */
4026
+ dbBranchName: DBBranchName;
4027
+ /**
4028
+ * The Table name
4029
+ */
4030
+ tableName: TableName;
4031
+ workspace: string;
4032
+ };
4033
+ declare type SummarizeTableError = ErrorWrapper<{
4034
+ status: 400;
4035
+ payload: BadRequestError;
4036
+ } | {
4037
+ status: 401;
4038
+ payload: AuthError;
4039
+ } | {
4040
+ status: 404;
4041
+ payload: SimpleError;
4042
+ }>;
4043
+ declare type SummarizeTableRequestBody = {
4044
+ columns?: ColumnsProjection;
4045
+ summaries?: SummaryExpressionList;
4046
+ sort?: SortExpression;
4047
+ };
4048
+ declare type SummarizeTableVariables = {
4049
+ body?: SummarizeTableRequestBody;
4050
+ pathParams: SummarizeTablePathParams;
4051
+ } & FetcherExtraProps;
4052
+ /**
4053
+ * This endpoint allows you to (optionally) define groups, and then to run
4054
+ * calculations on the values in each group. This is most helpful when you'd
4055
+ * like to understand the data you have in your database.
4056
+ *
4057
+ * A group is a combination of unique values. If you create a group for `sold_by`,
4058
+ * `product_name`, we will return one row for every combination of `sold_by` and
4059
+ * `product_name` you have in your database. When you want to calculate statistics,
4060
+ * you define these groups and ask Xata to calculate data on each group.
4061
+ *
4062
+ * **Some questions you can ask of your data:**
4063
+ *
4064
+ * How many records do I have in this table?
4065
+ * - Set `columns: []` as we we want data from the entire table, so we ask for no groups.
4066
+ * - Set `summaries: {"total": {"count": "*"}}` in order to see the count of all records.
4067
+ * We use `count: *` here we'd like to know the total amount of rows; ignoring whether
4068
+ * they are `null` or not.
4069
+ *
4070
+ * What are the top total sales for each product?
4071
+ * - Set `columns: [product_name]` as we'd like to run calculations on each unique product
4072
+ * name in our table. Setting `columns` like this will produce one row per unique product
4073
+ * name.
4074
+ * - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd like to create a
4075
+ * field called "total_sales" for each group. This field will count all rows in each group
4076
+ * with non-null product names.
4077
+ * - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with the highest
4078
+ * total_sales field to the top.
4079
+ *
4080
+ * `columns`: tells Xata how to create each group. If you add `product_id` we will create
4081
+ * a new group for every unique `product_id`.
4082
+ *
4083
+ * `summaries`: tells Xata which calculations to run on each group.
4084
+ *
4085
+ * `sort`: tells Xata in which order you'd like to see results. You may sort by fields
4086
+ * specified in `columns` as well as the summary names defined in `summaries`.
4087
+ *
4088
+ * note: Sorting on summarized values can be slower on very large tables; this will impact
4089
+ * your rate limit significantly more than other queries. Try use `filter` [coming soon] to
4090
+ * reduce the amount of data being processed in order to reduce impact on your limits.
4091
+ */
4092
+ declare const summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
2681
4093
  declare const operationsByTag: {
2682
4094
  users: {
2683
4095
  getUser: (variables: GetUserVariables) => Promise<UserWithID>;
@@ -2697,6 +4109,7 @@ declare const operationsByTag: {
2697
4109
  updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2698
4110
  removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2699
4111
  inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
4112
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
2700
4113
  cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2701
4114
  resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2702
4115
  acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
@@ -2705,6 +4118,8 @@ declare const operationsByTag: {
2705
4118
  getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2706
4119
  createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2707
4120
  deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
4121
+ getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
4122
+ updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
2708
4123
  getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
2709
4124
  addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2710
4125
  removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
@@ -2713,17 +4128,35 @@ declare const operationsByTag: {
2713
4128
  branch: {
2714
4129
  getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2715
4130
  getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2716
- createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
4131
+ createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2717
4132
  deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2718
4133
  updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2719
4134
  getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
4135
+ getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
4136
+ };
4137
+ migrationRequests: {
4138
+ listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
4139
+ createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
4140
+ getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
4141
+ updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
4142
+ listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
4143
+ compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
4144
+ getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
4145
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
4146
+ };
4147
+ branchSchema: {
2720
4148
  getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2721
4149
  executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2722
4150
  getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2723
- getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
4151
+ compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
4152
+ compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
4153
+ updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
4154
+ previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
4155
+ applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
4156
+ getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
2724
4157
  };
2725
4158
  table: {
2726
- createTable: (variables: CreateTableVariables) => Promise<undefined>;
4159
+ createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2727
4160
  deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2728
4161
  updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2729
4162
  getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
@@ -2735,16 +4168,17 @@ declare const operationsByTag: {
2735
4168
  updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
2736
4169
  };
2737
4170
  records: {
2738
- insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
4171
+ insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
2739
4172
  insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2740
4173
  updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2741
4174
  upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2742
- deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
4175
+ deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
2743
4176
  getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2744
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
4177
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
2745
4178
  queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2746
4179
  searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2747
4180
  searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
4181
+ summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
2748
4182
  };
2749
4183
  };
2750
4184
 
@@ -2759,10 +4193,8 @@ interface XataApiClientOptions {
2759
4193
  fetch?: FetchImpl;
2760
4194
  apiKey?: string;
2761
4195
  host?: HostProvider;
4196
+ trace?: TraceFunction;
2762
4197
  }
2763
- /**
2764
- * @deprecated Use XataApiPlugin instead
2765
- */
2766
4198
  declare class XataApiClient {
2767
4199
  #private;
2768
4200
  constructor(options?: XataApiClientOptions);
@@ -2772,6 +4204,8 @@ declare class XataApiClient {
2772
4204
  get branches(): BranchApi;
2773
4205
  get tables(): TableApi;
2774
4206
  get records(): RecordsApi;
4207
+ get migrationRequests(): MigrationRequestsApi;
4208
+ get branchSchema(): BranchSchemaApi;
2775
4209
  }
2776
4210
  declare class UserApi {
2777
4211
  private extraProps;
@@ -2795,6 +4229,7 @@ declare class WorkspaceApi {
2795
4229
  updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2796
4230
  removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2797
4231
  inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
4232
+ updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
2798
4233
  cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2799
4234
  resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2800
4235
  acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
@@ -2805,6 +4240,8 @@ declare class DatabaseApi {
2805
4240
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2806
4241
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2807
4242
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
4243
+ getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
4244
+ updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
2808
4245
  getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2809
4246
  addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2810
4247
  removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
@@ -2815,19 +4252,16 @@ declare class BranchApi {
2815
4252
  constructor(extraProps: FetcherExtraProps);
2816
4253
  getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2817
4254
  getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2818
- createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<void>;
4255
+ createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
2819
4256
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2820
4257
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2821
4258
  getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
2822
- getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
2823
- executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
2824
- getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
2825
4259
  getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
2826
4260
  }
2827
4261
  declare class TableApi {
2828
4262
  private extraProps;
2829
4263
  constructor(extraProps: FetcherExtraProps);
2830
- createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
4264
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
2831
4265
  deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2832
4266
  updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2833
4267
  getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
@@ -2841,16 +4275,42 @@ declare class TableApi {
2841
4275
  declare class RecordsApi {
2842
4276
  private extraProps;
2843
4277
  constructor(extraProps: FetcherExtraProps);
2844
- insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>): Promise<InsertRecordResponse>;
4278
+ insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
2845
4279
  insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2846
4280
  updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2847
4281
  upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2848
- deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<void>;
2849
- getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordRequestBody): Promise<XataRecord$1>;
2850
- bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<BulkInsertTableRecordsResponse>;
4282
+ deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
4283
+ getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
4284
+ bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
2851
4285
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2852
4286
  searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2853
4287
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
4288
+ summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
4289
+ }
4290
+ declare class MigrationRequestsApi {
4291
+ private extraProps;
4292
+ constructor(extraProps: FetcherExtraProps);
4293
+ listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
4294
+ createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
4295
+ getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
4296
+ updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
4297
+ listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
4298
+ compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
4299
+ getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
4300
+ mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
4301
+ }
4302
+ declare class BranchSchemaApi {
4303
+ private extraProps;
4304
+ constructor(extraProps: FetcherExtraProps);
4305
+ getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
4306
+ executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
4307
+ getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
4308
+ compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
4309
+ compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
4310
+ updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
4311
+ previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
4312
+ applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
4313
+ getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
2854
4314
  }
2855
4315
 
2856
4316
  declare class XataApiPlugin implements XataPlugin {
@@ -2863,19 +4323,20 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
2863
4323
  declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2864
4324
  declare type IsObject<T> = T extends Record<string, any> ? true : false;
2865
4325
  declare type IsArray<T> = T extends Array<any> ? true : false;
2866
- declare type NonEmptyArray<T> = T[] & {
2867
- 0: T;
2868
- };
2869
4326
  declare type RequiredBy<T, K extends keyof T> = T & {
2870
4327
  [P in K]-?: NonNullable<T[P]>;
2871
4328
  };
2872
4329
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2873
4330
  declare type SingleOrArray<T> = T | T[];
2874
4331
  declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
4332
+ declare type Without<T, U> = {
4333
+ [P in Exclude<keyof T, keyof U>]?: never;
4334
+ };
4335
+ declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
2875
4336
 
2876
4337
  declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
2877
- declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
2878
- [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
4338
+ declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
4339
+ [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
2879
4340
  }>>;
2880
4341
  declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
2881
4342
  V: ValueAtColumn<Item, V>;
@@ -2911,42 +4372,51 @@ interface BaseData {
2911
4372
  /**
2912
4373
  * Represents a persisted record from the database.
2913
4374
  */
2914
- interface XataRecord<ExtraMetadata extends Record<string, unknown> = Record<string, unknown>> extends Identifiable {
4375
+ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
2915
4376
  /**
2916
4377
  * Get metadata of this record.
2917
4378
  */
2918
- getMetadata(): XataRecordMetadata & ExtraMetadata;
4379
+ getMetadata(): XataRecordMetadata;
4380
+ /**
4381
+ * Retrieves a refreshed copy of the current record from the database.
4382
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4383
+ * @returns The persisted record with the selected columns, null if not found.
4384
+ */
4385
+ read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2919
4386
  /**
2920
4387
  * Retrieves a refreshed copy of the current record from the database.
4388
+ * @returns The persisted record with all first level properties, null if not found.
2921
4389
  */
2922
- read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
4390
+ read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2923
4391
  /**
2924
4392
  * Performs a partial update of the current record. On success a new object is
2925
4393
  * returned and the current object is not mutated.
2926
4394
  * @param partialUpdate The columns and their values that have to be updated.
2927
- * @returns A new record containing the latest values for all the columns of the current record.
4395
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4396
+ * @returns The persisted record with the selected columns, null if not found.
2928
4397
  */
2929
- update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
4398
+ update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2930
4399
  /**
2931
- * Performs a deletion of the current record in the database.
2932
- *
2933
- * @throws If the record was already deleted or if an error happened while performing the deletion.
4400
+ * Performs a partial update of the current record. On success a new object is
4401
+ * returned and the current object is not mutated.
4402
+ * @param partialUpdate The columns and their values that have to be updated.
4403
+ * @returns The persisted record with all first level properties, null if not found.
2934
4404
  */
2935
- delete(): Promise<void>;
2936
- }
2937
- declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
4405
+ update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2938
4406
  /**
2939
- * Retrieves a refreshed copy of the current record from the database.
4407
+ * Performs a deletion of the current record in the database.
4408
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4409
+ * @returns The deleted record, null if not found.
2940
4410
  */
2941
- read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4411
+ delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2942
4412
  /**
2943
- * Performs a partial update of the current record. On success a new object is
2944
- * returned and the current object is not mutated.
2945
- * @param partialUpdate The columns and their values that have to be updated.
2946
- * @returns A new record containing the latest values for all the columns of the current record.
4413
+ * Performs a deletion of the current record in the database.
4414
+ * @returns The deleted record, null if not found.
4415
+
2947
4416
  */
2948
- update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2949
- };
4417
+ delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
4418
+ }
4419
+ declare type Link<Record extends XataRecord> = XataRecord<Record>;
2950
4420
  declare type XataRecordMetadata = {
2951
4421
  /**
2952
4422
  * Number that is increased every time the record is updated.
@@ -2956,13 +4426,13 @@ declare type XataRecordMetadata = {
2956
4426
  };
2957
4427
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2958
4428
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2959
- declare type EditableData<O extends BaseData> = {
4429
+ declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
2960
4430
  [K in keyof O]: O[K] extends XataRecord ? {
2961
4431
  id: string;
2962
4432
  } | string : NonNullable<O[K]> extends XataRecord ? {
2963
4433
  id: string;
2964
4434
  } | string | null | undefined : O[K];
2965
- };
4435
+ }, keyof XataRecord>;
2966
4436
 
2967
4437
  /**
2968
4438
  * PropertyMatchFilter
@@ -3056,7 +4526,85 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
3056
4526
  declare type NestedApiFilter<T> = {
3057
4527
  [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
3058
4528
  };
3059
- declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
4529
+ 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>;
4530
+
4531
+ declare type DateBooster = {
4532
+ origin?: string;
4533
+ scale: string;
4534
+ decay: number;
4535
+ };
4536
+ declare type NumericBooster = {
4537
+ factor: number;
4538
+ };
4539
+ declare type ValueBooster<T extends string | number | boolean> = {
4540
+ value: T;
4541
+ factor: number;
4542
+ };
4543
+ declare type Boosters<O extends XataRecord> = Values<{
4544
+ [K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
4545
+ dateBooster: {
4546
+ column: K;
4547
+ } & DateBooster;
4548
+ } : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
4549
+ numericBooster?: {
4550
+ column: K;
4551
+ } & NumericBooster;
4552
+ }, {
4553
+ valueBooster?: {
4554
+ column: K;
4555
+ } & ValueBooster<number>;
4556
+ }> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
4557
+ valueBooster: {
4558
+ column: K;
4559
+ } & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
4560
+ } : never;
4561
+ }>;
4562
+
4563
+ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
4564
+ fuzziness?: FuzzinessExpression;
4565
+ prefix?: PrefixExpression;
4566
+ highlight?: HighlightExpression;
4567
+ tables?: Array<Tables | Values<{
4568
+ [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
4569
+ table: Model;
4570
+ filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
4571
+ boosters?: Boosters<Schemas[Model] & XataRecord>[];
4572
+ };
4573
+ }>>;
4574
+ };
4575
+ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
4576
+ all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
4577
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
4578
+ table: Model;
4579
+ record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
4580
+ };
4581
+ }>[]>;
4582
+ byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
4583
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
4584
+ }>;
4585
+ };
4586
+ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
4587
+ #private;
4588
+ private db;
4589
+ constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
4590
+ build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
4591
+ }
4592
+ declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
4593
+ getMetadata: () => XataRecordMetadata & SearchExtraProperties;
4594
+ };
4595
+ declare type SearchExtraProperties = {
4596
+ table: string;
4597
+ highlight?: {
4598
+ [key: string]: string[] | {
4599
+ [key: string]: any;
4600
+ };
4601
+ };
4602
+ score?: number;
4603
+ };
4604
+ declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
4605
+ 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 {
4606
+ table: infer Table;
4607
+ } ? ReturnTable<Table, Tables> : never;
3060
4608
 
3061
4609
  declare type SortDirection = 'asc' | 'desc';
3062
4610
  declare type SortFilterExtended<T extends XataRecord> = {
@@ -3069,7 +4617,7 @@ declare type SortFilterBase<T extends XataRecord> = {
3069
4617
  };
3070
4618
 
3071
4619
  declare type BaseOptions<T extends XataRecord> = {
3072
- columns?: NonEmptyArray<SelectableColumn<T>>;
4620
+ columns?: SelectableColumn<T>[];
3073
4621
  cache?: number;
3074
4622
  };
3075
4623
  declare type CursorQueryOptions = {
@@ -3093,7 +4641,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3093
4641
  #private;
3094
4642
  readonly meta: PaginationQueryMeta;
3095
4643
  readonly records: RecordArray<Result>;
3096
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
4644
+ constructor(repository: Repository<Record> | null, table: {
4645
+ name: string;
4646
+ schema?: Table;
4647
+ }, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
3097
4648
  getQueryOptions(): QueryOptions<Record>;
3098
4649
  key(): string;
3099
4650
  /**
@@ -3132,7 +4683,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3132
4683
  * @param value The value to filter.
3133
4684
  * @returns A new Query object.
3134
4685
  */
3135
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
4686
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
3136
4687
  /**
3137
4688
  * Builds a new query object adding one or more constraints. Examples:
3138
4689
  *
@@ -3146,20 +4697,20 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3146
4697
  * @param filters A filter object
3147
4698
  * @returns A new Query object.
3148
4699
  */
3149
- filter(filters: Filter<Record>): Query<Record, Result>;
4700
+ filter(filters?: Filter<Record>): Query<Record, Result>;
3150
4701
  /**
3151
4702
  * Builds a new query with a new sort option.
3152
4703
  * @param column The column name.
3153
4704
  * @param direction The direction. Either ascending or descending.
3154
4705
  * @returns A new Query object.
3155
4706
  */
3156
- sort<F extends SelectableColumn<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
4707
+ sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
3157
4708
  /**
3158
4709
  * Builds a new query specifying the set of columns to be returned in the query response.
3159
4710
  * @param columns Array of column names to be returned by the query.
3160
4711
  * @returns A new Query object.
3161
4712
  */
3162
- select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
4713
+ select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
3163
4714
  /**
3164
4715
  * Get paginated results
3165
4716
  *
@@ -3269,6 +4820,26 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3269
4820
  * @returns The first record that matches the query, or null if no record matched the query.
3270
4821
  */
3271
4822
  getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
4823
+ /**
4824
+ * Performs the query in the database and returns the first result.
4825
+ * @returns The first record that matches the query, or null if no record matched the query.
4826
+ * @throws if there are no results.
4827
+ */
4828
+ getFirstOrThrow(): Promise<Result>;
4829
+ /**
4830
+ * Performs the query in the database and returns the first result.
4831
+ * @param options Additional options to be used when performing the query.
4832
+ * @returns The first record that matches the query, or null if no record matched the query.
4833
+ * @throws if there are no results.
4834
+ */
4835
+ getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
4836
+ /**
4837
+ * Performs the query in the database and returns the first result.
4838
+ * @param options Additional options to be used when performing the query.
4839
+ * @returns The first record that matches the query, or null if no record matched the query.
4840
+ * @throws if there are no results.
4841
+ */
4842
+ getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
3272
4843
  /**
3273
4844
  * Builds a new query object adding a cache TTL in milliseconds.
3274
4845
  * @param ttl The cache TTL in milliseconds.
@@ -3390,6 +4961,8 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
3390
4961
  #private;
3391
4962
  constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
3392
4963
  static parseConstructorParams(...args: any[]): any[];
4964
+ toArray(): Result[];
4965
+ map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
3393
4966
  /**
3394
4967
  * Retrieve next page of records
3395
4968
  *
@@ -3423,21 +4996,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
3423
4996
  /**
3424
4997
  * Common interface for performing operations on a table.
3425
4998
  */
3426
- declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
3427
- abstract create(object: EditableData<Data> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
4999
+ declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
5000
+ abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5001
+ abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5002
+ /**
5003
+ * Creates a single record in the table with a unique id.
5004
+ * @param id The unique id.
5005
+ * @param object Object containing the column names with their values to be stored in the table.
5006
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5007
+ * @returns The full persisted record.
5008
+ */
5009
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3428
5010
  /**
3429
5011
  * Creates a single record in the table with a unique id.
3430
5012
  * @param id The unique id.
3431
5013
  * @param object Object containing the column names with their values to be stored in the table.
3432
5014
  * @returns The full persisted record.
3433
5015
  */
3434
- abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5016
+ abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3435
5017
  /**
3436
5018
  * Creates multiple records in the table.
3437
5019
  * @param objects Array of objects with the column names and the values to be stored in the table.
3438
- * @returns Array of the persisted records.
5020
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5021
+ * @returns Array of the persisted records in order.
5022
+ */
5023
+ abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5024
+ /**
5025
+ * Creates multiple records in the table.
5026
+ * @param objects Array of objects with the column names and the values to be stored in the table.
5027
+ * @returns Array of the persisted records in order.
5028
+ */
5029
+ abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5030
+ /**
5031
+ * Queries a single record from the table given its unique id.
5032
+ * @param id The unique id.
5033
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5034
+ * @returns The persisted record for the given id or null if the record could not be found.
3439
5035
  */
3440
- abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5036
+ abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3441
5037
  /**
3442
5038
  * Queries a single record from the table given its unique id.
3443
5039
  * @param id The unique id.
@@ -3447,9 +5043,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3447
5043
  /**
3448
5044
  * Queries multiple records from the table given their unique id.
3449
5045
  * @param ids The unique ids array.
3450
- * @returns The persisted records for the given ids (if a record could not be found it is not returned).
5046
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5047
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5048
+ */
5049
+ abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5050
+ /**
5051
+ * Queries multiple records from the table given their unique id.
5052
+ * @param ids The unique ids array.
5053
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
3451
5054
  */
3452
- abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5055
+ abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5056
+ /**
5057
+ * Queries a single record from the table by the id in the object.
5058
+ * @param object Object containing the id of the record.
5059
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5060
+ * @returns The persisted record for the given id or null if the record could not be found.
5061
+ */
5062
+ abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3453
5063
  /**
3454
5064
  * Queries a single record from the table by the id in the object.
3455
5065
  * @param object Object containing the id of the record.
@@ -3459,35 +5069,188 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3459
5069
  /**
3460
5070
  * Queries multiple records from the table by the ids in the objects.
3461
5071
  * @param objects Array of objects containing the ids of the records.
3462
- * @returns The persisted records for the given ids (if a record could not be found it is not returned).
5072
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5073
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5074
+ */
5075
+ abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5076
+ /**
5077
+ * Queries multiple records from the table by the ids in the objects.
5078
+ * @param objects Array of objects containing the ids of the records.
5079
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5080
+ */
5081
+ abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5082
+ /**
5083
+ * Queries a single record from the table given its unique id.
5084
+ * @param id The unique id.
5085
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5086
+ * @returns The persisted record for the given id.
5087
+ * @throws If the record could not be found.
5088
+ */
5089
+ abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5090
+ /**
5091
+ * Queries a single record from the table given its unique id.
5092
+ * @param id The unique id.
5093
+ * @returns The persisted record for the given id.
5094
+ * @throws If the record could not be found.
5095
+ */
5096
+ abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5097
+ /**
5098
+ * Queries multiple records from the table given their unique id.
5099
+ * @param ids The unique ids array.
5100
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5101
+ * @returns The persisted records for the given ids in order.
5102
+ * @throws If one or more records could not be found.
5103
+ */
5104
+ abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5105
+ /**
5106
+ * Queries multiple records from the table given their unique id.
5107
+ * @param ids The unique ids array.
5108
+ * @returns The persisted records for the given ids in order.
5109
+ * @throws If one or more records could not be found.
5110
+ */
5111
+ abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5112
+ /**
5113
+ * Queries a single record from the table by the id in the object.
5114
+ * @param object Object containing the id of the record.
5115
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5116
+ * @returns The persisted record for the given id.
5117
+ * @throws If the record could not be found.
5118
+ */
5119
+ abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5120
+ /**
5121
+ * Queries a single record from the table by the id in the object.
5122
+ * @param object Object containing the id of the record.
5123
+ * @returns The persisted record for the given id.
5124
+ * @throws If the record could not be found.
5125
+ */
5126
+ abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5127
+ /**
5128
+ * Queries multiple records from the table by the ids in the objects.
5129
+ * @param objects Array of objects containing the ids of the records.
5130
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5131
+ * @returns The persisted records for the given ids in order.
5132
+ * @throws If one or more records could not be found.
5133
+ */
5134
+ abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5135
+ /**
5136
+ * Queries multiple records from the table by the ids in the objects.
5137
+ * @param objects Array of objects containing the ids of the records.
5138
+ * @returns The persisted records for the given ids in order.
5139
+ * @throws If one or more records could not be found.
5140
+ */
5141
+ abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5142
+ /**
5143
+ * Partially update a single record.
5144
+ * @param object An object with its id and the columns to be updated.
5145
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5146
+ * @returns The full persisted record, null if the record could not be found.
5147
+ */
5148
+ abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5149
+ /**
5150
+ * Partially update a single record.
5151
+ * @param object An object with its id and the columns to be updated.
5152
+ * @returns The full persisted record, null if the record could not be found.
5153
+ */
5154
+ abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5155
+ /**
5156
+ * Partially update a single record given its unique id.
5157
+ * @param id The unique id.
5158
+ * @param object The column names and their values that have to be updated.
5159
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5160
+ * @returns The full persisted record, null if the record could not be found.
5161
+ */
5162
+ abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5163
+ /**
5164
+ * Partially update a single record given its unique id.
5165
+ * @param id The unique id.
5166
+ * @param object The column names and their values that have to be updated.
5167
+ * @returns The full persisted record, null if the record could not be found.
5168
+ */
5169
+ abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5170
+ /**
5171
+ * Partially updates multiple records.
5172
+ * @param objects An array of objects with their ids and columns to be updated.
5173
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5174
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
5175
+ */
5176
+ abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5177
+ /**
5178
+ * Partially updates multiple records.
5179
+ * @param objects An array of objects with their ids and columns to be updated.
5180
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
5181
+ */
5182
+ abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5183
+ /**
5184
+ * Partially update a single record.
5185
+ * @param object An object with its id and the columns to be updated.
5186
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5187
+ * @returns The full persisted record.
5188
+ * @throws If the record could not be found.
3463
5189
  */
3464
- abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5190
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3465
5191
  /**
3466
5192
  * Partially update a single record.
3467
5193
  * @param object An object with its id and the columns to be updated.
3468
5194
  * @returns The full persisted record.
5195
+ * @throws If the record could not be found.
3469
5196
  */
3470
- abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5197
+ abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3471
5198
  /**
3472
5199
  * Partially update a single record given its unique id.
3473
5200
  * @param id The unique id.
3474
5201
  * @param object The column names and their values that have to be updated.
5202
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3475
5203
  * @returns The full persisted record.
5204
+ * @throws If the record could not be found.
3476
5205
  */
3477
- abstract update(id: string, object: Partial<EditableData<Data>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5206
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5207
+ /**
5208
+ * Partially update a single record given its unique id.
5209
+ * @param id The unique id.
5210
+ * @param object The column names and their values that have to be updated.
5211
+ * @returns The full persisted record.
5212
+ * @throws If the record could not be found.
5213
+ */
5214
+ abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3478
5215
  /**
3479
5216
  * Partially updates multiple records.
3480
5217
  * @param objects An array of objects with their ids and columns to be updated.
3481
- * @returns Array of the persisted records.
5218
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5219
+ * @returns Array of the persisted records in order.
5220
+ * @throws If one or more records could not be found.
5221
+ */
5222
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5223
+ /**
5224
+ * Partially updates multiple records.
5225
+ * @param objects An array of objects with their ids and columns to be updated.
5226
+ * @returns Array of the persisted records in order.
5227
+ * @throws If one or more records could not be found.
5228
+ */
5229
+ abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5230
+ /**
5231
+ * Creates or updates a single record. If a record exists with the given id,
5232
+ * it will be update, otherwise a new record will be created.
5233
+ * @param object Object containing the column names with their values to be persisted in the table.
5234
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5235
+ * @returns The full persisted record.
3482
5236
  */
3483
- abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5237
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3484
5238
  /**
3485
5239
  * Creates or updates a single record. If a record exists with the given id,
3486
5240
  * it will be update, otherwise a new record will be created.
3487
5241
  * @param object Object containing the column names with their values to be persisted in the table.
3488
5242
  * @returns The full persisted record.
3489
5243
  */
3490
- abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5244
+ abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5245
+ /**
5246
+ * Creates or updates a single record. If a record exists with the given id,
5247
+ * it will be update, otherwise a new record will be created.
5248
+ * @param id A unique id.
5249
+ * @param object The column names and the values to be persisted.
5250
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5251
+ * @returns The full persisted record.
5252
+ */
5253
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3491
5254
  /**
3492
5255
  * Creates or updates a single record. If a record exists with the given id,
3493
5256
  * it will be update, otherwise a new record will be created.
@@ -3495,38 +5258,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3495
5258
  * @param object The column names and the values to be persisted.
3496
5259
  * @returns The full persisted record.
3497
5260
  */
3498
- abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5261
+ abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3499
5262
  /**
3500
5263
  * Creates or updates a single record. If a record exists with the given id,
3501
5264
  * it will be update, otherwise a new record will be created.
3502
5265
  * @param objects Array of objects with the column names and the values to be stored in the table.
5266
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3503
5267
  * @returns Array of the persisted records.
3504
5268
  */
3505
- abstract createOrUpdate(objects: Array<EditableData<Data> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5269
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5270
+ /**
5271
+ * Creates or updates a single record. If a record exists with the given id,
5272
+ * it will be update, otherwise a new record will be created.
5273
+ * @param objects Array of objects with the column names and the values to be stored in the table.
5274
+ * @returns Array of the persisted records.
5275
+ */
5276
+ abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5277
+ /**
5278
+ * Deletes a record given its unique id.
5279
+ * @param object An object with a unique id.
5280
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5281
+ * @returns The deleted record, null if the record could not be found.
5282
+ */
5283
+ abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3506
5284
  /**
3507
5285
  * Deletes a record given its unique id.
5286
+ * @param object An object with a unique id.
5287
+ * @returns The deleted record, null if the record could not be found.
5288
+ */
5289
+ abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5290
+ /**
5291
+ * Deletes a record given a unique id.
5292
+ * @param id The unique id.
5293
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5294
+ * @returns The deleted record, null if the record could not be found.
5295
+ */
5296
+ abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5297
+ /**
5298
+ * Deletes a record given a unique id.
3508
5299
  * @param id The unique id.
3509
- * @throws If the record could not be found or there was an error while performing the deletion.
5300
+ * @returns The deleted record, null if the record could not be found.
5301
+ */
5302
+ abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5303
+ /**
5304
+ * Deletes multiple records given an array of objects with ids.
5305
+ * @param objects An array of objects with unique ids.
5306
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5307
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
3510
5308
  */
3511
- abstract delete(id: string): Promise<void>;
5309
+ abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5310
+ /**
5311
+ * Deletes multiple records given an array of objects with ids.
5312
+ * @param objects An array of objects with unique ids.
5313
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5314
+ */
5315
+ abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5316
+ /**
5317
+ * Deletes multiple records given an array of unique ids.
5318
+ * @param objects An array of ids.
5319
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5320
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5321
+ */
5322
+ abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5323
+ /**
5324
+ * Deletes multiple records given an array of unique ids.
5325
+ * @param objects An array of ids.
5326
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5327
+ */
5328
+ abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5329
+ /**
5330
+ * Deletes a record given its unique id.
5331
+ * @param object An object with a unique id.
5332
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5333
+ * @returns The deleted record, null if the record could not be found.
5334
+ * @throws If the record could not be found.
5335
+ */
5336
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3512
5337
  /**
3513
5338
  * Deletes a record given its unique id.
3514
- * @param id An object with a unique id.
3515
- * @throws If the record could not be found or there was an error while performing the deletion.
5339
+ * @param object An object with a unique id.
5340
+ * @returns The deleted record, null if the record could not be found.
5341
+ * @throws If the record could not be found.
5342
+ */
5343
+ abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5344
+ /**
5345
+ * Deletes a record given a unique id.
5346
+ * @param id The unique id.
5347
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5348
+ * @returns The deleted record, null if the record could not be found.
5349
+ * @throws If the record could not be found.
5350
+ */
5351
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5352
+ /**
5353
+ * Deletes a record given a unique id.
5354
+ * @param id The unique id.
5355
+ * @returns The deleted record, null if the record could not be found.
5356
+ * @throws If the record could not be found.
5357
+ */
5358
+ abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5359
+ /**
5360
+ * Deletes multiple records given an array of objects with ids.
5361
+ * @param objects An array of objects with unique ids.
5362
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5363
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5364
+ * @throws If one or more records could not be found.
5365
+ */
5366
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5367
+ /**
5368
+ * Deletes multiple records given an array of objects with ids.
5369
+ * @param objects An array of objects with unique ids.
5370
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5371
+ * @throws If one or more records could not be found.
3516
5372
  */
3517
- abstract delete(id: Identifiable): Promise<void>;
5373
+ abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3518
5374
  /**
3519
- * Deletes a record given a list of unique ids.
3520
- * @param ids The array of unique ids.
3521
- * @throws If the record could not be found or there was an error while performing the deletion.
5375
+ * Deletes multiple records given an array of unique ids.
5376
+ * @param objects An array of ids.
5377
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5378
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5379
+ * @throws If one or more records could not be found.
3522
5380
  */
3523
- abstract delete(ids: string[]): Promise<void>;
5381
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3524
5382
  /**
3525
- * Deletes a record given a list of unique ids.
3526
- * @param ids An array of objects with unique ids.
3527
- * @throws If the record could not be found or there was an error while performing the deletion.
5383
+ * Deletes multiple records given an array of unique ids.
5384
+ * @param objects An array of ids.
5385
+ * @returns Array of the deleted records in order.
5386
+ * @throws If one or more records could not be found.
3528
5387
  */
3529
- abstract delete(ids: Identifiable[]): Promise<void>;
5388
+ abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3530
5389
  /**
3531
5390
  * Search for records in the table.
3532
5391
  * @param query The query to search for.
@@ -3535,39 +5394,84 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3535
5394
  */
3536
5395
  abstract search(query: string, options?: {
3537
5396
  fuzziness?: FuzzinessExpression;
5397
+ prefix?: PrefixExpression;
3538
5398
  highlight?: HighlightExpression;
3539
5399
  filter?: Filter<Record>;
3540
- }): Promise<SelectedPick<Record, ['*']>[]>;
5400
+ boosters?: Boosters<Record>[];
5401
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3541
5402
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3542
5403
  }
3543
- declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
5404
+ declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
3544
5405
  #private;
3545
- db: SchemaPluginResult<any>;
3546
5406
  constructor(options: {
3547
5407
  table: string;
3548
5408
  db: SchemaPluginResult<any>;
3549
5409
  pluginOptions: XataPluginOptions;
3550
5410
  schemaTables?: Table[];
3551
5411
  });
3552
- create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3553
- create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3554
- create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3555
- read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
3556
- read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3557
- read(object: Identifiable): Promise<SelectedPick<Record, ['*']> | null>;
3558
- read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3559
- update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3560
- update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3561
- update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3562
- createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3563
- createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3564
- createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3565
- delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
5412
+ create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5413
+ create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5414
+ create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5415
+ create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5416
+ create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5417
+ create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5418
+ read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
5419
+ read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
5420
+ read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5421
+ read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5422
+ read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
5423
+ read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
5424
+ read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5425
+ read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5426
+ readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5427
+ readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5428
+ readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5429
+ readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5430
+ readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5431
+ readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5432
+ readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5433
+ readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5434
+ update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5435
+ update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5436
+ update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5437
+ update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5438
+ update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5439
+ update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5440
+ updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5441
+ updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5442
+ updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5443
+ updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5444
+ updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5445
+ updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5446
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5447
+ createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5448
+ createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5449
+ createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5450
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5451
+ createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5452
+ delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5453
+ delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5454
+ delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5455
+ delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5456
+ delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5457
+ delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5458
+ delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5459
+ delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5460
+ deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5461
+ deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5462
+ deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5463
+ deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5464
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5465
+ deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5466
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5467
+ deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3566
5468
  search(query: string, options?: {
3567
5469
  fuzziness?: FuzzinessExpression;
5470
+ prefix?: PrefixExpression;
3568
5471
  highlight?: HighlightExpression;
3569
5472
  filter?: Filter<Record>;
3570
- }): Promise<SelectedPick<Record, ['*']>[]>;
5473
+ boosters?: Boosters<Record>[];
5474
+ }): Promise<any>;
3571
5475
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3572
5476
  }
3573
5477
 
@@ -3576,6 +5480,7 @@ declare type BaseSchema = {
3576
5480
  columns: readonly ({
3577
5481
  name: string;
3578
5482
  type: Column['type'];
5483
+ notNull?: boolean;
3579
5484
  } | {
3580
5485
  name: string;
3581
5486
  type: 'link';
@@ -3605,10 +5510,10 @@ declare type TableType<Tables, TableName> = Tables & {
3605
5510
  } ? Columns extends readonly unknown[] ? Columns[number] extends {
3606
5511
  name: string;
3607
5512
  type: string;
3608
- } ? {
3609
- [K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
3610
- } & XataRecord : never : never : never : never;
3611
- declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
5513
+ } ? Identifiable & UnionToIntersection<Values<{
5514
+ [K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
5515
+ }>> : never : never : never : never;
5516
+ declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
3612
5517
  name: PropertyName;
3613
5518
  } extends infer Property ? Property extends {
3614
5519
  name: string;
@@ -3617,13 +5522,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
3617
5522
  table: infer LinkedTable;
3618
5523
  };
3619
5524
  columns?: infer ObjectColumns;
3620
- } ? (Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
5525
+ notNull?: infer NotNull;
5526
+ } ? NotNull extends true ? {
5527
+ [K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
5528
+ } : {
5529
+ [K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
5530
+ } : never : never;
5531
+ 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 {
3621
5532
  name: string;
3622
5533
  type: string;
3623
- } ? {
5534
+ } ? UnionToIntersection<Values<{
3624
5535
  [K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
3625
- } : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
5536
+ }>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
3626
5537
 
5538
+ /**
5539
+ * Operator to restrict results to only values that are greater than the given value.
5540
+ */
5541
+ declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3627
5542
  /**
3628
5543
  * Operator to restrict results to only values that are greater than the given value.
3629
5544
  */
@@ -3631,15 +5546,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
3631
5546
  /**
3632
5547
  * Operator to restrict results to only values that are greater than or equal to the given value.
3633
5548
  */
3634
- declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
5549
+ declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
5550
+ /**
5551
+ * Operator to restrict results to only values that are greater than or equal to the given value.
5552
+ */
5553
+ declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3635
5554
  /**
3636
5555
  * Operator to restrict results to only values that are greater than or equal to the given value.
3637
5556
  */
3638
5557
  declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
5558
+ /**
5559
+ * Operator to restrict results to only values that are greater than or equal to the given value.
5560
+ */
5561
+ declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
5562
+ /**
5563
+ * Operator to restrict results to only values that are lower than the given value.
5564
+ */
5565
+ declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3639
5566
  /**
3640
5567
  * Operator to restrict results to only values that are lower than the given value.
3641
5568
  */
3642
5569
  declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
5570
+ /**
5571
+ * Operator to restrict results to only values that are lower than or equal to the given value.
5572
+ */
5573
+ declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
5574
+ /**
5575
+ * Operator to restrict results to only values that are lower than or equal to the given value.
5576
+ */
5577
+ declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3643
5578
  /**
3644
5579
  * Operator to restrict results to only values that are lower than or equal to the given value.
3645
5580
  */
@@ -3672,6 +5607,10 @@ declare const pattern: (value: string) => StringTypeFilter;
3672
5607
  * Operator to restrict results to only values that are equal to the given value.
3673
5608
  */
3674
5609
  declare const is: <T>(value: T) => PropertyFilter<T>;
5610
+ /**
5611
+ * Operator to restrict results to only values that are equal to the given value.
5612
+ */
5613
+ declare const equals: <T>(value: T) => PropertyFilter<T>;
3675
5614
  /**
3676
5615
  * Operator to restrict results to only values that are not equal to the given value.
3677
5616
  */
@@ -3700,58 +5639,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3700
5639
  declare type SchemaDefinition = {
3701
5640
  table: string;
3702
5641
  };
3703
- declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
5642
+ declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
3704
5643
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
3705
- } & {
3706
- [key: string]: Repository<XataRecord$1>;
3707
5644
  };
3708
- declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
5645
+ declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3709
5646
  #private;
3710
5647
  constructor(schemaTables?: Schemas.Table[]);
3711
5648
  build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3712
5649
  }
3713
5650
 
3714
- declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3715
- fuzziness?: FuzzinessExpression;
3716
- highlight?: HighlightExpression;
3717
- tables?: Array<Tables | Values<{
3718
- [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
3719
- table: Model;
3720
- filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3721
- };
3722
- }>>;
3723
- };
3724
- declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3725
- all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
3726
- [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
3727
- table: Model;
3728
- record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
3729
- };
3730
- }>[]>;
3731
- byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
3732
- [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
3733
- }>;
3734
- };
3735
- declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
3736
- #private;
3737
- private db;
3738
- constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
3739
- build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
3740
- }
3741
- declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
3742
- declare type SearchExtraProperties = {
3743
- table: string;
3744
- highlight?: {
3745
- [key: string]: string[] | {
3746
- [key: string]: any;
3747
- };
3748
- };
3749
- };
3750
- declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
3751
- declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
3752
- table: infer Table;
3753
- } ? ReturnTable<Table, Tables> : never;
3754
-
3755
5651
  declare type BranchStrategyValue = string | undefined | null;
3756
5652
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3757
5653
  declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
@@ -3763,19 +5659,34 @@ declare type BaseClientOptions = {
3763
5659
  databaseURL?: string;
3764
5660
  branch?: BranchStrategyOption;
3765
5661
  cache?: CacheImpl;
5662
+ trace?: TraceFunction;
3766
5663
  };
3767
5664
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3768
5665
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
3769
- new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
3770
- db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
3771
- search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
5666
+ new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
5667
+ db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
5668
+ search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
3772
5669
  }, keyof Plugins> & {
3773
5670
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
5671
+ } & {
5672
+ getConfig(): Promise<{
5673
+ databaseURL: string;
5674
+ branch: string;
5675
+ }>;
3774
5676
  };
3775
5677
  }
3776
5678
  declare const BaseClient_base: ClientConstructor<{}>;
3777
- declare class BaseClient extends BaseClient_base<[]> {
5679
+ declare class BaseClient extends BaseClient_base<Record<string, any>> {
5680
+ }
5681
+
5682
+ declare class Serializer {
5683
+ classes: Record<string, any>;
5684
+ add(clazz: any): void;
5685
+ toJSON<T>(data: T): string;
5686
+ fromJSON<T>(json: string): T;
3778
5687
  }
5688
+ declare const serialize: <T>(data: T) => string;
5689
+ declare const deserialize: <T>(json: string) => T;
3779
5690
 
3780
5691
  declare type BranchResolutionOptions = {
3781
5692
  databaseURL?: string;
@@ -3788,9 +5699,89 @@ declare function getDatabaseURL(): string | undefined;
3788
5699
 
3789
5700
  declare function getAPIKey(): string | undefined;
3790
5701
 
5702
+ interface Body {
5703
+ arrayBuffer(): Promise<ArrayBuffer>;
5704
+ blob(): Promise<Blob>;
5705
+ formData(): Promise<FormData>;
5706
+ json(): Promise<any>;
5707
+ text(): Promise<string>;
5708
+ }
5709
+ interface Blob {
5710
+ readonly size: number;
5711
+ readonly type: string;
5712
+ arrayBuffer(): Promise<ArrayBuffer>;
5713
+ slice(start?: number, end?: number, contentType?: string): Blob;
5714
+ text(): Promise<string>;
5715
+ }
5716
+ /** Provides information about files and allows JavaScript in a web page to access their content. */
5717
+ interface File extends Blob {
5718
+ readonly lastModified: number;
5719
+ readonly name: string;
5720
+ readonly webkitRelativePath: string;
5721
+ }
5722
+ declare type FormDataEntryValue = File | string;
5723
+ /** 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". */
5724
+ interface FormData {
5725
+ append(name: string, value: string | Blob, fileName?: string): void;
5726
+ delete(name: string): void;
5727
+ get(name: string): FormDataEntryValue | null;
5728
+ getAll(name: string): FormDataEntryValue[];
5729
+ has(name: string): boolean;
5730
+ set(name: string, value: string | Blob, fileName?: string): void;
5731
+ forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
5732
+ }
5733
+ /** 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. */
5734
+ interface Headers {
5735
+ append(name: string, value: string): void;
5736
+ delete(name: string): void;
5737
+ get(name: string): string | null;
5738
+ has(name: string): boolean;
5739
+ set(name: string, value: string): void;
5740
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
5741
+ }
5742
+ interface Request extends Body {
5743
+ /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
5744
+ readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
5745
+ /** 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. */
5746
+ readonly credentials: 'include' | 'omit' | 'same-origin';
5747
+ /** Returns the kind of resource requested by request, e.g., "document" or "script". */
5748
+ readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
5749
+ /** 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. */
5750
+ readonly headers: Headers;
5751
+ /** 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] */
5752
+ readonly integrity: string;
5753
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
5754
+ readonly keepalive: boolean;
5755
+ /** Returns request's HTTP method, which is "GET" by default. */
5756
+ readonly method: string;
5757
+ /** 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. */
5758
+ readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
5759
+ /** 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. */
5760
+ readonly redirect: 'error' | 'follow' | 'manual';
5761
+ /** 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. */
5762
+ readonly referrer: string;
5763
+ /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
5764
+ readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
5765
+ /** Returns the URL of request as a string. */
5766
+ readonly url: string;
5767
+ clone(): Request;
5768
+ }
5769
+
5770
+ declare type XataWorkerContext<XataClient> = {
5771
+ xata: XataClient;
5772
+ request: Request;
5773
+ env: Record<string, string | undefined>;
5774
+ };
5775
+ declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
5776
+ declare type WorkerRunnerConfig = {
5777
+ workspace: string;
5778
+ worker: string;
5779
+ };
5780
+ 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>>>;
5781
+
3791
5782
  declare class XataError extends Error {
3792
5783
  readonly status: number;
3793
5784
  constructor(message: string, status: number);
3794
5785
  }
3795
5786
 
3796
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
5787
+ 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 };