@xata.io/client 0.0.0-alpha.vfbbe3c7 → 0.0.0-alpha.vfbe46c7
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/CHANGELOG.md +100 -0
- package/README.md +27 -25
- package/Usage.md +29 -6
- package/dist/index.cjs +1018 -355
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2521 -291
- package/dist/index.mjs +986 -356
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
@@ -1,21 +1,30 @@
|
|
1
|
+
declare type AttributeDictionary = Record<string, string | number | boolean | undefined>;
|
2
|
+
declare type TraceFunction = <T>(name: string, fn: (options: {
|
3
|
+
setAttributes: (attrs: AttributeDictionary) => void;
|
4
|
+
}) => T, options?: AttributeDictionary) => Promise<T>;
|
5
|
+
|
1
6
|
declare type FetchImpl = (url: string, init?: {
|
2
7
|
body?: string;
|
3
8
|
headers?: Record<string, string>;
|
4
9
|
method?: string;
|
10
|
+
signal?: any;
|
5
11
|
}) => Promise<{
|
6
12
|
ok: boolean;
|
7
13
|
status: number;
|
14
|
+
url: string;
|
8
15
|
json(): Promise<any>;
|
9
16
|
headers?: {
|
10
17
|
get(name: string): string | null;
|
11
18
|
};
|
12
19
|
}>;
|
13
|
-
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string
|
20
|
+
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
|
14
21
|
declare type FetcherExtraProps = {
|
15
22
|
apiUrl: string;
|
16
23
|
workspacesApiUrl: string | WorkspaceApiUrlBuilder;
|
17
24
|
fetchImpl: FetchImpl;
|
18
25
|
apiKey: string;
|
26
|
+
trace: TraceFunction;
|
27
|
+
signal?: AbortSignal;
|
19
28
|
};
|
20
29
|
declare type ErrorWrapper<TError> = TError | {
|
21
30
|
status: 'unknown';
|
@@ -52,6 +61,7 @@ declare abstract class XataPlugin {
|
|
52
61
|
declare type XataPluginOptions = {
|
53
62
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
54
63
|
cache: CacheImpl;
|
64
|
+
trace?: TraceFunction;
|
55
65
|
};
|
56
66
|
|
57
67
|
/**
|
@@ -60,6 +70,9 @@ declare type XataPluginOptions = {
|
|
60
70
|
* @version 1.0
|
61
71
|
*/
|
62
72
|
declare type User = {
|
73
|
+
/**
|
74
|
+
* @format email
|
75
|
+
*/
|
63
76
|
email: string;
|
64
77
|
fullname: string;
|
65
78
|
image: string;
|
@@ -91,16 +104,19 @@ declare type WorkspaceID = string;
|
|
91
104
|
declare type Role = 'owner' | 'maintainer';
|
92
105
|
declare type WorkspaceMeta = {
|
93
106
|
name: string;
|
94
|
-
slug
|
107
|
+
slug?: string;
|
95
108
|
};
|
96
109
|
declare type Workspace = WorkspaceMeta & {
|
97
110
|
id: WorkspaceID;
|
98
111
|
memberCount: number;
|
99
|
-
plan: 'free';
|
112
|
+
plan: 'free' | 'pro';
|
100
113
|
};
|
101
114
|
declare type WorkspaceMember = {
|
102
115
|
userId: UserID;
|
103
116
|
fullname: string;
|
117
|
+
/**
|
118
|
+
* @format email
|
119
|
+
*/
|
104
120
|
email: string;
|
105
121
|
role: Role;
|
106
122
|
};
|
@@ -110,7 +126,13 @@ declare type WorkspaceMember = {
|
|
110
126
|
declare type InviteID = string;
|
111
127
|
declare type WorkspaceInvite = {
|
112
128
|
inviteId: InviteID;
|
129
|
+
/**
|
130
|
+
* @format email
|
131
|
+
*/
|
113
132
|
email: string;
|
133
|
+
/**
|
134
|
+
* @format date-time
|
135
|
+
*/
|
114
136
|
expires: string;
|
115
137
|
role: Role;
|
116
138
|
};
|
@@ -122,20 +144,40 @@ declare type WorkspaceMembers = {
|
|
122
144
|
* @pattern ^ik_[a-zA-Z0-9]+
|
123
145
|
*/
|
124
146
|
declare type InviteKey = string;
|
147
|
+
/**
|
148
|
+
* Metadata of databases
|
149
|
+
*/
|
150
|
+
declare type DatabaseMetadata = {
|
151
|
+
/**
|
152
|
+
* The machine-readable name of a database
|
153
|
+
*/
|
154
|
+
name: string;
|
155
|
+
/**
|
156
|
+
* The time this database was created
|
157
|
+
*/
|
158
|
+
createdAt: DateTime;
|
159
|
+
/**
|
160
|
+
* The number of branches the database has
|
161
|
+
*/
|
162
|
+
numberOfBranches: number;
|
163
|
+
/**
|
164
|
+
* Metadata about the database for display in Xata user interfaces
|
165
|
+
*/
|
166
|
+
ui?: {
|
167
|
+
/**
|
168
|
+
* The user-selected color for this database across interfaces
|
169
|
+
*/
|
170
|
+
color?: string;
|
171
|
+
};
|
172
|
+
};
|
125
173
|
declare type ListDatabasesResponse = {
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
numberOfBranches: number;
|
131
|
-
ui?: {
|
132
|
-
color?: string;
|
133
|
-
};
|
134
|
-
}[];
|
174
|
+
/**
|
175
|
+
* A list of databases in a Xata workspace
|
176
|
+
*/
|
177
|
+
databases?: DatabaseMetadata[];
|
135
178
|
};
|
136
179
|
declare type ListBranchesResponse = {
|
137
180
|
databaseName: string;
|
138
|
-
displayName: string;
|
139
181
|
branches: Branch[];
|
140
182
|
};
|
141
183
|
declare type ListGitBranchesResponse = {
|
@@ -153,8 +195,14 @@ declare type Branch = {
|
|
153
195
|
* @x-go-type xata.BranchMetadata
|
154
196
|
*/
|
155
197
|
declare type BranchMetadata = {
|
198
|
+
/**
|
199
|
+
* @minLength 1
|
200
|
+
*/
|
156
201
|
repository?: string;
|
157
202
|
branch?: BranchName;
|
203
|
+
/**
|
204
|
+
* @minLength 1
|
205
|
+
*/
|
158
206
|
stage?: string;
|
159
207
|
labels?: string[];
|
160
208
|
};
|
@@ -181,12 +229,28 @@ declare type Schema = {
|
|
181
229
|
tables: Table[];
|
182
230
|
tablesOrder?: string[];
|
183
231
|
};
|
232
|
+
/**
|
233
|
+
* @x-internal true
|
234
|
+
*/
|
235
|
+
declare type SchemaEditScript = {
|
236
|
+
sourceMigrationID?: string;
|
237
|
+
targetMigrationID?: string;
|
238
|
+
tables: TableEdit[];
|
239
|
+
};
|
184
240
|
declare type Table = {
|
185
241
|
id?: string;
|
186
242
|
name: TableName;
|
187
243
|
columns: Column[];
|
188
244
|
revLinks?: RevLink[];
|
189
245
|
};
|
246
|
+
/**
|
247
|
+
* @x-internal true
|
248
|
+
*/
|
249
|
+
declare type TableEdit = {
|
250
|
+
oldName?: string;
|
251
|
+
newName?: string;
|
252
|
+
columns?: MigrationColumnOp[];
|
253
|
+
};
|
190
254
|
/**
|
191
255
|
* @x-go-type xata.Column
|
192
256
|
*/
|
@@ -196,6 +260,8 @@ declare type Column = {
|
|
196
260
|
link?: {
|
197
261
|
table: string;
|
198
262
|
};
|
263
|
+
notNull?: boolean;
|
264
|
+
unique?: boolean;
|
199
265
|
columns?: Column[];
|
200
266
|
};
|
201
267
|
declare type RevLink = {
|
@@ -262,6 +328,137 @@ declare type ColumnMigration = {
|
|
262
328
|
old: Column;
|
263
329
|
['new']: Column;
|
264
330
|
};
|
331
|
+
/**
|
332
|
+
* @x-internal true
|
333
|
+
*/
|
334
|
+
declare type Commit = {
|
335
|
+
meta?: {
|
336
|
+
title?: string;
|
337
|
+
message?: string;
|
338
|
+
id: string;
|
339
|
+
parentID?: string;
|
340
|
+
mergeParentID?: string;
|
341
|
+
status: string;
|
342
|
+
createdAt: DateTime;
|
343
|
+
modifiedAt?: DateTime;
|
344
|
+
};
|
345
|
+
operations: MigrationOp[];
|
346
|
+
};
|
347
|
+
/**
|
348
|
+
* Branch schema migration.
|
349
|
+
*
|
350
|
+
* @x-internal true
|
351
|
+
*/
|
352
|
+
declare type Migration = {
|
353
|
+
parentID?: string;
|
354
|
+
operations: MigrationOp[];
|
355
|
+
};
|
356
|
+
/**
|
357
|
+
* Branch schema migration operations.
|
358
|
+
*
|
359
|
+
* @x-internal true
|
360
|
+
*/
|
361
|
+
declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
|
362
|
+
/**
|
363
|
+
* @x-internal true
|
364
|
+
*/
|
365
|
+
declare type MigrationTableOp = {
|
366
|
+
addTable: TableOpAdd;
|
367
|
+
} | {
|
368
|
+
removeTable: TableOpRemove;
|
369
|
+
} | {
|
370
|
+
renameTable: TableOpRename;
|
371
|
+
};
|
372
|
+
/**
|
373
|
+
* @x-internal true
|
374
|
+
*/
|
375
|
+
declare type MigrationColumnOp = {
|
376
|
+
addColumn: ColumnOpAdd;
|
377
|
+
} | {
|
378
|
+
removeColumn: ColumnOpRemove;
|
379
|
+
} | {
|
380
|
+
renameColumn: ColumnOpRename;
|
381
|
+
};
|
382
|
+
/**
|
383
|
+
* @x-internal true
|
384
|
+
*/
|
385
|
+
declare type TableOpAdd = {
|
386
|
+
table: string;
|
387
|
+
};
|
388
|
+
/**
|
389
|
+
* @x-internal true
|
390
|
+
*/
|
391
|
+
declare type TableOpRemove = {
|
392
|
+
table: string;
|
393
|
+
};
|
394
|
+
/**
|
395
|
+
* @x-internal true
|
396
|
+
*/
|
397
|
+
declare type TableOpRename = {
|
398
|
+
oldName: string;
|
399
|
+
newName: string;
|
400
|
+
};
|
401
|
+
/**
|
402
|
+
* @x-internal true
|
403
|
+
*/
|
404
|
+
declare type ColumnOpAdd = {
|
405
|
+
table?: string;
|
406
|
+
column: Column;
|
407
|
+
};
|
408
|
+
/**
|
409
|
+
* @x-internal true
|
410
|
+
*/
|
411
|
+
declare type ColumnOpRemove = {
|
412
|
+
table?: string;
|
413
|
+
column: string;
|
414
|
+
};
|
415
|
+
/**
|
416
|
+
* @x-internal true
|
417
|
+
*/
|
418
|
+
declare type ColumnOpRename = {
|
419
|
+
table?: string;
|
420
|
+
oldName: string;
|
421
|
+
newName: string;
|
422
|
+
};
|
423
|
+
declare type MigrationRequest = {
|
424
|
+
/**
|
425
|
+
* The migration request number.
|
426
|
+
*/
|
427
|
+
number: number;
|
428
|
+
/**
|
429
|
+
* Migration request creation timestamp.
|
430
|
+
*/
|
431
|
+
createdAt: DateTime;
|
432
|
+
/**
|
433
|
+
* Last modified timestamp.
|
434
|
+
*/
|
435
|
+
modifiedAt?: DateTime;
|
436
|
+
/**
|
437
|
+
* Timestamp when the migration request was closed.
|
438
|
+
*/
|
439
|
+
closedAt?: DateTime;
|
440
|
+
/**
|
441
|
+
* Timestamp when the migration request was merged.
|
442
|
+
*/
|
443
|
+
mergedAt?: DateTime;
|
444
|
+
status: 'open' | 'closed' | 'merging' | 'merged';
|
445
|
+
/**
|
446
|
+
* The migration request title.
|
447
|
+
*/
|
448
|
+
title: string;
|
449
|
+
/**
|
450
|
+
* The migration request body with detailed description.
|
451
|
+
*/
|
452
|
+
body: string;
|
453
|
+
/**
|
454
|
+
* Name of the source branch.
|
455
|
+
*/
|
456
|
+
source: string;
|
457
|
+
/**
|
458
|
+
* Name of the target branch.
|
459
|
+
*/
|
460
|
+
target: string;
|
461
|
+
};
|
265
462
|
declare type SortExpression = string[] | {
|
266
463
|
[key: string]: SortOrder;
|
267
464
|
} | {
|
@@ -270,7 +467,7 @@ declare type SortExpression = string[] | {
|
|
270
467
|
declare type SortOrder = 'asc' | 'desc';
|
271
468
|
/**
|
272
469
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
273
|
-
* distance is the number of one
|
470
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
274
471
|
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
275
472
|
* to allow two typos in a word.
|
276
473
|
*
|
@@ -283,6 +480,23 @@ declare type FuzzinessExpression = number;
|
|
283
480
|
* If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
|
284
481
|
*/
|
285
482
|
declare type PrefixExpression = 'phrase' | 'disabled';
|
483
|
+
/**
|
484
|
+
* The target expression is used to filter the search results by the target columns.
|
485
|
+
*/
|
486
|
+
declare type TargetExpression = (string | {
|
487
|
+
/**
|
488
|
+
* The name of the column.
|
489
|
+
*/
|
490
|
+
column: string;
|
491
|
+
/**
|
492
|
+
* The weight of the column.
|
493
|
+
*
|
494
|
+
* @default 1
|
495
|
+
* @maximum 10
|
496
|
+
* @minimum 1
|
497
|
+
*/
|
498
|
+
weight?: number;
|
499
|
+
})[];
|
286
500
|
/**
|
287
501
|
* @minProperties 1
|
288
502
|
*/
|
@@ -296,8 +510,215 @@ declare type FilterExpression = {
|
|
296
510
|
} & {
|
297
511
|
[key: string]: FilterColumn;
|
298
512
|
};
|
513
|
+
/**
|
514
|
+
* The description of the summaries you wish to receive. Set each key to be the field name
|
515
|
+
* you'd like for the summary. These names must not collide with other columns you've
|
516
|
+
* requested from `columns`; including implicit requests like `settings.*`.
|
517
|
+
*
|
518
|
+
* The value for each key needs to be an object. This object should contain one key and one
|
519
|
+
* value only. In this object, the key should be set to the summary function you wish to use
|
520
|
+
* and the value set to the column name to be summarized.
|
521
|
+
*
|
522
|
+
* The column being summarized cannot be an internal column (id, xata.*), nor the base of
|
523
|
+
* an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
|
524
|
+
* `settings.dark_mode` but not `settings` nor `settings.*`.
|
525
|
+
*
|
526
|
+
* @example {"all_users":{"count":"*"}}
|
527
|
+
* @example {"total_created":{"count":"created_at"}}
|
528
|
+
* @x-go-type xbquery.SummaryList
|
529
|
+
*/
|
530
|
+
declare type SummaryExpressionList = {
|
531
|
+
[key: string]: SummaryExpression;
|
532
|
+
};
|
533
|
+
/**
|
534
|
+
* A summary expression is the description of a single summary operation. It consists of a single
|
535
|
+
* key representing the operation, and a value representing the column to be operated on.
|
536
|
+
*
|
537
|
+
* The column being summarized cannot be an internal column (id, xata.*), nor the base of
|
538
|
+
* an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
|
539
|
+
* `settings.dark_mode` but not `settings` nor `settings.*`.
|
540
|
+
*
|
541
|
+
* We currently support the `count` operation. When using `count`, one can set a column name
|
542
|
+
* as the value. Xata will return the total number times this column is non-null in each group.
|
543
|
+
*
|
544
|
+
* Alternately, if you'd like to count the total rows in each group - irregardless of null/not null
|
545
|
+
* status - you can set `count` to `*` to count everything.
|
546
|
+
*
|
547
|
+
* @example {"count":"deleted_at"}
|
548
|
+
* @x-go-type xbquery.Summary
|
549
|
+
*/
|
550
|
+
declare type SummaryExpression = Record<string, any>;
|
551
|
+
/**
|
552
|
+
* The description of the aggregations you wish to receive.
|
553
|
+
*
|
554
|
+
* @example {"totalCount":{"count":"*"},"dailyActiveUsers":{"dateHistogram":{"column":"date","interval":"1d"},"aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}}}}
|
555
|
+
*/
|
556
|
+
declare type AggExpressionMap = {
|
557
|
+
[key: string]: AggExpression;
|
558
|
+
};
|
559
|
+
/**
|
560
|
+
* The description of a single aggregation operation. The key represents the
|
561
|
+
*
|
562
|
+
* @x-go-type xata.AggExpression
|
563
|
+
*/
|
564
|
+
declare type AggExpression = {
|
565
|
+
count?: CountAgg;
|
566
|
+
} | {
|
567
|
+
sum?: SumAgg;
|
568
|
+
} | {
|
569
|
+
max?: MaxAgg;
|
570
|
+
} | {
|
571
|
+
min?: MinAgg;
|
572
|
+
} | {
|
573
|
+
average?: AverageAgg;
|
574
|
+
} | {
|
575
|
+
uniqueCount?: UniqueCountAgg;
|
576
|
+
} | {
|
577
|
+
dateHistogram?: DateHistogramAgg;
|
578
|
+
} | {
|
579
|
+
topValues?: TopValuesAgg;
|
580
|
+
} | {
|
581
|
+
numericHistogram?: NumericHistogramAgg;
|
582
|
+
};
|
583
|
+
/**
|
584
|
+
* Count the number of records with an optional filter.
|
585
|
+
*/
|
586
|
+
declare type CountAgg = {
|
587
|
+
filter?: FilterExpression;
|
588
|
+
} | '*';
|
589
|
+
/**
|
590
|
+
* The sum of the numeric values in a particular column.
|
591
|
+
*/
|
592
|
+
declare type SumAgg = {
|
593
|
+
/**
|
594
|
+
* The column on which to compute the sum. Must be a numeric type.
|
595
|
+
*/
|
596
|
+
column: string;
|
597
|
+
};
|
598
|
+
/**
|
599
|
+
* The max of the numeric values in a particular column.
|
600
|
+
*/
|
601
|
+
declare type MaxAgg = {
|
602
|
+
/**
|
603
|
+
* The column on which to compute the max. Must be a numeric type.
|
604
|
+
*/
|
605
|
+
column: string;
|
606
|
+
};
|
607
|
+
/**
|
608
|
+
* The min of the numeric values in a particular column.
|
609
|
+
*/
|
610
|
+
declare type MinAgg = {
|
611
|
+
/**
|
612
|
+
* The column on which to compute the min. Must be a numeric type.
|
613
|
+
*/
|
614
|
+
column: string;
|
615
|
+
};
|
616
|
+
/**
|
617
|
+
* The average of the numeric values in a particular column.
|
618
|
+
*/
|
619
|
+
declare type AverageAgg = {
|
620
|
+
/**
|
621
|
+
* The column on which to compute the average. Must be a numeric type.
|
622
|
+
*/
|
623
|
+
column: string;
|
624
|
+
};
|
625
|
+
/**
|
626
|
+
* Count the number of distinct values in a particular column.
|
627
|
+
*/
|
628
|
+
declare type UniqueCountAgg = {
|
629
|
+
/**
|
630
|
+
* The column from where to count the unique values.
|
631
|
+
*/
|
632
|
+
column: string;
|
633
|
+
/**
|
634
|
+
* The threshold under which the unique count is exact. If the number of unique
|
635
|
+
* values in the column is higher than this threshold, the results are approximative.
|
636
|
+
* Maximum value is 40,000, default value is 3000.
|
637
|
+
*/
|
638
|
+
precisionThreshold?: number;
|
639
|
+
};
|
640
|
+
/**
|
641
|
+
* Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
|
642
|
+
*/
|
643
|
+
declare type DateHistogramAgg = {
|
644
|
+
/**
|
645
|
+
* The column to use for bucketing. Must be of type datetime.
|
646
|
+
*/
|
647
|
+
column: string;
|
648
|
+
/**
|
649
|
+
* The fixed interval to use when bucketing.
|
650
|
+
* It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
|
651
|
+
*
|
652
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
653
|
+
*/
|
654
|
+
interval?: string;
|
655
|
+
/**
|
656
|
+
* The calendar-aware interval to use when bucketing. Possible values are: `minute`,
|
657
|
+
* `hour`, `day`, `week`, `month`, `quarter`, `year`.
|
658
|
+
*/
|
659
|
+
calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
660
|
+
/**
|
661
|
+
* The timezone to use for bucketing. By default, UTC is assumed.
|
662
|
+
* The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
|
663
|
+
* `-08:00`.
|
664
|
+
*
|
665
|
+
* @pattern ^[+-][01]\d:[0-5]\d$
|
666
|
+
*/
|
667
|
+
timezone?: string;
|
668
|
+
aggs?: AggExpressionMap;
|
669
|
+
};
|
670
|
+
/**
|
671
|
+
* Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
|
672
|
+
* The top values as ordered by the number of records (`$count``) are returned.
|
673
|
+
*/
|
674
|
+
declare type TopValuesAgg = {
|
675
|
+
/**
|
676
|
+
* The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
|
677
|
+
*/
|
678
|
+
column: string;
|
679
|
+
aggs?: AggExpressionMap;
|
680
|
+
/**
|
681
|
+
* The maximum number of unique values to return.
|
682
|
+
*
|
683
|
+
* @default 10
|
684
|
+
* @maximum 1000
|
685
|
+
*/
|
686
|
+
size?: number;
|
687
|
+
};
|
688
|
+
/**
|
689
|
+
* Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
|
690
|
+
*/
|
691
|
+
declare type NumericHistogramAgg = {
|
692
|
+
/**
|
693
|
+
* The column to use for bucketing. Must be of numeric type.
|
694
|
+
*/
|
695
|
+
column: string;
|
696
|
+
/**
|
697
|
+
* The numeric interval to use for bucketing. The resulting buckets will be ranges
|
698
|
+
* with this value as size.
|
699
|
+
*
|
700
|
+
* @minimum 0
|
701
|
+
*/
|
702
|
+
interval: number;
|
703
|
+
/**
|
704
|
+
* By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
|
705
|
+
* boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
|
706
|
+
* but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
|
707
|
+
* to 50.
|
708
|
+
*
|
709
|
+
* @default 0
|
710
|
+
*/
|
711
|
+
offset?: number;
|
712
|
+
aggs?: AggExpressionMap;
|
713
|
+
};
|
299
714
|
declare type HighlightExpression = {
|
715
|
+
/**
|
716
|
+
* Set to `false` to disable highlighting. By default it is `true`.
|
717
|
+
*/
|
300
718
|
enabled?: boolean;
|
719
|
+
/**
|
720
|
+
* Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
|
721
|
+
*/
|
301
722
|
encodeHTML?: boolean;
|
302
723
|
};
|
303
724
|
/**
|
@@ -316,15 +737,30 @@ declare type BoosterExpression = {
|
|
316
737
|
* Boost records with a particular value for a column.
|
317
738
|
*/
|
318
739
|
declare type ValueBooster$1 = {
|
740
|
+
/**
|
741
|
+
* The column in which to look for the value.
|
742
|
+
*/
|
319
743
|
column: string;
|
744
|
+
/**
|
745
|
+
* The exact value to boost.
|
746
|
+
*/
|
320
747
|
value: string | number | boolean;
|
748
|
+
/**
|
749
|
+
* The factor with which to multiply the score of the record.
|
750
|
+
*/
|
321
751
|
factor: number;
|
322
752
|
};
|
323
753
|
/**
|
324
754
|
* Boost records based on the value of a numeric column.
|
325
755
|
*/
|
326
756
|
declare type NumericBooster$1 = {
|
757
|
+
/**
|
758
|
+
* The column in which to look for the value.
|
759
|
+
*/
|
327
760
|
column: string;
|
761
|
+
/**
|
762
|
+
* The factor with which to multiply the value of the column before adding it to the item score.
|
763
|
+
*/
|
328
764
|
factor: number;
|
329
765
|
};
|
330
766
|
/**
|
@@ -333,9 +769,24 @@ declare type NumericBooster$1 = {
|
|
333
769
|
* 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
770
|
*/
|
335
771
|
declare type DateBooster$1 = {
|
772
|
+
/**
|
773
|
+
* The column in which to look for the value.
|
774
|
+
*/
|
336
775
|
column: string;
|
776
|
+
/**
|
777
|
+
* 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.
|
778
|
+
* If it is not specified, the current date and time is used.
|
779
|
+
*/
|
337
780
|
origin?: string;
|
781
|
+
/**
|
782
|
+
* 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`.
|
783
|
+
*
|
784
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
785
|
+
*/
|
338
786
|
scale: string;
|
787
|
+
/**
|
788
|
+
* The decay factor to expect at "scale" distance from the "origin".
|
789
|
+
*/
|
339
790
|
decay: number;
|
340
791
|
};
|
341
792
|
declare type FilterList = FilterExpression | FilterExpression[];
|
@@ -387,13 +838,40 @@ declare type FilterValue = number | string | boolean;
|
|
387
838
|
* Pagination settings.
|
388
839
|
*/
|
389
840
|
declare type PageConfig = {
|
841
|
+
/**
|
842
|
+
* Query the next page that follow the cursor.
|
843
|
+
*/
|
390
844
|
after?: string;
|
845
|
+
/**
|
846
|
+
* Query the previous page before the cursor.
|
847
|
+
*/
|
391
848
|
before?: string;
|
849
|
+
/**
|
850
|
+
* Query the first page from the cursor.
|
851
|
+
*/
|
392
852
|
first?: string;
|
853
|
+
/**
|
854
|
+
* Query the last page from the cursor.
|
855
|
+
*/
|
393
856
|
last?: string;
|
857
|
+
/**
|
858
|
+
* 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.
|
859
|
+
*
|
860
|
+
* @default 20
|
861
|
+
*/
|
394
862
|
size?: number;
|
863
|
+
/**
|
864
|
+
* Use offset to skip entries. To skip pages set offset to a multiple of size.
|
865
|
+
*
|
866
|
+
* @default 0
|
867
|
+
*/
|
395
868
|
offset?: number;
|
396
869
|
};
|
870
|
+
/**
|
871
|
+
* @example name
|
872
|
+
* @example email
|
873
|
+
* @example created_at
|
874
|
+
*/
|
397
875
|
declare type ColumnsProjection = string[];
|
398
876
|
/**
|
399
877
|
* Xata Table Record Metadata
|
@@ -401,14 +879,29 @@ declare type ColumnsProjection = string[];
|
|
401
879
|
declare type RecordMeta = {
|
402
880
|
id: RecordID;
|
403
881
|
xata: {
|
882
|
+
/**
|
883
|
+
* The record's version. Can be used for optimistic concurrency control.
|
884
|
+
*/
|
404
885
|
version: number;
|
886
|
+
/**
|
887
|
+
* The record's table name. APIs that return records from multiple tables will set this field accordingly.
|
888
|
+
*/
|
405
889
|
table?: string;
|
890
|
+
/**
|
891
|
+
* Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
|
892
|
+
*/
|
406
893
|
highlight?: {
|
407
894
|
[key: string]: string[] | {
|
408
895
|
[key: string]: any;
|
409
896
|
};
|
410
897
|
};
|
898
|
+
/**
|
899
|
+
* The record's relevancy score. This is returned by the search APIs.
|
900
|
+
*/
|
411
901
|
score?: number;
|
902
|
+
/**
|
903
|
+
* Encoding/Decoding errors
|
904
|
+
*/
|
412
905
|
warnings?: string[];
|
413
906
|
};
|
414
907
|
};
|
@@ -420,7 +913,13 @@ declare type RecordID = string;
|
|
420
913
|
* @example {"newName":"newName","oldName":"oldName"}
|
421
914
|
*/
|
422
915
|
declare type TableRename = {
|
916
|
+
/**
|
917
|
+
* @minLength 1
|
918
|
+
*/
|
423
919
|
newName: string;
|
920
|
+
/**
|
921
|
+
* @minLength 1
|
922
|
+
*/
|
424
923
|
oldName: string;
|
425
924
|
};
|
426
925
|
/**
|
@@ -428,10 +927,23 @@ declare type TableRename = {
|
|
428
927
|
*/
|
429
928
|
declare type RecordsMetadata = {
|
430
929
|
page: {
|
930
|
+
/**
|
931
|
+
* last record id
|
932
|
+
*/
|
431
933
|
cursor: string;
|
934
|
+
/**
|
935
|
+
* true if more records can be fetch
|
936
|
+
*/
|
432
937
|
more: boolean;
|
433
938
|
};
|
434
939
|
};
|
940
|
+
declare type AggResponse$1 = number | {
|
941
|
+
values?: {
|
942
|
+
$key?: string | number;
|
943
|
+
$count?: number;
|
944
|
+
additionalProperties?: AggResponse$1;
|
945
|
+
}[];
|
946
|
+
};
|
435
947
|
/**
|
436
948
|
* Xata Table Record Metadata
|
437
949
|
*/
|
@@ -453,6 +965,7 @@ type schemas_InviteID = InviteID;
|
|
453
965
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
454
966
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
455
967
|
type schemas_InviteKey = InviteKey;
|
968
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
456
969
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
457
970
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
458
971
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
@@ -461,7 +974,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
461
974
|
type schemas_DBBranch = DBBranch;
|
462
975
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
463
976
|
type schemas_Schema = Schema;
|
977
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
464
978
|
type schemas_Table = Table;
|
979
|
+
type schemas_TableEdit = TableEdit;
|
465
980
|
type schemas_Column = Column;
|
466
981
|
type schemas_RevLink = RevLink;
|
467
982
|
type schemas_BranchName = BranchName;
|
@@ -474,11 +989,37 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
474
989
|
type schemas_BranchMigration = BranchMigration;
|
475
990
|
type schemas_TableMigration = TableMigration;
|
476
991
|
type schemas_ColumnMigration = ColumnMigration;
|
992
|
+
type schemas_Commit = Commit;
|
993
|
+
type schemas_Migration = Migration;
|
994
|
+
type schemas_MigrationOp = MigrationOp;
|
995
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
996
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
997
|
+
type schemas_TableOpAdd = TableOpAdd;
|
998
|
+
type schemas_TableOpRemove = TableOpRemove;
|
999
|
+
type schemas_TableOpRename = TableOpRename;
|
1000
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
1001
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
1002
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
1003
|
+
type schemas_MigrationRequest = MigrationRequest;
|
477
1004
|
type schemas_SortExpression = SortExpression;
|
478
1005
|
type schemas_SortOrder = SortOrder;
|
479
1006
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
480
1007
|
type schemas_PrefixExpression = PrefixExpression;
|
1008
|
+
type schemas_TargetExpression = TargetExpression;
|
481
1009
|
type schemas_FilterExpression = FilterExpression;
|
1010
|
+
type schemas_SummaryExpressionList = SummaryExpressionList;
|
1011
|
+
type schemas_SummaryExpression = SummaryExpression;
|
1012
|
+
type schemas_AggExpressionMap = AggExpressionMap;
|
1013
|
+
type schemas_AggExpression = AggExpression;
|
1014
|
+
type schemas_CountAgg = CountAgg;
|
1015
|
+
type schemas_SumAgg = SumAgg;
|
1016
|
+
type schemas_MaxAgg = MaxAgg;
|
1017
|
+
type schemas_MinAgg = MinAgg;
|
1018
|
+
type schemas_AverageAgg = AverageAgg;
|
1019
|
+
type schemas_UniqueCountAgg = UniqueCountAgg;
|
1020
|
+
type schemas_DateHistogramAgg = DateHistogramAgg;
|
1021
|
+
type schemas_TopValuesAgg = TopValuesAgg;
|
1022
|
+
type schemas_NumericHistogramAgg = NumericHistogramAgg;
|
482
1023
|
type schemas_HighlightExpression = HighlightExpression;
|
483
1024
|
type schemas_BoosterExpression = BoosterExpression;
|
484
1025
|
type schemas_FilterList = FilterList;
|
@@ -511,6 +1052,7 @@ declare namespace schemas {
|
|
511
1052
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
512
1053
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
513
1054
|
schemas_InviteKey as InviteKey,
|
1055
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
514
1056
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
515
1057
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
516
1058
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
@@ -519,7 +1061,9 @@ declare namespace schemas {
|
|
519
1061
|
schemas_DBBranch as DBBranch,
|
520
1062
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
521
1063
|
schemas_Schema as Schema,
|
1064
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
522
1065
|
schemas_Table as Table,
|
1066
|
+
schemas_TableEdit as TableEdit,
|
523
1067
|
schemas_Column as Column,
|
524
1068
|
schemas_RevLink as RevLink,
|
525
1069
|
schemas_BranchName as BranchName,
|
@@ -532,11 +1076,37 @@ declare namespace schemas {
|
|
532
1076
|
schemas_BranchMigration as BranchMigration,
|
533
1077
|
schemas_TableMigration as TableMigration,
|
534
1078
|
schemas_ColumnMigration as ColumnMigration,
|
1079
|
+
schemas_Commit as Commit,
|
1080
|
+
schemas_Migration as Migration,
|
1081
|
+
schemas_MigrationOp as MigrationOp,
|
1082
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
1083
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
1084
|
+
schemas_TableOpAdd as TableOpAdd,
|
1085
|
+
schemas_TableOpRemove as TableOpRemove,
|
1086
|
+
schemas_TableOpRename as TableOpRename,
|
1087
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
1088
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
1089
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
1090
|
+
schemas_MigrationRequest as MigrationRequest,
|
535
1091
|
schemas_SortExpression as SortExpression,
|
536
1092
|
schemas_SortOrder as SortOrder,
|
537
1093
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
538
1094
|
schemas_PrefixExpression as PrefixExpression,
|
1095
|
+
schemas_TargetExpression as TargetExpression,
|
539
1096
|
schemas_FilterExpression as FilterExpression,
|
1097
|
+
schemas_SummaryExpressionList as SummaryExpressionList,
|
1098
|
+
schemas_SummaryExpression as SummaryExpression,
|
1099
|
+
schemas_AggExpressionMap as AggExpressionMap,
|
1100
|
+
schemas_AggExpression as AggExpression,
|
1101
|
+
schemas_CountAgg as CountAgg,
|
1102
|
+
schemas_SumAgg as SumAgg,
|
1103
|
+
schemas_MaxAgg as MaxAgg,
|
1104
|
+
schemas_MinAgg as MinAgg,
|
1105
|
+
schemas_AverageAgg as AverageAgg,
|
1106
|
+
schemas_UniqueCountAgg as UniqueCountAgg,
|
1107
|
+
schemas_DateHistogramAgg as DateHistogramAgg,
|
1108
|
+
schemas_TopValuesAgg as TopValuesAgg,
|
1109
|
+
schemas_NumericHistogramAgg as NumericHistogramAgg,
|
540
1110
|
schemas_HighlightExpression as HighlightExpression,
|
541
1111
|
schemas_BoosterExpression as BoosterExpression,
|
542
1112
|
ValueBooster$1 as ValueBooster,
|
@@ -556,6 +1126,7 @@ declare namespace schemas {
|
|
556
1126
|
schemas_RecordID as RecordID,
|
557
1127
|
schemas_TableRename as TableRename,
|
558
1128
|
schemas_RecordsMetadata as RecordsMetadata,
|
1129
|
+
AggResponse$1 as AggResponse,
|
559
1130
|
XataRecord$1 as XataRecord,
|
560
1131
|
};
|
561
1132
|
}
|
@@ -597,6 +1168,11 @@ declare type BranchMigrationPlan = {
|
|
597
1168
|
migration: BranchMigration;
|
598
1169
|
};
|
599
1170
|
declare type RecordResponse = XataRecord$1;
|
1171
|
+
declare type SchemaCompareResponse = {
|
1172
|
+
source: Schema;
|
1173
|
+
target: Schema;
|
1174
|
+
edits: SchemaEditScript;
|
1175
|
+
};
|
600
1176
|
declare type RecordUpdateResponse = XataRecord$1 | {
|
601
1177
|
id: string;
|
602
1178
|
xata: {
|
@@ -607,13 +1183,28 @@ declare type QueryResponse = {
|
|
607
1183
|
records: XataRecord$1[];
|
608
1184
|
meta: RecordsMetadata;
|
609
1185
|
};
|
1186
|
+
declare type SummarizeResponse = {
|
1187
|
+
summaries: Record<string, any>[];
|
1188
|
+
};
|
1189
|
+
/**
|
1190
|
+
* @example {"aggs":{"dailyUniqueUsers":{"values":[{"key":"2022-02-22T22:22:22","uniqueUsers":134},{"key":"2022-02-23T22:22:22","uniqueUsers":90}]}}}
|
1191
|
+
*/
|
1192
|
+
declare type AggResponse = {
|
1193
|
+
aggs?: {
|
1194
|
+
[key: string]: AggResponse$1;
|
1195
|
+
};
|
1196
|
+
};
|
610
1197
|
declare type SearchResponse = {
|
611
1198
|
records: XataRecord$1[];
|
1199
|
+
warning?: string;
|
612
1200
|
};
|
613
1201
|
/**
|
614
1202
|
* @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
|
615
1203
|
*/
|
616
1204
|
declare type MigrationIdResponse = {
|
1205
|
+
/**
|
1206
|
+
* @minLength 1
|
1207
|
+
*/
|
617
1208
|
migrationID: string;
|
618
1209
|
};
|
619
1210
|
|
@@ -624,8 +1215,11 @@ type responses_BulkError = BulkError;
|
|
624
1215
|
type responses_BulkInsertResponse = BulkInsertResponse;
|
625
1216
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
626
1217
|
type responses_RecordResponse = RecordResponse;
|
1218
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
627
1219
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
628
1220
|
type responses_QueryResponse = QueryResponse;
|
1221
|
+
type responses_SummarizeResponse = SummarizeResponse;
|
1222
|
+
type responses_AggResponse = AggResponse;
|
629
1223
|
type responses_SearchResponse = SearchResponse;
|
630
1224
|
type responses_MigrationIdResponse = MigrationIdResponse;
|
631
1225
|
declare namespace responses {
|
@@ -637,8 +1231,11 @@ declare namespace responses {
|
|
637
1231
|
responses_BulkInsertResponse as BulkInsertResponse,
|
638
1232
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
639
1233
|
responses_RecordResponse as RecordResponse,
|
1234
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
640
1235
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
641
1236
|
responses_QueryResponse as QueryResponse,
|
1237
|
+
responses_SummarizeResponse as SummarizeResponse,
|
1238
|
+
responses_AggResponse as AggResponse,
|
642
1239
|
responses_SearchResponse as SearchResponse,
|
643
1240
|
responses_MigrationIdResponse as MigrationIdResponse,
|
644
1241
|
};
|
@@ -664,7 +1261,7 @@ declare type GetUserVariables = FetcherExtraProps;
|
|
664
1261
|
/**
|
665
1262
|
* Return details of the user making the request
|
666
1263
|
*/
|
667
|
-
declare const getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
1264
|
+
declare const getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
668
1265
|
declare type UpdateUserError = ErrorWrapper<{
|
669
1266
|
status: 400;
|
670
1267
|
payload: BadRequestError;
|
@@ -681,7 +1278,7 @@ declare type UpdateUserVariables = {
|
|
681
1278
|
/**
|
682
1279
|
* Update user info
|
683
1280
|
*/
|
684
|
-
declare const updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
|
1281
|
+
declare const updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
685
1282
|
declare type DeleteUserError = ErrorWrapper<{
|
686
1283
|
status: 400;
|
687
1284
|
payload: BadRequestError;
|
@@ -696,7 +1293,7 @@ declare type DeleteUserVariables = FetcherExtraProps;
|
|
696
1293
|
/**
|
697
1294
|
* Delete the user making the request
|
698
1295
|
*/
|
699
|
-
declare const deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
|
1296
|
+
declare const deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
|
700
1297
|
declare type GetUserAPIKeysError = ErrorWrapper<{
|
701
1298
|
status: 400;
|
702
1299
|
payload: BadRequestError;
|
@@ -717,8 +1314,11 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
|
|
717
1314
|
/**
|
718
1315
|
* Retrieve a list of existing user API keys
|
719
1316
|
*/
|
720
|
-
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
|
1317
|
+
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
|
721
1318
|
declare type CreateUserAPIKeyPathParams = {
|
1319
|
+
/**
|
1320
|
+
* API Key name
|
1321
|
+
*/
|
722
1322
|
keyName: APIKeyName;
|
723
1323
|
};
|
724
1324
|
declare type CreateUserAPIKeyError = ErrorWrapper<{
|
@@ -742,8 +1342,11 @@ declare type CreateUserAPIKeyVariables = {
|
|
742
1342
|
/**
|
743
1343
|
* Create and return new API key
|
744
1344
|
*/
|
745
|
-
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
|
1345
|
+
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
|
746
1346
|
declare type DeleteUserAPIKeyPathParams = {
|
1347
|
+
/**
|
1348
|
+
* API Key name
|
1349
|
+
*/
|
747
1350
|
keyName: APIKeyName;
|
748
1351
|
};
|
749
1352
|
declare type DeleteUserAPIKeyError = ErrorWrapper<{
|
@@ -762,7 +1365,7 @@ declare type DeleteUserAPIKeyVariables = {
|
|
762
1365
|
/**
|
763
1366
|
* Delete an existing API key
|
764
1367
|
*/
|
765
|
-
declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
|
1368
|
+
declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
|
766
1369
|
declare type CreateWorkspaceError = ErrorWrapper<{
|
767
1370
|
status: 400;
|
768
1371
|
payload: BadRequestError;
|
@@ -779,7 +1382,7 @@ declare type CreateWorkspaceVariables = {
|
|
779
1382
|
/**
|
780
1383
|
* Creates a new workspace with the user requesting it as its single owner.
|
781
1384
|
*/
|
782
|
-
declare const createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
|
1385
|
+
declare const createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
783
1386
|
declare type GetWorkspacesListError = ErrorWrapper<{
|
784
1387
|
status: 400;
|
785
1388
|
payload: BadRequestError;
|
@@ -802,8 +1405,11 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
|
|
802
1405
|
/**
|
803
1406
|
* Retrieve the list of workspaces the user belongs to
|
804
1407
|
*/
|
805
|
-
declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
|
1408
|
+
declare const getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
|
806
1409
|
declare type GetWorkspacePathParams = {
|
1410
|
+
/**
|
1411
|
+
* Workspace ID
|
1412
|
+
*/
|
807
1413
|
workspaceId: WorkspaceID;
|
808
1414
|
};
|
809
1415
|
declare type GetWorkspaceError = ErrorWrapper<{
|
@@ -822,8 +1428,11 @@ declare type GetWorkspaceVariables = {
|
|
822
1428
|
/**
|
823
1429
|
* Retrieve workspace info from a workspace ID
|
824
1430
|
*/
|
825
|
-
declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
|
1431
|
+
declare const getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
826
1432
|
declare type UpdateWorkspacePathParams = {
|
1433
|
+
/**
|
1434
|
+
* Workspace ID
|
1435
|
+
*/
|
827
1436
|
workspaceId: WorkspaceID;
|
828
1437
|
};
|
829
1438
|
declare type UpdateWorkspaceError = ErrorWrapper<{
|
@@ -843,8 +1452,11 @@ declare type UpdateWorkspaceVariables = {
|
|
843
1452
|
/**
|
844
1453
|
* Update workspace info
|
845
1454
|
*/
|
846
|
-
declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
|
1455
|
+
declare const updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
847
1456
|
declare type DeleteWorkspacePathParams = {
|
1457
|
+
/**
|
1458
|
+
* Workspace ID
|
1459
|
+
*/
|
848
1460
|
workspaceId: WorkspaceID;
|
849
1461
|
};
|
850
1462
|
declare type DeleteWorkspaceError = ErrorWrapper<{
|
@@ -863,8 +1475,11 @@ declare type DeleteWorkspaceVariables = {
|
|
863
1475
|
/**
|
864
1476
|
* Delete the workspace with the provided ID
|
865
1477
|
*/
|
866
|
-
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
|
1478
|
+
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
|
867
1479
|
declare type GetWorkspaceMembersListPathParams = {
|
1480
|
+
/**
|
1481
|
+
* Workspace ID
|
1482
|
+
*/
|
868
1483
|
workspaceId: WorkspaceID;
|
869
1484
|
};
|
870
1485
|
declare type GetWorkspaceMembersListError = ErrorWrapper<{
|
@@ -883,9 +1498,15 @@ declare type GetWorkspaceMembersListVariables = {
|
|
883
1498
|
/**
|
884
1499
|
* Retrieve the list of members of the given workspace
|
885
1500
|
*/
|
886
|
-
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
|
1501
|
+
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
|
887
1502
|
declare type UpdateWorkspaceMemberRolePathParams = {
|
1503
|
+
/**
|
1504
|
+
* Workspace ID
|
1505
|
+
*/
|
888
1506
|
workspaceId: WorkspaceID;
|
1507
|
+
/**
|
1508
|
+
* UserID
|
1509
|
+
*/
|
889
1510
|
userId: UserID;
|
890
1511
|
};
|
891
1512
|
declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
|
@@ -908,9 +1529,15 @@ declare type UpdateWorkspaceMemberRoleVariables = {
|
|
908
1529
|
/**
|
909
1530
|
* 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
1531
|
*/
|
911
|
-
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
1532
|
+
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
|
912
1533
|
declare type RemoveWorkspaceMemberPathParams = {
|
1534
|
+
/**
|
1535
|
+
* Workspace ID
|
1536
|
+
*/
|
913
1537
|
workspaceId: WorkspaceID;
|
1538
|
+
/**
|
1539
|
+
* UserID
|
1540
|
+
*/
|
914
1541
|
userId: UserID;
|
915
1542
|
};
|
916
1543
|
declare type RemoveWorkspaceMemberError = ErrorWrapper<{
|
@@ -929,8 +1556,11 @@ declare type RemoveWorkspaceMemberVariables = {
|
|
929
1556
|
/**
|
930
1557
|
* Remove the member from the workspace
|
931
1558
|
*/
|
932
|
-
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
1559
|
+
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
|
933
1560
|
declare type InviteWorkspaceMemberPathParams = {
|
1561
|
+
/**
|
1562
|
+
* Workspace ID
|
1563
|
+
*/
|
934
1564
|
workspaceId: WorkspaceID;
|
935
1565
|
};
|
936
1566
|
declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
@@ -947,6 +1577,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
947
1577
|
payload: SimpleError;
|
948
1578
|
}>;
|
949
1579
|
declare type InviteWorkspaceMemberRequestBody = {
|
1580
|
+
/**
|
1581
|
+
* @format email
|
1582
|
+
*/
|
950
1583
|
email: string;
|
951
1584
|
role: Role;
|
952
1585
|
};
|
@@ -957,9 +1590,15 @@ declare type InviteWorkspaceMemberVariables = {
|
|
957
1590
|
/**
|
958
1591
|
* Invite some user to join the workspace with the given role
|
959
1592
|
*/
|
960
|
-
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
1593
|
+
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
961
1594
|
declare type UpdateWorkspaceMemberInvitePathParams = {
|
1595
|
+
/**
|
1596
|
+
* Workspace ID
|
1597
|
+
*/
|
962
1598
|
workspaceId: WorkspaceID;
|
1599
|
+
/**
|
1600
|
+
* Invite identifier
|
1601
|
+
*/
|
963
1602
|
inviteId: InviteID;
|
964
1603
|
};
|
965
1604
|
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -985,9 +1624,15 @@ declare type UpdateWorkspaceMemberInviteVariables = {
|
|
985
1624
|
/**
|
986
1625
|
* 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
1626
|
*/
|
988
|
-
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
1627
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
989
1628
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
1629
|
+
/**
|
1630
|
+
* Workspace ID
|
1631
|
+
*/
|
990
1632
|
workspaceId: WorkspaceID;
|
1633
|
+
/**
|
1634
|
+
* Invite identifier
|
1635
|
+
*/
|
991
1636
|
inviteId: InviteID;
|
992
1637
|
};
|
993
1638
|
declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -1006,9 +1651,15 @@ declare type CancelWorkspaceMemberInviteVariables = {
|
|
1006
1651
|
/**
|
1007
1652
|
* This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
|
1008
1653
|
*/
|
1009
|
-
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
1654
|
+
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
1010
1655
|
declare type ResendWorkspaceMemberInvitePathParams = {
|
1656
|
+
/**
|
1657
|
+
* Workspace ID
|
1658
|
+
*/
|
1011
1659
|
workspaceId: WorkspaceID;
|
1660
|
+
/**
|
1661
|
+
* Invite identifier
|
1662
|
+
*/
|
1012
1663
|
inviteId: InviteID;
|
1013
1664
|
};
|
1014
1665
|
declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -1027,9 +1678,15 @@ declare type ResendWorkspaceMemberInviteVariables = {
|
|
1027
1678
|
/**
|
1028
1679
|
* This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
|
1029
1680
|
*/
|
1030
|
-
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
1681
|
+
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
1031
1682
|
declare type AcceptWorkspaceMemberInvitePathParams = {
|
1683
|
+
/**
|
1684
|
+
* Workspace ID
|
1685
|
+
*/
|
1032
1686
|
workspaceId: WorkspaceID;
|
1687
|
+
/**
|
1688
|
+
* Invite Key (secret) for the invited user
|
1689
|
+
*/
|
1033
1690
|
inviteKey: InviteKey;
|
1034
1691
|
};
|
1035
1692
|
declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -1048,7 +1705,7 @@ declare type AcceptWorkspaceMemberInviteVariables = {
|
|
1048
1705
|
/**
|
1049
1706
|
* Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
|
1050
1707
|
*/
|
1051
|
-
declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
1708
|
+
declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
1052
1709
|
declare type GetDatabaseListPathParams = {
|
1053
1710
|
workspace: string;
|
1054
1711
|
};
|
@@ -1065,8 +1722,11 @@ declare type GetDatabaseListVariables = {
|
|
1065
1722
|
/**
|
1066
1723
|
* List all databases available in your Workspace.
|
1067
1724
|
*/
|
1068
|
-
declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
1725
|
+
declare const getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
|
1069
1726
|
declare type GetBranchListPathParams = {
|
1727
|
+
/**
|
1728
|
+
* The Database Name
|
1729
|
+
*/
|
1070
1730
|
dbName: DBName;
|
1071
1731
|
workspace: string;
|
1072
1732
|
};
|
@@ -1086,8 +1746,11 @@ declare type GetBranchListVariables = {
|
|
1086
1746
|
/**
|
1087
1747
|
* List all available Branches
|
1088
1748
|
*/
|
1089
|
-
declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
1749
|
+
declare const getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
|
1090
1750
|
declare type CreateDatabasePathParams = {
|
1751
|
+
/**
|
1752
|
+
* The Database Name
|
1753
|
+
*/
|
1091
1754
|
dbName: DBName;
|
1092
1755
|
workspace: string;
|
1093
1756
|
};
|
@@ -1099,11 +1762,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
|
|
1099
1762
|
payload: AuthError;
|
1100
1763
|
}>;
|
1101
1764
|
declare type CreateDatabaseResponse = {
|
1765
|
+
/**
|
1766
|
+
* @minLength 1
|
1767
|
+
*/
|
1102
1768
|
databaseName: string;
|
1103
1769
|
branchName?: string;
|
1104
1770
|
};
|
1105
1771
|
declare type CreateDatabaseRequestBody = {
|
1106
|
-
|
1772
|
+
/**
|
1773
|
+
* @minLength 1
|
1774
|
+
*/
|
1107
1775
|
branchName?: string;
|
1108
1776
|
ui?: {
|
1109
1777
|
color?: string;
|
@@ -1117,8 +1785,11 @@ declare type CreateDatabaseVariables = {
|
|
1117
1785
|
/**
|
1118
1786
|
* Create Database with identifier name
|
1119
1787
|
*/
|
1120
|
-
declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
1788
|
+
declare const createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
|
1121
1789
|
declare type DeleteDatabasePathParams = {
|
1790
|
+
/**
|
1791
|
+
* The Database Name
|
1792
|
+
*/
|
1122
1793
|
dbName: DBName;
|
1123
1794
|
workspace: string;
|
1124
1795
|
};
|
@@ -1138,8 +1809,68 @@ declare type DeleteDatabaseVariables = {
|
|
1138
1809
|
/**
|
1139
1810
|
* Delete a database and all of its branches and tables permanently.
|
1140
1811
|
*/
|
1141
|
-
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1812
|
+
declare const deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
|
1813
|
+
declare type GetDatabaseMetadataPathParams = {
|
1814
|
+
/**
|
1815
|
+
* The Database Name
|
1816
|
+
*/
|
1817
|
+
dbName: DBName;
|
1818
|
+
workspace: string;
|
1819
|
+
};
|
1820
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
1821
|
+
status: 400;
|
1822
|
+
payload: BadRequestError;
|
1823
|
+
} | {
|
1824
|
+
status: 401;
|
1825
|
+
payload: AuthError;
|
1826
|
+
} | {
|
1827
|
+
status: 404;
|
1828
|
+
payload: SimpleError;
|
1829
|
+
}>;
|
1830
|
+
declare type GetDatabaseMetadataVariables = {
|
1831
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1832
|
+
} & FetcherExtraProps;
|
1833
|
+
/**
|
1834
|
+
* Retrieve metadata of the given database
|
1835
|
+
*/
|
1836
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
1837
|
+
declare type UpdateDatabaseMetadataPathParams = {
|
1838
|
+
/**
|
1839
|
+
* The Database Name
|
1840
|
+
*/
|
1841
|
+
dbName: DBName;
|
1842
|
+
workspace: string;
|
1843
|
+
};
|
1844
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
1845
|
+
status: 400;
|
1846
|
+
payload: BadRequestError;
|
1847
|
+
} | {
|
1848
|
+
status: 401;
|
1849
|
+
payload: AuthError;
|
1850
|
+
} | {
|
1851
|
+
status: 404;
|
1852
|
+
payload: SimpleError;
|
1853
|
+
}>;
|
1854
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
1855
|
+
ui?: {
|
1856
|
+
/**
|
1857
|
+
* @minLength 1
|
1858
|
+
*/
|
1859
|
+
color?: string;
|
1860
|
+
};
|
1861
|
+
};
|
1862
|
+
declare type UpdateDatabaseMetadataVariables = {
|
1863
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
1864
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
1865
|
+
} & FetcherExtraProps;
|
1866
|
+
/**
|
1867
|
+
* Update the color of the selected database
|
1868
|
+
*/
|
1869
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
1142
1870
|
declare type GetGitBranchesMappingPathParams = {
|
1871
|
+
/**
|
1872
|
+
* The Database Name
|
1873
|
+
*/
|
1143
1874
|
dbName: DBName;
|
1144
1875
|
workspace: string;
|
1145
1876
|
};
|
@@ -1177,8 +1908,11 @@ declare type GetGitBranchesMappingVariables = {
|
|
1177
1908
|
* }
|
1178
1909
|
* ```
|
1179
1910
|
*/
|
1180
|
-
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
1911
|
+
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
|
1181
1912
|
declare type AddGitBranchesEntryPathParams = {
|
1913
|
+
/**
|
1914
|
+
* The Database Name
|
1915
|
+
*/
|
1182
1916
|
dbName: DBName;
|
1183
1917
|
workspace: string;
|
1184
1918
|
};
|
@@ -1190,10 +1924,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
|
|
1190
1924
|
payload: AuthError;
|
1191
1925
|
}>;
|
1192
1926
|
declare type AddGitBranchesEntryResponse = {
|
1927
|
+
/**
|
1928
|
+
* Warning message
|
1929
|
+
*/
|
1193
1930
|
warning?: string;
|
1194
1931
|
};
|
1195
1932
|
declare type AddGitBranchesEntryRequestBody = {
|
1933
|
+
/**
|
1934
|
+
* The name of the Git branch.
|
1935
|
+
*/
|
1196
1936
|
gitBranch: string;
|
1937
|
+
/**
|
1938
|
+
* The name of the Xata branch.
|
1939
|
+
*/
|
1197
1940
|
xataBranch: BranchName;
|
1198
1941
|
};
|
1199
1942
|
declare type AddGitBranchesEntryVariables = {
|
@@ -1215,12 +1958,18 @@ declare type AddGitBranchesEntryVariables = {
|
|
1215
1958
|
* }
|
1216
1959
|
* ```
|
1217
1960
|
*/
|
1218
|
-
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
1961
|
+
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
|
1219
1962
|
declare type RemoveGitBranchesEntryPathParams = {
|
1963
|
+
/**
|
1964
|
+
* The Database Name
|
1965
|
+
*/
|
1220
1966
|
dbName: DBName;
|
1221
1967
|
workspace: string;
|
1222
1968
|
};
|
1223
1969
|
declare type RemoveGitBranchesEntryQueryParams = {
|
1970
|
+
/**
|
1971
|
+
* The Git Branch to remove from the mapping
|
1972
|
+
*/
|
1224
1973
|
gitBranch: string;
|
1225
1974
|
};
|
1226
1975
|
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
@@ -1243,13 +1992,22 @@ declare type RemoveGitBranchesEntryVariables = {
|
|
1243
1992
|
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
1244
1993
|
* ```
|
1245
1994
|
*/
|
1246
|
-
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
1995
|
+
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
|
1247
1996
|
declare type ResolveBranchPathParams = {
|
1997
|
+
/**
|
1998
|
+
* The Database Name
|
1999
|
+
*/
|
1248
2000
|
dbName: DBName;
|
1249
2001
|
workspace: string;
|
1250
2002
|
};
|
1251
2003
|
declare type ResolveBranchQueryParams = {
|
2004
|
+
/**
|
2005
|
+
* The Git Branch
|
2006
|
+
*/
|
1252
2007
|
gitBranch?: string;
|
2008
|
+
/**
|
2009
|
+
* Default branch to fallback to
|
2010
|
+
*/
|
1253
2011
|
fallbackBranch?: string;
|
1254
2012
|
};
|
1255
2013
|
declare type ResolveBranchError = ErrorWrapper<{
|
@@ -1295,8 +2053,286 @@ declare type ResolveBranchVariables = {
|
|
1295
2053
|
* }
|
1296
2054
|
* ```
|
1297
2055
|
*/
|
1298
|
-
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
2056
|
+
declare const resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
|
2057
|
+
declare type QueryMigrationRequestsPathParams = {
|
2058
|
+
/**
|
2059
|
+
* The Database Name
|
2060
|
+
*/
|
2061
|
+
dbName: DBName;
|
2062
|
+
workspace: string;
|
2063
|
+
};
|
2064
|
+
declare type QueryMigrationRequestsError = ErrorWrapper<{
|
2065
|
+
status: 400;
|
2066
|
+
payload: BadRequestError;
|
2067
|
+
} | {
|
2068
|
+
status: 401;
|
2069
|
+
payload: AuthError;
|
2070
|
+
} | {
|
2071
|
+
status: 404;
|
2072
|
+
payload: SimpleError;
|
2073
|
+
}>;
|
2074
|
+
declare type QueryMigrationRequestsResponse = {
|
2075
|
+
migrationRequests: MigrationRequest[];
|
2076
|
+
meta: RecordsMetadata;
|
2077
|
+
};
|
2078
|
+
declare type QueryMigrationRequestsRequestBody = {
|
2079
|
+
filter?: FilterExpression;
|
2080
|
+
sort?: SortExpression;
|
2081
|
+
page?: PageConfig;
|
2082
|
+
columns?: ColumnsProjection;
|
2083
|
+
};
|
2084
|
+
declare type QueryMigrationRequestsVariables = {
|
2085
|
+
body?: QueryMigrationRequestsRequestBody;
|
2086
|
+
pathParams: QueryMigrationRequestsPathParams;
|
2087
|
+
} & FetcherExtraProps;
|
2088
|
+
declare const queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
|
2089
|
+
declare type CreateMigrationRequestPathParams = {
|
2090
|
+
/**
|
2091
|
+
* The Database Name
|
2092
|
+
*/
|
2093
|
+
dbName: DBName;
|
2094
|
+
workspace: string;
|
2095
|
+
};
|
2096
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
2097
|
+
status: 400;
|
2098
|
+
payload: BadRequestError;
|
2099
|
+
} | {
|
2100
|
+
status: 401;
|
2101
|
+
payload: AuthError;
|
2102
|
+
} | {
|
2103
|
+
status: 404;
|
2104
|
+
payload: SimpleError;
|
2105
|
+
}>;
|
2106
|
+
declare type CreateMigrationRequestResponse = {
|
2107
|
+
number: number;
|
2108
|
+
};
|
2109
|
+
declare type CreateMigrationRequestRequestBody = {
|
2110
|
+
/**
|
2111
|
+
* The source branch.
|
2112
|
+
*/
|
2113
|
+
source: string;
|
2114
|
+
/**
|
2115
|
+
* The target branch.
|
2116
|
+
*/
|
2117
|
+
target: string;
|
2118
|
+
/**
|
2119
|
+
* The title.
|
2120
|
+
*/
|
2121
|
+
title: string;
|
2122
|
+
/**
|
2123
|
+
* Optional migration request description.
|
2124
|
+
*/
|
2125
|
+
body?: string;
|
2126
|
+
};
|
2127
|
+
declare type CreateMigrationRequestVariables = {
|
2128
|
+
body: CreateMigrationRequestRequestBody;
|
2129
|
+
pathParams: CreateMigrationRequestPathParams;
|
2130
|
+
} & FetcherExtraProps;
|
2131
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
|
2132
|
+
declare type GetMigrationRequestPathParams = {
|
2133
|
+
/**
|
2134
|
+
* The Database Name
|
2135
|
+
*/
|
2136
|
+
dbName: DBName;
|
2137
|
+
/**
|
2138
|
+
* The migration request number.
|
2139
|
+
*/
|
2140
|
+
mrNumber: number;
|
2141
|
+
workspace: string;
|
2142
|
+
};
|
2143
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
2144
|
+
status: 400;
|
2145
|
+
payload: BadRequestError;
|
2146
|
+
} | {
|
2147
|
+
status: 401;
|
2148
|
+
payload: AuthError;
|
2149
|
+
} | {
|
2150
|
+
status: 404;
|
2151
|
+
payload: SimpleError;
|
2152
|
+
}>;
|
2153
|
+
declare type GetMigrationRequestVariables = {
|
2154
|
+
pathParams: GetMigrationRequestPathParams;
|
2155
|
+
} & FetcherExtraProps;
|
2156
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
|
2157
|
+
declare type UpdateMigrationRequestPathParams = {
|
2158
|
+
/**
|
2159
|
+
* The Database Name
|
2160
|
+
*/
|
2161
|
+
dbName: DBName;
|
2162
|
+
/**
|
2163
|
+
* The migration request number.
|
2164
|
+
*/
|
2165
|
+
mrNumber: number;
|
2166
|
+
workspace: string;
|
2167
|
+
};
|
2168
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
2169
|
+
status: 400;
|
2170
|
+
payload: BadRequestError;
|
2171
|
+
} | {
|
2172
|
+
status: 401;
|
2173
|
+
payload: AuthError;
|
2174
|
+
} | {
|
2175
|
+
status: 404;
|
2176
|
+
payload: SimpleError;
|
2177
|
+
}>;
|
2178
|
+
declare type UpdateMigrationRequestRequestBody = {
|
2179
|
+
/**
|
2180
|
+
* New migration request title.
|
2181
|
+
*/
|
2182
|
+
title?: string;
|
2183
|
+
/**
|
2184
|
+
* New migration request description.
|
2185
|
+
*/
|
2186
|
+
body?: string;
|
2187
|
+
/**
|
2188
|
+
* Change the migration request status.
|
2189
|
+
*/
|
2190
|
+
status?: 'open' | 'closed';
|
2191
|
+
};
|
2192
|
+
declare type UpdateMigrationRequestVariables = {
|
2193
|
+
body?: UpdateMigrationRequestRequestBody;
|
2194
|
+
pathParams: UpdateMigrationRequestPathParams;
|
2195
|
+
} & FetcherExtraProps;
|
2196
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
|
2197
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
2198
|
+
/**
|
2199
|
+
* The Database Name
|
2200
|
+
*/
|
2201
|
+
dbName: DBName;
|
2202
|
+
/**
|
2203
|
+
* The migration request number.
|
2204
|
+
*/
|
2205
|
+
mrNumber: number;
|
2206
|
+
workspace: string;
|
2207
|
+
};
|
2208
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
2209
|
+
status: 400;
|
2210
|
+
payload: BadRequestError;
|
2211
|
+
} | {
|
2212
|
+
status: 401;
|
2213
|
+
payload: AuthError;
|
2214
|
+
} | {
|
2215
|
+
status: 404;
|
2216
|
+
payload: SimpleError;
|
2217
|
+
}>;
|
2218
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
2219
|
+
meta: {
|
2220
|
+
/**
|
2221
|
+
* last record id
|
2222
|
+
*/
|
2223
|
+
cursor: string;
|
2224
|
+
/**
|
2225
|
+
* true if more records can be fetch
|
2226
|
+
*/
|
2227
|
+
more: boolean;
|
2228
|
+
};
|
2229
|
+
logs: Commit[];
|
2230
|
+
};
|
2231
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
2232
|
+
page?: {
|
2233
|
+
/**
|
2234
|
+
* Query the next page that follow the cursor.
|
2235
|
+
*/
|
2236
|
+
after?: string;
|
2237
|
+
/**
|
2238
|
+
* Query the previous page before the cursor.
|
2239
|
+
*/
|
2240
|
+
before?: string;
|
2241
|
+
/**
|
2242
|
+
* 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.
|
2243
|
+
*
|
2244
|
+
* @default 20
|
2245
|
+
*/
|
2246
|
+
size?: number;
|
2247
|
+
};
|
2248
|
+
};
|
2249
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
2250
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
2251
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
2252
|
+
} & FetcherExtraProps;
|
2253
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
|
2254
|
+
declare type CompareMigrationRequestPathParams = {
|
2255
|
+
/**
|
2256
|
+
* The Database Name
|
2257
|
+
*/
|
2258
|
+
dbName: DBName;
|
2259
|
+
/**
|
2260
|
+
* The migration request number.
|
2261
|
+
*/
|
2262
|
+
mrNumber: number;
|
2263
|
+
workspace: string;
|
2264
|
+
};
|
2265
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
2266
|
+
status: 400;
|
2267
|
+
payload: BadRequestError;
|
2268
|
+
} | {
|
2269
|
+
status: 401;
|
2270
|
+
payload: AuthError;
|
2271
|
+
} | {
|
2272
|
+
status: 404;
|
2273
|
+
payload: SimpleError;
|
2274
|
+
}>;
|
2275
|
+
declare type CompareMigrationRequestVariables = {
|
2276
|
+
pathParams: CompareMigrationRequestPathParams;
|
2277
|
+
} & FetcherExtraProps;
|
2278
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
2279
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
2280
|
+
/**
|
2281
|
+
* The Database Name
|
2282
|
+
*/
|
2283
|
+
dbName: DBName;
|
2284
|
+
/**
|
2285
|
+
* The migration request number.
|
2286
|
+
*/
|
2287
|
+
mrNumber: number;
|
2288
|
+
workspace: string;
|
2289
|
+
};
|
2290
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
2291
|
+
status: 400;
|
2292
|
+
payload: BadRequestError;
|
2293
|
+
} | {
|
2294
|
+
status: 401;
|
2295
|
+
payload: AuthError;
|
2296
|
+
} | {
|
2297
|
+
status: 404;
|
2298
|
+
payload: SimpleError;
|
2299
|
+
}>;
|
2300
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
2301
|
+
merged?: boolean;
|
2302
|
+
};
|
2303
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
2304
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
2305
|
+
} & FetcherExtraProps;
|
2306
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
|
2307
|
+
declare type MergeMigrationRequestPathParams = {
|
2308
|
+
/**
|
2309
|
+
* The Database Name
|
2310
|
+
*/
|
2311
|
+
dbName: DBName;
|
2312
|
+
/**
|
2313
|
+
* The migration request number.
|
2314
|
+
*/
|
2315
|
+
mrNumber: number;
|
2316
|
+
workspace: string;
|
2317
|
+
};
|
2318
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
2319
|
+
status: 400;
|
2320
|
+
payload: BadRequestError;
|
2321
|
+
} | {
|
2322
|
+
status: 401;
|
2323
|
+
payload: AuthError;
|
2324
|
+
} | {
|
2325
|
+
status: 404;
|
2326
|
+
payload: SimpleError;
|
2327
|
+
}>;
|
2328
|
+
declare type MergeMigrationRequestVariables = {
|
2329
|
+
pathParams: MergeMigrationRequestPathParams;
|
2330
|
+
} & FetcherExtraProps;
|
2331
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
|
1299
2332
|
declare type GetBranchDetailsPathParams = {
|
2333
|
+
/**
|
2334
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2335
|
+
*/
|
1300
2336
|
dbBranchName: DBBranchName;
|
1301
2337
|
workspace: string;
|
1302
2338
|
};
|
@@ -1313,12 +2349,18 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
1313
2349
|
declare type GetBranchDetailsVariables = {
|
1314
2350
|
pathParams: GetBranchDetailsPathParams;
|
1315
2351
|
} & FetcherExtraProps;
|
1316
|
-
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2352
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
|
1317
2353
|
declare type CreateBranchPathParams = {
|
2354
|
+
/**
|
2355
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2356
|
+
*/
|
1318
2357
|
dbBranchName: DBBranchName;
|
1319
2358
|
workspace: string;
|
1320
2359
|
};
|
1321
2360
|
declare type CreateBranchQueryParams = {
|
2361
|
+
/**
|
2362
|
+
* Name of source branch to branch the new schema from
|
2363
|
+
*/
|
1322
2364
|
from?: string;
|
1323
2365
|
};
|
1324
2366
|
declare type CreateBranchError = ErrorWrapper<{
|
@@ -1332,10 +2374,16 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1332
2374
|
payload: SimpleError;
|
1333
2375
|
}>;
|
1334
2376
|
declare type CreateBranchResponse = {
|
2377
|
+
/**
|
2378
|
+
* @minLength 1
|
2379
|
+
*/
|
1335
2380
|
databaseName: string;
|
1336
2381
|
branchName: string;
|
1337
2382
|
};
|
1338
2383
|
declare type CreateBranchRequestBody = {
|
2384
|
+
/**
|
2385
|
+
* Select the branch to fork from. Defaults to 'main'
|
2386
|
+
*/
|
1339
2387
|
from?: string;
|
1340
2388
|
metadata?: BranchMetadata;
|
1341
2389
|
};
|
@@ -1344,8 +2392,11 @@ declare type CreateBranchVariables = {
|
|
1344
2392
|
pathParams: CreateBranchPathParams;
|
1345
2393
|
queryParams?: CreateBranchQueryParams;
|
1346
2394
|
} & FetcherExtraProps;
|
1347
|
-
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2395
|
+
declare const createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
|
1348
2396
|
declare type DeleteBranchPathParams = {
|
2397
|
+
/**
|
2398
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2399
|
+
*/
|
1349
2400
|
dbBranchName: DBBranchName;
|
1350
2401
|
workspace: string;
|
1351
2402
|
};
|
@@ -1365,12 +2416,174 @@ declare type DeleteBranchVariables = {
|
|
1365
2416
|
/**
|
1366
2417
|
* Delete the branch in the database and all its resources
|
1367
2418
|
*/
|
1368
|
-
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2419
|
+
declare const deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
|
1369
2420
|
declare type UpdateBranchMetadataPathParams = {
|
2421
|
+
/**
|
2422
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2423
|
+
*/
|
2424
|
+
dbBranchName: DBBranchName;
|
2425
|
+
workspace: string;
|
2426
|
+
};
|
2427
|
+
declare type UpdateBranchMetadataError = ErrorWrapper<{
|
2428
|
+
status: 400;
|
2429
|
+
payload: BadRequestError;
|
2430
|
+
} | {
|
2431
|
+
status: 401;
|
2432
|
+
payload: AuthError;
|
2433
|
+
} | {
|
2434
|
+
status: 404;
|
2435
|
+
payload: SimpleError;
|
2436
|
+
}>;
|
2437
|
+
declare type UpdateBranchMetadataVariables = {
|
2438
|
+
body?: BranchMetadata;
|
2439
|
+
pathParams: UpdateBranchMetadataPathParams;
|
2440
|
+
} & FetcherExtraProps;
|
2441
|
+
/**
|
2442
|
+
* Update the branch metadata
|
2443
|
+
*/
|
2444
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
|
2445
|
+
declare type GetBranchMetadataPathParams = {
|
2446
|
+
/**
|
2447
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2448
|
+
*/
|
2449
|
+
dbBranchName: DBBranchName;
|
2450
|
+
workspace: string;
|
2451
|
+
};
|
2452
|
+
declare type GetBranchMetadataError = ErrorWrapper<{
|
2453
|
+
status: 400;
|
2454
|
+
payload: BadRequestError;
|
2455
|
+
} | {
|
2456
|
+
status: 401;
|
2457
|
+
payload: AuthError;
|
2458
|
+
} | {
|
2459
|
+
status: 404;
|
2460
|
+
payload: SimpleError;
|
2461
|
+
}>;
|
2462
|
+
declare type GetBranchMetadataVariables = {
|
2463
|
+
pathParams: GetBranchMetadataPathParams;
|
2464
|
+
} & FetcherExtraProps;
|
2465
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
|
2466
|
+
declare type GetBranchMigrationHistoryPathParams = {
|
2467
|
+
/**
|
2468
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2469
|
+
*/
|
2470
|
+
dbBranchName: DBBranchName;
|
2471
|
+
workspace: string;
|
2472
|
+
};
|
2473
|
+
declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
2474
|
+
status: 400;
|
2475
|
+
payload: BadRequestError;
|
2476
|
+
} | {
|
2477
|
+
status: 401;
|
2478
|
+
payload: AuthError;
|
2479
|
+
} | {
|
2480
|
+
status: 404;
|
2481
|
+
payload: SimpleError;
|
2482
|
+
}>;
|
2483
|
+
declare type GetBranchMigrationHistoryResponse = {
|
2484
|
+
startedFrom?: StartedFromMetadata;
|
2485
|
+
migrations?: BranchMigration[];
|
2486
|
+
};
|
2487
|
+
declare type GetBranchMigrationHistoryRequestBody = {
|
2488
|
+
limit?: number;
|
2489
|
+
startFrom?: string;
|
2490
|
+
};
|
2491
|
+
declare type GetBranchMigrationHistoryVariables = {
|
2492
|
+
body?: GetBranchMigrationHistoryRequestBody;
|
2493
|
+
pathParams: GetBranchMigrationHistoryPathParams;
|
2494
|
+
} & FetcherExtraProps;
|
2495
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
|
2496
|
+
declare type ExecuteBranchMigrationPlanPathParams = {
|
2497
|
+
/**
|
2498
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2499
|
+
*/
|
2500
|
+
dbBranchName: DBBranchName;
|
2501
|
+
workspace: string;
|
2502
|
+
};
|
2503
|
+
declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
2504
|
+
status: 400;
|
2505
|
+
payload: BadRequestError;
|
2506
|
+
} | {
|
2507
|
+
status: 401;
|
2508
|
+
payload: AuthError;
|
2509
|
+
} | {
|
2510
|
+
status: 404;
|
2511
|
+
payload: SimpleError;
|
2512
|
+
}>;
|
2513
|
+
declare type ExecuteBranchMigrationPlanRequestBody = {
|
2514
|
+
version: number;
|
2515
|
+
migration: BranchMigration;
|
2516
|
+
};
|
2517
|
+
declare type ExecuteBranchMigrationPlanVariables = {
|
2518
|
+
body: ExecuteBranchMigrationPlanRequestBody;
|
2519
|
+
pathParams: ExecuteBranchMigrationPlanPathParams;
|
2520
|
+
} & FetcherExtraProps;
|
2521
|
+
/**
|
2522
|
+
* Apply a migration plan to the branch
|
2523
|
+
*/
|
2524
|
+
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
|
2525
|
+
declare type GetBranchMigrationPlanPathParams = {
|
2526
|
+
/**
|
2527
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2528
|
+
*/
|
2529
|
+
dbBranchName: DBBranchName;
|
2530
|
+
workspace: string;
|
2531
|
+
};
|
2532
|
+
declare type GetBranchMigrationPlanError = ErrorWrapper<{
|
2533
|
+
status: 400;
|
2534
|
+
payload: BadRequestError;
|
2535
|
+
} | {
|
2536
|
+
status: 401;
|
2537
|
+
payload: AuthError;
|
2538
|
+
} | {
|
2539
|
+
status: 404;
|
2540
|
+
payload: SimpleError;
|
2541
|
+
}>;
|
2542
|
+
declare type GetBranchMigrationPlanVariables = {
|
2543
|
+
body: Schema;
|
2544
|
+
pathParams: GetBranchMigrationPlanPathParams;
|
2545
|
+
} & FetcherExtraProps;
|
2546
|
+
/**
|
2547
|
+
* Compute a migration plan from a target schema the branch should be migrated too.
|
2548
|
+
*/
|
2549
|
+
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
|
2550
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
2551
|
+
/**
|
2552
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2553
|
+
*/
|
2554
|
+
dbBranchName: DBBranchName;
|
2555
|
+
workspace: string;
|
2556
|
+
};
|
2557
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
2558
|
+
status: 400;
|
2559
|
+
payload: BadRequestError;
|
2560
|
+
} | {
|
2561
|
+
status: 401;
|
2562
|
+
payload: AuthError;
|
2563
|
+
} | {
|
2564
|
+
status: 404;
|
2565
|
+
payload: SimpleError;
|
2566
|
+
}>;
|
2567
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
2568
|
+
schema: Schema;
|
2569
|
+
};
|
2570
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
2571
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
2572
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
2573
|
+
} & FetcherExtraProps;
|
2574
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
2575
|
+
declare type CompareBranchSchemasPathParams = {
|
2576
|
+
/**
|
2577
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2578
|
+
*/
|
1370
2579
|
dbBranchName: DBBranchName;
|
2580
|
+
/**
|
2581
|
+
* The Database Name
|
2582
|
+
*/
|
2583
|
+
branchName: BranchName;
|
1371
2584
|
workspace: string;
|
1372
2585
|
};
|
1373
|
-
declare type
|
2586
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
1374
2587
|
status: 400;
|
1375
2588
|
payload: BadRequestError;
|
1376
2589
|
} | {
|
@@ -1380,19 +2593,19 @@ declare type UpdateBranchMetadataError = ErrorWrapper<{
|
|
1380
2593
|
status: 404;
|
1381
2594
|
payload: SimpleError;
|
1382
2595
|
}>;
|
1383
|
-
declare type
|
1384
|
-
body?:
|
1385
|
-
pathParams:
|
2596
|
+
declare type CompareBranchSchemasVariables = {
|
2597
|
+
body?: Record<string, any>;
|
2598
|
+
pathParams: CompareBranchSchemasPathParams;
|
1386
2599
|
} & FetcherExtraProps;
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
2600
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
2601
|
+
declare type UpdateBranchSchemaPathParams = {
|
2602
|
+
/**
|
2603
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2604
|
+
*/
|
1392
2605
|
dbBranchName: DBBranchName;
|
1393
2606
|
workspace: string;
|
1394
2607
|
};
|
1395
|
-
declare type
|
2608
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
1396
2609
|
status: 400;
|
1397
2610
|
payload: BadRequestError;
|
1398
2611
|
} | {
|
@@ -1402,15 +2615,23 @@ declare type GetBranchMetadataError = ErrorWrapper<{
|
|
1402
2615
|
status: 404;
|
1403
2616
|
payload: SimpleError;
|
1404
2617
|
}>;
|
1405
|
-
declare type
|
1406
|
-
|
2618
|
+
declare type UpdateBranchSchemaResponse = {
|
2619
|
+
id: string;
|
2620
|
+
parentID: string;
|
2621
|
+
};
|
2622
|
+
declare type UpdateBranchSchemaVariables = {
|
2623
|
+
body: Migration;
|
2624
|
+
pathParams: UpdateBranchSchemaPathParams;
|
1407
2625
|
} & FetcherExtraProps;
|
1408
|
-
declare const
|
1409
|
-
declare type
|
2626
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
|
2627
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
2628
|
+
/**
|
2629
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2630
|
+
*/
|
1410
2631
|
dbBranchName: DBBranchName;
|
1411
2632
|
workspace: string;
|
1412
2633
|
};
|
1413
|
-
declare type
|
2634
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
1414
2635
|
status: 400;
|
1415
2636
|
payload: BadRequestError;
|
1416
2637
|
} | {
|
@@ -1420,24 +2641,27 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
1420
2641
|
status: 404;
|
1421
2642
|
payload: SimpleError;
|
1422
2643
|
}>;
|
1423
|
-
declare type
|
1424
|
-
|
1425
|
-
|
2644
|
+
declare type PreviewBranchSchemaEditResponse = {
|
2645
|
+
original: Schema;
|
2646
|
+
updated: Schema;
|
1426
2647
|
};
|
1427
|
-
declare type
|
1428
|
-
|
1429
|
-
|
2648
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
2649
|
+
edits?: SchemaEditScript;
|
2650
|
+
operations?: MigrationOp[];
|
1430
2651
|
};
|
1431
|
-
declare type
|
1432
|
-
body?:
|
1433
|
-
pathParams:
|
2652
|
+
declare type PreviewBranchSchemaEditVariables = {
|
2653
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
2654
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
1434
2655
|
} & FetcherExtraProps;
|
1435
|
-
declare const
|
1436
|
-
declare type
|
2656
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
|
2657
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
2658
|
+
/**
|
2659
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2660
|
+
*/
|
1437
2661
|
dbBranchName: DBBranchName;
|
1438
2662
|
workspace: string;
|
1439
2663
|
};
|
1440
|
-
declare type
|
2664
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
1441
2665
|
status: 400;
|
1442
2666
|
payload: BadRequestError;
|
1443
2667
|
} | {
|
@@ -1447,23 +2671,26 @@ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
|
1447
2671
|
status: 404;
|
1448
2672
|
payload: SimpleError;
|
1449
2673
|
}>;
|
1450
|
-
declare type
|
1451
|
-
|
1452
|
-
|
2674
|
+
declare type ApplyBranchSchemaEditResponse = {
|
2675
|
+
id: string;
|
2676
|
+
parentID: string;
|
1453
2677
|
};
|
1454
|
-
declare type
|
1455
|
-
|
1456
|
-
|
2678
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
2679
|
+
edits: SchemaEditScript;
|
2680
|
+
};
|
2681
|
+
declare type ApplyBranchSchemaEditVariables = {
|
2682
|
+
body: ApplyBranchSchemaEditRequestBody;
|
2683
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
1457
2684
|
} & FetcherExtraProps;
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
2685
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
|
2686
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
2687
|
+
/**
|
2688
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2689
|
+
*/
|
1463
2690
|
dbBranchName: DBBranchName;
|
1464
2691
|
workspace: string;
|
1465
2692
|
};
|
1466
|
-
declare type
|
2693
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
1467
2694
|
status: 400;
|
1468
2695
|
payload: BadRequestError;
|
1469
2696
|
} | {
|
@@ -1473,15 +2700,46 @@ declare type GetBranchMigrationPlanError = ErrorWrapper<{
|
|
1473
2700
|
status: 404;
|
1474
2701
|
payload: SimpleError;
|
1475
2702
|
}>;
|
1476
|
-
declare type
|
1477
|
-
|
1478
|
-
|
2703
|
+
declare type GetBranchSchemaHistoryResponse = {
|
2704
|
+
meta: {
|
2705
|
+
/**
|
2706
|
+
* last record id
|
2707
|
+
*/
|
2708
|
+
cursor: string;
|
2709
|
+
/**
|
2710
|
+
* true if more records can be fetch
|
2711
|
+
*/
|
2712
|
+
more: boolean;
|
2713
|
+
};
|
2714
|
+
logs: Commit[];
|
2715
|
+
};
|
2716
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
2717
|
+
page?: {
|
2718
|
+
/**
|
2719
|
+
* Query the next page that follow the cursor.
|
2720
|
+
*/
|
2721
|
+
after?: string;
|
2722
|
+
/**
|
2723
|
+
* Query the previous page before the cursor.
|
2724
|
+
*/
|
2725
|
+
before?: string;
|
2726
|
+
/**
|
2727
|
+
* 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.
|
2728
|
+
*
|
2729
|
+
* @default 20
|
2730
|
+
*/
|
2731
|
+
size?: number;
|
2732
|
+
};
|
2733
|
+
};
|
2734
|
+
declare type GetBranchSchemaHistoryVariables = {
|
2735
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
2736
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
1479
2737
|
} & FetcherExtraProps;
|
1480
|
-
|
1481
|
-
* Compute a migration plan from a target schema the branch should be migrated too.
|
1482
|
-
*/
|
1483
|
-
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2738
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
|
1484
2739
|
declare type GetBranchStatsPathParams = {
|
2740
|
+
/**
|
2741
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2742
|
+
*/
|
1485
2743
|
dbBranchName: DBBranchName;
|
1486
2744
|
workspace: string;
|
1487
2745
|
};
|
@@ -1512,9 +2770,15 @@ declare type GetBranchStatsVariables = {
|
|
1512
2770
|
/**
|
1513
2771
|
* Get branch usage metrics.
|
1514
2772
|
*/
|
1515
|
-
declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
2773
|
+
declare const getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
|
1516
2774
|
declare type CreateTablePathParams = {
|
2775
|
+
/**
|
2776
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2777
|
+
*/
|
1517
2778
|
dbBranchName: DBBranchName;
|
2779
|
+
/**
|
2780
|
+
* The Table name
|
2781
|
+
*/
|
1518
2782
|
tableName: TableName;
|
1519
2783
|
workspace: string;
|
1520
2784
|
};
|
@@ -1533,6 +2797,9 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1533
2797
|
}>;
|
1534
2798
|
declare type CreateTableResponse = {
|
1535
2799
|
branchName: string;
|
2800
|
+
/**
|
2801
|
+
* @minLength 1
|
2802
|
+
*/
|
1536
2803
|
tableName: string;
|
1537
2804
|
};
|
1538
2805
|
declare type CreateTableVariables = {
|
@@ -1541,9 +2808,15 @@ declare type CreateTableVariables = {
|
|
1541
2808
|
/**
|
1542
2809
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1543
2810
|
*/
|
1544
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2811
|
+
declare const createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
|
1545
2812
|
declare type DeleteTablePathParams = {
|
2813
|
+
/**
|
2814
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2815
|
+
*/
|
1546
2816
|
dbBranchName: DBBranchName;
|
2817
|
+
/**
|
2818
|
+
* The Table name
|
2819
|
+
*/
|
1547
2820
|
tableName: TableName;
|
1548
2821
|
workspace: string;
|
1549
2822
|
};
|
@@ -1560,9 +2833,15 @@ declare type DeleteTableVariables = {
|
|
1560
2833
|
/**
|
1561
2834
|
* Deletes the table with the given name.
|
1562
2835
|
*/
|
1563
|
-
declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2836
|
+
declare const deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
1564
2837
|
declare type UpdateTablePathParams = {
|
2838
|
+
/**
|
2839
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2840
|
+
*/
|
1565
2841
|
dbBranchName: DBBranchName;
|
2842
|
+
/**
|
2843
|
+
* The Table name
|
2844
|
+
*/
|
1566
2845
|
tableName: TableName;
|
1567
2846
|
workspace: string;
|
1568
2847
|
};
|
@@ -1577,6 +2856,9 @@ declare type UpdateTableError = ErrorWrapper<{
|
|
1577
2856
|
payload: SimpleError;
|
1578
2857
|
}>;
|
1579
2858
|
declare type UpdateTableRequestBody = {
|
2859
|
+
/**
|
2860
|
+
* @minLength 1
|
2861
|
+
*/
|
1580
2862
|
name: string;
|
1581
2863
|
};
|
1582
2864
|
declare type UpdateTableVariables = {
|
@@ -1596,9 +2878,15 @@ declare type UpdateTableVariables = {
|
|
1596
2878
|
* }
|
1597
2879
|
* ```
|
1598
2880
|
*/
|
1599
|
-
declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2881
|
+
declare const updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
1600
2882
|
declare type GetTableSchemaPathParams = {
|
2883
|
+
/**
|
2884
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2885
|
+
*/
|
1601
2886
|
dbBranchName: DBBranchName;
|
2887
|
+
/**
|
2888
|
+
* The Table name
|
2889
|
+
*/
|
1602
2890
|
tableName: TableName;
|
1603
2891
|
workspace: string;
|
1604
2892
|
};
|
@@ -1618,9 +2906,15 @@ declare type GetTableSchemaResponse = {
|
|
1618
2906
|
declare type GetTableSchemaVariables = {
|
1619
2907
|
pathParams: GetTableSchemaPathParams;
|
1620
2908
|
} & FetcherExtraProps;
|
1621
|
-
declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
2909
|
+
declare const getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
|
1622
2910
|
declare type SetTableSchemaPathParams = {
|
2911
|
+
/**
|
2912
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2913
|
+
*/
|
1623
2914
|
dbBranchName: DBBranchName;
|
2915
|
+
/**
|
2916
|
+
* The Table name
|
2917
|
+
*/
|
1624
2918
|
tableName: TableName;
|
1625
2919
|
workspace: string;
|
1626
2920
|
};
|
@@ -1644,9 +2938,15 @@ declare type SetTableSchemaVariables = {
|
|
1644
2938
|
body: SetTableSchemaRequestBody;
|
1645
2939
|
pathParams: SetTableSchemaPathParams;
|
1646
2940
|
} & FetcherExtraProps;
|
1647
|
-
declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
|
2941
|
+
declare const setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
|
1648
2942
|
declare type GetTableColumnsPathParams = {
|
2943
|
+
/**
|
2944
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2945
|
+
*/
|
1649
2946
|
dbBranchName: DBBranchName;
|
2947
|
+
/**
|
2948
|
+
* The Table name
|
2949
|
+
*/
|
1650
2950
|
tableName: TableName;
|
1651
2951
|
workspace: string;
|
1652
2952
|
};
|
@@ -1670,9 +2970,15 @@ declare type GetTableColumnsVariables = {
|
|
1670
2970
|
* Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
|
1671
2971
|
* full dot-separated path (flattened).
|
1672
2972
|
*/
|
1673
|
-
declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
|
2973
|
+
declare const getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
|
1674
2974
|
declare type AddTableColumnPathParams = {
|
2975
|
+
/**
|
2976
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2977
|
+
*/
|
1675
2978
|
dbBranchName: DBBranchName;
|
2979
|
+
/**
|
2980
|
+
* The Table name
|
2981
|
+
*/
|
1676
2982
|
tableName: TableName;
|
1677
2983
|
workspace: string;
|
1678
2984
|
};
|
@@ -1695,10 +3001,19 @@ declare type AddTableColumnVariables = {
|
|
1695
3001
|
* contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
|
1696
3002
|
* passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
|
1697
3003
|
*/
|
1698
|
-
declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
|
3004
|
+
declare const addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
1699
3005
|
declare type GetColumnPathParams = {
|
3006
|
+
/**
|
3007
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3008
|
+
*/
|
1700
3009
|
dbBranchName: DBBranchName;
|
3010
|
+
/**
|
3011
|
+
* The Table name
|
3012
|
+
*/
|
1701
3013
|
tableName: TableName;
|
3014
|
+
/**
|
3015
|
+
* The Column name
|
3016
|
+
*/
|
1702
3017
|
columnName: ColumnName;
|
1703
3018
|
workspace: string;
|
1704
3019
|
};
|
@@ -1718,10 +3033,19 @@ declare type GetColumnVariables = {
|
|
1718
3033
|
/**
|
1719
3034
|
* Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
|
1720
3035
|
*/
|
1721
|
-
declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
|
3036
|
+
declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
|
1722
3037
|
declare type DeleteColumnPathParams = {
|
3038
|
+
/**
|
3039
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3040
|
+
*/
|
1723
3041
|
dbBranchName: DBBranchName;
|
3042
|
+
/**
|
3043
|
+
* The Table name
|
3044
|
+
*/
|
1724
3045
|
tableName: TableName;
|
3046
|
+
/**
|
3047
|
+
* The Column name
|
3048
|
+
*/
|
1725
3049
|
columnName: ColumnName;
|
1726
3050
|
workspace: string;
|
1727
3051
|
};
|
@@ -1741,10 +3065,19 @@ declare type DeleteColumnVariables = {
|
|
1741
3065
|
/**
|
1742
3066
|
* Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
|
1743
3067
|
*/
|
1744
|
-
declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
|
3068
|
+
declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
1745
3069
|
declare type UpdateColumnPathParams = {
|
3070
|
+
/**
|
3071
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3072
|
+
*/
|
1746
3073
|
dbBranchName: DBBranchName;
|
3074
|
+
/**
|
3075
|
+
* The Table name
|
3076
|
+
*/
|
1747
3077
|
tableName: TableName;
|
3078
|
+
/**
|
3079
|
+
* The Column name
|
3080
|
+
*/
|
1748
3081
|
columnName: ColumnName;
|
1749
3082
|
workspace: string;
|
1750
3083
|
};
|
@@ -1759,6 +3092,9 @@ declare type UpdateColumnError = ErrorWrapper<{
|
|
1759
3092
|
payload: SimpleError;
|
1760
3093
|
}>;
|
1761
3094
|
declare type UpdateColumnRequestBody = {
|
3095
|
+
/**
|
3096
|
+
* @minLength 1
|
3097
|
+
*/
|
1762
3098
|
name: string;
|
1763
3099
|
};
|
1764
3100
|
declare type UpdateColumnVariables = {
|
@@ -1768,13 +3104,22 @@ declare type UpdateColumnVariables = {
|
|
1768
3104
|
/**
|
1769
3105
|
* 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
3106
|
*/
|
1771
|
-
declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
3107
|
+
declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
1772
3108
|
declare type InsertRecordPathParams = {
|
3109
|
+
/**
|
3110
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3111
|
+
*/
|
1773
3112
|
dbBranchName: DBBranchName;
|
3113
|
+
/**
|
3114
|
+
* The Table name
|
3115
|
+
*/
|
1774
3116
|
tableName: TableName;
|
1775
3117
|
workspace: string;
|
1776
3118
|
};
|
1777
3119
|
declare type InsertRecordQueryParams = {
|
3120
|
+
/**
|
3121
|
+
* Column filters
|
3122
|
+
*/
|
1778
3123
|
columns?: ColumnsProjection;
|
1779
3124
|
};
|
1780
3125
|
declare type InsertRecordError = ErrorWrapper<{
|
@@ -1795,14 +3140,26 @@ declare type InsertRecordVariables = {
|
|
1795
3140
|
/**
|
1796
3141
|
* Insert a new Record into the Table
|
1797
3142
|
*/
|
1798
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
3143
|
+
declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
1799
3144
|
declare type InsertRecordWithIDPathParams = {
|
3145
|
+
/**
|
3146
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3147
|
+
*/
|
1800
3148
|
dbBranchName: DBBranchName;
|
3149
|
+
/**
|
3150
|
+
* The Table name
|
3151
|
+
*/
|
1801
3152
|
tableName: TableName;
|
3153
|
+
/**
|
3154
|
+
* The Record name
|
3155
|
+
*/
|
1802
3156
|
recordId: RecordID;
|
1803
3157
|
workspace: string;
|
1804
3158
|
};
|
1805
3159
|
declare type InsertRecordWithIDQueryParams = {
|
3160
|
+
/**
|
3161
|
+
* Column filters
|
3162
|
+
*/
|
1806
3163
|
columns?: ColumnsProjection;
|
1807
3164
|
createOnly?: boolean;
|
1808
3165
|
ifVersion?: number;
|
@@ -1828,14 +3185,26 @@ declare type InsertRecordWithIDVariables = {
|
|
1828
3185
|
/**
|
1829
3186
|
* 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
3187
|
*/
|
1831
|
-
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
3188
|
+
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
1832
3189
|
declare type UpdateRecordWithIDPathParams = {
|
3190
|
+
/**
|
3191
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3192
|
+
*/
|
1833
3193
|
dbBranchName: DBBranchName;
|
3194
|
+
/**
|
3195
|
+
* The Table name
|
3196
|
+
*/
|
1834
3197
|
tableName: TableName;
|
3198
|
+
/**
|
3199
|
+
* The Record name
|
3200
|
+
*/
|
1835
3201
|
recordId: RecordID;
|
1836
3202
|
workspace: string;
|
1837
3203
|
};
|
1838
3204
|
declare type UpdateRecordWithIDQueryParams = {
|
3205
|
+
/**
|
3206
|
+
* Column filters
|
3207
|
+
*/
|
1839
3208
|
columns?: ColumnsProjection;
|
1840
3209
|
ifVersion?: number;
|
1841
3210
|
};
|
@@ -1857,14 +3226,26 @@ declare type UpdateRecordWithIDVariables = {
|
|
1857
3226
|
pathParams: UpdateRecordWithIDPathParams;
|
1858
3227
|
queryParams?: UpdateRecordWithIDQueryParams;
|
1859
3228
|
} & FetcherExtraProps;
|
1860
|
-
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
3229
|
+
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
1861
3230
|
declare type UpsertRecordWithIDPathParams = {
|
3231
|
+
/**
|
3232
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3233
|
+
*/
|
1862
3234
|
dbBranchName: DBBranchName;
|
3235
|
+
/**
|
3236
|
+
* The Table name
|
3237
|
+
*/
|
1863
3238
|
tableName: TableName;
|
3239
|
+
/**
|
3240
|
+
* The Record name
|
3241
|
+
*/
|
1864
3242
|
recordId: RecordID;
|
1865
3243
|
workspace: string;
|
1866
3244
|
};
|
1867
3245
|
declare type UpsertRecordWithIDQueryParams = {
|
3246
|
+
/**
|
3247
|
+
* Column filters
|
3248
|
+
*/
|
1868
3249
|
columns?: ColumnsProjection;
|
1869
3250
|
ifVersion?: number;
|
1870
3251
|
};
|
@@ -1886,14 +3267,26 @@ declare type UpsertRecordWithIDVariables = {
|
|
1886
3267
|
pathParams: UpsertRecordWithIDPathParams;
|
1887
3268
|
queryParams?: UpsertRecordWithIDQueryParams;
|
1888
3269
|
} & FetcherExtraProps;
|
1889
|
-
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
3270
|
+
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
1890
3271
|
declare type DeleteRecordPathParams = {
|
3272
|
+
/**
|
3273
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3274
|
+
*/
|
1891
3275
|
dbBranchName: DBBranchName;
|
3276
|
+
/**
|
3277
|
+
* The Table name
|
3278
|
+
*/
|
1892
3279
|
tableName: TableName;
|
3280
|
+
/**
|
3281
|
+
* The Record name
|
3282
|
+
*/
|
1893
3283
|
recordId: RecordID;
|
1894
3284
|
workspace: string;
|
1895
3285
|
};
|
1896
3286
|
declare type DeleteRecordQueryParams = {
|
3287
|
+
/**
|
3288
|
+
* Column filters
|
3289
|
+
*/
|
1897
3290
|
columns?: ColumnsProjection;
|
1898
3291
|
};
|
1899
3292
|
declare type DeleteRecordError = ErrorWrapper<{
|
@@ -1910,14 +3303,26 @@ declare type DeleteRecordVariables = {
|
|
1910
3303
|
pathParams: DeleteRecordPathParams;
|
1911
3304
|
queryParams?: DeleteRecordQueryParams;
|
1912
3305
|
} & FetcherExtraProps;
|
1913
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
3306
|
+
declare const deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
1914
3307
|
declare type GetRecordPathParams = {
|
3308
|
+
/**
|
3309
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3310
|
+
*/
|
1915
3311
|
dbBranchName: DBBranchName;
|
3312
|
+
/**
|
3313
|
+
* The Table name
|
3314
|
+
*/
|
1916
3315
|
tableName: TableName;
|
3316
|
+
/**
|
3317
|
+
* The Record name
|
3318
|
+
*/
|
1917
3319
|
recordId: RecordID;
|
1918
3320
|
workspace: string;
|
1919
3321
|
};
|
1920
3322
|
declare type GetRecordQueryParams = {
|
3323
|
+
/**
|
3324
|
+
* Column filters
|
3325
|
+
*/
|
1921
3326
|
columns?: ColumnsProjection;
|
1922
3327
|
};
|
1923
3328
|
declare type GetRecordError = ErrorWrapper<{
|
@@ -1937,13 +3342,22 @@ declare type GetRecordVariables = {
|
|
1937
3342
|
/**
|
1938
3343
|
* Retrieve record by ID
|
1939
3344
|
*/
|
1940
|
-
declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
3345
|
+
declare const getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
1941
3346
|
declare type BulkInsertTableRecordsPathParams = {
|
3347
|
+
/**
|
3348
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3349
|
+
*/
|
1942
3350
|
dbBranchName: DBBranchName;
|
3351
|
+
/**
|
3352
|
+
* The Table name
|
3353
|
+
*/
|
1943
3354
|
tableName: TableName;
|
1944
3355
|
workspace: string;
|
1945
3356
|
};
|
1946
3357
|
declare type BulkInsertTableRecordsQueryParams = {
|
3358
|
+
/**
|
3359
|
+
* Column filters
|
3360
|
+
*/
|
1947
3361
|
columns?: ColumnsProjection;
|
1948
3362
|
};
|
1949
3363
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
@@ -1970,9 +3384,15 @@ declare type BulkInsertTableRecordsVariables = {
|
|
1970
3384
|
/**
|
1971
3385
|
* Bulk insert records
|
1972
3386
|
*/
|
1973
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
3387
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
|
1974
3388
|
declare type QueryTablePathParams = {
|
3389
|
+
/**
|
3390
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3391
|
+
*/
|
1975
3392
|
dbBranchName: DBBranchName;
|
3393
|
+
/**
|
3394
|
+
* The Table name
|
3395
|
+
*/
|
1976
3396
|
tableName: TableName;
|
1977
3397
|
workspace: string;
|
1978
3398
|
};
|
@@ -2026,8 +3446,9 @@ declare type QueryTableVariables = {
|
|
2026
3446
|
* If the `columns` array is not specified, all columns are included. For link
|
2027
3447
|
* fields, only the ID column of the linked records is included in the response.
|
2028
3448
|
*
|
2029
|
-
* If the `columns` array is specified, only the selected
|
2030
|
-
* The `*` wildcard can be used to
|
3449
|
+
* If the `columns` array is specified, only the selected and internal
|
3450
|
+
* columns `id` and `xata` are included. The `*` wildcard can be used to
|
3451
|
+
* select all columns.
|
2031
3452
|
*
|
2032
3453
|
* For objects and link fields, if the column name of the object is specified, we
|
2033
3454
|
* include all of its sub-keys. If only some sub-keys are specified (via dotted
|
@@ -2143,6 +3564,10 @@ declare type QueryTableVariables = {
|
|
2143
3564
|
*
|
2144
3565
|
* ```json
|
2145
3566
|
* {
|
3567
|
+
* "id": "id1"
|
3568
|
+
* "xata": {
|
3569
|
+
* "version": 0
|
3570
|
+
* }
|
2146
3571
|
* "name": "Kilian",
|
2147
3572
|
* "address": {
|
2148
3573
|
* "street": "New street"
|
@@ -2162,6 +3587,10 @@ declare type QueryTableVariables = {
|
|
2162
3587
|
*
|
2163
3588
|
* ```json
|
2164
3589
|
* {
|
3590
|
+
* "id": "id1"
|
3591
|
+
* "xata": {
|
3592
|
+
* "version": 0
|
3593
|
+
* }
|
2165
3594
|
* "name": "Kilian",
|
2166
3595
|
* "email": "kilian@gmail.com",
|
2167
3596
|
* "address": {
|
@@ -2191,6 +3620,10 @@ declare type QueryTableVariables = {
|
|
2191
3620
|
*
|
2192
3621
|
* ```json
|
2193
3622
|
* {
|
3623
|
+
* "id": "id1"
|
3624
|
+
* "xata": {
|
3625
|
+
* "version": 0
|
3626
|
+
* }
|
2194
3627
|
* "name": "Kilian",
|
2195
3628
|
* "email": "kilian@gmail.com",
|
2196
3629
|
* "address": {
|
@@ -2617,8 +4050,8 @@ declare type QueryTableVariables = {
|
|
2617
4050
|
*
|
2618
4051
|
* ### Pagination
|
2619
4052
|
*
|
2620
|
-
* We offer cursor pagination and offset pagination.
|
2621
|
-
*
|
4053
|
+
* We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
|
4054
|
+
* cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
|
2622
4055
|
*
|
2623
4056
|
* Example of size + offset pagination:
|
2624
4057
|
*
|
@@ -2717,9 +4150,15 @@ declare type QueryTableVariables = {
|
|
2717
4150
|
* }
|
2718
4151
|
* ```
|
2719
4152
|
*/
|
2720
|
-
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
4153
|
+
declare const queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
|
2721
4154
|
declare type SearchTablePathParams = {
|
4155
|
+
/**
|
4156
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4157
|
+
*/
|
2722
4158
|
dbBranchName: DBBranchName;
|
4159
|
+
/**
|
4160
|
+
* The Table name
|
4161
|
+
*/
|
2723
4162
|
tableName: TableName;
|
2724
4163
|
workspace: string;
|
2725
4164
|
};
|
@@ -2734,8 +4173,14 @@ declare type SearchTableError = ErrorWrapper<{
|
|
2734
4173
|
payload: SimpleError;
|
2735
4174
|
}>;
|
2736
4175
|
declare type SearchTableRequestBody = {
|
4176
|
+
/**
|
4177
|
+
* The query string.
|
4178
|
+
*
|
4179
|
+
* @minLength 1
|
4180
|
+
*/
|
2737
4181
|
query: string;
|
2738
4182
|
fuzziness?: FuzzinessExpression;
|
4183
|
+
target?: TargetExpression;
|
2739
4184
|
prefix?: PrefixExpression;
|
2740
4185
|
filter?: FilterExpression;
|
2741
4186
|
highlight?: HighlightExpression;
|
@@ -2752,8 +4197,11 @@ declare type SearchTableVariables = {
|
|
2752
4197
|
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
2753
4198
|
* * filtering on columns of type `multiple` is currently unsupported
|
2754
4199
|
*/
|
2755
|
-
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
4200
|
+
declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
2756
4201
|
declare type SearchBranchPathParams = {
|
4202
|
+
/**
|
4203
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4204
|
+
*/
|
2757
4205
|
dbBranchName: DBBranchName;
|
2758
4206
|
workspace: string;
|
2759
4207
|
};
|
@@ -2768,13 +4216,26 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
2768
4216
|
payload: SimpleError;
|
2769
4217
|
}>;
|
2770
4218
|
declare type SearchBranchRequestBody = {
|
4219
|
+
/**
|
4220
|
+
* 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.
|
4221
|
+
*/
|
2771
4222
|
tables?: (string | {
|
4223
|
+
/**
|
4224
|
+
* The name of the table.
|
4225
|
+
*/
|
2772
4226
|
table: string;
|
2773
4227
|
filter?: FilterExpression;
|
4228
|
+
target?: TargetExpression;
|
2774
4229
|
boosters?: BoosterExpression[];
|
2775
4230
|
})[];
|
4231
|
+
/**
|
4232
|
+
* The query string.
|
4233
|
+
*
|
4234
|
+
* @minLength 1
|
4235
|
+
*/
|
2776
4236
|
query: string;
|
2777
4237
|
fuzziness?: FuzzinessExpression;
|
4238
|
+
prefix?: PrefixExpression;
|
2778
4239
|
highlight?: HighlightExpression;
|
2779
4240
|
};
|
2780
4241
|
declare type SearchBranchVariables = {
|
@@ -2784,75 +4245,228 @@ declare type SearchBranchVariables = {
|
|
2784
4245
|
/**
|
2785
4246
|
* Run a free text search operation across the database branch.
|
2786
4247
|
*/
|
2787
|
-
declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
4248
|
+
declare const searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
4249
|
+
declare type SummarizeTablePathParams = {
|
4250
|
+
/**
|
4251
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4252
|
+
*/
|
4253
|
+
dbBranchName: DBBranchName;
|
4254
|
+
/**
|
4255
|
+
* The Table name
|
4256
|
+
*/
|
4257
|
+
tableName: TableName;
|
4258
|
+
workspace: string;
|
4259
|
+
};
|
4260
|
+
declare type SummarizeTableError = ErrorWrapper<{
|
4261
|
+
status: 400;
|
4262
|
+
payload: BadRequestError;
|
4263
|
+
} | {
|
4264
|
+
status: 401;
|
4265
|
+
payload: AuthError;
|
4266
|
+
} | {
|
4267
|
+
status: 404;
|
4268
|
+
payload: SimpleError;
|
4269
|
+
}>;
|
4270
|
+
declare type SummarizeTableRequestBody = {
|
4271
|
+
filters?: FilterExpression;
|
4272
|
+
columns?: ColumnsProjection;
|
4273
|
+
summaries?: SummaryExpressionList;
|
4274
|
+
sort?: SortExpression;
|
4275
|
+
summariesFilter?: FilterExpression;
|
4276
|
+
};
|
4277
|
+
declare type SummarizeTableVariables = {
|
4278
|
+
body?: SummarizeTableRequestBody;
|
4279
|
+
pathParams: SummarizeTablePathParams;
|
4280
|
+
} & FetcherExtraProps;
|
4281
|
+
/**
|
4282
|
+
* This endpoint allows you to (optionally) define groups, and then to run
|
4283
|
+
* calculations on the values in each group. This is most helpful when
|
4284
|
+
* you'd like to understand the data you have in your database.
|
4285
|
+
*
|
4286
|
+
* A group is a combination of unique values. If you create a group for
|
4287
|
+
* `sold_by`, `product_name`, we will return one row for every combination
|
4288
|
+
* of `sold_by` and `product_name` you have in your database. When you
|
4289
|
+
* want to calculate statistics, you define these groups and ask Xata to
|
4290
|
+
* calculate data on each group.
|
4291
|
+
*
|
4292
|
+
* **Some questions you can ask of your data:**
|
4293
|
+
*
|
4294
|
+
* How many records do I have in this table?
|
4295
|
+
* - Set `columns: []` as we we want data from the entire table, so we ask
|
4296
|
+
* for no groups.
|
4297
|
+
* - Set `summaries: {"total": {"count": "*"}}` in order to see the count
|
4298
|
+
* of all records. We use `count: *` here we'd like to know the total
|
4299
|
+
* amount of rows; ignoring whether they are `null` or not.
|
4300
|
+
*
|
4301
|
+
* What are the top total sales for each product in July 2022 and sold
|
4302
|
+
* more than 10 units?
|
4303
|
+
* - Set `filter: {soldAt: {
|
4304
|
+
* "$ge": "2022-07-01T00:00:00.000Z",
|
4305
|
+
* "$lt": "2022-08-01T00:00:00.000Z"}
|
4306
|
+
* }`
|
4307
|
+
* in order to limit the result set to sales recorded in July 2022.
|
4308
|
+
* - Set `columns: [product_name]` as we'd like to run calculations on
|
4309
|
+
* each unique product name in our table. Setting `columns` like this will
|
4310
|
+
* produce one row per unique product name.
|
4311
|
+
* - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd
|
4312
|
+
* like to create a field called "total_sales" for each group. This field
|
4313
|
+
* will count all rows in each group with non-null product names.
|
4314
|
+
* - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with
|
4315
|
+
* the highest total_sales field to the top.
|
4316
|
+
* - Set `having: {"total_sales": {"$ge": 10}}` to only send back data
|
4317
|
+
* with greater than or equal to 10 units.
|
4318
|
+
*
|
4319
|
+
* `columns`: tells Xata how to create each group. If you add `product_id`
|
4320
|
+
* we will create a new group for every unique `product_id`.
|
4321
|
+
*
|
4322
|
+
* `summaries`: tells Xata which calculations to run on each group.
|
4323
|
+
*
|
4324
|
+
* `sort`: tells Xata in which order you'd like to see results. You may
|
4325
|
+
* sort by fields specified in `columns` as well as the summary names
|
4326
|
+
* defined in `summaries`.
|
4327
|
+
*
|
4328
|
+
* note: Sorting on summarized values can be slower on very large tables;
|
4329
|
+
* this will impact your rate limit significantly more than other queries.
|
4330
|
+
* Try use `filter` [coming soon] to reduce the amount of data being
|
4331
|
+
* processed in order to reduce impact on your limits.
|
4332
|
+
*
|
4333
|
+
* `summariesFilter`: tells Xata how to filter the results of a summary.
|
4334
|
+
* It has the same syntax as `filter`, however, by using `summariesFilter`
|
4335
|
+
* you may also filter on the results of a query.
|
4336
|
+
*
|
4337
|
+
* note: This is a much slower to use than `filter`. We recommend using
|
4338
|
+
* `filter` wherever possible and `summariesFilter` when it's not
|
4339
|
+
* possible to use `filter`.
|
4340
|
+
*/
|
4341
|
+
declare const summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
|
4342
|
+
declare type AggregateTablePathParams = {
|
4343
|
+
/**
|
4344
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4345
|
+
*/
|
4346
|
+
dbBranchName: DBBranchName;
|
4347
|
+
/**
|
4348
|
+
* The Table name
|
4349
|
+
*/
|
4350
|
+
tableName: TableName;
|
4351
|
+
workspace: string;
|
4352
|
+
};
|
4353
|
+
declare type AggregateTableError = ErrorWrapper<{
|
4354
|
+
status: 400;
|
4355
|
+
payload: BadRequestError;
|
4356
|
+
} | {
|
4357
|
+
status: 401;
|
4358
|
+
payload: AuthError;
|
4359
|
+
} | {
|
4360
|
+
status: 404;
|
4361
|
+
payload: SimpleError;
|
4362
|
+
}>;
|
4363
|
+
declare type AggregateTableRequestBody = {
|
4364
|
+
filter?: FilterExpression;
|
4365
|
+
aggs?: AggExpressionMap;
|
4366
|
+
};
|
4367
|
+
declare type AggregateTableVariables = {
|
4368
|
+
body?: AggregateTableRequestBody;
|
4369
|
+
pathParams: AggregateTablePathParams;
|
4370
|
+
} & FetcherExtraProps;
|
4371
|
+
/**
|
4372
|
+
* This endpoint allows you to run aggragations (analytics) on the data from one table.
|
4373
|
+
* While the summary endpoint is served from PostgreSQL and the results are strongly
|
4374
|
+
* consistent, the aggregate endpoint is served from Elasticsearch and the results are
|
4375
|
+
* only eventaully consistent. On the other hand, the aggregate endpoint uses a columnar
|
4376
|
+
* store that is more appropiate for analytics, makes use of approximative algorithms
|
4377
|
+
* (e.g for cardinality), and is generally faster and can do more complex aggregations.
|
4378
|
+
*/
|
4379
|
+
declare const aggregateTable: (variables: AggregateTableVariables) => Promise<AggResponse>;
|
2788
4380
|
declare const operationsByTag: {
|
2789
4381
|
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>;
|
4382
|
+
getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
4383
|
+
updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
4384
|
+
deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
|
4385
|
+
getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
|
4386
|
+
createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
|
4387
|
+
deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
|
2796
4388
|
};
|
2797
4389
|
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>;
|
4390
|
+
createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
4391
|
+
getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
|
4392
|
+
getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
4393
|
+
updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
4394
|
+
deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
|
4395
|
+
getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
|
4396
|
+
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
|
4397
|
+
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
|
4398
|
+
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
4399
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
4400
|
+
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
4401
|
+
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
4402
|
+
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
2811
4403
|
};
|
2812
4404
|
database: {
|
2813
|
-
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2814
|
-
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2815
|
-
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
4405
|
+
getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
|
4406
|
+
createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
|
4407
|
+
deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
|
4408
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
4409
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
4410
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
|
4411
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
|
4412
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
|
4413
|
+
resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
|
2820
4414
|
};
|
2821
4415
|
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
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
4416
|
+
getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
|
4417
|
+
getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
|
4418
|
+
createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
|
4419
|
+
deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
|
4420
|
+
updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
|
4421
|
+
getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
|
4422
|
+
getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
|
4423
|
+
};
|
4424
|
+
migrationRequests: {
|
4425
|
+
queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
|
4426
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
|
4427
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
|
4428
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
|
4429
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
|
4430
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
4431
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
|
4432
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
|
4433
|
+
};
|
4434
|
+
branchSchema: {
|
4435
|
+
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
|
4436
|
+
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
|
4437
|
+
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
|
4438
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
4439
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
4440
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
|
4441
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
|
4442
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
|
4443
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
|
2832
4444
|
};
|
2833
4445
|
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>;
|
4446
|
+
createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
|
4447
|
+
deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
4448
|
+
updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
4449
|
+
getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
|
4450
|
+
setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
|
4451
|
+
getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
|
4452
|
+
addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
4453
|
+
getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
|
4454
|
+
deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
4455
|
+
updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
2844
4456
|
};
|
2845
4457
|
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>;
|
4458
|
+
insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
4459
|
+
insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
4460
|
+
updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
4461
|
+
upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
4462
|
+
deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
4463
|
+
getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
4464
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
|
4465
|
+
queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
|
4466
|
+
searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
4467
|
+
searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
4468
|
+
summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
|
4469
|
+
aggregateTable: (variables: AggregateTableVariables) => Promise<AggResponse>;
|
2856
4470
|
};
|
2857
4471
|
};
|
2858
4472
|
|
@@ -2862,15 +4476,17 @@ declare type ProviderBuilder = {
|
|
2862
4476
|
workspaces: string;
|
2863
4477
|
};
|
2864
4478
|
declare type HostProvider = HostAliases | ProviderBuilder;
|
4479
|
+
declare function getHostUrl(provider: HostProvider, type: keyof ProviderBuilder): string;
|
4480
|
+
declare function isHostProviderAlias(alias: HostProvider | string): alias is HostAliases;
|
4481
|
+
declare function isHostProviderBuilder(builder: HostProvider): builder is ProviderBuilder;
|
4482
|
+
declare function parseProviderString(provider?: string): HostProvider | null;
|
2865
4483
|
|
2866
4484
|
interface XataApiClientOptions {
|
2867
4485
|
fetch?: FetchImpl;
|
2868
4486
|
apiKey?: string;
|
2869
4487
|
host?: HostProvider;
|
4488
|
+
trace?: TraceFunction;
|
2870
4489
|
}
|
2871
|
-
/**
|
2872
|
-
* @deprecated Use XataApiPlugin instead
|
2873
|
-
*/
|
2874
4490
|
declare class XataApiClient {
|
2875
4491
|
#private;
|
2876
4492
|
constructor(options?: XataApiClientOptions);
|
@@ -2880,6 +4496,8 @@ declare class XataApiClient {
|
|
2880
4496
|
get branches(): BranchApi;
|
2881
4497
|
get tables(): TableApi;
|
2882
4498
|
get records(): RecordsApi;
|
4499
|
+
get migrationRequests(): MigrationRequestsApi;
|
4500
|
+
get branchSchema(): BranchSchemaApi;
|
2883
4501
|
}
|
2884
4502
|
declare class UserApi {
|
2885
4503
|
private extraProps;
|
@@ -2914,6 +4532,8 @@ declare class DatabaseApi {
|
|
2914
4532
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2915
4533
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2916
4534
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
4535
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
4536
|
+
updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
2917
4537
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2918
4538
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2919
4539
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
@@ -2928,9 +4548,6 @@ declare class BranchApi {
|
|
2928
4548
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2929
4549
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2930
4550
|
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
4551
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2935
4552
|
}
|
2936
4553
|
declare class TableApi {
|
@@ -2960,6 +4577,33 @@ declare class RecordsApi {
|
|
2960
4577
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2961
4578
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2962
4579
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
4580
|
+
summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
|
4581
|
+
aggregateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: AggregateTableRequestBody): Promise<AggResponse>;
|
4582
|
+
}
|
4583
|
+
declare class MigrationRequestsApi {
|
4584
|
+
private extraProps;
|
4585
|
+
constructor(extraProps: FetcherExtraProps);
|
4586
|
+
queryMigrationRequests(workspace: WorkspaceID, database: DBName, options?: QueryMigrationRequestsRequestBody): Promise<QueryMigrationRequestsResponse>;
|
4587
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
4588
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
4589
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
4590
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
4591
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
4592
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
4593
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
4594
|
+
}
|
4595
|
+
declare class BranchSchemaApi {
|
4596
|
+
private extraProps;
|
4597
|
+
constructor(extraProps: FetcherExtraProps);
|
4598
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
4599
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
4600
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
4601
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
4602
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
4603
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
4604
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
4605
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
4606
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
2963
4607
|
}
|
2964
4608
|
|
2965
4609
|
declare class XataApiPlugin implements XataPlugin {
|
@@ -2977,13 +4621,28 @@ declare type RequiredBy<T, K extends keyof T> = T & {
|
|
2977
4621
|
};
|
2978
4622
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2979
4623
|
declare type SingleOrArray<T> = T | T[];
|
4624
|
+
declare type Dictionary<T> = Record<string, T>;
|
2980
4625
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
2981
4626
|
declare type Without<T, U> = {
|
2982
4627
|
[P in Exclude<keyof T, keyof U>]?: never;
|
2983
4628
|
};
|
2984
4629
|
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
4630
|
+
declare type Explode<T> = keyof T extends infer K ? K extends unknown ? {
|
4631
|
+
[I in keyof T]: I extends K ? T[I] : never;
|
4632
|
+
} : never : never;
|
4633
|
+
declare type AtMostOne<T> = Explode<Partial<T>>;
|
4634
|
+
declare type AtLeastOne<T, U = {
|
4635
|
+
[K in keyof T]: Pick<T, K>;
|
4636
|
+
}> = Partial<T> & U[keyof U];
|
4637
|
+
declare type ExactlyOne<T> = AtMostOne<T> & AtLeastOne<T>;
|
2985
4638
|
|
2986
4639
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
4640
|
+
declare type WildcardColumns<O> = Values<{
|
4641
|
+
[K in SelectableColumn<O>]: K extends `${string}*` ? K : never;
|
4642
|
+
}>;
|
4643
|
+
declare type ColumnsByValue<O extends XataRecord, Value> = Values<{
|
4644
|
+
[K in SelectableColumn<O>]: ValueAtColumn<O, K> extends infer C ? C extends Value ? K extends WildcardColumns<O> ? never : K : never : never;
|
4645
|
+
}>;
|
2987
4646
|
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
2988
4647
|
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2989
4648
|
}>>;
|
@@ -3029,12 +4688,12 @@ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> e
|
|
3029
4688
|
/**
|
3030
4689
|
* Retrieves a refreshed copy of the current record from the database.
|
3031
4690
|
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3032
|
-
* @returns The persisted record with the selected columns.
|
4691
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3033
4692
|
*/
|
3034
4693
|
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3035
4694
|
/**
|
3036
4695
|
* Retrieves a refreshed copy of the current record from the database.
|
3037
|
-
* @returns The persisted record with all first level properties.
|
4696
|
+
* @returns The persisted record with all first level properties, null if not found.
|
3038
4697
|
*/
|
3039
4698
|
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
3040
4699
|
/**
|
@@ -3042,42 +4701,30 @@ interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> e
|
|
3042
4701
|
* returned and the current object is not mutated.
|
3043
4702
|
* @param partialUpdate The columns and their values that have to be updated.
|
3044
4703
|
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3045
|
-
* @returns The persisted record with the selected columns.
|
4704
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3046
4705
|
*/
|
3047
|
-
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<
|
4706
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3048
4707
|
/**
|
3049
4708
|
* Performs a partial update of the current record. On success a new object is
|
3050
4709
|
* returned and the current object is not mutated.
|
3051
4710
|
* @param partialUpdate The columns and their values that have to be updated.
|
3052
|
-
* @returns The persisted record with all first level properties.
|
4711
|
+
* @returns The persisted record with all first level properties, null if not found.
|
3053
4712
|
*/
|
3054
|
-
update(partialUpdate: Partial<EditableData<
|
4713
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
3055
4714
|
/**
|
3056
4715
|
* Performs a deletion of the current record in the database.
|
3057
|
-
*
|
3058
|
-
* @
|
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.
|
4716
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4717
|
+
* @returns The deleted record, null if not found.
|
3072
4718
|
*/
|
3073
|
-
|
4719
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3074
4720
|
/**
|
3075
4721
|
* Performs a deletion of the current record in the database.
|
3076
|
-
*
|
3077
|
-
|
4722
|
+
* @returns The deleted record, null if not found.
|
4723
|
+
|
3078
4724
|
*/
|
3079
|
-
delete(): Promise<
|
3080
|
-
}
|
4725
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
4726
|
+
}
|
4727
|
+
declare type Link<Record extends XataRecord> = XataRecord<Record>;
|
3081
4728
|
declare type XataRecordMetadata = {
|
3082
4729
|
/**
|
3083
4730
|
* Number that is increased every time the record is updated.
|
@@ -3087,13 +4734,13 @@ declare type XataRecordMetadata = {
|
|
3087
4734
|
};
|
3088
4735
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
3089
4736
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
3090
|
-
declare type EditableData<O extends
|
4737
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
3091
4738
|
[K in keyof O]: O[K] extends XataRecord ? {
|
3092
4739
|
id: string;
|
3093
4740
|
} | string : NonNullable<O[K]> extends XataRecord ? {
|
3094
4741
|
id: string;
|
3095
4742
|
} | string | null | undefined : O[K];
|
3096
|
-
}
|
4743
|
+
}, keyof XataRecord>;
|
3097
4744
|
|
3098
4745
|
/**
|
3099
4746
|
* PropertyMatchFilter
|
@@ -3187,7 +4834,7 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
3187
4834
|
declare type NestedApiFilter<T> = {
|
3188
4835
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3189
4836
|
};
|
3190
|
-
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
4837
|
+
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
4838
|
|
3192
4839
|
declare type DateBooster = {
|
3193
4840
|
origin?: string;
|
@@ -3221,6 +4868,21 @@ declare type Boosters<O extends XataRecord> = Values<{
|
|
3221
4868
|
} : never;
|
3222
4869
|
}>;
|
3223
4870
|
|
4871
|
+
declare type TargetColumn<T extends XataRecord> = SelectableColumn<T> | {
|
4872
|
+
/**
|
4873
|
+
* The name of the column.
|
4874
|
+
*/
|
4875
|
+
column: SelectableColumn<T>;
|
4876
|
+
/**
|
4877
|
+
* The weight of the column.
|
4878
|
+
*
|
4879
|
+
* @default 1
|
4880
|
+
* @maximum 10
|
4881
|
+
* @minimum 1
|
4882
|
+
*/
|
4883
|
+
weight?: number;
|
4884
|
+
};
|
4885
|
+
|
3224
4886
|
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3225
4887
|
fuzziness?: FuzzinessExpression;
|
3226
4888
|
prefix?: PrefixExpression;
|
@@ -3228,6 +4890,7 @@ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables exte
|
|
3228
4890
|
tables?: Array<Tables | Values<{
|
3229
4891
|
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3230
4892
|
table: Model;
|
4893
|
+
target?: TargetColumn<Schemas[Model] & XataRecord>[];
|
3231
4894
|
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
3232
4895
|
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
3233
4896
|
};
|
@@ -3244,7 +4907,7 @@ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3244
4907
|
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
3245
4908
|
}>;
|
3246
4909
|
};
|
3247
|
-
declare class SearchPlugin<Schemas extends Record<string,
|
4910
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3248
4911
|
#private;
|
3249
4912
|
private db;
|
3250
4913
|
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
@@ -3267,6 +4930,191 @@ declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables exte
|
|
3267
4930
|
table: infer Table;
|
3268
4931
|
} ? ReturnTable<Table, Tables> : never;
|
3269
4932
|
|
4933
|
+
/**
|
4934
|
+
* The description of a single aggregation operation. The key represents the
|
4935
|
+
*/
|
4936
|
+
declare type AggregationExpression<O extends XataRecord> = ExactlyOne<{
|
4937
|
+
count: CountAggregation<O>;
|
4938
|
+
sum: SumAggregation<O>;
|
4939
|
+
max: MaxAggregation<O>;
|
4940
|
+
min: MinAggregation<O>;
|
4941
|
+
average: AverageAggregation<O>;
|
4942
|
+
uniqueCount: UniqueCountAggregation<O>;
|
4943
|
+
dateHistogram: DateHistogramAggregation<O>;
|
4944
|
+
topValues: TopValuesAggregation<O>;
|
4945
|
+
numericHistogram: NumericHistogramAggregation<O>;
|
4946
|
+
}>;
|
4947
|
+
declare type AggregationResult<Record extends XataRecord, Expression extends Dictionary<AggregationExpression<Record>>> = {
|
4948
|
+
aggs: {
|
4949
|
+
[K in keyof Expression]: AggregationResultItem<Record, Expression[K]>;
|
4950
|
+
};
|
4951
|
+
};
|
4952
|
+
declare type AggregationExpressionType<T extends AggregationExpression<any>> = keyof T;
|
4953
|
+
declare type AggregationResultItem<Record extends XataRecord, Expression extends AggregationExpression<Record>> = AggregationExpressionType<Expression> extends infer Type ? Type extends keyof AggregationExpressionResultTypes ? AggregationExpressionResultTypes[Type] : never : never;
|
4954
|
+
/**
|
4955
|
+
* Count the number of records with an optional filter.
|
4956
|
+
*/
|
4957
|
+
declare type CountAggregation<O extends XataRecord> = {
|
4958
|
+
filter?: Filter<O>;
|
4959
|
+
} | '*';
|
4960
|
+
/**
|
4961
|
+
* The sum of the numeric values in a particular column.
|
4962
|
+
*/
|
4963
|
+
declare type SumAggregation<O extends XataRecord> = {
|
4964
|
+
/**
|
4965
|
+
* The column on which to compute the sum. Must be a numeric type.
|
4966
|
+
*/
|
4967
|
+
column: ColumnsByValue<O, number>;
|
4968
|
+
};
|
4969
|
+
/**
|
4970
|
+
* The max of the numeric values in a particular column.
|
4971
|
+
*/
|
4972
|
+
declare type MaxAggregation<O extends XataRecord> = {
|
4973
|
+
/**
|
4974
|
+
* The column on which to compute the max. Must be a numeric type.
|
4975
|
+
*/
|
4976
|
+
column: ColumnsByValue<O, number>;
|
4977
|
+
};
|
4978
|
+
/**
|
4979
|
+
* The min of the numeric values in a particular column.
|
4980
|
+
*/
|
4981
|
+
declare type MinAggregation<O extends XataRecord> = {
|
4982
|
+
/**
|
4983
|
+
* The column on which to compute the min. Must be a numeric type.
|
4984
|
+
*/
|
4985
|
+
column: ColumnsByValue<O, number>;
|
4986
|
+
};
|
4987
|
+
/**
|
4988
|
+
* The average of the numeric values in a particular column.
|
4989
|
+
*/
|
4990
|
+
declare type AverageAggregation<O extends XataRecord> = {
|
4991
|
+
/**
|
4992
|
+
* The column on which to compute the average. Must be a numeric type.
|
4993
|
+
*/
|
4994
|
+
column: ColumnsByValue<O, number>;
|
4995
|
+
};
|
4996
|
+
/**
|
4997
|
+
* Count the number of distinct values in a particular column.
|
4998
|
+
*/
|
4999
|
+
declare type UniqueCountAggregation<O extends XataRecord> = {
|
5000
|
+
/**
|
5001
|
+
* The column from where to count the unique values.
|
5002
|
+
*/
|
5003
|
+
column: ColumnsByValue<O, any>;
|
5004
|
+
/**
|
5005
|
+
* The threshold under which the unique count is exact. If the number of unique
|
5006
|
+
* values in the column is higher than this threshold, the results are approximative.
|
5007
|
+
* Maximum value is 40,000, default value is 3000.
|
5008
|
+
*/
|
5009
|
+
precisionThreshold?: number;
|
5010
|
+
};
|
5011
|
+
/**
|
5012
|
+
* Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
|
5013
|
+
*/
|
5014
|
+
declare type DateHistogramAggregation<O extends XataRecord> = {
|
5015
|
+
/**
|
5016
|
+
* The column to use for bucketing. Must be of type datetime.
|
5017
|
+
*/
|
5018
|
+
column: ColumnsByValue<O, Date>;
|
5019
|
+
/**
|
5020
|
+
* The fixed interval to use when bucketing.
|
5021
|
+
* It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
|
5022
|
+
*
|
5023
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
5024
|
+
*/
|
5025
|
+
interval?: string;
|
5026
|
+
/**
|
5027
|
+
* The calendar-aware interval to use when bucketing. Possible values are: `minute`,
|
5028
|
+
* `hour`, `day`, `week`, `month`, `quarter`, `year`.
|
5029
|
+
*/
|
5030
|
+
calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
5031
|
+
/**
|
5032
|
+
* The timezone to use for bucketing. By default, UTC is assumed.
|
5033
|
+
* The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
|
5034
|
+
* `-08:00`.
|
5035
|
+
*
|
5036
|
+
* @pattern ^[+-][01]\d:[0-5]\d$
|
5037
|
+
*/
|
5038
|
+
timezone?: string;
|
5039
|
+
aggs?: Dictionary<AggregationExpression<O>>;
|
5040
|
+
};
|
5041
|
+
/**
|
5042
|
+
* Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
|
5043
|
+
* The top values as ordered by the number of records (`$count``) are returned.
|
5044
|
+
*/
|
5045
|
+
declare type TopValuesAggregation<O extends XataRecord> = {
|
5046
|
+
/**
|
5047
|
+
* The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
|
5048
|
+
*/
|
5049
|
+
column: ColumnsByValue<O, string | number | boolean>;
|
5050
|
+
aggs?: Dictionary<AggregationExpression<O>>;
|
5051
|
+
/**
|
5052
|
+
* The maximum number of unique values to return.
|
5053
|
+
*
|
5054
|
+
* @default 10
|
5055
|
+
* @maximum 1000
|
5056
|
+
*/
|
5057
|
+
size?: number;
|
5058
|
+
};
|
5059
|
+
/**
|
5060
|
+
* Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
|
5061
|
+
*/
|
5062
|
+
declare type NumericHistogramAggregation<O extends XataRecord> = {
|
5063
|
+
/**
|
5064
|
+
* The column to use for bucketing. Must be of numeric type.
|
5065
|
+
*/
|
5066
|
+
column: ColumnsByValue<O, number>;
|
5067
|
+
/**
|
5068
|
+
* The numeric interval to use for bucketing. The resulting buckets will be ranges
|
5069
|
+
* with this value as size.
|
5070
|
+
*
|
5071
|
+
* @minimum 0
|
5072
|
+
*/
|
5073
|
+
interval: number;
|
5074
|
+
/**
|
5075
|
+
* By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
|
5076
|
+
* boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
|
5077
|
+
* but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
|
5078
|
+
* to 50.
|
5079
|
+
*
|
5080
|
+
* @default 0
|
5081
|
+
*/
|
5082
|
+
offset?: number;
|
5083
|
+
aggs?: Dictionary<AggregationExpression<O>>;
|
5084
|
+
};
|
5085
|
+
declare type AggregationExpressionResultTypes = {
|
5086
|
+
count: number;
|
5087
|
+
sum: number;
|
5088
|
+
max: number;
|
5089
|
+
min: number;
|
5090
|
+
average: number;
|
5091
|
+
uniqueCount: number;
|
5092
|
+
dateHistogram: DateHistogramAggregationResult;
|
5093
|
+
topValues: TopValuesAggregationResult;
|
5094
|
+
numericHistogram: NumericHistogramAggregationResult;
|
5095
|
+
};
|
5096
|
+
declare type DateHistogramAggregationResult = {
|
5097
|
+
values?: {
|
5098
|
+
$key?: string | number;
|
5099
|
+
$count?: number;
|
5100
|
+
[key: string]: any;
|
5101
|
+
}[];
|
5102
|
+
};
|
5103
|
+
declare type TopValuesAggregationResult = {
|
5104
|
+
values?: {
|
5105
|
+
$key?: string | number;
|
5106
|
+
$count?: number;
|
5107
|
+
[key: string]: any;
|
5108
|
+
}[];
|
5109
|
+
};
|
5110
|
+
declare type NumericHistogramAggregationResult = {
|
5111
|
+
values?: {
|
5112
|
+
$key?: string | number;
|
5113
|
+
$count?: number;
|
5114
|
+
[key: string]: any;
|
5115
|
+
}[];
|
5116
|
+
};
|
5117
|
+
|
3270
5118
|
declare type SortDirection = 'asc' | 'desc';
|
3271
5119
|
declare type SortFilterExtended<T extends XataRecord> = {
|
3272
5120
|
column: SelectableColumn<T>;
|
@@ -3302,7 +5150,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3302
5150
|
#private;
|
3303
5151
|
readonly meta: PaginationQueryMeta;
|
3304
5152
|
readonly records: RecordArray<Result>;
|
3305
|
-
constructor(repository: Repository<Record> | null, table:
|
5153
|
+
constructor(repository: Repository<Record> | null, table: {
|
5154
|
+
name: string;
|
5155
|
+
schema?: Table;
|
5156
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3306
5157
|
getQueryOptions(): QueryOptions<Record>;
|
3307
5158
|
key(): string;
|
3308
5159
|
/**
|
@@ -3341,7 +5192,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3341
5192
|
* @param value The value to filter.
|
3342
5193
|
* @returns A new Query object.
|
3343
5194
|
*/
|
3344
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F
|
5195
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
3345
5196
|
/**
|
3346
5197
|
* Builds a new query object adding one or more constraints. Examples:
|
3347
5198
|
*
|
@@ -3355,14 +5206,14 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3355
5206
|
* @param filters A filter object
|
3356
5207
|
* @returns A new Query object.
|
3357
5208
|
*/
|
3358
|
-
filter(filters
|
5209
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
3359
5210
|
/**
|
3360
5211
|
* Builds a new query with a new sort option.
|
3361
5212
|
* @param column The column name.
|
3362
5213
|
* @param direction The direction. Either ascending or descending.
|
3363
5214
|
* @returns A new Query object.
|
3364
5215
|
*/
|
3365
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
5216
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
3366
5217
|
/**
|
3367
5218
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
3368
5219
|
* @param columns Array of column names to be returned by the query.
|
@@ -3478,6 +5329,26 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3478
5329
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3479
5330
|
*/
|
3480
5331
|
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
5332
|
+
/**
|
5333
|
+
* Performs the query in the database and returns the first result.
|
5334
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5335
|
+
* @throws if there are no results.
|
5336
|
+
*/
|
5337
|
+
getFirstOrThrow(): Promise<Result>;
|
5338
|
+
/**
|
5339
|
+
* Performs the query in the database and returns the first result.
|
5340
|
+
* @param options Additional options to be used when performing the query.
|
5341
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5342
|
+
* @throws if there are no results.
|
5343
|
+
*/
|
5344
|
+
getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
|
5345
|
+
/**
|
5346
|
+
* Performs the query in the database and returns the first result.
|
5347
|
+
* @param options Additional options to be used when performing the query.
|
5348
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5349
|
+
* @throws if there are no results.
|
5350
|
+
*/
|
5351
|
+
getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
|
3481
5352
|
/**
|
3482
5353
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3483
5354
|
* @param ttl The cache TTL in milliseconds.
|
@@ -3634,9 +5505,9 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3634
5505
|
/**
|
3635
5506
|
* Common interface for performing operations on a table.
|
3636
5507
|
*/
|
3637
|
-
declare abstract class Repository<
|
3638
|
-
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<
|
3639
|
-
abstract create(object: Omit<EditableData<
|
5508
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
5509
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5510
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3640
5511
|
/**
|
3641
5512
|
* Creates a single record in the table with a unique id.
|
3642
5513
|
* @param id The unique id.
|
@@ -3644,27 +5515,27 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3644
5515
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3645
5516
|
* @returns The full persisted record.
|
3646
5517
|
*/
|
3647
|
-
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<
|
5518
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3648
5519
|
/**
|
3649
5520
|
* Creates a single record in the table with a unique id.
|
3650
5521
|
* @param id The unique id.
|
3651
5522
|
* @param object Object containing the column names with their values to be stored in the table.
|
3652
5523
|
* @returns The full persisted record.
|
3653
5524
|
*/
|
3654
|
-
abstract create(id: string, object: Omit<EditableData<
|
5525
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3655
5526
|
/**
|
3656
5527
|
* Creates multiple records in the table.
|
3657
5528
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3658
5529
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3659
5530
|
* @returns Array of the persisted records in order.
|
3660
5531
|
*/
|
3661
|
-
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<
|
5532
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3662
5533
|
/**
|
3663
5534
|
* Creates multiple records in the table.
|
3664
5535
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3665
5536
|
* @returns Array of the persisted records in order.
|
3666
5537
|
*/
|
3667
|
-
abstract create(objects: Array<Omit<EditableData<
|
5538
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3668
5539
|
/**
|
3669
5540
|
* Queries a single record from the table given its unique id.
|
3670
5541
|
* @param id The unique id.
|
@@ -3717,47 +5588,154 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3717
5588
|
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3718
5589
|
*/
|
3719
5590
|
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5591
|
+
/**
|
5592
|
+
* Queries a single record from the table given its unique id.
|
5593
|
+
* @param id The unique id.
|
5594
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5595
|
+
* @returns The persisted record for the given id.
|
5596
|
+
* @throws If the record could not be found.
|
5597
|
+
*/
|
5598
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5599
|
+
/**
|
5600
|
+
* Queries a single record from the table given its unique id.
|
5601
|
+
* @param id The unique id.
|
5602
|
+
* @returns The persisted record for the given id.
|
5603
|
+
* @throws If the record could not be found.
|
5604
|
+
*/
|
5605
|
+
abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5606
|
+
/**
|
5607
|
+
* Queries multiple records from the table given their unique id.
|
5608
|
+
* @param ids The unique ids array.
|
5609
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5610
|
+
* @returns The persisted records for the given ids in order.
|
5611
|
+
* @throws If one or more records could not be found.
|
5612
|
+
*/
|
5613
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5614
|
+
/**
|
5615
|
+
* Queries multiple records from the table given their unique id.
|
5616
|
+
* @param ids The unique ids array.
|
5617
|
+
* @returns The persisted records for the given ids in order.
|
5618
|
+
* @throws If one or more records could not be found.
|
5619
|
+
*/
|
5620
|
+
abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5621
|
+
/**
|
5622
|
+
* Queries a single record from the table by the id in the object.
|
5623
|
+
* @param object Object containing the id of the record.
|
5624
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5625
|
+
* @returns The persisted record for the given id.
|
5626
|
+
* @throws If the record could not be found.
|
5627
|
+
*/
|
5628
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5629
|
+
/**
|
5630
|
+
* Queries a single record from the table by the id in the object.
|
5631
|
+
* @param object Object containing the id of the record.
|
5632
|
+
* @returns The persisted record for the given id.
|
5633
|
+
* @throws If the record could not be found.
|
5634
|
+
*/
|
5635
|
+
abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5636
|
+
/**
|
5637
|
+
* Queries multiple records from the table by the ids in the objects.
|
5638
|
+
* @param objects Array of objects containing the ids of the records.
|
5639
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5640
|
+
* @returns The persisted records for the given ids in order.
|
5641
|
+
* @throws If one or more records could not be found.
|
5642
|
+
*/
|
5643
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5644
|
+
/**
|
5645
|
+
* Queries multiple records from the table by the ids in the objects.
|
5646
|
+
* @param objects Array of objects containing the ids of the records.
|
5647
|
+
* @returns The persisted records for the given ids in order.
|
5648
|
+
* @throws If one or more records could not be found.
|
5649
|
+
*/
|
5650
|
+
abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5651
|
+
/**
|
5652
|
+
* Partially update a single record.
|
5653
|
+
* @param object An object with its id and the columns to be updated.
|
5654
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5655
|
+
* @returns The full persisted record, null if the record could not be found.
|
5656
|
+
*/
|
5657
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5658
|
+
/**
|
5659
|
+
* Partially update a single record.
|
5660
|
+
* @param object An object with its id and the columns to be updated.
|
5661
|
+
* @returns The full persisted record, null if the record could not be found.
|
5662
|
+
*/
|
5663
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5664
|
+
/**
|
5665
|
+
* Partially update a single record given its unique id.
|
5666
|
+
* @param id The unique id.
|
5667
|
+
* @param object The column names and their values that have to be updated.
|
5668
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5669
|
+
* @returns The full persisted record, null if the record could not be found.
|
5670
|
+
*/
|
5671
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5672
|
+
/**
|
5673
|
+
* Partially update a single record given its unique id.
|
5674
|
+
* @param id The unique id.
|
5675
|
+
* @param object The column names and their values that have to be updated.
|
5676
|
+
* @returns The full persisted record, null if the record could not be found.
|
5677
|
+
*/
|
5678
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5679
|
+
/**
|
5680
|
+
* Partially updates multiple records.
|
5681
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5682
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5683
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
5684
|
+
*/
|
5685
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5686
|
+
/**
|
5687
|
+
* Partially updates multiple records.
|
5688
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5689
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
5690
|
+
*/
|
5691
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3720
5692
|
/**
|
3721
5693
|
* Partially update a single record.
|
3722
5694
|
* @param object An object with its id and the columns to be updated.
|
3723
5695
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3724
5696
|
* @returns The full persisted record.
|
5697
|
+
* @throws If the record could not be found.
|
3725
5698
|
*/
|
3726
|
-
abstract
|
5699
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3727
5700
|
/**
|
3728
5701
|
* Partially update a single record.
|
3729
5702
|
* @param object An object with its id and the columns to be updated.
|
3730
5703
|
* @returns The full persisted record.
|
5704
|
+
* @throws If the record could not be found.
|
3731
5705
|
*/
|
3732
|
-
abstract
|
5706
|
+
abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3733
5707
|
/**
|
3734
5708
|
* Partially update a single record given its unique id.
|
3735
5709
|
* @param id The unique id.
|
3736
5710
|
* @param object The column names and their values that have to be updated.
|
3737
5711
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3738
5712
|
* @returns The full persisted record.
|
5713
|
+
* @throws If the record could not be found.
|
3739
5714
|
*/
|
3740
|
-
abstract
|
5715
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3741
5716
|
/**
|
3742
5717
|
* Partially update a single record given its unique id.
|
3743
5718
|
* @param id The unique id.
|
3744
5719
|
* @param object The column names and their values that have to be updated.
|
3745
5720
|
* @returns The full persisted record.
|
5721
|
+
* @throws If the record could not be found.
|
3746
5722
|
*/
|
3747
|
-
abstract
|
5723
|
+
abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3748
5724
|
/**
|
3749
5725
|
* Partially updates multiple records.
|
3750
5726
|
* @param objects An array of objects with their ids and columns to be updated.
|
3751
5727
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3752
5728
|
* @returns Array of the persisted records in order.
|
5729
|
+
* @throws If one or more records could not be found.
|
3753
5730
|
*/
|
3754
|
-
abstract
|
5731
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3755
5732
|
/**
|
3756
5733
|
* Partially updates multiple records.
|
3757
5734
|
* @param objects An array of objects with their ids and columns to be updated.
|
3758
5735
|
* @returns Array of the persisted records in order.
|
5736
|
+
* @throws If one or more records could not be found.
|
3759
5737
|
*/
|
3760
|
-
abstract
|
5738
|
+
abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3761
5739
|
/**
|
3762
5740
|
* Creates or updates a single record. If a record exists with the given id,
|
3763
5741
|
* it will be update, otherwise a new record will be created.
|
@@ -3765,14 +5743,14 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3765
5743
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3766
5744
|
* @returns The full persisted record.
|
3767
5745
|
*/
|
3768
|
-
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<
|
5746
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3769
5747
|
/**
|
3770
5748
|
* Creates or updates a single record. If a record exists with the given id,
|
3771
5749
|
* it will be update, otherwise a new record will be created.
|
3772
5750
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3773
5751
|
* @returns The full persisted record.
|
3774
5752
|
*/
|
3775
|
-
abstract createOrUpdate(object: EditableData<
|
5753
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3776
5754
|
/**
|
3777
5755
|
* Creates or updates a single record. If a record exists with the given id,
|
3778
5756
|
* it will be update, otherwise a new record will be created.
|
@@ -3781,7 +5759,7 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3781
5759
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3782
5760
|
* @returns The full persisted record.
|
3783
5761
|
*/
|
3784
|
-
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<
|
5762
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3785
5763
|
/**
|
3786
5764
|
* Creates or updates a single record. If a record exists with the given id,
|
3787
5765
|
* it will be update, otherwise a new record will be created.
|
@@ -3789,7 +5767,7 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3789
5767
|
* @param object The column names and the values to be persisted.
|
3790
5768
|
* @returns The full persisted record.
|
3791
5769
|
*/
|
3792
|
-
abstract createOrUpdate(id: string, object: Omit<EditableData<
|
5770
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3793
5771
|
/**
|
3794
5772
|
* Creates or updates a single record. If a record exists with the given id,
|
3795
5773
|
* it will be update, otherwise a new record will be created.
|
@@ -3797,38 +5775,126 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3797
5775
|
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3798
5776
|
* @returns Array of the persisted records.
|
3799
5777
|
*/
|
3800
|
-
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<
|
5778
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3801
5779
|
/**
|
3802
5780
|
* Creates or updates a single record. If a record exists with the given id,
|
3803
5781
|
* it will be update, otherwise a new record will be created.
|
3804
5782
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3805
5783
|
* @returns Array of the persisted records.
|
3806
5784
|
*/
|
3807
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
5785
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5786
|
+
/**
|
5787
|
+
* Deletes a record given its unique id.
|
5788
|
+
* @param object An object with a unique id.
|
5789
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5790
|
+
* @returns The deleted record, null if the record could not be found.
|
5791
|
+
*/
|
5792
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3808
5793
|
/**
|
3809
5794
|
* Deletes a record given its unique id.
|
5795
|
+
* @param object An object with a unique id.
|
5796
|
+
* @returns The deleted record, null if the record could not be found.
|
5797
|
+
*/
|
5798
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5799
|
+
/**
|
5800
|
+
* Deletes a record given a unique id.
|
5801
|
+
* @param id The unique id.
|
5802
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5803
|
+
* @returns The deleted record, null if the record could not be found.
|
5804
|
+
*/
|
5805
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5806
|
+
/**
|
5807
|
+
* Deletes a record given a unique id.
|
3810
5808
|
* @param id The unique id.
|
3811
|
-
* @
|
5809
|
+
* @returns The deleted record, null if the record could not be found.
|
5810
|
+
*/
|
5811
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5812
|
+
/**
|
5813
|
+
* Deletes multiple records given an array of objects with ids.
|
5814
|
+
* @param objects An array of objects with unique ids.
|
5815
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5816
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5817
|
+
*/
|
5818
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5819
|
+
/**
|
5820
|
+
* Deletes multiple records given an array of objects with ids.
|
5821
|
+
* @param objects An array of objects with unique ids.
|
5822
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3812
5823
|
*/
|
3813
|
-
abstract delete(
|
5824
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5825
|
+
/**
|
5826
|
+
* Deletes multiple records given an array of unique ids.
|
5827
|
+
* @param objects An array of ids.
|
5828
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5829
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5830
|
+
*/
|
5831
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5832
|
+
/**
|
5833
|
+
* Deletes multiple records given an array of unique ids.
|
5834
|
+
* @param objects An array of ids.
|
5835
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5836
|
+
*/
|
5837
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5838
|
+
/**
|
5839
|
+
* Deletes a record given its unique id.
|
5840
|
+
* @param object An object with a unique id.
|
5841
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5842
|
+
* @returns The deleted record, null if the record could not be found.
|
5843
|
+
* @throws If the record could not be found.
|
5844
|
+
*/
|
5845
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3814
5846
|
/**
|
3815
5847
|
* Deletes a record given its unique id.
|
3816
|
-
* @param
|
3817
|
-
* @
|
5848
|
+
* @param object An object with a unique id.
|
5849
|
+
* @returns The deleted record, null if the record could not be found.
|
5850
|
+
* @throws If the record could not be found.
|
5851
|
+
*/
|
5852
|
+
abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5853
|
+
/**
|
5854
|
+
* Deletes a record given a unique id.
|
5855
|
+
* @param id The unique id.
|
5856
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5857
|
+
* @returns The deleted record, null if the record could not be found.
|
5858
|
+
* @throws If the record could not be found.
|
5859
|
+
*/
|
5860
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5861
|
+
/**
|
5862
|
+
* Deletes a record given a unique id.
|
5863
|
+
* @param id The unique id.
|
5864
|
+
* @returns The deleted record, null if the record could not be found.
|
5865
|
+
* @throws If the record could not be found.
|
3818
5866
|
*/
|
3819
|
-
abstract
|
5867
|
+
abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3820
5868
|
/**
|
3821
|
-
* Deletes
|
3822
|
-
* @param
|
3823
|
-
* @
|
5869
|
+
* Deletes multiple records given an array of objects with ids.
|
5870
|
+
* @param objects An array of objects with unique ids.
|
5871
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5872
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5873
|
+
* @throws If one or more records could not be found.
|
5874
|
+
*/
|
5875
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5876
|
+
/**
|
5877
|
+
* Deletes multiple records given an array of objects with ids.
|
5878
|
+
* @param objects An array of objects with unique ids.
|
5879
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5880
|
+
* @throws If one or more records could not be found.
|
5881
|
+
*/
|
5882
|
+
abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5883
|
+
/**
|
5884
|
+
* Deletes multiple records given an array of unique ids.
|
5885
|
+
* @param objects An array of ids.
|
5886
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5887
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5888
|
+
* @throws If one or more records could not be found.
|
3824
5889
|
*/
|
3825
|
-
abstract
|
5890
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3826
5891
|
/**
|
3827
|
-
* Deletes
|
3828
|
-
* @param
|
3829
|
-
* @
|
5892
|
+
* Deletes multiple records given an array of unique ids.
|
5893
|
+
* @param objects An array of ids.
|
5894
|
+
* @returns Array of the deleted records in order.
|
5895
|
+
* @throws If one or more records could not be found.
|
3830
5896
|
*/
|
3831
|
-
abstract
|
5897
|
+
abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3832
5898
|
/**
|
3833
5899
|
* Search for records in the table.
|
3834
5900
|
* @param query The query to search for.
|
@@ -3842,44 +5908,79 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3842
5908
|
filter?: Filter<Record>;
|
3843
5909
|
boosters?: Boosters<Record>[];
|
3844
5910
|
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
5911
|
+
/**
|
5912
|
+
* Aggregates records in the table.
|
5913
|
+
* @param expression The aggregations to perform.
|
5914
|
+
* @param filter The filter to apply to the queried records.
|
5915
|
+
* @returns The requested aggregations.
|
5916
|
+
*/
|
5917
|
+
abstract aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(expression?: Expression, filter?: Filter<Record>): Promise<AggregationResult<Record, Expression>>;
|
3845
5918
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3846
5919
|
}
|
3847
|
-
declare class RestRepository<
|
5920
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3848
5921
|
#private;
|
3849
|
-
db: SchemaPluginResult<any>;
|
3850
5922
|
constructor(options: {
|
3851
5923
|
table: string;
|
3852
5924
|
db: SchemaPluginResult<any>;
|
3853
5925
|
pluginOptions: XataPluginOptions;
|
3854
5926
|
schemaTables?: Table[];
|
3855
5927
|
});
|
3856
|
-
create(object: EditableData<
|
3857
|
-
create(
|
3858
|
-
create(
|
3859
|
-
create
|
3860
|
-
create<K extends SelectableColumn<Record>>(
|
3861
|
-
create
|
3862
|
-
read(
|
3863
|
-
read(
|
3864
|
-
read(
|
3865
|
-
read(
|
3866
|
-
read<K extends SelectableColumn<Record>>(
|
3867
|
-
read
|
3868
|
-
read<K extends SelectableColumn<Record>>(
|
3869
|
-
read
|
3870
|
-
|
3871
|
-
|
3872
|
-
|
3873
|
-
|
3874
|
-
|
3875
|
-
|
3876
|
-
|
3877
|
-
|
3878
|
-
|
3879
|
-
|
3880
|
-
|
3881
|
-
|
3882
|
-
|
5928
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5929
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5930
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5931
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5932
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5933
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5934
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5935
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5936
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5937
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5938
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5939
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5940
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5941
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5942
|
+
readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5943
|
+
readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5944
|
+
readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5945
|
+
readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5946
|
+
readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5947
|
+
readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5948
|
+
readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5949
|
+
readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5950
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5951
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5952
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5953
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5954
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5955
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5956
|
+
updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5957
|
+
updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5958
|
+
updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5959
|
+
updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5960
|
+
updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5961
|
+
updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5962
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5963
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5964
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5965
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5966
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5967
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5968
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5969
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5970
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5971
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5972
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5973
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5974
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5975
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5976
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5977
|
+
deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5978
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5979
|
+
deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5980
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5981
|
+
deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5982
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5983
|
+
deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3883
5984
|
search(query: string, options?: {
|
3884
5985
|
fuzziness?: FuzzinessExpression;
|
3885
5986
|
prefix?: PrefixExpression;
|
@@ -3887,6 +5988,7 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
3887
5988
|
filter?: Filter<Record>;
|
3888
5989
|
boosters?: Boosters<Record>[];
|
3889
5990
|
}): Promise<any>;
|
5991
|
+
aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(aggs?: Expression, filter?: Filter<Record>): Promise<any>;
|
3890
5992
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3891
5993
|
}
|
3892
5994
|
|
@@ -3895,6 +5997,7 @@ declare type BaseSchema = {
|
|
3895
5997
|
columns: readonly ({
|
3896
5998
|
name: string;
|
3897
5999
|
type: Column['type'];
|
6000
|
+
notNull?: boolean;
|
3898
6001
|
} | {
|
3899
6002
|
name: string;
|
3900
6003
|
type: 'link';
|
@@ -3924,10 +6027,10 @@ declare type TableType<Tables, TableName> = Tables & {
|
|
3924
6027
|
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3925
6028
|
name: string;
|
3926
6029
|
type: string;
|
3927
|
-
} ? Identifiable & {
|
3928
|
-
[K in Columns[number]['name']]
|
3929
|
-
} : never : never : never : never;
|
3930
|
-
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
6030
|
+
} ? Identifiable & UnionToIntersection<Values<{
|
6031
|
+
[K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
|
6032
|
+
}>> : never : never : never : never;
|
6033
|
+
declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
|
3931
6034
|
name: PropertyName;
|
3932
6035
|
} extends infer Property ? Property extends {
|
3933
6036
|
name: string;
|
@@ -3936,13 +6039,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
|
3936
6039
|
table: infer LinkedTable;
|
3937
6040
|
};
|
3938
6041
|
columns?: infer ObjectColumns;
|
3939
|
-
|
6042
|
+
notNull?: infer NotNull;
|
6043
|
+
} ? NotNull extends true ? {
|
6044
|
+
[K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
|
6045
|
+
} : {
|
6046
|
+
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
6047
|
+
} : never : never;
|
6048
|
+
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 {
|
3940
6049
|
name: string;
|
3941
6050
|
type: string;
|
3942
|
-
} ? {
|
3943
|
-
[K in ObjectColumns[number]['name']]
|
3944
|
-
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never
|
6051
|
+
} ? UnionToIntersection<Values<{
|
6052
|
+
[K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
|
6053
|
+
}>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
|
3945
6054
|
|
6055
|
+
/**
|
6056
|
+
* Operator to restrict results to only values that are greater than the given value.
|
6057
|
+
*/
|
6058
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3946
6059
|
/**
|
3947
6060
|
* Operator to restrict results to only values that are greater than the given value.
|
3948
6061
|
*/
|
@@ -3950,15 +6063,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3950
6063
|
/**
|
3951
6064
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3952
6065
|
*/
|
3953
|
-
declare const
|
6066
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
6067
|
+
/**
|
6068
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
6069
|
+
*/
|
6070
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3954
6071
|
/**
|
3955
6072
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3956
6073
|
*/
|
3957
6074
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
6075
|
+
/**
|
6076
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
6077
|
+
*/
|
6078
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
6079
|
+
/**
|
6080
|
+
* Operator to restrict results to only values that are lower than the given value.
|
6081
|
+
*/
|
6082
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3958
6083
|
/**
|
3959
6084
|
* Operator to restrict results to only values that are lower than the given value.
|
3960
6085
|
*/
|
3961
6086
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
6087
|
+
/**
|
6088
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
6089
|
+
*/
|
6090
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
6091
|
+
/**
|
6092
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
6093
|
+
*/
|
6094
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3962
6095
|
/**
|
3963
6096
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3964
6097
|
*/
|
@@ -3991,6 +6124,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3991
6124
|
* Operator to restrict results to only values that are equal to the given value.
|
3992
6125
|
*/
|
3993
6126
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
6127
|
+
/**
|
6128
|
+
* Operator to restrict results to only values that are equal to the given value.
|
6129
|
+
*/
|
6130
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
3994
6131
|
/**
|
3995
6132
|
* Operator to restrict results to only values that are not equal to the given value.
|
3996
6133
|
*/
|
@@ -4019,12 +6156,10 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
4019
6156
|
declare type SchemaDefinition = {
|
4020
6157
|
table: string;
|
4021
6158
|
};
|
4022
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
6159
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
4023
6160
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
4024
|
-
} & {
|
4025
|
-
[key: string]: Repository<XataRecord$1>;
|
4026
6161
|
};
|
4027
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
6162
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
4028
6163
|
#private;
|
4029
6164
|
constructor(schemaTables?: Schemas.Table[]);
|
4030
6165
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
@@ -4041,19 +6176,34 @@ declare type BaseClientOptions = {
|
|
4041
6176
|
databaseURL?: string;
|
4042
6177
|
branch?: BranchStrategyOption;
|
4043
6178
|
cache?: CacheImpl;
|
6179
|
+
trace?: TraceFunction;
|
4044
6180
|
};
|
4045
6181
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
4046
6182
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
4047
|
-
new <
|
4048
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
4049
|
-
search: Awaited<ReturnType<SearchPlugin<
|
6183
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
6184
|
+
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
6185
|
+
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
4050
6186
|
}, keyof Plugins> & {
|
4051
6187
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
6188
|
+
} & {
|
6189
|
+
getConfig(): Promise<{
|
6190
|
+
databaseURL: string;
|
6191
|
+
branch: string;
|
6192
|
+
}>;
|
4052
6193
|
};
|
4053
6194
|
}
|
4054
6195
|
declare const BaseClient_base: ClientConstructor<{}>;
|
4055
|
-
declare class BaseClient extends BaseClient_base<
|
6196
|
+
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
6197
|
+
}
|
6198
|
+
|
6199
|
+
declare class Serializer {
|
6200
|
+
classes: Record<string, any>;
|
6201
|
+
add(clazz: any): void;
|
6202
|
+
toJSON<T>(data: T): string;
|
6203
|
+
fromJSON<T>(json: string): T;
|
4056
6204
|
}
|
6205
|
+
declare const serialize: <T>(data: T) => string;
|
6206
|
+
declare const deserialize: <T>(json: string) => T;
|
4057
6207
|
|
4058
6208
|
declare type BranchResolutionOptions = {
|
4059
6209
|
databaseURL?: string;
|
@@ -4066,9 +6216,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
4066
6216
|
|
4067
6217
|
declare function getAPIKey(): string | undefined;
|
4068
6218
|
|
6219
|
+
interface Body {
|
6220
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
6221
|
+
blob(): Promise<Blob>;
|
6222
|
+
formData(): Promise<FormData>;
|
6223
|
+
json(): Promise<any>;
|
6224
|
+
text(): Promise<string>;
|
6225
|
+
}
|
6226
|
+
interface Blob {
|
6227
|
+
readonly size: number;
|
6228
|
+
readonly type: string;
|
6229
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
6230
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
6231
|
+
text(): Promise<string>;
|
6232
|
+
}
|
6233
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
6234
|
+
interface File extends Blob {
|
6235
|
+
readonly lastModified: number;
|
6236
|
+
readonly name: string;
|
6237
|
+
readonly webkitRelativePath: string;
|
6238
|
+
}
|
6239
|
+
declare type FormDataEntryValue = File | string;
|
6240
|
+
/** 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". */
|
6241
|
+
interface FormData {
|
6242
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
6243
|
+
delete(name: string): void;
|
6244
|
+
get(name: string): FormDataEntryValue | null;
|
6245
|
+
getAll(name: string): FormDataEntryValue[];
|
6246
|
+
has(name: string): boolean;
|
6247
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
6248
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
6249
|
+
}
|
6250
|
+
/** 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. */
|
6251
|
+
interface Headers {
|
6252
|
+
append(name: string, value: string): void;
|
6253
|
+
delete(name: string): void;
|
6254
|
+
get(name: string): string | null;
|
6255
|
+
has(name: string): boolean;
|
6256
|
+
set(name: string, value: string): void;
|
6257
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
6258
|
+
}
|
6259
|
+
interface Request extends Body {
|
6260
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
6261
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
6262
|
+
/** 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. */
|
6263
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
6264
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
6265
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
6266
|
+
/** 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. */
|
6267
|
+
readonly headers: Headers;
|
6268
|
+
/** 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] */
|
6269
|
+
readonly integrity: string;
|
6270
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
6271
|
+
readonly keepalive: boolean;
|
6272
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
6273
|
+
readonly method: string;
|
6274
|
+
/** 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. */
|
6275
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
6276
|
+
/** 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. */
|
6277
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
6278
|
+
/** 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. */
|
6279
|
+
readonly referrer: string;
|
6280
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
6281
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
6282
|
+
/** Returns the URL of request as a string. */
|
6283
|
+
readonly url: string;
|
6284
|
+
clone(): Request;
|
6285
|
+
}
|
6286
|
+
|
6287
|
+
declare type XataWorkerContext<XataClient> = {
|
6288
|
+
xata: XataClient;
|
6289
|
+
request: Request;
|
6290
|
+
env: Record<string, string | undefined>;
|
6291
|
+
};
|
6292
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
6293
|
+
declare type WorkerRunnerConfig = {
|
6294
|
+
workspace: string;
|
6295
|
+
worker: string;
|
6296
|
+
};
|
6297
|
+
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>>>;
|
6298
|
+
|
4069
6299
|
declare class XataError extends Error {
|
4070
6300
|
readonly status: number;
|
4071
6301
|
constructor(message: string, status: number);
|
4072
6302
|
}
|
4073
6303
|
|
4074
|
-
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 };
|
6304
|
+
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, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, ColumnsByValue, 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, 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 };
|