@xata.io/client 0.0.0-alpha.vec0bff6 → 0.0.0-alpha.vec26c56

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,32 @@
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;
28
+ clientID?: string;
29
+ sessionID?: string;
19
30
  };
20
31
  declare type ErrorWrapper<TError> = TError | {
21
32
  status: 'unknown';
@@ -52,6 +63,7 @@ declare abstract class XataPlugin {
52
63
  declare type XataPluginOptions = {
53
64
  getFetchProps: () => Promise<FetcherExtraProps>;
54
65
  cache: CacheImpl;
66
+ trace?: TraceFunction;
55
67
  };
56
68
 
57
69
  /**
@@ -60,6 +72,9 @@ declare type XataPluginOptions = {
60
72
  * @version 1.0
61
73
  */
62
74
  declare type User = {
75
+ /**
76
+ * @format email
77
+ */
63
78
  email: string;
64
79
  fullname: string;
65
80
  image: string;
@@ -91,16 +106,19 @@ declare type WorkspaceID = string;
91
106
  declare type Role = 'owner' | 'maintainer';
92
107
  declare type WorkspaceMeta = {
93
108
  name: string;
94
- slug: string;
109
+ slug?: string;
95
110
  };
96
111
  declare type Workspace = WorkspaceMeta & {
97
112
  id: WorkspaceID;
98
113
  memberCount: number;
99
- plan: 'free';
114
+ plan: 'free' | 'pro';
100
115
  };
101
116
  declare type WorkspaceMember = {
102
117
  userId: UserID;
103
118
  fullname: string;
119
+ /**
120
+ * @format email
121
+ */
104
122
  email: string;
105
123
  role: Role;
106
124
  };
@@ -110,7 +128,13 @@ declare type WorkspaceMember = {
110
128
  declare type InviteID = string;
111
129
  declare type WorkspaceInvite = {
112
130
  inviteId: InviteID;
131
+ /**
132
+ * @format email
133
+ */
113
134
  email: string;
135
+ /**
136
+ * @format date-time
137
+ */
114
138
  expires: string;
115
139
  role: Role;
116
140
  };
@@ -122,20 +146,40 @@ declare type WorkspaceMembers = {
122
146
  * @pattern ^ik_[a-zA-Z0-9]+
123
147
  */
124
148
  declare type InviteKey = string;
149
+ /**
150
+ * Metadata of databases
151
+ */
152
+ declare type DatabaseMetadata = {
153
+ /**
154
+ * The machine-readable name of a database
155
+ */
156
+ name: string;
157
+ /**
158
+ * The time this database was created
159
+ */
160
+ createdAt: DateTime;
161
+ /**
162
+ * The number of branches the database has
163
+ */
164
+ numberOfBranches: number;
165
+ /**
166
+ * Metadata about the database for display in Xata user interfaces
167
+ */
168
+ ui?: {
169
+ /**
170
+ * The user-selected color for this database across interfaces
171
+ */
172
+ color?: string;
173
+ };
174
+ };
125
175
  declare type ListDatabasesResponse = {
126
- databases?: {
127
- name: string;
128
- displayName: string;
129
- createdAt: DateTime;
130
- numberOfBranches: number;
131
- ui?: {
132
- color?: string;
133
- };
134
- }[];
176
+ /**
177
+ * A list of databases in a Xata workspace
178
+ */
179
+ databases?: DatabaseMetadata[];
135
180
  };
136
181
  declare type ListBranchesResponse = {
137
182
  databaseName: string;
138
- displayName: string;
139
183
  branches: Branch[];
140
184
  };
141
185
  declare type ListGitBranchesResponse = {
@@ -153,8 +197,14 @@ declare type Branch = {
153
197
  * @x-go-type xata.BranchMetadata
154
198
  */
155
199
  declare type BranchMetadata = {
200
+ /**
201
+ * @minLength 1
202
+ */
156
203
  repository?: string;
157
204
  branch?: BranchName;
205
+ /**
206
+ * @minLength 1
207
+ */
158
208
  stage?: string;
159
209
  labels?: string[];
160
210
  };
@@ -181,12 +231,28 @@ declare type Schema = {
181
231
  tables: Table[];
182
232
  tablesOrder?: string[];
183
233
  };
234
+ /**
235
+ * @x-internal true
236
+ */
237
+ declare type SchemaEditScript = {
238
+ sourceMigrationID?: string;
239
+ targetMigrationID?: string;
240
+ tables: TableEdit[];
241
+ };
184
242
  declare type Table = {
185
243
  id?: string;
186
244
  name: TableName;
187
245
  columns: Column[];
188
246
  revLinks?: RevLink[];
189
247
  };
248
+ /**
249
+ * @x-internal true
250
+ */
251
+ declare type TableEdit = {
252
+ oldName?: string;
253
+ newName?: string;
254
+ columns?: MigrationColumnOp[];
255
+ };
190
256
  /**
191
257
  * @x-go-type xata.Column
192
258
  */
@@ -196,6 +262,8 @@ declare type Column = {
196
262
  link?: {
197
263
  table: string;
198
264
  };
265
+ notNull?: boolean;
266
+ unique?: boolean;
199
267
  columns?: Column[];
200
268
  };
201
269
  declare type RevLink = {
@@ -262,6 +330,137 @@ declare type ColumnMigration = {
262
330
  old: Column;
263
331
  ['new']: Column;
264
332
  };
333
+ /**
334
+ * @x-internal true
335
+ */
336
+ declare type Commit = {
337
+ meta?: {
338
+ title?: string;
339
+ message?: string;
340
+ id: string;
341
+ parentID?: string;
342
+ mergeParentID?: string;
343
+ status: string;
344
+ createdAt: DateTime;
345
+ modifiedAt?: DateTime;
346
+ };
347
+ operations: MigrationOp[];
348
+ };
349
+ /**
350
+ * Branch schema migration.
351
+ *
352
+ * @x-internal true
353
+ */
354
+ declare type Migration = {
355
+ parentID?: string;
356
+ operations: MigrationOp[];
357
+ };
358
+ /**
359
+ * Branch schema migration operations.
360
+ *
361
+ * @x-internal true
362
+ */
363
+ declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
364
+ /**
365
+ * @x-internal true
366
+ */
367
+ declare type MigrationTableOp = {
368
+ addTable: TableOpAdd;
369
+ } | {
370
+ removeTable: TableOpRemove;
371
+ } | {
372
+ renameTable: TableOpRename;
373
+ };
374
+ /**
375
+ * @x-internal true
376
+ */
377
+ declare type MigrationColumnOp = {
378
+ addColumn: ColumnOpAdd;
379
+ } | {
380
+ removeColumn: ColumnOpRemove;
381
+ } | {
382
+ renameColumn: ColumnOpRename;
383
+ };
384
+ /**
385
+ * @x-internal true
386
+ */
387
+ declare type TableOpAdd = {
388
+ table: string;
389
+ };
390
+ /**
391
+ * @x-internal true
392
+ */
393
+ declare type TableOpRemove = {
394
+ table: string;
395
+ };
396
+ /**
397
+ * @x-internal true
398
+ */
399
+ declare type TableOpRename = {
400
+ oldName: string;
401
+ newName: string;
402
+ };
403
+ /**
404
+ * @x-internal true
405
+ */
406
+ declare type ColumnOpAdd = {
407
+ table?: string;
408
+ column: Column;
409
+ };
410
+ /**
411
+ * @x-internal true
412
+ */
413
+ declare type ColumnOpRemove = {
414
+ table?: string;
415
+ column: string;
416
+ };
417
+ /**
418
+ * @x-internal true
419
+ */
420
+ declare type ColumnOpRename = {
421
+ table?: string;
422
+ oldName: string;
423
+ newName: string;
424
+ };
425
+ declare type MigrationRequest = {
426
+ /**
427
+ * The migration request number.
428
+ */
429
+ number: number;
430
+ /**
431
+ * Migration request creation timestamp.
432
+ */
433
+ createdAt: DateTime;
434
+ /**
435
+ * Last modified timestamp.
436
+ */
437
+ modifiedAt?: DateTime;
438
+ /**
439
+ * Timestamp when the migration request was closed.
440
+ */
441
+ closedAt?: DateTime;
442
+ /**
443
+ * Timestamp when the migration request was merged.
444
+ */
445
+ mergedAt?: DateTime;
446
+ status: 'open' | 'closed' | 'merging' | 'merged';
447
+ /**
448
+ * The migration request title.
449
+ */
450
+ title: string;
451
+ /**
452
+ * The migration request body with detailed description.
453
+ */
454
+ body: string;
455
+ /**
456
+ * Name of the source branch.
457
+ */
458
+ source: string;
459
+ /**
460
+ * Name of the target branch.
461
+ */
462
+ target: string;
463
+ };
265
464
  declare type SortExpression = string[] | {
266
465
  [key: string]: SortOrder;
267
466
  } | {
@@ -270,7 +469,7 @@ declare type SortExpression = string[] | {
270
469
  declare type SortOrder = 'asc' | 'desc';
271
470
  /**
272
471
  * Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
273
- * distance is the number of one charcter changes needed to make two strings equal. The default is 1, meaning that single
472
+ * distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
274
473
  * character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
275
474
  * to allow two typos in a word.
276
475
  *
@@ -283,6 +482,23 @@ declare type FuzzinessExpression = number;
283
482
  * 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.
284
483
  */
285
484
  declare type PrefixExpression = 'phrase' | 'disabled';
485
+ /**
486
+ * The target expression is used to filter the search results by the target columns.
487
+ */
488
+ declare type TargetExpression = (string | {
489
+ /**
490
+ * The name of the column.
491
+ */
492
+ column: string;
493
+ /**
494
+ * The weight of the column.
495
+ *
496
+ * @default 1
497
+ * @maximum 10
498
+ * @minimum 1
499
+ */
500
+ weight?: number;
501
+ })[];
286
502
  /**
287
503
  * @minProperties 1
288
504
  */
@@ -296,8 +512,217 @@ declare type FilterExpression = {
296
512
  } & {
297
513
  [key: string]: FilterColumn;
298
514
  };
515
+ /**
516
+ * The description of the summaries you wish to receive. Set each key to be the field name
517
+ * you'd like for the summary. These names must not collide with other columns you've
518
+ * requested from `columns`; including implicit requests like `settings.*`.
519
+ *
520
+ * The value for each key needs to be an object. This object should contain one key and one
521
+ * value only. In this object, the key should be set to the summary function you wish to use
522
+ * and the value set to the column name to be summarized.
523
+ *
524
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
525
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
526
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
527
+ *
528
+ * @example {"all_users":{"count":"*"}}
529
+ * @example {"total_created":{"count":"created_at"}}
530
+ * @x-go-type xbquery.SummaryList
531
+ */
532
+ declare type SummaryExpressionList = {
533
+ [key: string]: SummaryExpression;
534
+ };
535
+ /**
536
+ * A summary expression is the description of a single summary operation. It consists of a single
537
+ * key representing the operation, and a value representing the column to be operated on.
538
+ *
539
+ * The column being summarized cannot be an internal column (id, xata.*), nor the base of
540
+ * an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
541
+ * `settings.dark_mode` but not `settings` nor `settings.*`.
542
+ *
543
+ * We currently support the `count` operation. When using `count`, one can set a column name
544
+ * as the value. Xata will return the total number times this column is non-null in each group.
545
+ *
546
+ * Alternately, if you'd like to count the total rows in each group - irregardless of null/not null
547
+ * status - you can set `count` to `*` to count everything.
548
+ *
549
+ * @example {"count":"deleted_at"}
550
+ * @x-go-type xbquery.Summary
551
+ */
552
+ declare type SummaryExpression = Record<string, any>;
553
+ /**
554
+ * The description of the aggregations you wish to receive.
555
+ *
556
+ * @example {"totalCount":{"count":"*"},"dailyActiveUsers":{"dateHistogram":{"column":"date","interval":"1d"},"aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}}}}
557
+ */
558
+ declare type AggExpressionMap = {
559
+ [key: string]: AggExpression;
560
+ };
561
+ /**
562
+ * The description of a single aggregation operation. It is an object with only one key-value pair.
563
+ * The key represents the aggreagtion type, while the value is an object with the configuration of
564
+ * the aggreagtion.
565
+ *
566
+ * @x-go-type xata.AggExpression
567
+ */
568
+ declare type AggExpression = {
569
+ count?: CountAgg;
570
+ } | {
571
+ sum?: SumAgg;
572
+ } | {
573
+ max?: MaxAgg;
574
+ } | {
575
+ min?: MinAgg;
576
+ } | {
577
+ average?: AverageAgg;
578
+ } | {
579
+ uniqueCount?: UniqueCountAgg;
580
+ } | {
581
+ dateHistogram?: DateHistogramAgg;
582
+ } | {
583
+ topValues?: TopValuesAgg;
584
+ } | {
585
+ numericHistogram?: NumericHistogramAgg;
586
+ };
587
+ /**
588
+ * Count the number of records with an optional filter.
589
+ */
590
+ declare type CountAgg = {
591
+ filter?: FilterExpression;
592
+ } | '*';
593
+ /**
594
+ * The sum of the numeric values in a particular column.
595
+ */
596
+ declare type SumAgg = {
597
+ /**
598
+ * The column on which to compute the sum. Must be a numeric type.
599
+ */
600
+ column: string;
601
+ };
602
+ /**
603
+ * The max of the numeric values in a particular column.
604
+ */
605
+ declare type MaxAgg = {
606
+ /**
607
+ * The column on which to compute the max. Must be a numeric type.
608
+ */
609
+ column: string;
610
+ };
611
+ /**
612
+ * The min of the numeric values in a particular column.
613
+ */
614
+ declare type MinAgg = {
615
+ /**
616
+ * The column on which to compute the min. Must be a numeric type.
617
+ */
618
+ column: string;
619
+ };
620
+ /**
621
+ * The average of the numeric values in a particular column.
622
+ */
623
+ declare type AverageAgg = {
624
+ /**
625
+ * The column on which to compute the average. Must be a numeric type.
626
+ */
627
+ column: string;
628
+ };
629
+ /**
630
+ * Count the number of distinct values in a particular column.
631
+ */
632
+ declare type UniqueCountAgg = {
633
+ /**
634
+ * The column from where to count the unique values.
635
+ */
636
+ column: string;
637
+ /**
638
+ * The threshold under which the unique count is exact. If the number of unique
639
+ * values in the column is higher than this threshold, the results are approximative.
640
+ * Maximum value is 40,000, default value is 3000.
641
+ */
642
+ precisionThreshold?: number;
643
+ };
644
+ /**
645
+ * Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
646
+ */
647
+ declare type DateHistogramAgg = {
648
+ /**
649
+ * The column to use for bucketing. Must be of type datetime.
650
+ */
651
+ column: string;
652
+ /**
653
+ * The fixed interval to use when bucketing.
654
+ * It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
655
+ *
656
+ * @pattern ^(\d+)(d|h|m|s|ms)$
657
+ */
658
+ interval?: string;
659
+ /**
660
+ * The calendar-aware interval to use when bucketing. Possible values are: `minute`,
661
+ * `hour`, `day`, `week`, `month`, `quarter`, `year`.
662
+ */
663
+ calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
664
+ /**
665
+ * The timezone to use for bucketing. By default, UTC is assumed.
666
+ * The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
667
+ * `-08:00`.
668
+ *
669
+ * @pattern ^[+-][01]\d:[0-5]\d$
670
+ */
671
+ timezone?: string;
672
+ aggs?: AggExpressionMap;
673
+ };
674
+ /**
675
+ * Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
676
+ * The top values as ordered by the number of records (`$count``) are returned.
677
+ */
678
+ declare type TopValuesAgg = {
679
+ /**
680
+ * The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
681
+ */
682
+ column: string;
683
+ aggs?: AggExpressionMap;
684
+ /**
685
+ * The maximum number of unique values to return.
686
+ *
687
+ * @default 10
688
+ * @maximum 1000
689
+ */
690
+ size?: number;
691
+ };
692
+ /**
693
+ * Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
694
+ */
695
+ declare type NumericHistogramAgg = {
696
+ /**
697
+ * The column to use for bucketing. Must be of numeric type.
698
+ */
699
+ column: string;
700
+ /**
701
+ * The numeric interval to use for bucketing. The resulting buckets will be ranges
702
+ * with this value as size.
703
+ *
704
+ * @minimum 0
705
+ */
706
+ interval: number;
707
+ /**
708
+ * By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
709
+ * boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
710
+ * but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
711
+ * to 50.
712
+ *
713
+ * @default 0
714
+ */
715
+ offset?: number;
716
+ aggs?: AggExpressionMap;
717
+ };
299
718
  declare type HighlightExpression = {
719
+ /**
720
+ * Set to `false` to disable highlighting. By default it is `true`.
721
+ */
300
722
  enabled?: boolean;
723
+ /**
724
+ * Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
725
+ */
301
726
  encodeHTML?: boolean;
302
727
  };
303
728
  /**
@@ -316,15 +741,30 @@ declare type BoosterExpression = {
316
741
  * Boost records with a particular value for a column.
317
742
  */
318
743
  declare type ValueBooster$1 = {
744
+ /**
745
+ * The column in which to look for the value.
746
+ */
319
747
  column: string;
748
+ /**
749
+ * The exact value to boost.
750
+ */
320
751
  value: string | number | boolean;
752
+ /**
753
+ * The factor with which to multiply the score of the record.
754
+ */
321
755
  factor: number;
322
756
  };
323
757
  /**
324
758
  * Boost records based on the value of a numeric column.
325
759
  */
326
760
  declare type NumericBooster$1 = {
761
+ /**
762
+ * The column in which to look for the value.
763
+ */
327
764
  column: string;
765
+ /**
766
+ * The factor with which to multiply the value of the column before adding it to the item score.
767
+ */
328
768
  factor: number;
329
769
  };
330
770
  /**
@@ -333,9 +773,24 @@ declare type NumericBooster$1 = {
333
773
  * 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.
334
774
  */
335
775
  declare type DateBooster$1 = {
776
+ /**
777
+ * The column in which to look for the value.
778
+ */
336
779
  column: string;
780
+ /**
781
+ * 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.
782
+ * If it is not specified, the current date and time is used.
783
+ */
337
784
  origin?: string;
785
+ /**
786
+ * 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`.
787
+ *
788
+ * @pattern ^(\d+)(d|h|m|s|ms)$
789
+ */
338
790
  scale: string;
791
+ /**
792
+ * The decay factor to expect at "scale" distance from the "origin".
793
+ */
339
794
  decay: number;
340
795
  };
341
796
  declare type FilterList = FilterExpression | FilterExpression[];
@@ -387,13 +842,40 @@ declare type FilterValue = number | string | boolean;
387
842
  * Pagination settings.
388
843
  */
389
844
  declare type PageConfig = {
845
+ /**
846
+ * Query the next page that follow the cursor.
847
+ */
390
848
  after?: string;
849
+ /**
850
+ * Query the previous page before the cursor.
851
+ */
391
852
  before?: string;
853
+ /**
854
+ * Query the first page from the cursor.
855
+ */
392
856
  first?: string;
857
+ /**
858
+ * Query the last page from the cursor.
859
+ */
393
860
  last?: string;
861
+ /**
862
+ * 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.
863
+ *
864
+ * @default 20
865
+ */
394
866
  size?: number;
867
+ /**
868
+ * Use offset to skip entries. To skip pages set offset to a multiple of size.
869
+ *
870
+ * @default 0
871
+ */
395
872
  offset?: number;
396
873
  };
874
+ /**
875
+ * @example name
876
+ * @example email
877
+ * @example created_at
878
+ */
397
879
  declare type ColumnsProjection = string[];
398
880
  /**
399
881
  * Xata Table Record Metadata
@@ -401,14 +883,29 @@ declare type ColumnsProjection = string[];
401
883
  declare type RecordMeta = {
402
884
  id: RecordID;
403
885
  xata: {
886
+ /**
887
+ * The record's version. Can be used for optimistic concurrency control.
888
+ */
404
889
  version: number;
890
+ /**
891
+ * The record's table name. APIs that return records from multiple tables will set this field accordingly.
892
+ */
405
893
  table?: string;
894
+ /**
895
+ * Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
896
+ */
406
897
  highlight?: {
407
898
  [key: string]: string[] | {
408
899
  [key: string]: any;
409
900
  };
410
901
  };
902
+ /**
903
+ * The record's relevancy score. This is returned by the search APIs.
904
+ */
411
905
  score?: number;
906
+ /**
907
+ * Encoding/Decoding errors
908
+ */
412
909
  warnings?: string[];
413
910
  };
414
911
  };
@@ -420,7 +917,13 @@ declare type RecordID = string;
420
917
  * @example {"newName":"newName","oldName":"oldName"}
421
918
  */
422
919
  declare type TableRename = {
920
+ /**
921
+ * @minLength 1
922
+ */
423
923
  newName: string;
924
+ /**
925
+ * @minLength 1
926
+ */
424
927
  oldName: string;
425
928
  };
426
929
  /**
@@ -428,10 +931,56 @@ declare type TableRename = {
428
931
  */
429
932
  declare type RecordsMetadata = {
430
933
  page: {
934
+ /**
935
+ * last record id
936
+ */
431
937
  cursor: string;
938
+ /**
939
+ * true if more records can be fetch
940
+ */
432
941
  more: boolean;
433
942
  };
434
943
  };
944
+ declare type AggResponse$1 = (number | null) | {
945
+ values: ({
946
+ $key: string | number;
947
+ $count: number;
948
+ } & {
949
+ [key: string]: AggResponse$1;
950
+ })[];
951
+ };
952
+ /**
953
+ * Metadata of databases
954
+ */
955
+ declare type CPDatabaseMetadata = {
956
+ /**
957
+ * The machine-readable name of a database
958
+ */
959
+ name: string;
960
+ /**
961
+ * Region where this database is hosted
962
+ */
963
+ region: string;
964
+ /**
965
+ * The time this database was created
966
+ */
967
+ createdAt: DateTime;
968
+ /**
969
+ * Metadata about the database for display in Xata user interfaces
970
+ */
971
+ ui?: {
972
+ /**
973
+ * The user-selected color for this database across interfaces
974
+ */
975
+ color?: string;
976
+ };
977
+ };
978
+ declare type CPListDatabasesResponse = {
979
+ /**
980
+ * A list of databases in a Xata workspace
981
+ */
982
+ databases?: CPDatabaseMetadata[];
983
+ };
435
984
  /**
436
985
  * Xata Table Record Metadata
437
986
  */
@@ -453,6 +1002,7 @@ type schemas_InviteID = InviteID;
453
1002
  type schemas_WorkspaceInvite = WorkspaceInvite;
454
1003
  type schemas_WorkspaceMembers = WorkspaceMembers;
455
1004
  type schemas_InviteKey = InviteKey;
1005
+ type schemas_DatabaseMetadata = DatabaseMetadata;
456
1006
  type schemas_ListDatabasesResponse = ListDatabasesResponse;
457
1007
  type schemas_ListBranchesResponse = ListBranchesResponse;
458
1008
  type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
@@ -461,7 +1011,9 @@ type schemas_BranchMetadata = BranchMetadata;
461
1011
  type schemas_DBBranch = DBBranch;
462
1012
  type schemas_StartedFromMetadata = StartedFromMetadata;
463
1013
  type schemas_Schema = Schema;
1014
+ type schemas_SchemaEditScript = SchemaEditScript;
464
1015
  type schemas_Table = Table;
1016
+ type schemas_TableEdit = TableEdit;
465
1017
  type schemas_Column = Column;
466
1018
  type schemas_RevLink = RevLink;
467
1019
  type schemas_BranchName = BranchName;
@@ -474,11 +1026,37 @@ type schemas_MetricsLatency = MetricsLatency;
474
1026
  type schemas_BranchMigration = BranchMigration;
475
1027
  type schemas_TableMigration = TableMigration;
476
1028
  type schemas_ColumnMigration = ColumnMigration;
1029
+ type schemas_Commit = Commit;
1030
+ type schemas_Migration = Migration;
1031
+ type schemas_MigrationOp = MigrationOp;
1032
+ type schemas_MigrationTableOp = MigrationTableOp;
1033
+ type schemas_MigrationColumnOp = MigrationColumnOp;
1034
+ type schemas_TableOpAdd = TableOpAdd;
1035
+ type schemas_TableOpRemove = TableOpRemove;
1036
+ type schemas_TableOpRename = TableOpRename;
1037
+ type schemas_ColumnOpAdd = ColumnOpAdd;
1038
+ type schemas_ColumnOpRemove = ColumnOpRemove;
1039
+ type schemas_ColumnOpRename = ColumnOpRename;
1040
+ type schemas_MigrationRequest = MigrationRequest;
477
1041
  type schemas_SortExpression = SortExpression;
478
1042
  type schemas_SortOrder = SortOrder;
479
1043
  type schemas_FuzzinessExpression = FuzzinessExpression;
480
1044
  type schemas_PrefixExpression = PrefixExpression;
1045
+ type schemas_TargetExpression = TargetExpression;
481
1046
  type schemas_FilterExpression = FilterExpression;
1047
+ type schemas_SummaryExpressionList = SummaryExpressionList;
1048
+ type schemas_SummaryExpression = SummaryExpression;
1049
+ type schemas_AggExpressionMap = AggExpressionMap;
1050
+ type schemas_AggExpression = AggExpression;
1051
+ type schemas_CountAgg = CountAgg;
1052
+ type schemas_SumAgg = SumAgg;
1053
+ type schemas_MaxAgg = MaxAgg;
1054
+ type schemas_MinAgg = MinAgg;
1055
+ type schemas_AverageAgg = AverageAgg;
1056
+ type schemas_UniqueCountAgg = UniqueCountAgg;
1057
+ type schemas_DateHistogramAgg = DateHistogramAgg;
1058
+ type schemas_TopValuesAgg = TopValuesAgg;
1059
+ type schemas_NumericHistogramAgg = NumericHistogramAgg;
482
1060
  type schemas_HighlightExpression = HighlightExpression;
483
1061
  type schemas_BoosterExpression = BoosterExpression;
484
1062
  type schemas_FilterList = FilterList;
@@ -495,6 +1073,8 @@ type schemas_RecordMeta = RecordMeta;
495
1073
  type schemas_RecordID = RecordID;
496
1074
  type schemas_TableRename = TableRename;
497
1075
  type schemas_RecordsMetadata = RecordsMetadata;
1076
+ type schemas_CPDatabaseMetadata = CPDatabaseMetadata;
1077
+ type schemas_CPListDatabasesResponse = CPListDatabasesResponse;
498
1078
  declare namespace schemas {
499
1079
  export {
500
1080
  schemas_User as User,
@@ -511,6 +1091,7 @@ declare namespace schemas {
511
1091
  schemas_WorkspaceInvite as WorkspaceInvite,
512
1092
  schemas_WorkspaceMembers as WorkspaceMembers,
513
1093
  schemas_InviteKey as InviteKey,
1094
+ schemas_DatabaseMetadata as DatabaseMetadata,
514
1095
  schemas_ListDatabasesResponse as ListDatabasesResponse,
515
1096
  schemas_ListBranchesResponse as ListBranchesResponse,
516
1097
  schemas_ListGitBranchesResponse as ListGitBranchesResponse,
@@ -519,7 +1100,9 @@ declare namespace schemas {
519
1100
  schemas_DBBranch as DBBranch,
520
1101
  schemas_StartedFromMetadata as StartedFromMetadata,
521
1102
  schemas_Schema as Schema,
1103
+ schemas_SchemaEditScript as SchemaEditScript,
522
1104
  schemas_Table as Table,
1105
+ schemas_TableEdit as TableEdit,
523
1106
  schemas_Column as Column,
524
1107
  schemas_RevLink as RevLink,
525
1108
  schemas_BranchName as BranchName,
@@ -532,11 +1115,37 @@ declare namespace schemas {
532
1115
  schemas_BranchMigration as BranchMigration,
533
1116
  schemas_TableMigration as TableMigration,
534
1117
  schemas_ColumnMigration as ColumnMigration,
1118
+ schemas_Commit as Commit,
1119
+ schemas_Migration as Migration,
1120
+ schemas_MigrationOp as MigrationOp,
1121
+ schemas_MigrationTableOp as MigrationTableOp,
1122
+ schemas_MigrationColumnOp as MigrationColumnOp,
1123
+ schemas_TableOpAdd as TableOpAdd,
1124
+ schemas_TableOpRemove as TableOpRemove,
1125
+ schemas_TableOpRename as TableOpRename,
1126
+ schemas_ColumnOpAdd as ColumnOpAdd,
1127
+ schemas_ColumnOpRemove as ColumnOpRemove,
1128
+ schemas_ColumnOpRename as ColumnOpRename,
1129
+ schemas_MigrationRequest as MigrationRequest,
535
1130
  schemas_SortExpression as SortExpression,
536
1131
  schemas_SortOrder as SortOrder,
537
1132
  schemas_FuzzinessExpression as FuzzinessExpression,
538
1133
  schemas_PrefixExpression as PrefixExpression,
1134
+ schemas_TargetExpression as TargetExpression,
539
1135
  schemas_FilterExpression as FilterExpression,
1136
+ schemas_SummaryExpressionList as SummaryExpressionList,
1137
+ schemas_SummaryExpression as SummaryExpression,
1138
+ schemas_AggExpressionMap as AggExpressionMap,
1139
+ schemas_AggExpression as AggExpression,
1140
+ schemas_CountAgg as CountAgg,
1141
+ schemas_SumAgg as SumAgg,
1142
+ schemas_MaxAgg as MaxAgg,
1143
+ schemas_MinAgg as MinAgg,
1144
+ schemas_AverageAgg as AverageAgg,
1145
+ schemas_UniqueCountAgg as UniqueCountAgg,
1146
+ schemas_DateHistogramAgg as DateHistogramAgg,
1147
+ schemas_TopValuesAgg as TopValuesAgg,
1148
+ schemas_NumericHistogramAgg as NumericHistogramAgg,
540
1149
  schemas_HighlightExpression as HighlightExpression,
541
1150
  schemas_BoosterExpression as BoosterExpression,
542
1151
  ValueBooster$1 as ValueBooster,
@@ -556,6 +1165,9 @@ declare namespace schemas {
556
1165
  schemas_RecordID as RecordID,
557
1166
  schemas_TableRename as TableRename,
558
1167
  schemas_RecordsMetadata as RecordsMetadata,
1168
+ AggResponse$1 as AggResponse,
1169
+ schemas_CPDatabaseMetadata as CPDatabaseMetadata,
1170
+ schemas_CPListDatabasesResponse as CPListDatabasesResponse,
559
1171
  XataRecord$1 as XataRecord,
560
1172
  };
561
1173
  }
@@ -597,6 +1209,11 @@ declare type BranchMigrationPlan = {
597
1209
  migration: BranchMigration;
598
1210
  };
599
1211
  declare type RecordResponse = XataRecord$1;
1212
+ declare type SchemaCompareResponse = {
1213
+ source: Schema;
1214
+ target: Schema;
1215
+ edits: SchemaEditScript;
1216
+ };
600
1217
  declare type RecordUpdateResponse = XataRecord$1 | {
601
1218
  id: string;
602
1219
  xata: {
@@ -607,13 +1224,28 @@ declare type QueryResponse = {
607
1224
  records: XataRecord$1[];
608
1225
  meta: RecordsMetadata;
609
1226
  };
1227
+ declare type SummarizeResponse = {
1228
+ summaries: Record<string, any>[];
1229
+ };
1230
+ /**
1231
+ * @example {"aggs":{"dailyUniqueUsers":{"values":[{"key":"2022-02-22T22:22:22Z","uniqueUsers":134},{"key":"2022-02-23T22:22:22Z","uniqueUsers":90}]}}}
1232
+ */
1233
+ declare type AggResponse = {
1234
+ aggs?: {
1235
+ [key: string]: AggResponse$1;
1236
+ };
1237
+ };
610
1238
  declare type SearchResponse = {
611
1239
  records: XataRecord$1[];
1240
+ warning?: string;
612
1241
  };
613
1242
  /**
614
1243
  * @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
615
1244
  */
616
1245
  declare type MigrationIdResponse = {
1246
+ /**
1247
+ * @minLength 1
1248
+ */
617
1249
  migrationID: string;
618
1250
  };
619
1251
 
@@ -624,8 +1256,11 @@ type responses_BulkError = BulkError;
624
1256
  type responses_BulkInsertResponse = BulkInsertResponse;
625
1257
  type responses_BranchMigrationPlan = BranchMigrationPlan;
626
1258
  type responses_RecordResponse = RecordResponse;
1259
+ type responses_SchemaCompareResponse = SchemaCompareResponse;
627
1260
  type responses_RecordUpdateResponse = RecordUpdateResponse;
628
1261
  type responses_QueryResponse = QueryResponse;
1262
+ type responses_SummarizeResponse = SummarizeResponse;
1263
+ type responses_AggResponse = AggResponse;
629
1264
  type responses_SearchResponse = SearchResponse;
630
1265
  type responses_MigrationIdResponse = MigrationIdResponse;
631
1266
  declare namespace responses {
@@ -637,8 +1272,11 @@ declare namespace responses {
637
1272
  responses_BulkInsertResponse as BulkInsertResponse,
638
1273
  responses_BranchMigrationPlan as BranchMigrationPlan,
639
1274
  responses_RecordResponse as RecordResponse,
1275
+ responses_SchemaCompareResponse as SchemaCompareResponse,
640
1276
  responses_RecordUpdateResponse as RecordUpdateResponse,
641
1277
  responses_QueryResponse as QueryResponse,
1278
+ responses_SummarizeResponse as SummarizeResponse,
1279
+ responses_AggResponse as AggResponse,
642
1280
  responses_SearchResponse as SearchResponse,
643
1281
  responses_MigrationIdResponse as MigrationIdResponse,
644
1282
  };
@@ -664,7 +1302,7 @@ declare type GetUserVariables = FetcherExtraProps;
664
1302
  /**
665
1303
  * Return details of the user making the request
666
1304
  */
667
- declare const getUser: (variables: GetUserVariables) => Promise<UserWithID>;
1305
+ declare const getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
668
1306
  declare type UpdateUserError = ErrorWrapper<{
669
1307
  status: 400;
670
1308
  payload: BadRequestError;
@@ -681,7 +1319,7 @@ declare type UpdateUserVariables = {
681
1319
  /**
682
1320
  * Update user info
683
1321
  */
684
- declare const updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
1322
+ declare const updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
685
1323
  declare type DeleteUserError = ErrorWrapper<{
686
1324
  status: 400;
687
1325
  payload: BadRequestError;
@@ -696,7 +1334,7 @@ declare type DeleteUserVariables = FetcherExtraProps;
696
1334
  /**
697
1335
  * Delete the user making the request
698
1336
  */
699
- declare const deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
1337
+ declare const deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
700
1338
  declare type GetUserAPIKeysError = ErrorWrapper<{
701
1339
  status: 400;
702
1340
  payload: BadRequestError;
@@ -717,8 +1355,11 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
717
1355
  /**
718
1356
  * Retrieve a list of existing user API keys
719
1357
  */
720
- declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
1358
+ declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
721
1359
  declare type CreateUserAPIKeyPathParams = {
1360
+ /**
1361
+ * API Key name
1362
+ */
722
1363
  keyName: APIKeyName;
723
1364
  };
724
1365
  declare type CreateUserAPIKeyError = ErrorWrapper<{
@@ -742,8 +1383,11 @@ declare type CreateUserAPIKeyVariables = {
742
1383
  /**
743
1384
  * Create and return new API key
744
1385
  */
745
- declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
1386
+ declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
746
1387
  declare type DeleteUserAPIKeyPathParams = {
1388
+ /**
1389
+ * API Key name
1390
+ */
747
1391
  keyName: APIKeyName;
748
1392
  };
749
1393
  declare type DeleteUserAPIKeyError = ErrorWrapper<{
@@ -762,7 +1406,7 @@ declare type DeleteUserAPIKeyVariables = {
762
1406
  /**
763
1407
  * Delete an existing API key
764
1408
  */
765
- declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
1409
+ declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
766
1410
  declare type CreateWorkspaceError = ErrorWrapper<{
767
1411
  status: 400;
768
1412
  payload: BadRequestError;
@@ -779,7 +1423,7 @@ declare type CreateWorkspaceVariables = {
779
1423
  /**
780
1424
  * Creates a new workspace with the user requesting it as its single owner.
781
1425
  */
782
- declare const createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
1426
+ declare const createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
783
1427
  declare type GetWorkspacesListError = ErrorWrapper<{
784
1428
  status: 400;
785
1429
  payload: BadRequestError;
@@ -802,8 +1446,11 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
802
1446
  /**
803
1447
  * Retrieve the list of workspaces the user belongs to
804
1448
  */
805
- declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
1449
+ declare const getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
806
1450
  declare type GetWorkspacePathParams = {
1451
+ /**
1452
+ * Workspace ID
1453
+ */
807
1454
  workspaceId: WorkspaceID;
808
1455
  };
809
1456
  declare type GetWorkspaceError = ErrorWrapper<{
@@ -822,8 +1469,11 @@ declare type GetWorkspaceVariables = {
822
1469
  /**
823
1470
  * Retrieve workspace info from a workspace ID
824
1471
  */
825
- declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
1472
+ declare const getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
826
1473
  declare type UpdateWorkspacePathParams = {
1474
+ /**
1475
+ * Workspace ID
1476
+ */
827
1477
  workspaceId: WorkspaceID;
828
1478
  };
829
1479
  declare type UpdateWorkspaceError = ErrorWrapper<{
@@ -843,8 +1493,11 @@ declare type UpdateWorkspaceVariables = {
843
1493
  /**
844
1494
  * Update workspace info
845
1495
  */
846
- declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
1496
+ declare const updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
847
1497
  declare type DeleteWorkspacePathParams = {
1498
+ /**
1499
+ * Workspace ID
1500
+ */
848
1501
  workspaceId: WorkspaceID;
849
1502
  };
850
1503
  declare type DeleteWorkspaceError = ErrorWrapper<{
@@ -863,8 +1516,11 @@ declare type DeleteWorkspaceVariables = {
863
1516
  /**
864
1517
  * Delete the workspace with the provided ID
865
1518
  */
866
- declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
1519
+ declare const deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
867
1520
  declare type GetWorkspaceMembersListPathParams = {
1521
+ /**
1522
+ * Workspace ID
1523
+ */
868
1524
  workspaceId: WorkspaceID;
869
1525
  };
870
1526
  declare type GetWorkspaceMembersListError = ErrorWrapper<{
@@ -883,9 +1539,15 @@ declare type GetWorkspaceMembersListVariables = {
883
1539
  /**
884
1540
  * Retrieve the list of members of the given workspace
885
1541
  */
886
- declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
1542
+ declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
887
1543
  declare type UpdateWorkspaceMemberRolePathParams = {
1544
+ /**
1545
+ * Workspace ID
1546
+ */
888
1547
  workspaceId: WorkspaceID;
1548
+ /**
1549
+ * UserID
1550
+ */
889
1551
  userId: UserID;
890
1552
  };
891
1553
  declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
@@ -908,9 +1570,15 @@ declare type UpdateWorkspaceMemberRoleVariables = {
908
1570
  /**
909
1571
  * 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.
910
1572
  */
911
- declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
1573
+ declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
912
1574
  declare type RemoveWorkspaceMemberPathParams = {
1575
+ /**
1576
+ * Workspace ID
1577
+ */
913
1578
  workspaceId: WorkspaceID;
1579
+ /**
1580
+ * UserID
1581
+ */
914
1582
  userId: UserID;
915
1583
  };
916
1584
  declare type RemoveWorkspaceMemberError = ErrorWrapper<{
@@ -929,8 +1597,11 @@ declare type RemoveWorkspaceMemberVariables = {
929
1597
  /**
930
1598
  * Remove the member from the workspace
931
1599
  */
932
- declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
1600
+ declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
933
1601
  declare type InviteWorkspaceMemberPathParams = {
1602
+ /**
1603
+ * Workspace ID
1604
+ */
934
1605
  workspaceId: WorkspaceID;
935
1606
  };
936
1607
  declare type InviteWorkspaceMemberError = ErrorWrapper<{
@@ -947,6 +1618,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
947
1618
  payload: SimpleError;
948
1619
  }>;
949
1620
  declare type InviteWorkspaceMemberRequestBody = {
1621
+ /**
1622
+ * @format email
1623
+ */
950
1624
  email: string;
951
1625
  role: Role;
952
1626
  };
@@ -957,9 +1631,15 @@ declare type InviteWorkspaceMemberVariables = {
957
1631
  /**
958
1632
  * Invite some user to join the workspace with the given role
959
1633
  */
960
- declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
1634
+ declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
961
1635
  declare type UpdateWorkspaceMemberInvitePathParams = {
1636
+ /**
1637
+ * Workspace ID
1638
+ */
962
1639
  workspaceId: WorkspaceID;
1640
+ /**
1641
+ * Invite identifier
1642
+ */
963
1643
  inviteId: InviteID;
964
1644
  };
965
1645
  declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
@@ -985,9 +1665,15 @@ declare type UpdateWorkspaceMemberInviteVariables = {
985
1665
  /**
986
1666
  * 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.
987
1667
  */
988
- declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
1668
+ declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
989
1669
  declare type CancelWorkspaceMemberInvitePathParams = {
1670
+ /**
1671
+ * Workspace ID
1672
+ */
990
1673
  workspaceId: WorkspaceID;
1674
+ /**
1675
+ * Invite identifier
1676
+ */
991
1677
  inviteId: InviteID;
992
1678
  };
993
1679
  declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
@@ -1006,9 +1692,15 @@ declare type CancelWorkspaceMemberInviteVariables = {
1006
1692
  /**
1007
1693
  * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
1008
1694
  */
1009
- declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
1695
+ declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
1010
1696
  declare type ResendWorkspaceMemberInvitePathParams = {
1697
+ /**
1698
+ * Workspace ID
1699
+ */
1011
1700
  workspaceId: WorkspaceID;
1701
+ /**
1702
+ * Invite identifier
1703
+ */
1012
1704
  inviteId: InviteID;
1013
1705
  };
1014
1706
  declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
@@ -1027,9 +1719,15 @@ declare type ResendWorkspaceMemberInviteVariables = {
1027
1719
  /**
1028
1720
  * This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
1029
1721
  */
1030
- declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
1722
+ declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
1031
1723
  declare type AcceptWorkspaceMemberInvitePathParams = {
1724
+ /**
1725
+ * Workspace ID
1726
+ */
1032
1727
  workspaceId: WorkspaceID;
1728
+ /**
1729
+ * Invite Key (secret) for the invited user
1730
+ */
1033
1731
  inviteKey: InviteKey;
1034
1732
  };
1035
1733
  declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
@@ -1048,7 +1746,7 @@ declare type AcceptWorkspaceMemberInviteVariables = {
1048
1746
  /**
1049
1747
  * Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
1050
1748
  */
1051
- declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
1749
+ declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
1052
1750
  declare type GetDatabaseListPathParams = {
1053
1751
  workspace: string;
1054
1752
  };
@@ -1065,8 +1763,11 @@ declare type GetDatabaseListVariables = {
1065
1763
  /**
1066
1764
  * List all databases available in your Workspace.
1067
1765
  */
1068
- declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
1766
+ declare const getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
1069
1767
  declare type GetBranchListPathParams = {
1768
+ /**
1769
+ * The Database Name
1770
+ */
1070
1771
  dbName: DBName;
1071
1772
  workspace: string;
1072
1773
  };
@@ -1086,8 +1787,11 @@ declare type GetBranchListVariables = {
1086
1787
  /**
1087
1788
  * List all available Branches
1088
1789
  */
1089
- declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
1790
+ declare const getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
1090
1791
  declare type CreateDatabasePathParams = {
1792
+ /**
1793
+ * The Database Name
1794
+ */
1091
1795
  dbName: DBName;
1092
1796
  workspace: string;
1093
1797
  };
@@ -1099,11 +1803,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
1099
1803
  payload: AuthError;
1100
1804
  }>;
1101
1805
  declare type CreateDatabaseResponse = {
1806
+ /**
1807
+ * @minLength 1
1808
+ */
1102
1809
  databaseName: string;
1103
1810
  branchName?: string;
1104
1811
  };
1105
1812
  declare type CreateDatabaseRequestBody = {
1106
- displayName?: string;
1813
+ /**
1814
+ * @minLength 1
1815
+ */
1107
1816
  branchName?: string;
1108
1817
  ui?: {
1109
1818
  color?: string;
@@ -1117,8 +1826,11 @@ declare type CreateDatabaseVariables = {
1117
1826
  /**
1118
1827
  * Create Database with identifier name
1119
1828
  */
1120
- declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
1829
+ declare const createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
1121
1830
  declare type DeleteDatabasePathParams = {
1831
+ /**
1832
+ * The Database Name
1833
+ */
1122
1834
  dbName: DBName;
1123
1835
  workspace: string;
1124
1836
  };
@@ -1138,8 +1850,68 @@ declare type DeleteDatabaseVariables = {
1138
1850
  /**
1139
1851
  * Delete a database and all of its branches and tables permanently.
1140
1852
  */
1141
- declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
1853
+ declare const deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
1854
+ declare type GetDatabaseMetadataPathParams = {
1855
+ /**
1856
+ * The Database Name
1857
+ */
1858
+ dbName: DBName;
1859
+ workspace: string;
1860
+ };
1861
+ declare type GetDatabaseMetadataError = ErrorWrapper<{
1862
+ status: 400;
1863
+ payload: BadRequestError;
1864
+ } | {
1865
+ status: 401;
1866
+ payload: AuthError;
1867
+ } | {
1868
+ status: 404;
1869
+ payload: SimpleError;
1870
+ }>;
1871
+ declare type GetDatabaseMetadataVariables = {
1872
+ pathParams: GetDatabaseMetadataPathParams;
1873
+ } & FetcherExtraProps;
1874
+ /**
1875
+ * Retrieve metadata of the given database
1876
+ */
1877
+ declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
1878
+ declare type UpdateDatabaseMetadataPathParams = {
1879
+ /**
1880
+ * The Database Name
1881
+ */
1882
+ dbName: DBName;
1883
+ workspace: string;
1884
+ };
1885
+ declare type UpdateDatabaseMetadataError = ErrorWrapper<{
1886
+ status: 400;
1887
+ payload: BadRequestError;
1888
+ } | {
1889
+ status: 401;
1890
+ payload: AuthError;
1891
+ } | {
1892
+ status: 404;
1893
+ payload: SimpleError;
1894
+ }>;
1895
+ declare type UpdateDatabaseMetadataRequestBody = {
1896
+ ui?: {
1897
+ /**
1898
+ * @minLength 1
1899
+ */
1900
+ color?: string;
1901
+ };
1902
+ };
1903
+ declare type UpdateDatabaseMetadataVariables = {
1904
+ body?: UpdateDatabaseMetadataRequestBody;
1905
+ pathParams: UpdateDatabaseMetadataPathParams;
1906
+ } & FetcherExtraProps;
1907
+ /**
1908
+ * Update the color of the selected database
1909
+ */
1910
+ declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
1142
1911
  declare type GetGitBranchesMappingPathParams = {
1912
+ /**
1913
+ * The Database Name
1914
+ */
1143
1915
  dbName: DBName;
1144
1916
  workspace: string;
1145
1917
  };
@@ -1177,8 +1949,11 @@ declare type GetGitBranchesMappingVariables = {
1177
1949
  * }
1178
1950
  * ```
1179
1951
  */
1180
- declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
1952
+ declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
1181
1953
  declare type AddGitBranchesEntryPathParams = {
1954
+ /**
1955
+ * The Database Name
1956
+ */
1182
1957
  dbName: DBName;
1183
1958
  workspace: string;
1184
1959
  };
@@ -1190,10 +1965,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
1190
1965
  payload: AuthError;
1191
1966
  }>;
1192
1967
  declare type AddGitBranchesEntryResponse = {
1968
+ /**
1969
+ * Warning message
1970
+ */
1193
1971
  warning?: string;
1194
1972
  };
1195
1973
  declare type AddGitBranchesEntryRequestBody = {
1974
+ /**
1975
+ * The name of the Git branch.
1976
+ */
1196
1977
  gitBranch: string;
1978
+ /**
1979
+ * The name of the Xata branch.
1980
+ */
1197
1981
  xataBranch: BranchName;
1198
1982
  };
1199
1983
  declare type AddGitBranchesEntryVariables = {
@@ -1215,88 +1999,381 @@ declare type AddGitBranchesEntryVariables = {
1215
1999
  * }
1216
2000
  * ```
1217
2001
  */
1218
- declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2002
+ declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
1219
2003
  declare type RemoveGitBranchesEntryPathParams = {
2004
+ /**
2005
+ * The Database Name
2006
+ */
2007
+ dbName: DBName;
2008
+ workspace: string;
2009
+ };
2010
+ declare type RemoveGitBranchesEntryQueryParams = {
2011
+ /**
2012
+ * The Git Branch to remove from the mapping
2013
+ */
2014
+ gitBranch: string;
2015
+ };
2016
+ declare type RemoveGitBranchesEntryError = ErrorWrapper<{
2017
+ status: 400;
2018
+ payload: BadRequestError;
2019
+ } | {
2020
+ status: 401;
2021
+ payload: AuthError;
2022
+ }>;
2023
+ declare type RemoveGitBranchesEntryVariables = {
2024
+ pathParams: RemoveGitBranchesEntryPathParams;
2025
+ queryParams: RemoveGitBranchesEntryQueryParams;
2026
+ } & FetcherExtraProps;
2027
+ /**
2028
+ * Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
2029
+ *
2030
+ * Example request:
2031
+ *
2032
+ * ```json
2033
+ * // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
2034
+ * ```
2035
+ */
2036
+ declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
2037
+ declare type ResolveBranchPathParams = {
2038
+ /**
2039
+ * The Database Name
2040
+ */
2041
+ dbName: DBName;
2042
+ workspace: string;
2043
+ };
2044
+ declare type ResolveBranchQueryParams = {
2045
+ /**
2046
+ * The Git Branch
2047
+ */
2048
+ gitBranch?: string;
2049
+ /**
2050
+ * Default branch to fallback to
2051
+ */
2052
+ fallbackBranch?: string;
2053
+ };
2054
+ declare type ResolveBranchError = ErrorWrapper<{
2055
+ status: 400;
2056
+ payload: BadRequestError;
2057
+ } | {
2058
+ status: 401;
2059
+ payload: AuthError;
2060
+ }>;
2061
+ declare type ResolveBranchResponse = {
2062
+ branch: string;
2063
+ reason: {
2064
+ code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
2065
+ message: string;
2066
+ };
2067
+ };
2068
+ declare type ResolveBranchVariables = {
2069
+ pathParams: ResolveBranchPathParams;
2070
+ queryParams?: ResolveBranchQueryParams;
2071
+ } & FetcherExtraProps;
2072
+ /**
2073
+ * In order to resolve the database branch, the following algorithm is used:
2074
+ * * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
2075
+ * * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
2076
+ * * else, if `fallbackBranch` is provided and a branch with that name exists, return it
2077
+ * * else, return the default branch of the DB (`main` or the first branch)
2078
+ *
2079
+ * Example call:
2080
+ *
2081
+ * ```json
2082
+ * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
2083
+ * ```
2084
+ *
2085
+ * Example response:
2086
+ *
2087
+ * ```json
2088
+ * {
2089
+ * "branch": "main",
2090
+ * "reason": {
2091
+ * "code": "DEFAULT_BRANCH",
2092
+ * "message": "Default branch for this database (main)"
2093
+ * }
2094
+ * }
2095
+ * ```
2096
+ */
2097
+ declare const resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
2098
+ declare type QueryMigrationRequestsPathParams = {
2099
+ /**
2100
+ * The Database Name
2101
+ */
2102
+ dbName: DBName;
2103
+ workspace: string;
2104
+ };
2105
+ declare type QueryMigrationRequestsError = ErrorWrapper<{
2106
+ status: 400;
2107
+ payload: BadRequestError;
2108
+ } | {
2109
+ status: 401;
2110
+ payload: AuthError;
2111
+ } | {
2112
+ status: 404;
2113
+ payload: SimpleError;
2114
+ }>;
2115
+ declare type QueryMigrationRequestsResponse = {
2116
+ migrationRequests: MigrationRequest[];
2117
+ meta: RecordsMetadata;
2118
+ };
2119
+ declare type QueryMigrationRequestsRequestBody = {
2120
+ filter?: FilterExpression;
2121
+ sort?: SortExpression;
2122
+ page?: PageConfig;
2123
+ columns?: ColumnsProjection;
2124
+ };
2125
+ declare type QueryMigrationRequestsVariables = {
2126
+ body?: QueryMigrationRequestsRequestBody;
2127
+ pathParams: QueryMigrationRequestsPathParams;
2128
+ } & FetcherExtraProps;
2129
+ declare const queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
2130
+ declare type CreateMigrationRequestPathParams = {
2131
+ /**
2132
+ * The Database Name
2133
+ */
1220
2134
  dbName: DBName;
1221
2135
  workspace: string;
1222
2136
  };
1223
- declare type RemoveGitBranchesEntryQueryParams = {
1224
- gitBranch: string;
1225
- };
1226
- declare type RemoveGitBranchesEntryError = ErrorWrapper<{
2137
+ declare type CreateMigrationRequestError = ErrorWrapper<{
2138
+ status: 400;
2139
+ payload: BadRequestError;
2140
+ } | {
2141
+ status: 401;
2142
+ payload: AuthError;
2143
+ } | {
2144
+ status: 404;
2145
+ payload: SimpleError;
2146
+ }>;
2147
+ declare type CreateMigrationRequestResponse = {
2148
+ number: number;
2149
+ };
2150
+ declare type CreateMigrationRequestRequestBody = {
2151
+ /**
2152
+ * The source branch.
2153
+ */
2154
+ source: string;
2155
+ /**
2156
+ * The target branch.
2157
+ */
2158
+ target: string;
2159
+ /**
2160
+ * The title.
2161
+ */
2162
+ title: string;
2163
+ /**
2164
+ * Optional migration request description.
2165
+ */
2166
+ body?: string;
2167
+ };
2168
+ declare type CreateMigrationRequestVariables = {
2169
+ body: CreateMigrationRequestRequestBody;
2170
+ pathParams: CreateMigrationRequestPathParams;
2171
+ } & FetcherExtraProps;
2172
+ declare const createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
2173
+ declare type GetMigrationRequestPathParams = {
2174
+ /**
2175
+ * The Database Name
2176
+ */
2177
+ dbName: DBName;
2178
+ /**
2179
+ * The migration request number.
2180
+ */
2181
+ mrNumber: number;
2182
+ workspace: string;
2183
+ };
2184
+ declare type GetMigrationRequestError = ErrorWrapper<{
2185
+ status: 400;
2186
+ payload: BadRequestError;
2187
+ } | {
2188
+ status: 401;
2189
+ payload: AuthError;
2190
+ } | {
2191
+ status: 404;
2192
+ payload: SimpleError;
2193
+ }>;
2194
+ declare type GetMigrationRequestVariables = {
2195
+ pathParams: GetMigrationRequestPathParams;
2196
+ } & FetcherExtraProps;
2197
+ declare const getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
2198
+ declare type UpdateMigrationRequestPathParams = {
2199
+ /**
2200
+ * The Database Name
2201
+ */
2202
+ dbName: DBName;
2203
+ /**
2204
+ * The migration request number.
2205
+ */
2206
+ mrNumber: number;
2207
+ workspace: string;
2208
+ };
2209
+ declare type UpdateMigrationRequestError = ErrorWrapper<{
2210
+ status: 400;
2211
+ payload: BadRequestError;
2212
+ } | {
2213
+ status: 401;
2214
+ payload: AuthError;
2215
+ } | {
2216
+ status: 404;
2217
+ payload: SimpleError;
2218
+ }>;
2219
+ declare type UpdateMigrationRequestRequestBody = {
2220
+ /**
2221
+ * New migration request title.
2222
+ */
2223
+ title?: string;
2224
+ /**
2225
+ * New migration request description.
2226
+ */
2227
+ body?: string;
2228
+ /**
2229
+ * Change the migration request status.
2230
+ */
2231
+ status?: 'open' | 'closed';
2232
+ };
2233
+ declare type UpdateMigrationRequestVariables = {
2234
+ body?: UpdateMigrationRequestRequestBody;
2235
+ pathParams: UpdateMigrationRequestPathParams;
2236
+ } & FetcherExtraProps;
2237
+ declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
2238
+ declare type ListMigrationRequestsCommitsPathParams = {
2239
+ /**
2240
+ * The Database Name
2241
+ */
2242
+ dbName: DBName;
2243
+ /**
2244
+ * The migration request number.
2245
+ */
2246
+ mrNumber: number;
2247
+ workspace: string;
2248
+ };
2249
+ declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
2250
+ status: 400;
2251
+ payload: BadRequestError;
2252
+ } | {
2253
+ status: 401;
2254
+ payload: AuthError;
2255
+ } | {
2256
+ status: 404;
2257
+ payload: SimpleError;
2258
+ }>;
2259
+ declare type ListMigrationRequestsCommitsResponse = {
2260
+ meta: {
2261
+ /**
2262
+ * last record id
2263
+ */
2264
+ cursor: string;
2265
+ /**
2266
+ * true if more records can be fetch
2267
+ */
2268
+ more: boolean;
2269
+ };
2270
+ logs: Commit[];
2271
+ };
2272
+ declare type ListMigrationRequestsCommitsRequestBody = {
2273
+ page?: {
2274
+ /**
2275
+ * Query the next page that follow the cursor.
2276
+ */
2277
+ after?: string;
2278
+ /**
2279
+ * Query the previous page before the cursor.
2280
+ */
2281
+ before?: string;
2282
+ /**
2283
+ * 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.
2284
+ *
2285
+ * @default 20
2286
+ */
2287
+ size?: number;
2288
+ };
2289
+ };
2290
+ declare type ListMigrationRequestsCommitsVariables = {
2291
+ body?: ListMigrationRequestsCommitsRequestBody;
2292
+ pathParams: ListMigrationRequestsCommitsPathParams;
2293
+ } & FetcherExtraProps;
2294
+ declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
2295
+ declare type CompareMigrationRequestPathParams = {
2296
+ /**
2297
+ * The Database Name
2298
+ */
2299
+ dbName: DBName;
2300
+ /**
2301
+ * The migration request number.
2302
+ */
2303
+ mrNumber: number;
2304
+ workspace: string;
2305
+ };
2306
+ declare type CompareMigrationRequestError = ErrorWrapper<{
1227
2307
  status: 400;
1228
2308
  payload: BadRequestError;
1229
2309
  } | {
1230
2310
  status: 401;
1231
2311
  payload: AuthError;
2312
+ } | {
2313
+ status: 404;
2314
+ payload: SimpleError;
1232
2315
  }>;
1233
- declare type RemoveGitBranchesEntryVariables = {
1234
- pathParams: RemoveGitBranchesEntryPathParams;
1235
- queryParams: RemoveGitBranchesEntryQueryParams;
2316
+ declare type CompareMigrationRequestVariables = {
2317
+ pathParams: CompareMigrationRequestPathParams;
1236
2318
  } & FetcherExtraProps;
1237
- /**
1238
- * Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
1239
- *
1240
- * Example request:
1241
- *
1242
- * ```json
1243
- * // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
1244
- * ```
1245
- */
1246
- declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
1247
- declare type ResolveBranchPathParams = {
2319
+ declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
2320
+ declare type GetMigrationRequestIsMergedPathParams = {
2321
+ /**
2322
+ * The Database Name
2323
+ */
1248
2324
  dbName: DBName;
2325
+ /**
2326
+ * The migration request number.
2327
+ */
2328
+ mrNumber: number;
1249
2329
  workspace: string;
1250
2330
  };
1251
- declare type ResolveBranchQueryParams = {
1252
- gitBranch?: string;
1253
- fallbackBranch?: string;
1254
- };
1255
- declare type ResolveBranchError = ErrorWrapper<{
2331
+ declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
1256
2332
  status: 400;
1257
2333
  payload: BadRequestError;
1258
2334
  } | {
1259
2335
  status: 401;
1260
2336
  payload: AuthError;
2337
+ } | {
2338
+ status: 404;
2339
+ payload: SimpleError;
1261
2340
  }>;
1262
- declare type ResolveBranchResponse = {
1263
- branch: string;
1264
- reason: {
1265
- code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
1266
- message: string;
1267
- };
2341
+ declare type GetMigrationRequestIsMergedResponse = {
2342
+ merged?: boolean;
1268
2343
  };
1269
- declare type ResolveBranchVariables = {
1270
- pathParams: ResolveBranchPathParams;
1271
- queryParams?: ResolveBranchQueryParams;
2344
+ declare type GetMigrationRequestIsMergedVariables = {
2345
+ pathParams: GetMigrationRequestIsMergedPathParams;
1272
2346
  } & FetcherExtraProps;
1273
- /**
1274
- * In order to resolve the database branch, the following algorithm is used:
1275
- * * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
1276
- * * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
1277
- * * else, if `fallbackBranch` is provided and a branch with that name exists, return it
1278
- * * else, return the default branch of the DB (`main` or the first branch)
1279
- *
1280
- * Example call:
1281
- *
1282
- * ```json
1283
- * // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
1284
- * ```
1285
- *
1286
- * Example response:
1287
- *
1288
- * ```json
1289
- * {
1290
- * "branch": "main",
1291
- * "reason": {
1292
- * "code": "DEFAULT_BRANCH",
1293
- * "message": "Default branch for this database (main)"
1294
- * }
1295
- * }
1296
- * ```
1297
- */
1298
- declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
2347
+ declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
2348
+ declare type MergeMigrationRequestPathParams = {
2349
+ /**
2350
+ * The Database Name
2351
+ */
2352
+ dbName: DBName;
2353
+ /**
2354
+ * The migration request number.
2355
+ */
2356
+ mrNumber: number;
2357
+ workspace: string;
2358
+ };
2359
+ declare type MergeMigrationRequestError = ErrorWrapper<{
2360
+ status: 400;
2361
+ payload: BadRequestError;
2362
+ } | {
2363
+ status: 401;
2364
+ payload: AuthError;
2365
+ } | {
2366
+ status: 404;
2367
+ payload: SimpleError;
2368
+ }>;
2369
+ declare type MergeMigrationRequestVariables = {
2370
+ pathParams: MergeMigrationRequestPathParams;
2371
+ } & FetcherExtraProps;
2372
+ declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
1299
2373
  declare type GetBranchDetailsPathParams = {
2374
+ /**
2375
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2376
+ */
1300
2377
  dbBranchName: DBBranchName;
1301
2378
  workspace: string;
1302
2379
  };
@@ -1313,12 +2390,18 @@ declare type GetBranchDetailsError = ErrorWrapper<{
1313
2390
  declare type GetBranchDetailsVariables = {
1314
2391
  pathParams: GetBranchDetailsPathParams;
1315
2392
  } & FetcherExtraProps;
1316
- declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2393
+ declare const getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
1317
2394
  declare type CreateBranchPathParams = {
2395
+ /**
2396
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2397
+ */
1318
2398
  dbBranchName: DBBranchName;
1319
2399
  workspace: string;
1320
2400
  };
1321
2401
  declare type CreateBranchQueryParams = {
2402
+ /**
2403
+ * Name of source branch to branch the new schema from
2404
+ */
1322
2405
  from?: string;
1323
2406
  };
1324
2407
  declare type CreateBranchError = ErrorWrapper<{
@@ -1332,10 +2415,16 @@ declare type CreateBranchError = ErrorWrapper<{
1332
2415
  payload: SimpleError;
1333
2416
  }>;
1334
2417
  declare type CreateBranchResponse = {
2418
+ /**
2419
+ * @minLength 1
2420
+ */
1335
2421
  databaseName: string;
1336
2422
  branchName: string;
1337
2423
  };
1338
2424
  declare type CreateBranchRequestBody = {
2425
+ /**
2426
+ * Select the branch to fork from. Defaults to 'main'
2427
+ */
1339
2428
  from?: string;
1340
2429
  metadata?: BranchMetadata;
1341
2430
  };
@@ -1344,8 +2433,11 @@ declare type CreateBranchVariables = {
1344
2433
  pathParams: CreateBranchPathParams;
1345
2434
  queryParams?: CreateBranchQueryParams;
1346
2435
  } & FetcherExtraProps;
1347
- declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2436
+ declare const createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
1348
2437
  declare type DeleteBranchPathParams = {
2438
+ /**
2439
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2440
+ */
1349
2441
  dbBranchName: DBBranchName;
1350
2442
  workspace: string;
1351
2443
  };
@@ -1365,8 +2457,11 @@ declare type DeleteBranchVariables = {
1365
2457
  /**
1366
2458
  * Delete the branch in the database and all its resources
1367
2459
  */
1368
- declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2460
+ declare const deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
1369
2461
  declare type UpdateBranchMetadataPathParams = {
2462
+ /**
2463
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2464
+ */
1370
2465
  dbBranchName: DBBranchName;
1371
2466
  workspace: string;
1372
2467
  };
@@ -1387,8 +2482,11 @@ declare type UpdateBranchMetadataVariables = {
1387
2482
  /**
1388
2483
  * Update the branch metadata
1389
2484
  */
1390
- declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2485
+ declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
1391
2486
  declare type GetBranchMetadataPathParams = {
2487
+ /**
2488
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2489
+ */
1392
2490
  dbBranchName: DBBranchName;
1393
2491
  workspace: string;
1394
2492
  };
@@ -1405,8 +2503,11 @@ declare type GetBranchMetadataError = ErrorWrapper<{
1405
2503
  declare type GetBranchMetadataVariables = {
1406
2504
  pathParams: GetBranchMetadataPathParams;
1407
2505
  } & FetcherExtraProps;
1408
- declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
2506
+ declare const getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
1409
2507
  declare type GetBranchMigrationHistoryPathParams = {
2508
+ /**
2509
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2510
+ */
1410
2511
  dbBranchName: DBBranchName;
1411
2512
  workspace: string;
1412
2513
  };
@@ -1432,8 +2533,11 @@ declare type GetBranchMigrationHistoryVariables = {
1432
2533
  body?: GetBranchMigrationHistoryRequestBody;
1433
2534
  pathParams: GetBranchMigrationHistoryPathParams;
1434
2535
  } & FetcherExtraProps;
1435
- declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2536
+ declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
1436
2537
  declare type ExecuteBranchMigrationPlanPathParams = {
2538
+ /**
2539
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2540
+ */
1437
2541
  dbBranchName: DBBranchName;
1438
2542
  workspace: string;
1439
2543
  };
@@ -1458,8 +2562,11 @@ declare type ExecuteBranchMigrationPlanVariables = {
1458
2562
  /**
1459
2563
  * Apply a migration plan to the branch
1460
2564
  */
1461
- declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2565
+ declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
1462
2566
  declare type GetBranchMigrationPlanPathParams = {
2567
+ /**
2568
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2569
+ */
1463
2570
  dbBranchName: DBBranchName;
1464
2571
  workspace: string;
1465
2572
  };
@@ -1480,8 +2587,200 @@ declare type GetBranchMigrationPlanVariables = {
1480
2587
  /**
1481
2588
  * Compute a migration plan from a target schema the branch should be migrated too.
1482
2589
  */
1483
- declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2590
+ declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
2591
+ declare type CompareBranchWithUserSchemaPathParams = {
2592
+ /**
2593
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2594
+ */
2595
+ dbBranchName: DBBranchName;
2596
+ workspace: string;
2597
+ };
2598
+ declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
2599
+ status: 400;
2600
+ payload: BadRequestError;
2601
+ } | {
2602
+ status: 401;
2603
+ payload: AuthError;
2604
+ } | {
2605
+ status: 404;
2606
+ payload: SimpleError;
2607
+ }>;
2608
+ declare type CompareBranchWithUserSchemaRequestBody = {
2609
+ schema: Schema;
2610
+ };
2611
+ declare type CompareBranchWithUserSchemaVariables = {
2612
+ body: CompareBranchWithUserSchemaRequestBody;
2613
+ pathParams: CompareBranchWithUserSchemaPathParams;
2614
+ } & FetcherExtraProps;
2615
+ declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
2616
+ declare type CompareBranchSchemasPathParams = {
2617
+ /**
2618
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2619
+ */
2620
+ dbBranchName: DBBranchName;
2621
+ /**
2622
+ * The Database Name
2623
+ */
2624
+ branchName: BranchName;
2625
+ workspace: string;
2626
+ };
2627
+ declare type CompareBranchSchemasError = ErrorWrapper<{
2628
+ status: 400;
2629
+ payload: BadRequestError;
2630
+ } | {
2631
+ status: 401;
2632
+ payload: AuthError;
2633
+ } | {
2634
+ status: 404;
2635
+ payload: SimpleError;
2636
+ }>;
2637
+ declare type CompareBranchSchemasVariables = {
2638
+ body?: Record<string, any>;
2639
+ pathParams: CompareBranchSchemasPathParams;
2640
+ } & FetcherExtraProps;
2641
+ declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
2642
+ declare type UpdateBranchSchemaPathParams = {
2643
+ /**
2644
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2645
+ */
2646
+ dbBranchName: DBBranchName;
2647
+ workspace: string;
2648
+ };
2649
+ declare type UpdateBranchSchemaError = ErrorWrapper<{
2650
+ status: 400;
2651
+ payload: BadRequestError;
2652
+ } | {
2653
+ status: 401;
2654
+ payload: AuthError;
2655
+ } | {
2656
+ status: 404;
2657
+ payload: SimpleError;
2658
+ }>;
2659
+ declare type UpdateBranchSchemaResponse = {
2660
+ id: string;
2661
+ parentID: string;
2662
+ };
2663
+ declare type UpdateBranchSchemaVariables = {
2664
+ body: Migration;
2665
+ pathParams: UpdateBranchSchemaPathParams;
2666
+ } & FetcherExtraProps;
2667
+ declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
2668
+ declare type PreviewBranchSchemaEditPathParams = {
2669
+ /**
2670
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2671
+ */
2672
+ dbBranchName: DBBranchName;
2673
+ workspace: string;
2674
+ };
2675
+ declare type PreviewBranchSchemaEditError = ErrorWrapper<{
2676
+ status: 400;
2677
+ payload: BadRequestError;
2678
+ } | {
2679
+ status: 401;
2680
+ payload: AuthError;
2681
+ } | {
2682
+ status: 404;
2683
+ payload: SimpleError;
2684
+ }>;
2685
+ declare type PreviewBranchSchemaEditResponse = {
2686
+ original: Schema;
2687
+ updated: Schema;
2688
+ };
2689
+ declare type PreviewBranchSchemaEditRequestBody = {
2690
+ edits?: SchemaEditScript;
2691
+ operations?: MigrationOp[];
2692
+ };
2693
+ declare type PreviewBranchSchemaEditVariables = {
2694
+ body?: PreviewBranchSchemaEditRequestBody;
2695
+ pathParams: PreviewBranchSchemaEditPathParams;
2696
+ } & FetcherExtraProps;
2697
+ declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
2698
+ declare type ApplyBranchSchemaEditPathParams = {
2699
+ /**
2700
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2701
+ */
2702
+ dbBranchName: DBBranchName;
2703
+ workspace: string;
2704
+ };
2705
+ declare type ApplyBranchSchemaEditError = ErrorWrapper<{
2706
+ status: 400;
2707
+ payload: BadRequestError;
2708
+ } | {
2709
+ status: 401;
2710
+ payload: AuthError;
2711
+ } | {
2712
+ status: 404;
2713
+ payload: SimpleError;
2714
+ }>;
2715
+ declare type ApplyBranchSchemaEditResponse = {
2716
+ id: string;
2717
+ parentID: string;
2718
+ };
2719
+ declare type ApplyBranchSchemaEditRequestBody = {
2720
+ edits: SchemaEditScript;
2721
+ };
2722
+ declare type ApplyBranchSchemaEditVariables = {
2723
+ body: ApplyBranchSchemaEditRequestBody;
2724
+ pathParams: ApplyBranchSchemaEditPathParams;
2725
+ } & FetcherExtraProps;
2726
+ declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
2727
+ declare type GetBranchSchemaHistoryPathParams = {
2728
+ /**
2729
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2730
+ */
2731
+ dbBranchName: DBBranchName;
2732
+ workspace: string;
2733
+ };
2734
+ declare type GetBranchSchemaHistoryError = ErrorWrapper<{
2735
+ status: 400;
2736
+ payload: BadRequestError;
2737
+ } | {
2738
+ status: 401;
2739
+ payload: AuthError;
2740
+ } | {
2741
+ status: 404;
2742
+ payload: SimpleError;
2743
+ }>;
2744
+ declare type GetBranchSchemaHistoryResponse = {
2745
+ meta: {
2746
+ /**
2747
+ * last record id
2748
+ */
2749
+ cursor: string;
2750
+ /**
2751
+ * true if more records can be fetch
2752
+ */
2753
+ more: boolean;
2754
+ };
2755
+ logs: Commit[];
2756
+ };
2757
+ declare type GetBranchSchemaHistoryRequestBody = {
2758
+ page?: {
2759
+ /**
2760
+ * Query the next page that follow the cursor.
2761
+ */
2762
+ after?: string;
2763
+ /**
2764
+ * Query the previous page before the cursor.
2765
+ */
2766
+ before?: string;
2767
+ /**
2768
+ * 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.
2769
+ *
2770
+ * @default 20
2771
+ */
2772
+ size?: number;
2773
+ };
2774
+ };
2775
+ declare type GetBranchSchemaHistoryVariables = {
2776
+ body?: GetBranchSchemaHistoryRequestBody;
2777
+ pathParams: GetBranchSchemaHistoryPathParams;
2778
+ } & FetcherExtraProps;
2779
+ declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
1484
2780
  declare type GetBranchStatsPathParams = {
2781
+ /**
2782
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2783
+ */
1485
2784
  dbBranchName: DBBranchName;
1486
2785
  workspace: string;
1487
2786
  };
@@ -1512,9 +2811,15 @@ declare type GetBranchStatsVariables = {
1512
2811
  /**
1513
2812
  * Get branch usage metrics.
1514
2813
  */
1515
- declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
2814
+ declare const getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
1516
2815
  declare type CreateTablePathParams = {
2816
+ /**
2817
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2818
+ */
1517
2819
  dbBranchName: DBBranchName;
2820
+ /**
2821
+ * The Table name
2822
+ */
1518
2823
  tableName: TableName;
1519
2824
  workspace: string;
1520
2825
  };
@@ -1533,6 +2838,9 @@ declare type CreateTableError = ErrorWrapper<{
1533
2838
  }>;
1534
2839
  declare type CreateTableResponse = {
1535
2840
  branchName: string;
2841
+ /**
2842
+ * @minLength 1
2843
+ */
1536
2844
  tableName: string;
1537
2845
  };
1538
2846
  declare type CreateTableVariables = {
@@ -1541,9 +2849,15 @@ declare type CreateTableVariables = {
1541
2849
  /**
1542
2850
  * Creates a new table with the given name. Returns 422 if a table with the same name already exists.
1543
2851
  */
1544
- declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2852
+ declare const createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
1545
2853
  declare type DeleteTablePathParams = {
2854
+ /**
2855
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2856
+ */
1546
2857
  dbBranchName: DBBranchName;
2858
+ /**
2859
+ * The Table name
2860
+ */
1547
2861
  tableName: TableName;
1548
2862
  workspace: string;
1549
2863
  };
@@ -1560,9 +2874,15 @@ declare type DeleteTableVariables = {
1560
2874
  /**
1561
2875
  * Deletes the table with the given name.
1562
2876
  */
1563
- declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2877
+ declare const deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
1564
2878
  declare type UpdateTablePathParams = {
2879
+ /**
2880
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2881
+ */
1565
2882
  dbBranchName: DBBranchName;
2883
+ /**
2884
+ * The Table name
2885
+ */
1566
2886
  tableName: TableName;
1567
2887
  workspace: string;
1568
2888
  };
@@ -1577,6 +2897,9 @@ declare type UpdateTableError = ErrorWrapper<{
1577
2897
  payload: SimpleError;
1578
2898
  }>;
1579
2899
  declare type UpdateTableRequestBody = {
2900
+ /**
2901
+ * @minLength 1
2902
+ */
1580
2903
  name: string;
1581
2904
  };
1582
2905
  declare type UpdateTableVariables = {
@@ -1596,9 +2919,15 @@ declare type UpdateTableVariables = {
1596
2919
  * }
1597
2920
  * ```
1598
2921
  */
1599
- declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2922
+ declare const updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
1600
2923
  declare type GetTableSchemaPathParams = {
2924
+ /**
2925
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2926
+ */
1601
2927
  dbBranchName: DBBranchName;
2928
+ /**
2929
+ * The Table name
2930
+ */
1602
2931
  tableName: TableName;
1603
2932
  workspace: string;
1604
2933
  };
@@ -1618,9 +2947,15 @@ declare type GetTableSchemaResponse = {
1618
2947
  declare type GetTableSchemaVariables = {
1619
2948
  pathParams: GetTableSchemaPathParams;
1620
2949
  } & FetcherExtraProps;
1621
- declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
2950
+ declare const getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
1622
2951
  declare type SetTableSchemaPathParams = {
2952
+ /**
2953
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2954
+ */
1623
2955
  dbBranchName: DBBranchName;
2956
+ /**
2957
+ * The Table name
2958
+ */
1624
2959
  tableName: TableName;
1625
2960
  workspace: string;
1626
2961
  };
@@ -1644,9 +2979,15 @@ declare type SetTableSchemaVariables = {
1644
2979
  body: SetTableSchemaRequestBody;
1645
2980
  pathParams: SetTableSchemaPathParams;
1646
2981
  } & FetcherExtraProps;
1647
- declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
2982
+ declare const setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
1648
2983
  declare type GetTableColumnsPathParams = {
2984
+ /**
2985
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
2986
+ */
1649
2987
  dbBranchName: DBBranchName;
2988
+ /**
2989
+ * The Table name
2990
+ */
1650
2991
  tableName: TableName;
1651
2992
  workspace: string;
1652
2993
  };
@@ -1670,9 +3011,15 @@ declare type GetTableColumnsVariables = {
1670
3011
  * Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
1671
3012
  * full dot-separated path (flattened).
1672
3013
  */
1673
- declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
3014
+ declare const getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
1674
3015
  declare type AddTableColumnPathParams = {
3016
+ /**
3017
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3018
+ */
1675
3019
  dbBranchName: DBBranchName;
3020
+ /**
3021
+ * The Table name
3022
+ */
1676
3023
  tableName: TableName;
1677
3024
  workspace: string;
1678
3025
  };
@@ -1695,10 +3042,19 @@ declare type AddTableColumnVariables = {
1695
3042
  * contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
1696
3043
  * passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
1697
3044
  */
1698
- declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
3045
+ declare const addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
1699
3046
  declare type GetColumnPathParams = {
3047
+ /**
3048
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3049
+ */
1700
3050
  dbBranchName: DBBranchName;
3051
+ /**
3052
+ * The Table name
3053
+ */
1701
3054
  tableName: TableName;
3055
+ /**
3056
+ * The Column name
3057
+ */
1702
3058
  columnName: ColumnName;
1703
3059
  workspace: string;
1704
3060
  };
@@ -1718,10 +3074,19 @@ declare type GetColumnVariables = {
1718
3074
  /**
1719
3075
  * Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1720
3076
  */
1721
- declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
3077
+ declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
1722
3078
  declare type DeleteColumnPathParams = {
3079
+ /**
3080
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3081
+ */
1723
3082
  dbBranchName: DBBranchName;
3083
+ /**
3084
+ * The Table name
3085
+ */
1724
3086
  tableName: TableName;
3087
+ /**
3088
+ * The Column name
3089
+ */
1725
3090
  columnName: ColumnName;
1726
3091
  workspace: string;
1727
3092
  };
@@ -1741,10 +3106,19 @@ declare type DeleteColumnVariables = {
1741
3106
  /**
1742
3107
  * Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
1743
3108
  */
1744
- declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
3109
+ declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
1745
3110
  declare type UpdateColumnPathParams = {
3111
+ /**
3112
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3113
+ */
1746
3114
  dbBranchName: DBBranchName;
3115
+ /**
3116
+ * The Table name
3117
+ */
1747
3118
  tableName: TableName;
3119
+ /**
3120
+ * The Column name
3121
+ */
1748
3122
  columnName: ColumnName;
1749
3123
  workspace: string;
1750
3124
  };
@@ -1759,6 +3133,9 @@ declare type UpdateColumnError = ErrorWrapper<{
1759
3133
  payload: SimpleError;
1760
3134
  }>;
1761
3135
  declare type UpdateColumnRequestBody = {
3136
+ /**
3137
+ * @minLength 1
3138
+ */
1762
3139
  name: string;
1763
3140
  };
1764
3141
  declare type UpdateColumnVariables = {
@@ -1768,13 +3145,22 @@ declare type UpdateColumnVariables = {
1768
3145
  /**
1769
3146
  * 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`.
1770
3147
  */
1771
- declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
3148
+ declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
1772
3149
  declare type InsertRecordPathParams = {
3150
+ /**
3151
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3152
+ */
1773
3153
  dbBranchName: DBBranchName;
3154
+ /**
3155
+ * The Table name
3156
+ */
1774
3157
  tableName: TableName;
1775
3158
  workspace: string;
1776
3159
  };
1777
3160
  declare type InsertRecordQueryParams = {
3161
+ /**
3162
+ * Column filters
3163
+ */
1778
3164
  columns?: ColumnsProjection;
1779
3165
  };
1780
3166
  declare type InsertRecordError = ErrorWrapper<{
@@ -1795,14 +3181,26 @@ declare type InsertRecordVariables = {
1795
3181
  /**
1796
3182
  * Insert a new Record into the Table
1797
3183
  */
1798
- declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
3184
+ declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1799
3185
  declare type InsertRecordWithIDPathParams = {
3186
+ /**
3187
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3188
+ */
1800
3189
  dbBranchName: DBBranchName;
3190
+ /**
3191
+ * The Table name
3192
+ */
1801
3193
  tableName: TableName;
3194
+ /**
3195
+ * The Record name
3196
+ */
1802
3197
  recordId: RecordID;
1803
3198
  workspace: string;
1804
3199
  };
1805
3200
  declare type InsertRecordWithIDQueryParams = {
3201
+ /**
3202
+ * Column filters
3203
+ */
1806
3204
  columns?: ColumnsProjection;
1807
3205
  createOnly?: boolean;
1808
3206
  ifVersion?: number;
@@ -1828,14 +3226,26 @@ declare type InsertRecordWithIDVariables = {
1828
3226
  /**
1829
3227
  * 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.
1830
3228
  */
1831
- declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
3229
+ declare const insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1832
3230
  declare type UpdateRecordWithIDPathParams = {
3231
+ /**
3232
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3233
+ */
1833
3234
  dbBranchName: DBBranchName;
3235
+ /**
3236
+ * The Table name
3237
+ */
1834
3238
  tableName: TableName;
3239
+ /**
3240
+ * The Record name
3241
+ */
1835
3242
  recordId: RecordID;
1836
3243
  workspace: string;
1837
3244
  };
1838
3245
  declare type UpdateRecordWithIDQueryParams = {
3246
+ /**
3247
+ * Column filters
3248
+ */
1839
3249
  columns?: ColumnsProjection;
1840
3250
  ifVersion?: number;
1841
3251
  };
@@ -1857,14 +3267,26 @@ declare type UpdateRecordWithIDVariables = {
1857
3267
  pathParams: UpdateRecordWithIDPathParams;
1858
3268
  queryParams?: UpdateRecordWithIDQueryParams;
1859
3269
  } & FetcherExtraProps;
1860
- declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
3270
+ declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1861
3271
  declare type UpsertRecordWithIDPathParams = {
3272
+ /**
3273
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3274
+ */
1862
3275
  dbBranchName: DBBranchName;
3276
+ /**
3277
+ * The Table name
3278
+ */
1863
3279
  tableName: TableName;
3280
+ /**
3281
+ * The Record name
3282
+ */
1864
3283
  recordId: RecordID;
1865
3284
  workspace: string;
1866
3285
  };
1867
3286
  declare type UpsertRecordWithIDQueryParams = {
3287
+ /**
3288
+ * Column filters
3289
+ */
1868
3290
  columns?: ColumnsProjection;
1869
3291
  ifVersion?: number;
1870
3292
  };
@@ -1886,14 +3308,26 @@ declare type UpsertRecordWithIDVariables = {
1886
3308
  pathParams: UpsertRecordWithIDPathParams;
1887
3309
  queryParams?: UpsertRecordWithIDQueryParams;
1888
3310
  } & FetcherExtraProps;
1889
- declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
3311
+ declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
1890
3312
  declare type DeleteRecordPathParams = {
3313
+ /**
3314
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3315
+ */
1891
3316
  dbBranchName: DBBranchName;
3317
+ /**
3318
+ * The Table name
3319
+ */
1892
3320
  tableName: TableName;
3321
+ /**
3322
+ * The Record name
3323
+ */
1893
3324
  recordId: RecordID;
1894
3325
  workspace: string;
1895
3326
  };
1896
3327
  declare type DeleteRecordQueryParams = {
3328
+ /**
3329
+ * Column filters
3330
+ */
1897
3331
  columns?: ColumnsProjection;
1898
3332
  };
1899
3333
  declare type DeleteRecordError = ErrorWrapper<{
@@ -1910,14 +3344,26 @@ declare type DeleteRecordVariables = {
1910
3344
  pathParams: DeleteRecordPathParams;
1911
3345
  queryParams?: DeleteRecordQueryParams;
1912
3346
  } & FetcherExtraProps;
1913
- declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
3347
+ declare const deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
1914
3348
  declare type GetRecordPathParams = {
3349
+ /**
3350
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3351
+ */
1915
3352
  dbBranchName: DBBranchName;
3353
+ /**
3354
+ * The Table name
3355
+ */
1916
3356
  tableName: TableName;
3357
+ /**
3358
+ * The Record name
3359
+ */
1917
3360
  recordId: RecordID;
1918
3361
  workspace: string;
1919
3362
  };
1920
3363
  declare type GetRecordQueryParams = {
3364
+ /**
3365
+ * Column filters
3366
+ */
1921
3367
  columns?: ColumnsProjection;
1922
3368
  };
1923
3369
  declare type GetRecordError = ErrorWrapper<{
@@ -1937,13 +3383,22 @@ declare type GetRecordVariables = {
1937
3383
  /**
1938
3384
  * Retrieve record by ID
1939
3385
  */
1940
- declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
3386
+ declare const getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
1941
3387
  declare type BulkInsertTableRecordsPathParams = {
3388
+ /**
3389
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3390
+ */
1942
3391
  dbBranchName: DBBranchName;
3392
+ /**
3393
+ * The Table name
3394
+ */
1943
3395
  tableName: TableName;
1944
3396
  workspace: string;
1945
3397
  };
1946
3398
  declare type BulkInsertTableRecordsQueryParams = {
3399
+ /**
3400
+ * Column filters
3401
+ */
1947
3402
  columns?: ColumnsProjection;
1948
3403
  };
1949
3404
  declare type BulkInsertTableRecordsError = ErrorWrapper<{
@@ -1970,9 +3425,15 @@ declare type BulkInsertTableRecordsVariables = {
1970
3425
  /**
1971
3426
  * Bulk insert records
1972
3427
  */
1973
- declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
3428
+ declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
1974
3429
  declare type QueryTablePathParams = {
3430
+ /**
3431
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
3432
+ */
1975
3433
  dbBranchName: DBBranchName;
3434
+ /**
3435
+ * The Table name
3436
+ */
1976
3437
  tableName: TableName;
1977
3438
  workspace: string;
1978
3439
  };
@@ -2026,8 +3487,9 @@ declare type QueryTableVariables = {
2026
3487
  * If the `columns` array is not specified, all columns are included. For link
2027
3488
  * fields, only the ID column of the linked records is included in the response.
2028
3489
  *
2029
- * If the `columns` array is specified, only the selected columns are included.
2030
- * The `*` wildcard can be used to select all columns of the given array
3490
+ * If the `columns` array is specified, only the selected and internal
3491
+ * columns `id` and `xata` are included. The `*` wildcard can be used to
3492
+ * select all columns.
2031
3493
  *
2032
3494
  * For objects and link fields, if the column name of the object is specified, we
2033
3495
  * include all of its sub-keys. If only some sub-keys are specified (via dotted
@@ -2143,6 +3605,10 @@ declare type QueryTableVariables = {
2143
3605
  *
2144
3606
  * ```json
2145
3607
  * {
3608
+ * "id": "id1"
3609
+ * "xata": {
3610
+ * "version": 0
3611
+ * }
2146
3612
  * "name": "Kilian",
2147
3613
  * "address": {
2148
3614
  * "street": "New street"
@@ -2162,6 +3628,10 @@ declare type QueryTableVariables = {
2162
3628
  *
2163
3629
  * ```json
2164
3630
  * {
3631
+ * "id": "id1"
3632
+ * "xata": {
3633
+ * "version": 0
3634
+ * }
2165
3635
  * "name": "Kilian",
2166
3636
  * "email": "kilian@gmail.com",
2167
3637
  * "address": {
@@ -2191,6 +3661,10 @@ declare type QueryTableVariables = {
2191
3661
  *
2192
3662
  * ```json
2193
3663
  * {
3664
+ * "id": "id1"
3665
+ * "xata": {
3666
+ * "version": 0
3667
+ * }
2194
3668
  * "name": "Kilian",
2195
3669
  * "email": "kilian@gmail.com",
2196
3670
  * "address": {
@@ -2617,8 +4091,8 @@ declare type QueryTableVariables = {
2617
4091
  *
2618
4092
  * ### Pagination
2619
4093
  *
2620
- * We offer cursor pagination and offset pagination. The offset pagination is limited
2621
- * in the amount of data it can retrieve, so we recommend the cursor pagination if you have more than 1000 records.
4094
+ * We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
4095
+ * cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
2622
4096
  *
2623
4097
  * Example of size + offset pagination:
2624
4098
  *
@@ -2717,13 +4191,337 @@ declare type QueryTableVariables = {
2717
4191
  * }
2718
4192
  * ```
2719
4193
  */
2720
- declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2721
- declare type SearchTablePathParams = {
2722
- dbBranchName: DBBranchName;
2723
- tableName: TableName;
2724
- workspace: string;
4194
+ declare const queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
4195
+ declare type SearchTablePathParams = {
4196
+ /**
4197
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4198
+ */
4199
+ dbBranchName: DBBranchName;
4200
+ /**
4201
+ * The Table name
4202
+ */
4203
+ tableName: TableName;
4204
+ workspace: string;
4205
+ };
4206
+ declare type SearchTableError = ErrorWrapper<{
4207
+ status: 400;
4208
+ payload: BadRequestError;
4209
+ } | {
4210
+ status: 401;
4211
+ payload: AuthError;
4212
+ } | {
4213
+ status: 404;
4214
+ payload: SimpleError;
4215
+ }>;
4216
+ declare type SearchTableRequestBody = {
4217
+ /**
4218
+ * The query string.
4219
+ *
4220
+ * @minLength 1
4221
+ */
4222
+ query: string;
4223
+ fuzziness?: FuzzinessExpression;
4224
+ target?: TargetExpression;
4225
+ prefix?: PrefixExpression;
4226
+ filter?: FilterExpression;
4227
+ highlight?: HighlightExpression;
4228
+ boosters?: BoosterExpression[];
4229
+ };
4230
+ declare type SearchTableVariables = {
4231
+ body: SearchTableRequestBody;
4232
+ pathParams: SearchTablePathParams;
4233
+ } & FetcherExtraProps;
4234
+ /**
4235
+ * Run a free text search operation in a particular table.
4236
+ *
4237
+ * The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
4238
+ * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
4239
+ * * filtering on columns of type `multiple` is currently unsupported
4240
+ */
4241
+ declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4242
+ declare type SearchBranchPathParams = {
4243
+ /**
4244
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4245
+ */
4246
+ dbBranchName: DBBranchName;
4247
+ workspace: string;
4248
+ };
4249
+ declare type SearchBranchError = ErrorWrapper<{
4250
+ status: 400;
4251
+ payload: BadRequestError;
4252
+ } | {
4253
+ status: 401;
4254
+ payload: AuthError;
4255
+ } | {
4256
+ status: 404;
4257
+ payload: SimpleError;
4258
+ }>;
4259
+ declare type SearchBranchRequestBody = {
4260
+ /**
4261
+ * 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.
4262
+ */
4263
+ tables?: (string | {
4264
+ /**
4265
+ * The name of the table.
4266
+ */
4267
+ table: string;
4268
+ filter?: FilterExpression;
4269
+ target?: TargetExpression;
4270
+ boosters?: BoosterExpression[];
4271
+ })[];
4272
+ /**
4273
+ * The query string.
4274
+ *
4275
+ * @minLength 1
4276
+ */
4277
+ query: string;
4278
+ fuzziness?: FuzzinessExpression;
4279
+ prefix?: PrefixExpression;
4280
+ highlight?: HighlightExpression;
4281
+ };
4282
+ declare type SearchBranchVariables = {
4283
+ body: SearchBranchRequestBody;
4284
+ pathParams: SearchBranchPathParams;
4285
+ } & FetcherExtraProps;
4286
+ /**
4287
+ * Run a free text search operation across the database branch.
4288
+ */
4289
+ declare const searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4290
+ declare type SummarizeTablePathParams = {
4291
+ /**
4292
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4293
+ */
4294
+ dbBranchName: DBBranchName;
4295
+ /**
4296
+ * The Table name
4297
+ */
4298
+ tableName: TableName;
4299
+ workspace: string;
4300
+ };
4301
+ declare type SummarizeTableError = ErrorWrapper<{
4302
+ status: 400;
4303
+ payload: BadRequestError;
4304
+ } | {
4305
+ status: 401;
4306
+ payload: AuthError;
4307
+ } | {
4308
+ status: 404;
4309
+ payload: SimpleError;
4310
+ }>;
4311
+ declare type SummarizeTableRequestBody = {
4312
+ filter?: FilterExpression;
4313
+ columns?: ColumnsProjection;
4314
+ summaries?: SummaryExpressionList;
4315
+ sort?: SortExpression;
4316
+ summariesFilter?: FilterExpression;
4317
+ };
4318
+ declare type SummarizeTableVariables = {
4319
+ body?: SummarizeTableRequestBody;
4320
+ pathParams: SummarizeTablePathParams;
4321
+ } & FetcherExtraProps;
4322
+ /**
4323
+ * This endpoint allows you to (optionally) define groups, and then to run
4324
+ * calculations on the values in each group. This is most helpful when
4325
+ * you'd like to understand the data you have in your database.
4326
+ *
4327
+ * A group is a combination of unique values. If you create a group for
4328
+ * `sold_by`, `product_name`, we will return one row for every combination
4329
+ * of `sold_by` and `product_name` you have in your database. When you
4330
+ * want to calculate statistics, you define these groups and ask Xata to
4331
+ * calculate data on each group.
4332
+ *
4333
+ * **Some questions you can ask of your data:**
4334
+ *
4335
+ * How many records do I have in this table?
4336
+ * - Set `columns: []` as we we want data from the entire table, so we ask
4337
+ * for no groups.
4338
+ * - Set `summaries: {"total": {"count": "*"}}` in order to see the count
4339
+ * of all records. We use `count: *` here we'd like to know the total
4340
+ * amount of rows; ignoring whether they are `null` or not.
4341
+ *
4342
+ * What are the top total sales for each product in July 2022 and sold
4343
+ * more than 10 units?
4344
+ * - Set `filter: {soldAt: {
4345
+ * "$ge": "2022-07-01T00:00:00.000Z",
4346
+ * "$lt": "2022-08-01T00:00:00.000Z"}
4347
+ * }`
4348
+ * in order to limit the result set to sales recorded in July 2022.
4349
+ * - Set `columns: [product_name]` as we'd like to run calculations on
4350
+ * each unique product name in our table. Setting `columns` like this will
4351
+ * produce one row per unique product name.
4352
+ * - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd
4353
+ * like to create a field called "total_sales" for each group. This field
4354
+ * will count all rows in each group with non-null product names.
4355
+ * - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with
4356
+ * the highest total_sales field to the top.
4357
+ * - Set `summariesFilters: {"total_sales": {"$ge": 10}}` to only send back data
4358
+ * with greater than or equal to 10 units.
4359
+ *
4360
+ * `columns`: tells Xata how to create each group. If you add `product_id`
4361
+ * we will create a new group for every unique `product_id`.
4362
+ *
4363
+ * `summaries`: tells Xata which calculations to run on each group.
4364
+ *
4365
+ * `sort`: tells Xata in which order you'd like to see results. You may
4366
+ * sort by fields specified in `columns` as well as the summary names
4367
+ * defined in `summaries`.
4368
+ *
4369
+ * note: Sorting on summarized values can be slower on very large tables;
4370
+ * this will impact your rate limit significantly more than other queries.
4371
+ * Try use `filter` [coming soon] to reduce the amount of data being
4372
+ * processed in order to reduce impact on your limits.
4373
+ *
4374
+ * `summariesFilter`: tells Xata how to filter the results of a summary.
4375
+ * It has the same syntax as `filter`, however, by using `summariesFilter`
4376
+ * you may also filter on the results of a query.
4377
+ *
4378
+ * note: This is a much slower to use than `filter`. We recommend using
4379
+ * `filter` wherever possible and `summariesFilter` when it's not
4380
+ * possible to use `filter`.
4381
+ */
4382
+ declare const summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
4383
+ declare type AggregateTablePathParams = {
4384
+ /**
4385
+ * The DBBranchName matches the pattern `{db_name}:{branch_name}`.
4386
+ */
4387
+ dbBranchName: DBBranchName;
4388
+ /**
4389
+ * The Table name
4390
+ */
4391
+ tableName: TableName;
4392
+ workspace: string;
4393
+ };
4394
+ declare type AggregateTableError = ErrorWrapper<{
4395
+ status: 400;
4396
+ payload: BadRequestError;
4397
+ } | {
4398
+ status: 401;
4399
+ payload: AuthError;
4400
+ } | {
4401
+ status: 404;
4402
+ payload: SimpleError;
4403
+ }>;
4404
+ declare type AggregateTableRequestBody = {
4405
+ filter?: FilterExpression;
4406
+ aggs?: AggExpressionMap;
4407
+ };
4408
+ declare type AggregateTableVariables = {
4409
+ body?: AggregateTableRequestBody;
4410
+ pathParams: AggregateTablePathParams;
4411
+ } & FetcherExtraProps;
4412
+ /**
4413
+ * This endpoint allows you to run aggragations (analytics) on the data from one table.
4414
+ * While the summary endpoint is served from a transactional store and the results are strongly
4415
+ * consistent, the aggregate endpoint is served from our columnar store and the results are
4416
+ * only eventually consistent. On the other hand, the aggregate endpoint uses a
4417
+ * store that is more appropiate for analytics, makes use of approximative algorithms
4418
+ * (e.g for cardinality), and is generally faster and can do more complex aggregations.
4419
+ */
4420
+ declare const aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
4421
+ declare type CPGetDatabaseListPathParams = {
4422
+ /**
4423
+ * Workspace ID
4424
+ */
4425
+ workspaceId: WorkspaceID;
4426
+ };
4427
+ declare type CPGetDatabaseListError = ErrorWrapper<{
4428
+ status: 400;
4429
+ payload: BadRequestError;
4430
+ } | {
4431
+ status: 401;
4432
+ payload: AuthError;
4433
+ }>;
4434
+ declare type CPGetDatabaseListVariables = {
4435
+ pathParams: CPGetDatabaseListPathParams;
4436
+ } & FetcherExtraProps;
4437
+ /**
4438
+ * List all databases available in your Workspace.
4439
+ */
4440
+ declare const cPGetDatabaseList: (variables: CPGetDatabaseListVariables, signal?: AbortSignal) => Promise<CPListDatabasesResponse>;
4441
+ declare type CPCreateDatabasePathParams = {
4442
+ /**
4443
+ * Workspace ID
4444
+ */
4445
+ workspaceId: WorkspaceID;
4446
+ /**
4447
+ * The Database Name
4448
+ */
4449
+ dbName: DBName;
4450
+ };
4451
+ declare type CPCreateDatabaseError = ErrorWrapper<{
4452
+ status: 400;
4453
+ payload: BadRequestError;
4454
+ } | {
4455
+ status: 401;
4456
+ payload: AuthError;
4457
+ }>;
4458
+ declare type CPCreateDatabaseResponse = {
4459
+ /**
4460
+ * @minLength 1
4461
+ */
4462
+ databaseName?: string;
4463
+ branchName?: string;
4464
+ };
4465
+ declare type CPCreateDatabaseRequestBody = {
4466
+ /**
4467
+ * @minLength 1
4468
+ */
4469
+ branchName?: string;
4470
+ /**
4471
+ * @minLength 1
4472
+ */
4473
+ region: string;
4474
+ ui?: {
4475
+ color?: string;
4476
+ };
4477
+ metadata?: BranchMetadata;
4478
+ };
4479
+ declare type CPCreateDatabaseVariables = {
4480
+ body: CPCreateDatabaseRequestBody;
4481
+ pathParams: CPCreateDatabasePathParams;
4482
+ } & FetcherExtraProps;
4483
+ /**
4484
+ * Create Database with identifier name
4485
+ */
4486
+ declare const cPCreateDatabase: (variables: CPCreateDatabaseVariables, signal?: AbortSignal) => Promise<CPCreateDatabaseResponse>;
4487
+ declare type CPDeleteDatabasePathParams = {
4488
+ /**
4489
+ * Workspace ID
4490
+ */
4491
+ workspaceId: WorkspaceID;
4492
+ /**
4493
+ * The Database Name
4494
+ */
4495
+ dbName: DBName;
4496
+ };
4497
+ declare type CPDeleteDatabaseError = ErrorWrapper<{
4498
+ status: 400;
4499
+ payload: BadRequestError;
4500
+ } | {
4501
+ status: 401;
4502
+ payload: AuthError;
4503
+ } | {
4504
+ status: 404;
4505
+ payload: SimpleError;
4506
+ }>;
4507
+ declare type CPDeleteDatabaseVariables = {
4508
+ pathParams: CPDeleteDatabasePathParams;
4509
+ } & FetcherExtraProps;
4510
+ /**
4511
+ * Delete a database and all of its branches and tables permanently.
4512
+ */
4513
+ declare const cPDeleteDatabase: (variables: CPDeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
4514
+ declare type CPGetCPDatabaseMetadataPathParams = {
4515
+ /**
4516
+ * Workspace ID
4517
+ */
4518
+ workspaceId: WorkspaceID;
4519
+ /**
4520
+ * The Database Name
4521
+ */
4522
+ dbName: DBName;
2725
4523
  };
2726
- declare type SearchTableError = ErrorWrapper<{
4524
+ declare type CPGetCPDatabaseMetadataError = ErrorWrapper<{
2727
4525
  status: 400;
2728
4526
  payload: BadRequestError;
2729
4527
  } | {
@@ -2733,31 +4531,24 @@ declare type SearchTableError = ErrorWrapper<{
2733
4531
  status: 404;
2734
4532
  payload: SimpleError;
2735
4533
  }>;
2736
- declare type SearchTableRequestBody = {
2737
- query: string;
2738
- fuzziness?: FuzzinessExpression;
2739
- prefix?: PrefixExpression;
2740
- filter?: FilterExpression;
2741
- highlight?: HighlightExpression;
2742
- boosters?: BoosterExpression[];
2743
- };
2744
- declare type SearchTableVariables = {
2745
- body: SearchTableRequestBody;
2746
- pathParams: SearchTablePathParams;
4534
+ declare type CPGetCPDatabaseMetadataVariables = {
4535
+ pathParams: CPGetCPDatabaseMetadataPathParams;
2747
4536
  } & FetcherExtraProps;
2748
4537
  /**
2749
- * Run a free text search operation in a particular table.
2750
- *
2751
- * The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
2752
- * * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
2753
- * * filtering on columns of type `multiple` is currently unsupported
4538
+ * Retrieve metadata of the given database
2754
4539
  */
2755
- declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2756
- declare type SearchBranchPathParams = {
2757
- dbBranchName: DBBranchName;
2758
- workspace: string;
4540
+ declare const cPGetCPDatabaseMetadata: (variables: CPGetCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
4541
+ declare type CPUpdateCPDatabaseMetadataPathParams = {
4542
+ /**
4543
+ * Workspace ID
4544
+ */
4545
+ workspaceId: WorkspaceID;
4546
+ /**
4547
+ * The Database Name
4548
+ */
4549
+ dbName: DBName;
2759
4550
  };
2760
- declare type SearchBranchError = ErrorWrapper<{
4551
+ declare type CPUpdateCPDatabaseMetadataError = ErrorWrapper<{
2761
4552
  status: 400;
2762
4553
  payload: BadRequestError;
2763
4554
  } | {
@@ -2767,92 +4558,119 @@ declare type SearchBranchError = ErrorWrapper<{
2767
4558
  status: 404;
2768
4559
  payload: SimpleError;
2769
4560
  }>;
2770
- declare type SearchBranchRequestBody = {
2771
- tables?: (string | {
2772
- table: string;
2773
- filter?: FilterExpression;
2774
- boosters?: BoosterExpression[];
2775
- })[];
2776
- query: string;
2777
- fuzziness?: FuzzinessExpression;
2778
- highlight?: HighlightExpression;
4561
+ declare type CPUpdateCPDatabaseMetadataRequestBody = {
4562
+ ui?: {
4563
+ /**
4564
+ * @minLength 1
4565
+ */
4566
+ color?: string;
4567
+ };
2779
4568
  };
2780
- declare type SearchBranchVariables = {
2781
- body: SearchBranchRequestBody;
2782
- pathParams: SearchBranchPathParams;
4569
+ declare type CPUpdateCPDatabaseMetadataVariables = {
4570
+ body?: CPUpdateCPDatabaseMetadataRequestBody;
4571
+ pathParams: CPUpdateCPDatabaseMetadataPathParams;
2783
4572
  } & FetcherExtraProps;
2784
4573
  /**
2785
- * Run a free text search operation across the database branch.
4574
+ * Update the color of the selected database
2786
4575
  */
2787
- declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
4576
+ declare const cPUpdateCPDatabaseMetadata: (variables: CPUpdateCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
2788
4577
  declare const operationsByTag: {
2789
4578
  users: {
2790
- getUser: (variables: GetUserVariables) => Promise<UserWithID>;
2791
- updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
2792
- deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
2793
- getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
2794
- createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
2795
- deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
4579
+ getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
4580
+ updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
4581
+ deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
4582
+ getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
4583
+ createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
4584
+ deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
2796
4585
  };
2797
4586
  workspaces: {
2798
- createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
2799
- getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
2800
- getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
2801
- updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
2802
- deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
2803
- getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
2804
- updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
2805
- removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
2806
- inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
2807
- updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
2808
- cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
2809
- resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
2810
- acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
4587
+ createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
4588
+ getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
4589
+ getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
4590
+ updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
4591
+ deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
4592
+ getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
4593
+ updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
4594
+ removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
4595
+ inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
4596
+ updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
4597
+ cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
4598
+ resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
4599
+ acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
2811
4600
  };
2812
4601
  database: {
2813
- getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
2814
- createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
2815
- deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
2816
- getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
2817
- addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
2818
- removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
2819
- resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
4602
+ getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
4603
+ createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
4604
+ deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
4605
+ getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
4606
+ updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
4607
+ getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
4608
+ addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
4609
+ removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
4610
+ resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
2820
4611
  };
2821
4612
  branch: {
2822
- getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
2823
- getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
2824
- createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
2825
- deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
2826
- updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
2827
- getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
2828
- getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
2829
- executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
2830
- getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
2831
- getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
4613
+ getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
4614
+ getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
4615
+ createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
4616
+ deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
4617
+ updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
4618
+ getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
4619
+ getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
4620
+ };
4621
+ migrationRequests: {
4622
+ queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
4623
+ createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
4624
+ getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
4625
+ updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
4626
+ listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
4627
+ compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
4628
+ getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
4629
+ mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
4630
+ };
4631
+ branchSchema: {
4632
+ getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
4633
+ executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
4634
+ getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
4635
+ compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
4636
+ compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
4637
+ updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
4638
+ previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
4639
+ applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
4640
+ getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
2832
4641
  };
2833
4642
  table: {
2834
- createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
2835
- deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
2836
- updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
2837
- getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
2838
- setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
2839
- getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
2840
- addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
2841
- getColumn: (variables: GetColumnVariables) => Promise<Column>;
2842
- deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
2843
- updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
4643
+ createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
4644
+ deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
4645
+ updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
4646
+ getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
4647
+ setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
4648
+ getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
4649
+ addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
4650
+ getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
4651
+ deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
4652
+ updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
2844
4653
  };
2845
4654
  records: {
2846
- insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
2847
- insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2848
- updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2849
- upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
2850
- deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
2851
- getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
2852
- bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
2853
- queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
2854
- searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
2855
- searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
4655
+ insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4656
+ insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4657
+ updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4658
+ upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
4659
+ deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
4660
+ getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
4661
+ bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
4662
+ queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
4663
+ searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4664
+ searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
4665
+ summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
4666
+ aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
4667
+ };
4668
+ databases: {
4669
+ cPGetDatabaseList: (variables: CPGetDatabaseListVariables, signal?: AbortSignal) => Promise<CPListDatabasesResponse>;
4670
+ cPCreateDatabase: (variables: CPCreateDatabaseVariables, signal?: AbortSignal) => Promise<CPCreateDatabaseResponse>;
4671
+ cPDeleteDatabase: (variables: CPDeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
4672
+ cPGetCPDatabaseMetadata: (variables: CPGetCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
4673
+ cPUpdateCPDatabaseMetadata: (variables: CPUpdateCPDatabaseMetadataVariables, signal?: AbortSignal) => Promise<CPDatabaseMetadata>;
2856
4674
  };
2857
4675
  };
2858
4676
 
@@ -2862,15 +4680,17 @@ declare type ProviderBuilder = {
2862
4680
  workspaces: string;
2863
4681
  };
2864
4682
  declare type HostProvider = HostAliases | ProviderBuilder;
4683
+ declare function getHostUrl(provider: HostProvider, type: keyof ProviderBuilder): string;
4684
+ declare function isHostProviderAlias(alias: HostProvider | string): alias is HostAliases;
4685
+ declare function isHostProviderBuilder(builder: HostProvider): builder is ProviderBuilder;
4686
+ declare function parseProviderString(provider?: string): HostProvider | null;
2865
4687
 
2866
4688
  interface XataApiClientOptions {
2867
4689
  fetch?: FetchImpl;
2868
4690
  apiKey?: string;
2869
4691
  host?: HostProvider;
4692
+ trace?: TraceFunction;
2870
4693
  }
2871
- /**
2872
- * @deprecated Use XataApiPlugin instead
2873
- */
2874
4694
  declare class XataApiClient {
2875
4695
  #private;
2876
4696
  constructor(options?: XataApiClientOptions);
@@ -2880,6 +4700,8 @@ declare class XataApiClient {
2880
4700
  get branches(): BranchApi;
2881
4701
  get tables(): TableApi;
2882
4702
  get records(): RecordsApi;
4703
+ get migrationRequests(): MigrationRequestsApi;
4704
+ get branchSchema(): BranchSchemaApi;
2883
4705
  }
2884
4706
  declare class UserApi {
2885
4707
  private extraProps;
@@ -2914,6 +4736,8 @@ declare class DatabaseApi {
2914
4736
  getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
2915
4737
  createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
2916
4738
  deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
4739
+ getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
4740
+ updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
2917
4741
  getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
2918
4742
  addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
2919
4743
  removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
@@ -2928,9 +4752,6 @@ declare class BranchApi {
2928
4752
  deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
2929
4753
  updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
2930
4754
  getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
2931
- getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
2932
- executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
2933
- getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
2934
4755
  getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
2935
4756
  }
2936
4757
  declare class TableApi {
@@ -2960,6 +4781,32 @@ declare class RecordsApi {
2960
4781
  queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
2961
4782
  searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
2962
4783
  searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
4784
+ summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
4785
+ }
4786
+ declare class MigrationRequestsApi {
4787
+ private extraProps;
4788
+ constructor(extraProps: FetcherExtraProps);
4789
+ queryMigrationRequests(workspace: WorkspaceID, database: DBName, options?: QueryMigrationRequestsRequestBody): Promise<QueryMigrationRequestsResponse>;
4790
+ createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
4791
+ getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
4792
+ updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
4793
+ listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
4794
+ compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
4795
+ getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
4796
+ mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
4797
+ }
4798
+ declare class BranchSchemaApi {
4799
+ private extraProps;
4800
+ constructor(extraProps: FetcherExtraProps);
4801
+ getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
4802
+ executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
4803
+ getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
4804
+ compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
4805
+ compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
4806
+ updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
4807
+ previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
4808
+ applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
4809
+ getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
2963
4810
  }
2964
4811
 
2965
4812
  declare class XataApiPlugin implements XataPlugin {
@@ -3029,12 +4876,12 @@ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> e
3029
4876
  /**
3030
4877
  * Retrieves a refreshed copy of the current record from the database.
3031
4878
  * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3032
- * @returns The persisted record with the selected columns.
4879
+ * @returns The persisted record with the selected columns, null if not found.
3033
4880
  */
3034
4881
  read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
3035
4882
  /**
3036
4883
  * Retrieves a refreshed copy of the current record from the database.
3037
- * @returns The persisted record with all first level properties.
4884
+ * @returns The persisted record with all first level properties, null if not found.
3038
4885
  */
3039
4886
  read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
3040
4887
  /**
@@ -3042,42 +4889,30 @@ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> e
3042
4889
  * returned and the current object is not mutated.
3043
4890
  * @param partialUpdate The columns and their values that have to be updated.
3044
4891
  * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
3045
- * @returns The persisted record with the selected columns.
4892
+ * @returns The persisted record with the selected columns, null if not found.
3046
4893
  */
3047
- update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>>>;
4894
+ update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
3048
4895
  /**
3049
4896
  * Performs a partial update of the current record. On success a new object is
3050
4897
  * returned and the current object is not mutated.
3051
4898
  * @param partialUpdate The columns and their values that have to be updated.
3052
- * @returns The persisted record with all first level properties.
4899
+ * @returns The persisted record with all first level properties, null if not found.
3053
4900
  */
3054
- update(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>>>;
4901
+ update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
3055
4902
  /**
3056
4903
  * Performs a deletion of the current record in the database.
3057
- *
3058
- * @throws If the record was already deleted or if an error happened while performing the deletion.
3059
- */
3060
- delete(): Promise<void>;
3061
- }
3062
- declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
3063
- /**
3064
- * Retrieves a refreshed copy of the current record from the database.
3065
- */
3066
- read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
3067
- /**
3068
- * Performs a partial update of the current record. On success a new object is
3069
- * returned and the current object is not mutated.
3070
- * @param partialUpdate The columns and their values that have to be updated.
3071
- * @returns A new record containing the latest values for all the columns of the current record.
4904
+ * @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
4905
+ * @returns The deleted record, null if not found.
3072
4906
  */
3073
- update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
4907
+ delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
3074
4908
  /**
3075
4909
  * Performs a deletion of the current record in the database.
3076
- *
3077
- * @throws If the record was already deleted or if an error happened while performing the deletion.
4910
+ * @returns The deleted record, null if not found.
4911
+
3078
4912
  */
3079
- delete(): Promise<void>;
3080
- };
4913
+ delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
4914
+ }
4915
+ declare type Link<Record extends XataRecord> = XataRecord<Record>;
3081
4916
  declare type XataRecordMetadata = {
3082
4917
  /**
3083
4918
  * Number that is increased every time the record is updated.
@@ -3087,13 +4922,13 @@ declare type XataRecordMetadata = {
3087
4922
  };
3088
4923
  declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
3089
4924
  declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
3090
- declare type EditableData<O extends BaseData> = {
4925
+ declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
3091
4926
  [K in keyof O]: O[K] extends XataRecord ? {
3092
4927
  id: string;
3093
4928
  } | string : NonNullable<O[K]> extends XataRecord ? {
3094
4929
  id: string;
3095
4930
  } | string | null | undefined : O[K];
3096
- };
4931
+ }, keyof XataRecord>;
3097
4932
 
3098
4933
  /**
3099
4934
  * PropertyMatchFilter
@@ -3187,7 +5022,7 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
3187
5022
  declare type NestedApiFilter<T> = {
3188
5023
  [key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
3189
5024
  };
3190
- declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
5025
+ 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>;
3191
5026
 
3192
5027
  declare type DateBooster = {
3193
5028
  origin?: string;
@@ -3221,6 +5056,21 @@ declare type Boosters<O extends XataRecord> = Values<{
3221
5056
  } : never;
3222
5057
  }>;
3223
5058
 
5059
+ declare type TargetColumn<T extends XataRecord> = SelectableColumn<T> | {
5060
+ /**
5061
+ * The name of the column.
5062
+ */
5063
+ column: SelectableColumn<T>;
5064
+ /**
5065
+ * The weight of the column.
5066
+ *
5067
+ * @default 1
5068
+ * @maximum 10
5069
+ * @minimum 1
5070
+ */
5071
+ weight?: number;
5072
+ };
5073
+
3224
5074
  declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
3225
5075
  fuzziness?: FuzzinessExpression;
3226
5076
  prefix?: PrefixExpression;
@@ -3228,6 +5078,7 @@ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables exte
3228
5078
  tables?: Array<Tables | Values<{
3229
5079
  [Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
3230
5080
  table: Model;
5081
+ target?: TargetColumn<Schemas[Model] & XataRecord>[];
3231
5082
  filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
3232
5083
  boosters?: Boosters<Schemas[Model] & XataRecord>[];
3233
5084
  };
@@ -3244,7 +5095,7 @@ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
3244
5095
  [Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
3245
5096
  }>;
3246
5097
  };
3247
- declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
5098
+ declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
3248
5099
  #private;
3249
5100
  private db;
3250
5101
  constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
@@ -3302,7 +5153,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3302
5153
  #private;
3303
5154
  readonly meta: PaginationQueryMeta;
3304
5155
  readonly records: RecordArray<Result>;
3305
- constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
5156
+ constructor(repository: Repository<Record> | null, table: {
5157
+ name: string;
5158
+ schema?: Table;
5159
+ }, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
3306
5160
  getQueryOptions(): QueryOptions<Record>;
3307
5161
  key(): string;
3308
5162
  /**
@@ -3341,7 +5195,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3341
5195
  * @param value The value to filter.
3342
5196
  * @returns A new Query object.
3343
5197
  */
3344
- filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
5198
+ filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
3345
5199
  /**
3346
5200
  * Builds a new query object adding one or more constraints. Examples:
3347
5201
  *
@@ -3355,14 +5209,14 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3355
5209
  * @param filters A filter object
3356
5210
  * @returns A new Query object.
3357
5211
  */
3358
- filter(filters: Filter<Record>): Query<Record, Result>;
5212
+ filter(filters?: Filter<Record>): Query<Record, Result>;
3359
5213
  /**
3360
5214
  * Builds a new query with a new sort option.
3361
5215
  * @param column The column name.
3362
5216
  * @param direction The direction. Either ascending or descending.
3363
5217
  * @returns A new Query object.
3364
5218
  */
3365
- sort<F extends SelectableColumn<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
5219
+ sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
3366
5220
  /**
3367
5221
  * Builds a new query specifying the set of columns to be returned in the query response.
3368
5222
  * @param columns Array of column names to be returned by the query.
@@ -3478,6 +5332,26 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
3478
5332
  * @returns The first record that matches the query, or null if no record matched the query.
3479
5333
  */
3480
5334
  getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
5335
+ /**
5336
+ * Performs the query in the database and returns the first result.
5337
+ * @returns The first record that matches the query, or null if no record matched the query.
5338
+ * @throws if there are no results.
5339
+ */
5340
+ getFirstOrThrow(): Promise<Result>;
5341
+ /**
5342
+ * Performs the query in the database and returns the first result.
5343
+ * @param options Additional options to be used when performing the query.
5344
+ * @returns The first record that matches the query, or null if no record matched the query.
5345
+ * @throws if there are no results.
5346
+ */
5347
+ getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
5348
+ /**
5349
+ * Performs the query in the database and returns the first result.
5350
+ * @param options Additional options to be used when performing the query.
5351
+ * @returns The first record that matches the query, or null if no record matched the query.
5352
+ * @throws if there are no results.
5353
+ */
5354
+ getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
3481
5355
  /**
3482
5356
  * Builds a new query object adding a cache TTL in milliseconds.
3483
5357
  * @param ttl The cache TTL in milliseconds.
@@ -3634,9 +5508,9 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
3634
5508
  /**
3635
5509
  * Common interface for performing operations on a table.
3636
5510
  */
3637
- declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
3638
- abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Data>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3639
- abstract create(object: Omit<EditableData<Data>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5511
+ declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
5512
+ abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5513
+ abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3640
5514
  /**
3641
5515
  * Creates a single record in the table with a unique id.
3642
5516
  * @param id The unique id.
@@ -3644,27 +5518,27 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3644
5518
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3645
5519
  * @returns The full persisted record.
3646
5520
  */
3647
- abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5521
+ abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3648
5522
  /**
3649
5523
  * Creates a single record in the table with a unique id.
3650
5524
  * @param id The unique id.
3651
5525
  * @param object Object containing the column names with their values to be stored in the table.
3652
5526
  * @returns The full persisted record.
3653
5527
  */
3654
- abstract create(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5528
+ abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3655
5529
  /**
3656
5530
  * Creates multiple records in the table.
3657
5531
  * @param objects Array of objects with the column names and the values to be stored in the table.
3658
5532
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3659
5533
  * @returns Array of the persisted records in order.
3660
5534
  */
3661
- abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Data>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5535
+ abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3662
5536
  /**
3663
5537
  * Creates multiple records in the table.
3664
5538
  * @param objects Array of objects with the column names and the values to be stored in the table.
3665
5539
  * @returns Array of the persisted records in order.
3666
5540
  */
3667
- abstract create(objects: Array<Omit<EditableData<Data>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5541
+ abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3668
5542
  /**
3669
5543
  * Queries a single record from the table given its unique id.
3670
5544
  * @param id The unique id.
@@ -3717,47 +5591,154 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3717
5591
  * @returns The persisted records for the given ids in order (if a record could not be found null is returned).
3718
5592
  */
3719
5593
  abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5594
+ /**
5595
+ * Queries a single record from the table given its unique id.
5596
+ * @param id The unique id.
5597
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5598
+ * @returns The persisted record for the given id.
5599
+ * @throws If the record could not be found.
5600
+ */
5601
+ abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5602
+ /**
5603
+ * Queries a single record from the table given its unique id.
5604
+ * @param id The unique id.
5605
+ * @returns The persisted record for the given id.
5606
+ * @throws If the record could not be found.
5607
+ */
5608
+ abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5609
+ /**
5610
+ * Queries multiple records from the table given their unique id.
5611
+ * @param ids The unique ids array.
5612
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5613
+ * @returns The persisted records for the given ids in order.
5614
+ * @throws If one or more records could not be found.
5615
+ */
5616
+ abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5617
+ /**
5618
+ * Queries multiple records from the table given their unique id.
5619
+ * @param ids The unique ids array.
5620
+ * @returns The persisted records for the given ids in order.
5621
+ * @throws If one or more records could not be found.
5622
+ */
5623
+ abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5624
+ /**
5625
+ * Queries a single record from the table by the id in the object.
5626
+ * @param object Object containing the id of the record.
5627
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5628
+ * @returns The persisted record for the given id.
5629
+ * @throws If the record could not be found.
5630
+ */
5631
+ abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5632
+ /**
5633
+ * Queries a single record from the table by the id in the object.
5634
+ * @param object Object containing the id of the record.
5635
+ * @returns The persisted record for the given id.
5636
+ * @throws If the record could not be found.
5637
+ */
5638
+ abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5639
+ /**
5640
+ * Queries multiple records from the table by the ids in the objects.
5641
+ * @param objects Array of objects containing the ids of the records.
5642
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5643
+ * @returns The persisted records for the given ids in order.
5644
+ * @throws If one or more records could not be found.
5645
+ */
5646
+ abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5647
+ /**
5648
+ * Queries multiple records from the table by the ids in the objects.
5649
+ * @param objects Array of objects containing the ids of the records.
5650
+ * @returns The persisted records for the given ids in order.
5651
+ * @throws If one or more records could not be found.
5652
+ */
5653
+ abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5654
+ /**
5655
+ * Partially update a single record.
5656
+ * @param object An object with its id and the columns to be updated.
5657
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5658
+ * @returns The full persisted record, null if the record could not be found.
5659
+ */
5660
+ abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5661
+ /**
5662
+ * Partially update a single record.
5663
+ * @param object An object with its id and the columns to be updated.
5664
+ * @returns The full persisted record, null if the record could not be found.
5665
+ */
5666
+ abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5667
+ /**
5668
+ * Partially update a single record given its unique id.
5669
+ * @param id The unique id.
5670
+ * @param object The column names and their values that have to be updated.
5671
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5672
+ * @returns The full persisted record, null if the record could not be found.
5673
+ */
5674
+ abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5675
+ /**
5676
+ * Partially update a single record given its unique id.
5677
+ * @param id The unique id.
5678
+ * @param object The column names and their values that have to be updated.
5679
+ * @returns The full persisted record, null if the record could not be found.
5680
+ */
5681
+ abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5682
+ /**
5683
+ * Partially updates multiple records.
5684
+ * @param objects An array of objects with their ids and columns to be updated.
5685
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5686
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
5687
+ */
5688
+ abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5689
+ /**
5690
+ * Partially updates multiple records.
5691
+ * @param objects An array of objects with their ids and columns to be updated.
5692
+ * @returns Array of the persisted records in order (if a record could not be found null is returned).
5693
+ */
5694
+ abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
3720
5695
  /**
3721
5696
  * Partially update a single record.
3722
5697
  * @param object An object with its id and the columns to be updated.
3723
5698
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3724
5699
  * @returns The full persisted record.
5700
+ * @throws If the record could not be found.
3725
5701
  */
3726
- abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5702
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3727
5703
  /**
3728
5704
  * Partially update a single record.
3729
5705
  * @param object An object with its id and the columns to be updated.
3730
5706
  * @returns The full persisted record.
5707
+ * @throws If the record could not be found.
3731
5708
  */
3732
- abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5709
+ abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3733
5710
  /**
3734
5711
  * Partially update a single record given its unique id.
3735
5712
  * @param id The unique id.
3736
5713
  * @param object The column names and their values that have to be updated.
3737
5714
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3738
5715
  * @returns The full persisted record.
5716
+ * @throws If the record could not be found.
3739
5717
  */
3740
- abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5718
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3741
5719
  /**
3742
5720
  * Partially update a single record given its unique id.
3743
5721
  * @param id The unique id.
3744
5722
  * @param object The column names and their values that have to be updated.
3745
5723
  * @returns The full persisted record.
5724
+ * @throws If the record could not be found.
3746
5725
  */
3747
- abstract update(id: string, object: Partial<EditableData<Data>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5726
+ abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3748
5727
  /**
3749
5728
  * Partially updates multiple records.
3750
5729
  * @param objects An array of objects with their ids and columns to be updated.
3751
5730
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3752
5731
  * @returns Array of the persisted records in order.
5732
+ * @throws If one or more records could not be found.
3753
5733
  */
3754
- abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5734
+ abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3755
5735
  /**
3756
5736
  * Partially updates multiple records.
3757
5737
  * @param objects An array of objects with their ids and columns to be updated.
3758
5738
  * @returns Array of the persisted records in order.
5739
+ * @throws If one or more records could not be found.
3759
5740
  */
3760
- abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5741
+ abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3761
5742
  /**
3762
5743
  * Creates or updates a single record. If a record exists with the given id,
3763
5744
  * it will be update, otherwise a new record will be created.
@@ -3765,14 +5746,14 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3765
5746
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3766
5747
  * @returns The full persisted record.
3767
5748
  */
3768
- abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5749
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3769
5750
  /**
3770
5751
  * Creates or updates a single record. If a record exists with the given id,
3771
5752
  * it will be update, otherwise a new record will be created.
3772
5753
  * @param object Object containing the column names with their values to be persisted in the table.
3773
5754
  * @returns The full persisted record.
3774
5755
  */
3775
- abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5756
+ abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3776
5757
  /**
3777
5758
  * Creates or updates a single record. If a record exists with the given id,
3778
5759
  * it will be update, otherwise a new record will be created.
@@ -3781,7 +5762,7 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3781
5762
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3782
5763
  * @returns The full persisted record.
3783
5764
  */
3784
- abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5765
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3785
5766
  /**
3786
5767
  * Creates or updates a single record. If a record exists with the given id,
3787
5768
  * it will be update, otherwise a new record will be created.
@@ -3789,7 +5770,7 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3789
5770
  * @param object The column names and the values to be persisted.
3790
5771
  * @returns The full persisted record.
3791
5772
  */
3792
- abstract createOrUpdate(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5773
+ abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3793
5774
  /**
3794
5775
  * Creates or updates a single record. If a record exists with the given id,
3795
5776
  * it will be update, otherwise a new record will be created.
@@ -3797,38 +5778,126 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3797
5778
  * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
3798
5779
  * @returns Array of the persisted records.
3799
5780
  */
3800
- abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Data> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5781
+ abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3801
5782
  /**
3802
5783
  * Creates or updates a single record. If a record exists with the given id,
3803
5784
  * it will be update, otherwise a new record will be created.
3804
5785
  * @param objects Array of objects with the column names and the values to be stored in the table.
3805
5786
  * @returns Array of the persisted records.
3806
5787
  */
3807
- abstract createOrUpdate(objects: Array<EditableData<Data> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5788
+ abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5789
+ /**
5790
+ * Deletes a record given its unique id.
5791
+ * @param object An object with a unique id.
5792
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5793
+ * @returns The deleted record, null if the record could not be found.
5794
+ */
5795
+ abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3808
5796
  /**
3809
5797
  * Deletes a record given its unique id.
5798
+ * @param object An object with a unique id.
5799
+ * @returns The deleted record, null if the record could not be found.
5800
+ */
5801
+ abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5802
+ /**
5803
+ * Deletes a record given a unique id.
5804
+ * @param id The unique id.
5805
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5806
+ * @returns The deleted record, null if the record could not be found.
5807
+ */
5808
+ abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5809
+ /**
5810
+ * Deletes a record given a unique id.
3810
5811
  * @param id The unique id.
3811
- * @throws If the record could not be found or there was an error while performing the deletion.
5812
+ * @returns The deleted record, null if the record could not be found.
5813
+ */
5814
+ abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5815
+ /**
5816
+ * Deletes multiple records given an array of objects with ids.
5817
+ * @param objects An array of objects with unique ids.
5818
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5819
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
3812
5820
  */
3813
- abstract delete(id: string): Promise<void>;
5821
+ abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5822
+ /**
5823
+ * Deletes multiple records given an array of objects with ids.
5824
+ * @param objects An array of objects with unique ids.
5825
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5826
+ */
5827
+ abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5828
+ /**
5829
+ * Deletes multiple records given an array of unique ids.
5830
+ * @param objects An array of ids.
5831
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5832
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5833
+ */
5834
+ abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5835
+ /**
5836
+ * Deletes multiple records given an array of unique ids.
5837
+ * @param objects An array of ids.
5838
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5839
+ */
5840
+ abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5841
+ /**
5842
+ * Deletes a record given its unique id.
5843
+ * @param object An object with a unique id.
5844
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5845
+ * @returns The deleted record, null if the record could not be found.
5846
+ * @throws If the record could not be found.
5847
+ */
5848
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3814
5849
  /**
3815
5850
  * Deletes a record given its unique id.
3816
- * @param id An object with a unique id.
3817
- * @throws If the record could not be found or there was an error while performing the deletion.
5851
+ * @param object An object with a unique id.
5852
+ * @returns The deleted record, null if the record could not be found.
5853
+ * @throws If the record could not be found.
5854
+ */
5855
+ abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5856
+ /**
5857
+ * Deletes a record given a unique id.
5858
+ * @param id The unique id.
5859
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5860
+ * @returns The deleted record, null if the record could not be found.
5861
+ * @throws If the record could not be found.
5862
+ */
5863
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5864
+ /**
5865
+ * Deletes a record given a unique id.
5866
+ * @param id The unique id.
5867
+ * @returns The deleted record, null if the record could not be found.
5868
+ * @throws If the record could not be found.
5869
+ */
5870
+ abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5871
+ /**
5872
+ * Deletes multiple records given an array of objects with ids.
5873
+ * @param objects An array of objects with unique ids.
5874
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5875
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5876
+ * @throws If one or more records could not be found.
5877
+ */
5878
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5879
+ /**
5880
+ * Deletes multiple records given an array of objects with ids.
5881
+ * @param objects An array of objects with unique ids.
5882
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5883
+ * @throws If one or more records could not be found.
3818
5884
  */
3819
- abstract delete(id: Identifiable): Promise<void>;
5885
+ abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3820
5886
  /**
3821
- * Deletes a record given a list of unique ids.
3822
- * @param ids The array of unique ids.
3823
- * @throws If the record could not be found or there was an error while performing the deletion.
5887
+ * Deletes multiple records given an array of unique ids.
5888
+ * @param objects An array of ids.
5889
+ * @param columns Array of columns to be returned. If not specified, first level columns will be returned.
5890
+ * @returns Array of the deleted records in order (if a record could not be found null is returned).
5891
+ * @throws If one or more records could not be found.
3824
5892
  */
3825
- abstract delete(ids: string[]): Promise<void>;
5893
+ abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3826
5894
  /**
3827
- * Deletes a record given a list of unique ids.
3828
- * @param ids An array of objects with unique ids.
3829
- * @throws If the record could not be found or there was an error while performing the deletion.
5895
+ * Deletes multiple records given an array of unique ids.
5896
+ * @param objects An array of ids.
5897
+ * @returns Array of the deleted records in order.
5898
+ * @throws If one or more records could not be found.
3830
5899
  */
3831
- abstract delete(ids: Identifiable[]): Promise<void>;
5900
+ abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3832
5901
  /**
3833
5902
  * Search for records in the table.
3834
5903
  * @param query The query to search for.
@@ -3844,7 +5913,7 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
3844
5913
  }): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
3845
5914
  abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
3846
5915
  }
3847
- declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
5916
+ declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
3848
5917
  #private;
3849
5918
  constructor(options: {
3850
5919
  table: string;
@@ -3852,33 +5921,62 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
3852
5921
  pluginOptions: XataPluginOptions;
3853
5922
  schemaTables?: Table[];
3854
5923
  });
3855
- create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3856
- create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
3857
- create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
3858
- create<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3859
- create<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
3860
- create<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
3861
- read(recordId: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3862
- read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3863
- read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
3864
- read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3865
- read<K extends SelectableColumn<Record>>(recordId: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3866
- read<K extends SelectableColumn<Record>>(recordIds: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3867
- read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
3868
- read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
3869
- update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
3870
- update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
3871
- update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
3872
- update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3873
- update<K extends SelectableColumn<Record>>(recordId: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3874
- update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
3875
- createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3876
- createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
3877
- createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
3878
- createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3879
- createOrUpdate<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
3880
- createOrUpdate<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
3881
- delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
5924
+ create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5925
+ create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5926
+ create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5927
+ create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5928
+ create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5929
+ create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5930
+ read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
5931
+ read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
5932
+ read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5933
+ read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5934
+ read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
5935
+ read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
5936
+ read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5937
+ read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5938
+ readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5939
+ readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5940
+ readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5941
+ readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5942
+ readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5943
+ readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5944
+ readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5945
+ readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5946
+ update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5947
+ update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5948
+ update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5949
+ update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5950
+ update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5951
+ update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5952
+ updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5953
+ updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5954
+ updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5955
+ updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5956
+ updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5957
+ updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5958
+ createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5959
+ createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5960
+ createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5961
+ createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5962
+ createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
5963
+ createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
5964
+ delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5965
+ delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5966
+ delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
5967
+ delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
5968
+ delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5969
+ delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5970
+ delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
5971
+ delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
5972
+ deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5973
+ deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5974
+ deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
5975
+ deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
5976
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5977
+ deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
5978
+ deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
5979
+ deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
3882
5980
  search(query: string, options?: {
3883
5981
  fuzziness?: FuzzinessExpression;
3884
5982
  prefix?: PrefixExpression;
@@ -3894,6 +5992,7 @@ declare type BaseSchema = {
3894
5992
  columns: readonly ({
3895
5993
  name: string;
3896
5994
  type: Column['type'];
5995
+ notNull?: boolean;
3897
5996
  } | {
3898
5997
  name: string;
3899
5998
  type: 'link';
@@ -3923,10 +6022,10 @@ declare type TableType<Tables, TableName> = Tables & {
3923
6022
  } ? Columns extends readonly unknown[] ? Columns[number] extends {
3924
6023
  name: string;
3925
6024
  type: string;
3926
- } ? Identifiable & {
3927
- [K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
3928
- } : never : never : never : never;
3929
- declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
6025
+ } ? Identifiable & UnionToIntersection<Values<{
6026
+ [K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
6027
+ }>> : never : never : never : never;
6028
+ declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
3930
6029
  name: PropertyName;
3931
6030
  } extends infer Property ? Property extends {
3932
6031
  name: string;
@@ -3935,13 +6034,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
3935
6034
  table: infer LinkedTable;
3936
6035
  };
3937
6036
  columns?: infer ObjectColumns;
3938
- } ? (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 {
6037
+ notNull?: infer NotNull;
6038
+ } ? NotNull extends true ? {
6039
+ [K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
6040
+ } : {
6041
+ [K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
6042
+ } : never : never;
6043
+ 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 {
3939
6044
  name: string;
3940
6045
  type: string;
3941
- } ? {
3942
- [K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
3943
- } : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
6046
+ } ? UnionToIntersection<Values<{
6047
+ [K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
6048
+ }>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
3944
6049
 
6050
+ /**
6051
+ * Operator to restrict results to only values that are greater than the given value.
6052
+ */
6053
+ declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3945
6054
  /**
3946
6055
  * Operator to restrict results to only values that are greater than the given value.
3947
6056
  */
@@ -3949,15 +6058,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
3949
6058
  /**
3950
6059
  * Operator to restrict results to only values that are greater than or equal to the given value.
3951
6060
  */
3952
- declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6061
+ declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6062
+ /**
6063
+ * Operator to restrict results to only values that are greater than or equal to the given value.
6064
+ */
6065
+ declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3953
6066
  /**
3954
6067
  * Operator to restrict results to only values that are greater than or equal to the given value.
3955
6068
  */
3956
6069
  declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6070
+ /**
6071
+ * Operator to restrict results to only values that are greater than or equal to the given value.
6072
+ */
6073
+ declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6074
+ /**
6075
+ * Operator to restrict results to only values that are lower than the given value.
6076
+ */
6077
+ declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3957
6078
  /**
3958
6079
  * Operator to restrict results to only values that are lower than the given value.
3959
6080
  */
3960
6081
  declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6082
+ /**
6083
+ * Operator to restrict results to only values that are lower than or equal to the given value.
6084
+ */
6085
+ declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
6086
+ /**
6087
+ * Operator to restrict results to only values that are lower than or equal to the given value.
6088
+ */
6089
+ declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
3961
6090
  /**
3962
6091
  * Operator to restrict results to only values that are lower than or equal to the given value.
3963
6092
  */
@@ -3990,6 +6119,10 @@ declare const pattern: (value: string) => StringTypeFilter;
3990
6119
  * Operator to restrict results to only values that are equal to the given value.
3991
6120
  */
3992
6121
  declare const is: <T>(value: T) => PropertyFilter<T>;
6122
+ /**
6123
+ * Operator to restrict results to only values that are equal to the given value.
6124
+ */
6125
+ declare const equals: <T>(value: T) => PropertyFilter<T>;
3993
6126
  /**
3994
6127
  * Operator to restrict results to only values that are not equal to the given value.
3995
6128
  */
@@ -4018,12 +6151,10 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
4018
6151
  declare type SchemaDefinition = {
4019
6152
  table: string;
4020
6153
  };
4021
- declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
6154
+ declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
4022
6155
  [Key in keyof Schemas]: Repository<Schemas[Key]>;
4023
- } & {
4024
- [key: string]: Repository<XataRecord$1>;
4025
6156
  };
4026
- declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
6157
+ declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
4027
6158
  #private;
4028
6159
  constructor(schemaTables?: Schemas.Table[]);
4029
6160
  build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
@@ -4040,12 +6171,13 @@ declare type BaseClientOptions = {
4040
6171
  databaseURL?: string;
4041
6172
  branch?: BranchStrategyOption;
4042
6173
  cache?: CacheImpl;
6174
+ trace?: TraceFunction;
4043
6175
  };
4044
6176
  declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
4045
6177
  interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
4046
- new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
4047
- db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
4048
- search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
6178
+ new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
6179
+ db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
6180
+ search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
4049
6181
  }, keyof Plugins> & {
4050
6182
  [Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
4051
6183
  } & {
@@ -4056,8 +6188,17 @@ interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
4056
6188
  };
4057
6189
  }
4058
6190
  declare const BaseClient_base: ClientConstructor<{}>;
4059
- declare class BaseClient extends BaseClient_base<[]> {
6191
+ declare class BaseClient extends BaseClient_base<Record<string, any>> {
6192
+ }
6193
+
6194
+ declare class Serializer {
6195
+ classes: Record<string, any>;
6196
+ add(clazz: any): void;
6197
+ toJSON<T>(data: T): string;
6198
+ fromJSON<T>(json: string): T;
4060
6199
  }
6200
+ declare const serialize: <T>(data: T) => string;
6201
+ declare const deserialize: <T>(json: string) => T;
4061
6202
 
4062
6203
  declare type BranchResolutionOptions = {
4063
6204
  databaseURL?: string;
@@ -4070,9 +6211,89 @@ declare function getDatabaseURL(): string | undefined;
4070
6211
 
4071
6212
  declare function getAPIKey(): string | undefined;
4072
6213
 
6214
+ interface Body {
6215
+ arrayBuffer(): Promise<ArrayBuffer>;
6216
+ blob(): Promise<Blob>;
6217
+ formData(): Promise<FormData>;
6218
+ json(): Promise<any>;
6219
+ text(): Promise<string>;
6220
+ }
6221
+ interface Blob {
6222
+ readonly size: number;
6223
+ readonly type: string;
6224
+ arrayBuffer(): Promise<ArrayBuffer>;
6225
+ slice(start?: number, end?: number, contentType?: string): Blob;
6226
+ text(): Promise<string>;
6227
+ }
6228
+ /** Provides information about files and allows JavaScript in a web page to access their content. */
6229
+ interface File extends Blob {
6230
+ readonly lastModified: number;
6231
+ readonly name: string;
6232
+ readonly webkitRelativePath: string;
6233
+ }
6234
+ declare type FormDataEntryValue = File | string;
6235
+ /** 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". */
6236
+ interface FormData {
6237
+ append(name: string, value: string | Blob, fileName?: string): void;
6238
+ delete(name: string): void;
6239
+ get(name: string): FormDataEntryValue | null;
6240
+ getAll(name: string): FormDataEntryValue[];
6241
+ has(name: string): boolean;
6242
+ set(name: string, value: string | Blob, fileName?: string): void;
6243
+ forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
6244
+ }
6245
+ /** 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. */
6246
+ interface Headers {
6247
+ append(name: string, value: string): void;
6248
+ delete(name: string): void;
6249
+ get(name: string): string | null;
6250
+ has(name: string): boolean;
6251
+ set(name: string, value: string): void;
6252
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
6253
+ }
6254
+ interface Request extends Body {
6255
+ /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
6256
+ readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
6257
+ /** 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. */
6258
+ readonly credentials: 'include' | 'omit' | 'same-origin';
6259
+ /** Returns the kind of resource requested by request, e.g., "document" or "script". */
6260
+ readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
6261
+ /** 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. */
6262
+ readonly headers: Headers;
6263
+ /** 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] */
6264
+ readonly integrity: string;
6265
+ /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
6266
+ readonly keepalive: boolean;
6267
+ /** Returns request's HTTP method, which is "GET" by default. */
6268
+ readonly method: string;
6269
+ /** 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. */
6270
+ readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
6271
+ /** 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. */
6272
+ readonly redirect: 'error' | 'follow' | 'manual';
6273
+ /** 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. */
6274
+ readonly referrer: string;
6275
+ /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
6276
+ readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
6277
+ /** Returns the URL of request as a string. */
6278
+ readonly url: string;
6279
+ clone(): Request;
6280
+ }
6281
+
6282
+ declare type XataWorkerContext<XataClient> = {
6283
+ xata: XataClient;
6284
+ request: Request;
6285
+ env: Record<string, string | undefined>;
6286
+ };
6287
+ declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
6288
+ declare type WorkerRunnerConfig = {
6289
+ workspace: string;
6290
+ worker: string;
6291
+ };
6292
+ 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>>>;
6293
+
4073
6294
  declare class XataError extends Error {
4074
6295
  readonly status: number;
4075
6296
  constructor(message: string, status: number);
4076
6297
  }
4077
6298
 
4078
- export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, 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, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, 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, SearchXataRecord, 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, 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, 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, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
6299
+ 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 };