@xata.io/client 0.0.0-alpha.vf481c73 → 0.0.0-alpha.vf54f8ba

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,21 +1,30 @@
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>;
4
9
  method?: string;
10
+ signal?: any;
5
11
  }) => Promise<{
6
12
  ok: boolean;
7
13
  status: number;
14
+ url: string;
8
15
  json(): Promise<any>;
9
16
  headers?: {
10
17
  get(name: string): string | null;
11
18
  };
12
19
  }>;
13
- declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
20
+ declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
14
21
  declare type FetcherExtraProps = {
15
22
  apiUrl: string;
16
23
  workspacesApiUrl: string | WorkspaceApiUrlBuilder;
17
24
  fetchImpl: FetchImpl;
18
25
  apiKey: string;
26
+ trace: TraceFunction;
27
+ signal?: AbortSignal;
19
28
  };
20
29
  declare type ErrorWrapper<TError> = TError | {
21
30
  status: 'unknown';
@@ -23,7 +32,6 @@ declare type ErrorWrapper<TError> = TError | {
23
32
  };
24
33
 
25
34
  interface CacheImpl {
26
- cacheRecords: boolean;
27
35
  defaultQueryTTL: number;
28
36
  getAll(): Promise<Record<string, unknown>>;
29
37
  get: <T>(key: string) => Promise<T | null>;
@@ -33,13 +41,11 @@ interface CacheImpl {
33
41
  }
34
42
  interface SimpleCacheOptions {
35
43
  max?: number;
36
- cacheRecords?: boolean;
37
44
  defaultQueryTTL?: number;
38
45
  }
39
46
  declare class SimpleCache implements CacheImpl {
40
47
  #private;
41
48
  capacity: number;
42
- cacheRecords: boolean;
43
49
  defaultQueryTTL: number;
44
50
  constructor(options?: SimpleCacheOptions);
45
51
  getAll(): Promise<Record<string, unknown>>;
@@ -55,6 +61,7 @@ declare abstract class XataPlugin {
55
61
  declare type XataPluginOptions = {
56
62
  getFetchProps: () => Promise<FetcherExtraProps>;
57
63
  cache: CacheImpl;
64
+ trace?: TraceFunction;
58
65
  };
59
66
 
60
67
  /**
@@ -63,6 +70,9 @@ declare type XataPluginOptions = {
63
70
  * @version 1.0
64
71
  */
65
72
  declare type User = {
73
+ /**
74
+ * @format email
75
+ */
66
76
  email: string;
67
77
  fullname: string;
68
78
  image: string;
@@ -94,16 +104,19 @@ declare type WorkspaceID = string;
94
104
  declare type Role = 'owner' | 'maintainer';
95
105
  declare type WorkspaceMeta = {
96
106
  name: string;
97
- slug: string;
107
+ slug?: string;
98
108
  };
99
109
  declare type Workspace = WorkspaceMeta & {
100
110
  id: WorkspaceID;
101
111
  memberCount: number;
102
- plan: 'free';
112
+ plan: 'free' | 'pro';
103
113
  };
104
114
  declare type WorkspaceMember = {
105
115
  userId: UserID;
106
116
  fullname: string;
117
+ /**
118
+ * @format email
119
+ */
107
120
  email: string;
108
121
  role: Role;
109
122
  };
@@ -113,7 +126,13 @@ declare type WorkspaceMember = {
113
126
  declare type InviteID = string;
114
127
  declare type WorkspaceInvite = {
115
128
  inviteId: InviteID;
129
+ /**
130
+ * @format email
131
+ */
116
132
  email: string;
133
+ /**
134
+ * @format date-time
135
+ */
117
136
  expires: string;
118
137
  role: Role;
119
138
  };
@@ -125,20 +144,40 @@ declare type WorkspaceMembers = {
125
144
  * @pattern ^ik_[a-zA-Z0-9]+
126
145
  */
127
146
  declare type InviteKey = string;
147
+ /**
148
+ * Metadata of databases
149
+ */
150
+ declare type DatabaseMetadata = {
151
+ /**
152
+ * The machine-readable name of a database
153
+ */
154
+ name: string;
155
+ /**
156
+ * The time this database was created
157
+ */
158
+ createdAt: DateTime;
159
+ /**
160
+ * The number of branches the database has
161
+ */
162
+ numberOfBranches: number;
163
+ /**
164
+ * Metadata about the database for display in Xata user interfaces
165
+ */
166
+ ui?: {
167
+ /**
168
+ * The user-selected color for this database across interfaces
169
+ */
170
+ color?: string;
171
+ };
172
+ };
128
173
  declare type ListDatabasesResponse = {
129
- databases?: {
130
- name: string;
131
- displayName: string;
132
- createdAt: DateTime;
133
- numberOfBranches: number;
134
- ui?: {
135
- color?: string;
136
- };
137
- }[];
174
+ /**
175
+ * A list of databases in a Xata workspace
176
+ */
177
+ databases?: DatabaseMetadata[];
138
178
  };
139
179
  declare type ListBranchesResponse = {
140
180
  databaseName: string;
141
- displayName: string;
142
181
  branches: Branch[];
143
182
  };
144
183
  declare type ListGitBranchesResponse = {
@@ -156,8 +195,14 @@ declare type Branch = {
156
195
  * @x-go-type xata.BranchMetadata
157
196
  */
158
197
  declare type BranchMetadata = {
198
+ /**
199
+ * @minLength 1
200
+ */
159
201
  repository?: string;
160
202
  branch?: BranchName;
203
+ /**
204
+ * @minLength 1
205
+ */
161
206
  stage?: string;
162
207
  labels?: string[];
163
208
  };
@@ -184,12 +229,28 @@ declare type Schema = {
184
229
  tables: Table[];
185
230
  tablesOrder?: string[];
186
231
  };
232
+ /**
233
+ * @x-internal true
234
+ */
235
+ declare type SchemaEditScript = {
236
+ sourceMigrationID?: string;
237
+ targetMigrationID?: string;
238
+ tables: TableEdit[];
239
+ };
187
240
  declare type Table = {
188
241
  id?: string;
189
242
  name: TableName;
190
243
  columns: Column[];
191
244
  revLinks?: RevLink[];
192
245
  };
246
+ /**
247
+ * @x-internal true
248
+ */
249
+ declare type TableEdit = {
250
+ oldName?: string;
251
+ newName?: string;
252
+ columns?: MigrationColumnOp[];
253
+ };
193
254
  /**
194
255
  * @x-go-type xata.Column
195
256
  */
@@ -199,6 +260,8 @@ declare type Column = {
199
260
  link?: {
200
261
  table: string;
201
262
  };
263
+ notNull?: boolean;
264
+ unique?: boolean;
202
265
  columns?: Column[];
203
266
  };
204
267
  declare type RevLink = {
@@ -265,6 +328,137 @@ declare type ColumnMigration = {
265
328
  old: Column;
266
329
  ['new']: Column;
267
330
  };
331
+ /**
332
+ * @x-internal true
333
+ */
334
+ declare type Commit = {
335
+ meta?: {
336
+ title?: string;
337
+ message?: string;
338
+ id: string;
339
+ parentID?: string;
340
+ mergeParentID?: string;
341
+ status: string;
342
+ createdAt: DateTime;
343
+ modifiedAt?: DateTime;
344
+ };
345
+ operations: MigrationOp[];
346
+ };
347
+ /**
348
+ * Branch schema migration.
349
+ *
350
+ * @x-internal true
351
+ */
352
+ declare type Migration = {
353
+ parentID?: string;
354
+ operations: MigrationOp[];
355
+ };
356
+ /**
357
+ * Branch schema migration operations.
358
+ *
359
+ * @x-internal true
360
+ */
361
+ declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
362
+ /**
363
+ * @x-internal true
364
+ */
365
+ declare type MigrationTableOp = {
366
+ addTable: TableOpAdd;
367
+ } | {
368
+ removeTable: TableOpRemove;
369
+ } | {
370
+ renameTable: TableOpRename;
371
+ };
372
+ /**
373
+ * @x-internal true
374
+ */
375
+ declare type MigrationColumnOp = {
376
+ addColumn: ColumnOpAdd;
377
+ } | {
378
+ removeColumn: ColumnOpRemove;
379
+ } | {
380
+ renameColumn: ColumnOpRename;
381
+ };
382
+ /**
383
+ * @x-internal true
384
+ */
385
+ declare type TableOpAdd = {
386
+ table: string;
387
+ };
388
+ /**
389
+ * @x-internal true
390
+ */
391
+ declare type TableOpRemove = {
392
+ table: string;
393
+ };
394
+ /**
395
+ * @x-internal true
396
+ */
397
+ declare type TableOpRename = {
398
+ oldName: string;
399
+ newName: string;
400
+ };
401
+ /**
402
+ * @x-internal true
403
+ */
404
+ declare type ColumnOpAdd = {
405
+ table?: string;
406
+ column: Column;
407
+ };
408
+ /**
409
+ * @x-internal true
410
+ */
411
+ declare type ColumnOpRemove = {
412
+ table?: string;
413
+ column: string;
414
+ };
415
+ /**
416
+ * @x-internal true
417
+ */
418
+ declare type ColumnOpRename = {
419
+ table?: string;
420
+ oldName: string;
421
+ newName: string;
422
+ };
423
+ declare type MigrationRequest = {
424
+ /**
425
+ * The migration request number.
426
+ */
427
+ number: number;
428
+ /**
429
+ * Migration request creation timestamp.
430
+ */
431
+ createdAt: DateTime;
432
+ /**
433
+ * Last modified timestamp.
434
+ */
435
+ modifiedAt?: DateTime;
436
+ /**
437
+ * Timestamp when the migration request was closed.
438
+ */
439
+ closedAt?: DateTime;
440
+ /**
441
+ * Timestamp when the migration request was merged.
442
+ */
443
+ mergedAt?: DateTime;
444
+ status: 'open' | 'closed' | 'merging' | 'merged';
445
+ /**
446
+ * The migration request title.
447
+ */
448
+ title: string;
449
+ /**
450
+ * The migration request body with detailed description.
451
+ */
452
+ body: string;
453
+ /**
454
+ * Name of the source branch.
455
+ */
456
+ source: string;
457
+ /**
458
+ * Name of the target branch.
459
+ */
460
+ target: string;
461
+ };
268
462
  declare type SortExpression = string[] | {
269
463
  [key: string]: SortOrder;
270
464
  } | {
@@ -273,7 +467,7 @@ declare type SortExpression = string[] | {
273
467
  declare type SortOrder = 'asc' | 'desc';
274
468
  /**
275
469
  * 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
470
+ * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
277
471
  * 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
472
  * to allow two typos in a word.
279
473
  *
@@ -286,6 +480,23 @@ declare type FuzzinessExpression = number;
286
480
  * If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
287
481
  */
288
482
  declare type PrefixExpression = 'phrase' | 'disabled';
483
+ /**
484
+ * The target expression is used to filter the search results by the target columns.
485
+ */
486
+ declare type TargetExpression = (string | {
487
+ /**
488
+ * The name of the column.
489
+ */
490
+ column: string;
491
+ /**
492
+ * The weight of the column.
493
+ *
494
+ * @default 1
495
+ * @maximum 10
496
+ * @minimum 1
497
+ */
498
+ weight?: number;
499
+ })[];
289
500
  /**
290
501
  * @minProperties 1
291
502
  */
@@ -299,10 +510,287 @@ declare type FilterExpression = {
299
510
  } & {
300
511
  [key: string]: FilterColumn;
301
512
  };
513
+ /**
514
+ * The description of the summaries you wish to receive. Set each key to be the field name
515
+ * you'd like for the summary. These names must not collide with other columns you've
516
+ * requested from `columns`; including implicit requests like `settings.*`.
517
+ *
518
+ * The value for each key needs to be an object. This object should contain one key and one
519
+ * value only. In this object, the key should be set to the summary function you wish to use
520
+ * and the value set to the column name to be summarized.
521
+ *
522
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
523
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
524
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
525
+ *
526
+ * @example {"all_users":{"count":"*"}}
527
+ * @example {"total_created":{"count":"created_at"}}
528
+ * @x-go-type xbquery.SummaryList
529
+ */
530
+ declare type SummaryExpressionList = {
531
+ [key: string]: SummaryExpression;
532
+ };
533
+ /**
534
+ * A summary expression is the description of a single summary operation. It consists of a single
535
+ * key representing the operation, and a value representing the column to be operated on.
536
+ *
537
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
538
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
539
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
540
+ *
541
+ * We currently support the `count` operation. When using `count`, one can set a column name
542
+ * as the value. Xata will return the total number times this column is non-null in each group.
543
+ *
544
+ * Alternately, if you'd like to count the total rows in each group - irregardless of null/not null
545
+ * status - you can set `count` to `*` to count everything.
546
+ *
547
+ * @example {"count":"deleted_at"}
548
+ * @x-go-type xbquery.Summary
549
+ */
550
+ declare type SummaryExpression = Record<string, any>;
551
+ /**
552
+ * The description of the aggregations you wish to receive.
553
+ *
554
+ * @example {"totalCount":{"count":"*"},"dailyActiveUsers":{"dateHistogram":{"column":"date","interval":"1d"},"aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}}}}
555
+ */
556
+ declare type AggExpressionMap = {
557
+ [key: string]: AggExpression;
558
+ };
559
+ /**
560
+ * The description of a single aggregation operation. It is an object with only one key-value pair.
561
+ * The key represents the aggreagtion type, while the value is an object with the configuration of
562
+ * the aggreagtion.
563
+ *
564
+ * @x-go-type xata.AggExpression
565
+ */
566
+ declare type AggExpression = {
567
+ count?: CountAgg;
568
+ } | {
569
+ sum?: SumAgg;
570
+ } | {
571
+ max?: MaxAgg;
572
+ } | {
573
+ min?: MinAgg;
574
+ } | {
575
+ average?: AverageAgg;
576
+ } | {
577
+ uniqueCount?: UniqueCountAgg;
578
+ } | {
579
+ dateHistogram?: DateHistogramAgg;
580
+ } | {
581
+ topValues?: TopValuesAgg;
582
+ } | {
583
+ numericHistogram?: NumericHistogramAgg;
584
+ };
585
+ /**
586
+ * Count the number of records with an optional filter.
587
+ */
588
+ declare type CountAgg = {
589
+ filter?: FilterExpression;
590
+ } | '*';
591
+ /**
592
+ * The sum of the numeric values in a particular column.
593
+ */
594
+ declare type SumAgg = {
595
+ /**
596
+ * The column on which to compute the sum. Must be a numeric type.
597
+ */
598
+ column: string;
599
+ };
600
+ /**
601
+ * The max of the numeric values in a particular column.
602
+ */
603
+ declare type MaxAgg = {
604
+ /**
605
+ * The column on which to compute the max. Must be a numeric type.
606
+ */
607
+ column: string;
608
+ };
609
+ /**
610
+ * The min of the numeric values in a particular column.
611
+ */
612
+ declare type MinAgg = {
613
+ /**
614
+ * The column on which to compute the min. Must be a numeric type.
615
+ */
616
+ column: string;
617
+ };
618
+ /**
619
+ * The average of the numeric values in a particular column.
620
+ */
621
+ declare type AverageAgg = {
622
+ /**
623
+ * The column on which to compute the average. Must be a numeric type.
624
+ */
625
+ column: string;
626
+ };
627
+ /**
628
+ * Count the number of distinct values in a particular column.
629
+ */
630
+ declare type UniqueCountAgg = {
631
+ /**
632
+ * The column from where to count the unique values.
633
+ */
634
+ column: string;
635
+ /**
636
+ * The threshold under which the unique count is exact. If the number of unique
637
+ * values in the column is higher than this threshold, the results are approximative.
638
+ * Maximum value is 40,000, default value is 3000.
639
+ */
640
+ precisionThreshold?: number;
641
+ };
642
+ /**
643
+ * Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
644
+ */
645
+ declare type DateHistogramAgg = {
646
+ /**
647
+ * The column to use for bucketing. Must be of type datetime.
648
+ */
649
+ column: string;
650
+ /**
651
+ * The fixed interval to use when bucketing.
652
+ * It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
653
+ *
654
+ * @pattern ^(\d+)(d|h|m|s|ms)$
655
+ */
656
+ interval?: string;
657
+ /**
658
+ * The calendar-aware interval to use when bucketing. Possible values are: `minute`,
659
+ * `hour`, `day`, `week`, `month`, `quarter`, `year`.
660
+ */
661
+ calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
662
+ /**
663
+ * The timezone to use for bucketing. By default, UTC is assumed.
664
+ * The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
665
+ * `-08:00`.
666
+ *
667
+ * @pattern ^[+-][01]\d:[0-5]\d$
668
+ */
669
+ timezone?: string;
670
+ aggs?: AggExpressionMap;
671
+ };
672
+ /**
673
+ * Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
674
+ * The top values as ordered by the number of records (`$count``) are returned.
675
+ */
676
+ declare type TopValuesAgg = {
677
+ /**
678
+ * The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
679
+ */
680
+ column: string;
681
+ aggs?: AggExpressionMap;
682
+ /**
683
+ * The maximum number of unique values to return.
684
+ *
685
+ * @default 10
686
+ * @maximum 1000
687
+ */
688
+ size?: number;
689
+ };
690
+ /**
691
+ * Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
692
+ */
693
+ declare type NumericHistogramAgg = {
694
+ /**
695
+ * The column to use for bucketing. Must be of numeric type.
696
+ */
697
+ column: string;
698
+ /**
699
+ * The numeric interval to use for bucketing. The resulting buckets will be ranges
700
+ * with this value as size.
701
+ *
702
+ * @minimum 0
703
+ */
704
+ interval: number;
705
+ /**
706
+ * By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
707
+ * boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
708
+ * but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
709
+ * to 50.
710
+ *
711
+ * @default 0
712
+ */
713
+ offset?: number;
714
+ aggs?: AggExpressionMap;
715
+ };
302
716
  declare type HighlightExpression = {
717
+ /**
718
+ * Set to `false` to disable highlighting. By default it is `true`.
719
+ */
303
720
  enabled?: boolean;
721
+ /**
722
+ * Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
723
+ */
304
724
  encodeHTML?: boolean;
305
725
  };
726
+ /**
727
+ * Booster Expression
728
+ *
729
+ * @x-go-type xata.BoosterExpression
730
+ */
731
+ declare type BoosterExpression = {
732
+ valueBooster?: ValueBooster$1;
733
+ } | {
734
+ numericBooster?: NumericBooster$1;
735
+ } | {
736
+ dateBooster?: DateBooster$1;
737
+ };
738
+ /**
739
+ * Boost records with a particular value for a column.
740
+ */
741
+ declare type ValueBooster$1 = {
742
+ /**
743
+ * The column in which to look for the value.
744
+ */
745
+ column: string;
746
+ /**
747
+ * The exact value to boost.
748
+ */
749
+ value: string | number | boolean;
750
+ /**
751
+ * The factor with which to multiply the score of the record.
752
+ */
753
+ factor: number;
754
+ };
755
+ /**
756
+ * Boost records based on the value of a numeric column.
757
+ */
758
+ declare type NumericBooster$1 = {
759
+ /**
760
+ * The column in which to look for the value.
761
+ */
762
+ column: string;
763
+ /**
764
+ * The factor with which to multiply the value of the column before adding it to the item score.
765
+ */
766
+ factor: number;
767
+ };
768
+ /**
769
+ * Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
770
+ * 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
771
+ * 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.
772
+ */
773
+ declare type DateBooster$1 = {
774
+ /**
775
+ * The column in which to look for the value.
776
+ */
777
+ column: string;
778
+ /**
779
+ * 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.
780
+ * If it is not specified, the current date and time is used.
781
+ */
782
+ origin?: string;
783
+ /**
784
+ * 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`.
785
+ *
786
+ * @pattern ^(\d+)(d|h|m|s|ms)$
787
+ */
788
+ scale: string;
789
+ /**
790
+ * The decay factor to expect at "scale" distance from the "origin".
791
+ */
792
+ decay: number;
793
+ };
306
794
  declare type FilterList = FilterExpression | FilterExpression[];
307
795
  declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
308
796
  /**
@@ -352,14 +840,73 @@ declare type FilterValue = number | string | boolean;
352
840
  * Pagination settings.
353
841
  */
354
842
  declare type PageConfig = {
843
+ /**
844
+ * Query the next page that follow the cursor.
845
+ */
355
846
  after?: string;
847
+ /**
848
+ * Query the previous page before the cursor.
849
+ */
356
850
  before?: string;
851
+ /**
852
+ * Query the first page from the cursor.
853
+ */
357
854
  first?: string;
855
+ /**
856
+ * Query the last page from the cursor.
857
+ */
358
858
  last?: string;
359
- size?: number;
859
+ /**
860
+ * 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.
861
+ *
862
+ * @default 20
863
+ */
864
+ size?: number;
865
+ /**
866
+ * Use offset to skip entries. To skip pages set offset to a multiple of size.
867
+ *
868
+ * @default 0
869
+ */
360
870
  offset?: number;
361
871
  };
362
- declare type ColumnsFilter = string[];
872
+ /**
873
+ * @example name
874
+ * @example email
875
+ * @example created_at
876
+ */
877
+ declare type ColumnsProjection = string[];
878
+ /**
879
+ * Xata Table Record Metadata
880
+ */
881
+ declare type RecordMeta = {
882
+ id: RecordID;
883
+ xata: {
884
+ /**
885
+ * The record's version. Can be used for optimistic concurrency control.
886
+ */
887
+ version: number;
888
+ /**
889
+ * The record's table name. APIs that return records from multiple tables will set this field accordingly.
890
+ */
891
+ table?: string;
892
+ /**
893
+ * Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
894
+ */
895
+ highlight?: {
896
+ [key: string]: string[] | {
897
+ [key: string]: any;
898
+ };
899
+ };
900
+ /**
901
+ * The record's relevancy score. This is returned by the search APIs.
902
+ */
903
+ score?: number;
904
+ /**
905
+ * Encoding/Decoding errors
906
+ */
907
+ warnings?: string[];
908
+ };
909
+ };
363
910
  /**
364
911
  * @pattern [a-zA-Z0-9_-~:]+
365
912
  */
@@ -368,7 +915,13 @@ declare type RecordID = string;
368
915
  * @example {"newName":"newName","oldName":"oldName"}
369
916
  */
370
917
  declare type TableRename = {
918
+ /**
919
+ * @minLength 1
920
+ */
371
921
  newName: string;
922
+ /**
923
+ * @minLength 1
924
+ */
372
925
  oldName: string;
373
926
  };
374
927
  /**
@@ -376,26 +929,60 @@ declare type TableRename = {
376
929
  */
377
930
  declare type RecordsMetadata = {
378
931
  page: {
932
+ /**
933
+ * last record id
934
+ */
379
935
  cursor: string;
936
+ /**
937
+ * true if more records can be fetch
938
+ */
380
939
  more: boolean;
381
940
  };
382
941
  };
942
+ declare type AggResponse$1 = (number | null) | {
943
+ values: ({
944
+ $key: string | number;
945
+ $count: number;
946
+ } & {
947
+ [key: string]: AggResponse$1;
948
+ })[];
949
+ };
383
950
  /**
384
- * Xata Table Record
951
+ * Metadata of databases
385
952
  */
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[];
953
+ declare type CPDatabaseMetadata = {
954
+ /**
955
+ * The machine-readable name of a database
956
+ */
957
+ name: string;
958
+ /**
959
+ * Region where this database is hosted
960
+ */
961
+ region: string;
962
+ /**
963
+ * The time this database was created
964
+ */
965
+ createdAt: DateTime;
966
+ /**
967
+ * Metadata about the database for display in Xata user interfaces
968
+ */
969
+ ui?: {
970
+ /**
971
+ * The user-selected color for this database across interfaces
972
+ */
973
+ color?: string;
397
974
  };
398
- } & {
975
+ };
976
+ declare type CPListDatabasesResponse = {
977
+ /**
978
+ * A list of databases in a Xata workspace
979
+ */
980
+ databases?: CPDatabaseMetadata[];
981
+ };
982
+ /**
983
+ * Xata Table Record Metadata
984
+ */
985
+ declare type XataRecord$1 = RecordMeta & {
399
986
  [key: string]: any;
400
987
  };
401
988
 
@@ -413,6 +1000,7 @@ type schemas_InviteID = InviteID;
413
1000
  type schemas_WorkspaceInvite = WorkspaceInvite;
414
1001
  type schemas_WorkspaceMembers = WorkspaceMembers;
415
1002
  type schemas_InviteKey = InviteKey;
1003
+ type schemas_DatabaseMetadata = DatabaseMetadata;
416
1004
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
417
1005
  type schemas_ListBranchesResponse = ListBranchesResponse;
418
1006
  type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
@@ -421,7 +1009,9 @@ type schemas_BranchMetadata = BranchMetadata;
421
1009
  type schemas_DBBranch = DBBranch;
422
1010
  type schemas_StartedFromMetadata = StartedFromMetadata;
423
1011
  type schemas_Schema = Schema;
1012
+ type schemas_SchemaEditScript = SchemaEditScript;
424
1013
  type schemas_Table = Table;
1014
+ type schemas_TableEdit = TableEdit;
425
1015
  type schemas_Column = Column;
426
1016
  type schemas_RevLink = RevLink;
427
1017
  type schemas_BranchName = BranchName;
@@ -434,12 +1024,39 @@ type schemas_MetricsLatency = MetricsLatency;
434
1024
  type schemas_BranchMigration = BranchMigration;
435
1025
  type schemas_TableMigration = TableMigration;
436
1026
  type schemas_ColumnMigration = ColumnMigration;
1027
+ type schemas_Commit = Commit;
1028
+ type schemas_Migration = Migration;
1029
+ type schemas_MigrationOp = MigrationOp;
1030
+ type schemas_MigrationTableOp = MigrationTableOp;
1031
+ type schemas_MigrationColumnOp = MigrationColumnOp;
1032
+ type schemas_TableOpAdd = TableOpAdd;
1033
+ type schemas_TableOpRemove = TableOpRemove;
1034
+ type schemas_TableOpRename = TableOpRename;
1035
+ type schemas_ColumnOpAdd = ColumnOpAdd;
1036
+ type schemas_ColumnOpRemove = ColumnOpRemove;
1037
+ type schemas_ColumnOpRename = ColumnOpRename;
1038
+ type schemas_MigrationRequest = MigrationRequest;
437
1039
  type schemas_SortExpression = SortExpression;
438
1040
  type schemas_SortOrder = SortOrder;
439
1041
  type schemas_FuzzinessExpression = FuzzinessExpression;
440
1042
  type schemas_PrefixExpression = PrefixExpression;
1043
+ type schemas_TargetExpression = TargetExpression;
441
1044
  type schemas_FilterExpression = FilterExpression;
1045
+ type schemas_SummaryExpressionList = SummaryExpressionList;
1046
+ type schemas_SummaryExpression = SummaryExpression;
1047
+ type schemas_AggExpressionMap = AggExpressionMap;
1048
+ type schemas_AggExpression = AggExpression;
1049
+ type schemas_CountAgg = CountAgg;
1050
+ type schemas_SumAgg = SumAgg;
1051
+ type schemas_MaxAgg = MaxAgg;
1052
+ type schemas_MinAgg = MinAgg;
1053
+ type schemas_AverageAgg = AverageAgg;
1054
+ type schemas_UniqueCountAgg = UniqueCountAgg;
1055
+ type schemas_DateHistogramAgg = DateHistogramAgg;
1056
+ type schemas_TopValuesAgg = TopValuesAgg;
1057
+ type schemas_NumericHistogramAgg = NumericHistogramAgg;
442
1058
  type schemas_HighlightExpression = HighlightExpression;
1059
+ type schemas_BoosterExpression = BoosterExpression;
443
1060
  type schemas_FilterList = FilterList;
444
1061
  type schemas_FilterColumn = FilterColumn;
445
1062
  type schemas_FilterColumnIncludes = FilterColumnIncludes;
@@ -449,10 +1066,13 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
449
1066
  type schemas_FilterRangeValue = FilterRangeValue;
450
1067
  type schemas_FilterValue = FilterValue;
451
1068
  type schemas_PageConfig = PageConfig;
452
- type schemas_ColumnsFilter = ColumnsFilter;
1069
+ type schemas_ColumnsProjection = ColumnsProjection;
1070
+ type schemas_RecordMeta = RecordMeta;
453
1071
  type schemas_RecordID = RecordID;
454
1072
  type schemas_TableRename = TableRename;
455
1073
  type schemas_RecordsMetadata = RecordsMetadata;
1074
+ type schemas_CPDatabaseMetadata = CPDatabaseMetadata;
1075
+ type schemas_CPListDatabasesResponse = CPListDatabasesResponse;
456
1076
  declare namespace schemas {
457
1077
  export {
458
1078
  schemas_User as User,
@@ -469,6 +1089,7 @@ declare namespace schemas {
469
1089
  schemas_WorkspaceInvite as WorkspaceInvite,
470
1090
  schemas_WorkspaceMembers as WorkspaceMembers,
471
1091
  schemas_InviteKey as InviteKey,
1092
+ schemas_DatabaseMetadata as DatabaseMetadata,
472
1093
  schemas_ListDatabasesResponse as ListDatabasesResponse,
473
1094
  schemas_ListBranchesResponse as ListBranchesResponse,
474
1095
  schemas_ListGitBranchesResponse as ListGitBranchesResponse,
@@ -477,7 +1098,9 @@ declare namespace schemas {
477
1098
  schemas_DBBranch as DBBranch,
478
1099
  schemas_StartedFromMetadata as StartedFromMetadata,
479
1100
  schemas_Schema as Schema,
1101
+ schemas_SchemaEditScript as SchemaEditScript,
480
1102
  schemas_Table as Table,
1103
+ schemas_TableEdit as TableEdit,
481
1104
  schemas_Column as Column,
482
1105
  schemas_RevLink as RevLink,
483
1106
  schemas_BranchName as BranchName,
@@ -490,12 +1113,42 @@ declare namespace schemas {
490
1113
  schemas_BranchMigration as BranchMigration,
491
1114
  schemas_TableMigration as TableMigration,
492
1115
  schemas_ColumnMigration as ColumnMigration,
1116
+ schemas_Commit as Commit,
1117
+ schemas_Migration as Migration,
1118
+ schemas_MigrationOp as MigrationOp,
1119
+ schemas_MigrationTableOp as MigrationTableOp,
1120
+ schemas_MigrationColumnOp as MigrationColumnOp,
1121
+ schemas_TableOpAdd as TableOpAdd,
1122
+ schemas_TableOpRemove as TableOpRemove,
1123
+ schemas_TableOpRename as TableOpRename,
1124
+ schemas_ColumnOpAdd as ColumnOpAdd,
1125
+ schemas_ColumnOpRemove as ColumnOpRemove,
1126
+ schemas_ColumnOpRename as ColumnOpRename,
1127
+ schemas_MigrationRequest as MigrationRequest,
493
1128
  schemas_SortExpression as SortExpression,
494
1129
  schemas_SortOrder as SortOrder,
495
1130
  schemas_FuzzinessExpression as FuzzinessExpression,
496
1131
  schemas_PrefixExpression as PrefixExpression,
1132
+ schemas_TargetExpression as TargetExpression,
497
1133
  schemas_FilterExpression as FilterExpression,
1134
+ schemas_SummaryExpressionList as SummaryExpressionList,
1135
+ schemas_SummaryExpression as SummaryExpression,
1136
+ schemas_AggExpressionMap as AggExpressionMap,
1137
+ schemas_AggExpression as AggExpression,
1138
+ schemas_CountAgg as CountAgg,
1139
+ schemas_SumAgg as SumAgg,
1140
+ schemas_MaxAgg as MaxAgg,
1141
+ schemas_MinAgg as MinAgg,
1142
+ schemas_AverageAgg as AverageAgg,
1143
+ schemas_UniqueCountAgg as UniqueCountAgg,
1144
+ schemas_DateHistogramAgg as DateHistogramAgg,
1145
+ schemas_TopValuesAgg as TopValuesAgg,
1146
+ schemas_NumericHistogramAgg as NumericHistogramAgg,
498
1147
  schemas_HighlightExpression as HighlightExpression,
1148
+ schemas_BoosterExpression as BoosterExpression,
1149
+ ValueBooster$1 as ValueBooster,
1150
+ NumericBooster$1 as NumericBooster,
1151
+ DateBooster$1 as DateBooster,
499
1152
  schemas_FilterList as FilterList,
500
1153
  schemas_FilterColumn as FilterColumn,
501
1154
  schemas_FilterColumnIncludes as FilterColumnIncludes,
@@ -505,10 +1158,14 @@ declare namespace schemas {
505
1158
  schemas_FilterRangeValue as FilterRangeValue,
506
1159
  schemas_FilterValue as FilterValue,
507
1160
  schemas_PageConfig as PageConfig,
508
- schemas_ColumnsFilter as ColumnsFilter,
1161
+ schemas_ColumnsProjection as ColumnsProjection,
1162
+ schemas_RecordMeta as RecordMeta,
509
1163
  schemas_RecordID as RecordID,
510
1164
  schemas_TableRename as TableRename,
511
1165
  schemas_RecordsMetadata as RecordsMetadata,
1166
+ AggResponse$1 as AggResponse,
1167
+ schemas_CPDatabaseMetadata as CPDatabaseMetadata,
1168
+ schemas_CPListDatabasesResponse as CPListDatabasesResponse,
512
1169
  XataRecord$1 as XataRecord,
513
1170
  };
514
1171
  }
@@ -540,11 +1197,22 @@ declare type BulkError = {
540
1197
  status?: number;
541
1198
  }[];
542
1199
  };
1200
+ declare type BulkInsertResponse = {
1201
+ recordIDs: string[];
1202
+ } | {
1203
+ records: XataRecord$1[];
1204
+ };
543
1205
  declare type BranchMigrationPlan = {
544
1206
  version: number;
545
1207
  migration: BranchMigration;
546
1208
  };
547
- declare type RecordUpdateResponse = {
1209
+ declare type RecordResponse = XataRecord$1;
1210
+ declare type SchemaCompareResponse = {
1211
+ source: Schema;
1212
+ target: Schema;
1213
+ edits: SchemaEditScript;
1214
+ };
1215
+ declare type RecordUpdateResponse = XataRecord$1 | {
548
1216
  id: string;
549
1217
  xata: {
550
1218
  version: number;
@@ -554,13 +1222,28 @@ declare type QueryResponse = {
554
1222
  records: XataRecord$1[];
555
1223
  meta: RecordsMetadata;
556
1224
  };
1225
+ declare type SummarizeResponse = {
1226
+ summaries: Record<string, any>[];
1227
+ };
1228
+ /**
1229
+ * @example {"aggs":{"dailyUniqueUsers":{"values":[{"key":"2022-02-22T22:22:22Z","uniqueUsers":134},{"key":"2022-02-23T22:22:22Z","uniqueUsers":90}]}}}
1230
+ */
1231
+ declare type AggResponse = {
1232
+ aggs?: {
1233
+ [key: string]: AggResponse$1;
1234
+ };
1235
+ };
557
1236
  declare type SearchResponse = {
558
1237
  records: XataRecord$1[];
1238
+ warning?: string;
559
1239
  };
560
1240
  /**
561
1241
  * @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
562
1242
  */
563
1243
  declare type MigrationIdResponse = {
1244
+ /**
1245
+ * @minLength 1
1246
+ */
564
1247
  migrationID: string;
565
1248
  };
566
1249
 
@@ -568,9 +1251,14 @@ type responses_SimpleError = SimpleError;
568
1251
  type responses_BadRequestError = BadRequestError;
569
1252
  type responses_AuthError = AuthError;
570
1253
  type responses_BulkError = BulkError;
1254
+ type responses_BulkInsertResponse = BulkInsertResponse;
571
1255
  type responses_BranchMigrationPlan = BranchMigrationPlan;
1256
+ type responses_RecordResponse = RecordResponse;
1257
+ type responses_SchemaCompareResponse = SchemaCompareResponse;
572
1258
  type responses_RecordUpdateResponse = RecordUpdateResponse;
573
1259
  type responses_QueryResponse = QueryResponse;
1260
+ type responses_SummarizeResponse = SummarizeResponse;
1261
+ type responses_AggResponse = AggResponse;
574
1262
  type responses_SearchResponse = SearchResponse;
575
1263
  type responses_MigrationIdResponse = MigrationIdResponse;
576
1264
  declare namespace responses {
@@ -579,9 +1267,14 @@ declare namespace responses {
579
1267
  responses_BadRequestError as BadRequestError,
580
1268
  responses_AuthError as AuthError,
581
1269
  responses_BulkError as BulkError,
1270
+ responses_BulkInsertResponse as BulkInsertResponse,
582
1271
  responses_BranchMigrationPlan as BranchMigrationPlan,
1272
+ responses_RecordResponse as RecordResponse,
1273
+ responses_SchemaCompareResponse as SchemaCompareResponse,
583
1274
  responses_RecordUpdateResponse as RecordUpdateResponse,
584
1275
  responses_QueryResponse as QueryResponse,
1276
+ responses_SummarizeResponse as SummarizeResponse,
1277
+ responses_AggResponse as AggResponse,
585
1278
  responses_SearchResponse as SearchResponse,
586
1279
  responses_MigrationIdResponse as MigrationIdResponse,
587
1280
  };
@@ -607,7 +1300,7 @@ declare type GetUserVariables = FetcherExtraProps;
607
1300
  /**
608
1301
  * Return details of the user making the request
609
1302
  */
610
- declare const getUser: (variables: GetUserVariables) => Promise<UserWithID>;
1303
+ declare const getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
611
1304
  declare type UpdateUserError = ErrorWrapper<{
612
1305
  status: 400;
613
1306
  payload: BadRequestError;
@@ -624,7 +1317,7 @@ declare type UpdateUserVariables = {
624
1317
  /**
625
1318
  * Update user info
626
1319
  */
627
- declare const updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
1320
+ declare const updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
628
1321
  declare type DeleteUserError = ErrorWrapper<{
629
1322
  status: 400;
630
1323
  payload: BadRequestError;
@@ -639,7 +1332,7 @@ declare type DeleteUserVariables = FetcherExtraProps;
639
1332
  /**
640
1333
  * Delete the user making the request
641
1334
  */
642
- declare const deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
1335
+ declare const deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
643
1336
  declare type GetUserAPIKeysError = ErrorWrapper<{
644
1337
  status: 400;
645
1338
  payload: BadRequestError;
@@ -660,8 +1353,11 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
660
1353
  /**
661
1354
  * Retrieve a list of existing user API keys
662
1355
  */
663
- declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
1356
+ declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
664
1357
  declare type CreateUserAPIKeyPathParams = {
1358
+ /**
1359
+ * API Key name
1360
+ */
665
1361
  keyName: APIKeyName;
666
1362
  };
667
1363
  declare type CreateUserAPIKeyError = ErrorWrapper<{
@@ -685,8 +1381,11 @@ declare type CreateUserAPIKeyVariables = {
685
1381
  /**
686
1382
  * Create and return new API key
687
1383
  */
688
- declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
1384
+ declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
689
1385
  declare type DeleteUserAPIKeyPathParams = {
1386
+ /**
1387
+ * API Key name
1388
+ */
690
1389
  keyName: APIKeyName;
691
1390
  };
692
1391
  declare type DeleteUserAPIKeyError = ErrorWrapper<{
@@ -705,7 +1404,7 @@ declare type DeleteUserAPIKeyVariables = {
705
1404
  /**
706
1405
  * Delete an existing API key
707
1406
  */
708
- declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
1407
+ declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
709
1408
  declare type CreateWorkspaceError = ErrorWrapper<{
710
1409
  status: 400;
711
1410
  payload: BadRequestError;
@@ -722,7 +1421,7 @@ declare type CreateWorkspaceVariables = {
722
1421
  /**
723
1422
  * Creates a new workspace with the user requesting it as its single owner.
724
1423
  */
725
- declare const createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
1424
+ declare const createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
726
1425
  declare type GetWorkspacesListError = ErrorWrapper<{
727
1426
  status: 400;
728
1427
  payload: BadRequestError;
@@ -745,8 +1444,11 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
745
1444
  /**
746
1445
  * Retrieve the list of workspaces the user belongs to
747
1446
  */
748
- declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
1447
+ declare const getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
749
1448
  declare type GetWorkspacePathParams = {
1449
+ /**
1450
+ * Workspace ID
1451
+ */
750
1452
  workspaceId: WorkspaceID;
751
1453
  };
752
1454
  declare type GetWorkspaceError = ErrorWrapper<{
@@ -765,8 +1467,11 @@ declare type GetWorkspaceVariables = {
765
1467
  /**
766
1468
  * Retrieve workspace info from a workspace ID
767
1469
  */
768
- declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
1470
+ declare const getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
769
1471
  declare type UpdateWorkspacePathParams = {
1472
+ /**
1473
+ * Workspace ID
1474
+ */
770
1475
  workspaceId: WorkspaceID;
771
1476
  };
772
1477
  declare type UpdateWorkspaceError = ErrorWrapper<{
@@ -786,8 +1491,11 @@ declare type UpdateWorkspaceVariables = {
786
1491
  /**
787
1492
  * Update workspace info
788
1493
  */
789
- declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
1494
+ declare const updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
790
1495
  declare type DeleteWorkspacePathParams = {
1496
+ /**
1497
+ * Workspace ID
1498
+ */
791
1499
  workspaceId: WorkspaceID;
792
1500
  };
793
1501
  declare type DeleteWorkspaceError = ErrorWrapper<{
@@ -806,8 +1514,11 @@ declare type DeleteWorkspaceVariables = {
806
1514
  /**
807
1515
  * Delete the workspace with the provided ID
808
1516
  */
809
- declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
1517
+ declare const deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
810
1518
  declare type GetWorkspaceMembersListPathParams = {
1519
+ /**
1520
+ * Workspace ID
1521
+ */
811
1522
  workspaceId: WorkspaceID;
812
1523
  };
813
1524
  declare type GetWorkspaceMembersListError = ErrorWrapper<{
@@ -826,9 +1537,15 @@ declare type GetWorkspaceMembersListVariables = {
826
1537
  /**
827
1538
  * Retrieve the list of members of the given workspace
828
1539
  */
829
- declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
1540
+ declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
830
1541
  declare type UpdateWorkspaceMemberRolePathParams = {
1542
+ /**
1543
+ * Workspace ID
1544
+ */
831
1545
  workspaceId: WorkspaceID;
1546
+ /**
1547
+ * UserID
1548
+ */
832
1549
  userId: UserID;
833
1550
  };
834
1551
  declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
@@ -851,9 +1568,15 @@ declare type UpdateWorkspaceMemberRoleVariables = {
851
1568
  /**
852
1569
  * Update a workspace member role. Workspaces must always have at least one owner, so this operation will fail if trying to remove owner role from the last owner in the workspace.
853
1570
  */
854
- declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
1571
+ declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
855
1572
  declare type RemoveWorkspaceMemberPathParams = {
1573
+ /**
1574
+ * Workspace ID
1575
+ */
856
1576
  workspaceId: WorkspaceID;
1577
+ /**
1578
+ * UserID
1579
+ */
857
1580
  userId: UserID;
858
1581
  };
859
1582
  declare type RemoveWorkspaceMemberError = ErrorWrapper<{
@@ -872,8 +1595,11 @@ declare type RemoveWorkspaceMemberVariables = {
872
1595
  /**
873
1596
  * Remove the member from the workspace
874
1597
  */
875
- declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
1598
+ declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
876
1599
  declare type InviteWorkspaceMemberPathParams = {
1600
+ /**
1601
+ * Workspace ID
1602
+ */
877
1603
  workspaceId: WorkspaceID;
878
1604
  };
879
1605
  declare type InviteWorkspaceMemberError = ErrorWrapper<{
@@ -885,8 +1611,14 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
885
1611
  } | {
886
1612
  status: 404;
887
1613
  payload: SimpleError;
1614
+ } | {
1615
+ status: 409;
1616
+ payload: SimpleError;
888
1617
  }>;
889
1618
  declare type InviteWorkspaceMemberRequestBody = {
1619
+ /**
1620
+ * @format email
1621
+ */
890
1622
  email: string;
891
1623
  role: Role;
892
1624
  };
@@ -897,9 +1629,49 @@ declare type InviteWorkspaceMemberVariables = {
897
1629
  /**
898
1630
  * Invite some user to join the workspace with the given role
899
1631
  */
900
- declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
1632
+ declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
1633
+ declare type UpdateWorkspaceMemberInvitePathParams = {
1634
+ /**
1635
+ * Workspace ID
1636
+ */
1637
+ workspaceId: WorkspaceID;
1638
+ /**
1639
+ * Invite identifier
1640
+ */
1641
+ inviteId: InviteID;
1642
+ };
1643
+ declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
1644
+ status: 400;
1645
+ payload: BadRequestError;
1646
+ } | {
1647
+ status: 401;
1648
+ payload: AuthError;
1649
+ } | {
1650
+ status: 404;
1651
+ payload: SimpleError;
1652
+ } | {
1653
+ status: 422;
1654
+ payload: SimpleError;
1655
+ }>;
1656
+ declare type UpdateWorkspaceMemberInviteRequestBody = {
1657
+ role: Role;
1658
+ };
1659
+ declare type UpdateWorkspaceMemberInviteVariables = {
1660
+ body: UpdateWorkspaceMemberInviteRequestBody;
1661
+ pathParams: UpdateWorkspaceMemberInvitePathParams;
1662
+ } & FetcherExtraProps;
1663
+ /**
1664
+ * 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.
1665
+ */
1666
+ declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
901
1667
  declare type CancelWorkspaceMemberInvitePathParams = {
1668
+ /**
1669
+ * Workspace ID
1670
+ */
902
1671
  workspaceId: WorkspaceID;
1672
+ /**
1673
+ * Invite identifier
1674
+ */
903
1675
  inviteId: InviteID;
904
1676
  };
905
1677
  declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
@@ -918,9 +1690,15 @@ declare type CancelWorkspaceMemberInviteVariables = {
918
1690
  /**
919
1691
  * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
920
1692
  */
921
- declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
1693
+ declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
922
1694
  declare type ResendWorkspaceMemberInvitePathParams = {
1695
+ /**
1696
+ * Workspace ID
1697
+ */
923
1698
  workspaceId: WorkspaceID;
1699
+ /**
1700
+ * Invite identifier
1701
+ */
924
1702
  inviteId: InviteID;
925
1703
  };
926
1704
  declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
@@ -939,9 +1717,15 @@ declare type ResendWorkspaceMemberInviteVariables = {
939
1717
  /**
940
1718
  * This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
941
1719
  */
942
- declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
1720
+ declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
943
1721
  declare type AcceptWorkspaceMemberInvitePathParams = {
1722
+ /**
1723
+ * Workspace ID
1724
+ */
944
1725
  workspaceId: WorkspaceID;
1726
+ /**
1727
+ * Invite Key (secret) for the invited user
1728
+ */
945
1729
  inviteKey: InviteKey;
946
1730
  };
947
1731
  declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
@@ -960,7 +1744,7 @@ declare type AcceptWorkspaceMemberInviteVariables = {
960
1744
  /**
961
1745
  * Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
962
1746
  */
963
- declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
1747
+ declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
964
1748
  declare type GetDatabaseListPathParams = {
965
1749
  workspace: string;
966
1750
  };
@@ -977,8 +1761,11 @@ declare type GetDatabaseListVariables = {
977
1761
  /**
978
1762
  * List all databases available in your Workspace.
979
1763
  */
980
- declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
1764
+ declare const getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
981
1765
  declare type GetBranchListPathParams = {
1766
+ /**
1767
+ * The Database Name
1768
+ */
982
1769
  dbName: DBName;
983
1770
  workspace: string;
984
1771
  };
@@ -998,8 +1785,11 @@ declare type GetBranchListVariables = {
998
1785
  /**
999
1786
  * List all available Branches
1000
1787
  */
1001
- declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
1788
+ declare const getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
1002
1789
  declare type CreateDatabasePathParams = {
1790
+ /**
1791
+ * The Database Name
1792
+ */
1003
1793
  dbName: DBName;
1004
1794
  workspace: string;
1005
1795
  };
@@ -1011,11 +1801,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
1011
1801
  payload: AuthError;
1012
1802
  }>;
1013
1803
  declare type CreateDatabaseResponse = {
1804
+ /**
1805
+ * @minLength 1
1806
+ */
1014
1807
  databaseName: string;
1015
1808
  branchName?: string;
1016
1809
  };
1017
1810
  declare type CreateDatabaseRequestBody = {
1018
- displayName?: string;
1811
+ /**
1812
+ * @minLength 1
1813
+ */
1019
1814
  branchName?: string;
1020
1815
  ui?: {
1021
1816
  color?: string;
@@ -1029,8 +1824,11 @@ declare type CreateDatabaseVariables = {
1029
1824
  /**
1030
1825
  * Create Database with identifier name
1031
1826
  */
1032
- declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
1827
+ declare const createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
1033
1828
  declare type DeleteDatabasePathParams = {
1829
+ /**
1830
+ * The Database Name
1831
+ */
1034
1832
  dbName: DBName;
1035
1833
  workspace: string;
1036
1834
  };
@@ -1050,8 +1848,68 @@ declare type DeleteDatabaseVariables = {
1050
1848
  /**
1051
1849
  * Delete a database and all of its branches and tables permanently.
1052
1850
  */
1053
- declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1851
+ declare const deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
1852
+ declare type GetDatabaseMetadataPathParams = {
1853
+ /**
1854
+ * The Database Name
1855
+ */
1856
+ dbName: DBName;
1857
+ workspace: string;
1858
+ };
1859
+ declare type GetDatabaseMetadataError = ErrorWrapper<{
1860
+ status: 400;
1861
+ payload: BadRequestError;
1862
+ } | {
1863
+ status: 401;
1864
+ payload: AuthError;
1865
+ } | {
1866
+ status: 404;
1867
+ payload: SimpleError;
1868
+ }>;
1869
+ declare type GetDatabaseMetadataVariables = {
1870
+ pathParams: GetDatabaseMetadataPathParams;
1871
+ } & FetcherExtraProps;
1872
+ /**
1873
+ * Retrieve metadata of the given database
1874
+ */
1875
+ declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
1876
+ declare type UpdateDatabaseMetadataPathParams = {
1877
+ /**
1878
+ * The Database Name
1879
+ */
1880
+ dbName: DBName;
1881
+ workspace: string;
1882
+ };
1883
+ declare type UpdateDatabaseMetadataError = ErrorWrapper<{
1884
+ status: 400;
1885
+ payload: BadRequestError;
1886
+ } | {
1887
+ status: 401;
1888
+ payload: AuthError;
1889
+ } | {
1890
+ status: 404;
1891
+ payload: SimpleError;
1892
+ }>;
1893
+ declare type UpdateDatabaseMetadataRequestBody = {
1894
+ ui?: {
1895
+ /**
1896
+ * @minLength 1
1897
+ */
1898
+ color?: string;
1899
+ };
1900
+ };
1901
+ declare type UpdateDatabaseMetadataVariables = {
1902
+ body?: UpdateDatabaseMetadataRequestBody;
1903
+ pathParams: UpdateDatabaseMetadataPathParams;
1904
+ } & FetcherExtraProps;
1905
+ /**
1906
+ * Update the color of the selected database
1907
+ */
1908
+ declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
1054
1909
  declare type GetGitBranchesMappingPathParams = {
1910
+ /**
1911
+ * The Database Name
1912
+ */
1055
1913
  dbName: DBName;
1056
1914
  workspace: string;
1057
1915
  };
@@ -1089,8 +1947,11 @@ declare type GetGitBranchesMappingVariables = {
1089
1947
  * }
1090
1948
  * ```
1091
1949
  */
1092
- declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
1950
+ declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
1093
1951
  declare type AddGitBranchesEntryPathParams = {
1952
+ /**
1953
+ * The Database Name
1954
+ */
1094
1955
  dbName: DBName;
1095
1956
  workspace: string;
1096
1957
  };
@@ -1102,10 +1963,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
1102
1963
  payload: AuthError;
1103
1964
  }>;
1104
1965
  declare type AddGitBranchesEntryResponse = {
1966
+ /**
1967
+ * Warning message
1968
+ */
1105
1969
  warning?: string;
1106
1970
  };
1107
1971
  declare type AddGitBranchesEntryRequestBody = {
1972
+ /**
1973
+ * The name of the Git branch.
1974
+ */
1108
1975
  gitBranch: string;
1976
+ /**
1977
+ * The name of the Xata branch.
1978
+ */
1109
1979
  xataBranch: BranchName;
1110
1980
  };
1111
1981
  declare type AddGitBranchesEntryVariables = {
@@ -1127,12 +1997,18 @@ declare type AddGitBranchesEntryVariables = {
1127
1997
  * }
1128
1998
  * ```
1129
1999
  */
1130
- declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2000
+ declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
1131
2001
  declare type RemoveGitBranchesEntryPathParams = {
2002
+ /**
2003
+ * The Database Name
2004
+ */
1132
2005
  dbName: DBName;
1133
2006
  workspace: string;
1134
2007
  };
1135
2008
  declare type RemoveGitBranchesEntryQueryParams = {
2009
+ /**
2010
+ * The Git Branch to remove from the mapping
2011
+ */
1136
2012
  gitBranch: string;
1137
2013
  };
1138
2014
  declare type RemoveGitBranchesEntryError = ErrorWrapper<{
@@ -1155,13 +2031,22 @@ declare type RemoveGitBranchesEntryVariables = {
1155
2031
  * // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
1156
2032
  * ```
1157
2033
  */
1158
- declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
2034
+ declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
1159
2035
  declare type ResolveBranchPathParams = {
2036
+ /**
2037
+ * The Database Name
2038
+ */
1160
2039
  dbName: DBName;
1161
2040
  workspace: string;
1162
2041
  };
1163
2042
  declare type ResolveBranchQueryParams = {
2043
+ /**
2044
+ * The Git Branch
2045
+ */
1164
2046
  gitBranch?: string;
2047
+ /**
2048
+ * Default branch to fallback to
2049
+ */
1165
2050
  fallbackBranch?: string;
1166
2051
  };
1167
2052
  declare type ResolveBranchError = ErrorWrapper<{
@@ -1207,8 +2092,286 @@ declare type ResolveBranchVariables = {
1207
2092
  * }
1208
2093
  * ```
1209
2094
  */
1210
- declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
2095
+ declare const resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
2096
+ declare type QueryMigrationRequestsPathParams = {
2097
+ /**
2098
+ * The Database Name
2099
+ */
2100
+ dbName: DBName;
2101
+ workspace: string;
2102
+ };
2103
+ declare type QueryMigrationRequestsError = ErrorWrapper<{
2104
+ status: 400;
2105
+ payload: BadRequestError;
2106
+ } | {
2107
+ status: 401;
2108
+ payload: AuthError;
2109
+ } | {
2110
+ status: 404;
2111
+ payload: SimpleError;
2112
+ }>;
2113
+ declare type QueryMigrationRequestsResponse = {
2114
+ migrationRequests: MigrationRequest[];
2115
+ meta: RecordsMetadata;
2116
+ };
2117
+ declare type QueryMigrationRequestsRequestBody = {
2118
+ filter?: FilterExpression;
2119
+ sort?: SortExpression;
2120
+ page?: PageConfig;
2121
+ columns?: ColumnsProjection;
2122
+ };
2123
+ declare type QueryMigrationRequestsVariables = {
2124
+ body?: QueryMigrationRequestsRequestBody;
2125
+ pathParams: QueryMigrationRequestsPathParams;
2126
+ } & FetcherExtraProps;
2127
+ declare const queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
2128
+ declare type CreateMigrationRequestPathParams = {
2129
+ /**
2130
+ * The Database Name
2131
+ */
2132
+ dbName: DBName;
2133
+ workspace: string;
2134
+ };
2135
+ declare type CreateMigrationRequestError = ErrorWrapper<{
2136
+ status: 400;
2137
+ payload: BadRequestError;
2138
+ } | {
2139
+ status: 401;
2140
+ payload: AuthError;
2141
+ } | {
2142
+ status: 404;
2143
+ payload: SimpleError;
2144
+ }>;
2145
+ declare type CreateMigrationRequestResponse = {
2146
+ number: number;
2147
+ };
2148
+ declare type CreateMigrationRequestRequestBody = {
2149
+ /**
2150
+ * The source branch.
2151
+ */
2152
+ source: string;
2153
+ /**
2154
+ * The target branch.
2155
+ */
2156
+ target: string;
2157
+ /**
2158
+ * The title.
2159
+ */
2160
+ title: string;
2161
+ /**
2162
+ * Optional migration request description.
2163
+ */
2164
+ body?: string;
2165
+ };
2166
+ declare type CreateMigrationRequestVariables = {
2167
+ body: CreateMigrationRequestRequestBody;
2168
+ pathParams: CreateMigrationRequestPathParams;
2169
+ } & FetcherExtraProps;
2170
+ declare const createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
2171
+ declare type GetMigrationRequestPathParams = {
2172
+ /**
2173
+ * The Database Name
2174
+ */
2175
+ dbName: DBName;
2176
+ /**
2177
+ * The migration request number.
2178
+ */
2179
+ mrNumber: number;
2180
+ workspace: string;
2181
+ };
2182
+ declare type GetMigrationRequestError = ErrorWrapper<{
2183
+ status: 400;
2184
+ payload: BadRequestError;
2185
+ } | {
2186
+ status: 401;
2187
+ payload: AuthError;
2188
+ } | {
2189
+ status: 404;
2190
+ payload: SimpleError;
2191
+ }>;
2192
+ declare type GetMigrationRequestVariables = {
2193
+ pathParams: GetMigrationRequestPathParams;
2194
+ } & FetcherExtraProps;
2195
+ declare const getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
2196
+ declare type UpdateMigrationRequestPathParams = {
2197
+ /**
2198
+ * The Database Name
2199
+ */
2200
+ dbName: DBName;
2201
+ /**
2202
+ * The migration request number.
2203
+ */
2204
+ mrNumber: number;
2205
+ workspace: string;
2206
+ };
2207
+ declare type UpdateMigrationRequestError = ErrorWrapper<{
2208
+ status: 400;
2209
+ payload: BadRequestError;
2210
+ } | {
2211
+ status: 401;
2212
+ payload: AuthError;
2213
+ } | {
2214
+ status: 404;
2215
+ payload: SimpleError;
2216
+ }>;
2217
+ declare type UpdateMigrationRequestRequestBody = {
2218
+ /**
2219
+ * New migration request title.
2220
+ */
2221
+ title?: string;
2222
+ /**
2223
+ * New migration request description.
2224
+ */
2225
+ body?: string;
2226
+ /**
2227
+ * Change the migration request status.
2228
+ */
2229
+ status?: 'open' | 'closed';
2230
+ };
2231
+ declare type UpdateMigrationRequestVariables = {
2232
+ body?: UpdateMigrationRequestRequestBody;
2233
+ pathParams: UpdateMigrationRequestPathParams;
2234
+ } & FetcherExtraProps;
2235
+ declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
2236
+ declare type ListMigrationRequestsCommitsPathParams = {
2237
+ /**
2238
+ * The Database Name
2239
+ */
2240
+ dbName: DBName;
2241
+ /**
2242
+ * The migration request number.
2243
+ */
2244
+ mrNumber: number;
2245
+ workspace: string;
2246
+ };
2247
+ declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
2248
+ status: 400;
2249
+ payload: BadRequestError;
2250
+ } | {
2251
+ status: 401;
2252
+ payload: AuthError;
2253
+ } | {
2254
+ status: 404;
2255
+ payload: SimpleError;
2256
+ }>;
2257
+ declare type ListMigrationRequestsCommitsResponse = {
2258
+ meta: {
2259
+ /**
2260
+ * last record id
2261
+ */
2262
+ cursor: string;
2263
+ /**
2264
+ * true if more records can be fetch
2265
+ */
2266
+ more: boolean;
2267
+ };
2268
+ logs: Commit[];
2269
+ };
2270
+ declare type ListMigrationRequestsCommitsRequestBody = {
2271
+ page?: {
2272
+ /**
2273
+ * Query the next page that follow the cursor.
2274
+ */
2275
+ after?: string;
2276
+ /**
2277
+ * Query the previous page before the cursor.
2278
+ */
2279
+ before?: string;
2280
+ /**
2281
+ * 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.
2282
+ *
2283
+ * @default 20
2284
+ */
2285
+ size?: number;
2286
+ };
2287
+ };
2288
+ declare type ListMigrationRequestsCommitsVariables = {
2289
+ body?: ListMigrationRequestsCommitsRequestBody;
2290
+ pathParams: ListMigrationRequestsCommitsPathParams;
2291
+ } & FetcherExtraProps;
2292
+ declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
2293
+ declare type CompareMigrationRequestPathParams = {
2294
+ /**
2295
+ * The Database Name
2296
+ */
2297
+ dbName: DBName;
2298
+ /**
2299
+ * The migration request number.
2300
+ */
2301
+ mrNumber: number;
2302
+ workspace: string;
2303
+ };
2304
+ declare type CompareMigrationRequestError = ErrorWrapper<{
2305
+ status: 400;
2306
+ payload: BadRequestError;
2307
+ } | {
2308
+ status: 401;
2309
+ payload: AuthError;
2310
+ } | {
2311
+ status: 404;
2312
+ payload: SimpleError;
2313
+ }>;
2314
+ declare type CompareMigrationRequestVariables = {
2315
+ pathParams: CompareMigrationRequestPathParams;
2316
+ } & FetcherExtraProps;
2317
+ declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
2318
+ declare type GetMigrationRequestIsMergedPathParams = {
2319
+ /**
2320
+ * The Database Name
2321
+ */
2322
+ dbName: DBName;
2323
+ /**
2324
+ * The migration request number.
2325
+ */
2326
+ mrNumber: number;
2327
+ workspace: string;
2328
+ };
2329
+ declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
2330
+ status: 400;
2331
+ payload: BadRequestError;
2332
+ } | {
2333
+ status: 401;
2334
+ payload: AuthError;
2335
+ } | {
2336
+ status: 404;
2337
+ payload: SimpleError;
2338
+ }>;
2339
+ declare type GetMigrationRequestIsMergedResponse = {
2340
+ merged?: boolean;
2341
+ };
2342
+ declare type GetMigrationRequestIsMergedVariables = {
2343
+ pathParams: GetMigrationRequestIsMergedPathParams;
2344
+ } & FetcherExtraProps;
2345
+ declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
2346
+ declare type MergeMigrationRequestPathParams = {
2347
+ /**
2348
+ * The Database Name
2349
+ */
2350
+ dbName: DBName;
2351
+ /**
2352
+ * The migration request number.
2353
+ */
2354
+ mrNumber: number;
2355
+ workspace: string;
2356
+ };
2357
+ declare type MergeMigrationRequestError = ErrorWrapper<{
2358
+ status: 400;
2359
+ payload: BadRequestError;
2360
+ } | {
2361
+ status: 401;
2362
+ payload: AuthError;
2363
+ } | {
2364
+ status: 404;
2365
+ payload: SimpleError;
2366
+ }>;
2367
+ declare type MergeMigrationRequestVariables = {
2368
+ pathParams: MergeMigrationRequestPathParams;
2369
+ } & FetcherExtraProps;
2370
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
1211
2371
  declare type GetBranchDetailsPathParams = {
2372
+ /**
2373
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2374
+ */
1212
2375
  dbBranchName: DBBranchName;
1213
2376
  workspace: string;
1214
2377
  };
@@ -1225,12 +2388,18 @@ declare type GetBranchDetailsError = ErrorWrapper<{
1225
2388
  declare type GetBranchDetailsVariables = {
1226
2389
  pathParams: GetBranchDetailsPathParams;
1227
2390
  } & FetcherExtraProps;
1228
- declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2391
+ declare const getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
1229
2392
  declare type CreateBranchPathParams = {
2393
+ /**
2394
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2395
+ */
1230
2396
  dbBranchName: DBBranchName;
1231
2397
  workspace: string;
1232
2398
  };
1233
2399
  declare type CreateBranchQueryParams = {
2400
+ /**
2401
+ * Name of source branch to branch the new schema from
2402
+ */
1234
2403
  from?: string;
1235
2404
  };
1236
2405
  declare type CreateBranchError = ErrorWrapper<{
@@ -1243,7 +2412,17 @@ declare type CreateBranchError = ErrorWrapper<{
1243
2412
  status: 404;
1244
2413
  payload: SimpleError;
1245
2414
  }>;
2415
+ declare type CreateBranchResponse = {
2416
+ /**
2417
+ * @minLength 1
2418
+ */
2419
+ databaseName: string;
2420
+ branchName: string;
2421
+ };
1246
2422
  declare type CreateBranchRequestBody = {
2423
+ /**
2424
+ * Select the branch to fork from. Defaults to 'main'
2425
+ */
1247
2426
  from?: string;
1248
2427
  metadata?: BranchMetadata;
1249
2428
  };
@@ -1252,8 +2431,11 @@ declare type CreateBranchVariables = {
1252
2431
  pathParams: CreateBranchPathParams;
1253
2432
  queryParams?: CreateBranchQueryParams;
1254
2433
  } & FetcherExtraProps;
1255
- declare const createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
2434
+ declare const createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
1256
2435
  declare type DeleteBranchPathParams = {
2436
+ /**
2437
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2438
+ */
1257
2439
  dbBranchName: DBBranchName;
1258
2440
  workspace: string;
1259
2441
  };
@@ -1273,8 +2455,11 @@ declare type DeleteBranchVariables = {
1273
2455
  /**
1274
2456
  * Delete the branch in the database and all its resources
1275
2457
  */
1276
- declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2458
+ declare const deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
1277
2459
  declare type UpdateBranchMetadataPathParams = {
2460
+ /**
2461
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2462
+ */
1278
2463
  dbBranchName: DBBranchName;
1279
2464
  workspace: string;
1280
2465
  };
@@ -1295,8 +2480,11 @@ declare type UpdateBranchMetadataVariables = {
1295
2480
  /**
1296
2481
  * Update the branch metadata
1297
2482
  */
1298
- declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2483
+ declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
1299
2484
  declare type GetBranchMetadataPathParams = {
2485
+ /**
2486
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2487
+ */
1300
2488
  dbBranchName: DBBranchName;
1301
2489
  workspace: string;
1302
2490
  };
@@ -1313,8 +2501,11 @@ declare type GetBranchMetadataError = ErrorWrapper<{
1313
2501
  declare type GetBranchMetadataVariables = {
1314
2502
  pathParams: GetBranchMetadataPathParams;
1315
2503
  } & FetcherExtraProps;
1316
- declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
2504
+ declare const getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
1317
2505
  declare type GetBranchMigrationHistoryPathParams = {
2506
+ /**
2507
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2508
+ */
1318
2509
  dbBranchName: DBBranchName;
1319
2510
  workspace: string;
1320
2511
  };
@@ -1340,8 +2531,11 @@ declare type GetBranchMigrationHistoryVariables = {
1340
2531
  body?: GetBranchMigrationHistoryRequestBody;
1341
2532
  pathParams: GetBranchMigrationHistoryPathParams;
1342
2533
  } & FetcherExtraProps;
1343
- declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2534
+ declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
1344
2535
  declare type ExecuteBranchMigrationPlanPathParams = {
2536
+ /**
2537
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2538
+ */
1345
2539
  dbBranchName: DBBranchName;
1346
2540
  workspace: string;
1347
2541
  };
@@ -1366,8 +2560,11 @@ declare type ExecuteBranchMigrationPlanVariables = {
1366
2560
  /**
1367
2561
  * Apply a migration plan to the branch
1368
2562
  */
1369
- declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2563
+ declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
1370
2564
  declare type GetBranchMigrationPlanPathParams = {
2565
+ /**
2566
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2567
+ */
1371
2568
  dbBranchName: DBBranchName;
1372
2569
  workspace: string;
1373
2570
  };
@@ -1388,8 +2585,200 @@ declare type GetBranchMigrationPlanVariables = {
1388
2585
  /**
1389
2586
  * Compute a migration plan from a target schema the branch should be migrated too.
1390
2587
  */
1391
- declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2588
+ declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
2589
+ declare type CompareBranchWithUserSchemaPathParams = {
2590
+ /**
2591
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2592
+ */
2593
+ dbBranchName: DBBranchName;
2594
+ workspace: string;
2595
+ };
2596
+ declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
2597
+ status: 400;
2598
+ payload: BadRequestError;
2599
+ } | {
2600
+ status: 401;
2601
+ payload: AuthError;
2602
+ } | {
2603
+ status: 404;
2604
+ payload: SimpleError;
2605
+ }>;
2606
+ declare type CompareBranchWithUserSchemaRequestBody = {
2607
+ schema: Schema;
2608
+ };
2609
+ declare type CompareBranchWithUserSchemaVariables = {
2610
+ body: CompareBranchWithUserSchemaRequestBody;
2611
+ pathParams: CompareBranchWithUserSchemaPathParams;
2612
+ } & FetcherExtraProps;
2613
+ declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
2614
+ declare type CompareBranchSchemasPathParams = {
2615
+ /**
2616
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2617
+ */
2618
+ dbBranchName: DBBranchName;
2619
+ /**
2620
+ * The Database Name
2621
+ */
2622
+ branchName: BranchName;
2623
+ workspace: string;
2624
+ };
2625
+ declare type CompareBranchSchemasError = ErrorWrapper<{
2626
+ status: 400;
2627
+ payload: BadRequestError;
2628
+ } | {
2629
+ status: 401;
2630
+ payload: AuthError;
2631
+ } | {
2632
+ status: 404;
2633
+ payload: SimpleError;
2634
+ }>;
2635
+ declare type CompareBranchSchemasVariables = {
2636
+ body?: Record<string, any>;
2637
+ pathParams: CompareBranchSchemasPathParams;
2638
+ } & FetcherExtraProps;
2639
+ declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
2640
+ declare type UpdateBranchSchemaPathParams = {
2641
+ /**
2642
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2643
+ */
2644
+ dbBranchName: DBBranchName;
2645
+ workspace: string;
2646
+ };
2647
+ declare type UpdateBranchSchemaError = ErrorWrapper<{
2648
+ status: 400;
2649
+ payload: BadRequestError;
2650
+ } | {
2651
+ status: 401;
2652
+ payload: AuthError;
2653
+ } | {
2654
+ status: 404;
2655
+ payload: SimpleError;
2656
+ }>;
2657
+ declare type UpdateBranchSchemaResponse = {
2658
+ id: string;
2659
+ parentID: string;
2660
+ };
2661
+ declare type UpdateBranchSchemaVariables = {
2662
+ body: Migration;
2663
+ pathParams: UpdateBranchSchemaPathParams;
2664
+ } & FetcherExtraProps;
2665
+ declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
2666
+ declare type PreviewBranchSchemaEditPathParams = {
2667
+ /**
2668
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2669
+ */
2670
+ dbBranchName: DBBranchName;
2671
+ workspace: string;
2672
+ };
2673
+ declare type PreviewBranchSchemaEditError = ErrorWrapper<{
2674
+ status: 400;
2675
+ payload: BadRequestError;
2676
+ } | {
2677
+ status: 401;
2678
+ payload: AuthError;
2679
+ } | {
2680
+ status: 404;
2681
+ payload: SimpleError;
2682
+ }>;
2683
+ declare type PreviewBranchSchemaEditResponse = {
2684
+ original: Schema;
2685
+ updated: Schema;
2686
+ };
2687
+ declare type PreviewBranchSchemaEditRequestBody = {
2688
+ edits?: SchemaEditScript;
2689
+ operations?: MigrationOp[];
2690
+ };
2691
+ declare type PreviewBranchSchemaEditVariables = {
2692
+ body?: PreviewBranchSchemaEditRequestBody;
2693
+ pathParams: PreviewBranchSchemaEditPathParams;
2694
+ } & FetcherExtraProps;
2695
+ declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
2696
+ declare type ApplyBranchSchemaEditPathParams = {
2697
+ /**
2698
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2699
+ */
2700
+ dbBranchName: DBBranchName;
2701
+ workspace: string;
2702
+ };
2703
+ declare type ApplyBranchSchemaEditError = ErrorWrapper<{
2704
+ status: 400;
2705
+ payload: BadRequestError;
2706
+ } | {
2707
+ status: 401;
2708
+ payload: AuthError;
2709
+ } | {
2710
+ status: 404;
2711
+ payload: SimpleError;
2712
+ }>;
2713
+ declare type ApplyBranchSchemaEditResponse = {
2714
+ id: string;
2715
+ parentID: string;
2716
+ };
2717
+ declare type ApplyBranchSchemaEditRequestBody = {
2718
+ edits: SchemaEditScript;
2719
+ };
2720
+ declare type ApplyBranchSchemaEditVariables = {
2721
+ body: ApplyBranchSchemaEditRequestBody;
2722
+ pathParams: ApplyBranchSchemaEditPathParams;
2723
+ } & FetcherExtraProps;
2724
+ declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
2725
+ declare type GetBranchSchemaHistoryPathParams = {
2726
+ /**
2727
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2728
+ */
2729
+ dbBranchName: DBBranchName;
2730
+ workspace: string;
2731
+ };
2732
+ declare type GetBranchSchemaHistoryError = ErrorWrapper<{
2733
+ status: 400;
2734
+ payload: BadRequestError;
2735
+ } | {
2736
+ status: 401;
2737
+ payload: AuthError;
2738
+ } | {
2739
+ status: 404;
2740
+ payload: SimpleError;
2741
+ }>;
2742
+ declare type GetBranchSchemaHistoryResponse = {
2743
+ meta: {
2744
+ /**
2745
+ * last record id
2746
+ */
2747
+ cursor: string;
2748
+ /**
2749
+ * true if more records can be fetch
2750
+ */
2751
+ more: boolean;
2752
+ };
2753
+ logs: Commit[];
2754
+ };
2755
+ declare type GetBranchSchemaHistoryRequestBody = {
2756
+ page?: {
2757
+ /**
2758
+ * Query the next page that follow the cursor.
2759
+ */
2760
+ after?: string;
2761
+ /**
2762
+ * Query the previous page before the cursor.
2763
+ */
2764
+ before?: string;
2765
+ /**
2766
+ * 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.
2767
+ *
2768
+ * @default 20
2769
+ */
2770
+ size?: number;
2771
+ };
2772
+ };
2773
+ declare type GetBranchSchemaHistoryVariables = {
2774
+ body?: GetBranchSchemaHistoryRequestBody;
2775
+ pathParams: GetBranchSchemaHistoryPathParams;
2776
+ } & FetcherExtraProps;
2777
+ declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
1392
2778
  declare type GetBranchStatsPathParams = {
2779
+ /**
2780
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2781
+ */
1393
2782
  dbBranchName: DBBranchName;
1394
2783
  workspace: string;
1395
2784
  };
@@ -1420,9 +2809,15 @@ declare type GetBranchStatsVariables = {
1420
2809
  /**
1421
2810
  * Get branch usage metrics.
1422
2811
  */
1423
- declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
2812
+ declare const getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
1424
2813
  declare type CreateTablePathParams = {
2814
+ /**
2815
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2816
+ */
1425
2817
  dbBranchName: DBBranchName;
2818
+ /**
2819
+ * The Table name
2820
+ */
1426
2821
  tableName: TableName;
1427
2822
  workspace: string;
1428
2823
  };
@@ -1439,15 +2834,28 @@ declare type CreateTableError = ErrorWrapper<{
1439
2834
  status: 422;
1440
2835
  payload: SimpleError;
1441
2836
  }>;
2837
+ declare type CreateTableResponse = {
2838
+ branchName: string;
2839
+ /**
2840
+ * @minLength 1
2841
+ */
2842
+ tableName: string;
2843
+ };
1442
2844
  declare type CreateTableVariables = {
1443
2845
  pathParams: CreateTablePathParams;
1444
2846
  } & FetcherExtraProps;
1445
2847
  /**
1446
2848
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1447
2849
  */
1448
- declare const createTable: (variables: CreateTableVariables) => Promise<undefined>;
2850
+ declare const createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
1449
2851
  declare type DeleteTablePathParams = {
2852
+ /**
2853
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2854
+ */
1450
2855
  dbBranchName: DBBranchName;
2856
+ /**
2857
+ * The Table name
2858
+ */
1451
2859
  tableName: TableName;
1452
2860
  workspace: string;
1453
2861
  };
@@ -1464,9 +2872,15 @@ declare type DeleteTableVariables = {
1464
2872
  /**
1465
2873
  * Deletes the table with the given name.
1466
2874
  */
1467
- declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2875
+ declare const deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
1468
2876
  declare type UpdateTablePathParams = {
2877
+ /**
2878
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2879
+ */
1469
2880
  dbBranchName: DBBranchName;
2881
+ /**
2882
+ * The Table name
2883
+ */
1470
2884
  tableName: TableName;
1471
2885
  workspace: string;
1472
2886
  };
@@ -1481,6 +2895,9 @@ declare type UpdateTableError = ErrorWrapper<{
1481
2895
  payload: SimpleError;
1482
2896
  }>;
1483
2897
  declare type UpdateTableRequestBody = {
2898
+ /**
2899
+ * @minLength 1
2900
+ */
1484
2901
  name: string;
1485
2902
  };
1486
2903
  declare type UpdateTableVariables = {
@@ -1500,9 +2917,15 @@ declare type UpdateTableVariables = {
1500
2917
  * }
1501
2918
  * ```
1502
2919
  */
1503
- declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2920
+ declare const updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
1504
2921
  declare type GetTableSchemaPathParams = {
2922
+ /**
2923
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2924
+ */
1505
2925
  dbBranchName: DBBranchName;
2926
+ /**
2927
+ * The Table name
2928
+ */
1506
2929
  tableName: TableName;
1507
2930
  workspace: string;
1508
2931
  };
@@ -1522,9 +2945,15 @@ declare type GetTableSchemaResponse = {
1522
2945
  declare type GetTableSchemaVariables = {
1523
2946
  pathParams: GetTableSchemaPathParams;
1524
2947
  } & FetcherExtraProps;
1525
- declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
2948
+ declare const getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
1526
2949
  declare type SetTableSchemaPathParams = {
2950
+ /**
2951
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2952
+ */
1527
2953
  dbBranchName: DBBranchName;
2954
+ /**
2955
+ * The Table name
2956
+ */
1528
2957
  tableName: TableName;
1529
2958
  workspace: string;
1530
2959
  };
@@ -1548,9 +2977,15 @@ declare type SetTableSchemaVariables = {
1548
2977
  body: SetTableSchemaRequestBody;
1549
2978
  pathParams: SetTableSchemaPathParams;
1550
2979
  } & FetcherExtraProps;
1551
- declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
2980
+ declare const setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
1552
2981
  declare type GetTableColumnsPathParams = {
2982
+ /**
2983
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2984
+ */
1553
2985
  dbBranchName: DBBranchName;
2986
+ /**
2987
+ * The Table name
2988
+ */
1554
2989
  tableName: TableName;
1555
2990
  workspace: string;
1556
2991
  };
@@ -1574,9 +3009,15 @@ declare type GetTableColumnsVariables = {
1574
3009
  * Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
1575
3010
  * full dot-separated path (flattened).
1576
3011
  */
1577
- declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
3012
+ declare const getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
1578
3013
  declare type AddTableColumnPathParams = {
3014
+ /**
3015
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3016
+ */
1579
3017
  dbBranchName: DBBranchName;
3018
+ /**
3019
+ * The Table name
3020
+ */
1580
3021
  tableName: TableName;
1581
3022
  workspace: string;
1582
3023
  };
@@ -1599,10 +3040,19 @@ declare type AddTableColumnVariables = {
1599
3040
  * contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
1600
3041
  * passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
1601
3042
  */
1602
- declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
3043
+ declare const addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
1603
3044
  declare type GetColumnPathParams = {
3045
+ /**
3046
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3047
+ */
1604
3048
  dbBranchName: DBBranchName;
3049
+ /**
3050
+ * The Table name
3051
+ */
1605
3052
  tableName: TableName;
3053
+ /**
3054
+ * The Column name
3055
+ */
1606
3056
  columnName: ColumnName;
1607
3057
  workspace: string;
1608
3058
  };
@@ -1622,10 +3072,19 @@ declare type GetColumnVariables = {
1622
3072
  /**
1623
3073
  * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1624
3074
  */
1625
- declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
3075
+ declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
1626
3076
  declare type DeleteColumnPathParams = {
3077
+ /**
3078
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3079
+ */
1627
3080
  dbBranchName: DBBranchName;
3081
+ /**
3082
+ * The Table name
3083
+ */
1628
3084
  tableName: TableName;
3085
+ /**
3086
+ * The Column name
3087
+ */
1629
3088
  columnName: ColumnName;
1630
3089
  workspace: string;
1631
3090
  };
@@ -1645,10 +3104,19 @@ declare type DeleteColumnVariables = {
1645
3104
  /**
1646
3105
  * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1647
3106
  */
1648
- declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
3107
+ declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
1649
3108
  declare type UpdateColumnPathParams = {
3109
+ /**
3110
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3111
+ */
1650
3112
  dbBranchName: DBBranchName;
3113
+ /**
3114
+ * The Table name
3115
+ */
1651
3116
  tableName: TableName;
3117
+ /**
3118
+ * The Column name
3119
+ */
1652
3120
  columnName: ColumnName;
1653
3121
  workspace: string;
1654
3122
  };
@@ -1663,6 +3131,9 @@ declare type UpdateColumnError = ErrorWrapper<{
1663
3131
  payload: SimpleError;
1664
3132
  }>;
1665
3133
  declare type UpdateColumnRequestBody = {
3134
+ /**
3135
+ * @minLength 1
3136
+ */
1666
3137
  name: string;
1667
3138
  };
1668
3139
  declare type UpdateColumnVariables = {
@@ -1672,12 +3143,24 @@ declare type UpdateColumnVariables = {
1672
3143
  /**
1673
3144
  * Update column with partial data. Can be used for renaming the column by providing a new "name" field. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1674
3145
  */
1675
- declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
3146
+ declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
1676
3147
  declare type InsertRecordPathParams = {
3148
+ /**
3149
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3150
+ */
1677
3151
  dbBranchName: DBBranchName;
3152
+ /**
3153
+ * The Table name
3154
+ */
1678
3155
  tableName: TableName;
1679
3156
  workspace: string;
1680
3157
  };
3158
+ declare type InsertRecordQueryParams = {
3159
+ /**
3160
+ * Column filters
3161
+ */
3162
+ columns?: ColumnsProjection;
3163
+ };
1681
3164
  declare type InsertRecordError = ErrorWrapper<{
1682
3165
  status: 400;
1683
3166
  payload: BadRequestError;
@@ -1688,27 +3171,35 @@ declare type InsertRecordError = ErrorWrapper<{
1688
3171
  status: 404;
1689
3172
  payload: SimpleError;
1690
3173
  }>;
1691
- declare type InsertRecordResponse = {
1692
- id: string;
1693
- xata: {
1694
- version: number;
1695
- };
1696
- };
1697
3174
  declare type InsertRecordVariables = {
1698
3175
  body?: Record<string, any>;
1699
3176
  pathParams: InsertRecordPathParams;
3177
+ queryParams?: InsertRecordQueryParams;
1700
3178
  } & FetcherExtraProps;
1701
3179
  /**
1702
3180
  * Insert a new Record into the Table
1703
3181
  */
1704
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
3182
+ declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1705
3183
  declare type InsertRecordWithIDPathParams = {
3184
+ /**
3185
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3186
+ */
1706
3187
  dbBranchName: DBBranchName;
3188
+ /**
3189
+ * The Table name
3190
+ */
1707
3191
  tableName: TableName;
3192
+ /**
3193
+ * The Record name
3194
+ */
1708
3195
  recordId: RecordID;
1709
3196
  workspace: string;
1710
3197
  };
1711
3198
  declare type InsertRecordWithIDQueryParams = {
3199
+ /**
3200
+ * Column filters
3201
+ */
3202
+ columns?: ColumnsProjection;
1712
3203
  createOnly?: boolean;
1713
3204
  ifVersion?: number;
1714
3205
  };
@@ -1733,14 +3224,27 @@ declare type InsertRecordWithIDVariables = {
1733
3224
  /**
1734
3225
  * By default, IDs are auto-generated when data is insterted into Xata. Sending a request to this endpoint allows us to insert a record with a pre-existing ID, bypassing the default automatic ID generation.
1735
3226
  */
1736
- declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
3227
+ declare const insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1737
3228
  declare type UpdateRecordWithIDPathParams = {
3229
+ /**
3230
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3231
+ */
1738
3232
  dbBranchName: DBBranchName;
3233
+ /**
3234
+ * The Table name
3235
+ */
1739
3236
  tableName: TableName;
3237
+ /**
3238
+ * The Record name
3239
+ */
1740
3240
  recordId: RecordID;
1741
3241
  workspace: string;
1742
3242
  };
1743
3243
  declare type UpdateRecordWithIDQueryParams = {
3244
+ /**
3245
+ * Column filters
3246
+ */
3247
+ columns?: ColumnsProjection;
1744
3248
  ifVersion?: number;
1745
3249
  };
1746
3250
  declare type UpdateRecordWithIDError = ErrorWrapper<{
@@ -1761,14 +3265,27 @@ declare type UpdateRecordWithIDVariables = {
1761
3265
  pathParams: UpdateRecordWithIDPathParams;
1762
3266
  queryParams?: UpdateRecordWithIDQueryParams;
1763
3267
  } & FetcherExtraProps;
1764
- declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
3268
+ declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1765
3269
  declare type UpsertRecordWithIDPathParams = {
3270
+ /**
3271
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3272
+ */
1766
3273
  dbBranchName: DBBranchName;
3274
+ /**
3275
+ * The Table name
3276
+ */
1767
3277
  tableName: TableName;
3278
+ /**
3279
+ * The Record name
3280
+ */
1768
3281
  recordId: RecordID;
1769
3282
  workspace: string;
1770
3283
  };
1771
3284
  declare type UpsertRecordWithIDQueryParams = {
3285
+ /**
3286
+ * Column filters
3287
+ */
3288
+ columns?: ColumnsProjection;
1772
3289
  ifVersion?: number;
1773
3290
  };
1774
3291
  declare type UpsertRecordWithIDError = ErrorWrapper<{
@@ -1789,13 +3306,28 @@ declare type UpsertRecordWithIDVariables = {
1789
3306
  pathParams: UpsertRecordWithIDPathParams;
1790
3307
  queryParams?: UpsertRecordWithIDQueryParams;
1791
3308
  } & FetcherExtraProps;
1792
- declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
3309
+ declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1793
3310
  declare type DeleteRecordPathParams = {
3311
+ /**
3312
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3313
+ */
1794
3314
  dbBranchName: DBBranchName;
3315
+ /**
3316
+ * The Table name
3317
+ */
1795
3318
  tableName: TableName;
3319
+ /**
3320
+ * The Record name
3321
+ */
1796
3322
  recordId: RecordID;
1797
3323
  workspace: string;
1798
3324
  };
3325
+ declare type DeleteRecordQueryParams = {
3326
+ /**
3327
+ * Column filters
3328
+ */
3329
+ columns?: ColumnsProjection;
3330
+ };
1799
3331
  declare type DeleteRecordError = ErrorWrapper<{
1800
3332
  status: 400;
1801
3333
  payload: BadRequestError;
@@ -1808,14 +3340,30 @@ declare type DeleteRecordError = ErrorWrapper<{
1808
3340
  }>;
1809
3341
  declare type DeleteRecordVariables = {
1810
3342
  pathParams: DeleteRecordPathParams;
3343
+ queryParams?: DeleteRecordQueryParams;
1811
3344
  } & FetcherExtraProps;
1812
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
3345
+ declare const deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
1813
3346
  declare type GetRecordPathParams = {
3347
+ /**
3348
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3349
+ */
1814
3350
  dbBranchName: DBBranchName;
3351
+ /**
3352
+ * The Table name
3353
+ */
1815
3354
  tableName: TableName;
3355
+ /**
3356
+ * The Record name
3357
+ */
1816
3358
  recordId: RecordID;
1817
3359
  workspace: string;
1818
3360
  };
3361
+ declare type GetRecordQueryParams = {
3362
+ /**
3363
+ * Column filters
3364
+ */
3365
+ columns?: ColumnsProjection;
3366
+ };
1819
3367
  declare type GetRecordError = ErrorWrapper<{
1820
3368
  status: 400;
1821
3369
  payload: BadRequestError;
@@ -1826,22 +3374,31 @@ declare type GetRecordError = ErrorWrapper<{
1826
3374
  status: 404;
1827
3375
  payload: SimpleError;
1828
3376
  }>;
1829
- declare type GetRecordRequestBody = {
1830
- columns?: ColumnsFilter;
1831
- };
1832
3377
  declare type GetRecordVariables = {
1833
- body?: GetRecordRequestBody;
1834
3378
  pathParams: GetRecordPathParams;
3379
+ queryParams?: GetRecordQueryParams;
1835
3380
  } & FetcherExtraProps;
1836
3381
  /**
1837
3382
  * Retrieve record by ID
1838
3383
  */
1839
- declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
3384
+ declare const getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
1840
3385
  declare type BulkInsertTableRecordsPathParams = {
3386
+ /**
3387
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3388
+ */
1841
3389
  dbBranchName: DBBranchName;
3390
+ /**
3391
+ * The Table name
3392
+ */
1842
3393
  tableName: TableName;
1843
3394
  workspace: string;
1844
3395
  };
3396
+ declare type BulkInsertTableRecordsQueryParams = {
3397
+ /**
3398
+ * Column filters
3399
+ */
3400
+ columns?: ColumnsProjection;
3401
+ };
1845
3402
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
1846
3403
  status: 400;
1847
3404
  payload: BulkError;
@@ -1851,23 +3408,30 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
1851
3408
  } | {
1852
3409
  status: 404;
1853
3410
  payload: SimpleError;
3411
+ } | {
3412
+ status: 422;
3413
+ payload: SimpleError;
1854
3414
  }>;
1855
- declare type BulkInsertTableRecordsResponse = {
1856
- recordIDs: string[];
1857
- };
1858
3415
  declare type BulkInsertTableRecordsRequestBody = {
1859
3416
  records: Record<string, any>[];
1860
3417
  };
1861
3418
  declare type BulkInsertTableRecordsVariables = {
1862
3419
  body: BulkInsertTableRecordsRequestBody;
1863
3420
  pathParams: BulkInsertTableRecordsPathParams;
3421
+ queryParams?: BulkInsertTableRecordsQueryParams;
1864
3422
  } & FetcherExtraProps;
1865
3423
  /**
1866
3424
  * Bulk insert records
1867
3425
  */
1868
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
3426
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
1869
3427
  declare type QueryTablePathParams = {
3428
+ /**
3429
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3430
+ */
1870
3431
  dbBranchName: DBBranchName;
3432
+ /**
3433
+ * The Table name
3434
+ */
1871
3435
  tableName: TableName;
1872
3436
  workspace: string;
1873
3437
  };
@@ -1885,7 +3449,7 @@ declare type QueryTableRequestBody = {
1885
3449
  filter?: FilterExpression;
1886
3450
  sort?: SortExpression;
1887
3451
  page?: PageConfig;
1888
- columns?: ColumnsFilter;
3452
+ columns?: ColumnsProjection;
1889
3453
  };
1890
3454
  declare type QueryTableVariables = {
1891
3455
  body?: QueryTableRequestBody;
@@ -1921,8 +3485,9 @@ declare type QueryTableVariables = {
1921
3485
  * If the `columns` array is not specified, all columns are included. For link
1922
3486
  * fields, only the ID column of the linked records is included in the response.
1923
3487
  *
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
3488
+ * If the `columns` array is specified, only the selected and internal
3489
+ * columns `id` and `xata` are included. The `*` wildcard can be used to
3490
+ * select all columns.
1926
3491
  *
1927
3492
  * For objects and link fields, if the column name of the object is specified, we
1928
3493
  * include all of its sub-keys. If only some sub-keys are specified (via dotted
@@ -2038,6 +3603,10 @@ declare type QueryTableVariables = {
2038
3603
  *
2039
3604
  * ```json
2040
3605
  * {
3606
+ * "id": "id1"
3607
+ * "xata": {
3608
+ * "version": 0
3609
+ * }
2041
3610
  * "name": "Kilian",
2042
3611
  * "address": {
2043
3612
  * "street": "New street"
@@ -2057,6 +3626,10 @@ declare type QueryTableVariables = {
2057
3626
  *
2058
3627
  * ```json
2059
3628
  * {
3629
+ * "id": "id1"
3630
+ * "xata": {
3631
+ * "version": 0
3632
+ * }
2060
3633
  * "name": "Kilian",
2061
3634
  * "email": "kilian@gmail.com",
2062
3635
  * "address": {
@@ -2086,6 +3659,10 @@ declare type QueryTableVariables = {
2086
3659
  *
2087
3660
  * ```json
2088
3661
  * {
3662
+ * "id": "id1"
3663
+ * "xata": {
3664
+ * "version": 0
3665
+ * }
2089
3666
  * "name": "Kilian",
2090
3667
  * "email": "kilian@gmail.com",
2091
3668
  * "address": {
@@ -2512,8 +4089,8 @@ declare type QueryTableVariables = {
2512
4089
  *
2513
4090
  * ### Pagination
2514
4091
  *
2515
- * We offer cursor pagination and offset pagination. The offset pagination is limited
2516
- * in the amount of data it can retrieve, so we recommend the cursor pagination if you have more than 1000 records.
4092
+ * We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
4093
+ * cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
2517
4094
  *
2518
4095
  * Example of size + offset pagination:
2519
4096
  *
@@ -2612,9 +4189,15 @@ declare type QueryTableVariables = {
2612
4189
  * }
2613
4190
  * ```
2614
4191
  */
2615
- declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
4192
+ declare const queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
2616
4193
  declare type SearchTablePathParams = {
4194
+ /**
4195
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4196
+ */
2617
4197
  dbBranchName: DBBranchName;
4198
+ /**
4199
+ * The Table name
4200
+ */
2618
4201
  tableName: TableName;
2619
4202
  workspace: string;
2620
4203
  };
@@ -2629,11 +4212,18 @@ declare type SearchTableError = ErrorWrapper<{
2629
4212
  payload: SimpleError;
2630
4213
  }>;
2631
4214
  declare type SearchTableRequestBody = {
4215
+ /**
4216
+ * The query string.
4217
+ *
4218
+ * @minLength 1
4219
+ */
2632
4220
  query: string;
2633
4221
  fuzziness?: FuzzinessExpression;
4222
+ target?: TargetExpression;
2634
4223
  prefix?: PrefixExpression;
2635
4224
  filter?: FilterExpression;
2636
4225
  highlight?: HighlightExpression;
4226
+ boosters?: BoosterExpression[];
2637
4227
  };
2638
4228
  declare type SearchTableVariables = {
2639
4229
  body: SearchTableRequestBody;
@@ -2646,8 +4236,11 @@ declare type SearchTableVariables = {
2646
4236
  * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
2647
4237
  * * filtering on columns of type `multiple` is currently unsupported
2648
4238
  */
2649
- declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
4239
+ declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
2650
4240
  declare type SearchBranchPathParams = {
4241
+ /**
4242
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4243
+ */
2651
4244
  dbBranchName: DBBranchName;
2652
4245
  workspace: string;
2653
4246
  };
@@ -2662,12 +4255,26 @@ declare type SearchBranchError = ErrorWrapper<{
2662
4255
  payload: SimpleError;
2663
4256
  }>;
2664
4257
  declare type SearchBranchRequestBody = {
4258
+ /**
4259
+ * 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.
4260
+ */
2665
4261
  tables?: (string | {
4262
+ /**
4263
+ * The name of the table.
4264
+ */
2666
4265
  table: string;
2667
4266
  filter?: FilterExpression;
4267
+ target?: TargetExpression;
4268
+ boosters?: BoosterExpression[];
2668
4269
  })[];
4270
+ /**
4271
+ * The query string.
4272
+ *
4273
+ * @minLength 1
4274
+ */
2669
4275
  query: string;
2670
4276
  fuzziness?: FuzzinessExpression;
4277
+ prefix?: PrefixExpression;
2671
4278
  highlight?: HighlightExpression;
2672
4279
  };
2673
4280
  declare type SearchBranchVariables = {
@@ -2677,74 +4284,391 @@ declare type SearchBranchVariables = {
2677
4284
  /**
2678
4285
  * Run a free text search operation across the database branch.
2679
4286
  */
2680
- declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
4287
+ declare const searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4288
+ declare type SummarizeTablePathParams = {
4289
+ /**
4290
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4291
+ */
4292
+ dbBranchName: DBBranchName;
4293
+ /**
4294
+ * The Table name
4295
+ */
4296
+ tableName: TableName;
4297
+ workspace: string;
4298
+ };
4299
+ declare type SummarizeTableError = ErrorWrapper<{
4300
+ status: 400;
4301
+ payload: BadRequestError;
4302
+ } | {
4303
+ status: 401;
4304
+ payload: AuthError;
4305
+ } | {
4306
+ status: 404;
4307
+ payload: SimpleError;
4308
+ }>;
4309
+ declare type SummarizeTableRequestBody = {
4310
+ filters?: FilterExpression;
4311
+ columns?: ColumnsProjection;
4312
+ summaries?: SummaryExpressionList;
4313
+ sort?: SortExpression;
4314
+ summariesFilter?: FilterExpression;
4315
+ };
4316
+ declare type SummarizeTableVariables = {
4317
+ body?: SummarizeTableRequestBody;
4318
+ pathParams: SummarizeTablePathParams;
4319
+ } & FetcherExtraProps;
4320
+ /**
4321
+ * This endpoint allows you to (optionally) define groups, and then to run
4322
+ * calculations on the values in each group. This is most helpful when
4323
+ * you'd like to understand the data you have in your database.
4324
+ *
4325
+ * A group is a combination of unique values. If you create a group for
4326
+ * `sold_by`, `product_name`, we will return one row for every combination
4327
+ * of `sold_by` and `product_name` you have in your database. When you
4328
+ * want to calculate statistics, you define these groups and ask Xata to
4329
+ * calculate data on each group.
4330
+ *
4331
+ * **Some questions you can ask of your data:**
4332
+ *
4333
+ * How many records do I have in this table?
4334
+ * - Set `columns: []` as we we want data from the entire table, so we ask
4335
+ * for no groups.
4336
+ * - Set `summaries: {"total": {"count": "*"}}` in order to see the count
4337
+ * of all records. We use `count: *` here we'd like to know the total
4338
+ * amount of rows; ignoring whether they are `null` or not.
4339
+ *
4340
+ * What are the top total sales for each product in July 2022 and sold
4341
+ * more than 10 units?
4342
+ * - Set `filter: {soldAt: {
4343
+ * "$ge": "2022-07-01T00:00:00.000Z",
4344
+ * "$lt": "2022-08-01T00:00:00.000Z"}
4345
+ * }`
4346
+ * in order to limit the result set to sales recorded in July 2022.
4347
+ * - Set `columns: [product_name]` as we'd like to run calculations on
4348
+ * each unique product name in our table. Setting `columns` like this will
4349
+ * produce one row per unique product name.
4350
+ * - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd
4351
+ * like to create a field called "total_sales" for each group. This field
4352
+ * will count all rows in each group with non-null product names.
4353
+ * - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with
4354
+ * the highest total_sales field to the top.
4355
+ * - Set `summariesFilters: {"total_sales": {"$ge": 10}}` to only send back data
4356
+ * with greater than or equal to 10 units.
4357
+ *
4358
+ * `columns`: tells Xata how to create each group. If you add `product_id`
4359
+ * we will create a new group for every unique `product_id`.
4360
+ *
4361
+ * `summaries`: tells Xata which calculations to run on each group.
4362
+ *
4363
+ * `sort`: tells Xata in which order you'd like to see results. You may
4364
+ * sort by fields specified in `columns` as well as the summary names
4365
+ * defined in `summaries`.
4366
+ *
4367
+ * note: Sorting on summarized values can be slower on very large tables;
4368
+ * this will impact your rate limit significantly more than other queries.
4369
+ * Try use `filter` [coming soon] to reduce the amount of data being
4370
+ * processed in order to reduce impact on your limits.
4371
+ *
4372
+ * `summariesFilter`: tells Xata how to filter the results of a summary.
4373
+ * It has the same syntax as `filter`, however, by using `summariesFilter`
4374
+ * you may also filter on the results of a query.
4375
+ *
4376
+ * note: This is a much slower to use than `filter`. We recommend using
4377
+ * `filter` wherever possible and `summariesFilter` when it's not
4378
+ * possible to use `filter`.
4379
+ */
4380
+ declare const summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
4381
+ declare type AggregateTablePathParams = {
4382
+ /**
4383
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4384
+ */
4385
+ dbBranchName: DBBranchName;
4386
+ /**
4387
+ * The Table name
4388
+ */
4389
+ tableName: TableName;
4390
+ workspace: string;
4391
+ };
4392
+ declare type AggregateTableError = ErrorWrapper<{
4393
+ status: 400;
4394
+ payload: BadRequestError;
4395
+ } | {
4396
+ status: 401;
4397
+ payload: AuthError;
4398
+ } | {
4399
+ status: 404;
4400
+ payload: SimpleError;
4401
+ }>;
4402
+ declare type AggregateTableRequestBody = {
4403
+ filter?: FilterExpression;
4404
+ aggs?: AggExpressionMap;
4405
+ };
4406
+ declare type AggregateTableVariables = {
4407
+ body?: AggregateTableRequestBody;
4408
+ pathParams: AggregateTablePathParams;
4409
+ } & FetcherExtraProps;
4410
+ /**
4411
+ * This endpoint allows you to run aggragations (analytics) on the data from one table.
4412
+ * While the summary endpoint is served from a transactional store and the results are strongly
4413
+ * consistent, the aggregate endpoint is served from our columnar store and the results are
4414
+ * only eventually consistent. On the other hand, the aggregate endpoint uses a
4415
+ * store that is more appropiate for analytics, makes use of approximative algorithms
4416
+ * (e.g for cardinality), and is generally faster and can do more complex aggregations.
4417
+ */
4418
+ declare const aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
4419
+ declare type CPGetDatabaseListPathParams = {
4420
+ /**
4421
+ * Workspace ID
4422
+ */
4423
+ workspaceId: WorkspaceID;
4424
+ };
4425
+ declare type CPGetDatabaseListError = ErrorWrapper<{
4426
+ status: 400;
4427
+ payload: BadRequestError;
4428
+ } | {
4429
+ status: 401;
4430
+ payload: AuthError;
4431
+ }>;
4432
+ declare type CPGetDatabaseListVariables = {
4433
+ pathParams: CPGetDatabaseListPathParams;
4434
+ } & FetcherExtraProps;
4435
+ /**
4436
+ * List all databases available in your Workspace.
4437
+ */
4438
+ declare const cPGetDatabaseList: (variables: CPGetDatabaseListVariables, signal?: AbortSignal) => Promise<CPListDatabasesResponse>;
4439
+ declare type CPCreateDatabasePathParams = {
4440
+ /**
4441
+ * Workspace ID
4442
+ */
4443
+ workspaceId: WorkspaceID;
4444
+ /**
4445
+ * The Database Name
4446
+ */
4447
+ dbName: DBName;
4448
+ };
4449
+ declare type CPCreateDatabaseError = ErrorWrapper<{
4450
+ status: 400;
4451
+ payload: BadRequestError;
4452
+ } | {
4453
+ status: 401;
4454
+ payload: AuthError;
4455
+ }>;
4456
+ declare type CPCreateDatabaseResponse = {
4457
+ /**
4458
+ * @minLength 1
4459
+ */
4460
+ databaseName?: string;
4461
+ branchName?: string;
4462
+ };
4463
+ declare type CPCreateDatabaseRequestBody = {
4464
+ /**
4465
+ * @minLength 1
4466
+ */
4467
+ branchName?: string;
4468
+ /**
4469
+ * @minLength 1
4470
+ */
4471
+ region: string;
4472
+ ui?: {
4473
+ color?: string;
4474
+ };
4475
+ metadata?: BranchMetadata;
4476
+ };
4477
+ declare type CPCreateDatabaseVariables = {
4478
+ body: CPCreateDatabaseRequestBody;
4479
+ pathParams: CPCreateDatabasePathParams;
4480
+ } & FetcherExtraProps;
4481
+ /**
4482
+ * Create Database with identifier name
4483
+ */
4484
+ declare const cPCreateDatabase: (variables: CPCreateDatabaseVariables, signal?: AbortSignal) => Promise<CPCreateDatabaseResponse>;
4485
+ declare type CPDeleteDatabasePathParams = {
4486
+ /**
4487
+ * Workspace ID
4488
+ */
4489
+ workspaceId: WorkspaceID;
4490
+ /**
4491
+ * The Database Name
4492
+ */
4493
+ dbName: DBName;
4494
+ };
4495
+ declare type CPDeleteDatabaseError = ErrorWrapper<{
4496
+ status: 400;
4497
+ payload: BadRequestError;
4498
+ } | {
4499
+ status: 401;
4500
+ payload: AuthError;
4501
+ } | {
4502
+ status: 404;
4503
+ payload: SimpleError;
4504
+ }>;
4505
+ declare type CPDeleteDatabaseVariables = {
4506
+ pathParams: CPDeleteDatabasePathParams;
4507
+ } & FetcherExtraProps;
4508
+ /**
4509
+ * Delete a database and all of its branches and tables permanently.
4510
+ */
4511
+ declare const cPDeleteDatabase: (variables: CPDeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
4512
+ declare type CPGetCPDatabaseMetadataPathParams = {
4513
+ /**
4514
+ * Workspace ID
4515
+ */
4516
+ workspaceId: WorkspaceID;
4517
+ /**
4518
+ * The Database Name
4519
+ */
4520
+ dbName: DBName;
4521
+ };
4522
+ declare type CPGetCPDatabaseMetadataError = ErrorWrapper<{
4523
+ status: 400;
4524
+ payload: BadRequestError;
4525
+ } | {
4526
+ status: 401;
4527
+ payload: AuthError;
4528
+ } | {
4529
+ status: 404;
4530
+ payload: SimpleError;
4531
+ }>;
4532
+ declare type CPGetCPDatabaseMetadataVariables = {
4533
+ pathParams: CPGetCPDatabaseMetadataPathParams;
4534
+ } & FetcherExtraProps;
4535
+ /**
4536
+ * Retrieve metadata of the given database
4537
+ */
4538
+ declare const cPGetCPDatabaseMetadata: (variables: CPGetCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
4539
+ declare type CPUpdateCPDatabaseMetadataPathParams = {
4540
+ /**
4541
+ * Workspace ID
4542
+ */
4543
+ workspaceId: WorkspaceID;
4544
+ /**
4545
+ * The Database Name
4546
+ */
4547
+ dbName: DBName;
4548
+ };
4549
+ declare type CPUpdateCPDatabaseMetadataError = ErrorWrapper<{
4550
+ status: 400;
4551
+ payload: BadRequestError;
4552
+ } | {
4553
+ status: 401;
4554
+ payload: AuthError;
4555
+ } | {
4556
+ status: 404;
4557
+ payload: SimpleError;
4558
+ }>;
4559
+ declare type CPUpdateCPDatabaseMetadataRequestBody = {
4560
+ ui?: {
4561
+ /**
4562
+ * @minLength 1
4563
+ */
4564
+ color?: string;
4565
+ };
4566
+ };
4567
+ declare type CPUpdateCPDatabaseMetadataVariables = {
4568
+ body?: CPUpdateCPDatabaseMetadataRequestBody;
4569
+ pathParams: CPUpdateCPDatabaseMetadataPathParams;
4570
+ } & FetcherExtraProps;
4571
+ /**
4572
+ * Update the color of the selected database
4573
+ */
4574
+ declare const cPUpdateCPDatabaseMetadata: (variables: CPUpdateCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
2681
4575
  declare const operationsByTag: {
2682
4576
  users: {
2683
- getUser: (variables: GetUserVariables) => Promise<UserWithID>;
2684
- updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
2685
- deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
2686
- getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
2687
- createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
2688
- deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
4577
+ getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
4578
+ updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
4579
+ deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
4580
+ getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
4581
+ createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
4582
+ deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
2689
4583
  };
2690
4584
  workspaces: {
2691
- createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
2692
- getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
2693
- getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
2694
- updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
2695
- deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
2696
- getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
2697
- updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2698
- removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2699
- inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
2700
- cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2701
- resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2702
- acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
4585
+ createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
4586
+ getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
4587
+ getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
4588
+ updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
4589
+ deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
4590
+ getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
4591
+ updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
4592
+ removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
4593
+ inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
4594
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
4595
+ cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
4596
+ resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
4597
+ acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
2703
4598
  };
2704
4599
  database: {
2705
- getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2706
- createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2707
- deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
2708
- getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
2709
- addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2710
- removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
2711
- resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
4600
+ getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
4601
+ createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
4602
+ deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
4603
+ getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
4604
+ updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
4605
+ getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
4606
+ addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
4607
+ removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
4608
+ resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
2712
4609
  };
2713
4610
  branch: {
2714
- getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2715
- getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2716
- createBranch: (variables: CreateBranchVariables) => Promise<undefined>;
2717
- deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2718
- updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2719
- getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
2720
- getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2721
- executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2722
- getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2723
- getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
4611
+ getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
4612
+ getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
4613
+ createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
4614
+ deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
4615
+ updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
4616
+ getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
4617
+ getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
4618
+ };
4619
+ migrationRequests: {
4620
+ queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
4621
+ createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
4622
+ getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
4623
+ updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
4624
+ listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
4625
+ compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
4626
+ getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
4627
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
4628
+ };
4629
+ branchSchema: {
4630
+ getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
4631
+ executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
4632
+ getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
4633
+ compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
4634
+ compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
4635
+ updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
4636
+ previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
4637
+ applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
4638
+ getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
2724
4639
  };
2725
4640
  table: {
2726
- createTable: (variables: CreateTableVariables) => Promise<undefined>;
2727
- deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2728
- updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2729
- getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
2730
- setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
2731
- getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
2732
- addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
2733
- getColumn: (variables: GetColumnVariables) => Promise<Column>;
2734
- deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
2735
- updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
4641
+ createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
4642
+ deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
4643
+ updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
4644
+ getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
4645
+ setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
4646
+ getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
4647
+ addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
4648
+ getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
4649
+ deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
4650
+ updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
2736
4651
  };
2737
4652
  records: {
2738
- insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>;
2739
- insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2740
- updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2741
- upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2742
- deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>;
2743
- getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2744
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>;
2745
- queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2746
- searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2747
- searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
4653
+ insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4654
+ insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4655
+ updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4656
+ upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4657
+ deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
4658
+ getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
4659
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
4660
+ queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
4661
+ searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4662
+ searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4663
+ summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
4664
+ aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
4665
+ };
4666
+ databases: {
4667
+ cPGetDatabaseList: (variables: CPGetDatabaseListVariables, signal?: AbortSignal) => Promise<CPListDatabasesResponse>;
4668
+ cPCreateDatabase: (variables: CPCreateDatabaseVariables, signal?: AbortSignal) => Promise<CPCreateDatabaseResponse>;
4669
+ cPDeleteDatabase: (variables: CPDeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
4670
+ cPGetCPDatabaseMetadata: (variables: CPGetCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
4671
+ cPUpdateCPDatabaseMetadata: (variables: CPUpdateCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
2748
4672
  };
2749
4673
  };
2750
4674
 
@@ -2754,15 +4678,17 @@ declare type ProviderBuilder = {
2754
4678
  workspaces: string;
2755
4679
  };
2756
4680
  declare type HostProvider = HostAliases | ProviderBuilder;
4681
+ declare function getHostUrl(provider: HostProvider, type: keyof ProviderBuilder): string;
4682
+ declare function isHostProviderAlias(alias: HostProvider | string): alias is HostAliases;
4683
+ declare function isHostProviderBuilder(builder: HostProvider): builder is ProviderBuilder;
4684
+ declare function parseProviderString(provider?: string): HostProvider | null;
2757
4685
 
2758
4686
  interface XataApiClientOptions {
2759
4687
  fetch?: FetchImpl;
2760
4688
  apiKey?: string;
2761
4689
  host?: HostProvider;
4690
+ trace?: TraceFunction;
2762
4691
  }
2763
- /**
2764
- * @deprecated Use XataApiPlugin instead
2765
- */
2766
4692
  declare class XataApiClient {
2767
4693
  #private;
2768
4694
  constructor(options?: XataApiClientOptions);
@@ -2772,6 +4698,8 @@ declare class XataApiClient {
2772
4698
  get branches(): BranchApi;
2773
4699
  get tables(): TableApi;
2774
4700
  get records(): RecordsApi;
4701
+ get migrationRequests(): MigrationRequestsApi;
4702
+ get branchSchema(): BranchSchemaApi;
2775
4703
  }
2776
4704
  declare class UserApi {
2777
4705
  private extraProps;
@@ -2795,6 +4723,7 @@ declare class WorkspaceApi {
2795
4723
  updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
2796
4724
  removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
2797
4725
  inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
4726
+ updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
2798
4727
  cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2799
4728
  resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
2800
4729
  acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
@@ -2805,6 +4734,8 @@ declare class DatabaseApi {
2805
4734
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2806
4735
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2807
4736
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
4737
+ getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
4738
+ updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
2808
4739
  getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2809
4740
  addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2810
4741
  removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
@@ -2815,19 +4746,16 @@ declare class BranchApi {
2815
4746
  constructor(extraProps: FetcherExtraProps);
2816
4747
  getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
2817
4748
  getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
2818
- createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<void>;
4749
+ createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
2819
4750
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2820
4751
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2821
4752
  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
4753
  getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
2826
4754
  }
2827
4755
  declare class TableApi {
2828
4756
  private extraProps;
2829
4757
  constructor(extraProps: FetcherExtraProps);
2830
- createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
4758
+ createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
2831
4759
  deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
2832
4760
  updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
2833
4761
  getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
@@ -2841,16 +4769,42 @@ declare class TableApi {
2841
4769
  declare class RecordsApi {
2842
4770
  private extraProps;
2843
4771
  constructor(extraProps: FetcherExtraProps);
2844
- insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>): Promise<InsertRecordResponse>;
4772
+ insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
2845
4773
  insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2846
4774
  updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
2847
4775
  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>;
4776
+ deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
4777
+ getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
4778
+ bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
2851
4779
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2852
4780
  searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2853
4781
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
4782
+ summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
4783
+ }
4784
+ declare class MigrationRequestsApi {
4785
+ private extraProps;
4786
+ constructor(extraProps: FetcherExtraProps);
4787
+ queryMigrationRequests(workspace: WorkspaceID, database: DBName, options?: QueryMigrationRequestsRequestBody): Promise<QueryMigrationRequestsResponse>;
4788
+ createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
4789
+ getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
4790
+ updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
4791
+ listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
4792
+ compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
4793
+ getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
4794
+ mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
4795
+ }
4796
+ declare class BranchSchemaApi {
4797
+ private extraProps;
4798
+ constructor(extraProps: FetcherExtraProps);
4799
+ getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
4800
+ executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
4801
+ getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
4802
+ compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
4803
+ compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
4804
+ updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
4805
+ previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
4806
+ applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
4807
+ getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
2854
4808
  }
2855
4809
 
2856
4810
  declare class XataApiPlugin implements XataPlugin {
@@ -2863,19 +4817,20 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
2863
4817
  declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
2864
4818
  declare type IsObject<T> = T extends Record<string, any> ? true : false;
2865
4819
  declare type IsArray<T> = T extends Array<any> ? true : false;
2866
- declare type NonEmptyArray<T> = T[] & {
2867
- 0: T;
2868
- };
2869
4820
  declare type RequiredBy<T, K extends keyof T> = T & {
2870
4821
  [P in K]-?: NonNullable<T[P]>;
2871
4822
  };
2872
4823
  declare type GetArrayInnerType<T extends readonly any[]> = T[number];
2873
4824
  declare type SingleOrArray<T> = T | T[];
2874
4825
  declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
4826
+ declare type Without<T, U> = {
4827
+ [P in Exclude<keyof T, keyof U>]?: never;
4828
+ };
4829
+ declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
2875
4830
 
2876
4831
  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;
4832
+ declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
4833
+ [K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
2879
4834
  }>>;
2880
4835
  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
4836
  V: ValueAtColumn<Item, V>;
@@ -2911,42 +4866,51 @@ interface BaseData {
2911
4866
  /**
2912
4867
  * Represents a persisted record from the database.
2913
4868
  */
2914
- interface XataRecord<ExtraMetadata extends Record<string, unknown> = Record<string, unknown>> extends Identifiable {
4869
+ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
2915
4870
  /**
2916
4871
  * Get metadata of this record.
2917
4872
  */
2918
- getMetadata(): XataRecordMetadata & ExtraMetadata;
4873
+ getMetadata(): XataRecordMetadata;
2919
4874
  /**
2920
4875
  * Retrieves a refreshed copy of the current record from the database.
4876
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4877
+ * @returns The persisted record with the selected columns, null if not found.
2921
4878
  */
2922
- read(): Promise<Readonly<SelectedPick<this, ['*']>> | null>;
4879
+ read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
4880
+ /**
4881
+ * Retrieves a refreshed copy of the current record from the database.
4882
+ * @returns The persisted record with all first level properties, null if not found.
4883
+ */
4884
+ read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2923
4885
  /**
2924
4886
  * Performs a partial update of the current record. On success a new object is
2925
4887
  * returned and the current object is not mutated.
2926
4888
  * @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.
4889
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4890
+ * @returns The persisted record with the selected columns, null if not found.
2928
4891
  */
2929
- update(partialUpdate: Partial<EditableData<Omit<this, keyof XataRecord>>>): Promise<Readonly<SelectedPick<this, ['*']>>>;
4892
+ update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2930
4893
  /**
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.
4894
+ * Performs a partial update of the current record. On success a new object is
4895
+ * returned and the current object is not mutated.
4896
+ * @param partialUpdate The columns and their values that have to be updated.
4897
+ * @returns The persisted record with all first level properties, null if not found.
2934
4898
  */
2935
- delete(): Promise<void>;
2936
- }
2937
- declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
4899
+ update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
2938
4900
  /**
2939
- * Retrieves a refreshed copy of the current record from the database.
4901
+ * Performs a deletion of the current record in the database.
4902
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4903
+ * @returns The deleted record, null if not found.
2940
4904
  */
2941
- read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
4905
+ delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
2942
4906
  /**
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.
4907
+ * Performs a deletion of the current record in the database.
4908
+ * @returns The deleted record, null if not found.
4909
+
2947
4910
  */
2948
- update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
2949
- };
4911
+ delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
4912
+ }
4913
+ declare type Link<Record extends XataRecord> = XataRecord<Record>;
2950
4914
  declare type XataRecordMetadata = {
2951
4915
  /**
2952
4916
  * Number that is increased every time the record is updated.
@@ -2956,13 +4920,13 @@ declare type XataRecordMetadata = {
2956
4920
  };
2957
4921
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
2958
4922
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
2959
- declare type EditableData<O extends BaseData> = {
4923
+ declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
2960
4924
  [K in keyof O]: O[K] extends XataRecord ? {
2961
4925
  id: string;
2962
4926
  } | string : NonNullable<O[K]> extends XataRecord ? {
2963
4927
  id: string;
2964
4928
  } | string | null | undefined : O[K];
2965
- };
4929
+ }, keyof XataRecord>;
2966
4930
 
2967
4931
  /**
2968
4932
  * PropertyMatchFilter
@@ -3056,7 +5020,101 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
3056
5020
  declare type NestedApiFilter<T> = {
3057
5021
  [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
3058
5022
  };
3059
- declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
5023
+ 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>;
5024
+
5025
+ declare type DateBooster = {
5026
+ origin?: string;
5027
+ scale: string;
5028
+ decay: number;
5029
+ };
5030
+ declare type NumericBooster = {
5031
+ factor: number;
5032
+ };
5033
+ declare type ValueBooster<T extends string | number | boolean> = {
5034
+ value: T;
5035
+ factor: number;
5036
+ };
5037
+ declare type Boosters<O extends XataRecord> = Values<{
5038
+ [K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
5039
+ dateBooster: {
5040
+ column: K;
5041
+ } & DateBooster;
5042
+ } : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
5043
+ numericBooster?: {
5044
+ column: K;
5045
+ } & NumericBooster;
5046
+ }, {
5047
+ valueBooster?: {
5048
+ column: K;
5049
+ } & ValueBooster<number>;
5050
+ }> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
5051
+ valueBooster: {
5052
+ column: K;
5053
+ } & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
5054
+ } : never;
5055
+ }>;
5056
+
5057
+ declare type TargetColumn<T extends XataRecord> = SelectableColumn<T> | {
5058
+ /**
5059
+ * The name of the column.
5060
+ */
5061
+ column: SelectableColumn<T>;
5062
+ /**
5063
+ * The weight of the column.
5064
+ *
5065
+ * @default 1
5066
+ * @maximum 10
5067
+ * @minimum 1
5068
+ */
5069
+ weight?: number;
5070
+ };
5071
+
5072
+ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
5073
+ fuzziness?: FuzzinessExpression;
5074
+ prefix?: PrefixExpression;
5075
+ highlight?: HighlightExpression;
5076
+ tables?: Array<Tables | Values<{
5077
+ [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
5078
+ table: Model;
5079
+ target?: TargetColumn<Schemas[Model] & XataRecord>[];
5080
+ filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
5081
+ boosters?: Boosters<Schemas[Model] & XataRecord>[];
5082
+ };
5083
+ }>>;
5084
+ };
5085
+ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
5086
+ all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
5087
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
5088
+ table: Model;
5089
+ record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
5090
+ };
5091
+ }>[]>;
5092
+ byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
5093
+ [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
5094
+ }>;
5095
+ };
5096
+ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
5097
+ #private;
5098
+ private db;
5099
+ constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
5100
+ build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
5101
+ }
5102
+ declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
5103
+ getMetadata: () => XataRecordMetadata & SearchExtraProperties;
5104
+ };
5105
+ declare type SearchExtraProperties = {
5106
+ table: string;
5107
+ highlight?: {
5108
+ [key: string]: string[] | {
5109
+ [key: string]: any;
5110
+ };
5111
+ };
5112
+ score?: number;
5113
+ };
5114
+ declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
5115
+ 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 {
5116
+ table: infer Table;
5117
+ } ? ReturnTable<Table, Tables> : never;
3060
5118
 
3061
5119
  declare type SortDirection = 'asc' | 'desc';
3062
5120
  declare type SortFilterExtended<T extends XataRecord> = {
@@ -3069,7 +5127,7 @@ declare type SortFilterBase<T extends XataRecord> = {
3069
5127
  };
3070
5128
 
3071
5129
  declare type BaseOptions<T extends XataRecord> = {
3072
- columns?: NonEmptyArray<SelectableColumn<T>>;
5130
+ columns?: SelectableColumn<T>[];
3073
5131
  cache?: number;
3074
5132
  };
3075
5133
  declare type CursorQueryOptions = {
@@ -3093,7 +5151,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3093
5151
  #private;
3094
5152
  readonly meta: PaginationQueryMeta;
3095
5153
  readonly records: RecordArray<Result>;
3096
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
5154
+ constructor(repository: Repository<Record> | null, table: {
5155
+ name: string;
5156
+ schema?: Table;
5157
+ }, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
3097
5158
  getQueryOptions(): QueryOptions<Record>;
3098
5159
  key(): string;
3099
5160
  /**
@@ -3132,7 +5193,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3132
5193
  * @param value The value to filter.
3133
5194
  * @returns A new Query object.
3134
5195
  */
3135
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
5196
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
3136
5197
  /**
3137
5198
  * Builds a new query object adding one or more constraints. Examples:
3138
5199
  *
@@ -3146,20 +5207,20 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3146
5207
  * @param filters A filter object
3147
5208
  * @returns A new Query object.
3148
5209
  */
3149
- filter(filters: Filter<Record>): Query<Record, Result>;
5210
+ filter(filters?: Filter<Record>): Query<Record, Result>;
3150
5211
  /**
3151
5212
  * Builds a new query with a new sort option.
3152
5213
  * @param column The column name.
3153
5214
  * @param direction The direction. Either ascending or descending.
3154
5215
  * @returns A new Query object.
3155
5216
  */
3156
- sort<F extends SelectableColumn<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
5217
+ sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
3157
5218
  /**
3158
5219
  * Builds a new query specifying the set of columns to be returned in the query response.
3159
5220
  * @param columns Array of column names to be returned by the query.
3160
5221
  * @returns A new Query object.
3161
5222
  */
3162
- select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
5223
+ select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
3163
5224
  /**
3164
5225
  * Get paginated results
3165
5226
  *
@@ -3269,6 +5330,26 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3269
5330
  * @returns The first record that matches the query, or null if no record matched the query.
3270
5331
  */
3271
5332
  getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
5333
+ /**
5334
+ * Performs the query in the database and returns the first result.
5335
+ * @returns The first record that matches the query, or null if no record matched the query.
5336
+ * @throws if there are no results.
5337
+ */
5338
+ getFirstOrThrow(): Promise<Result>;
5339
+ /**
5340
+ * Performs the query in the database and returns the first result.
5341
+ * @param options Additional options to be used when performing the query.
5342
+ * @returns The first record that matches the query, or null if no record matched the query.
5343
+ * @throws if there are no results.
5344
+ */
5345
+ getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
5346
+ /**
5347
+ * Performs the query in the database and returns the first result.
5348
+ * @param options Additional options to be used when performing the query.
5349
+ * @returns The first record that matches the query, or null if no record matched the query.
5350
+ * @throws if there are no results.
5351
+ */
5352
+ getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
3272
5353
  /**
3273
5354
  * Builds a new query object adding a cache TTL in milliseconds.
3274
5355
  * @param ttl The cache TTL in milliseconds.
@@ -3390,6 +5471,8 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
3390
5471
  #private;
3391
5472
  constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
3392
5473
  static parseConstructorParams(...args: any[]): any[];
5474
+ toArray(): Result[];
5475
+ map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
3393
5476
  /**
3394
5477
  * Retrieve next page of records
3395
5478
  *
@@ -3423,21 +5506,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
3423
5506
  /**
3424
5507
  * Common interface for performing operations on a table.
3425
5508
  */
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, ['*']>>>;
5509
+ declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
5510
+ abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5511
+ abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5512
+ /**
5513
+ * Creates a single record in the table with a unique id.
5514
+ * @param id The unique id.
5515
+ * @param object Object containing the column names with their values to be stored in the table.
5516
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5517
+ * @returns The full persisted record.
5518
+ */
5519
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3428
5520
  /**
3429
5521
  * Creates a single record in the table with a unique id.
3430
5522
  * @param id The unique id.
3431
5523
  * @param object Object containing the column names with their values to be stored in the table.
3432
5524
  * @returns The full persisted record.
3433
5525
  */
3434
- abstract create(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5526
+ abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3435
5527
  /**
3436
5528
  * Creates multiple records in the table.
3437
5529
  * @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.
5530
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5531
+ * @returns Array of the persisted records in order.
5532
+ */
5533
+ abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5534
+ /**
5535
+ * Creates multiple records in the table.
5536
+ * @param objects Array of objects with the column names and the values to be stored in the table.
5537
+ * @returns Array of the persisted records in order.
3439
5538
  */
3440
- abstract create(objects: Array<EditableData<Data> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5539
+ abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5540
+ /**
5541
+ * Queries a single record from the table given its unique id.
5542
+ * @param id The unique id.
5543
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5544
+ * @returns The persisted record for the given id or null if the record could not be found.
5545
+ */
5546
+ abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3441
5547
  /**
3442
5548
  * Queries a single record from the table given its unique id.
3443
5549
  * @param id The unique id.
@@ -3447,9 +5553,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3447
5553
  /**
3448
5554
  * Queries multiple records from the table given their unique id.
3449
5555
  * @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).
5556
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5557
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5558
+ */
5559
+ abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5560
+ /**
5561
+ * Queries multiple records from the table given their unique id.
5562
+ * @param ids The unique ids array.
5563
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5564
+ */
5565
+ abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5566
+ /**
5567
+ * Queries a single record from the table by the id in the object.
5568
+ * @param object Object containing the id of the record.
5569
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5570
+ * @returns The persisted record for the given id or null if the record could not be found.
3451
5571
  */
3452
- abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5572
+ abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
3453
5573
  /**
3454
5574
  * Queries a single record from the table by the id in the object.
3455
5575
  * @param object Object containing the id of the record.
@@ -3459,35 +5579,188 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3459
5579
  /**
3460
5580
  * Queries multiple records from the table by the ids in the objects.
3461
5581
  * @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).
5582
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5583
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5584
+ */
5585
+ abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5586
+ /**
5587
+ * Queries multiple records from the table by the ids in the objects.
5588
+ * @param objects Array of objects containing the ids of the records.
5589
+ * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
5590
+ */
5591
+ abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5592
+ /**
5593
+ * Queries a single record from the table given its unique id.
5594
+ * @param id The unique id.
5595
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5596
+ * @returns The persisted record for the given id.
5597
+ * @throws If the record could not be found.
5598
+ */
5599
+ abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5600
+ /**
5601
+ * Queries a single record from the table given its unique id.
5602
+ * @param id The unique id.
5603
+ * @returns The persisted record for the given id.
5604
+ * @throws If the record could not be found.
5605
+ */
5606
+ abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5607
+ /**
5608
+ * Queries multiple records from the table given their unique id.
5609
+ * @param ids The unique ids array.
5610
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5611
+ * @returns The persisted records for the given ids in order.
5612
+ * @throws If one or more records could not be found.
5613
+ */
5614
+ abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5615
+ /**
5616
+ * Queries multiple records from the table given their unique id.
5617
+ * @param ids The unique ids array.
5618
+ * @returns The persisted records for the given ids in order.
5619
+ * @throws If one or more records could not be found.
5620
+ */
5621
+ abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5622
+ /**
5623
+ * Queries a single record from the table by the id in the object.
5624
+ * @param object Object containing the id of the record.
5625
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5626
+ * @returns The persisted record for the given id.
5627
+ * @throws If the record could not be found.
5628
+ */
5629
+ abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5630
+ /**
5631
+ * Queries a single record from the table by the id in the object.
5632
+ * @param object Object containing the id of the record.
5633
+ * @returns The persisted record for the given id.
5634
+ * @throws If the record could not be found.
5635
+ */
5636
+ abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5637
+ /**
5638
+ * Queries multiple records from the table by the ids in the objects.
5639
+ * @param objects Array of objects containing the ids of the records.
5640
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5641
+ * @returns The persisted records for the given ids in order.
5642
+ * @throws If one or more records could not be found.
5643
+ */
5644
+ abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5645
+ /**
5646
+ * Queries multiple records from the table by the ids in the objects.
5647
+ * @param objects Array of objects containing the ids of the records.
5648
+ * @returns The persisted records for the given ids in order.
5649
+ * @throws If one or more records could not be found.
5650
+ */
5651
+ abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5652
+ /**
5653
+ * Partially update a single record.
5654
+ * @param object An object with its id and the columns to be updated.
5655
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5656
+ * @returns The full persisted record, null if the record could not be found.
5657
+ */
5658
+ abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5659
+ /**
5660
+ * Partially update a single record.
5661
+ * @param object An object with its id and the columns to be updated.
5662
+ * @returns The full persisted record, null if the record could not be found.
5663
+ */
5664
+ abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5665
+ /**
5666
+ * Partially update a single record given its unique id.
5667
+ * @param id The unique id.
5668
+ * @param object The column names and their values that have to be updated.
5669
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5670
+ * @returns The full persisted record, null if the record could not be found.
5671
+ */
5672
+ abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5673
+ /**
5674
+ * Partially update a single record given its unique id.
5675
+ * @param id The unique id.
5676
+ * @param object The column names and their values that have to be updated.
5677
+ * @returns The full persisted record, null if the record could not be found.
5678
+ */
5679
+ abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5680
+ /**
5681
+ * Partially updates multiple records.
5682
+ * @param objects An array of objects with their ids and columns to be updated.
5683
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5684
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
3463
5685
  */
3464
- abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5686
+ abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5687
+ /**
5688
+ * Partially updates multiple records.
5689
+ * @param objects An array of objects with their ids and columns to be updated.
5690
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
5691
+ */
5692
+ abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5693
+ /**
5694
+ * Partially update a single record.
5695
+ * @param object An object with its id and the columns to be updated.
5696
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5697
+ * @returns The full persisted record.
5698
+ * @throws If the record could not be found.
5699
+ */
5700
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3465
5701
  /**
3466
5702
  * Partially update a single record.
3467
5703
  * @param object An object with its id and the columns to be updated.
3468
5704
  * @returns The full persisted record.
5705
+ * @throws If the record could not be found.
5706
+ */
5707
+ abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5708
+ /**
5709
+ * Partially update a single record given its unique id.
5710
+ * @param id The unique id.
5711
+ * @param object The column names and their values that have to be updated.
5712
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5713
+ * @returns The full persisted record.
5714
+ * @throws If the record could not be found.
3469
5715
  */
3470
- abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5716
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3471
5717
  /**
3472
5718
  * Partially update a single record given its unique id.
3473
5719
  * @param id The unique id.
3474
5720
  * @param object The column names and their values that have to be updated.
3475
5721
  * @returns The full persisted record.
5722
+ * @throws If the record could not be found.
3476
5723
  */
3477
- abstract update(id: string, object: Partial<EditableData<Data>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5724
+ abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3478
5725
  /**
3479
5726
  * Partially updates multiple records.
3480
5727
  * @param objects An array of objects with their ids and columns to be updated.
3481
- * @returns Array of the persisted records.
5728
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5729
+ * @returns Array of the persisted records in order.
5730
+ * @throws If one or more records could not be found.
3482
5731
  */
3483
- abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5732
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5733
+ /**
5734
+ * Partially updates multiple records.
5735
+ * @param objects An array of objects with their ids and columns to be updated.
5736
+ * @returns Array of the persisted records in order.
5737
+ * @throws If one or more records could not be found.
5738
+ */
5739
+ abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5740
+ /**
5741
+ * Creates or updates a single record. If a record exists with the given id,
5742
+ * it will be update, otherwise a new record will be created.
5743
+ * @param object Object containing the column names with their values to be persisted in the table.
5744
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5745
+ * @returns The full persisted record.
5746
+ */
5747
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3484
5748
  /**
3485
5749
  * Creates or updates a single record. If a record exists with the given id,
3486
5750
  * it will be update, otherwise a new record will be created.
3487
5751
  * @param object Object containing the column names with their values to be persisted in the table.
3488
5752
  * @returns The full persisted record.
3489
5753
  */
3490
- abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5754
+ abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5755
+ /**
5756
+ * Creates or updates a single record. If a record exists with the given id,
5757
+ * it will be update, otherwise a new record will be created.
5758
+ * @param id A unique id.
5759
+ * @param object The column names and the values to be persisted.
5760
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5761
+ * @returns The full persisted record.
5762
+ */
5763
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3491
5764
  /**
3492
5765
  * Creates or updates a single record. If a record exists with the given id,
3493
5766
  * it will be update, otherwise a new record will be created.
@@ -3495,38 +5768,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3495
5768
  * @param object The column names and the values to be persisted.
3496
5769
  * @returns The full persisted record.
3497
5770
  */
3498
- abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5771
+ abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5772
+ /**
5773
+ * Creates or updates a single record. If a record exists with the given id,
5774
+ * it will be update, otherwise a new record will be created.
5775
+ * @param objects Array of objects with the column names and the values to be stored in the table.
5776
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5777
+ * @returns Array of the persisted records.
5778
+ */
5779
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3499
5780
  /**
3500
5781
  * Creates or updates a single record. If a record exists with the given id,
3501
5782
  * it will be update, otherwise a new record will be created.
3502
5783
  * @param objects Array of objects with the column names and the values to be stored in the table.
3503
5784
  * @returns Array of the persisted records.
3504
5785
  */
3505
- abstract createOrUpdate(objects: Array<EditableData<Data> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5786
+ abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5787
+ /**
5788
+ * Deletes a record given its unique id.
5789
+ * @param object An object with a unique id.
5790
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5791
+ * @returns The deleted record, null if the record could not be found.
5792
+ */
5793
+ abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3506
5794
  /**
3507
5795
  * Deletes a record given its unique id.
5796
+ * @param object An object with a unique id.
5797
+ * @returns The deleted record, null if the record could not be found.
5798
+ */
5799
+ abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5800
+ /**
5801
+ * Deletes a record given a unique id.
3508
5802
  * @param id The unique id.
3509
- * @throws If the record could not be found or there was an error while performing the deletion.
5803
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5804
+ * @returns The deleted record, null if the record could not be found.
5805
+ */
5806
+ abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5807
+ /**
5808
+ * Deletes a record given a unique id.
5809
+ * @param id The unique id.
5810
+ * @returns The deleted record, null if the record could not be found.
5811
+ */
5812
+ abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5813
+ /**
5814
+ * Deletes multiple records given an array of objects with ids.
5815
+ * @param objects An array of objects with unique ids.
5816
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5817
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5818
+ */
5819
+ abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5820
+ /**
5821
+ * Deletes multiple records given an array of objects with ids.
5822
+ * @param objects An array of objects with unique ids.
5823
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5824
+ */
5825
+ abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5826
+ /**
5827
+ * Deletes multiple records given an array of unique ids.
5828
+ * @param objects An array of ids.
5829
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5830
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5831
+ */
5832
+ abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5833
+ /**
5834
+ * Deletes multiple records given an array of unique ids.
5835
+ * @param objects An array of ids.
5836
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5837
+ */
5838
+ abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5839
+ /**
5840
+ * Deletes a record given its unique id.
5841
+ * @param object An object with a unique id.
5842
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5843
+ * @returns The deleted record, null if the record could not be found.
5844
+ * @throws If the record could not be found.
3510
5845
  */
3511
- abstract delete(id: string): Promise<void>;
5846
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3512
5847
  /**
3513
5848
  * 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.
5849
+ * @param object An object with a unique id.
5850
+ * @returns The deleted record, null if the record could not be found.
5851
+ * @throws If the record could not be found.
5852
+ */
5853
+ abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5854
+ /**
5855
+ * Deletes a record given a unique id.
5856
+ * @param id The unique id.
5857
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5858
+ * @returns The deleted record, null if the record could not be found.
5859
+ * @throws If the record could not be found.
5860
+ */
5861
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5862
+ /**
5863
+ * Deletes a record given a unique id.
5864
+ * @param id The unique id.
5865
+ * @returns The deleted record, null if the record could not be found.
5866
+ * @throws If the record could not be found.
3516
5867
  */
3517
- abstract delete(id: Identifiable): Promise<void>;
5868
+ abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3518
5869
  /**
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.
5870
+ * Deletes multiple records given an array of objects with ids.
5871
+ * @param objects An array of objects with unique ids.
5872
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5873
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5874
+ * @throws If one or more records could not be found.
3522
5875
  */
3523
- abstract delete(ids: string[]): Promise<void>;
5876
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3524
5877
  /**
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.
5878
+ * Deletes multiple records given an array of objects with ids.
5879
+ * @param objects An array of objects with unique ids.
5880
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5881
+ * @throws If one or more records could not be found.
3528
5882
  */
3529
- abstract delete(ids: Identifiable[]): Promise<void>;
5883
+ abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5884
+ /**
5885
+ * Deletes multiple records given an array of unique ids.
5886
+ * @param objects An array of ids.
5887
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5888
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5889
+ * @throws If one or more records could not be found.
5890
+ */
5891
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5892
+ /**
5893
+ * Deletes multiple records given an array of unique ids.
5894
+ * @param objects An array of ids.
5895
+ * @returns Array of the deleted records in order.
5896
+ * @throws If one or more records could not be found.
5897
+ */
5898
+ abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3530
5899
  /**
3531
5900
  * Search for records in the table.
3532
5901
  * @param query The query to search for.
@@ -3535,39 +5904,84 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3535
5904
  */
3536
5905
  abstract search(query: string, options?: {
3537
5906
  fuzziness?: FuzzinessExpression;
5907
+ prefix?: PrefixExpression;
3538
5908
  highlight?: HighlightExpression;
3539
5909
  filter?: Filter<Record>;
3540
- }): Promise<SelectedPick<Record, ['*']>[]>;
5910
+ boosters?: Boosters<Record>[];
5911
+ }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3541
5912
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3542
5913
  }
3543
- declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
5914
+ declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
3544
5915
  #private;
3545
- db: SchemaPluginResult<any>;
3546
5916
  constructor(options: {
3547
5917
  table: string;
3548
5918
  db: SchemaPluginResult<any>;
3549
5919
  pluginOptions: XataPluginOptions;
3550
5920
  schemaTables?: Table[];
3551
5921
  });
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>;
5922
+ create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5923
+ create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5924
+ create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5925
+ create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5926
+ create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5927
+ create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5928
+ read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
5929
+ read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
5930
+ read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5931
+ read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5932
+ read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
5933
+ read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
5934
+ read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5935
+ read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5936
+ readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5937
+ readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5938
+ readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5939
+ readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5940
+ readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5941
+ readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5942
+ readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5943
+ readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5944
+ update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5945
+ update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5946
+ update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5947
+ update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5948
+ update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5949
+ update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5950
+ updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5951
+ updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5952
+ updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5953
+ updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5954
+ updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5955
+ updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5956
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5957
+ createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5958
+ createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5959
+ createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5960
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5961
+ createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5962
+ delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5963
+ delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5964
+ delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5965
+ delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5966
+ delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5967
+ delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5968
+ delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5969
+ delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5970
+ deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5971
+ deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5972
+ deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5973
+ deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5974
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5975
+ deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5976
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5977
+ deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3566
5978
  search(query: string, options?: {
3567
5979
  fuzziness?: FuzzinessExpression;
5980
+ prefix?: PrefixExpression;
3568
5981
  highlight?: HighlightExpression;
3569
5982
  filter?: Filter<Record>;
3570
- }): Promise<SelectedPick<Record, ['*']>[]>;
5983
+ boosters?: Boosters<Record>[];
5984
+ }): Promise<any>;
3571
5985
  query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3572
5986
  }
3573
5987
 
@@ -3576,6 +5990,7 @@ declare type BaseSchema = {
3576
5990
  columns: readonly ({
3577
5991
  name: string;
3578
5992
  type: Column['type'];
5993
+ notNull?: boolean;
3579
5994
  } | {
3580
5995
  name: string;
3581
5996
  type: 'link';
@@ -3605,10 +6020,10 @@ declare type TableType<Tables, TableName> = Tables & {
3605
6020
  } ? Columns extends readonly unknown[] ? Columns[number] extends {
3606
6021
  name: string;
3607
6022
  type: string;
3608
- } ? Identifiable & {
3609
- [K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
3610
- } : never : never : never : never;
3611
- declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
6023
+ } ? Identifiable & UnionToIntersection<Values<{
6024
+ [K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
6025
+ }>> : never : never : never : never;
6026
+ declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
3612
6027
  name: PropertyName;
3613
6028
  } extends infer Property ? Property extends {
3614
6029
  name: string;
@@ -3617,13 +6032,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
3617
6032
  table: infer LinkedTable;
3618
6033
  };
3619
6034
  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 {
6035
+ notNull?: infer NotNull;
6036
+ } ? NotNull extends true ? {
6037
+ [K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
6038
+ } : {
6039
+ [K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
6040
+ } : never : never;
6041
+ 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
6042
  name: string;
3622
6043
  type: string;
3623
- } ? {
3624
- [K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
3625
- } : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
6044
+ } ? UnionToIntersection<Values<{
6045
+ [K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
6046
+ }>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
3626
6047
 
6048
+ /**
6049
+ * Operator to restrict results to only values that are greater than the given value.
6050
+ */
6051
+ declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3627
6052
  /**
3628
6053
  * Operator to restrict results to only values that are greater than the given value.
3629
6054
  */
@@ -3631,15 +6056,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
3631
6056
  /**
3632
6057
  * Operator to restrict results to only values that are greater than or equal to the given value.
3633
6058
  */
3634
- declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6059
+ declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6060
+ /**
6061
+ * Operator to restrict results to only values that are greater than or equal to the given value.
6062
+ */
6063
+ declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3635
6064
  /**
3636
6065
  * Operator to restrict results to only values that are greater than or equal to the given value.
3637
6066
  */
3638
6067
  declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6068
+ /**
6069
+ * Operator to restrict results to only values that are greater than or equal to the given value.
6070
+ */
6071
+ declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6072
+ /**
6073
+ * Operator to restrict results to only values that are lower than the given value.
6074
+ */
6075
+ declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3639
6076
  /**
3640
6077
  * Operator to restrict results to only values that are lower than the given value.
3641
6078
  */
3642
6079
  declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6080
+ /**
6081
+ * Operator to restrict results to only values that are lower than or equal to the given value.
6082
+ */
6083
+ declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6084
+ /**
6085
+ * Operator to restrict results to only values that are lower than or equal to the given value.
6086
+ */
6087
+ declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3643
6088
  /**
3644
6089
  * Operator to restrict results to only values that are lower than or equal to the given value.
3645
6090
  */
@@ -3672,6 +6117,10 @@ declare const pattern: (value: string) => StringTypeFilter;
3672
6117
  * Operator to restrict results to only values that are equal to the given value.
3673
6118
  */
3674
6119
  declare const is: <T>(value: T) => PropertyFilter<T>;
6120
+ /**
6121
+ * Operator to restrict results to only values that are equal to the given value.
6122
+ */
6123
+ declare const equals: <T>(value: T) => PropertyFilter<T>;
3675
6124
  /**
3676
6125
  * Operator to restrict results to only values that are not equal to the given value.
3677
6126
  */
@@ -3700,58 +6149,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
3700
6149
  declare type SchemaDefinition = {
3701
6150
  table: string;
3702
6151
  };
3703
- declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
6152
+ declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
3704
6153
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
3705
- } & {
3706
- [key: string]: Repository<XataRecord$1>;
3707
6154
  };
3708
- declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
6155
+ declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3709
6156
  #private;
3710
6157
  constructor(schemaTables?: Schemas.Table[]);
3711
6158
  build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
3712
6159
  }
3713
6160
 
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
6161
  declare type BranchStrategyValue = string | undefined | null;
3756
6162
  declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
3757
6163
  declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
@@ -3763,19 +6169,34 @@ declare type BaseClientOptions = {
3763
6169
  databaseURL?: string;
3764
6170
  branch?: BranchStrategyOption;
3765
6171
  cache?: CacheImpl;
6172
+ trace?: TraceFunction;
3766
6173
  };
3767
6174
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
3768
6175
  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']>>;
6176
+ new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
6177
+ db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
6178
+ search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
3772
6179
  }, keyof Plugins> & {
3773
6180
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
6181
+ } & {
6182
+ getConfig(): Promise<{
6183
+ databaseURL: string;
6184
+ branch: string;
6185
+ }>;
3774
6186
  };
3775
6187
  }
3776
6188
  declare const BaseClient_base: ClientConstructor<{}>;
3777
- declare class BaseClient extends BaseClient_base<[]> {
6189
+ declare class BaseClient extends BaseClient_base<Record<string, any>> {
6190
+ }
6191
+
6192
+ declare class Serializer {
6193
+ classes: Record<string, any>;
6194
+ add(clazz: any): void;
6195
+ toJSON<T>(data: T): string;
6196
+ fromJSON<T>(json: string): T;
3778
6197
  }
6198
+ declare const serialize: <T>(data: T) => string;
6199
+ declare const deserialize: <T>(json: string) => T;
3779
6200
 
3780
6201
  declare type BranchResolutionOptions = {
3781
6202
  databaseURL?: string;
@@ -3788,9 +6209,89 @@ declare function getDatabaseURL(): string | undefined;
3788
6209
 
3789
6210
  declare function getAPIKey(): string | undefined;
3790
6211
 
6212
+ interface Body {
6213
+ arrayBuffer(): Promise<ArrayBuffer>;
6214
+ blob(): Promise<Blob>;
6215
+ formData(): Promise<FormData>;
6216
+ json(): Promise<any>;
6217
+ text(): Promise<string>;
6218
+ }
6219
+ interface Blob {
6220
+ readonly size: number;
6221
+ readonly type: string;
6222
+ arrayBuffer(): Promise<ArrayBuffer>;
6223
+ slice(start?: number, end?: number, contentType?: string): Blob;
6224
+ text(): Promise<string>;
6225
+ }
6226
+ /** Provides information about files and allows JavaScript in a web page to access their content. */
6227
+ interface File extends Blob {
6228
+ readonly lastModified: number;
6229
+ readonly name: string;
6230
+ readonly webkitRelativePath: string;
6231
+ }
6232
+ declare type FormDataEntryValue = File | string;
6233
+ /** 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". */
6234
+ interface FormData {
6235
+ append(name: string, value: string | Blob, fileName?: string): void;
6236
+ delete(name: string): void;
6237
+ get(name: string): FormDataEntryValue | null;
6238
+ getAll(name: string): FormDataEntryValue[];
6239
+ has(name: string): boolean;
6240
+ set(name: string, value: string | Blob, fileName?: string): void;
6241
+ forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
6242
+ }
6243
+ /** 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. */
6244
+ interface Headers {
6245
+ append(name: string, value: string): void;
6246
+ delete(name: string): void;
6247
+ get(name: string): string | null;
6248
+ has(name: string): boolean;
6249
+ set(name: string, value: string): void;
6250
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
6251
+ }
6252
+ interface Request extends Body {
6253
+ /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
6254
+ readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
6255
+ /** 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. */
6256
+ readonly credentials: 'include' | 'omit' | 'same-origin';
6257
+ /** Returns the kind of resource requested by request, e.g., "document" or "script". */
6258
+ readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
6259
+ /** 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. */
6260
+ readonly headers: Headers;
6261
+ /** 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] */
6262
+ readonly integrity: string;
6263
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
6264
+ readonly keepalive: boolean;
6265
+ /** Returns request's HTTP method, which is "GET" by default. */
6266
+ readonly method: string;
6267
+ /** 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. */
6268
+ readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
6269
+ /** 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. */
6270
+ readonly redirect: 'error' | 'follow' | 'manual';
6271
+ /** 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. */
6272
+ readonly referrer: string;
6273
+ /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
6274
+ readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
6275
+ /** Returns the URL of request as a string. */
6276
+ readonly url: string;
6277
+ clone(): Request;
6278
+ }
6279
+
6280
+ declare type XataWorkerContext<XataClient> = {
6281
+ xata: XataClient;
6282
+ request: Request;
6283
+ env: Record<string, string | undefined>;
6284
+ };
6285
+ declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
6286
+ declare type WorkerRunnerConfig = {
6287
+ workspace: string;
6288
+ worker: string;
6289
+ };
6290
+ 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>>>;
6291
+
3791
6292
  declare class XataError extends Error {
3792
6293
  readonly status: number;
3793
6294
  constructor(message: string, status: number);
3794
6295
  }
3795
6296
 
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 };
6297
+ export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, AggregateTableError, AggregateTablePathParams, AggregateTableRequestBody, AggregateTableVariables, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditResponse, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CPCreateDatabaseError, CPCreateDatabasePathParams, CPCreateDatabaseRequestBody, CPCreateDatabaseResponse, CPCreateDatabaseVariables, CPDeleteDatabaseError, CPDeleteDatabasePathParams, CPDeleteDatabaseVariables, CPGetCPDatabaseMetadataError, CPGetCPDatabaseMetadataPathParams, CPGetCPDatabaseMetadataVariables, CPGetDatabaseListError, CPGetDatabaseListPathParams, CPGetDatabaseListVariables, CPUpdateCPDatabaseMetadataError, CPUpdateCPDatabaseMetadataPathParams, CPUpdateCPDatabaseMetadataRequestBody, CPUpdateCPDatabaseMetadataVariables, 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, HostProvider, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, Query, QueryMigrationRequestsError, QueryMigrationRequestsPathParams, QueryMigrationRequestsRequestBody, QueryMigrationRequestsResponse, QueryMigrationRequestsVariables, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, 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, aggregateTable, applyBranchSchemaEdit, buildClient, buildWorkerRunner, bulkInsertTableRecords, cPCreateDatabase, cPDeleteDatabase, cPGetCPDatabaseMetadata, cPGetDatabaseList, cPUpdateCPDatabaseMetadata, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, pattern, previewBranchSchemaEdit, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };