@xata.io/client 0.0.0-alpha.vec92b09 → 0.0.0-alpha.vecd13ea
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 +140 -0
- package/README.md +27 -25
- package/Usage.md +62 -6
- package/dist/index.cjs +1245 -543
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2874 -361
- package/dist/index.mjs +1194 -544
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
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';
|
|
@@ -23,7 +32,6 @@ declare type ErrorWrapper<TError> = TError | {
|
|
|
23
32
|
};
|
|
24
33
|
|
|
25
34
|
interface CacheImpl {
|
|
26
|
-
cacheRecords: boolean;
|
|
27
35
|
defaultQueryTTL: number;
|
|
28
36
|
getAll(): Promise<Record<string, unknown>>;
|
|
29
37
|
get: <T>(key: string) => Promise<T | null>;
|
|
@@ -33,13 +41,11 @@ interface CacheImpl {
|
|
|
33
41
|
}
|
|
34
42
|
interface SimpleCacheOptions {
|
|
35
43
|
max?: number;
|
|
36
|
-
cacheRecords?: boolean;
|
|
37
44
|
defaultQueryTTL?: number;
|
|
38
45
|
}
|
|
39
46
|
declare class SimpleCache implements CacheImpl {
|
|
40
47
|
#private;
|
|
41
48
|
capacity: number;
|
|
42
|
-
cacheRecords: boolean;
|
|
43
49
|
defaultQueryTTL: number;
|
|
44
50
|
constructor(options?: SimpleCacheOptions);
|
|
45
51
|
getAll(): Promise<Record<string, unknown>>;
|
|
@@ -55,6 +61,7 @@ declare abstract class XataPlugin {
|
|
|
55
61
|
declare type XataPluginOptions = {
|
|
56
62
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
|
57
63
|
cache: CacheImpl;
|
|
64
|
+
trace?: TraceFunction;
|
|
58
65
|
};
|
|
59
66
|
|
|
60
67
|
/**
|
|
@@ -63,6 +70,9 @@ declare type XataPluginOptions = {
|
|
|
63
70
|
* @version 1.0
|
|
64
71
|
*/
|
|
65
72
|
declare type User = {
|
|
73
|
+
/**
|
|
74
|
+
* @format email
|
|
75
|
+
*/
|
|
66
76
|
email: string;
|
|
67
77
|
fullname: string;
|
|
68
78
|
image: string;
|
|
@@ -94,16 +104,19 @@ declare type WorkspaceID = string;
|
|
|
94
104
|
declare type Role = 'owner' | 'maintainer';
|
|
95
105
|
declare type WorkspaceMeta = {
|
|
96
106
|
name: string;
|
|
97
|
-
slug
|
|
107
|
+
slug?: string;
|
|
98
108
|
};
|
|
99
109
|
declare type Workspace = WorkspaceMeta & {
|
|
100
110
|
id: WorkspaceID;
|
|
101
111
|
memberCount: number;
|
|
102
|
-
plan: 'free';
|
|
112
|
+
plan: 'free' | 'pro';
|
|
103
113
|
};
|
|
104
114
|
declare type WorkspaceMember = {
|
|
105
115
|
userId: UserID;
|
|
106
116
|
fullname: string;
|
|
117
|
+
/**
|
|
118
|
+
* @format email
|
|
119
|
+
*/
|
|
107
120
|
email: string;
|
|
108
121
|
role: Role;
|
|
109
122
|
};
|
|
@@ -113,7 +126,13 @@ declare type WorkspaceMember = {
|
|
|
113
126
|
declare type InviteID = string;
|
|
114
127
|
declare type WorkspaceInvite = {
|
|
115
128
|
inviteId: InviteID;
|
|
129
|
+
/**
|
|
130
|
+
* @format email
|
|
131
|
+
*/
|
|
116
132
|
email: string;
|
|
133
|
+
/**
|
|
134
|
+
* @format date-time
|
|
135
|
+
*/
|
|
117
136
|
expires: string;
|
|
118
137
|
role: Role;
|
|
119
138
|
};
|
|
@@ -125,20 +144,40 @@ declare type WorkspaceMembers = {
|
|
|
125
144
|
* @pattern ^ik_[a-zA-Z0-9]+
|
|
126
145
|
*/
|
|
127
146
|
declare type InviteKey = string;
|
|
147
|
+
/**
|
|
148
|
+
* Metadata of databases
|
|
149
|
+
*/
|
|
150
|
+
declare type DatabaseMetadata = {
|
|
151
|
+
/**
|
|
152
|
+
* The machine-readable name of a database
|
|
153
|
+
*/
|
|
154
|
+
name: string;
|
|
155
|
+
/**
|
|
156
|
+
* The time this database was created
|
|
157
|
+
*/
|
|
158
|
+
createdAt: DateTime;
|
|
159
|
+
/**
|
|
160
|
+
* The number of branches the database has
|
|
161
|
+
*/
|
|
162
|
+
numberOfBranches: number;
|
|
163
|
+
/**
|
|
164
|
+
* Metadata about the database for display in Xata user interfaces
|
|
165
|
+
*/
|
|
166
|
+
ui?: {
|
|
167
|
+
/**
|
|
168
|
+
* The user-selected color for this database across interfaces
|
|
169
|
+
*/
|
|
170
|
+
color?: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
128
173
|
declare type ListDatabasesResponse = {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
numberOfBranches: number;
|
|
134
|
-
ui?: {
|
|
135
|
-
color?: string;
|
|
136
|
-
};
|
|
137
|
-
}[];
|
|
174
|
+
/**
|
|
175
|
+
* A list of databases in a Xata workspace
|
|
176
|
+
*/
|
|
177
|
+
databases?: DatabaseMetadata[];
|
|
138
178
|
};
|
|
139
179
|
declare type ListBranchesResponse = {
|
|
140
180
|
databaseName: string;
|
|
141
|
-
displayName: string;
|
|
142
181
|
branches: Branch[];
|
|
143
182
|
};
|
|
144
183
|
declare type ListGitBranchesResponse = {
|
|
@@ -156,8 +195,14 @@ declare type Branch = {
|
|
|
156
195
|
* @x-go-type xata.BranchMetadata
|
|
157
196
|
*/
|
|
158
197
|
declare type BranchMetadata = {
|
|
198
|
+
/**
|
|
199
|
+
* @minLength 1
|
|
200
|
+
*/
|
|
159
201
|
repository?: string;
|
|
160
202
|
branch?: BranchName;
|
|
203
|
+
/**
|
|
204
|
+
* @minLength 1
|
|
205
|
+
*/
|
|
161
206
|
stage?: string;
|
|
162
207
|
labels?: string[];
|
|
163
208
|
};
|
|
@@ -184,12 +229,28 @@ declare type Schema = {
|
|
|
184
229
|
tables: Table[];
|
|
185
230
|
tablesOrder?: string[];
|
|
186
231
|
};
|
|
232
|
+
/**
|
|
233
|
+
* @x-internal true
|
|
234
|
+
*/
|
|
235
|
+
declare type SchemaEditScript = {
|
|
236
|
+
sourceMigrationID?: string;
|
|
237
|
+
targetMigrationID?: string;
|
|
238
|
+
tables: TableEdit[];
|
|
239
|
+
};
|
|
187
240
|
declare type Table = {
|
|
188
241
|
id?: string;
|
|
189
242
|
name: TableName;
|
|
190
243
|
columns: Column[];
|
|
191
244
|
revLinks?: RevLink[];
|
|
192
245
|
};
|
|
246
|
+
/**
|
|
247
|
+
* @x-internal true
|
|
248
|
+
*/
|
|
249
|
+
declare type TableEdit = {
|
|
250
|
+
oldName?: string;
|
|
251
|
+
newName?: string;
|
|
252
|
+
columns?: MigrationColumnOp[];
|
|
253
|
+
};
|
|
193
254
|
/**
|
|
194
255
|
* @x-go-type xata.Column
|
|
195
256
|
*/
|
|
@@ -199,6 +260,8 @@ declare type Column = {
|
|
|
199
260
|
link?: {
|
|
200
261
|
table: string;
|
|
201
262
|
};
|
|
263
|
+
notNull?: boolean;
|
|
264
|
+
unique?: boolean;
|
|
202
265
|
columns?: Column[];
|
|
203
266
|
};
|
|
204
267
|
declare type RevLink = {
|
|
@@ -265,6 +328,137 @@ declare type ColumnMigration = {
|
|
|
265
328
|
old: Column;
|
|
266
329
|
['new']: Column;
|
|
267
330
|
};
|
|
331
|
+
/**
|
|
332
|
+
* @x-internal true
|
|
333
|
+
*/
|
|
334
|
+
declare type Commit = {
|
|
335
|
+
meta?: {
|
|
336
|
+
title?: string;
|
|
337
|
+
message?: string;
|
|
338
|
+
id: string;
|
|
339
|
+
parentID?: string;
|
|
340
|
+
mergeParentID?: string;
|
|
341
|
+
status: string;
|
|
342
|
+
createdAt: DateTime;
|
|
343
|
+
modifiedAt?: DateTime;
|
|
344
|
+
};
|
|
345
|
+
operations: MigrationOp[];
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* Branch schema migration.
|
|
349
|
+
*
|
|
350
|
+
* @x-internal true
|
|
351
|
+
*/
|
|
352
|
+
declare type Migration = {
|
|
353
|
+
parentID?: string;
|
|
354
|
+
operations: MigrationOp[];
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Branch schema migration operations.
|
|
358
|
+
*
|
|
359
|
+
* @x-internal true
|
|
360
|
+
*/
|
|
361
|
+
declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
|
|
362
|
+
/**
|
|
363
|
+
* @x-internal true
|
|
364
|
+
*/
|
|
365
|
+
declare type MigrationTableOp = {
|
|
366
|
+
addTable: TableOpAdd;
|
|
367
|
+
} | {
|
|
368
|
+
removeTable: TableOpRemove;
|
|
369
|
+
} | {
|
|
370
|
+
renameTable: TableOpRename;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* @x-internal true
|
|
374
|
+
*/
|
|
375
|
+
declare type MigrationColumnOp = {
|
|
376
|
+
addColumn: ColumnOpAdd;
|
|
377
|
+
} | {
|
|
378
|
+
removeColumn: ColumnOpRemove;
|
|
379
|
+
} | {
|
|
380
|
+
renameColumn: ColumnOpRename;
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* @x-internal true
|
|
384
|
+
*/
|
|
385
|
+
declare type TableOpAdd = {
|
|
386
|
+
table: string;
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* @x-internal true
|
|
390
|
+
*/
|
|
391
|
+
declare type TableOpRemove = {
|
|
392
|
+
table: string;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* @x-internal true
|
|
396
|
+
*/
|
|
397
|
+
declare type TableOpRename = {
|
|
398
|
+
oldName: string;
|
|
399
|
+
newName: string;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* @x-internal true
|
|
403
|
+
*/
|
|
404
|
+
declare type ColumnOpAdd = {
|
|
405
|
+
table?: string;
|
|
406
|
+
column: Column;
|
|
407
|
+
};
|
|
408
|
+
/**
|
|
409
|
+
* @x-internal true
|
|
410
|
+
*/
|
|
411
|
+
declare type ColumnOpRemove = {
|
|
412
|
+
table?: string;
|
|
413
|
+
column: string;
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* @x-internal true
|
|
417
|
+
*/
|
|
418
|
+
declare type ColumnOpRename = {
|
|
419
|
+
table?: string;
|
|
420
|
+
oldName: string;
|
|
421
|
+
newName: string;
|
|
422
|
+
};
|
|
423
|
+
declare type MigrationRequest = {
|
|
424
|
+
/**
|
|
425
|
+
* The migration request number.
|
|
426
|
+
*/
|
|
427
|
+
number: number;
|
|
428
|
+
/**
|
|
429
|
+
* Migration request creation timestamp.
|
|
430
|
+
*/
|
|
431
|
+
createdAt: DateTime;
|
|
432
|
+
/**
|
|
433
|
+
* Last modified timestamp.
|
|
434
|
+
*/
|
|
435
|
+
modifiedAt?: DateTime;
|
|
436
|
+
/**
|
|
437
|
+
* Timestamp when the migration request was closed.
|
|
438
|
+
*/
|
|
439
|
+
closedAt?: DateTime;
|
|
440
|
+
/**
|
|
441
|
+
* Timestamp when the migration request was merged.
|
|
442
|
+
*/
|
|
443
|
+
mergedAt?: DateTime;
|
|
444
|
+
status: 'open' | 'closed' | 'merging' | 'merged';
|
|
445
|
+
/**
|
|
446
|
+
* The migration request title.
|
|
447
|
+
*/
|
|
448
|
+
title: string;
|
|
449
|
+
/**
|
|
450
|
+
* The migration request body with detailed description.
|
|
451
|
+
*/
|
|
452
|
+
body: string;
|
|
453
|
+
/**
|
|
454
|
+
* Name of the source branch.
|
|
455
|
+
*/
|
|
456
|
+
source: string;
|
|
457
|
+
/**
|
|
458
|
+
* Name of the target branch.
|
|
459
|
+
*/
|
|
460
|
+
target: string;
|
|
461
|
+
};
|
|
268
462
|
declare type SortExpression = string[] | {
|
|
269
463
|
[key: string]: SortOrder;
|
|
270
464
|
} | {
|
|
@@ -273,7 +467,7 @@ declare type SortExpression = string[] | {
|
|
|
273
467
|
declare type SortOrder = 'asc' | 'desc';
|
|
274
468
|
/**
|
|
275
469
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
|
276
|
-
* distance is the number of one
|
|
470
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
|
277
471
|
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
|
278
472
|
* to allow two typos in a word.
|
|
279
473
|
*
|
|
@@ -286,6 +480,23 @@ declare type FuzzinessExpression = number;
|
|
|
286
480
|
* If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
|
|
287
481
|
*/
|
|
288
482
|
declare type PrefixExpression = 'phrase' | 'disabled';
|
|
483
|
+
/**
|
|
484
|
+
* The target expression is used to filter the search results by the target columns.
|
|
485
|
+
*/
|
|
486
|
+
declare type TargetExpression = (string | {
|
|
487
|
+
/**
|
|
488
|
+
* The name of the column.
|
|
489
|
+
*/
|
|
490
|
+
column: string;
|
|
491
|
+
/**
|
|
492
|
+
* The weight of the column.
|
|
493
|
+
*
|
|
494
|
+
* @default 1
|
|
495
|
+
* @maximum 10
|
|
496
|
+
* @minimum 1
|
|
497
|
+
*/
|
|
498
|
+
weight?: number;
|
|
499
|
+
})[];
|
|
289
500
|
/**
|
|
290
501
|
* @minProperties 1
|
|
291
502
|
*/
|
|
@@ -299,26 +510,286 @@ declare type FilterExpression = {
|
|
|
299
510
|
} & {
|
|
300
511
|
[key: string]: FilterColumn;
|
|
301
512
|
};
|
|
513
|
+
/**
|
|
514
|
+
* The description of the summaries you wish to receive. Set each key to be the field name
|
|
515
|
+
* you'd like for the summary. These names must not collide with other columns you've
|
|
516
|
+
* requested from `columns`; including implicit requests like `settings.*`.
|
|
517
|
+
*
|
|
518
|
+
* The value for each key needs to be an object. This object should contain one key and one
|
|
519
|
+
* value only. In this object, the key should be set to the summary function you wish to use
|
|
520
|
+
* and the value set to the column name to be summarized.
|
|
521
|
+
*
|
|
522
|
+
* The column being summarized cannot be an internal column (id, xata.*), nor the base of
|
|
523
|
+
* an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
|
|
524
|
+
* `settings.dark_mode` but not `settings` nor `settings.*`.
|
|
525
|
+
*
|
|
526
|
+
* @example {"all_users":{"count":"*"}}
|
|
527
|
+
* @example {"total_created":{"count":"created_at"}}
|
|
528
|
+
* @x-go-type xbquery.SummaryList
|
|
529
|
+
*/
|
|
530
|
+
declare type SummaryExpressionList = {
|
|
531
|
+
[key: string]: SummaryExpression;
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* A summary expression is the description of a single summary operation. It consists of a single
|
|
535
|
+
* key representing the operation, and a value representing the column to be operated on.
|
|
536
|
+
*
|
|
537
|
+
* The column being summarized cannot be an internal column (id, xata.*), nor the base of
|
|
538
|
+
* an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
|
|
539
|
+
* `settings.dark_mode` but not `settings` nor `settings.*`.
|
|
540
|
+
*
|
|
541
|
+
* We currently support the `count` operation. When using `count`, one can set a column name
|
|
542
|
+
* as the value. Xata will return the total number times this column is non-null in each group.
|
|
543
|
+
*
|
|
544
|
+
* Alternately, if you'd like to count the total rows in each group - irregardless of null/not null
|
|
545
|
+
* status - you can set `count` to `*` to count everything.
|
|
546
|
+
*
|
|
547
|
+
* @example {"count":"deleted_at"}
|
|
548
|
+
* @x-go-type xbquery.Summary
|
|
549
|
+
*/
|
|
550
|
+
declare type SummaryExpression = Record<string, any>;
|
|
551
|
+
/**
|
|
552
|
+
* The description of the aggregations you wish to receive.
|
|
553
|
+
*
|
|
554
|
+
* @example {"totalCount":{"count":"*"},"dailyActiveUsers":{"dateHistogram":{"column":"date","interval":"1d"},"aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}}}}
|
|
555
|
+
*/
|
|
556
|
+
declare type AggExpressionMap = {
|
|
557
|
+
[key: string]: AggExpression;
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* The description of a single aggregation operation. It is an object with only one key-value pair.
|
|
561
|
+
* The key represents the aggreagtion type, while the value is an object with the configuration of
|
|
562
|
+
* the aggreagtion.
|
|
563
|
+
*
|
|
564
|
+
* @x-go-type xata.AggExpression
|
|
565
|
+
*/
|
|
566
|
+
declare type AggExpression = {
|
|
567
|
+
count?: CountAgg;
|
|
568
|
+
} | {
|
|
569
|
+
sum?: SumAgg;
|
|
570
|
+
} | {
|
|
571
|
+
max?: MaxAgg;
|
|
572
|
+
} | {
|
|
573
|
+
min?: MinAgg;
|
|
574
|
+
} | {
|
|
575
|
+
average?: AverageAgg;
|
|
576
|
+
} | {
|
|
577
|
+
uniqueCount?: UniqueCountAgg;
|
|
578
|
+
} | {
|
|
579
|
+
dateHistogram?: DateHistogramAgg;
|
|
580
|
+
} | {
|
|
581
|
+
topValues?: TopValuesAgg;
|
|
582
|
+
} | {
|
|
583
|
+
numericHistogram?: NumericHistogramAgg;
|
|
584
|
+
};
|
|
585
|
+
/**
|
|
586
|
+
* Count the number of records with an optional filter.
|
|
587
|
+
*/
|
|
588
|
+
declare type CountAgg = {
|
|
589
|
+
filter?: FilterExpression;
|
|
590
|
+
} | '*';
|
|
591
|
+
/**
|
|
592
|
+
* The sum of the numeric values in a particular column.
|
|
593
|
+
*/
|
|
594
|
+
declare type SumAgg = {
|
|
595
|
+
/**
|
|
596
|
+
* The column on which to compute the sum. Must be a numeric type.
|
|
597
|
+
*/
|
|
598
|
+
column: string;
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* The max of the numeric values in a particular column.
|
|
602
|
+
*/
|
|
603
|
+
declare type MaxAgg = {
|
|
604
|
+
/**
|
|
605
|
+
* The column on which to compute the max. Must be a numeric type.
|
|
606
|
+
*/
|
|
607
|
+
column: string;
|
|
608
|
+
};
|
|
609
|
+
/**
|
|
610
|
+
* The min of the numeric values in a particular column.
|
|
611
|
+
*/
|
|
612
|
+
declare type MinAgg = {
|
|
613
|
+
/**
|
|
614
|
+
* The column on which to compute the min. Must be a numeric type.
|
|
615
|
+
*/
|
|
616
|
+
column: string;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* The average of the numeric values in a particular column.
|
|
620
|
+
*/
|
|
621
|
+
declare type AverageAgg = {
|
|
622
|
+
/**
|
|
623
|
+
* The column on which to compute the average. Must be a numeric type.
|
|
624
|
+
*/
|
|
625
|
+
column: string;
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* Count the number of distinct values in a particular column.
|
|
629
|
+
*/
|
|
630
|
+
declare type UniqueCountAgg = {
|
|
631
|
+
/**
|
|
632
|
+
* The column from where to count the unique values.
|
|
633
|
+
*/
|
|
634
|
+
column: string;
|
|
635
|
+
/**
|
|
636
|
+
* The threshold under which the unique count is exact. If the number of unique
|
|
637
|
+
* values in the column is higher than this threshold, the results are approximative.
|
|
638
|
+
* Maximum value is 40,000, default value is 3000.
|
|
639
|
+
*/
|
|
640
|
+
precisionThreshold?: number;
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
|
|
644
|
+
*/
|
|
645
|
+
declare type DateHistogramAgg = {
|
|
646
|
+
/**
|
|
647
|
+
* The column to use for bucketing. Must be of type datetime.
|
|
648
|
+
*/
|
|
649
|
+
column: string;
|
|
650
|
+
/**
|
|
651
|
+
* The fixed interval to use when bucketing.
|
|
652
|
+
* It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
|
|
653
|
+
*
|
|
654
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
|
655
|
+
*/
|
|
656
|
+
interval?: string;
|
|
657
|
+
/**
|
|
658
|
+
* The calendar-aware interval to use when bucketing. Possible values are: `minute`,
|
|
659
|
+
* `hour`, `day`, `week`, `month`, `quarter`, `year`.
|
|
660
|
+
*/
|
|
661
|
+
calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
662
|
+
/**
|
|
663
|
+
* The timezone to use for bucketing. By default, UTC is assumed.
|
|
664
|
+
* The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
|
|
665
|
+
* `-08:00`.
|
|
666
|
+
*
|
|
667
|
+
* @pattern ^[+-][01]\d:[0-5]\d$
|
|
668
|
+
*/
|
|
669
|
+
timezone?: string;
|
|
670
|
+
aggs?: AggExpressionMap;
|
|
671
|
+
};
|
|
672
|
+
/**
|
|
673
|
+
* Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
|
|
674
|
+
* The top values as ordered by the number of records (`$count``) are returned.
|
|
675
|
+
*/
|
|
676
|
+
declare type TopValuesAgg = {
|
|
677
|
+
/**
|
|
678
|
+
* The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
|
|
679
|
+
*/
|
|
680
|
+
column: string;
|
|
681
|
+
aggs?: AggExpressionMap;
|
|
682
|
+
/**
|
|
683
|
+
* The maximum number of unique values to return.
|
|
684
|
+
*
|
|
685
|
+
* @default 10
|
|
686
|
+
* @maximum 1000
|
|
687
|
+
*/
|
|
688
|
+
size?: number;
|
|
689
|
+
};
|
|
690
|
+
/**
|
|
691
|
+
* Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
|
|
692
|
+
*/
|
|
693
|
+
declare type NumericHistogramAgg = {
|
|
694
|
+
/**
|
|
695
|
+
* The column to use for bucketing. Must be of numeric type.
|
|
696
|
+
*/
|
|
697
|
+
column: string;
|
|
698
|
+
/**
|
|
699
|
+
* The numeric interval to use for bucketing. The resulting buckets will be ranges
|
|
700
|
+
* with this value as size.
|
|
701
|
+
*
|
|
702
|
+
* @minimum 0
|
|
703
|
+
*/
|
|
704
|
+
interval: number;
|
|
705
|
+
/**
|
|
706
|
+
* By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
|
|
707
|
+
* boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
|
|
708
|
+
* but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
|
|
709
|
+
* to 50.
|
|
710
|
+
*
|
|
711
|
+
* @default 0
|
|
712
|
+
*/
|
|
713
|
+
offset?: number;
|
|
714
|
+
aggs?: AggExpressionMap;
|
|
715
|
+
};
|
|
302
716
|
declare type HighlightExpression = {
|
|
717
|
+
/**
|
|
718
|
+
* Set to `false` to disable highlighting. By default it is `true`.
|
|
719
|
+
*/
|
|
303
720
|
enabled?: boolean;
|
|
721
|
+
/**
|
|
722
|
+
* Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
|
|
723
|
+
*/
|
|
304
724
|
encodeHTML?: boolean;
|
|
305
725
|
};
|
|
726
|
+
/**
|
|
727
|
+
* Booster Expression
|
|
728
|
+
*
|
|
729
|
+
* @x-go-type xata.BoosterExpression
|
|
730
|
+
*/
|
|
306
731
|
declare type BoosterExpression = {
|
|
307
|
-
valueBooster?:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
732
|
+
valueBooster?: ValueBooster$1;
|
|
733
|
+
} | {
|
|
734
|
+
numericBooster?: NumericBooster$1;
|
|
735
|
+
} | {
|
|
736
|
+
dateBooster?: DateBooster$1;
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* Boost records with a particular value for a column.
|
|
740
|
+
*/
|
|
741
|
+
declare type ValueBooster$1 = {
|
|
742
|
+
/**
|
|
743
|
+
* The column in which to look for the value.
|
|
744
|
+
*/
|
|
745
|
+
column: string;
|
|
746
|
+
/**
|
|
747
|
+
* The exact value to boost.
|
|
748
|
+
*/
|
|
749
|
+
value: string | number | boolean;
|
|
750
|
+
/**
|
|
751
|
+
* The factor with which to multiply the score of the record.
|
|
752
|
+
*/
|
|
753
|
+
factor: number;
|
|
754
|
+
};
|
|
755
|
+
/**
|
|
756
|
+
* Boost records based on the value of a numeric column.
|
|
757
|
+
*/
|
|
758
|
+
declare type NumericBooster$1 = {
|
|
759
|
+
/**
|
|
760
|
+
* The column in which to look for the value.
|
|
761
|
+
*/
|
|
762
|
+
column: string;
|
|
763
|
+
/**
|
|
764
|
+
* The factor with which to multiply the value of the column before adding it to the item score.
|
|
765
|
+
*/
|
|
766
|
+
factor: number;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
|
|
770
|
+
* the more the score is decayed. The decay function uses an exponential function. For example if origin is "now", and scale is 10 days and decay is 0.5, it
|
|
771
|
+
* should be interpreted as: a record with a date 10 days before/after origin will score 2 times less than a record with the date at origin.
|
|
772
|
+
*/
|
|
773
|
+
declare type DateBooster$1 = {
|
|
774
|
+
/**
|
|
775
|
+
* The column in which to look for the value.
|
|
776
|
+
*/
|
|
777
|
+
column: string;
|
|
778
|
+
/**
|
|
779
|
+
* The datetime (formatted as RFC3339) from where to apply the score decay function. The maximum boost will be applied for records with values at this time.
|
|
780
|
+
* If it is not specified, the current date and time is used.
|
|
781
|
+
*/
|
|
782
|
+
origin?: string;
|
|
783
|
+
/**
|
|
784
|
+
* The duration at which distance from origin the score is decayed with factor, using an exponential function. It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
|
|
785
|
+
*
|
|
786
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
|
787
|
+
*/
|
|
788
|
+
scale: string;
|
|
789
|
+
/**
|
|
790
|
+
* The decay factor to expect at "scale" distance from the "origin".
|
|
791
|
+
*/
|
|
792
|
+
decay: number;
|
|
322
793
|
};
|
|
323
794
|
declare type FilterList = FilterExpression | FilterExpression[];
|
|
324
795
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
|
@@ -369,14 +840,73 @@ declare type FilterValue = number | string | boolean;
|
|
|
369
840
|
* Pagination settings.
|
|
370
841
|
*/
|
|
371
842
|
declare type PageConfig = {
|
|
843
|
+
/**
|
|
844
|
+
* Query the next page that follow the cursor.
|
|
845
|
+
*/
|
|
372
846
|
after?: string;
|
|
847
|
+
/**
|
|
848
|
+
* Query the previous page before the cursor.
|
|
849
|
+
*/
|
|
373
850
|
before?: string;
|
|
851
|
+
/**
|
|
852
|
+
* Query the first page from the cursor.
|
|
853
|
+
*/
|
|
374
854
|
first?: string;
|
|
855
|
+
/**
|
|
856
|
+
* Query the last page from the cursor.
|
|
857
|
+
*/
|
|
375
858
|
last?: string;
|
|
859
|
+
/**
|
|
860
|
+
* Set page size. If the size is missing it is read from the cursor. If no cursor is given xata will choose the default page size.
|
|
861
|
+
*
|
|
862
|
+
* @default 20
|
|
863
|
+
*/
|
|
376
864
|
size?: number;
|
|
865
|
+
/**
|
|
866
|
+
* Use offset to skip entries. To skip pages set offset to a multiple of size.
|
|
867
|
+
*
|
|
868
|
+
* @default 0
|
|
869
|
+
*/
|
|
377
870
|
offset?: number;
|
|
378
871
|
};
|
|
379
|
-
|
|
872
|
+
/**
|
|
873
|
+
* @example name
|
|
874
|
+
* @example email
|
|
875
|
+
* @example created_at
|
|
876
|
+
*/
|
|
877
|
+
declare type ColumnsProjection = string[];
|
|
878
|
+
/**
|
|
879
|
+
* Xata Table Record Metadata
|
|
880
|
+
*/
|
|
881
|
+
declare type RecordMeta = {
|
|
882
|
+
id: RecordID;
|
|
883
|
+
xata: {
|
|
884
|
+
/**
|
|
885
|
+
* The record's version. Can be used for optimistic concurrency control.
|
|
886
|
+
*/
|
|
887
|
+
version: number;
|
|
888
|
+
/**
|
|
889
|
+
* The record's table name. APIs that return records from multiple tables will set this field accordingly.
|
|
890
|
+
*/
|
|
891
|
+
table?: string;
|
|
892
|
+
/**
|
|
893
|
+
* Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
|
|
894
|
+
*/
|
|
895
|
+
highlight?: {
|
|
896
|
+
[key: string]: string[] | {
|
|
897
|
+
[key: string]: any;
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
/**
|
|
901
|
+
* The record's relevancy score. This is returned by the search APIs.
|
|
902
|
+
*/
|
|
903
|
+
score?: number;
|
|
904
|
+
/**
|
|
905
|
+
* Encoding/Decoding errors
|
|
906
|
+
*/
|
|
907
|
+
warnings?: string[];
|
|
908
|
+
};
|
|
909
|
+
};
|
|
380
910
|
/**
|
|
381
911
|
* @pattern [a-zA-Z0-9_-~:]+
|
|
382
912
|
*/
|
|
@@ -385,7 +915,13 @@ declare type RecordID = string;
|
|
|
385
915
|
* @example {"newName":"newName","oldName":"oldName"}
|
|
386
916
|
*/
|
|
387
917
|
declare type TableRename = {
|
|
918
|
+
/**
|
|
919
|
+
* @minLength 1
|
|
920
|
+
*/
|
|
388
921
|
newName: string;
|
|
922
|
+
/**
|
|
923
|
+
* @minLength 1
|
|
924
|
+
*/
|
|
389
925
|
oldName: string;
|
|
390
926
|
};
|
|
391
927
|
/**
|
|
@@ -393,27 +929,28 @@ declare type TableRename = {
|
|
|
393
929
|
*/
|
|
394
930
|
declare type RecordsMetadata = {
|
|
395
931
|
page: {
|
|
932
|
+
/**
|
|
933
|
+
* last record id
|
|
934
|
+
*/
|
|
396
935
|
cursor: string;
|
|
936
|
+
/**
|
|
937
|
+
* true if more records can be fetch
|
|
938
|
+
*/
|
|
397
939
|
more: boolean;
|
|
398
940
|
};
|
|
399
941
|
};
|
|
942
|
+
declare type AggResponse$1 = number | {
|
|
943
|
+
values: ({
|
|
944
|
+
$key: string | number;
|
|
945
|
+
$count: number;
|
|
946
|
+
} & {
|
|
947
|
+
[key: string]: AggResponse$1;
|
|
948
|
+
})[];
|
|
949
|
+
};
|
|
400
950
|
/**
|
|
401
|
-
* Xata Table Record
|
|
951
|
+
* Xata Table Record Metadata
|
|
402
952
|
*/
|
|
403
|
-
declare type XataRecord$1 = {
|
|
404
|
-
id: RecordID;
|
|
405
|
-
xata: {
|
|
406
|
-
version: number;
|
|
407
|
-
table?: string;
|
|
408
|
-
highlight?: {
|
|
409
|
-
[key: string]: string[] | {
|
|
410
|
-
[key: string]: any;
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
score?: number;
|
|
414
|
-
warnings?: string[];
|
|
415
|
-
};
|
|
416
|
-
} & {
|
|
953
|
+
declare type XataRecord$1 = RecordMeta & {
|
|
417
954
|
[key: string]: any;
|
|
418
955
|
};
|
|
419
956
|
|
|
@@ -431,6 +968,7 @@ type schemas_InviteID = InviteID;
|
|
|
431
968
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
|
432
969
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
|
433
970
|
type schemas_InviteKey = InviteKey;
|
|
971
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
|
434
972
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
|
435
973
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
|
436
974
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
|
@@ -439,7 +977,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
|
439
977
|
type schemas_DBBranch = DBBranch;
|
|
440
978
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
|
441
979
|
type schemas_Schema = Schema;
|
|
980
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
|
442
981
|
type schemas_Table = Table;
|
|
982
|
+
type schemas_TableEdit = TableEdit;
|
|
443
983
|
type schemas_Column = Column;
|
|
444
984
|
type schemas_RevLink = RevLink;
|
|
445
985
|
type schemas_BranchName = BranchName;
|
|
@@ -452,11 +992,37 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
|
452
992
|
type schemas_BranchMigration = BranchMigration;
|
|
453
993
|
type schemas_TableMigration = TableMigration;
|
|
454
994
|
type schemas_ColumnMigration = ColumnMigration;
|
|
995
|
+
type schemas_Commit = Commit;
|
|
996
|
+
type schemas_Migration = Migration;
|
|
997
|
+
type schemas_MigrationOp = MigrationOp;
|
|
998
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
|
999
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
|
1000
|
+
type schemas_TableOpAdd = TableOpAdd;
|
|
1001
|
+
type schemas_TableOpRemove = TableOpRemove;
|
|
1002
|
+
type schemas_TableOpRename = TableOpRename;
|
|
1003
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
|
1004
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
|
1005
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
|
1006
|
+
type schemas_MigrationRequest = MigrationRequest;
|
|
455
1007
|
type schemas_SortExpression = SortExpression;
|
|
456
1008
|
type schemas_SortOrder = SortOrder;
|
|
457
1009
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
|
458
1010
|
type schemas_PrefixExpression = PrefixExpression;
|
|
1011
|
+
type schemas_TargetExpression = TargetExpression;
|
|
459
1012
|
type schemas_FilterExpression = FilterExpression;
|
|
1013
|
+
type schemas_SummaryExpressionList = SummaryExpressionList;
|
|
1014
|
+
type schemas_SummaryExpression = SummaryExpression;
|
|
1015
|
+
type schemas_AggExpressionMap = AggExpressionMap;
|
|
1016
|
+
type schemas_AggExpression = AggExpression;
|
|
1017
|
+
type schemas_CountAgg = CountAgg;
|
|
1018
|
+
type schemas_SumAgg = SumAgg;
|
|
1019
|
+
type schemas_MaxAgg = MaxAgg;
|
|
1020
|
+
type schemas_MinAgg = MinAgg;
|
|
1021
|
+
type schemas_AverageAgg = AverageAgg;
|
|
1022
|
+
type schemas_UniqueCountAgg = UniqueCountAgg;
|
|
1023
|
+
type schemas_DateHistogramAgg = DateHistogramAgg;
|
|
1024
|
+
type schemas_TopValuesAgg = TopValuesAgg;
|
|
1025
|
+
type schemas_NumericHistogramAgg = NumericHistogramAgg;
|
|
460
1026
|
type schemas_HighlightExpression = HighlightExpression;
|
|
461
1027
|
type schemas_BoosterExpression = BoosterExpression;
|
|
462
1028
|
type schemas_FilterList = FilterList;
|
|
@@ -468,7 +1034,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
|
468
1034
|
type schemas_FilterRangeValue = FilterRangeValue;
|
|
469
1035
|
type schemas_FilterValue = FilterValue;
|
|
470
1036
|
type schemas_PageConfig = PageConfig;
|
|
471
|
-
type
|
|
1037
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
|
1038
|
+
type schemas_RecordMeta = RecordMeta;
|
|
472
1039
|
type schemas_RecordID = RecordID;
|
|
473
1040
|
type schemas_TableRename = TableRename;
|
|
474
1041
|
type schemas_RecordsMetadata = RecordsMetadata;
|
|
@@ -488,6 +1055,7 @@ declare namespace schemas {
|
|
|
488
1055
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
|
489
1056
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
|
490
1057
|
schemas_InviteKey as InviteKey,
|
|
1058
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
|
491
1059
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
|
492
1060
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
|
493
1061
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
|
@@ -496,7 +1064,9 @@ declare namespace schemas {
|
|
|
496
1064
|
schemas_DBBranch as DBBranch,
|
|
497
1065
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
|
498
1066
|
schemas_Schema as Schema,
|
|
1067
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
|
499
1068
|
schemas_Table as Table,
|
|
1069
|
+
schemas_TableEdit as TableEdit,
|
|
500
1070
|
schemas_Column as Column,
|
|
501
1071
|
schemas_RevLink as RevLink,
|
|
502
1072
|
schemas_BranchName as BranchName,
|
|
@@ -509,13 +1079,42 @@ declare namespace schemas {
|
|
|
509
1079
|
schemas_BranchMigration as BranchMigration,
|
|
510
1080
|
schemas_TableMigration as TableMigration,
|
|
511
1081
|
schemas_ColumnMigration as ColumnMigration,
|
|
1082
|
+
schemas_Commit as Commit,
|
|
1083
|
+
schemas_Migration as Migration,
|
|
1084
|
+
schemas_MigrationOp as MigrationOp,
|
|
1085
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
|
1086
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
|
1087
|
+
schemas_TableOpAdd as TableOpAdd,
|
|
1088
|
+
schemas_TableOpRemove as TableOpRemove,
|
|
1089
|
+
schemas_TableOpRename as TableOpRename,
|
|
1090
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
|
1091
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
|
1092
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
|
1093
|
+
schemas_MigrationRequest as MigrationRequest,
|
|
512
1094
|
schemas_SortExpression as SortExpression,
|
|
513
1095
|
schemas_SortOrder as SortOrder,
|
|
514
1096
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
|
515
1097
|
schemas_PrefixExpression as PrefixExpression,
|
|
1098
|
+
schemas_TargetExpression as TargetExpression,
|
|
516
1099
|
schemas_FilterExpression as FilterExpression,
|
|
1100
|
+
schemas_SummaryExpressionList as SummaryExpressionList,
|
|
1101
|
+
schemas_SummaryExpression as SummaryExpression,
|
|
1102
|
+
schemas_AggExpressionMap as AggExpressionMap,
|
|
1103
|
+
schemas_AggExpression as AggExpression,
|
|
1104
|
+
schemas_CountAgg as CountAgg,
|
|
1105
|
+
schemas_SumAgg as SumAgg,
|
|
1106
|
+
schemas_MaxAgg as MaxAgg,
|
|
1107
|
+
schemas_MinAgg as MinAgg,
|
|
1108
|
+
schemas_AverageAgg as AverageAgg,
|
|
1109
|
+
schemas_UniqueCountAgg as UniqueCountAgg,
|
|
1110
|
+
schemas_DateHistogramAgg as DateHistogramAgg,
|
|
1111
|
+
schemas_TopValuesAgg as TopValuesAgg,
|
|
1112
|
+
schemas_NumericHistogramAgg as NumericHistogramAgg,
|
|
517
1113
|
schemas_HighlightExpression as HighlightExpression,
|
|
518
1114
|
schemas_BoosterExpression as BoosterExpression,
|
|
1115
|
+
ValueBooster$1 as ValueBooster,
|
|
1116
|
+
NumericBooster$1 as NumericBooster,
|
|
1117
|
+
DateBooster$1 as DateBooster,
|
|
519
1118
|
schemas_FilterList as FilterList,
|
|
520
1119
|
schemas_FilterColumn as FilterColumn,
|
|
521
1120
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
|
@@ -525,10 +1124,12 @@ declare namespace schemas {
|
|
|
525
1124
|
schemas_FilterRangeValue as FilterRangeValue,
|
|
526
1125
|
schemas_FilterValue as FilterValue,
|
|
527
1126
|
schemas_PageConfig as PageConfig,
|
|
528
|
-
|
|
1127
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
|
1128
|
+
schemas_RecordMeta as RecordMeta,
|
|
529
1129
|
schemas_RecordID as RecordID,
|
|
530
1130
|
schemas_TableRename as TableRename,
|
|
531
1131
|
schemas_RecordsMetadata as RecordsMetadata,
|
|
1132
|
+
AggResponse$1 as AggResponse,
|
|
532
1133
|
XataRecord$1 as XataRecord,
|
|
533
1134
|
};
|
|
534
1135
|
}
|
|
@@ -560,11 +1161,22 @@ declare type BulkError = {
|
|
|
560
1161
|
status?: number;
|
|
561
1162
|
}[];
|
|
562
1163
|
};
|
|
1164
|
+
declare type BulkInsertResponse = {
|
|
1165
|
+
recordIDs: string[];
|
|
1166
|
+
} | {
|
|
1167
|
+
records: XataRecord$1[];
|
|
1168
|
+
};
|
|
563
1169
|
declare type BranchMigrationPlan = {
|
|
564
1170
|
version: number;
|
|
565
1171
|
migration: BranchMigration;
|
|
566
1172
|
};
|
|
567
|
-
declare type
|
|
1173
|
+
declare type RecordResponse = XataRecord$1;
|
|
1174
|
+
declare type SchemaCompareResponse = {
|
|
1175
|
+
source: Schema;
|
|
1176
|
+
target: Schema;
|
|
1177
|
+
edits: SchemaEditScript;
|
|
1178
|
+
};
|
|
1179
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
|
568
1180
|
id: string;
|
|
569
1181
|
xata: {
|
|
570
1182
|
version: number;
|
|
@@ -574,13 +1186,28 @@ declare type QueryResponse = {
|
|
|
574
1186
|
records: XataRecord$1[];
|
|
575
1187
|
meta: RecordsMetadata;
|
|
576
1188
|
};
|
|
1189
|
+
declare type SummarizeResponse = {
|
|
1190
|
+
summaries: Record<string, any>[];
|
|
1191
|
+
};
|
|
1192
|
+
/**
|
|
1193
|
+
* @example {"aggs":{"dailyUniqueUsers":{"values":[{"key":"2022-02-22T22:22:22","uniqueUsers":134},{"key":"2022-02-23T22:22:22","uniqueUsers":90}]}}}
|
|
1194
|
+
*/
|
|
1195
|
+
declare type AggResponse = {
|
|
1196
|
+
aggs?: {
|
|
1197
|
+
[key: string]: AggResponse$1;
|
|
1198
|
+
};
|
|
1199
|
+
};
|
|
577
1200
|
declare type SearchResponse = {
|
|
578
1201
|
records: XataRecord$1[];
|
|
1202
|
+
warning?: string;
|
|
579
1203
|
};
|
|
580
1204
|
/**
|
|
581
1205
|
* @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
|
|
582
1206
|
*/
|
|
583
1207
|
declare type MigrationIdResponse = {
|
|
1208
|
+
/**
|
|
1209
|
+
* @minLength 1
|
|
1210
|
+
*/
|
|
584
1211
|
migrationID: string;
|
|
585
1212
|
};
|
|
586
1213
|
|
|
@@ -588,9 +1215,14 @@ type responses_SimpleError = SimpleError;
|
|
|
588
1215
|
type responses_BadRequestError = BadRequestError;
|
|
589
1216
|
type responses_AuthError = AuthError;
|
|
590
1217
|
type responses_BulkError = BulkError;
|
|
1218
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
|
591
1219
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
|
1220
|
+
type responses_RecordResponse = RecordResponse;
|
|
1221
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
|
592
1222
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
|
593
1223
|
type responses_QueryResponse = QueryResponse;
|
|
1224
|
+
type responses_SummarizeResponse = SummarizeResponse;
|
|
1225
|
+
type responses_AggResponse = AggResponse;
|
|
594
1226
|
type responses_SearchResponse = SearchResponse;
|
|
595
1227
|
type responses_MigrationIdResponse = MigrationIdResponse;
|
|
596
1228
|
declare namespace responses {
|
|
@@ -599,9 +1231,14 @@ declare namespace responses {
|
|
|
599
1231
|
responses_BadRequestError as BadRequestError,
|
|
600
1232
|
responses_AuthError as AuthError,
|
|
601
1233
|
responses_BulkError as BulkError,
|
|
1234
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
|
602
1235
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
|
1236
|
+
responses_RecordResponse as RecordResponse,
|
|
1237
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
|
603
1238
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
|
604
1239
|
responses_QueryResponse as QueryResponse,
|
|
1240
|
+
responses_SummarizeResponse as SummarizeResponse,
|
|
1241
|
+
responses_AggResponse as AggResponse,
|
|
605
1242
|
responses_SearchResponse as SearchResponse,
|
|
606
1243
|
responses_MigrationIdResponse as MigrationIdResponse,
|
|
607
1244
|
};
|
|
@@ -627,7 +1264,7 @@ declare type GetUserVariables = FetcherExtraProps;
|
|
|
627
1264
|
/**
|
|
628
1265
|
* Return details of the user making the request
|
|
629
1266
|
*/
|
|
630
|
-
declare const getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
|
1267
|
+
declare const getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
|
631
1268
|
declare type UpdateUserError = ErrorWrapper<{
|
|
632
1269
|
status: 400;
|
|
633
1270
|
payload: BadRequestError;
|
|
@@ -644,7 +1281,7 @@ declare type UpdateUserVariables = {
|
|
|
644
1281
|
/**
|
|
645
1282
|
* Update user info
|
|
646
1283
|
*/
|
|
647
|
-
declare const updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
|
|
1284
|
+
declare const updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
|
648
1285
|
declare type DeleteUserError = ErrorWrapper<{
|
|
649
1286
|
status: 400;
|
|
650
1287
|
payload: BadRequestError;
|
|
@@ -659,7 +1296,7 @@ declare type DeleteUserVariables = FetcherExtraProps;
|
|
|
659
1296
|
/**
|
|
660
1297
|
* Delete the user making the request
|
|
661
1298
|
*/
|
|
662
|
-
declare const deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
|
|
1299
|
+
declare const deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
663
1300
|
declare type GetUserAPIKeysError = ErrorWrapper<{
|
|
664
1301
|
status: 400;
|
|
665
1302
|
payload: BadRequestError;
|
|
@@ -680,8 +1317,11 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
|
|
|
680
1317
|
/**
|
|
681
1318
|
* Retrieve a list of existing user API keys
|
|
682
1319
|
*/
|
|
683
|
-
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
|
|
1320
|
+
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
|
|
684
1321
|
declare type CreateUserAPIKeyPathParams = {
|
|
1322
|
+
/**
|
|
1323
|
+
* API Key name
|
|
1324
|
+
*/
|
|
685
1325
|
keyName: APIKeyName;
|
|
686
1326
|
};
|
|
687
1327
|
declare type CreateUserAPIKeyError = ErrorWrapper<{
|
|
@@ -705,8 +1345,11 @@ declare type CreateUserAPIKeyVariables = {
|
|
|
705
1345
|
/**
|
|
706
1346
|
* Create and return new API key
|
|
707
1347
|
*/
|
|
708
|
-
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
|
|
1348
|
+
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
|
|
709
1349
|
declare type DeleteUserAPIKeyPathParams = {
|
|
1350
|
+
/**
|
|
1351
|
+
* API Key name
|
|
1352
|
+
*/
|
|
710
1353
|
keyName: APIKeyName;
|
|
711
1354
|
};
|
|
712
1355
|
declare type DeleteUserAPIKeyError = ErrorWrapper<{
|
|
@@ -725,7 +1368,7 @@ declare type DeleteUserAPIKeyVariables = {
|
|
|
725
1368
|
/**
|
|
726
1369
|
* Delete an existing API key
|
|
727
1370
|
*/
|
|
728
|
-
declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
|
|
1371
|
+
declare const deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
729
1372
|
declare type CreateWorkspaceError = ErrorWrapper<{
|
|
730
1373
|
status: 400;
|
|
731
1374
|
payload: BadRequestError;
|
|
@@ -742,7 +1385,7 @@ declare type CreateWorkspaceVariables = {
|
|
|
742
1385
|
/**
|
|
743
1386
|
* Creates a new workspace with the user requesting it as its single owner.
|
|
744
1387
|
*/
|
|
745
|
-
declare const createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
|
|
1388
|
+
declare const createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
|
746
1389
|
declare type GetWorkspacesListError = ErrorWrapper<{
|
|
747
1390
|
status: 400;
|
|
748
1391
|
payload: BadRequestError;
|
|
@@ -765,8 +1408,11 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
|
|
|
765
1408
|
/**
|
|
766
1409
|
* Retrieve the list of workspaces the user belongs to
|
|
767
1410
|
*/
|
|
768
|
-
declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
|
|
1411
|
+
declare const getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
|
|
769
1412
|
declare type GetWorkspacePathParams = {
|
|
1413
|
+
/**
|
|
1414
|
+
* Workspace ID
|
|
1415
|
+
*/
|
|
770
1416
|
workspaceId: WorkspaceID;
|
|
771
1417
|
};
|
|
772
1418
|
declare type GetWorkspaceError = ErrorWrapper<{
|
|
@@ -785,8 +1431,11 @@ declare type GetWorkspaceVariables = {
|
|
|
785
1431
|
/**
|
|
786
1432
|
* Retrieve workspace info from a workspace ID
|
|
787
1433
|
*/
|
|
788
|
-
declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
|
|
1434
|
+
declare const getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
|
789
1435
|
declare type UpdateWorkspacePathParams = {
|
|
1436
|
+
/**
|
|
1437
|
+
* Workspace ID
|
|
1438
|
+
*/
|
|
790
1439
|
workspaceId: WorkspaceID;
|
|
791
1440
|
};
|
|
792
1441
|
declare type UpdateWorkspaceError = ErrorWrapper<{
|
|
@@ -806,8 +1455,11 @@ declare type UpdateWorkspaceVariables = {
|
|
|
806
1455
|
/**
|
|
807
1456
|
* Update workspace info
|
|
808
1457
|
*/
|
|
809
|
-
declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
|
|
1458
|
+
declare const updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
|
810
1459
|
declare type DeleteWorkspacePathParams = {
|
|
1460
|
+
/**
|
|
1461
|
+
* Workspace ID
|
|
1462
|
+
*/
|
|
811
1463
|
workspaceId: WorkspaceID;
|
|
812
1464
|
};
|
|
813
1465
|
declare type DeleteWorkspaceError = ErrorWrapper<{
|
|
@@ -826,8 +1478,11 @@ declare type DeleteWorkspaceVariables = {
|
|
|
826
1478
|
/**
|
|
827
1479
|
* Delete the workspace with the provided ID
|
|
828
1480
|
*/
|
|
829
|
-
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
|
|
1481
|
+
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
830
1482
|
declare type GetWorkspaceMembersListPathParams = {
|
|
1483
|
+
/**
|
|
1484
|
+
* Workspace ID
|
|
1485
|
+
*/
|
|
831
1486
|
workspaceId: WorkspaceID;
|
|
832
1487
|
};
|
|
833
1488
|
declare type GetWorkspaceMembersListError = ErrorWrapper<{
|
|
@@ -846,9 +1501,15 @@ declare type GetWorkspaceMembersListVariables = {
|
|
|
846
1501
|
/**
|
|
847
1502
|
* Retrieve the list of members of the given workspace
|
|
848
1503
|
*/
|
|
849
|
-
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
|
|
1504
|
+
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
|
|
850
1505
|
declare type UpdateWorkspaceMemberRolePathParams = {
|
|
1506
|
+
/**
|
|
1507
|
+
* Workspace ID
|
|
1508
|
+
*/
|
|
851
1509
|
workspaceId: WorkspaceID;
|
|
1510
|
+
/**
|
|
1511
|
+
* UserID
|
|
1512
|
+
*/
|
|
852
1513
|
userId: UserID;
|
|
853
1514
|
};
|
|
854
1515
|
declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
|
|
@@ -871,9 +1532,15 @@ declare type UpdateWorkspaceMemberRoleVariables = {
|
|
|
871
1532
|
/**
|
|
872
1533
|
* 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.
|
|
873
1534
|
*/
|
|
874
|
-
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
|
1535
|
+
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
875
1536
|
declare type RemoveWorkspaceMemberPathParams = {
|
|
1537
|
+
/**
|
|
1538
|
+
* Workspace ID
|
|
1539
|
+
*/
|
|
876
1540
|
workspaceId: WorkspaceID;
|
|
1541
|
+
/**
|
|
1542
|
+
* UserID
|
|
1543
|
+
*/
|
|
877
1544
|
userId: UserID;
|
|
878
1545
|
};
|
|
879
1546
|
declare type RemoveWorkspaceMemberError = ErrorWrapper<{
|
|
@@ -892,8 +1559,11 @@ declare type RemoveWorkspaceMemberVariables = {
|
|
|
892
1559
|
/**
|
|
893
1560
|
* Remove the member from the workspace
|
|
894
1561
|
*/
|
|
895
|
-
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
|
1562
|
+
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
896
1563
|
declare type InviteWorkspaceMemberPathParams = {
|
|
1564
|
+
/**
|
|
1565
|
+
* Workspace ID
|
|
1566
|
+
*/
|
|
897
1567
|
workspaceId: WorkspaceID;
|
|
898
1568
|
};
|
|
899
1569
|
declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
@@ -905,8 +1575,14 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
|
905
1575
|
} | {
|
|
906
1576
|
status: 404;
|
|
907
1577
|
payload: SimpleError;
|
|
1578
|
+
} | {
|
|
1579
|
+
status: 409;
|
|
1580
|
+
payload: SimpleError;
|
|
908
1581
|
}>;
|
|
909
1582
|
declare type InviteWorkspaceMemberRequestBody = {
|
|
1583
|
+
/**
|
|
1584
|
+
* @format email
|
|
1585
|
+
*/
|
|
910
1586
|
email: string;
|
|
911
1587
|
role: Role;
|
|
912
1588
|
};
|
|
@@ -917,9 +1593,49 @@ declare type InviteWorkspaceMemberVariables = {
|
|
|
917
1593
|
/**
|
|
918
1594
|
* Invite some user to join the workspace with the given role
|
|
919
1595
|
*/
|
|
920
|
-
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
|
1596
|
+
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
|
1597
|
+
declare type UpdateWorkspaceMemberInvitePathParams = {
|
|
1598
|
+
/**
|
|
1599
|
+
* Workspace ID
|
|
1600
|
+
*/
|
|
1601
|
+
workspaceId: WorkspaceID;
|
|
1602
|
+
/**
|
|
1603
|
+
* Invite identifier
|
|
1604
|
+
*/
|
|
1605
|
+
inviteId: InviteID;
|
|
1606
|
+
};
|
|
1607
|
+
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
|
1608
|
+
status: 400;
|
|
1609
|
+
payload: BadRequestError;
|
|
1610
|
+
} | {
|
|
1611
|
+
status: 401;
|
|
1612
|
+
payload: AuthError;
|
|
1613
|
+
} | {
|
|
1614
|
+
status: 404;
|
|
1615
|
+
payload: SimpleError;
|
|
1616
|
+
} | {
|
|
1617
|
+
status: 422;
|
|
1618
|
+
payload: SimpleError;
|
|
1619
|
+
}>;
|
|
1620
|
+
declare type UpdateWorkspaceMemberInviteRequestBody = {
|
|
1621
|
+
role: Role;
|
|
1622
|
+
};
|
|
1623
|
+
declare type UpdateWorkspaceMemberInviteVariables = {
|
|
1624
|
+
body: UpdateWorkspaceMemberInviteRequestBody;
|
|
1625
|
+
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
|
1626
|
+
} & FetcherExtraProps;
|
|
1627
|
+
/**
|
|
1628
|
+
* 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.
|
|
1629
|
+
*/
|
|
1630
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
|
921
1631
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
|
1632
|
+
/**
|
|
1633
|
+
* Workspace ID
|
|
1634
|
+
*/
|
|
922
1635
|
workspaceId: WorkspaceID;
|
|
1636
|
+
/**
|
|
1637
|
+
* Invite identifier
|
|
1638
|
+
*/
|
|
923
1639
|
inviteId: InviteID;
|
|
924
1640
|
};
|
|
925
1641
|
declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
|
|
@@ -938,9 +1654,15 @@ declare type CancelWorkspaceMemberInviteVariables = {
|
|
|
938
1654
|
/**
|
|
939
1655
|
* This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
|
|
940
1656
|
*/
|
|
941
|
-
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
|
1657
|
+
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
942
1658
|
declare type ResendWorkspaceMemberInvitePathParams = {
|
|
1659
|
+
/**
|
|
1660
|
+
* Workspace ID
|
|
1661
|
+
*/
|
|
943
1662
|
workspaceId: WorkspaceID;
|
|
1663
|
+
/**
|
|
1664
|
+
* Invite identifier
|
|
1665
|
+
*/
|
|
944
1666
|
inviteId: InviteID;
|
|
945
1667
|
};
|
|
946
1668
|
declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
|
|
@@ -959,9 +1681,15 @@ declare type ResendWorkspaceMemberInviteVariables = {
|
|
|
959
1681
|
/**
|
|
960
1682
|
* This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
|
|
961
1683
|
*/
|
|
962
|
-
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
|
1684
|
+
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
963
1685
|
declare type AcceptWorkspaceMemberInvitePathParams = {
|
|
1686
|
+
/**
|
|
1687
|
+
* Workspace ID
|
|
1688
|
+
*/
|
|
964
1689
|
workspaceId: WorkspaceID;
|
|
1690
|
+
/**
|
|
1691
|
+
* Invite Key (secret) for the invited user
|
|
1692
|
+
*/
|
|
965
1693
|
inviteKey: InviteKey;
|
|
966
1694
|
};
|
|
967
1695
|
declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
|
|
@@ -980,7 +1708,7 @@ declare type AcceptWorkspaceMemberInviteVariables = {
|
|
|
980
1708
|
/**
|
|
981
1709
|
* Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
|
|
982
1710
|
*/
|
|
983
|
-
declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
|
1711
|
+
declare const acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
984
1712
|
declare type GetDatabaseListPathParams = {
|
|
985
1713
|
workspace: string;
|
|
986
1714
|
};
|
|
@@ -997,8 +1725,11 @@ declare type GetDatabaseListVariables = {
|
|
|
997
1725
|
/**
|
|
998
1726
|
* List all databases available in your Workspace.
|
|
999
1727
|
*/
|
|
1000
|
-
declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
|
1728
|
+
declare const getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
|
|
1001
1729
|
declare type GetBranchListPathParams = {
|
|
1730
|
+
/**
|
|
1731
|
+
* The Database Name
|
|
1732
|
+
*/
|
|
1002
1733
|
dbName: DBName;
|
|
1003
1734
|
workspace: string;
|
|
1004
1735
|
};
|
|
@@ -1018,8 +1749,11 @@ declare type GetBranchListVariables = {
|
|
|
1018
1749
|
/**
|
|
1019
1750
|
* List all available Branches
|
|
1020
1751
|
*/
|
|
1021
|
-
declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
|
1752
|
+
declare const getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
|
|
1022
1753
|
declare type CreateDatabasePathParams = {
|
|
1754
|
+
/**
|
|
1755
|
+
* The Database Name
|
|
1756
|
+
*/
|
|
1023
1757
|
dbName: DBName;
|
|
1024
1758
|
workspace: string;
|
|
1025
1759
|
};
|
|
@@ -1031,11 +1765,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
|
|
|
1031
1765
|
payload: AuthError;
|
|
1032
1766
|
}>;
|
|
1033
1767
|
declare type CreateDatabaseResponse = {
|
|
1768
|
+
/**
|
|
1769
|
+
* @minLength 1
|
|
1770
|
+
*/
|
|
1034
1771
|
databaseName: string;
|
|
1035
1772
|
branchName?: string;
|
|
1036
1773
|
};
|
|
1037
1774
|
declare type CreateDatabaseRequestBody = {
|
|
1038
|
-
|
|
1775
|
+
/**
|
|
1776
|
+
* @minLength 1
|
|
1777
|
+
*/
|
|
1039
1778
|
branchName?: string;
|
|
1040
1779
|
ui?: {
|
|
1041
1780
|
color?: string;
|
|
@@ -1049,8 +1788,11 @@ declare type CreateDatabaseVariables = {
|
|
|
1049
1788
|
/**
|
|
1050
1789
|
* Create Database with identifier name
|
|
1051
1790
|
*/
|
|
1052
|
-
declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
|
1791
|
+
declare const createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
|
|
1053
1792
|
declare type DeleteDatabasePathParams = {
|
|
1793
|
+
/**
|
|
1794
|
+
* The Database Name
|
|
1795
|
+
*/
|
|
1054
1796
|
dbName: DBName;
|
|
1055
1797
|
workspace: string;
|
|
1056
1798
|
};
|
|
@@ -1070,8 +1812,68 @@ declare type DeleteDatabaseVariables = {
|
|
|
1070
1812
|
/**
|
|
1071
1813
|
* Delete a database and all of its branches and tables permanently.
|
|
1072
1814
|
*/
|
|
1073
|
-
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
1815
|
+
declare const deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1816
|
+
declare type GetDatabaseMetadataPathParams = {
|
|
1817
|
+
/**
|
|
1818
|
+
* The Database Name
|
|
1819
|
+
*/
|
|
1820
|
+
dbName: DBName;
|
|
1821
|
+
workspace: string;
|
|
1822
|
+
};
|
|
1823
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
|
1824
|
+
status: 400;
|
|
1825
|
+
payload: BadRequestError;
|
|
1826
|
+
} | {
|
|
1827
|
+
status: 401;
|
|
1828
|
+
payload: AuthError;
|
|
1829
|
+
} | {
|
|
1830
|
+
status: 404;
|
|
1831
|
+
payload: SimpleError;
|
|
1832
|
+
}>;
|
|
1833
|
+
declare type GetDatabaseMetadataVariables = {
|
|
1834
|
+
pathParams: GetDatabaseMetadataPathParams;
|
|
1835
|
+
} & FetcherExtraProps;
|
|
1836
|
+
/**
|
|
1837
|
+
* Retrieve metadata of the given database
|
|
1838
|
+
*/
|
|
1839
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
|
1840
|
+
declare type UpdateDatabaseMetadataPathParams = {
|
|
1841
|
+
/**
|
|
1842
|
+
* The Database Name
|
|
1843
|
+
*/
|
|
1844
|
+
dbName: DBName;
|
|
1845
|
+
workspace: string;
|
|
1846
|
+
};
|
|
1847
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
|
1848
|
+
status: 400;
|
|
1849
|
+
payload: BadRequestError;
|
|
1850
|
+
} | {
|
|
1851
|
+
status: 401;
|
|
1852
|
+
payload: AuthError;
|
|
1853
|
+
} | {
|
|
1854
|
+
status: 404;
|
|
1855
|
+
payload: SimpleError;
|
|
1856
|
+
}>;
|
|
1857
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
|
1858
|
+
ui?: {
|
|
1859
|
+
/**
|
|
1860
|
+
* @minLength 1
|
|
1861
|
+
*/
|
|
1862
|
+
color?: string;
|
|
1863
|
+
};
|
|
1864
|
+
};
|
|
1865
|
+
declare type UpdateDatabaseMetadataVariables = {
|
|
1866
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
|
1867
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
|
1868
|
+
} & FetcherExtraProps;
|
|
1869
|
+
/**
|
|
1870
|
+
* Update the color of the selected database
|
|
1871
|
+
*/
|
|
1872
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
|
1074
1873
|
declare type GetGitBranchesMappingPathParams = {
|
|
1874
|
+
/**
|
|
1875
|
+
* The Database Name
|
|
1876
|
+
*/
|
|
1075
1877
|
dbName: DBName;
|
|
1076
1878
|
workspace: string;
|
|
1077
1879
|
};
|
|
@@ -1109,8 +1911,11 @@ declare type GetGitBranchesMappingVariables = {
|
|
|
1109
1911
|
* }
|
|
1110
1912
|
* ```
|
|
1111
1913
|
*/
|
|
1112
|
-
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
|
1914
|
+
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
|
|
1113
1915
|
declare type AddGitBranchesEntryPathParams = {
|
|
1916
|
+
/**
|
|
1917
|
+
* The Database Name
|
|
1918
|
+
*/
|
|
1114
1919
|
dbName: DBName;
|
|
1115
1920
|
workspace: string;
|
|
1116
1921
|
};
|
|
@@ -1122,10 +1927,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
|
|
|
1122
1927
|
payload: AuthError;
|
|
1123
1928
|
}>;
|
|
1124
1929
|
declare type AddGitBranchesEntryResponse = {
|
|
1930
|
+
/**
|
|
1931
|
+
* Warning message
|
|
1932
|
+
*/
|
|
1125
1933
|
warning?: string;
|
|
1126
1934
|
};
|
|
1127
1935
|
declare type AddGitBranchesEntryRequestBody = {
|
|
1936
|
+
/**
|
|
1937
|
+
* The name of the Git branch.
|
|
1938
|
+
*/
|
|
1128
1939
|
gitBranch: string;
|
|
1940
|
+
/**
|
|
1941
|
+
* The name of the Xata branch.
|
|
1942
|
+
*/
|
|
1129
1943
|
xataBranch: BranchName;
|
|
1130
1944
|
};
|
|
1131
1945
|
declare type AddGitBranchesEntryVariables = {
|
|
@@ -1147,88 +1961,381 @@ declare type AddGitBranchesEntryVariables = {
|
|
|
1147
1961
|
* }
|
|
1148
1962
|
* ```
|
|
1149
1963
|
*/
|
|
1150
|
-
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
|
1964
|
+
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
|
|
1151
1965
|
declare type RemoveGitBranchesEntryPathParams = {
|
|
1966
|
+
/**
|
|
1967
|
+
* The Database Name
|
|
1968
|
+
*/
|
|
1969
|
+
dbName: DBName;
|
|
1970
|
+
workspace: string;
|
|
1971
|
+
};
|
|
1972
|
+
declare type RemoveGitBranchesEntryQueryParams = {
|
|
1973
|
+
/**
|
|
1974
|
+
* The Git Branch to remove from the mapping
|
|
1975
|
+
*/
|
|
1976
|
+
gitBranch: string;
|
|
1977
|
+
};
|
|
1978
|
+
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
|
1979
|
+
status: 400;
|
|
1980
|
+
payload: BadRequestError;
|
|
1981
|
+
} | {
|
|
1982
|
+
status: 401;
|
|
1983
|
+
payload: AuthError;
|
|
1984
|
+
}>;
|
|
1985
|
+
declare type RemoveGitBranchesEntryVariables = {
|
|
1986
|
+
pathParams: RemoveGitBranchesEntryPathParams;
|
|
1987
|
+
queryParams: RemoveGitBranchesEntryQueryParams;
|
|
1988
|
+
} & FetcherExtraProps;
|
|
1989
|
+
/**
|
|
1990
|
+
* Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
|
|
1991
|
+
*
|
|
1992
|
+
* Example request:
|
|
1993
|
+
*
|
|
1994
|
+
* ```json
|
|
1995
|
+
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
|
1996
|
+
* ```
|
|
1997
|
+
*/
|
|
1998
|
+
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1999
|
+
declare type ResolveBranchPathParams = {
|
|
2000
|
+
/**
|
|
2001
|
+
* The Database Name
|
|
2002
|
+
*/
|
|
2003
|
+
dbName: DBName;
|
|
2004
|
+
workspace: string;
|
|
2005
|
+
};
|
|
2006
|
+
declare type ResolveBranchQueryParams = {
|
|
2007
|
+
/**
|
|
2008
|
+
* The Git Branch
|
|
2009
|
+
*/
|
|
2010
|
+
gitBranch?: string;
|
|
2011
|
+
/**
|
|
2012
|
+
* Default branch to fallback to
|
|
2013
|
+
*/
|
|
2014
|
+
fallbackBranch?: string;
|
|
2015
|
+
};
|
|
2016
|
+
declare type ResolveBranchError = ErrorWrapper<{
|
|
2017
|
+
status: 400;
|
|
2018
|
+
payload: BadRequestError;
|
|
2019
|
+
} | {
|
|
2020
|
+
status: 401;
|
|
2021
|
+
payload: AuthError;
|
|
2022
|
+
}>;
|
|
2023
|
+
declare type ResolveBranchResponse = {
|
|
2024
|
+
branch: string;
|
|
2025
|
+
reason: {
|
|
2026
|
+
code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
|
|
2027
|
+
message: string;
|
|
2028
|
+
};
|
|
2029
|
+
};
|
|
2030
|
+
declare type ResolveBranchVariables = {
|
|
2031
|
+
pathParams: ResolveBranchPathParams;
|
|
2032
|
+
queryParams?: ResolveBranchQueryParams;
|
|
2033
|
+
} & FetcherExtraProps;
|
|
2034
|
+
/**
|
|
2035
|
+
* In order to resolve the database branch, the following algorithm is used:
|
|
2036
|
+
* * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
|
|
2037
|
+
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
|
2038
|
+
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
|
2039
|
+
* * else, return the default branch of the DB (`main` or the first branch)
|
|
2040
|
+
*
|
|
2041
|
+
* Example call:
|
|
2042
|
+
*
|
|
2043
|
+
* ```json
|
|
2044
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
|
2045
|
+
* ```
|
|
2046
|
+
*
|
|
2047
|
+
* Example response:
|
|
2048
|
+
*
|
|
2049
|
+
* ```json
|
|
2050
|
+
* {
|
|
2051
|
+
* "branch": "main",
|
|
2052
|
+
* "reason": {
|
|
2053
|
+
* "code": "DEFAULT_BRANCH",
|
|
2054
|
+
* "message": "Default branch for this database (main)"
|
|
2055
|
+
* }
|
|
2056
|
+
* }
|
|
2057
|
+
* ```
|
|
2058
|
+
*/
|
|
2059
|
+
declare const resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
|
|
2060
|
+
declare type QueryMigrationRequestsPathParams = {
|
|
2061
|
+
/**
|
|
2062
|
+
* The Database Name
|
|
2063
|
+
*/
|
|
2064
|
+
dbName: DBName;
|
|
2065
|
+
workspace: string;
|
|
2066
|
+
};
|
|
2067
|
+
declare type QueryMigrationRequestsError = ErrorWrapper<{
|
|
2068
|
+
status: 400;
|
|
2069
|
+
payload: BadRequestError;
|
|
2070
|
+
} | {
|
|
2071
|
+
status: 401;
|
|
2072
|
+
payload: AuthError;
|
|
2073
|
+
} | {
|
|
2074
|
+
status: 404;
|
|
2075
|
+
payload: SimpleError;
|
|
2076
|
+
}>;
|
|
2077
|
+
declare type QueryMigrationRequestsResponse = {
|
|
2078
|
+
migrationRequests: MigrationRequest[];
|
|
2079
|
+
meta: RecordsMetadata;
|
|
2080
|
+
};
|
|
2081
|
+
declare type QueryMigrationRequestsRequestBody = {
|
|
2082
|
+
filter?: FilterExpression;
|
|
2083
|
+
sort?: SortExpression;
|
|
2084
|
+
page?: PageConfig;
|
|
2085
|
+
columns?: ColumnsProjection;
|
|
2086
|
+
};
|
|
2087
|
+
declare type QueryMigrationRequestsVariables = {
|
|
2088
|
+
body?: QueryMigrationRequestsRequestBody;
|
|
2089
|
+
pathParams: QueryMigrationRequestsPathParams;
|
|
2090
|
+
} & FetcherExtraProps;
|
|
2091
|
+
declare const queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
|
|
2092
|
+
declare type CreateMigrationRequestPathParams = {
|
|
2093
|
+
/**
|
|
2094
|
+
* The Database Name
|
|
2095
|
+
*/
|
|
2096
|
+
dbName: DBName;
|
|
2097
|
+
workspace: string;
|
|
2098
|
+
};
|
|
2099
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
|
2100
|
+
status: 400;
|
|
2101
|
+
payload: BadRequestError;
|
|
2102
|
+
} | {
|
|
2103
|
+
status: 401;
|
|
2104
|
+
payload: AuthError;
|
|
2105
|
+
} | {
|
|
2106
|
+
status: 404;
|
|
2107
|
+
payload: SimpleError;
|
|
2108
|
+
}>;
|
|
2109
|
+
declare type CreateMigrationRequestResponse = {
|
|
2110
|
+
number: number;
|
|
2111
|
+
};
|
|
2112
|
+
declare type CreateMigrationRequestRequestBody = {
|
|
2113
|
+
/**
|
|
2114
|
+
* The source branch.
|
|
2115
|
+
*/
|
|
2116
|
+
source: string;
|
|
2117
|
+
/**
|
|
2118
|
+
* The target branch.
|
|
2119
|
+
*/
|
|
2120
|
+
target: string;
|
|
2121
|
+
/**
|
|
2122
|
+
* The title.
|
|
2123
|
+
*/
|
|
2124
|
+
title: string;
|
|
2125
|
+
/**
|
|
2126
|
+
* Optional migration request description.
|
|
2127
|
+
*/
|
|
2128
|
+
body?: string;
|
|
2129
|
+
};
|
|
2130
|
+
declare type CreateMigrationRequestVariables = {
|
|
2131
|
+
body: CreateMigrationRequestRequestBody;
|
|
2132
|
+
pathParams: CreateMigrationRequestPathParams;
|
|
2133
|
+
} & FetcherExtraProps;
|
|
2134
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
|
|
2135
|
+
declare type GetMigrationRequestPathParams = {
|
|
2136
|
+
/**
|
|
2137
|
+
* The Database Name
|
|
2138
|
+
*/
|
|
2139
|
+
dbName: DBName;
|
|
2140
|
+
/**
|
|
2141
|
+
* The migration request number.
|
|
2142
|
+
*/
|
|
2143
|
+
mrNumber: number;
|
|
2144
|
+
workspace: string;
|
|
2145
|
+
};
|
|
2146
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
|
2147
|
+
status: 400;
|
|
2148
|
+
payload: BadRequestError;
|
|
2149
|
+
} | {
|
|
2150
|
+
status: 401;
|
|
2151
|
+
payload: AuthError;
|
|
2152
|
+
} | {
|
|
2153
|
+
status: 404;
|
|
2154
|
+
payload: SimpleError;
|
|
2155
|
+
}>;
|
|
2156
|
+
declare type GetMigrationRequestVariables = {
|
|
2157
|
+
pathParams: GetMigrationRequestPathParams;
|
|
2158
|
+
} & FetcherExtraProps;
|
|
2159
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
|
|
2160
|
+
declare type UpdateMigrationRequestPathParams = {
|
|
2161
|
+
/**
|
|
2162
|
+
* The Database Name
|
|
2163
|
+
*/
|
|
2164
|
+
dbName: DBName;
|
|
2165
|
+
/**
|
|
2166
|
+
* The migration request number.
|
|
2167
|
+
*/
|
|
2168
|
+
mrNumber: number;
|
|
2169
|
+
workspace: string;
|
|
2170
|
+
};
|
|
2171
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
|
2172
|
+
status: 400;
|
|
2173
|
+
payload: BadRequestError;
|
|
2174
|
+
} | {
|
|
2175
|
+
status: 401;
|
|
2176
|
+
payload: AuthError;
|
|
2177
|
+
} | {
|
|
2178
|
+
status: 404;
|
|
2179
|
+
payload: SimpleError;
|
|
2180
|
+
}>;
|
|
2181
|
+
declare type UpdateMigrationRequestRequestBody = {
|
|
2182
|
+
/**
|
|
2183
|
+
* New migration request title.
|
|
2184
|
+
*/
|
|
2185
|
+
title?: string;
|
|
2186
|
+
/**
|
|
2187
|
+
* New migration request description.
|
|
2188
|
+
*/
|
|
2189
|
+
body?: string;
|
|
2190
|
+
/**
|
|
2191
|
+
* Change the migration request status.
|
|
2192
|
+
*/
|
|
2193
|
+
status?: 'open' | 'closed';
|
|
2194
|
+
};
|
|
2195
|
+
declare type UpdateMigrationRequestVariables = {
|
|
2196
|
+
body?: UpdateMigrationRequestRequestBody;
|
|
2197
|
+
pathParams: UpdateMigrationRequestPathParams;
|
|
2198
|
+
} & FetcherExtraProps;
|
|
2199
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
2200
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
|
2201
|
+
/**
|
|
2202
|
+
* The Database Name
|
|
2203
|
+
*/
|
|
2204
|
+
dbName: DBName;
|
|
2205
|
+
/**
|
|
2206
|
+
* The migration request number.
|
|
2207
|
+
*/
|
|
2208
|
+
mrNumber: number;
|
|
2209
|
+
workspace: string;
|
|
2210
|
+
};
|
|
2211
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
|
2212
|
+
status: 400;
|
|
2213
|
+
payload: BadRequestError;
|
|
2214
|
+
} | {
|
|
2215
|
+
status: 401;
|
|
2216
|
+
payload: AuthError;
|
|
2217
|
+
} | {
|
|
2218
|
+
status: 404;
|
|
2219
|
+
payload: SimpleError;
|
|
2220
|
+
}>;
|
|
2221
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
|
2222
|
+
meta: {
|
|
2223
|
+
/**
|
|
2224
|
+
* last record id
|
|
2225
|
+
*/
|
|
2226
|
+
cursor: string;
|
|
2227
|
+
/**
|
|
2228
|
+
* true if more records can be fetch
|
|
2229
|
+
*/
|
|
2230
|
+
more: boolean;
|
|
2231
|
+
};
|
|
2232
|
+
logs: Commit[];
|
|
2233
|
+
};
|
|
2234
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
|
2235
|
+
page?: {
|
|
2236
|
+
/**
|
|
2237
|
+
* Query the next page that follow the cursor.
|
|
2238
|
+
*/
|
|
2239
|
+
after?: string;
|
|
2240
|
+
/**
|
|
2241
|
+
* Query the previous page before the cursor.
|
|
2242
|
+
*/
|
|
2243
|
+
before?: string;
|
|
2244
|
+
/**
|
|
2245
|
+
* 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.
|
|
2246
|
+
*
|
|
2247
|
+
* @default 20
|
|
2248
|
+
*/
|
|
2249
|
+
size?: number;
|
|
2250
|
+
};
|
|
2251
|
+
};
|
|
2252
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
|
2253
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
|
2254
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
|
2255
|
+
} & FetcherExtraProps;
|
|
2256
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
|
|
2257
|
+
declare type CompareMigrationRequestPathParams = {
|
|
2258
|
+
/**
|
|
2259
|
+
* The Database Name
|
|
2260
|
+
*/
|
|
2261
|
+
dbName: DBName;
|
|
2262
|
+
/**
|
|
2263
|
+
* The migration request number.
|
|
2264
|
+
*/
|
|
2265
|
+
mrNumber: number;
|
|
2266
|
+
workspace: string;
|
|
2267
|
+
};
|
|
2268
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
|
2269
|
+
status: 400;
|
|
2270
|
+
payload: BadRequestError;
|
|
2271
|
+
} | {
|
|
2272
|
+
status: 401;
|
|
2273
|
+
payload: AuthError;
|
|
2274
|
+
} | {
|
|
2275
|
+
status: 404;
|
|
2276
|
+
payload: SimpleError;
|
|
2277
|
+
}>;
|
|
2278
|
+
declare type CompareMigrationRequestVariables = {
|
|
2279
|
+
pathParams: CompareMigrationRequestPathParams;
|
|
2280
|
+
} & FetcherExtraProps;
|
|
2281
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
|
2282
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
|
2283
|
+
/**
|
|
2284
|
+
* The Database Name
|
|
2285
|
+
*/
|
|
1152
2286
|
dbName: DBName;
|
|
2287
|
+
/**
|
|
2288
|
+
* The migration request number.
|
|
2289
|
+
*/
|
|
2290
|
+
mrNumber: number;
|
|
1153
2291
|
workspace: string;
|
|
1154
2292
|
};
|
|
1155
|
-
declare type
|
|
1156
|
-
gitBranch: string;
|
|
1157
|
-
};
|
|
1158
|
-
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
|
2293
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
|
1159
2294
|
status: 400;
|
|
1160
2295
|
payload: BadRequestError;
|
|
1161
2296
|
} | {
|
|
1162
2297
|
status: 401;
|
|
1163
2298
|
payload: AuthError;
|
|
2299
|
+
} | {
|
|
2300
|
+
status: 404;
|
|
2301
|
+
payload: SimpleError;
|
|
1164
2302
|
}>;
|
|
1165
|
-
declare type
|
|
1166
|
-
|
|
1167
|
-
|
|
2303
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
|
2304
|
+
merged?: boolean;
|
|
2305
|
+
};
|
|
2306
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
|
2307
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
|
1168
2308
|
} & FetcherExtraProps;
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
* ```json
|
|
1175
|
-
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
|
1176
|
-
* ```
|
|
1177
|
-
*/
|
|
1178
|
-
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
|
1179
|
-
declare type ResolveBranchPathParams = {
|
|
2309
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
|
|
2310
|
+
declare type MergeMigrationRequestPathParams = {
|
|
2311
|
+
/**
|
|
2312
|
+
* The Database Name
|
|
2313
|
+
*/
|
|
1180
2314
|
dbName: DBName;
|
|
2315
|
+
/**
|
|
2316
|
+
* The migration request number.
|
|
2317
|
+
*/
|
|
2318
|
+
mrNumber: number;
|
|
1181
2319
|
workspace: string;
|
|
1182
2320
|
};
|
|
1183
|
-
declare type
|
|
1184
|
-
gitBranch?: string;
|
|
1185
|
-
fallbackBranch?: string;
|
|
1186
|
-
};
|
|
1187
|
-
declare type ResolveBranchError = ErrorWrapper<{
|
|
2321
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
|
1188
2322
|
status: 400;
|
|
1189
2323
|
payload: BadRequestError;
|
|
1190
2324
|
} | {
|
|
1191
2325
|
status: 401;
|
|
1192
2326
|
payload: AuthError;
|
|
2327
|
+
} | {
|
|
2328
|
+
status: 404;
|
|
2329
|
+
payload: SimpleError;
|
|
1193
2330
|
}>;
|
|
1194
|
-
declare type
|
|
1195
|
-
|
|
1196
|
-
reason: {
|
|
1197
|
-
code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
|
|
1198
|
-
message: string;
|
|
1199
|
-
};
|
|
1200
|
-
};
|
|
1201
|
-
declare type ResolveBranchVariables = {
|
|
1202
|
-
pathParams: ResolveBranchPathParams;
|
|
1203
|
-
queryParams?: ResolveBranchQueryParams;
|
|
2331
|
+
declare type MergeMigrationRequestVariables = {
|
|
2332
|
+
pathParams: MergeMigrationRequestPathParams;
|
|
1204
2333
|
} & FetcherExtraProps;
|
|
1205
|
-
|
|
1206
|
-
* In order to resolve the database branch, the following algorithm is used:
|
|
1207
|
-
* * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
|
|
1208
|
-
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
|
1209
|
-
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
|
1210
|
-
* * else, return the default branch of the DB (`main` or the first branch)
|
|
1211
|
-
*
|
|
1212
|
-
* Example call:
|
|
1213
|
-
*
|
|
1214
|
-
* ```json
|
|
1215
|
-
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
|
1216
|
-
* ```
|
|
1217
|
-
*
|
|
1218
|
-
* Example response:
|
|
1219
|
-
*
|
|
1220
|
-
* ```json
|
|
1221
|
-
* {
|
|
1222
|
-
* "branch": "main",
|
|
1223
|
-
* "reason": {
|
|
1224
|
-
* "code": "DEFAULT_BRANCH",
|
|
1225
|
-
* "message": "Default branch for this database (main)"
|
|
1226
|
-
* }
|
|
1227
|
-
* }
|
|
1228
|
-
* ```
|
|
1229
|
-
*/
|
|
1230
|
-
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
|
2334
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
|
|
1231
2335
|
declare type GetBranchDetailsPathParams = {
|
|
2336
|
+
/**
|
|
2337
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2338
|
+
*/
|
|
1232
2339
|
dbBranchName: DBBranchName;
|
|
1233
2340
|
workspace: string;
|
|
1234
2341
|
};
|
|
@@ -1245,12 +2352,18 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
|
1245
2352
|
declare type GetBranchDetailsVariables = {
|
|
1246
2353
|
pathParams: GetBranchDetailsPathParams;
|
|
1247
2354
|
} & FetcherExtraProps;
|
|
1248
|
-
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
|
2355
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
|
|
1249
2356
|
declare type CreateBranchPathParams = {
|
|
2357
|
+
/**
|
|
2358
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2359
|
+
*/
|
|
1250
2360
|
dbBranchName: DBBranchName;
|
|
1251
2361
|
workspace: string;
|
|
1252
2362
|
};
|
|
1253
2363
|
declare type CreateBranchQueryParams = {
|
|
2364
|
+
/**
|
|
2365
|
+
* Name of source branch to branch the new schema from
|
|
2366
|
+
*/
|
|
1254
2367
|
from?: string;
|
|
1255
2368
|
};
|
|
1256
2369
|
declare type CreateBranchError = ErrorWrapper<{
|
|
@@ -1263,7 +2376,17 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
|
1263
2376
|
status: 404;
|
|
1264
2377
|
payload: SimpleError;
|
|
1265
2378
|
}>;
|
|
2379
|
+
declare type CreateBranchResponse = {
|
|
2380
|
+
/**
|
|
2381
|
+
* @minLength 1
|
|
2382
|
+
*/
|
|
2383
|
+
databaseName: string;
|
|
2384
|
+
branchName: string;
|
|
2385
|
+
};
|
|
1266
2386
|
declare type CreateBranchRequestBody = {
|
|
2387
|
+
/**
|
|
2388
|
+
* Select the branch to fork from. Defaults to 'main'
|
|
2389
|
+
*/
|
|
1267
2390
|
from?: string;
|
|
1268
2391
|
metadata?: BranchMetadata;
|
|
1269
2392
|
};
|
|
@@ -1272,8 +2395,11 @@ declare type CreateBranchVariables = {
|
|
|
1272
2395
|
pathParams: CreateBranchPathParams;
|
|
1273
2396
|
queryParams?: CreateBranchQueryParams;
|
|
1274
2397
|
} & FetcherExtraProps;
|
|
1275
|
-
declare const createBranch: (variables: CreateBranchVariables) => Promise<
|
|
2398
|
+
declare const createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
|
|
1276
2399
|
declare type DeleteBranchPathParams = {
|
|
2400
|
+
/**
|
|
2401
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2402
|
+
*/
|
|
1277
2403
|
dbBranchName: DBBranchName;
|
|
1278
2404
|
workspace: string;
|
|
1279
2405
|
};
|
|
@@ -1293,8 +2419,11 @@ declare type DeleteBranchVariables = {
|
|
|
1293
2419
|
/**
|
|
1294
2420
|
* Delete the branch in the database and all its resources
|
|
1295
2421
|
*/
|
|
1296
|
-
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
|
2422
|
+
declare const deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1297
2423
|
declare type UpdateBranchMetadataPathParams = {
|
|
2424
|
+
/**
|
|
2425
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2426
|
+
*/
|
|
1298
2427
|
dbBranchName: DBBranchName;
|
|
1299
2428
|
workspace: string;
|
|
1300
2429
|
};
|
|
@@ -1315,8 +2444,11 @@ declare type UpdateBranchMetadataVariables = {
|
|
|
1315
2444
|
/**
|
|
1316
2445
|
* Update the branch metadata
|
|
1317
2446
|
*/
|
|
1318
|
-
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
|
2447
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1319
2448
|
declare type GetBranchMetadataPathParams = {
|
|
2449
|
+
/**
|
|
2450
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2451
|
+
*/
|
|
1320
2452
|
dbBranchName: DBBranchName;
|
|
1321
2453
|
workspace: string;
|
|
1322
2454
|
};
|
|
@@ -1333,8 +2465,11 @@ declare type GetBranchMetadataError = ErrorWrapper<{
|
|
|
1333
2465
|
declare type GetBranchMetadataVariables = {
|
|
1334
2466
|
pathParams: GetBranchMetadataPathParams;
|
|
1335
2467
|
} & FetcherExtraProps;
|
|
1336
|
-
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
|
2468
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
|
|
1337
2469
|
declare type GetBranchMigrationHistoryPathParams = {
|
|
2470
|
+
/**
|
|
2471
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2472
|
+
*/
|
|
1338
2473
|
dbBranchName: DBBranchName;
|
|
1339
2474
|
workspace: string;
|
|
1340
2475
|
};
|
|
@@ -1360,8 +2495,11 @@ declare type GetBranchMigrationHistoryVariables = {
|
|
|
1360
2495
|
body?: GetBranchMigrationHistoryRequestBody;
|
|
1361
2496
|
pathParams: GetBranchMigrationHistoryPathParams;
|
|
1362
2497
|
} & FetcherExtraProps;
|
|
1363
|
-
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
|
2498
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
|
|
1364
2499
|
declare type ExecuteBranchMigrationPlanPathParams = {
|
|
2500
|
+
/**
|
|
2501
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2502
|
+
*/
|
|
1365
2503
|
dbBranchName: DBBranchName;
|
|
1366
2504
|
workspace: string;
|
|
1367
2505
|
};
|
|
@@ -1386,8 +2524,11 @@ declare type ExecuteBranchMigrationPlanVariables = {
|
|
|
1386
2524
|
/**
|
|
1387
2525
|
* Apply a migration plan to the branch
|
|
1388
2526
|
*/
|
|
1389
|
-
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
|
2527
|
+
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1390
2528
|
declare type GetBranchMigrationPlanPathParams = {
|
|
2529
|
+
/**
|
|
2530
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2531
|
+
*/
|
|
1391
2532
|
dbBranchName: DBBranchName;
|
|
1392
2533
|
workspace: string;
|
|
1393
2534
|
};
|
|
@@ -1408,8 +2549,200 @@ declare type GetBranchMigrationPlanVariables = {
|
|
|
1408
2549
|
/**
|
|
1409
2550
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
|
1410
2551
|
*/
|
|
1411
|
-
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
|
2552
|
+
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
|
|
2553
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
|
2554
|
+
/**
|
|
2555
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2556
|
+
*/
|
|
2557
|
+
dbBranchName: DBBranchName;
|
|
2558
|
+
workspace: string;
|
|
2559
|
+
};
|
|
2560
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
|
2561
|
+
status: 400;
|
|
2562
|
+
payload: BadRequestError;
|
|
2563
|
+
} | {
|
|
2564
|
+
status: 401;
|
|
2565
|
+
payload: AuthError;
|
|
2566
|
+
} | {
|
|
2567
|
+
status: 404;
|
|
2568
|
+
payload: SimpleError;
|
|
2569
|
+
}>;
|
|
2570
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
|
2571
|
+
schema: Schema;
|
|
2572
|
+
};
|
|
2573
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
|
2574
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
|
2575
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
|
2576
|
+
} & FetcherExtraProps;
|
|
2577
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
|
2578
|
+
declare type CompareBranchSchemasPathParams = {
|
|
2579
|
+
/**
|
|
2580
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2581
|
+
*/
|
|
2582
|
+
dbBranchName: DBBranchName;
|
|
2583
|
+
/**
|
|
2584
|
+
* The Database Name
|
|
2585
|
+
*/
|
|
2586
|
+
branchName: BranchName;
|
|
2587
|
+
workspace: string;
|
|
2588
|
+
};
|
|
2589
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
|
2590
|
+
status: 400;
|
|
2591
|
+
payload: BadRequestError;
|
|
2592
|
+
} | {
|
|
2593
|
+
status: 401;
|
|
2594
|
+
payload: AuthError;
|
|
2595
|
+
} | {
|
|
2596
|
+
status: 404;
|
|
2597
|
+
payload: SimpleError;
|
|
2598
|
+
}>;
|
|
2599
|
+
declare type CompareBranchSchemasVariables = {
|
|
2600
|
+
body?: Record<string, any>;
|
|
2601
|
+
pathParams: CompareBranchSchemasPathParams;
|
|
2602
|
+
} & FetcherExtraProps;
|
|
2603
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
|
2604
|
+
declare type UpdateBranchSchemaPathParams = {
|
|
2605
|
+
/**
|
|
2606
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2607
|
+
*/
|
|
2608
|
+
dbBranchName: DBBranchName;
|
|
2609
|
+
workspace: string;
|
|
2610
|
+
};
|
|
2611
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
|
2612
|
+
status: 400;
|
|
2613
|
+
payload: BadRequestError;
|
|
2614
|
+
} | {
|
|
2615
|
+
status: 401;
|
|
2616
|
+
payload: AuthError;
|
|
2617
|
+
} | {
|
|
2618
|
+
status: 404;
|
|
2619
|
+
payload: SimpleError;
|
|
2620
|
+
}>;
|
|
2621
|
+
declare type UpdateBranchSchemaResponse = {
|
|
2622
|
+
id: string;
|
|
2623
|
+
parentID: string;
|
|
2624
|
+
};
|
|
2625
|
+
declare type UpdateBranchSchemaVariables = {
|
|
2626
|
+
body: Migration;
|
|
2627
|
+
pathParams: UpdateBranchSchemaPathParams;
|
|
2628
|
+
} & FetcherExtraProps;
|
|
2629
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
|
|
2630
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
|
2631
|
+
/**
|
|
2632
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2633
|
+
*/
|
|
2634
|
+
dbBranchName: DBBranchName;
|
|
2635
|
+
workspace: string;
|
|
2636
|
+
};
|
|
2637
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
|
2638
|
+
status: 400;
|
|
2639
|
+
payload: BadRequestError;
|
|
2640
|
+
} | {
|
|
2641
|
+
status: 401;
|
|
2642
|
+
payload: AuthError;
|
|
2643
|
+
} | {
|
|
2644
|
+
status: 404;
|
|
2645
|
+
payload: SimpleError;
|
|
2646
|
+
}>;
|
|
2647
|
+
declare type PreviewBranchSchemaEditResponse = {
|
|
2648
|
+
original: Schema;
|
|
2649
|
+
updated: Schema;
|
|
2650
|
+
};
|
|
2651
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
|
2652
|
+
edits?: SchemaEditScript;
|
|
2653
|
+
operations?: MigrationOp[];
|
|
2654
|
+
};
|
|
2655
|
+
declare type PreviewBranchSchemaEditVariables = {
|
|
2656
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
|
2657
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
|
2658
|
+
} & FetcherExtraProps;
|
|
2659
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
|
|
2660
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
|
2661
|
+
/**
|
|
2662
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2663
|
+
*/
|
|
2664
|
+
dbBranchName: DBBranchName;
|
|
2665
|
+
workspace: string;
|
|
2666
|
+
};
|
|
2667
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
|
2668
|
+
status: 400;
|
|
2669
|
+
payload: BadRequestError;
|
|
2670
|
+
} | {
|
|
2671
|
+
status: 401;
|
|
2672
|
+
payload: AuthError;
|
|
2673
|
+
} | {
|
|
2674
|
+
status: 404;
|
|
2675
|
+
payload: SimpleError;
|
|
2676
|
+
}>;
|
|
2677
|
+
declare type ApplyBranchSchemaEditResponse = {
|
|
2678
|
+
id: string;
|
|
2679
|
+
parentID: string;
|
|
2680
|
+
};
|
|
2681
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
|
2682
|
+
edits: SchemaEditScript;
|
|
2683
|
+
};
|
|
2684
|
+
declare type ApplyBranchSchemaEditVariables = {
|
|
2685
|
+
body: ApplyBranchSchemaEditRequestBody;
|
|
2686
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
|
2687
|
+
} & FetcherExtraProps;
|
|
2688
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
|
|
2689
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
|
2690
|
+
/**
|
|
2691
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2692
|
+
*/
|
|
2693
|
+
dbBranchName: DBBranchName;
|
|
2694
|
+
workspace: string;
|
|
2695
|
+
};
|
|
2696
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
|
2697
|
+
status: 400;
|
|
2698
|
+
payload: BadRequestError;
|
|
2699
|
+
} | {
|
|
2700
|
+
status: 401;
|
|
2701
|
+
payload: AuthError;
|
|
2702
|
+
} | {
|
|
2703
|
+
status: 404;
|
|
2704
|
+
payload: SimpleError;
|
|
2705
|
+
}>;
|
|
2706
|
+
declare type GetBranchSchemaHistoryResponse = {
|
|
2707
|
+
meta: {
|
|
2708
|
+
/**
|
|
2709
|
+
* last record id
|
|
2710
|
+
*/
|
|
2711
|
+
cursor: string;
|
|
2712
|
+
/**
|
|
2713
|
+
* true if more records can be fetch
|
|
2714
|
+
*/
|
|
2715
|
+
more: boolean;
|
|
2716
|
+
};
|
|
2717
|
+
logs: Commit[];
|
|
2718
|
+
};
|
|
2719
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
|
2720
|
+
page?: {
|
|
2721
|
+
/**
|
|
2722
|
+
* Query the next page that follow the cursor.
|
|
2723
|
+
*/
|
|
2724
|
+
after?: string;
|
|
2725
|
+
/**
|
|
2726
|
+
* Query the previous page before the cursor.
|
|
2727
|
+
*/
|
|
2728
|
+
before?: string;
|
|
2729
|
+
/**
|
|
2730
|
+
* 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.
|
|
2731
|
+
*
|
|
2732
|
+
* @default 20
|
|
2733
|
+
*/
|
|
2734
|
+
size?: number;
|
|
2735
|
+
};
|
|
2736
|
+
};
|
|
2737
|
+
declare type GetBranchSchemaHistoryVariables = {
|
|
2738
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
|
2739
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
|
2740
|
+
} & FetcherExtraProps;
|
|
2741
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
|
|
1412
2742
|
declare type GetBranchStatsPathParams = {
|
|
2743
|
+
/**
|
|
2744
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2745
|
+
*/
|
|
1413
2746
|
dbBranchName: DBBranchName;
|
|
1414
2747
|
workspace: string;
|
|
1415
2748
|
};
|
|
@@ -1440,9 +2773,15 @@ declare type GetBranchStatsVariables = {
|
|
|
1440
2773
|
/**
|
|
1441
2774
|
* Get branch usage metrics.
|
|
1442
2775
|
*/
|
|
1443
|
-
declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
|
2776
|
+
declare const getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
|
|
1444
2777
|
declare type CreateTablePathParams = {
|
|
2778
|
+
/**
|
|
2779
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2780
|
+
*/
|
|
1445
2781
|
dbBranchName: DBBranchName;
|
|
2782
|
+
/**
|
|
2783
|
+
* The Table name
|
|
2784
|
+
*/
|
|
1446
2785
|
tableName: TableName;
|
|
1447
2786
|
workspace: string;
|
|
1448
2787
|
};
|
|
@@ -1459,15 +2798,28 @@ declare type CreateTableError = ErrorWrapper<{
|
|
|
1459
2798
|
status: 422;
|
|
1460
2799
|
payload: SimpleError;
|
|
1461
2800
|
}>;
|
|
2801
|
+
declare type CreateTableResponse = {
|
|
2802
|
+
branchName: string;
|
|
2803
|
+
/**
|
|
2804
|
+
* @minLength 1
|
|
2805
|
+
*/
|
|
2806
|
+
tableName: string;
|
|
2807
|
+
};
|
|
1462
2808
|
declare type CreateTableVariables = {
|
|
1463
2809
|
pathParams: CreateTablePathParams;
|
|
1464
2810
|
} & FetcherExtraProps;
|
|
1465
2811
|
/**
|
|
1466
2812
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
|
1467
2813
|
*/
|
|
1468
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
|
2814
|
+
declare const createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
|
|
1469
2815
|
declare type DeleteTablePathParams = {
|
|
2816
|
+
/**
|
|
2817
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2818
|
+
*/
|
|
1470
2819
|
dbBranchName: DBBranchName;
|
|
2820
|
+
/**
|
|
2821
|
+
* The Table name
|
|
2822
|
+
*/
|
|
1471
2823
|
tableName: TableName;
|
|
1472
2824
|
workspace: string;
|
|
1473
2825
|
};
|
|
@@ -1484,9 +2836,15 @@ declare type DeleteTableVariables = {
|
|
|
1484
2836
|
/**
|
|
1485
2837
|
* Deletes the table with the given name.
|
|
1486
2838
|
*/
|
|
1487
|
-
declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
|
2839
|
+
declare const deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1488
2840
|
declare type UpdateTablePathParams = {
|
|
2841
|
+
/**
|
|
2842
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2843
|
+
*/
|
|
1489
2844
|
dbBranchName: DBBranchName;
|
|
2845
|
+
/**
|
|
2846
|
+
* The Table name
|
|
2847
|
+
*/
|
|
1490
2848
|
tableName: TableName;
|
|
1491
2849
|
workspace: string;
|
|
1492
2850
|
};
|
|
@@ -1501,6 +2859,9 @@ declare type UpdateTableError = ErrorWrapper<{
|
|
|
1501
2859
|
payload: SimpleError;
|
|
1502
2860
|
}>;
|
|
1503
2861
|
declare type UpdateTableRequestBody = {
|
|
2862
|
+
/**
|
|
2863
|
+
* @minLength 1
|
|
2864
|
+
*/
|
|
1504
2865
|
name: string;
|
|
1505
2866
|
};
|
|
1506
2867
|
declare type UpdateTableVariables = {
|
|
@@ -1520,9 +2881,15 @@ declare type UpdateTableVariables = {
|
|
|
1520
2881
|
* }
|
|
1521
2882
|
* ```
|
|
1522
2883
|
*/
|
|
1523
|
-
declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
|
2884
|
+
declare const updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1524
2885
|
declare type GetTableSchemaPathParams = {
|
|
2886
|
+
/**
|
|
2887
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2888
|
+
*/
|
|
1525
2889
|
dbBranchName: DBBranchName;
|
|
2890
|
+
/**
|
|
2891
|
+
* The Table name
|
|
2892
|
+
*/
|
|
1526
2893
|
tableName: TableName;
|
|
1527
2894
|
workspace: string;
|
|
1528
2895
|
};
|
|
@@ -1542,9 +2909,15 @@ declare type GetTableSchemaResponse = {
|
|
|
1542
2909
|
declare type GetTableSchemaVariables = {
|
|
1543
2910
|
pathParams: GetTableSchemaPathParams;
|
|
1544
2911
|
} & FetcherExtraProps;
|
|
1545
|
-
declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
|
2912
|
+
declare const getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
|
|
1546
2913
|
declare type SetTableSchemaPathParams = {
|
|
2914
|
+
/**
|
|
2915
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2916
|
+
*/
|
|
1547
2917
|
dbBranchName: DBBranchName;
|
|
2918
|
+
/**
|
|
2919
|
+
* The Table name
|
|
2920
|
+
*/
|
|
1548
2921
|
tableName: TableName;
|
|
1549
2922
|
workspace: string;
|
|
1550
2923
|
};
|
|
@@ -1568,9 +2941,15 @@ declare type SetTableSchemaVariables = {
|
|
|
1568
2941
|
body: SetTableSchemaRequestBody;
|
|
1569
2942
|
pathParams: SetTableSchemaPathParams;
|
|
1570
2943
|
} & FetcherExtraProps;
|
|
1571
|
-
declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
|
|
2944
|
+
declare const setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
1572
2945
|
declare type GetTableColumnsPathParams = {
|
|
2946
|
+
/**
|
|
2947
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2948
|
+
*/
|
|
1573
2949
|
dbBranchName: DBBranchName;
|
|
2950
|
+
/**
|
|
2951
|
+
* The Table name
|
|
2952
|
+
*/
|
|
1574
2953
|
tableName: TableName;
|
|
1575
2954
|
workspace: string;
|
|
1576
2955
|
};
|
|
@@ -1594,9 +2973,15 @@ declare type GetTableColumnsVariables = {
|
|
|
1594
2973
|
* Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
|
|
1595
2974
|
* full dot-separated path (flattened).
|
|
1596
2975
|
*/
|
|
1597
|
-
declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
|
|
2976
|
+
declare const getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
|
|
1598
2977
|
declare type AddTableColumnPathParams = {
|
|
2978
|
+
/**
|
|
2979
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
2980
|
+
*/
|
|
1599
2981
|
dbBranchName: DBBranchName;
|
|
2982
|
+
/**
|
|
2983
|
+
* The Table name
|
|
2984
|
+
*/
|
|
1600
2985
|
tableName: TableName;
|
|
1601
2986
|
workspace: string;
|
|
1602
2987
|
};
|
|
@@ -1619,10 +3004,19 @@ declare type AddTableColumnVariables = {
|
|
|
1619
3004
|
* contain the full path separated by dots. If the parent objects do not exists, they will be automatically created. For example,
|
|
1620
3005
|
* passing `"name": "address.city"` will auto-create the `address` object if it doesn't exist.
|
|
1621
3006
|
*/
|
|
1622
|
-
declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
|
|
3007
|
+
declare const addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
|
1623
3008
|
declare type GetColumnPathParams = {
|
|
3009
|
+
/**
|
|
3010
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3011
|
+
*/
|
|
1624
3012
|
dbBranchName: DBBranchName;
|
|
3013
|
+
/**
|
|
3014
|
+
* The Table name
|
|
3015
|
+
*/
|
|
1625
3016
|
tableName: TableName;
|
|
3017
|
+
/**
|
|
3018
|
+
* The Column name
|
|
3019
|
+
*/
|
|
1626
3020
|
columnName: ColumnName;
|
|
1627
3021
|
workspace: string;
|
|
1628
3022
|
};
|
|
@@ -1642,10 +3036,19 @@ declare type GetColumnVariables = {
|
|
|
1642
3036
|
/**
|
|
1643
3037
|
* Get the definition of a single column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
|
|
1644
3038
|
*/
|
|
1645
|
-
declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
|
|
3039
|
+
declare const getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
|
|
1646
3040
|
declare type DeleteColumnPathParams = {
|
|
3041
|
+
/**
|
|
3042
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3043
|
+
*/
|
|
1647
3044
|
dbBranchName: DBBranchName;
|
|
3045
|
+
/**
|
|
3046
|
+
* The Table name
|
|
3047
|
+
*/
|
|
1648
3048
|
tableName: TableName;
|
|
3049
|
+
/**
|
|
3050
|
+
* The Column name
|
|
3051
|
+
*/
|
|
1649
3052
|
columnName: ColumnName;
|
|
1650
3053
|
workspace: string;
|
|
1651
3054
|
};
|
|
@@ -1665,10 +3068,19 @@ declare type DeleteColumnVariables = {
|
|
|
1665
3068
|
/**
|
|
1666
3069
|
* Deletes the specified column. To refer to sub-objects, the column name can contain dots. For example `address.country`.
|
|
1667
3070
|
*/
|
|
1668
|
-
declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
|
|
3071
|
+
declare const deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
|
1669
3072
|
declare type UpdateColumnPathParams = {
|
|
3073
|
+
/**
|
|
3074
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3075
|
+
*/
|
|
1670
3076
|
dbBranchName: DBBranchName;
|
|
3077
|
+
/**
|
|
3078
|
+
* The Table name
|
|
3079
|
+
*/
|
|
1671
3080
|
tableName: TableName;
|
|
3081
|
+
/**
|
|
3082
|
+
* The Column name
|
|
3083
|
+
*/
|
|
1672
3084
|
columnName: ColumnName;
|
|
1673
3085
|
workspace: string;
|
|
1674
3086
|
};
|
|
@@ -1683,6 +3095,9 @@ declare type UpdateColumnError = ErrorWrapper<{
|
|
|
1683
3095
|
payload: SimpleError;
|
|
1684
3096
|
}>;
|
|
1685
3097
|
declare type UpdateColumnRequestBody = {
|
|
3098
|
+
/**
|
|
3099
|
+
* @minLength 1
|
|
3100
|
+
*/
|
|
1686
3101
|
name: string;
|
|
1687
3102
|
};
|
|
1688
3103
|
declare type UpdateColumnVariables = {
|
|
@@ -1692,12 +3107,24 @@ declare type UpdateColumnVariables = {
|
|
|
1692
3107
|
/**
|
|
1693
3108
|
* 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`.
|
|
1694
3109
|
*/
|
|
1695
|
-
declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
|
3110
|
+
declare const updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
|
1696
3111
|
declare type InsertRecordPathParams = {
|
|
3112
|
+
/**
|
|
3113
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3114
|
+
*/
|
|
1697
3115
|
dbBranchName: DBBranchName;
|
|
3116
|
+
/**
|
|
3117
|
+
* The Table name
|
|
3118
|
+
*/
|
|
1698
3119
|
tableName: TableName;
|
|
1699
3120
|
workspace: string;
|
|
1700
3121
|
};
|
|
3122
|
+
declare type InsertRecordQueryParams = {
|
|
3123
|
+
/**
|
|
3124
|
+
* Column filters
|
|
3125
|
+
*/
|
|
3126
|
+
columns?: ColumnsProjection;
|
|
3127
|
+
};
|
|
1701
3128
|
declare type InsertRecordError = ErrorWrapper<{
|
|
1702
3129
|
status: 400;
|
|
1703
3130
|
payload: BadRequestError;
|
|
@@ -1708,27 +3135,35 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
|
1708
3135
|
status: 404;
|
|
1709
3136
|
payload: SimpleError;
|
|
1710
3137
|
}>;
|
|
1711
|
-
declare type InsertRecordResponse = {
|
|
1712
|
-
id: string;
|
|
1713
|
-
xata: {
|
|
1714
|
-
version: number;
|
|
1715
|
-
};
|
|
1716
|
-
};
|
|
1717
3138
|
declare type InsertRecordVariables = {
|
|
1718
3139
|
body?: Record<string, any>;
|
|
1719
3140
|
pathParams: InsertRecordPathParams;
|
|
3141
|
+
queryParams?: InsertRecordQueryParams;
|
|
1720
3142
|
} & FetcherExtraProps;
|
|
1721
3143
|
/**
|
|
1722
3144
|
* Insert a new Record into the Table
|
|
1723
3145
|
*/
|
|
1724
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
|
3146
|
+
declare const insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
1725
3147
|
declare type InsertRecordWithIDPathParams = {
|
|
3148
|
+
/**
|
|
3149
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3150
|
+
*/
|
|
1726
3151
|
dbBranchName: DBBranchName;
|
|
3152
|
+
/**
|
|
3153
|
+
* The Table name
|
|
3154
|
+
*/
|
|
1727
3155
|
tableName: TableName;
|
|
3156
|
+
/**
|
|
3157
|
+
* The Record name
|
|
3158
|
+
*/
|
|
1728
3159
|
recordId: RecordID;
|
|
1729
3160
|
workspace: string;
|
|
1730
3161
|
};
|
|
1731
3162
|
declare type InsertRecordWithIDQueryParams = {
|
|
3163
|
+
/**
|
|
3164
|
+
* Column filters
|
|
3165
|
+
*/
|
|
3166
|
+
columns?: ColumnsProjection;
|
|
1732
3167
|
createOnly?: boolean;
|
|
1733
3168
|
ifVersion?: number;
|
|
1734
3169
|
};
|
|
@@ -1753,14 +3188,27 @@ declare type InsertRecordWithIDVariables = {
|
|
|
1753
3188
|
/**
|
|
1754
3189
|
* 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.
|
|
1755
3190
|
*/
|
|
1756
|
-
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
3191
|
+
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
1757
3192
|
declare type UpdateRecordWithIDPathParams = {
|
|
3193
|
+
/**
|
|
3194
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3195
|
+
*/
|
|
1758
3196
|
dbBranchName: DBBranchName;
|
|
3197
|
+
/**
|
|
3198
|
+
* The Table name
|
|
3199
|
+
*/
|
|
1759
3200
|
tableName: TableName;
|
|
3201
|
+
/**
|
|
3202
|
+
* The Record name
|
|
3203
|
+
*/
|
|
1760
3204
|
recordId: RecordID;
|
|
1761
3205
|
workspace: string;
|
|
1762
3206
|
};
|
|
1763
3207
|
declare type UpdateRecordWithIDQueryParams = {
|
|
3208
|
+
/**
|
|
3209
|
+
* Column filters
|
|
3210
|
+
*/
|
|
3211
|
+
columns?: ColumnsProjection;
|
|
1764
3212
|
ifVersion?: number;
|
|
1765
3213
|
};
|
|
1766
3214
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
|
@@ -1781,14 +3229,27 @@ declare type UpdateRecordWithIDVariables = {
|
|
|
1781
3229
|
pathParams: UpdateRecordWithIDPathParams;
|
|
1782
3230
|
queryParams?: UpdateRecordWithIDQueryParams;
|
|
1783
3231
|
} & FetcherExtraProps;
|
|
1784
|
-
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
3232
|
+
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
1785
3233
|
declare type UpsertRecordWithIDPathParams = {
|
|
3234
|
+
/**
|
|
3235
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3236
|
+
*/
|
|
1786
3237
|
dbBranchName: DBBranchName;
|
|
3238
|
+
/**
|
|
3239
|
+
* The Table name
|
|
3240
|
+
*/
|
|
1787
3241
|
tableName: TableName;
|
|
3242
|
+
/**
|
|
3243
|
+
* The Record name
|
|
3244
|
+
*/
|
|
1788
3245
|
recordId: RecordID;
|
|
1789
3246
|
workspace: string;
|
|
1790
3247
|
};
|
|
1791
3248
|
declare type UpsertRecordWithIDQueryParams = {
|
|
3249
|
+
/**
|
|
3250
|
+
* Column filters
|
|
3251
|
+
*/
|
|
3252
|
+
columns?: ColumnsProjection;
|
|
1792
3253
|
ifVersion?: number;
|
|
1793
3254
|
};
|
|
1794
3255
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
|
@@ -1809,13 +3270,28 @@ declare type UpsertRecordWithIDVariables = {
|
|
|
1809
3270
|
pathParams: UpsertRecordWithIDPathParams;
|
|
1810
3271
|
queryParams?: UpsertRecordWithIDQueryParams;
|
|
1811
3272
|
} & FetcherExtraProps;
|
|
1812
|
-
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
3273
|
+
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
1813
3274
|
declare type DeleteRecordPathParams = {
|
|
3275
|
+
/**
|
|
3276
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3277
|
+
*/
|
|
1814
3278
|
dbBranchName: DBBranchName;
|
|
3279
|
+
/**
|
|
3280
|
+
* The Table name
|
|
3281
|
+
*/
|
|
1815
3282
|
tableName: TableName;
|
|
3283
|
+
/**
|
|
3284
|
+
* The Record name
|
|
3285
|
+
*/
|
|
1816
3286
|
recordId: RecordID;
|
|
1817
3287
|
workspace: string;
|
|
1818
3288
|
};
|
|
3289
|
+
declare type DeleteRecordQueryParams = {
|
|
3290
|
+
/**
|
|
3291
|
+
* Column filters
|
|
3292
|
+
*/
|
|
3293
|
+
columns?: ColumnsProjection;
|
|
3294
|
+
};
|
|
1819
3295
|
declare type DeleteRecordError = ErrorWrapper<{
|
|
1820
3296
|
status: 400;
|
|
1821
3297
|
payload: BadRequestError;
|
|
@@ -1828,14 +3304,30 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
|
1828
3304
|
}>;
|
|
1829
3305
|
declare type DeleteRecordVariables = {
|
|
1830
3306
|
pathParams: DeleteRecordPathParams;
|
|
3307
|
+
queryParams?: DeleteRecordQueryParams;
|
|
1831
3308
|
} & FetcherExtraProps;
|
|
1832
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
|
3309
|
+
declare const deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
|
1833
3310
|
declare type GetRecordPathParams = {
|
|
3311
|
+
/**
|
|
3312
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3313
|
+
*/
|
|
1834
3314
|
dbBranchName: DBBranchName;
|
|
3315
|
+
/**
|
|
3316
|
+
* The Table name
|
|
3317
|
+
*/
|
|
1835
3318
|
tableName: TableName;
|
|
3319
|
+
/**
|
|
3320
|
+
* The Record name
|
|
3321
|
+
*/
|
|
1836
3322
|
recordId: RecordID;
|
|
1837
3323
|
workspace: string;
|
|
1838
3324
|
};
|
|
3325
|
+
declare type GetRecordQueryParams = {
|
|
3326
|
+
/**
|
|
3327
|
+
* Column filters
|
|
3328
|
+
*/
|
|
3329
|
+
columns?: ColumnsProjection;
|
|
3330
|
+
};
|
|
1839
3331
|
declare type GetRecordError = ErrorWrapper<{
|
|
1840
3332
|
status: 400;
|
|
1841
3333
|
payload: BadRequestError;
|
|
@@ -1846,22 +3338,31 @@ declare type GetRecordError = ErrorWrapper<{
|
|
|
1846
3338
|
status: 404;
|
|
1847
3339
|
payload: SimpleError;
|
|
1848
3340
|
}>;
|
|
1849
|
-
declare type GetRecordRequestBody = {
|
|
1850
|
-
columns?: ColumnsFilter;
|
|
1851
|
-
};
|
|
1852
3341
|
declare type GetRecordVariables = {
|
|
1853
|
-
body?: GetRecordRequestBody;
|
|
1854
3342
|
pathParams: GetRecordPathParams;
|
|
3343
|
+
queryParams?: GetRecordQueryParams;
|
|
1855
3344
|
} & FetcherExtraProps;
|
|
1856
3345
|
/**
|
|
1857
3346
|
* Retrieve record by ID
|
|
1858
3347
|
*/
|
|
1859
|
-
declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
|
3348
|
+
declare const getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
|
1860
3349
|
declare type BulkInsertTableRecordsPathParams = {
|
|
3350
|
+
/**
|
|
3351
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3352
|
+
*/
|
|
1861
3353
|
dbBranchName: DBBranchName;
|
|
3354
|
+
/**
|
|
3355
|
+
* The Table name
|
|
3356
|
+
*/
|
|
1862
3357
|
tableName: TableName;
|
|
1863
3358
|
workspace: string;
|
|
1864
3359
|
};
|
|
3360
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
|
3361
|
+
/**
|
|
3362
|
+
* Column filters
|
|
3363
|
+
*/
|
|
3364
|
+
columns?: ColumnsProjection;
|
|
3365
|
+
};
|
|
1865
3366
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1866
3367
|
status: 400;
|
|
1867
3368
|
payload: BulkError;
|
|
@@ -1871,23 +3372,30 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
|
1871
3372
|
} | {
|
|
1872
3373
|
status: 404;
|
|
1873
3374
|
payload: SimpleError;
|
|
3375
|
+
} | {
|
|
3376
|
+
status: 422;
|
|
3377
|
+
payload: SimpleError;
|
|
1874
3378
|
}>;
|
|
1875
|
-
declare type BulkInsertTableRecordsResponse = {
|
|
1876
|
-
recordIDs: string[];
|
|
1877
|
-
};
|
|
1878
3379
|
declare type BulkInsertTableRecordsRequestBody = {
|
|
1879
3380
|
records: Record<string, any>[];
|
|
1880
3381
|
};
|
|
1881
3382
|
declare type BulkInsertTableRecordsVariables = {
|
|
1882
3383
|
body: BulkInsertTableRecordsRequestBody;
|
|
1883
3384
|
pathParams: BulkInsertTableRecordsPathParams;
|
|
3385
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
|
1884
3386
|
} & FetcherExtraProps;
|
|
1885
3387
|
/**
|
|
1886
3388
|
* Bulk insert records
|
|
1887
3389
|
*/
|
|
1888
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
|
3390
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
|
|
1889
3391
|
declare type QueryTablePathParams = {
|
|
3392
|
+
/**
|
|
3393
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
3394
|
+
*/
|
|
1890
3395
|
dbBranchName: DBBranchName;
|
|
3396
|
+
/**
|
|
3397
|
+
* The Table name
|
|
3398
|
+
*/
|
|
1891
3399
|
tableName: TableName;
|
|
1892
3400
|
workspace: string;
|
|
1893
3401
|
};
|
|
@@ -1905,7 +3413,7 @@ declare type QueryTableRequestBody = {
|
|
|
1905
3413
|
filter?: FilterExpression;
|
|
1906
3414
|
sort?: SortExpression;
|
|
1907
3415
|
page?: PageConfig;
|
|
1908
|
-
columns?:
|
|
3416
|
+
columns?: ColumnsProjection;
|
|
1909
3417
|
};
|
|
1910
3418
|
declare type QueryTableVariables = {
|
|
1911
3419
|
body?: QueryTableRequestBody;
|
|
@@ -1941,8 +3449,9 @@ declare type QueryTableVariables = {
|
|
|
1941
3449
|
* If the `columns` array is not specified, all columns are included. For link
|
|
1942
3450
|
* fields, only the ID column of the linked records is included in the response.
|
|
1943
3451
|
*
|
|
1944
|
-
* If the `columns` array is specified, only the selected
|
|
1945
|
-
* The `*` wildcard can be used to
|
|
3452
|
+
* If the `columns` array is specified, only the selected and internal
|
|
3453
|
+
* columns `id` and `xata` are included. The `*` wildcard can be used to
|
|
3454
|
+
* select all columns.
|
|
1946
3455
|
*
|
|
1947
3456
|
* For objects and link fields, if the column name of the object is specified, we
|
|
1948
3457
|
* include all of its sub-keys. If only some sub-keys are specified (via dotted
|
|
@@ -2058,6 +3567,10 @@ declare type QueryTableVariables = {
|
|
|
2058
3567
|
*
|
|
2059
3568
|
* ```json
|
|
2060
3569
|
* {
|
|
3570
|
+
* "id": "id1"
|
|
3571
|
+
* "xata": {
|
|
3572
|
+
* "version": 0
|
|
3573
|
+
* }
|
|
2061
3574
|
* "name": "Kilian",
|
|
2062
3575
|
* "address": {
|
|
2063
3576
|
* "street": "New street"
|
|
@@ -2077,6 +3590,10 @@ declare type QueryTableVariables = {
|
|
|
2077
3590
|
*
|
|
2078
3591
|
* ```json
|
|
2079
3592
|
* {
|
|
3593
|
+
* "id": "id1"
|
|
3594
|
+
* "xata": {
|
|
3595
|
+
* "version": 0
|
|
3596
|
+
* }
|
|
2080
3597
|
* "name": "Kilian",
|
|
2081
3598
|
* "email": "kilian@gmail.com",
|
|
2082
3599
|
* "address": {
|
|
@@ -2106,6 +3623,10 @@ declare type QueryTableVariables = {
|
|
|
2106
3623
|
*
|
|
2107
3624
|
* ```json
|
|
2108
3625
|
* {
|
|
3626
|
+
* "id": "id1"
|
|
3627
|
+
* "xata": {
|
|
3628
|
+
* "version": 0
|
|
3629
|
+
* }
|
|
2109
3630
|
* "name": "Kilian",
|
|
2110
3631
|
* "email": "kilian@gmail.com",
|
|
2111
3632
|
* "address": {
|
|
@@ -2532,8 +4053,8 @@ declare type QueryTableVariables = {
|
|
|
2532
4053
|
*
|
|
2533
4054
|
* ### Pagination
|
|
2534
4055
|
*
|
|
2535
|
-
* We offer cursor pagination and offset pagination.
|
|
2536
|
-
*
|
|
4056
|
+
* We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
|
|
4057
|
+
* cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
|
|
2537
4058
|
*
|
|
2538
4059
|
* Example of size + offset pagination:
|
|
2539
4060
|
*
|
|
@@ -2632,9 +4153,15 @@ declare type QueryTableVariables = {
|
|
|
2632
4153
|
* }
|
|
2633
4154
|
* ```
|
|
2634
4155
|
*/
|
|
2635
|
-
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
4156
|
+
declare const queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
|
|
2636
4157
|
declare type SearchTablePathParams = {
|
|
4158
|
+
/**
|
|
4159
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
4160
|
+
*/
|
|
2637
4161
|
dbBranchName: DBBranchName;
|
|
4162
|
+
/**
|
|
4163
|
+
* The Table name
|
|
4164
|
+
*/
|
|
2638
4165
|
tableName: TableName;
|
|
2639
4166
|
workspace: string;
|
|
2640
4167
|
};
|
|
@@ -2649,8 +4176,14 @@ declare type SearchTableError = ErrorWrapper<{
|
|
|
2649
4176
|
payload: SimpleError;
|
|
2650
4177
|
}>;
|
|
2651
4178
|
declare type SearchTableRequestBody = {
|
|
4179
|
+
/**
|
|
4180
|
+
* The query string.
|
|
4181
|
+
*
|
|
4182
|
+
* @minLength 1
|
|
4183
|
+
*/
|
|
2652
4184
|
query: string;
|
|
2653
4185
|
fuzziness?: FuzzinessExpression;
|
|
4186
|
+
target?: TargetExpression;
|
|
2654
4187
|
prefix?: PrefixExpression;
|
|
2655
4188
|
filter?: FilterExpression;
|
|
2656
4189
|
highlight?: HighlightExpression;
|
|
@@ -2667,8 +4200,11 @@ declare type SearchTableVariables = {
|
|
|
2667
4200
|
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
|
2668
4201
|
* * filtering on columns of type `multiple` is currently unsupported
|
|
2669
4202
|
*/
|
|
2670
|
-
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
4203
|
+
declare const searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
|
2671
4204
|
declare type SearchBranchPathParams = {
|
|
4205
|
+
/**
|
|
4206
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
4207
|
+
*/
|
|
2672
4208
|
dbBranchName: DBBranchName;
|
|
2673
4209
|
workspace: string;
|
|
2674
4210
|
};
|
|
@@ -2683,13 +4219,26 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
|
2683
4219
|
payload: SimpleError;
|
|
2684
4220
|
}>;
|
|
2685
4221
|
declare type SearchBranchRequestBody = {
|
|
4222
|
+
/**
|
|
4223
|
+
* 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.
|
|
4224
|
+
*/
|
|
2686
4225
|
tables?: (string | {
|
|
4226
|
+
/**
|
|
4227
|
+
* The name of the table.
|
|
4228
|
+
*/
|
|
2687
4229
|
table: string;
|
|
2688
4230
|
filter?: FilterExpression;
|
|
4231
|
+
target?: TargetExpression;
|
|
2689
4232
|
boosters?: BoosterExpression[];
|
|
2690
4233
|
})[];
|
|
4234
|
+
/**
|
|
4235
|
+
* The query string.
|
|
4236
|
+
*
|
|
4237
|
+
* @minLength 1
|
|
4238
|
+
*/
|
|
2691
4239
|
query: string;
|
|
2692
4240
|
fuzziness?: FuzzinessExpression;
|
|
4241
|
+
prefix?: PrefixExpression;
|
|
2693
4242
|
highlight?: HighlightExpression;
|
|
2694
4243
|
};
|
|
2695
4244
|
declare type SearchBranchVariables = {
|
|
@@ -2699,74 +4248,228 @@ declare type SearchBranchVariables = {
|
|
|
2699
4248
|
/**
|
|
2700
4249
|
* Run a free text search operation across the database branch.
|
|
2701
4250
|
*/
|
|
2702
|
-
declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
|
4251
|
+
declare const searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
|
4252
|
+
declare type SummarizeTablePathParams = {
|
|
4253
|
+
/**
|
|
4254
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
4255
|
+
*/
|
|
4256
|
+
dbBranchName: DBBranchName;
|
|
4257
|
+
/**
|
|
4258
|
+
* The Table name
|
|
4259
|
+
*/
|
|
4260
|
+
tableName: TableName;
|
|
4261
|
+
workspace: string;
|
|
4262
|
+
};
|
|
4263
|
+
declare type SummarizeTableError = ErrorWrapper<{
|
|
4264
|
+
status: 400;
|
|
4265
|
+
payload: BadRequestError;
|
|
4266
|
+
} | {
|
|
4267
|
+
status: 401;
|
|
4268
|
+
payload: AuthError;
|
|
4269
|
+
} | {
|
|
4270
|
+
status: 404;
|
|
4271
|
+
payload: SimpleError;
|
|
4272
|
+
}>;
|
|
4273
|
+
declare type SummarizeTableRequestBody = {
|
|
4274
|
+
filters?: FilterExpression;
|
|
4275
|
+
columns?: ColumnsProjection;
|
|
4276
|
+
summaries?: SummaryExpressionList;
|
|
4277
|
+
sort?: SortExpression;
|
|
4278
|
+
summariesFilter?: FilterExpression;
|
|
4279
|
+
};
|
|
4280
|
+
declare type SummarizeTableVariables = {
|
|
4281
|
+
body?: SummarizeTableRequestBody;
|
|
4282
|
+
pathParams: SummarizeTablePathParams;
|
|
4283
|
+
} & FetcherExtraProps;
|
|
4284
|
+
/**
|
|
4285
|
+
* This endpoint allows you to (optionally) define groups, and then to run
|
|
4286
|
+
* calculations on the values in each group. This is most helpful when
|
|
4287
|
+
* you'd like to understand the data you have in your database.
|
|
4288
|
+
*
|
|
4289
|
+
* A group is a combination of unique values. If you create a group for
|
|
4290
|
+
* `sold_by`, `product_name`, we will return one row for every combination
|
|
4291
|
+
* of `sold_by` and `product_name` you have in your database. When you
|
|
4292
|
+
* want to calculate statistics, you define these groups and ask Xata to
|
|
4293
|
+
* calculate data on each group.
|
|
4294
|
+
*
|
|
4295
|
+
* **Some questions you can ask of your data:**
|
|
4296
|
+
*
|
|
4297
|
+
* How many records do I have in this table?
|
|
4298
|
+
* - Set `columns: []` as we we want data from the entire table, so we ask
|
|
4299
|
+
* for no groups.
|
|
4300
|
+
* - Set `summaries: {"total": {"count": "*"}}` in order to see the count
|
|
4301
|
+
* of all records. We use `count: *` here we'd like to know the total
|
|
4302
|
+
* amount of rows; ignoring whether they are `null` or not.
|
|
4303
|
+
*
|
|
4304
|
+
* What are the top total sales for each product in July 2022 and sold
|
|
4305
|
+
* more than 10 units?
|
|
4306
|
+
* - Set `filter: {soldAt: {
|
|
4307
|
+
* "$ge": "2022-07-01T00:00:00.000Z",
|
|
4308
|
+
* "$lt": "2022-08-01T00:00:00.000Z"}
|
|
4309
|
+
* }`
|
|
4310
|
+
* in order to limit the result set to sales recorded in July 2022.
|
|
4311
|
+
* - Set `columns: [product_name]` as we'd like to run calculations on
|
|
4312
|
+
* each unique product name in our table. Setting `columns` like this will
|
|
4313
|
+
* produce one row per unique product name.
|
|
4314
|
+
* - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd
|
|
4315
|
+
* like to create a field called "total_sales" for each group. This field
|
|
4316
|
+
* will count all rows in each group with non-null product names.
|
|
4317
|
+
* - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with
|
|
4318
|
+
* the highest total_sales field to the top.
|
|
4319
|
+
* - Set `summariesFilters: {"total_sales": {"$ge": 10}}` to only send back data
|
|
4320
|
+
* with greater than or equal to 10 units.
|
|
4321
|
+
*
|
|
4322
|
+
* `columns`: tells Xata how to create each group. If you add `product_id`
|
|
4323
|
+
* we will create a new group for every unique `product_id`.
|
|
4324
|
+
*
|
|
4325
|
+
* `summaries`: tells Xata which calculations to run on each group.
|
|
4326
|
+
*
|
|
4327
|
+
* `sort`: tells Xata in which order you'd like to see results. You may
|
|
4328
|
+
* sort by fields specified in `columns` as well as the summary names
|
|
4329
|
+
* defined in `summaries`.
|
|
4330
|
+
*
|
|
4331
|
+
* note: Sorting on summarized values can be slower on very large tables;
|
|
4332
|
+
* this will impact your rate limit significantly more than other queries.
|
|
4333
|
+
* Try use `filter` [coming soon] to reduce the amount of data being
|
|
4334
|
+
* processed in order to reduce impact on your limits.
|
|
4335
|
+
*
|
|
4336
|
+
* `summariesFilter`: tells Xata how to filter the results of a summary.
|
|
4337
|
+
* It has the same syntax as `filter`, however, by using `summariesFilter`
|
|
4338
|
+
* you may also filter on the results of a query.
|
|
4339
|
+
*
|
|
4340
|
+
* note: This is a much slower to use than `filter`. We recommend using
|
|
4341
|
+
* `filter` wherever possible and `summariesFilter` when it's not
|
|
4342
|
+
* possible to use `filter`.
|
|
4343
|
+
*/
|
|
4344
|
+
declare const summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
|
|
4345
|
+
declare type AggregateTablePathParams = {
|
|
4346
|
+
/**
|
|
4347
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
|
4348
|
+
*/
|
|
4349
|
+
dbBranchName: DBBranchName;
|
|
4350
|
+
/**
|
|
4351
|
+
* The Table name
|
|
4352
|
+
*/
|
|
4353
|
+
tableName: TableName;
|
|
4354
|
+
workspace: string;
|
|
4355
|
+
};
|
|
4356
|
+
declare type AggregateTableError = ErrorWrapper<{
|
|
4357
|
+
status: 400;
|
|
4358
|
+
payload: BadRequestError;
|
|
4359
|
+
} | {
|
|
4360
|
+
status: 401;
|
|
4361
|
+
payload: AuthError;
|
|
4362
|
+
} | {
|
|
4363
|
+
status: 404;
|
|
4364
|
+
payload: SimpleError;
|
|
4365
|
+
}>;
|
|
4366
|
+
declare type AggregateTableRequestBody = {
|
|
4367
|
+
filter?: FilterExpression;
|
|
4368
|
+
aggs?: AggExpressionMap;
|
|
4369
|
+
};
|
|
4370
|
+
declare type AggregateTableVariables = {
|
|
4371
|
+
body?: AggregateTableRequestBody;
|
|
4372
|
+
pathParams: AggregateTablePathParams;
|
|
4373
|
+
} & FetcherExtraProps;
|
|
4374
|
+
/**
|
|
4375
|
+
* This endpoint allows you to run aggragations (analytics) on the data from one table.
|
|
4376
|
+
* While the summary endpoint is served from a transactional store and the results are strongly
|
|
4377
|
+
* consistent, the aggregate endpoint is served from our columnar store and the results are
|
|
4378
|
+
* only eventually consistent. On the other hand, the aggregate endpoint uses a
|
|
4379
|
+
* store that is more appropiate for analytics, makes use of approximative algorithms
|
|
4380
|
+
* (e.g for cardinality), and is generally faster and can do more complex aggregations.
|
|
4381
|
+
*/
|
|
4382
|
+
declare const aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
|
|
2703
4383
|
declare const operationsByTag: {
|
|
2704
4384
|
users: {
|
|
2705
|
-
getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
|
2706
|
-
updateUser: (variables: UpdateUserVariables) => Promise<UserWithID>;
|
|
2707
|
-
deleteUser: (variables: DeleteUserVariables) => Promise<undefined>;
|
|
2708
|
-
getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
|
|
2709
|
-
createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
|
|
2710
|
-
deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>;
|
|
4385
|
+
getUser: (variables: GetUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
|
4386
|
+
updateUser: (variables: UpdateUserVariables, signal?: AbortSignal) => Promise<UserWithID>;
|
|
4387
|
+
deleteUser: (variables: DeleteUserVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4388
|
+
getUserAPIKeys: (variables: GetUserAPIKeysVariables, signal?: AbortSignal) => Promise<GetUserAPIKeysResponse>;
|
|
4389
|
+
createUserAPIKey: (variables: CreateUserAPIKeyVariables, signal?: AbortSignal) => Promise<CreateUserAPIKeyResponse>;
|
|
4390
|
+
deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
2711
4391
|
};
|
|
2712
4392
|
workspaces: {
|
|
2713
|
-
createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Workspace>;
|
|
2714
|
-
getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
|
|
2715
|
-
getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
|
|
2716
|
-
updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
|
|
2717
|
-
deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
|
|
2718
|
-
getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
|
|
2719
|
-
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
|
2720
|
-
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
|
2721
|
-
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
4393
|
+
createWorkspace: (variables: CreateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
|
4394
|
+
getWorkspacesList: (variables: GetWorkspacesListVariables, signal?: AbortSignal) => Promise<GetWorkspacesListResponse>;
|
|
4395
|
+
getWorkspace: (variables: GetWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
|
4396
|
+
updateWorkspace: (variables: UpdateWorkspaceVariables, signal?: AbortSignal) => Promise<Workspace>;
|
|
4397
|
+
deleteWorkspace: (variables: DeleteWorkspaceVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4398
|
+
getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables, signal?: AbortSignal) => Promise<WorkspaceMembers>;
|
|
4399
|
+
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4400
|
+
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4401
|
+
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
|
4402
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<WorkspaceInvite>;
|
|
4403
|
+
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4404
|
+
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4405
|
+
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
2725
4406
|
};
|
|
2726
4407
|
database: {
|
|
2727
|
-
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
|
2728
|
-
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
|
2729
|
-
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
4408
|
+
getDatabaseList: (variables: GetDatabaseListVariables, signal?: AbortSignal) => Promise<ListDatabasesResponse>;
|
|
4409
|
+
createDatabase: (variables: CreateDatabaseVariables, signal?: AbortSignal) => Promise<CreateDatabaseResponse>;
|
|
4410
|
+
deleteDatabase: (variables: DeleteDatabaseVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4411
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
|
4412
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables, signal?: AbortSignal) => Promise<DatabaseMetadata>;
|
|
4413
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables, signal?: AbortSignal) => Promise<ListGitBranchesResponse>;
|
|
4414
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables, signal?: AbortSignal) => Promise<AddGitBranchesEntryResponse>;
|
|
4415
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4416
|
+
resolveBranch: (variables: ResolveBranchVariables, signal?: AbortSignal) => Promise<ResolveBranchResponse>;
|
|
2734
4417
|
};
|
|
2735
4418
|
branch: {
|
|
2736
|
-
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
|
2737
|
-
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
|
2738
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
|
2739
|
-
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
|
2740
|
-
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
|
2741
|
-
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
4419
|
+
getBranchList: (variables: GetBranchListVariables, signal?: AbortSignal) => Promise<ListBranchesResponse>;
|
|
4420
|
+
getBranchDetails: (variables: GetBranchDetailsVariables, signal?: AbortSignal) => Promise<DBBranch>;
|
|
4421
|
+
createBranch: (variables: CreateBranchVariables, signal?: AbortSignal) => Promise<CreateBranchResponse>;
|
|
4422
|
+
deleteBranch: (variables: DeleteBranchVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4423
|
+
updateBranchMetadata: (variables: UpdateBranchMetadataVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4424
|
+
getBranchMetadata: (variables: GetBranchMetadataVariables, signal?: AbortSignal) => Promise<BranchMetadata>;
|
|
4425
|
+
getBranchStats: (variables: GetBranchStatsVariables, signal?: AbortSignal) => Promise<GetBranchStatsResponse>;
|
|
4426
|
+
};
|
|
4427
|
+
migrationRequests: {
|
|
4428
|
+
queryMigrationRequests: (variables: QueryMigrationRequestsVariables, signal?: AbortSignal) => Promise<QueryMigrationRequestsResponse>;
|
|
4429
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables, signal?: AbortSignal) => Promise<CreateMigrationRequestResponse>;
|
|
4430
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables, signal?: AbortSignal) => Promise<MigrationRequest>;
|
|
4431
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4432
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables, signal?: AbortSignal) => Promise<ListMigrationRequestsCommitsResponse>;
|
|
4433
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
|
4434
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables, signal?: AbortSignal) => Promise<GetMigrationRequestIsMergedResponse>;
|
|
4435
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables, signal?: AbortSignal) => Promise<Commit>;
|
|
4436
|
+
};
|
|
4437
|
+
branchSchema: {
|
|
4438
|
+
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables, signal?: AbortSignal) => Promise<GetBranchMigrationHistoryResponse>;
|
|
4439
|
+
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4440
|
+
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables, signal?: AbortSignal) => Promise<BranchMigrationPlan>;
|
|
4441
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
|
4442
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables, signal?: AbortSignal) => Promise<SchemaCompareResponse>;
|
|
4443
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables, signal?: AbortSignal) => Promise<UpdateBranchSchemaResponse>;
|
|
4444
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables, signal?: AbortSignal) => Promise<PreviewBranchSchemaEditResponse>;
|
|
4445
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables, signal?: AbortSignal) => Promise<ApplyBranchSchemaEditResponse>;
|
|
4446
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables, signal?: AbortSignal) => Promise<GetBranchSchemaHistoryResponse>;
|
|
2746
4447
|
};
|
|
2747
4448
|
table: {
|
|
2748
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
|
2749
|
-
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
|
2750
|
-
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
|
2751
|
-
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
|
2752
|
-
setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
|
|
2753
|
-
getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
|
|
2754
|
-
addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
|
|
2755
|
-
getColumn: (variables: GetColumnVariables) => Promise<Column>;
|
|
2756
|
-
deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
|
|
2757
|
-
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
|
4449
|
+
createTable: (variables: CreateTableVariables, signal?: AbortSignal) => Promise<CreateTableResponse>;
|
|
4450
|
+
deleteTable: (variables: DeleteTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4451
|
+
updateTable: (variables: UpdateTableVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4452
|
+
getTableSchema: (variables: GetTableSchemaVariables, signal?: AbortSignal) => Promise<GetTableSchemaResponse>;
|
|
4453
|
+
setTableSchema: (variables: SetTableSchemaVariables, signal?: AbortSignal) => Promise<undefined>;
|
|
4454
|
+
getTableColumns: (variables: GetTableColumnsVariables, signal?: AbortSignal) => Promise<GetTableColumnsResponse>;
|
|
4455
|
+
addTableColumn: (variables: AddTableColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
|
4456
|
+
getColumn: (variables: GetColumnVariables, signal?: AbortSignal) => Promise<Column>;
|
|
4457
|
+
deleteColumn: (variables: DeleteColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
|
4458
|
+
updateColumn: (variables: UpdateColumnVariables, signal?: AbortSignal) => Promise<MigrationIdResponse>;
|
|
2758
4459
|
};
|
|
2759
4460
|
records: {
|
|
2760
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
|
2761
|
-
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
2762
|
-
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
2763
|
-
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
2764
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
|
2765
|
-
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
|
2766
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
|
2767
|
-
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
2768
|
-
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
2769
|
-
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
|
4461
|
+
insertRecord: (variables: InsertRecordVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
4462
|
+
insertRecordWithID: (variables: InsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
4463
|
+
updateRecordWithID: (variables: UpdateRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
4464
|
+
upsertRecordWithID: (variables: UpsertRecordWithIDVariables, signal?: AbortSignal) => Promise<RecordUpdateResponse>;
|
|
4465
|
+
deleteRecord: (variables: DeleteRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
|
4466
|
+
getRecord: (variables: GetRecordVariables, signal?: AbortSignal) => Promise<XataRecord$1>;
|
|
4467
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables, signal?: AbortSignal) => Promise<BulkInsertResponse>;
|
|
4468
|
+
queryTable: (variables: QueryTableVariables, signal?: AbortSignal) => Promise<QueryResponse>;
|
|
4469
|
+
searchTable: (variables: SearchTableVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
|
4470
|
+
searchBranch: (variables: SearchBranchVariables, signal?: AbortSignal) => Promise<SearchResponse>;
|
|
4471
|
+
summarizeTable: (variables: SummarizeTableVariables, signal?: AbortSignal) => Promise<SummarizeResponse>;
|
|
4472
|
+
aggregateTable: (variables: AggregateTableVariables, signal?: AbortSignal) => Promise<AggResponse>;
|
|
2770
4473
|
};
|
|
2771
4474
|
};
|
|
2772
4475
|
|
|
@@ -2776,15 +4479,17 @@ declare type ProviderBuilder = {
|
|
|
2776
4479
|
workspaces: string;
|
|
2777
4480
|
};
|
|
2778
4481
|
declare type HostProvider = HostAliases | ProviderBuilder;
|
|
4482
|
+
declare function getHostUrl(provider: HostProvider, type: keyof ProviderBuilder): string;
|
|
4483
|
+
declare function isHostProviderAlias(alias: HostProvider | string): alias is HostAliases;
|
|
4484
|
+
declare function isHostProviderBuilder(builder: HostProvider): builder is ProviderBuilder;
|
|
4485
|
+
declare function parseProviderString(provider?: string): HostProvider | null;
|
|
2779
4486
|
|
|
2780
4487
|
interface XataApiClientOptions {
|
|
2781
4488
|
fetch?: FetchImpl;
|
|
2782
4489
|
apiKey?: string;
|
|
2783
4490
|
host?: HostProvider;
|
|
4491
|
+
trace?: TraceFunction;
|
|
2784
4492
|
}
|
|
2785
|
-
/**
|
|
2786
|
-
* @deprecated Use XataApiPlugin instead
|
|
2787
|
-
*/
|
|
2788
4493
|
declare class XataApiClient {
|
|
2789
4494
|
#private;
|
|
2790
4495
|
constructor(options?: XataApiClientOptions);
|
|
@@ -2794,6 +4499,8 @@ declare class XataApiClient {
|
|
|
2794
4499
|
get branches(): BranchApi;
|
|
2795
4500
|
get tables(): TableApi;
|
|
2796
4501
|
get records(): RecordsApi;
|
|
4502
|
+
get migrationRequests(): MigrationRequestsApi;
|
|
4503
|
+
get branchSchema(): BranchSchemaApi;
|
|
2797
4504
|
}
|
|
2798
4505
|
declare class UserApi {
|
|
2799
4506
|
private extraProps;
|
|
@@ -2817,6 +4524,7 @@ declare class WorkspaceApi {
|
|
|
2817
4524
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
|
2818
4525
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
|
2819
4526
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
|
4527
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
|
2820
4528
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
|
2821
4529
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
|
2822
4530
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
|
@@ -2827,6 +4535,8 @@ declare class DatabaseApi {
|
|
|
2827
4535
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
|
2828
4536
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
|
2829
4537
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
|
4538
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
|
4539
|
+
updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
|
2830
4540
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
|
2831
4541
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
|
2832
4542
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
|
@@ -2837,19 +4547,16 @@ declare class BranchApi {
|
|
|
2837
4547
|
constructor(extraProps: FetcherExtraProps);
|
|
2838
4548
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
|
2839
4549
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
|
2840
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
|
4550
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
|
2841
4551
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
|
2842
4552
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
|
2843
4553
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
|
2844
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
|
2845
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
|
2846
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
|
2847
4554
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
|
2848
4555
|
}
|
|
2849
4556
|
declare class TableApi {
|
|
2850
4557
|
private extraProps;
|
|
2851
4558
|
constructor(extraProps: FetcherExtraProps);
|
|
2852
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
|
4559
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
|
2853
4560
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
|
2854
4561
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
|
2855
4562
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
|
@@ -2863,16 +4570,43 @@ declare class TableApi {
|
|
|
2863
4570
|
declare class RecordsApi {
|
|
2864
4571
|
private extraProps;
|
|
2865
4572
|
constructor(extraProps: FetcherExtraProps);
|
|
2866
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
|
4573
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
|
2867
4574
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
|
2868
4575
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
|
2869
4576
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
|
2870
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
|
2871
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
|
2872
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
|
4577
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
|
4578
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
|
4579
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
|
2873
4580
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
|
2874
4581
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
|
2875
4582
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
|
4583
|
+
summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
|
|
4584
|
+
aggregateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: AggregateTableRequestBody): Promise<AggResponse>;
|
|
4585
|
+
}
|
|
4586
|
+
declare class MigrationRequestsApi {
|
|
4587
|
+
private extraProps;
|
|
4588
|
+
constructor(extraProps: FetcherExtraProps);
|
|
4589
|
+
queryMigrationRequests(workspace: WorkspaceID, database: DBName, options?: QueryMigrationRequestsRequestBody): Promise<QueryMigrationRequestsResponse>;
|
|
4590
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
|
4591
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
|
4592
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
|
4593
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
|
4594
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
|
4595
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
|
4596
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
|
4597
|
+
}
|
|
4598
|
+
declare class BranchSchemaApi {
|
|
4599
|
+
private extraProps;
|
|
4600
|
+
constructor(extraProps: FetcherExtraProps);
|
|
4601
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
|
4602
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
|
4603
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
|
4604
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
|
4605
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
|
4606
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
|
4607
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
|
4608
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
|
4609
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
|
2876
4610
|
}
|
|
2877
4611
|
|
|
2878
4612
|
declare class XataApiPlugin implements XataPlugin {
|
|
@@ -2885,23 +4619,35 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
|
2885
4619
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
|
2886
4620
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
|
2887
4621
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
|
2888
|
-
declare type NonEmptyArray<T> = T[] & {
|
|
2889
|
-
0: T;
|
|
2890
|
-
};
|
|
2891
4622
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
|
2892
4623
|
[P in K]-?: NonNullable<T[P]>;
|
|
2893
4624
|
};
|
|
2894
4625
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
|
2895
4626
|
declare type SingleOrArray<T> = T | T[];
|
|
4627
|
+
declare type Dictionary<T> = Record<string, T>;
|
|
2896
4628
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
|
2897
4629
|
declare type Without<T, U> = {
|
|
2898
4630
|
[P in Exclude<keyof T, keyof U>]?: never;
|
|
2899
4631
|
};
|
|
2900
4632
|
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
|
4633
|
+
declare type Explode<T> = keyof T extends infer K ? K extends unknown ? {
|
|
4634
|
+
[I in keyof T]: I extends K ? T[I] : never;
|
|
4635
|
+
} : never : never;
|
|
4636
|
+
declare type AtMostOne<T> = Explode<Partial<T>>;
|
|
4637
|
+
declare type AtLeastOne<T, U = {
|
|
4638
|
+
[K in keyof T]: Pick<T, K>;
|
|
4639
|
+
}> = Partial<T> & U[keyof U];
|
|
4640
|
+
declare type ExactlyOne<T> = AtMostOne<T> & AtLeastOne<T>;
|
|
2901
4641
|
|
|
2902
4642
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
|
2903
|
-
declare type
|
|
2904
|
-
[K in
|
|
4643
|
+
declare type WildcardColumns<O> = Values<{
|
|
4644
|
+
[K in SelectableColumn<O>]: K extends `${string}*` ? K : never;
|
|
4645
|
+
}>;
|
|
4646
|
+
declare type ColumnsByValue<O, Value> = Values<{
|
|
4647
|
+
[K in SelectableColumn<O>]: ValueAtColumn<O, K> extends infer C ? C extends Value ? K extends WildcardColumns<O> ? never : K : never : never;
|
|
4648
|
+
}>;
|
|
4649
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
|
4650
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
|
2905
4651
|
}>>;
|
|
2906
4652
|
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
|
|
2907
4653
|
V: ValueAtColumn<Item, V>;
|
|
@@ -2937,42 +4683,51 @@ interface BaseData {
|
|
|
2937
4683
|
/**
|
|
2938
4684
|
* Represents a persisted record from the database.
|
|
2939
4685
|
*/
|
|
2940
|
-
interface XataRecord<
|
|
4686
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
|
2941
4687
|
/**
|
|
2942
4688
|
* Get metadata of this record.
|
|
2943
4689
|
*/
|
|
2944
|
-
getMetadata(): XataRecordMetadata
|
|
4690
|
+
getMetadata(): XataRecordMetadata;
|
|
2945
4691
|
/**
|
|
2946
4692
|
* Retrieves a refreshed copy of the current record from the database.
|
|
4693
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
|
4694
|
+
* @returns The persisted record with the selected columns, null if not found.
|
|
2947
4695
|
*/
|
|
2948
|
-
read(): Promise<Readonly<SelectedPick<
|
|
4696
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
|
4697
|
+
/**
|
|
4698
|
+
* Retrieves a refreshed copy of the current record from the database.
|
|
4699
|
+
* @returns The persisted record with all first level properties, null if not found.
|
|
4700
|
+
*/
|
|
4701
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
|
2949
4702
|
/**
|
|
2950
4703
|
* Performs a partial update of the current record. On success a new object is
|
|
2951
4704
|
* returned and the current object is not mutated.
|
|
2952
4705
|
* @param partialUpdate The columns and their values that have to be updated.
|
|
2953
|
-
* @
|
|
4706
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
|
4707
|
+
* @returns The persisted record with the selected columns, null if not found.
|
|
2954
4708
|
*/
|
|
2955
|
-
update(partialUpdate: Partial<EditableData<
|
|
4709
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
|
2956
4710
|
/**
|
|
2957
|
-
* Performs a
|
|
2958
|
-
*
|
|
2959
|
-
* @
|
|
4711
|
+
* Performs a partial update of the current record. On success a new object is
|
|
4712
|
+
* returned and the current object is not mutated.
|
|
4713
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
4714
|
+
* @returns The persisted record with all first level properties, null if not found.
|
|
2960
4715
|
*/
|
|
2961
|
-
|
|
2962
|
-
}
|
|
2963
|
-
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
|
4716
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
|
2964
4717
|
/**
|
|
2965
|
-
*
|
|
4718
|
+
* Performs a deletion of the current record in the database.
|
|
4719
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
|
4720
|
+
* @returns The deleted record, null if not found.
|
|
2966
4721
|
*/
|
|
2967
|
-
|
|
4722
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
|
2968
4723
|
/**
|
|
2969
|
-
* Performs a
|
|
2970
|
-
*
|
|
2971
|
-
|
|
2972
|
-
* @returns A new record containing the latest values for all the columns of the current record.
|
|
4724
|
+
* Performs a deletion of the current record in the database.
|
|
4725
|
+
* @returns The deleted record, null if not found.
|
|
4726
|
+
|
|
2973
4727
|
*/
|
|
2974
|
-
|
|
2975
|
-
}
|
|
4728
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
|
4729
|
+
}
|
|
4730
|
+
declare type Link<Record extends XataRecord> = XataRecord<Record>;
|
|
2976
4731
|
declare type XataRecordMetadata = {
|
|
2977
4732
|
/**
|
|
2978
4733
|
* Number that is increased every time the record is updated.
|
|
@@ -2982,13 +4737,13 @@ declare type XataRecordMetadata = {
|
|
|
2982
4737
|
};
|
|
2983
4738
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
|
2984
4739
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
|
2985
|
-
declare type EditableData<O extends
|
|
4740
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
|
2986
4741
|
[K in keyof O]: O[K] extends XataRecord ? {
|
|
2987
4742
|
id: string;
|
|
2988
4743
|
} | string : NonNullable<O[K]> extends XataRecord ? {
|
|
2989
4744
|
id: string;
|
|
2990
4745
|
} | string | null | undefined : O[K];
|
|
2991
|
-
}
|
|
4746
|
+
}, keyof XataRecord>;
|
|
2992
4747
|
|
|
2993
4748
|
/**
|
|
2994
4749
|
* PropertyMatchFilter
|
|
@@ -3009,7 +4764,7 @@ declare type EditableData<O extends BaseData> = {
|
|
|
3009
4764
|
}
|
|
3010
4765
|
*/
|
|
3011
4766
|
declare type PropertyAccessFilter<Record> = {
|
|
3012
|
-
[key in
|
|
4767
|
+
[key in ColumnsByValue<Record, any>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
|
|
3013
4768
|
};
|
|
3014
4769
|
declare type PropertyFilter<T> = T | {
|
|
3015
4770
|
$is: T;
|
|
@@ -3071,7 +4826,7 @@ declare type AggregatorFilter<T> = {
|
|
|
3071
4826
|
* Example: { filter: { $exists: "settings" } }
|
|
3072
4827
|
*/
|
|
3073
4828
|
declare type ExistanceFilter<Record> = {
|
|
3074
|
-
[key in '$exists' | '$notExists']?:
|
|
4829
|
+
[key in '$exists' | '$notExists']?: ColumnsByValue<Record, any>;
|
|
3075
4830
|
};
|
|
3076
4831
|
declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
|
|
3077
4832
|
/**
|
|
@@ -3082,7 +4837,7 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
|
3082
4837
|
declare type NestedApiFilter<T> = {
|
|
3083
4838
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
|
3084
4839
|
};
|
|
3085
|
-
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
|
4840
|
+
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>;
|
|
3086
4841
|
|
|
3087
4842
|
declare type DateBooster = {
|
|
3088
4843
|
origin?: string;
|
|
@@ -3116,6 +4871,21 @@ declare type Boosters<O extends XataRecord> = Values<{
|
|
|
3116
4871
|
} : never;
|
|
3117
4872
|
}>;
|
|
3118
4873
|
|
|
4874
|
+
declare type TargetColumn<T extends XataRecord> = SelectableColumn<T> | {
|
|
4875
|
+
/**
|
|
4876
|
+
* The name of the column.
|
|
4877
|
+
*/
|
|
4878
|
+
column: SelectableColumn<T>;
|
|
4879
|
+
/**
|
|
4880
|
+
* The weight of the column.
|
|
4881
|
+
*
|
|
4882
|
+
* @default 1
|
|
4883
|
+
* @maximum 10
|
|
4884
|
+
* @minimum 1
|
|
4885
|
+
*/
|
|
4886
|
+
weight?: number;
|
|
4887
|
+
};
|
|
4888
|
+
|
|
3119
4889
|
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
|
3120
4890
|
fuzziness?: FuzzinessExpression;
|
|
3121
4891
|
prefix?: PrefixExpression;
|
|
@@ -3123,6 +4893,7 @@ declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables exte
|
|
|
3123
4893
|
tables?: Array<Tables | Values<{
|
|
3124
4894
|
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
|
3125
4895
|
table: Model;
|
|
4896
|
+
target?: TargetColumn<Schemas[Model] & XataRecord>[];
|
|
3126
4897
|
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
|
3127
4898
|
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
|
3128
4899
|
};
|
|
@@ -3139,13 +4910,15 @@ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
|
3139
4910
|
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
|
3140
4911
|
}>;
|
|
3141
4912
|
};
|
|
3142
|
-
declare class SearchPlugin<Schemas extends Record<string,
|
|
4913
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
|
3143
4914
|
#private;
|
|
3144
4915
|
private db;
|
|
3145
|
-
constructor(db: SchemaPluginResult<Schemas
|
|
4916
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
|
3146
4917
|
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
|
3147
4918
|
}
|
|
3148
|
-
declare type SearchXataRecord<
|
|
4919
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
|
4920
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
|
4921
|
+
};
|
|
3149
4922
|
declare type SearchExtraProperties = {
|
|
3150
4923
|
table: string;
|
|
3151
4924
|
highlight?: {
|
|
@@ -3155,23 +4928,220 @@ declare type SearchExtraProperties = {
|
|
|
3155
4928
|
};
|
|
3156
4929
|
score?: number;
|
|
3157
4930
|
};
|
|
3158
|
-
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
|
3159
|
-
declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
|
|
3160
|
-
table: infer Table;
|
|
3161
|
-
} ? ReturnTable<Table, Tables> : never;
|
|
4931
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
|
4932
|
+
declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
|
|
4933
|
+
table: infer Table;
|
|
4934
|
+
} ? ReturnTable<Table, Tables> : never;
|
|
4935
|
+
|
|
4936
|
+
/**
|
|
4937
|
+
* The description of a single aggregation operation. The key represents the
|
|
4938
|
+
*/
|
|
4939
|
+
declare type AggregationExpression<O extends XataRecord> = ExactlyOne<{
|
|
4940
|
+
count: CountAggregation<O>;
|
|
4941
|
+
sum: SumAggregation<O>;
|
|
4942
|
+
max: MaxAggregation<O>;
|
|
4943
|
+
min: MinAggregation<O>;
|
|
4944
|
+
average: AverageAggregation<O>;
|
|
4945
|
+
uniqueCount: UniqueCountAggregation<O>;
|
|
4946
|
+
dateHistogram: DateHistogramAggregation<O>;
|
|
4947
|
+
topValues: TopValuesAggregation<O>;
|
|
4948
|
+
numericHistogram: NumericHistogramAggregation<O>;
|
|
4949
|
+
}>;
|
|
4950
|
+
declare type AggregationResult<Record extends XataRecord, Expression extends Dictionary<AggregationExpression<Record>>> = {
|
|
4951
|
+
aggs: {
|
|
4952
|
+
[K in keyof Expression]: AggregationResultItem<Record, Expression[K]>;
|
|
4953
|
+
};
|
|
4954
|
+
};
|
|
4955
|
+
declare type AggregationExpressionType<T extends AggregationExpression<any>> = keyof T;
|
|
4956
|
+
declare type AggregationResultItem<Record extends XataRecord, Expression extends AggregationExpression<Record>> = AggregationExpressionType<Expression> extends infer Type ? Type extends keyof AggregationExpressionResultTypes ? AggregationExpressionResultTypes[Type] : never : never;
|
|
4957
|
+
/**
|
|
4958
|
+
* Count the number of records with an optional filter.
|
|
4959
|
+
*/
|
|
4960
|
+
declare type CountAggregation<O extends XataRecord> = {
|
|
4961
|
+
filter?: Filter<O>;
|
|
4962
|
+
} | '*';
|
|
4963
|
+
/**
|
|
4964
|
+
* The sum of the numeric values in a particular column.
|
|
4965
|
+
*/
|
|
4966
|
+
declare type SumAggregation<O extends XataRecord> = {
|
|
4967
|
+
/**
|
|
4968
|
+
* The column on which to compute the sum. Must be a numeric type.
|
|
4969
|
+
*/
|
|
4970
|
+
column: ColumnsByValue<O, number>;
|
|
4971
|
+
};
|
|
4972
|
+
/**
|
|
4973
|
+
* The max of the numeric values in a particular column.
|
|
4974
|
+
*/
|
|
4975
|
+
declare type MaxAggregation<O extends XataRecord> = {
|
|
4976
|
+
/**
|
|
4977
|
+
* The column on which to compute the max. Must be a numeric type.
|
|
4978
|
+
*/
|
|
4979
|
+
column: ColumnsByValue<O, number>;
|
|
4980
|
+
};
|
|
4981
|
+
/**
|
|
4982
|
+
* The min of the numeric values in a particular column.
|
|
4983
|
+
*/
|
|
4984
|
+
declare type MinAggregation<O extends XataRecord> = {
|
|
4985
|
+
/**
|
|
4986
|
+
* The column on which to compute the min. Must be a numeric type.
|
|
4987
|
+
*/
|
|
4988
|
+
column: ColumnsByValue<O, number>;
|
|
4989
|
+
};
|
|
4990
|
+
/**
|
|
4991
|
+
* The average of the numeric values in a particular column.
|
|
4992
|
+
*/
|
|
4993
|
+
declare type AverageAggregation<O extends XataRecord> = {
|
|
4994
|
+
/**
|
|
4995
|
+
* The column on which to compute the average. Must be a numeric type.
|
|
4996
|
+
*/
|
|
4997
|
+
column: ColumnsByValue<O, number>;
|
|
4998
|
+
};
|
|
4999
|
+
/**
|
|
5000
|
+
* Count the number of distinct values in a particular column.
|
|
5001
|
+
*/
|
|
5002
|
+
declare type UniqueCountAggregation<O extends XataRecord> = {
|
|
5003
|
+
/**
|
|
5004
|
+
* The column from where to count the unique values.
|
|
5005
|
+
*/
|
|
5006
|
+
column: ColumnsByValue<O, any>;
|
|
5007
|
+
/**
|
|
5008
|
+
* The threshold under which the unique count is exact. If the number of unique
|
|
5009
|
+
* values in the column is higher than this threshold, the results are approximative.
|
|
5010
|
+
* Maximum value is 40,000, default value is 3000.
|
|
5011
|
+
*/
|
|
5012
|
+
precisionThreshold?: number;
|
|
5013
|
+
};
|
|
5014
|
+
/**
|
|
5015
|
+
* Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
|
|
5016
|
+
*/
|
|
5017
|
+
declare type DateHistogramAggregation<O extends XataRecord> = {
|
|
5018
|
+
/**
|
|
5019
|
+
* The column to use for bucketing. Must be of type datetime.
|
|
5020
|
+
*/
|
|
5021
|
+
column: ColumnsByValue<O, Date>;
|
|
5022
|
+
/**
|
|
5023
|
+
* The fixed interval to use when bucketing.
|
|
5024
|
+
* It is fromatted as number + units, for example: `5d`, `20m`, `10s`.
|
|
5025
|
+
*
|
|
5026
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
|
5027
|
+
*/
|
|
5028
|
+
interval?: string;
|
|
5029
|
+
/**
|
|
5030
|
+
* The calendar-aware interval to use when bucketing. Possible values are: `minute`,
|
|
5031
|
+
* `hour`, `day`, `week`, `month`, `quarter`, `year`.
|
|
5032
|
+
*/
|
|
5033
|
+
calendarInterval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
5034
|
+
/**
|
|
5035
|
+
* The timezone to use for bucketing. By default, UTC is assumed.
|
|
5036
|
+
* The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
|
|
5037
|
+
* `-08:00`.
|
|
5038
|
+
*
|
|
5039
|
+
* @pattern ^[+-][01]\d:[0-5]\d$
|
|
5040
|
+
*/
|
|
5041
|
+
timezone?: string;
|
|
5042
|
+
aggs?: Dictionary<AggregationExpression<O>>;
|
|
5043
|
+
};
|
|
5044
|
+
/**
|
|
5045
|
+
* Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
|
|
5046
|
+
* The top values as ordered by the number of records (`$count``) are returned.
|
|
5047
|
+
*/
|
|
5048
|
+
declare type TopValuesAggregation<O extends XataRecord> = {
|
|
5049
|
+
/**
|
|
5050
|
+
* The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
|
|
5051
|
+
*/
|
|
5052
|
+
column: ColumnsByValue<O, string | number | boolean>;
|
|
5053
|
+
aggs?: Dictionary<AggregationExpression<O>>;
|
|
5054
|
+
/**
|
|
5055
|
+
* The maximum number of unique values to return.
|
|
5056
|
+
*
|
|
5057
|
+
* @default 10
|
|
5058
|
+
* @maximum 1000
|
|
5059
|
+
*/
|
|
5060
|
+
size?: number;
|
|
5061
|
+
};
|
|
5062
|
+
/**
|
|
5063
|
+
* Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
|
|
5064
|
+
*/
|
|
5065
|
+
declare type NumericHistogramAggregation<O extends XataRecord> = {
|
|
5066
|
+
/**
|
|
5067
|
+
* The column to use for bucketing. Must be of numeric type.
|
|
5068
|
+
*/
|
|
5069
|
+
column: ColumnsByValue<O, number>;
|
|
5070
|
+
/**
|
|
5071
|
+
* The numeric interval to use for bucketing. The resulting buckets will be ranges
|
|
5072
|
+
* with this value as size.
|
|
5073
|
+
*
|
|
5074
|
+
* @minimum 0
|
|
5075
|
+
*/
|
|
5076
|
+
interval: number;
|
|
5077
|
+
/**
|
|
5078
|
+
* By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
|
|
5079
|
+
* boundaries can be shiftend by using the offset option. For example, if the `interval` is 100,
|
|
5080
|
+
* but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
|
|
5081
|
+
* to 50.
|
|
5082
|
+
*
|
|
5083
|
+
* @default 0
|
|
5084
|
+
*/
|
|
5085
|
+
offset?: number;
|
|
5086
|
+
aggs?: Dictionary<AggregationExpression<O>>;
|
|
5087
|
+
};
|
|
5088
|
+
declare type AggregationExpressionResultTypes = {
|
|
5089
|
+
count: number;
|
|
5090
|
+
sum: number;
|
|
5091
|
+
max: number;
|
|
5092
|
+
min: number;
|
|
5093
|
+
average: number;
|
|
5094
|
+
uniqueCount: number;
|
|
5095
|
+
dateHistogram: ComplexAggregationResult;
|
|
5096
|
+
topValues: ComplexAggregationResult;
|
|
5097
|
+
numericHistogram: ComplexAggregationResult;
|
|
5098
|
+
};
|
|
5099
|
+
declare type ComplexAggregationResult = {
|
|
5100
|
+
values: Array<{
|
|
5101
|
+
$key: string | number;
|
|
5102
|
+
$count: number;
|
|
5103
|
+
[key: string]: any;
|
|
5104
|
+
}>;
|
|
5105
|
+
};
|
|
3162
5106
|
|
|
3163
5107
|
declare type SortDirection = 'asc' | 'desc';
|
|
3164
|
-
declare type SortFilterExtended<T extends XataRecord
|
|
3165
|
-
column:
|
|
5108
|
+
declare type SortFilterExtended<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = {
|
|
5109
|
+
column: Columns;
|
|
3166
5110
|
direction?: SortDirection;
|
|
3167
5111
|
};
|
|
3168
|
-
declare type SortFilter<T extends XataRecord
|
|
3169
|
-
declare type SortFilterBase<T extends XataRecord
|
|
3170
|
-
[Key in
|
|
3171
|
-
|
|
5112
|
+
declare type SortFilter<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = Columns | SortFilterExtended<T, Columns> | SortFilterBase<T, Columns>;
|
|
5113
|
+
declare type SortFilterBase<T extends XataRecord, Columns extends string = ColumnsByValue<T, any>> = Values<{
|
|
5114
|
+
[Key in Columns]: {
|
|
5115
|
+
[K in Key]: SortDirection;
|
|
5116
|
+
};
|
|
5117
|
+
}>;
|
|
5118
|
+
|
|
5119
|
+
declare type SummarizeExpression<O extends XataRecord> = ExactlyOne<{
|
|
5120
|
+
count: ColumnsByValue<O, any> | '*';
|
|
5121
|
+
}>;
|
|
5122
|
+
declare type SummarizeParams<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>, Columns extends SelectableColumn<Record>[]> = {
|
|
5123
|
+
summaries?: Expression;
|
|
5124
|
+
summariesFilter?: SummariesFilter<Record, Expression>;
|
|
5125
|
+
filter?: Filter<Record>;
|
|
5126
|
+
columns?: Columns;
|
|
5127
|
+
sort?: SummarizeSort<Record, Expression>;
|
|
5128
|
+
};
|
|
5129
|
+
declare type SummarizeResult<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>, Columns extends SelectableColumn<Record>[]> = {
|
|
5130
|
+
summaries: SummarizeResultItem<Record, Expression, Columns>[];
|
|
5131
|
+
};
|
|
5132
|
+
declare type SummarizeResultItem<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>, Columns extends SelectableColumn<Record>[]> = {
|
|
5133
|
+
[K in StringKeys<Expression>]: StringKeys<Expression[K]> extends keyof SummarizeExpressionResultTypes ? SummarizeExpressionResultTypes[StringKeys<Expression[K]>] : never;
|
|
5134
|
+
} & SelectedPick<Record, Columns>;
|
|
5135
|
+
declare type SummarizeExpressionResultTypes = {
|
|
5136
|
+
count: number;
|
|
5137
|
+
};
|
|
5138
|
+
declare type SummarizeSort<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>> = SingleOrArray<SortFilter<Record, SelectableColumn<Record> | StringKeys<Expression>>>;
|
|
5139
|
+
declare type SummariesFilter<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>> = Filter<{
|
|
5140
|
+
[K in StringKeys<Expression>]: StringKeys<Expression[K]> extends infer SummarizeOperation ? SummarizeOperation extends keyof SummarizeExpressionResultTypes ? SummarizeExpressionResultTypes[SummarizeOperation] : never : never;
|
|
5141
|
+
}>;
|
|
3172
5142
|
|
|
3173
5143
|
declare type BaseOptions<T extends XataRecord> = {
|
|
3174
|
-
columns?:
|
|
5144
|
+
columns?: SelectableColumn<T>[];
|
|
3175
5145
|
cache?: number;
|
|
3176
5146
|
};
|
|
3177
5147
|
declare type CursorQueryOptions = {
|
|
@@ -3182,7 +5152,7 @@ declare type CursorQueryOptions = {
|
|
|
3182
5152
|
declare type OffsetQueryOptions<T extends XataRecord> = {
|
|
3183
5153
|
pagination?: OffsetNavigationOptions;
|
|
3184
5154
|
filter?: FilterExpression;
|
|
3185
|
-
sort?:
|
|
5155
|
+
sort?: SingleOrArray<SortFilter<T>>;
|
|
3186
5156
|
};
|
|
3187
5157
|
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
|
3188
5158
|
/**
|
|
@@ -3195,7 +5165,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
3195
5165
|
#private;
|
|
3196
5166
|
readonly meta: PaginationQueryMeta;
|
|
3197
5167
|
readonly records: RecordArray<Result>;
|
|
3198
|
-
constructor(repository:
|
|
5168
|
+
constructor(repository: RestRepository<Record> | null, table: {
|
|
5169
|
+
name: string;
|
|
5170
|
+
schema?: Table;
|
|
5171
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
|
3199
5172
|
getQueryOptions(): QueryOptions<Record>;
|
|
3200
5173
|
key(): string;
|
|
3201
5174
|
/**
|
|
@@ -3234,7 +5207,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
3234
5207
|
* @param value The value to filter.
|
|
3235
5208
|
* @returns A new Query object.
|
|
3236
5209
|
*/
|
|
3237
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F
|
|
5210
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
|
3238
5211
|
/**
|
|
3239
5212
|
* Builds a new query object adding one or more constraints. Examples:
|
|
3240
5213
|
*
|
|
@@ -3248,20 +5221,20 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
3248
5221
|
* @param filters A filter object
|
|
3249
5222
|
* @returns A new Query object.
|
|
3250
5223
|
*/
|
|
3251
|
-
filter(filters
|
|
5224
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
|
3252
5225
|
/**
|
|
3253
5226
|
* Builds a new query with a new sort option.
|
|
3254
5227
|
* @param column The column name.
|
|
3255
5228
|
* @param direction The direction. Either ascending or descending.
|
|
3256
5229
|
* @returns A new Query object.
|
|
3257
5230
|
*/
|
|
3258
|
-
sort<F extends
|
|
5231
|
+
sort<F extends ColumnsByValue<Record, any>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
|
3259
5232
|
/**
|
|
3260
5233
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
|
3261
5234
|
* @param columns Array of column names to be returned by the query.
|
|
3262
5235
|
* @returns A new Query object.
|
|
3263
5236
|
*/
|
|
3264
|
-
select<K extends SelectableColumn<Record>>(columns:
|
|
5237
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
|
3265
5238
|
/**
|
|
3266
5239
|
* Get paginated results
|
|
3267
5240
|
*
|
|
@@ -3323,13 +5296,13 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
3323
5296
|
* @param options Additional options to be used when performing the query.
|
|
3324
5297
|
* @returns An array of records from the database.
|
|
3325
5298
|
*/
|
|
3326
|
-
getMany
|
|
5299
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
|
3327
5300
|
/**
|
|
3328
5301
|
* Performs the query in the database and returns a set of results.
|
|
3329
5302
|
* @param options Additional options to be used when performing the query.
|
|
3330
5303
|
* @returns An array of records from the database.
|
|
3331
5304
|
*/
|
|
3332
|
-
getMany
|
|
5305
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
|
3333
5306
|
/**
|
|
3334
5307
|
* Performs the query in the database and returns all the results.
|
|
3335
5308
|
* Warning: If there are a large number of results, this method can have performance implications.
|
|
@@ -3342,35 +5315,56 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
3342
5315
|
* @param options Additional options to be used when performing the query.
|
|
3343
5316
|
* @returns An array of records from the database.
|
|
3344
5317
|
*/
|
|
3345
|
-
getAll
|
|
5318
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3346
5319
|
batchSize?: number;
|
|
3347
|
-
}): Promise<
|
|
5320
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
|
3348
5321
|
/**
|
|
3349
5322
|
* Performs the query in the database and returns all the results.
|
|
3350
5323
|
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3351
5324
|
* @param options Additional options to be used when performing the query.
|
|
3352
5325
|
* @returns An array of records from the database.
|
|
3353
5326
|
*/
|
|
3354
|
-
getAll
|
|
5327
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
3355
5328
|
batchSize?: number;
|
|
3356
|
-
}
|
|
5329
|
+
}): Promise<Result[]>;
|
|
3357
5330
|
/**
|
|
3358
5331
|
* Performs the query in the database and returns the first result.
|
|
3359
5332
|
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3360
5333
|
*/
|
|
3361
5334
|
getFirst(): Promise<Result | null>;
|
|
5335
|
+
/**
|
|
5336
|
+
* Performs the query in the database and returns the first result.
|
|
5337
|
+
* @param options Additional options to be used when performing the query.
|
|
5338
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
5339
|
+
*/
|
|
5340
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
|
3362
5341
|
/**
|
|
3363
5342
|
* Performs the query in the database and returns the first result.
|
|
3364
5343
|
* @param options Additional options to be used when performing the query.
|
|
3365
5344
|
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3366
5345
|
*/
|
|
3367
5346
|
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
|
5347
|
+
/**
|
|
5348
|
+
* Performs the query in the database and returns the first result.
|
|
5349
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
5350
|
+
* @throws if there are no results.
|
|
5351
|
+
*/
|
|
5352
|
+
getFirstOrThrow(): Promise<Result>;
|
|
3368
5353
|
/**
|
|
3369
5354
|
* Performs the query in the database and returns the first result.
|
|
3370
5355
|
* @param options Additional options to be used when performing the query.
|
|
3371
5356
|
* @returns The first record that matches the query, or null if no record matched the query.
|
|
5357
|
+
* @throws if there are no results.
|
|
3372
5358
|
*/
|
|
3373
|
-
|
|
5359
|
+
getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
|
|
5360
|
+
/**
|
|
5361
|
+
* Performs the query in the database and returns the first result.
|
|
5362
|
+
* @param options Additional options to be used when performing the query.
|
|
5363
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
5364
|
+
* @throws if there are no results.
|
|
5365
|
+
*/
|
|
5366
|
+
getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
|
|
5367
|
+
summarize<Expression extends Dictionary<SummarizeExpression<Record>>, Columns extends SelectableColumn<Record>[]>(params?: SummarizeParams<Record, Expression, Columns>): Promise<SummarizeResult<Record, Expression, Columns>>;
|
|
3374
5368
|
/**
|
|
3375
5369
|
* Builds a new query object adding a cache TTL in milliseconds.
|
|
3376
5370
|
* @param ttl The cache TTL in milliseconds.
|
|
@@ -3492,6 +5486,8 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
|
3492
5486
|
#private;
|
|
3493
5487
|
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
|
3494
5488
|
static parseConstructorParams(...args: any[]): any[];
|
|
5489
|
+
toArray(): Result[];
|
|
5490
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
|
3495
5491
|
/**
|
|
3496
5492
|
* Retrieve next page of records
|
|
3497
5493
|
*
|
|
@@ -3525,21 +5521,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
|
3525
5521
|
/**
|
|
3526
5522
|
* Common interface for performing operations on a table.
|
|
3527
5523
|
*/
|
|
3528
|
-
declare abstract class Repository<
|
|
3529
|
-
abstract create(object: EditableData<
|
|
5524
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
|
5525
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5526
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5527
|
+
/**
|
|
5528
|
+
* Creates a single record in the table with a unique id.
|
|
5529
|
+
* @param id The unique id.
|
|
5530
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
|
5531
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5532
|
+
* @returns The full persisted record.
|
|
5533
|
+
*/
|
|
5534
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3530
5535
|
/**
|
|
3531
5536
|
* Creates a single record in the table with a unique id.
|
|
3532
5537
|
* @param id The unique id.
|
|
3533
5538
|
* @param object Object containing the column names with their values to be stored in the table.
|
|
3534
5539
|
* @returns The full persisted record.
|
|
3535
5540
|
*/
|
|
3536
|
-
abstract create(id: string, object: EditableData<
|
|
5541
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
3537
5542
|
/**
|
|
3538
5543
|
* Creates multiple records in the table.
|
|
3539
5544
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
3540
|
-
* @
|
|
5545
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5546
|
+
* @returns Array of the persisted records in order.
|
|
5547
|
+
*/
|
|
5548
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
5549
|
+
/**
|
|
5550
|
+
* Creates multiple records in the table.
|
|
5551
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
5552
|
+
* @returns Array of the persisted records in order.
|
|
5553
|
+
*/
|
|
5554
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
5555
|
+
/**
|
|
5556
|
+
* Queries a single record from the table given its unique id.
|
|
5557
|
+
* @param id The unique id.
|
|
5558
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5559
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
3541
5560
|
*/
|
|
3542
|
-
abstract
|
|
5561
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
3543
5562
|
/**
|
|
3544
5563
|
* Queries a single record from the table given its unique id.
|
|
3545
5564
|
* @param id The unique id.
|
|
@@ -3549,9 +5568,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3549
5568
|
/**
|
|
3550
5569
|
* Queries multiple records from the table given their unique id.
|
|
3551
5570
|
* @param ids The unique ids array.
|
|
3552
|
-
* @
|
|
5571
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5572
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
5573
|
+
*/
|
|
5574
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5575
|
+
/**
|
|
5576
|
+
* Queries multiple records from the table given their unique id.
|
|
5577
|
+
* @param ids The unique ids array.
|
|
5578
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
5579
|
+
*/
|
|
5580
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5581
|
+
/**
|
|
5582
|
+
* Queries a single record from the table by the id in the object.
|
|
5583
|
+
* @param object Object containing the id of the record.
|
|
5584
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5585
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
3553
5586
|
*/
|
|
3554
|
-
abstract read(
|
|
5587
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
3555
5588
|
/**
|
|
3556
5589
|
* Queries a single record from the table by the id in the object.
|
|
3557
5590
|
* @param object Object containing the id of the record.
|
|
@@ -3561,35 +5594,188 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3561
5594
|
/**
|
|
3562
5595
|
* Queries multiple records from the table by the ids in the objects.
|
|
3563
5596
|
* @param objects Array of objects containing the ids of the records.
|
|
3564
|
-
* @
|
|
5597
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5598
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
5599
|
+
*/
|
|
5600
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5601
|
+
/**
|
|
5602
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
5603
|
+
* @param objects Array of objects containing the ids of the records.
|
|
5604
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
5605
|
+
*/
|
|
5606
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5607
|
+
/**
|
|
5608
|
+
* Queries a single record from the table given its unique id.
|
|
5609
|
+
* @param id The unique id.
|
|
5610
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5611
|
+
* @returns The persisted record for the given id.
|
|
5612
|
+
* @throws If the record could not be found.
|
|
5613
|
+
*/
|
|
5614
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5615
|
+
/**
|
|
5616
|
+
* Queries a single record from the table given its unique id.
|
|
5617
|
+
* @param id The unique id.
|
|
5618
|
+
* @returns The persisted record for the given id.
|
|
5619
|
+
* @throws If the record could not be found.
|
|
5620
|
+
*/
|
|
5621
|
+
abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5622
|
+
/**
|
|
5623
|
+
* Queries multiple records from the table given their unique id.
|
|
5624
|
+
* @param ids The unique ids array.
|
|
5625
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5626
|
+
* @returns The persisted records for the given ids in order.
|
|
5627
|
+
* @throws If one or more records could not be found.
|
|
5628
|
+
*/
|
|
5629
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5630
|
+
/**
|
|
5631
|
+
* Queries multiple records from the table given their unique id.
|
|
5632
|
+
* @param ids The unique ids array.
|
|
5633
|
+
* @returns The persisted records for the given ids in order.
|
|
5634
|
+
* @throws If one or more records could not be found.
|
|
5635
|
+
*/
|
|
5636
|
+
abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
5637
|
+
/**
|
|
5638
|
+
* Queries a single record from the table by the id in the object.
|
|
5639
|
+
* @param object Object containing the id of the record.
|
|
5640
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5641
|
+
* @returns The persisted record for the given id.
|
|
5642
|
+
* @throws If the record could not be found.
|
|
5643
|
+
*/
|
|
5644
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5645
|
+
/**
|
|
5646
|
+
* Queries a single record from the table by the id in the object.
|
|
5647
|
+
* @param object Object containing the id of the record.
|
|
5648
|
+
* @returns The persisted record for the given id.
|
|
5649
|
+
* @throws If the record could not be found.
|
|
5650
|
+
*/
|
|
5651
|
+
abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5652
|
+
/**
|
|
5653
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
5654
|
+
* @param objects Array of objects containing the ids of the records.
|
|
5655
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5656
|
+
* @returns The persisted records for the given ids in order.
|
|
5657
|
+
* @throws If one or more records could not be found.
|
|
5658
|
+
*/
|
|
5659
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5660
|
+
/**
|
|
5661
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
5662
|
+
* @param objects Array of objects containing the ids of the records.
|
|
5663
|
+
* @returns The persisted records for the given ids in order.
|
|
5664
|
+
* @throws If one or more records could not be found.
|
|
5665
|
+
*/
|
|
5666
|
+
abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
5667
|
+
/**
|
|
5668
|
+
* Partially update a single record.
|
|
5669
|
+
* @param object An object with its id and the columns to be updated.
|
|
5670
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5671
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
5672
|
+
*/
|
|
5673
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5674
|
+
/**
|
|
5675
|
+
* Partially update a single record.
|
|
5676
|
+
* @param object An object with its id and the columns to be updated.
|
|
5677
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
5678
|
+
*/
|
|
5679
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5680
|
+
/**
|
|
5681
|
+
* Partially update a single record given its unique id.
|
|
5682
|
+
* @param id The unique id.
|
|
5683
|
+
* @param object The column names and their values that have to be updated.
|
|
5684
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5685
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
5686
|
+
*/
|
|
5687
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5688
|
+
/**
|
|
5689
|
+
* Partially update a single record given its unique id.
|
|
5690
|
+
* @param id The unique id.
|
|
5691
|
+
* @param object The column names and their values that have to be updated.
|
|
5692
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
3565
5693
|
*/
|
|
3566
|
-
abstract
|
|
5694
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5695
|
+
/**
|
|
5696
|
+
* Partially updates multiple records.
|
|
5697
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
|
5698
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5699
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
|
5700
|
+
*/
|
|
5701
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5702
|
+
/**
|
|
5703
|
+
* Partially updates multiple records.
|
|
5704
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
|
5705
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
|
5706
|
+
*/
|
|
5707
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
3567
5708
|
/**
|
|
3568
5709
|
* Partially update a single record.
|
|
3569
5710
|
* @param object An object with its id and the columns to be updated.
|
|
5711
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5712
|
+
* @returns The full persisted record.
|
|
5713
|
+
* @throws If the record could not be found.
|
|
5714
|
+
*/
|
|
5715
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5716
|
+
/**
|
|
5717
|
+
* Partially update a single record.
|
|
5718
|
+
* @param object An object with its id and the columns to be updated.
|
|
5719
|
+
* @returns The full persisted record.
|
|
5720
|
+
* @throws If the record could not be found.
|
|
5721
|
+
*/
|
|
5722
|
+
abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5723
|
+
/**
|
|
5724
|
+
* Partially update a single record given its unique id.
|
|
5725
|
+
* @param id The unique id.
|
|
5726
|
+
* @param object The column names and their values that have to be updated.
|
|
5727
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
3570
5728
|
* @returns The full persisted record.
|
|
5729
|
+
* @throws If the record could not be found.
|
|
3571
5730
|
*/
|
|
3572
|
-
abstract
|
|
5731
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3573
5732
|
/**
|
|
3574
5733
|
* Partially update a single record given its unique id.
|
|
3575
5734
|
* @param id The unique id.
|
|
3576
5735
|
* @param object The column names and their values that have to be updated.
|
|
3577
5736
|
* @returns The full persisted record.
|
|
5737
|
+
* @throws If the record could not be found.
|
|
3578
5738
|
*/
|
|
3579
|
-
abstract
|
|
5739
|
+
abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
3580
5740
|
/**
|
|
3581
5741
|
* Partially updates multiple records.
|
|
3582
5742
|
* @param objects An array of objects with their ids and columns to be updated.
|
|
3583
|
-
* @
|
|
5743
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5744
|
+
* @returns Array of the persisted records in order.
|
|
5745
|
+
* @throws If one or more records could not be found.
|
|
5746
|
+
*/
|
|
5747
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
5748
|
+
/**
|
|
5749
|
+
* Partially updates multiple records.
|
|
5750
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
|
5751
|
+
* @returns Array of the persisted records in order.
|
|
5752
|
+
* @throws If one or more records could not be found.
|
|
3584
5753
|
*/
|
|
3585
|
-
abstract
|
|
5754
|
+
abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
3586
5755
|
/**
|
|
3587
5756
|
* Creates or updates a single record. If a record exists with the given id,
|
|
3588
5757
|
* it will be update, otherwise a new record will be created.
|
|
3589
5758
|
* @param object Object containing the column names with their values to be persisted in the table.
|
|
5759
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5760
|
+
* @returns The full persisted record.
|
|
5761
|
+
*/
|
|
5762
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5763
|
+
/**
|
|
5764
|
+
* Creates or updates a single record. If a record exists with the given id,
|
|
5765
|
+
* it will be update, otherwise a new record will be created.
|
|
5766
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
|
5767
|
+
* @returns The full persisted record.
|
|
5768
|
+
*/
|
|
5769
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5770
|
+
/**
|
|
5771
|
+
* Creates or updates a single record. If a record exists with the given id,
|
|
5772
|
+
* it will be update, otherwise a new record will be created.
|
|
5773
|
+
* @param id A unique id.
|
|
5774
|
+
* @param object The column names and the values to be persisted.
|
|
5775
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
3590
5776
|
* @returns The full persisted record.
|
|
3591
5777
|
*/
|
|
3592
|
-
abstract createOrUpdate(object: EditableData<
|
|
5778
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3593
5779
|
/**
|
|
3594
5780
|
* Creates or updates a single record. If a record exists with the given id,
|
|
3595
5781
|
* it will be update, otherwise a new record will be created.
|
|
@@ -3597,38 +5783,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3597
5783
|
* @param object The column names and the values to be persisted.
|
|
3598
5784
|
* @returns The full persisted record.
|
|
3599
5785
|
*/
|
|
3600
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
|
5786
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5787
|
+
/**
|
|
5788
|
+
* Creates or updates a single record. If a record exists with the given id,
|
|
5789
|
+
* it will be update, otherwise a new record will be created.
|
|
5790
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
5791
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5792
|
+
* @returns Array of the persisted records.
|
|
5793
|
+
*/
|
|
5794
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
3601
5795
|
/**
|
|
3602
5796
|
* Creates or updates a single record. If a record exists with the given id,
|
|
3603
5797
|
* it will be update, otherwise a new record will be created.
|
|
3604
5798
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
3605
5799
|
* @returns Array of the persisted records.
|
|
3606
5800
|
*/
|
|
3607
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
|
5801
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
5802
|
+
/**
|
|
5803
|
+
* Deletes a record given its unique id.
|
|
5804
|
+
* @param object An object with a unique id.
|
|
5805
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5806
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5807
|
+
*/
|
|
5808
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
3608
5809
|
/**
|
|
3609
5810
|
* Deletes a record given its unique id.
|
|
5811
|
+
* @param object An object with a unique id.
|
|
5812
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5813
|
+
*/
|
|
5814
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5815
|
+
/**
|
|
5816
|
+
* Deletes a record given a unique id.
|
|
3610
5817
|
* @param id The unique id.
|
|
3611
|
-
* @
|
|
5818
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5819
|
+
* @returns The deleted record, null if the record could not be found.
|
|
3612
5820
|
*/
|
|
3613
|
-
abstract delete(id: string): Promise<
|
|
5821
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5822
|
+
/**
|
|
5823
|
+
* Deletes a record given a unique id.
|
|
5824
|
+
* @param id The unique id.
|
|
5825
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5826
|
+
*/
|
|
5827
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5828
|
+
/**
|
|
5829
|
+
* Deletes multiple records given an array of objects with ids.
|
|
5830
|
+
* @param objects An array of objects with unique ids.
|
|
5831
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5832
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5833
|
+
*/
|
|
5834
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5835
|
+
/**
|
|
5836
|
+
* Deletes multiple records given an array of objects with ids.
|
|
5837
|
+
* @param objects An array of objects with unique ids.
|
|
5838
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5839
|
+
*/
|
|
5840
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5841
|
+
/**
|
|
5842
|
+
* Deletes multiple records given an array of unique ids.
|
|
5843
|
+
* @param objects An array of ids.
|
|
5844
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5845
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5846
|
+
*/
|
|
5847
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5848
|
+
/**
|
|
5849
|
+
* Deletes multiple records given an array of unique ids.
|
|
5850
|
+
* @param objects An array of ids.
|
|
5851
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5852
|
+
*/
|
|
5853
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5854
|
+
/**
|
|
5855
|
+
* Deletes a record given its unique id.
|
|
5856
|
+
* @param object An object with a unique id.
|
|
5857
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5858
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5859
|
+
* @throws If the record could not be found.
|
|
5860
|
+
*/
|
|
5861
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3614
5862
|
/**
|
|
3615
5863
|
* Deletes a record given its unique id.
|
|
3616
|
-
* @param
|
|
3617
|
-
* @
|
|
5864
|
+
* @param object An object with a unique id.
|
|
5865
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5866
|
+
* @throws If the record could not be found.
|
|
5867
|
+
*/
|
|
5868
|
+
abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5869
|
+
/**
|
|
5870
|
+
* Deletes a record given a unique id.
|
|
5871
|
+
* @param id The unique id.
|
|
5872
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5873
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5874
|
+
* @throws If the record could not be found.
|
|
5875
|
+
*/
|
|
5876
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5877
|
+
/**
|
|
5878
|
+
* Deletes a record given a unique id.
|
|
5879
|
+
* @param id The unique id.
|
|
5880
|
+
* @returns The deleted record, null if the record could not be found.
|
|
5881
|
+
* @throws If the record could not be found.
|
|
5882
|
+
*/
|
|
5883
|
+
abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5884
|
+
/**
|
|
5885
|
+
* Deletes multiple records given an array of objects with ids.
|
|
5886
|
+
* @param objects An array of objects with unique ids.
|
|
5887
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5888
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5889
|
+
* @throws If one or more records could not be found.
|
|
5890
|
+
*/
|
|
5891
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5892
|
+
/**
|
|
5893
|
+
* Deletes multiple records given an array of objects with ids.
|
|
5894
|
+
* @param objects An array of objects with unique ids.
|
|
5895
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5896
|
+
* @throws If one or more records could not be found.
|
|
3618
5897
|
*/
|
|
3619
|
-
abstract
|
|
5898
|
+
abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3620
5899
|
/**
|
|
3621
|
-
* Deletes
|
|
3622
|
-
* @param
|
|
3623
|
-
* @
|
|
5900
|
+
* Deletes multiple records given an array of unique ids.
|
|
5901
|
+
* @param objects An array of ids.
|
|
5902
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
5903
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
5904
|
+
* @throws If one or more records could not be found.
|
|
3624
5905
|
*/
|
|
3625
|
-
abstract
|
|
5906
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
3626
5907
|
/**
|
|
3627
|
-
* Deletes
|
|
3628
|
-
* @param
|
|
3629
|
-
* @
|
|
5908
|
+
* Deletes multiple records given an array of unique ids.
|
|
5909
|
+
* @param objects An array of ids.
|
|
5910
|
+
* @returns Array of the deleted records in order.
|
|
5911
|
+
* @throws If one or more records could not be found.
|
|
3630
5912
|
*/
|
|
3631
|
-
abstract
|
|
5913
|
+
abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3632
5914
|
/**
|
|
3633
5915
|
* Search for records in the table.
|
|
3634
5916
|
* @param query The query to search for.
|
|
@@ -3642,30 +5924,79 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3642
5924
|
filter?: Filter<Record>;
|
|
3643
5925
|
boosters?: Boosters<Record>[];
|
|
3644
5926
|
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
|
5927
|
+
/**
|
|
5928
|
+
* Aggregates records in the table.
|
|
5929
|
+
* @param expression The aggregations to perform.
|
|
5930
|
+
* @param filter The filter to apply to the queried records.
|
|
5931
|
+
* @returns The requested aggregations.
|
|
5932
|
+
*/
|
|
5933
|
+
abstract aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(expression?: Expression, filter?: Filter<Record>): Promise<AggregationResult<Record, Expression>>;
|
|
3645
5934
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3646
5935
|
}
|
|
3647
|
-
declare class RestRepository<
|
|
5936
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
|
3648
5937
|
#private;
|
|
3649
|
-
db: SchemaPluginResult<any>;
|
|
3650
5938
|
constructor(options: {
|
|
3651
5939
|
table: string;
|
|
3652
5940
|
db: SchemaPluginResult<any>;
|
|
3653
5941
|
pluginOptions: XataPluginOptions;
|
|
5942
|
+
schemaTables?: Table[];
|
|
3654
5943
|
});
|
|
3655
|
-
create(object: EditableData<
|
|
3656
|
-
create(
|
|
3657
|
-
create(
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
read(
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
5944
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5945
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5946
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5947
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5948
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
5949
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
5950
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
5951
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
5952
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5953
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5954
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
5955
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
5956
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5957
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5958
|
+
readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5959
|
+
readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5960
|
+
readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5961
|
+
readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
5962
|
+
readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5963
|
+
readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5964
|
+
readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5965
|
+
readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
5966
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5967
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5968
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5969
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5970
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5971
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5972
|
+
updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5973
|
+
updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5974
|
+
updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5975
|
+
updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5976
|
+
updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
5977
|
+
updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
5978
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5979
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5980
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5981
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5982
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
5983
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
5984
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5985
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5986
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
5987
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
5988
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5989
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5990
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
5991
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
5992
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5993
|
+
deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5994
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
5995
|
+
deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
5996
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5997
|
+
deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
5998
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
|
5999
|
+
deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
|
3669
6000
|
search(query: string, options?: {
|
|
3670
6001
|
fuzziness?: FuzzinessExpression;
|
|
3671
6002
|
prefix?: PrefixExpression;
|
|
@@ -3673,9 +6004,75 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
|
3673
6004
|
filter?: Filter<Record>;
|
|
3674
6005
|
boosters?: Boosters<Record>[];
|
|
3675
6006
|
}): Promise<any>;
|
|
6007
|
+
aggregate<Expression extends Dictionary<AggregationExpression<Record>>>(aggs?: Expression, filter?: Filter<Record>): Promise<any>;
|
|
3676
6008
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
6009
|
+
summarizeTable<Result extends XataRecord>(query: Query<Record, Result>, summaries?: Dictionary<SummarizeExpression<Record>>, summariesFilter?: FilterExpression): Promise<SummarizeResponse>;
|
|
3677
6010
|
}
|
|
3678
6011
|
|
|
6012
|
+
declare type BaseSchema = {
|
|
6013
|
+
name: string;
|
|
6014
|
+
columns: readonly ({
|
|
6015
|
+
name: string;
|
|
6016
|
+
type: Column['type'];
|
|
6017
|
+
notNull?: boolean;
|
|
6018
|
+
} | {
|
|
6019
|
+
name: string;
|
|
6020
|
+
type: 'link';
|
|
6021
|
+
link: {
|
|
6022
|
+
table: string;
|
|
6023
|
+
};
|
|
6024
|
+
} | {
|
|
6025
|
+
name: string;
|
|
6026
|
+
type: 'object';
|
|
6027
|
+
columns: {
|
|
6028
|
+
name: string;
|
|
6029
|
+
type: string;
|
|
6030
|
+
}[];
|
|
6031
|
+
})[];
|
|
6032
|
+
};
|
|
6033
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
|
6034
|
+
name: string;
|
|
6035
|
+
columns: readonly unknown[];
|
|
6036
|
+
} ? {
|
|
6037
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
|
6038
|
+
} : never : never;
|
|
6039
|
+
declare type TableType<Tables, TableName> = Tables & {
|
|
6040
|
+
name: TableName;
|
|
6041
|
+
} extends infer Table ? Table extends {
|
|
6042
|
+
name: string;
|
|
6043
|
+
columns: infer Columns;
|
|
6044
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
|
6045
|
+
name: string;
|
|
6046
|
+
type: string;
|
|
6047
|
+
} ? Identifiable & UnionToIntersection<Values<{
|
|
6048
|
+
[K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
|
|
6049
|
+
}>> : never : never : never : never;
|
|
6050
|
+
declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
|
|
6051
|
+
name: PropertyName;
|
|
6052
|
+
} extends infer Property ? Property extends {
|
|
6053
|
+
name: string;
|
|
6054
|
+
type: infer Type;
|
|
6055
|
+
link?: {
|
|
6056
|
+
table: infer LinkedTable;
|
|
6057
|
+
};
|
|
6058
|
+
columns?: infer ObjectColumns;
|
|
6059
|
+
notNull?: infer NotNull;
|
|
6060
|
+
} ? NotNull extends true ? {
|
|
6061
|
+
[K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
|
|
6062
|
+
} : {
|
|
6063
|
+
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
|
6064
|
+
} : never : never;
|
|
6065
|
+
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 {
|
|
6066
|
+
name: string;
|
|
6067
|
+
type: string;
|
|
6068
|
+
} ? UnionToIntersection<Values<{
|
|
6069
|
+
[K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
|
|
6070
|
+
}>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
|
|
6071
|
+
|
|
6072
|
+
/**
|
|
6073
|
+
* Operator to restrict results to only values that are greater than the given value.
|
|
6074
|
+
*/
|
|
6075
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3679
6076
|
/**
|
|
3680
6077
|
* Operator to restrict results to only values that are greater than the given value.
|
|
3681
6078
|
*/
|
|
@@ -3683,15 +6080,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
|
3683
6080
|
/**
|
|
3684
6081
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
3685
6082
|
*/
|
|
3686
|
-
declare const
|
|
6083
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
6084
|
+
/**
|
|
6085
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
6086
|
+
*/
|
|
6087
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3687
6088
|
/**
|
|
3688
6089
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
3689
6090
|
*/
|
|
3690
6091
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
6092
|
+
/**
|
|
6093
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
6094
|
+
*/
|
|
6095
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
6096
|
+
/**
|
|
6097
|
+
* Operator to restrict results to only values that are lower than the given value.
|
|
6098
|
+
*/
|
|
6099
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3691
6100
|
/**
|
|
3692
6101
|
* Operator to restrict results to only values that are lower than the given value.
|
|
3693
6102
|
*/
|
|
3694
6103
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
6104
|
+
/**
|
|
6105
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
|
6106
|
+
*/
|
|
6107
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
6108
|
+
/**
|
|
6109
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
|
6110
|
+
*/
|
|
6111
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3695
6112
|
/**
|
|
3696
6113
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
|
3697
6114
|
*/
|
|
@@ -3703,11 +6120,11 @@ declare const le: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
|
3703
6120
|
/**
|
|
3704
6121
|
* Operator to restrict results to only values that are not null.
|
|
3705
6122
|
*/
|
|
3706
|
-
declare const exists: <T>(column
|
|
6123
|
+
declare const exists: <T>(column?: ColumnsByValue<T, any> | undefined) => ExistanceFilter<T>;
|
|
3707
6124
|
/**
|
|
3708
6125
|
* Operator to restrict results to only values that are null.
|
|
3709
6126
|
*/
|
|
3710
|
-
declare const notExists: <T>(column
|
|
6127
|
+
declare const notExists: <T>(column?: ColumnsByValue<T, any> | undefined) => ExistanceFilter<T>;
|
|
3711
6128
|
/**
|
|
3712
6129
|
* Operator to restrict results to only values that start with the given prefix.
|
|
3713
6130
|
*/
|
|
@@ -3724,6 +6141,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
|
3724
6141
|
* Operator to restrict results to only values that are equal to the given value.
|
|
3725
6142
|
*/
|
|
3726
6143
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
|
6144
|
+
/**
|
|
6145
|
+
* Operator to restrict results to only values that are equal to the given value.
|
|
6146
|
+
*/
|
|
6147
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
|
3727
6148
|
/**
|
|
3728
6149
|
* Operator to restrict results to only values that are not equal to the given value.
|
|
3729
6150
|
*/
|
|
@@ -3752,15 +6173,12 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
|
3752
6173
|
declare type SchemaDefinition = {
|
|
3753
6174
|
table: string;
|
|
3754
6175
|
};
|
|
3755
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
|
6176
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
|
3756
6177
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
|
3757
|
-
} & {
|
|
3758
|
-
[key: string]: Repository<XataRecord$1>;
|
|
3759
6178
|
};
|
|
3760
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
|
6179
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
|
3761
6180
|
#private;
|
|
3762
|
-
|
|
3763
|
-
constructor(tableNames?: string[] | undefined);
|
|
6181
|
+
constructor(schemaTables?: Schemas.Table[]);
|
|
3764
6182
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
|
3765
6183
|
}
|
|
3766
6184
|
|
|
@@ -3775,20 +6193,35 @@ declare type BaseClientOptions = {
|
|
|
3775
6193
|
databaseURL?: string;
|
|
3776
6194
|
branch?: BranchStrategyOption;
|
|
3777
6195
|
cache?: CacheImpl;
|
|
6196
|
+
trace?: TraceFunction;
|
|
3778
6197
|
};
|
|
3779
6198
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
|
3780
6199
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
|
3781
|
-
new <Schemas extends Record<string,
|
|
6200
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
|
3782
6201
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
|
3783
6202
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
|
3784
6203
|
}, keyof Plugins> & {
|
|
3785
6204
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
|
6205
|
+
} & {
|
|
6206
|
+
getConfig(): Promise<{
|
|
6207
|
+
databaseURL: string;
|
|
6208
|
+
branch: string;
|
|
6209
|
+
}>;
|
|
3786
6210
|
};
|
|
3787
6211
|
}
|
|
3788
6212
|
declare const BaseClient_base: ClientConstructor<{}>;
|
|
3789
6213
|
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
|
3790
6214
|
}
|
|
3791
6215
|
|
|
6216
|
+
declare class Serializer {
|
|
6217
|
+
classes: Record<string, any>;
|
|
6218
|
+
add(clazz: any): void;
|
|
6219
|
+
toJSON<T>(data: T): string;
|
|
6220
|
+
fromJSON<T>(json: string): T;
|
|
6221
|
+
}
|
|
6222
|
+
declare const serialize: <T>(data: T) => string;
|
|
6223
|
+
declare const deserialize: <T>(json: string) => T;
|
|
6224
|
+
|
|
3792
6225
|
declare type BranchResolutionOptions = {
|
|
3793
6226
|
databaseURL?: string;
|
|
3794
6227
|
apiKey?: string;
|
|
@@ -3800,9 +6233,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
|
3800
6233
|
|
|
3801
6234
|
declare function getAPIKey(): string | undefined;
|
|
3802
6235
|
|
|
6236
|
+
interface Body {
|
|
6237
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
6238
|
+
blob(): Promise<Blob>;
|
|
6239
|
+
formData(): Promise<FormData>;
|
|
6240
|
+
json(): Promise<any>;
|
|
6241
|
+
text(): Promise<string>;
|
|
6242
|
+
}
|
|
6243
|
+
interface Blob {
|
|
6244
|
+
readonly size: number;
|
|
6245
|
+
readonly type: string;
|
|
6246
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
6247
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
6248
|
+
text(): Promise<string>;
|
|
6249
|
+
}
|
|
6250
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
|
6251
|
+
interface File extends Blob {
|
|
6252
|
+
readonly lastModified: number;
|
|
6253
|
+
readonly name: string;
|
|
6254
|
+
readonly webkitRelativePath: string;
|
|
6255
|
+
}
|
|
6256
|
+
declare type FormDataEntryValue = File | string;
|
|
6257
|
+
/** 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". */
|
|
6258
|
+
interface FormData {
|
|
6259
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
|
6260
|
+
delete(name: string): void;
|
|
6261
|
+
get(name: string): FormDataEntryValue | null;
|
|
6262
|
+
getAll(name: string): FormDataEntryValue[];
|
|
6263
|
+
has(name: string): boolean;
|
|
6264
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
|
6265
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
|
6266
|
+
}
|
|
6267
|
+
/** 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. */
|
|
6268
|
+
interface Headers {
|
|
6269
|
+
append(name: string, value: string): void;
|
|
6270
|
+
delete(name: string): void;
|
|
6271
|
+
get(name: string): string | null;
|
|
6272
|
+
has(name: string): boolean;
|
|
6273
|
+
set(name: string, value: string): void;
|
|
6274
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
6275
|
+
}
|
|
6276
|
+
interface Request extends Body {
|
|
6277
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
|
6278
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
|
6279
|
+
/** 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. */
|
|
6280
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
|
6281
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
|
6282
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
|
6283
|
+
/** 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. */
|
|
6284
|
+
readonly headers: Headers;
|
|
6285
|
+
/** 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] */
|
|
6286
|
+
readonly integrity: string;
|
|
6287
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
|
6288
|
+
readonly keepalive: boolean;
|
|
6289
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
|
6290
|
+
readonly method: string;
|
|
6291
|
+
/** 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. */
|
|
6292
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
|
6293
|
+
/** 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. */
|
|
6294
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
|
6295
|
+
/** 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. */
|
|
6296
|
+
readonly referrer: string;
|
|
6297
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
|
6298
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
6299
|
+
/** Returns the URL of request as a string. */
|
|
6300
|
+
readonly url: string;
|
|
6301
|
+
clone(): Request;
|
|
6302
|
+
}
|
|
6303
|
+
|
|
6304
|
+
declare type XataWorkerContext<XataClient> = {
|
|
6305
|
+
xata: XataClient;
|
|
6306
|
+
request: Request;
|
|
6307
|
+
env: Record<string, string | undefined>;
|
|
6308
|
+
};
|
|
6309
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
|
6310
|
+
declare type WorkerRunnerConfig = {
|
|
6311
|
+
workspace: string;
|
|
6312
|
+
worker: string;
|
|
6313
|
+
};
|
|
6314
|
+
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>>>;
|
|
6315
|
+
|
|
3803
6316
|
declare class XataError extends Error {
|
|
3804
6317
|
readonly status: number;
|
|
3805
6318
|
constructor(message: string, status: number);
|
|
3806
6319
|
}
|
|
3807
6320
|
|
|
3808
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, 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, 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, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
|
6321
|
+
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 };
|