@xata.io/client 0.0.0-alpha.vf0f8e71 → 0.0.0-alpha.vf1de7db
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 +116 -0
- package/README.md +27 -25
- package/Usage.md +62 -6
- package/dist/index.cjs +957 -366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2445 -215
- package/dist/index.mjs +906 -367
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
declare type AttributeDictionary = Record<string, string | number | boolean | undefined>;
|
2
|
+
declare type TraceFunction = <T>(name: string, fn: (options: {
|
3
|
+
setAttributes: (attrs: AttributeDictionary) => void;
|
4
|
+
}) => T, options?: AttributeDictionary) => Promise<T>;
|
5
|
+
|
1
6
|
declare type FetchImpl = (url: string, init?: {
|
2
7
|
body?: string;
|
3
8
|
headers?: Record<string, string>;
|
@@ -5,17 +10,19 @@ declare type FetchImpl = (url: string, init?: {
|
|
5
10
|
}) => Promise<{
|
6
11
|
ok: boolean;
|
7
12
|
status: number;
|
13
|
+
url: string;
|
8
14
|
json(): Promise<any>;
|
9
15
|
headers?: {
|
10
16
|
get(name: string): string | null;
|
11
17
|
};
|
12
18
|
}>;
|
13
|
-
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string
|
19
|
+
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
|
14
20
|
declare type FetcherExtraProps = {
|
15
21
|
apiUrl: string;
|
16
22
|
workspacesApiUrl: string | WorkspaceApiUrlBuilder;
|
17
23
|
fetchImpl: FetchImpl;
|
18
24
|
apiKey: string;
|
25
|
+
trace: TraceFunction;
|
19
26
|
};
|
20
27
|
declare type ErrorWrapper<TError> = TError | {
|
21
28
|
status: 'unknown';
|
@@ -23,7 +30,6 @@ declare type ErrorWrapper<TError> = TError | {
|
|
23
30
|
};
|
24
31
|
|
25
32
|
interface CacheImpl {
|
26
|
-
cacheRecords: boolean;
|
27
33
|
defaultQueryTTL: number;
|
28
34
|
getAll(): Promise<Record<string, unknown>>;
|
29
35
|
get: <T>(key: string) => Promise<T | null>;
|
@@ -33,13 +39,11 @@ interface CacheImpl {
|
|
33
39
|
}
|
34
40
|
interface SimpleCacheOptions {
|
35
41
|
max?: number;
|
36
|
-
cacheRecords?: boolean;
|
37
42
|
defaultQueryTTL?: number;
|
38
43
|
}
|
39
44
|
declare class SimpleCache implements CacheImpl {
|
40
45
|
#private;
|
41
46
|
capacity: number;
|
42
|
-
cacheRecords: boolean;
|
43
47
|
defaultQueryTTL: number;
|
44
48
|
constructor(options?: SimpleCacheOptions);
|
45
49
|
getAll(): Promise<Record<string, unknown>>;
|
@@ -55,6 +59,7 @@ declare abstract class XataPlugin {
|
|
55
59
|
declare type XataPluginOptions = {
|
56
60
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
57
61
|
cache: CacheImpl;
|
62
|
+
trace?: TraceFunction;
|
58
63
|
};
|
59
64
|
|
60
65
|
/**
|
@@ -63,6 +68,9 @@ declare type XataPluginOptions = {
|
|
63
68
|
* @version 1.0
|
64
69
|
*/
|
65
70
|
declare type User = {
|
71
|
+
/**
|
72
|
+
* @format email
|
73
|
+
*/
|
66
74
|
email: string;
|
67
75
|
fullname: string;
|
68
76
|
image: string;
|
@@ -94,7 +102,7 @@ declare type WorkspaceID = string;
|
|
94
102
|
declare type Role = 'owner' | 'maintainer';
|
95
103
|
declare type WorkspaceMeta = {
|
96
104
|
name: string;
|
97
|
-
slug
|
105
|
+
slug?: string;
|
98
106
|
};
|
99
107
|
declare type Workspace = WorkspaceMeta & {
|
100
108
|
id: WorkspaceID;
|
@@ -104,6 +112,9 @@ declare type Workspace = WorkspaceMeta & {
|
|
104
112
|
declare type WorkspaceMember = {
|
105
113
|
userId: UserID;
|
106
114
|
fullname: string;
|
115
|
+
/**
|
116
|
+
* @format email
|
117
|
+
*/
|
107
118
|
email: string;
|
108
119
|
role: Role;
|
109
120
|
};
|
@@ -113,7 +124,13 @@ declare type WorkspaceMember = {
|
|
113
124
|
declare type InviteID = string;
|
114
125
|
declare type WorkspaceInvite = {
|
115
126
|
inviteId: InviteID;
|
127
|
+
/**
|
128
|
+
* @format email
|
129
|
+
*/
|
116
130
|
email: string;
|
131
|
+
/**
|
132
|
+
* @format date-time
|
133
|
+
*/
|
117
134
|
expires: string;
|
118
135
|
role: Role;
|
119
136
|
};
|
@@ -125,20 +142,40 @@ declare type WorkspaceMembers = {
|
|
125
142
|
* @pattern ^ik_[a-zA-Z0-9]+
|
126
143
|
*/
|
127
144
|
declare type InviteKey = string;
|
145
|
+
/**
|
146
|
+
* Metadata of databases
|
147
|
+
*/
|
148
|
+
declare type DatabaseMetadata = {
|
149
|
+
/**
|
150
|
+
* The machine-readable name of a database
|
151
|
+
*/
|
152
|
+
name: string;
|
153
|
+
/**
|
154
|
+
* The time this database was created
|
155
|
+
*/
|
156
|
+
createdAt: DateTime;
|
157
|
+
/**
|
158
|
+
* The number of branches the database has
|
159
|
+
*/
|
160
|
+
numberOfBranches: number;
|
161
|
+
/**
|
162
|
+
* Metadata about the database for display in Xata user interfaces
|
163
|
+
*/
|
164
|
+
ui?: {
|
165
|
+
/**
|
166
|
+
* The user-selected color for this database across interfaces
|
167
|
+
*/
|
168
|
+
color?: string;
|
169
|
+
};
|
170
|
+
};
|
128
171
|
declare type ListDatabasesResponse = {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
numberOfBranches: number;
|
134
|
-
ui?: {
|
135
|
-
color?: string;
|
136
|
-
};
|
137
|
-
}[];
|
172
|
+
/**
|
173
|
+
* A list of databases in a Xata workspace
|
174
|
+
*/
|
175
|
+
databases?: DatabaseMetadata[];
|
138
176
|
};
|
139
177
|
declare type ListBranchesResponse = {
|
140
178
|
databaseName: string;
|
141
|
-
displayName: string;
|
142
179
|
branches: Branch[];
|
143
180
|
};
|
144
181
|
declare type ListGitBranchesResponse = {
|
@@ -156,8 +193,14 @@ declare type Branch = {
|
|
156
193
|
* @x-go-type xata.BranchMetadata
|
157
194
|
*/
|
158
195
|
declare type BranchMetadata = {
|
196
|
+
/**
|
197
|
+
* @minLength 1
|
198
|
+
*/
|
159
199
|
repository?: string;
|
160
200
|
branch?: BranchName;
|
201
|
+
/**
|
202
|
+
* @minLength 1
|
203
|
+
*/
|
161
204
|
stage?: string;
|
162
205
|
labels?: string[];
|
163
206
|
};
|
@@ -184,12 +227,28 @@ declare type Schema = {
|
|
184
227
|
tables: Table[];
|
185
228
|
tablesOrder?: string[];
|
186
229
|
};
|
230
|
+
/**
|
231
|
+
* @x-internal true
|
232
|
+
*/
|
233
|
+
declare type SchemaEditScript = {
|
234
|
+
sourceMigrationID?: string;
|
235
|
+
targetMigrationID?: string;
|
236
|
+
tables: TableEdit[];
|
237
|
+
};
|
187
238
|
declare type Table = {
|
188
239
|
id?: string;
|
189
240
|
name: TableName;
|
190
241
|
columns: Column[];
|
191
242
|
revLinks?: RevLink[];
|
192
243
|
};
|
244
|
+
/**
|
245
|
+
* @x-internal true
|
246
|
+
*/
|
247
|
+
declare type TableEdit = {
|
248
|
+
oldName?: string;
|
249
|
+
newName?: string;
|
250
|
+
columns?: MigrationColumnOp[];
|
251
|
+
};
|
193
252
|
/**
|
194
253
|
* @x-go-type xata.Column
|
195
254
|
*/
|
@@ -199,6 +258,8 @@ declare type Column = {
|
|
199
258
|
link?: {
|
200
259
|
table: string;
|
201
260
|
};
|
261
|
+
notNull?: boolean;
|
262
|
+
unique?: boolean;
|
202
263
|
columns?: Column[];
|
203
264
|
};
|
204
265
|
declare type RevLink = {
|
@@ -265,6 +326,137 @@ declare type ColumnMigration = {
|
|
265
326
|
old: Column;
|
266
327
|
['new']: Column;
|
267
328
|
};
|
329
|
+
/**
|
330
|
+
* @x-internal true
|
331
|
+
*/
|
332
|
+
declare type Commit = {
|
333
|
+
meta?: {
|
334
|
+
title?: string;
|
335
|
+
message?: string;
|
336
|
+
id: string;
|
337
|
+
parentID?: string;
|
338
|
+
mergeParentID?: string;
|
339
|
+
status: string;
|
340
|
+
createdAt: DateTime;
|
341
|
+
modifiedAt?: DateTime;
|
342
|
+
};
|
343
|
+
operations: MigrationOp[];
|
344
|
+
};
|
345
|
+
/**
|
346
|
+
* Branch schema migration.
|
347
|
+
*
|
348
|
+
* @x-internal true
|
349
|
+
*/
|
350
|
+
declare type Migration = {
|
351
|
+
parentID?: string;
|
352
|
+
operations: MigrationOp[];
|
353
|
+
};
|
354
|
+
/**
|
355
|
+
* Branch schema migration operations.
|
356
|
+
*
|
357
|
+
* @x-internal true
|
358
|
+
*/
|
359
|
+
declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
|
360
|
+
/**
|
361
|
+
* @x-internal true
|
362
|
+
*/
|
363
|
+
declare type MigrationTableOp = {
|
364
|
+
addTable: TableOpAdd;
|
365
|
+
} | {
|
366
|
+
removeTable: TableOpRemove;
|
367
|
+
} | {
|
368
|
+
renameTable: TableOpRename;
|
369
|
+
};
|
370
|
+
/**
|
371
|
+
* @x-internal true
|
372
|
+
*/
|
373
|
+
declare type MigrationColumnOp = {
|
374
|
+
addColumn: ColumnOpAdd;
|
375
|
+
} | {
|
376
|
+
removeColumn: ColumnOpRemove;
|
377
|
+
} | {
|
378
|
+
renameColumn: ColumnOpRename;
|
379
|
+
};
|
380
|
+
/**
|
381
|
+
* @x-internal true
|
382
|
+
*/
|
383
|
+
declare type TableOpAdd = {
|
384
|
+
table: string;
|
385
|
+
};
|
386
|
+
/**
|
387
|
+
* @x-internal true
|
388
|
+
*/
|
389
|
+
declare type TableOpRemove = {
|
390
|
+
table: string;
|
391
|
+
};
|
392
|
+
/**
|
393
|
+
* @x-internal true
|
394
|
+
*/
|
395
|
+
declare type TableOpRename = {
|
396
|
+
oldName: string;
|
397
|
+
newName: string;
|
398
|
+
};
|
399
|
+
/**
|
400
|
+
* @x-internal true
|
401
|
+
*/
|
402
|
+
declare type ColumnOpAdd = {
|
403
|
+
table?: string;
|
404
|
+
column: Column;
|
405
|
+
};
|
406
|
+
/**
|
407
|
+
* @x-internal true
|
408
|
+
*/
|
409
|
+
declare type ColumnOpRemove = {
|
410
|
+
table?: string;
|
411
|
+
column: string;
|
412
|
+
};
|
413
|
+
/**
|
414
|
+
* @x-internal true
|
415
|
+
*/
|
416
|
+
declare type ColumnOpRename = {
|
417
|
+
table?: string;
|
418
|
+
oldName: string;
|
419
|
+
newName: string;
|
420
|
+
};
|
421
|
+
declare type MigrationRequest = {
|
422
|
+
/**
|
423
|
+
* The migration request number.
|
424
|
+
*/
|
425
|
+
number: number;
|
426
|
+
/**
|
427
|
+
* Migration request creation timestamp.
|
428
|
+
*/
|
429
|
+
createdAt: DateTime;
|
430
|
+
/**
|
431
|
+
* Last modified timestamp.
|
432
|
+
*/
|
433
|
+
modifiedAt?: DateTime;
|
434
|
+
/**
|
435
|
+
* Timestamp when the migration request was closed.
|
436
|
+
*/
|
437
|
+
closedAt?: DateTime;
|
438
|
+
/**
|
439
|
+
* Timestamp when the migration request was merged.
|
440
|
+
*/
|
441
|
+
mergedAt?: DateTime;
|
442
|
+
status: 'open' | 'closed' | 'merging' | 'merged';
|
443
|
+
/**
|
444
|
+
* The migration request title.
|
445
|
+
*/
|
446
|
+
title: string;
|
447
|
+
/**
|
448
|
+
* The migration request body with detailed description.
|
449
|
+
*/
|
450
|
+
body: string;
|
451
|
+
/**
|
452
|
+
* Name of the source branch.
|
453
|
+
*/
|
454
|
+
source: string;
|
455
|
+
/**
|
456
|
+
* Name of the target branch.
|
457
|
+
*/
|
458
|
+
target: string;
|
459
|
+
};
|
268
460
|
declare type SortExpression = string[] | {
|
269
461
|
[key: string]: SortOrder;
|
270
462
|
} | {
|
@@ -273,7 +465,7 @@ declare type SortExpression = string[] | {
|
|
273
465
|
declare type SortOrder = 'asc' | 'desc';
|
274
466
|
/**
|
275
467
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
276
|
-
* distance is the number of one
|
468
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
277
469
|
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
278
470
|
* to allow two typos in a word.
|
279
471
|
*
|
@@ -286,6 +478,23 @@ declare type FuzzinessExpression = number;
|
|
286
478
|
* 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
479
|
*/
|
288
480
|
declare type PrefixExpression = 'phrase' | 'disabled';
|
481
|
+
/**
|
482
|
+
* The target expression is used to filter the search results by the target columns.
|
483
|
+
*/
|
484
|
+
declare type TargetExpression = (string | {
|
485
|
+
/**
|
486
|
+
* The name of the column.
|
487
|
+
*/
|
488
|
+
column: string;
|
489
|
+
/**
|
490
|
+
* The weight of the column.
|
491
|
+
*
|
492
|
+
* @default 1
|
493
|
+
* @maximum 10
|
494
|
+
* @minimum 1
|
495
|
+
*/
|
496
|
+
weight?: number;
|
497
|
+
})[];
|
289
498
|
/**
|
290
499
|
* @minProperties 1
|
291
500
|
*/
|
@@ -299,10 +508,122 @@ declare type FilterExpression = {
|
|
299
508
|
} & {
|
300
509
|
[key: string]: FilterColumn;
|
301
510
|
};
|
511
|
+
/**
|
512
|
+
* The description of the summaries you wish to receive. Set each key to be the field name
|
513
|
+
* you'd like for the summary. These names must not collide with other columns you've
|
514
|
+
* requested from `columns`; including implicit requests like `settings.*`.
|
515
|
+
*
|
516
|
+
* The value for each key needs to be an object. This object should contain one key and one
|
517
|
+
* value only. In this object, the key should be set to the summary function you wish to use
|
518
|
+
* and the value set to the column name to be summarized.
|
519
|
+
*
|
520
|
+
* The column being summarized cannot be an internal column (id, xata.*), nor the base of
|
521
|
+
* an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
|
522
|
+
* `settings.dark_mode` but not `settings` nor `settings.*`.
|
523
|
+
*
|
524
|
+
* @example {"all_users":{"count":"*"}}
|
525
|
+
* @example {"total_created":{"count":"created_at"}}
|
526
|
+
* @x-go-type xbquery.SummaryList
|
527
|
+
*/
|
528
|
+
declare type SummaryExpressionList = {
|
529
|
+
[key: string]: SummaryExpression;
|
530
|
+
};
|
531
|
+
/**
|
532
|
+
* A summary expression is the description of a single summary operation. It consists of a single
|
533
|
+
* key representing the operation, and a value representing the column to be operated on.
|
534
|
+
*
|
535
|
+
* The column being summarized cannot be an internal column (id, xata.*), nor the base of
|
536
|
+
* an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
|
537
|
+
* `settings.dark_mode` but not `settings` nor `settings.*`.
|
538
|
+
*
|
539
|
+
* We currently support the `count` operation. When using `count`, one can set a column name
|
540
|
+
* as the value. Xata will return the total number times this column is non-null in each group.
|
541
|
+
*
|
542
|
+
* Alternately, if you'd like to count the total rows in each group - irregardless of null/not null
|
543
|
+
* status - you can set `count` to `*` to count everything.
|
544
|
+
*
|
545
|
+
* @example {"count":"deleted_at"}
|
546
|
+
* @x-go-type xbquery.Summary
|
547
|
+
*/
|
548
|
+
declare type SummaryExpression = Record<string, any>;
|
302
549
|
declare type HighlightExpression = {
|
550
|
+
/**
|
551
|
+
* Set to `false` to disable highlighting. By default it is `true`.
|
552
|
+
*/
|
303
553
|
enabled?: boolean;
|
554
|
+
/**
|
555
|
+
* Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
|
556
|
+
*/
|
304
557
|
encodeHTML?: boolean;
|
305
558
|
};
|
559
|
+
/**
|
560
|
+
* Booster Expression
|
561
|
+
*
|
562
|
+
* @x-go-type xata.BoosterExpression
|
563
|
+
*/
|
564
|
+
declare type BoosterExpression = {
|
565
|
+
valueBooster?: ValueBooster$1;
|
566
|
+
} | {
|
567
|
+
numericBooster?: NumericBooster$1;
|
568
|
+
} | {
|
569
|
+
dateBooster?: DateBooster$1;
|
570
|
+
};
|
571
|
+
/**
|
572
|
+
* Boost records with a particular value for a column.
|
573
|
+
*/
|
574
|
+
declare type ValueBooster$1 = {
|
575
|
+
/**
|
576
|
+
* The column in which to look for the value.
|
577
|
+
*/
|
578
|
+
column: string;
|
579
|
+
/**
|
580
|
+
* The exact value to boost.
|
581
|
+
*/
|
582
|
+
value: string | number | boolean;
|
583
|
+
/**
|
584
|
+
* The factor with which to multiply the score of the record.
|
585
|
+
*/
|
586
|
+
factor: number;
|
587
|
+
};
|
588
|
+
/**
|
589
|
+
* Boost records based on the value of a numeric column.
|
590
|
+
*/
|
591
|
+
declare type NumericBooster$1 = {
|
592
|
+
/**
|
593
|
+
* The column in which to look for the value.
|
594
|
+
*/
|
595
|
+
column: string;
|
596
|
+
/**
|
597
|
+
* The factor with which to multiply the value of the column before adding it to the item score.
|
598
|
+
*/
|
599
|
+
factor: number;
|
600
|
+
};
|
601
|
+
/**
|
602
|
+
* Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
|
603
|
+
* 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
|
604
|
+
* 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.
|
605
|
+
*/
|
606
|
+
declare type DateBooster$1 = {
|
607
|
+
/**
|
608
|
+
* The column in which to look for the value.
|
609
|
+
*/
|
610
|
+
column: string;
|
611
|
+
/**
|
612
|
+
* 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.
|
613
|
+
* If it is not specified, the current date and time is used.
|
614
|
+
*/
|
615
|
+
origin?: string;
|
616
|
+
/**
|
617
|
+
* 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`.
|
618
|
+
*
|
619
|
+
* @pattern ^(\d+)(d|h|m|s|ms)$
|
620
|
+
*/
|
621
|
+
scale: string;
|
622
|
+
/**
|
623
|
+
* The decay factor to expect at "scale" distance from the "origin".
|
624
|
+
*/
|
625
|
+
decay: number;
|
626
|
+
};
|
306
627
|
declare type FilterList = FilterExpression | FilterExpression[];
|
307
628
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
308
629
|
/**
|
@@ -352,14 +673,73 @@ declare type FilterValue = number | string | boolean;
|
|
352
673
|
* Pagination settings.
|
353
674
|
*/
|
354
675
|
declare type PageConfig = {
|
676
|
+
/**
|
677
|
+
* Query the next page that follow the cursor.
|
678
|
+
*/
|
355
679
|
after?: string;
|
680
|
+
/**
|
681
|
+
* Query the previous page before the cursor.
|
682
|
+
*/
|
356
683
|
before?: string;
|
684
|
+
/**
|
685
|
+
* Query the first page from the cursor.
|
686
|
+
*/
|
357
687
|
first?: string;
|
688
|
+
/**
|
689
|
+
* Query the last page from the cursor.
|
690
|
+
*/
|
358
691
|
last?: string;
|
692
|
+
/**
|
693
|
+
* 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.
|
694
|
+
*
|
695
|
+
* @default 20
|
696
|
+
*/
|
359
697
|
size?: number;
|
698
|
+
/**
|
699
|
+
* Use offset to skip entries. To skip pages set offset to a multiple of size.
|
700
|
+
*
|
701
|
+
* @default 0
|
702
|
+
*/
|
360
703
|
offset?: number;
|
361
704
|
};
|
362
|
-
|
705
|
+
/**
|
706
|
+
* @example name
|
707
|
+
* @example email
|
708
|
+
* @example created_at
|
709
|
+
*/
|
710
|
+
declare type ColumnsProjection = string[];
|
711
|
+
/**
|
712
|
+
* Xata Table Record Metadata
|
713
|
+
*/
|
714
|
+
declare type RecordMeta = {
|
715
|
+
id: RecordID;
|
716
|
+
xata: {
|
717
|
+
/**
|
718
|
+
* The record's version. Can be used for optimistic concurrency control.
|
719
|
+
*/
|
720
|
+
version: number;
|
721
|
+
/**
|
722
|
+
* The record's table name. APIs that return records from multiple tables will set this field accordingly.
|
723
|
+
*/
|
724
|
+
table?: string;
|
725
|
+
/**
|
726
|
+
* Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
|
727
|
+
*/
|
728
|
+
highlight?: {
|
729
|
+
[key: string]: string[] | {
|
730
|
+
[key: string]: any;
|
731
|
+
};
|
732
|
+
};
|
733
|
+
/**
|
734
|
+
* The record's relevancy score. This is returned by the search APIs.
|
735
|
+
*/
|
736
|
+
score?: number;
|
737
|
+
/**
|
738
|
+
* Encoding/Decoding errors
|
739
|
+
*/
|
740
|
+
warnings?: string[];
|
741
|
+
};
|
742
|
+
};
|
363
743
|
/**
|
364
744
|
* @pattern [a-zA-Z0-9_-~:]+
|
365
745
|
*/
|
@@ -368,7 +748,13 @@ declare type RecordID = string;
|
|
368
748
|
* @example {"newName":"newName","oldName":"oldName"}
|
369
749
|
*/
|
370
750
|
declare type TableRename = {
|
751
|
+
/**
|
752
|
+
* @minLength 1
|
753
|
+
*/
|
371
754
|
newName: string;
|
755
|
+
/**
|
756
|
+
* @minLength 1
|
757
|
+
*/
|
372
758
|
oldName: string;
|
373
759
|
};
|
374
760
|
/**
|
@@ -376,26 +762,52 @@ declare type TableRename = {
|
|
376
762
|
*/
|
377
763
|
declare type RecordsMetadata = {
|
378
764
|
page: {
|
765
|
+
/**
|
766
|
+
* last record id
|
767
|
+
*/
|
379
768
|
cursor: string;
|
769
|
+
/**
|
770
|
+
* true if more records can be fetch
|
771
|
+
*/
|
380
772
|
more: boolean;
|
381
773
|
};
|
382
774
|
};
|
383
775
|
/**
|
384
|
-
*
|
776
|
+
* Metadata of databases
|
385
777
|
*/
|
386
|
-
declare type
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
778
|
+
declare type CPDatabaseMetadata = {
|
779
|
+
/**
|
780
|
+
* The machine-readable name of a database
|
781
|
+
*/
|
782
|
+
name: string;
|
783
|
+
/**
|
784
|
+
* Region where this database is hosted
|
785
|
+
*/
|
786
|
+
region: string;
|
787
|
+
/**
|
788
|
+
* The time this database was created
|
789
|
+
*/
|
790
|
+
createdAt: DateTime;
|
791
|
+
/**
|
792
|
+
* Metadata about the database for display in Xata user interfaces
|
793
|
+
*/
|
794
|
+
ui?: {
|
795
|
+
/**
|
796
|
+
* The user-selected color for this database across interfaces
|
797
|
+
*/
|
798
|
+
color?: string;
|
397
799
|
};
|
398
|
-
}
|
800
|
+
};
|
801
|
+
declare type CPListDatabasesResponse = {
|
802
|
+
/**
|
803
|
+
* A list of databases in a Xata workspace
|
804
|
+
*/
|
805
|
+
databases?: CPDatabaseMetadata[];
|
806
|
+
};
|
807
|
+
/**
|
808
|
+
* Xata Table Record Metadata
|
809
|
+
*/
|
810
|
+
declare type XataRecord$1 = RecordMeta & {
|
399
811
|
[key: string]: any;
|
400
812
|
};
|
401
813
|
|
@@ -413,6 +825,7 @@ type schemas_InviteID = InviteID;
|
|
413
825
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
414
826
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
415
827
|
type schemas_InviteKey = InviteKey;
|
828
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
416
829
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
417
830
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
418
831
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
@@ -421,7 +834,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
421
834
|
type schemas_DBBranch = DBBranch;
|
422
835
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
423
836
|
type schemas_Schema = Schema;
|
837
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
424
838
|
type schemas_Table = Table;
|
839
|
+
type schemas_TableEdit = TableEdit;
|
425
840
|
type schemas_Column = Column;
|
426
841
|
type schemas_RevLink = RevLink;
|
427
842
|
type schemas_BranchName = BranchName;
|
@@ -434,12 +849,28 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
434
849
|
type schemas_BranchMigration = BranchMigration;
|
435
850
|
type schemas_TableMigration = TableMigration;
|
436
851
|
type schemas_ColumnMigration = ColumnMigration;
|
852
|
+
type schemas_Commit = Commit;
|
853
|
+
type schemas_Migration = Migration;
|
854
|
+
type schemas_MigrationOp = MigrationOp;
|
855
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
856
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
857
|
+
type schemas_TableOpAdd = TableOpAdd;
|
858
|
+
type schemas_TableOpRemove = TableOpRemove;
|
859
|
+
type schemas_TableOpRename = TableOpRename;
|
860
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
861
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
862
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
863
|
+
type schemas_MigrationRequest = MigrationRequest;
|
437
864
|
type schemas_SortExpression = SortExpression;
|
438
865
|
type schemas_SortOrder = SortOrder;
|
439
866
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
440
867
|
type schemas_PrefixExpression = PrefixExpression;
|
868
|
+
type schemas_TargetExpression = TargetExpression;
|
441
869
|
type schemas_FilterExpression = FilterExpression;
|
870
|
+
type schemas_SummaryExpressionList = SummaryExpressionList;
|
871
|
+
type schemas_SummaryExpression = SummaryExpression;
|
442
872
|
type schemas_HighlightExpression = HighlightExpression;
|
873
|
+
type schemas_BoosterExpression = BoosterExpression;
|
443
874
|
type schemas_FilterList = FilterList;
|
444
875
|
type schemas_FilterColumn = FilterColumn;
|
445
876
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -449,10 +880,13 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
449
880
|
type schemas_FilterRangeValue = FilterRangeValue;
|
450
881
|
type schemas_FilterValue = FilterValue;
|
451
882
|
type schemas_PageConfig = PageConfig;
|
452
|
-
type
|
883
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
884
|
+
type schemas_RecordMeta = RecordMeta;
|
453
885
|
type schemas_RecordID = RecordID;
|
454
886
|
type schemas_TableRename = TableRename;
|
455
887
|
type schemas_RecordsMetadata = RecordsMetadata;
|
888
|
+
type schemas_CPDatabaseMetadata = CPDatabaseMetadata;
|
889
|
+
type schemas_CPListDatabasesResponse = CPListDatabasesResponse;
|
456
890
|
declare namespace schemas {
|
457
891
|
export {
|
458
892
|
schemas_User as User,
|
@@ -469,6 +903,7 @@ declare namespace schemas {
|
|
469
903
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
470
904
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
471
905
|
schemas_InviteKey as InviteKey,
|
906
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
472
907
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
473
908
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
474
909
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
@@ -477,7 +912,9 @@ declare namespace schemas {
|
|
477
912
|
schemas_DBBranch as DBBranch,
|
478
913
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
479
914
|
schemas_Schema as Schema,
|
915
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
480
916
|
schemas_Table as Table,
|
917
|
+
schemas_TableEdit as TableEdit,
|
481
918
|
schemas_Column as Column,
|
482
919
|
schemas_RevLink as RevLink,
|
483
920
|
schemas_BranchName as BranchName,
|
@@ -490,12 +927,31 @@ declare namespace schemas {
|
|
490
927
|
schemas_BranchMigration as BranchMigration,
|
491
928
|
schemas_TableMigration as TableMigration,
|
492
929
|
schemas_ColumnMigration as ColumnMigration,
|
930
|
+
schemas_Commit as Commit,
|
931
|
+
schemas_Migration as Migration,
|
932
|
+
schemas_MigrationOp as MigrationOp,
|
933
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
934
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
935
|
+
schemas_TableOpAdd as TableOpAdd,
|
936
|
+
schemas_TableOpRemove as TableOpRemove,
|
937
|
+
schemas_TableOpRename as TableOpRename,
|
938
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
939
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
940
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
941
|
+
schemas_MigrationRequest as MigrationRequest,
|
493
942
|
schemas_SortExpression as SortExpression,
|
494
943
|
schemas_SortOrder as SortOrder,
|
495
944
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
496
945
|
schemas_PrefixExpression as PrefixExpression,
|
946
|
+
schemas_TargetExpression as TargetExpression,
|
497
947
|
schemas_FilterExpression as FilterExpression,
|
948
|
+
schemas_SummaryExpressionList as SummaryExpressionList,
|
949
|
+
schemas_SummaryExpression as SummaryExpression,
|
498
950
|
schemas_HighlightExpression as HighlightExpression,
|
951
|
+
schemas_BoosterExpression as BoosterExpression,
|
952
|
+
ValueBooster$1 as ValueBooster,
|
953
|
+
NumericBooster$1 as NumericBooster,
|
954
|
+
DateBooster$1 as DateBooster,
|
499
955
|
schemas_FilterList as FilterList,
|
500
956
|
schemas_FilterColumn as FilterColumn,
|
501
957
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -505,10 +961,13 @@ declare namespace schemas {
|
|
505
961
|
schemas_FilterRangeValue as FilterRangeValue,
|
506
962
|
schemas_FilterValue as FilterValue,
|
507
963
|
schemas_PageConfig as PageConfig,
|
508
|
-
|
964
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
965
|
+
schemas_RecordMeta as RecordMeta,
|
509
966
|
schemas_RecordID as RecordID,
|
510
967
|
schemas_TableRename as TableRename,
|
511
968
|
schemas_RecordsMetadata as RecordsMetadata,
|
969
|
+
schemas_CPDatabaseMetadata as CPDatabaseMetadata,
|
970
|
+
schemas_CPListDatabasesResponse as CPListDatabasesResponse,
|
512
971
|
XataRecord$1 as XataRecord,
|
513
972
|
};
|
514
973
|
}
|
@@ -540,11 +999,22 @@ declare type BulkError = {
|
|
540
999
|
status?: number;
|
541
1000
|
}[];
|
542
1001
|
};
|
1002
|
+
declare type BulkInsertResponse = {
|
1003
|
+
recordIDs: string[];
|
1004
|
+
} | {
|
1005
|
+
records: XataRecord$1[];
|
1006
|
+
};
|
543
1007
|
declare type BranchMigrationPlan = {
|
544
1008
|
version: number;
|
545
1009
|
migration: BranchMigration;
|
546
1010
|
};
|
547
|
-
declare type
|
1011
|
+
declare type RecordResponse = XataRecord$1;
|
1012
|
+
declare type SchemaCompareResponse = {
|
1013
|
+
source: Schema;
|
1014
|
+
target: Schema;
|
1015
|
+
edits: SchemaEditScript;
|
1016
|
+
};
|
1017
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
548
1018
|
id: string;
|
549
1019
|
xata: {
|
550
1020
|
version: number;
|
@@ -554,13 +1024,20 @@ declare type QueryResponse = {
|
|
554
1024
|
records: XataRecord$1[];
|
555
1025
|
meta: RecordsMetadata;
|
556
1026
|
};
|
1027
|
+
declare type SummarizeResponse = {
|
1028
|
+
summaries: Record<string, any>[];
|
1029
|
+
};
|
557
1030
|
declare type SearchResponse = {
|
558
1031
|
records: XataRecord$1[];
|
1032
|
+
warning?: string;
|
559
1033
|
};
|
560
1034
|
/**
|
561
1035
|
* @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
|
562
1036
|
*/
|
563
1037
|
declare type MigrationIdResponse = {
|
1038
|
+
/**
|
1039
|
+
* @minLength 1
|
1040
|
+
*/
|
564
1041
|
migrationID: string;
|
565
1042
|
};
|
566
1043
|
|
@@ -568,9 +1045,13 @@ type responses_SimpleError = SimpleError;
|
|
568
1045
|
type responses_BadRequestError = BadRequestError;
|
569
1046
|
type responses_AuthError = AuthError;
|
570
1047
|
type responses_BulkError = BulkError;
|
1048
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
571
1049
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
1050
|
+
type responses_RecordResponse = RecordResponse;
|
1051
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
572
1052
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
573
1053
|
type responses_QueryResponse = QueryResponse;
|
1054
|
+
type responses_SummarizeResponse = SummarizeResponse;
|
574
1055
|
type responses_SearchResponse = SearchResponse;
|
575
1056
|
type responses_MigrationIdResponse = MigrationIdResponse;
|
576
1057
|
declare namespace responses {
|
@@ -579,9 +1060,13 @@ declare namespace responses {
|
|
579
1060
|
responses_BadRequestError as BadRequestError,
|
580
1061
|
responses_AuthError as AuthError,
|
581
1062
|
responses_BulkError as BulkError,
|
1063
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
582
1064
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
1065
|
+
responses_RecordResponse as RecordResponse,
|
1066
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
583
1067
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
584
1068
|
responses_QueryResponse as QueryResponse,
|
1069
|
+
responses_SummarizeResponse as SummarizeResponse,
|
585
1070
|
responses_SearchResponse as SearchResponse,
|
586
1071
|
responses_MigrationIdResponse as MigrationIdResponse,
|
587
1072
|
};
|
@@ -662,6 +1147,9 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
|
|
662
1147
|
*/
|
663
1148
|
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
|
664
1149
|
declare type CreateUserAPIKeyPathParams = {
|
1150
|
+
/**
|
1151
|
+
* API Key name
|
1152
|
+
*/
|
665
1153
|
keyName: APIKeyName;
|
666
1154
|
};
|
667
1155
|
declare type CreateUserAPIKeyError = ErrorWrapper<{
|
@@ -687,6 +1175,9 @@ declare type CreateUserAPIKeyVariables = {
|
|
687
1175
|
*/
|
688
1176
|
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
|
689
1177
|
declare type DeleteUserAPIKeyPathParams = {
|
1178
|
+
/**
|
1179
|
+
* API Key name
|
1180
|
+
*/
|
690
1181
|
keyName: APIKeyName;
|
691
1182
|
};
|
692
1183
|
declare type DeleteUserAPIKeyError = ErrorWrapper<{
|
@@ -747,6 +1238,9 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
|
|
747
1238
|
*/
|
748
1239
|
declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
|
749
1240
|
declare type GetWorkspacePathParams = {
|
1241
|
+
/**
|
1242
|
+
* Workspace name
|
1243
|
+
*/
|
750
1244
|
workspaceId: WorkspaceID;
|
751
1245
|
};
|
752
1246
|
declare type GetWorkspaceError = ErrorWrapper<{
|
@@ -767,6 +1261,9 @@ declare type GetWorkspaceVariables = {
|
|
767
1261
|
*/
|
768
1262
|
declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
|
769
1263
|
declare type UpdateWorkspacePathParams = {
|
1264
|
+
/**
|
1265
|
+
* Workspace name
|
1266
|
+
*/
|
770
1267
|
workspaceId: WorkspaceID;
|
771
1268
|
};
|
772
1269
|
declare type UpdateWorkspaceError = ErrorWrapper<{
|
@@ -788,6 +1285,9 @@ declare type UpdateWorkspaceVariables = {
|
|
788
1285
|
*/
|
789
1286
|
declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
|
790
1287
|
declare type DeleteWorkspacePathParams = {
|
1288
|
+
/**
|
1289
|
+
* Workspace name
|
1290
|
+
*/
|
791
1291
|
workspaceId: WorkspaceID;
|
792
1292
|
};
|
793
1293
|
declare type DeleteWorkspaceError = ErrorWrapper<{
|
@@ -808,6 +1308,9 @@ declare type DeleteWorkspaceVariables = {
|
|
808
1308
|
*/
|
809
1309
|
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
|
810
1310
|
declare type GetWorkspaceMembersListPathParams = {
|
1311
|
+
/**
|
1312
|
+
* Workspace name
|
1313
|
+
*/
|
811
1314
|
workspaceId: WorkspaceID;
|
812
1315
|
};
|
813
1316
|
declare type GetWorkspaceMembersListError = ErrorWrapper<{
|
@@ -828,7 +1331,13 @@ declare type GetWorkspaceMembersListVariables = {
|
|
828
1331
|
*/
|
829
1332
|
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
|
830
1333
|
declare type UpdateWorkspaceMemberRolePathParams = {
|
1334
|
+
/**
|
1335
|
+
* Workspace name
|
1336
|
+
*/
|
831
1337
|
workspaceId: WorkspaceID;
|
1338
|
+
/**
|
1339
|
+
* UserID
|
1340
|
+
*/
|
832
1341
|
userId: UserID;
|
833
1342
|
};
|
834
1343
|
declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
|
@@ -853,7 +1362,13 @@ declare type UpdateWorkspaceMemberRoleVariables = {
|
|
853
1362
|
*/
|
854
1363
|
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
855
1364
|
declare type RemoveWorkspaceMemberPathParams = {
|
856
|
-
|
1365
|
+
/**
|
1366
|
+
* Workspace name
|
1367
|
+
*/
|
1368
|
+
workspaceId: WorkspaceID;
|
1369
|
+
/**
|
1370
|
+
* UserID
|
1371
|
+
*/
|
857
1372
|
userId: UserID;
|
858
1373
|
};
|
859
1374
|
declare type RemoveWorkspaceMemberError = ErrorWrapper<{
|
@@ -874,6 +1389,9 @@ declare type RemoveWorkspaceMemberVariables = {
|
|
874
1389
|
*/
|
875
1390
|
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
876
1391
|
declare type InviteWorkspaceMemberPathParams = {
|
1392
|
+
/**
|
1393
|
+
* Workspace name
|
1394
|
+
*/
|
877
1395
|
workspaceId: WorkspaceID;
|
878
1396
|
};
|
879
1397
|
declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
@@ -885,8 +1403,14 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
885
1403
|
} | {
|
886
1404
|
status: 404;
|
887
1405
|
payload: SimpleError;
|
1406
|
+
} | {
|
1407
|
+
status: 409;
|
1408
|
+
payload: SimpleError;
|
888
1409
|
}>;
|
889
1410
|
declare type InviteWorkspaceMemberRequestBody = {
|
1411
|
+
/**
|
1412
|
+
* @format email
|
1413
|
+
*/
|
890
1414
|
email: string;
|
891
1415
|
role: Role;
|
892
1416
|
};
|
@@ -898,8 +1422,48 @@ declare type InviteWorkspaceMemberVariables = {
|
|
898
1422
|
* Invite some user to join the workspace with the given role
|
899
1423
|
*/
|
900
1424
|
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
1425
|
+
declare type UpdateWorkspaceMemberInvitePathParams = {
|
1426
|
+
/**
|
1427
|
+
* Workspace name
|
1428
|
+
*/
|
1429
|
+
workspaceId: WorkspaceID;
|
1430
|
+
/**
|
1431
|
+
* Invite identifier
|
1432
|
+
*/
|
1433
|
+
inviteId: InviteID;
|
1434
|
+
};
|
1435
|
+
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
1436
|
+
status: 400;
|
1437
|
+
payload: BadRequestError;
|
1438
|
+
} | {
|
1439
|
+
status: 401;
|
1440
|
+
payload: AuthError;
|
1441
|
+
} | {
|
1442
|
+
status: 404;
|
1443
|
+
payload: SimpleError;
|
1444
|
+
} | {
|
1445
|
+
status: 422;
|
1446
|
+
payload: SimpleError;
|
1447
|
+
}>;
|
1448
|
+
declare type UpdateWorkspaceMemberInviteRequestBody = {
|
1449
|
+
role: Role;
|
1450
|
+
};
|
1451
|
+
declare type UpdateWorkspaceMemberInviteVariables = {
|
1452
|
+
body: UpdateWorkspaceMemberInviteRequestBody;
|
1453
|
+
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
1454
|
+
} & FetcherExtraProps;
|
1455
|
+
/**
|
1456
|
+
* 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.
|
1457
|
+
*/
|
1458
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
901
1459
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
1460
|
+
/**
|
1461
|
+
* Workspace name
|
1462
|
+
*/
|
902
1463
|
workspaceId: WorkspaceID;
|
1464
|
+
/**
|
1465
|
+
* Invite identifier
|
1466
|
+
*/
|
903
1467
|
inviteId: InviteID;
|
904
1468
|
};
|
905
1469
|
declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -920,7 +1484,13 @@ declare type CancelWorkspaceMemberInviteVariables = {
|
|
920
1484
|
*/
|
921
1485
|
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
922
1486
|
declare type ResendWorkspaceMemberInvitePathParams = {
|
1487
|
+
/**
|
1488
|
+
* Workspace name
|
1489
|
+
*/
|
923
1490
|
workspaceId: WorkspaceID;
|
1491
|
+
/**
|
1492
|
+
* Invite identifier
|
1493
|
+
*/
|
924
1494
|
inviteId: InviteID;
|
925
1495
|
};
|
926
1496
|
declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -941,7 +1511,13 @@ declare type ResendWorkspaceMemberInviteVariables = {
|
|
941
1511
|
*/
|
942
1512
|
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
943
1513
|
declare type AcceptWorkspaceMemberInvitePathParams = {
|
1514
|
+
/**
|
1515
|
+
* Workspace name
|
1516
|
+
*/
|
944
1517
|
workspaceId: WorkspaceID;
|
1518
|
+
/**
|
1519
|
+
* Invite Key (secret) for the invited user
|
1520
|
+
*/
|
945
1521
|
inviteKey: InviteKey;
|
946
1522
|
};
|
947
1523
|
declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -979,6 +1555,9 @@ declare type GetDatabaseListVariables = {
|
|
979
1555
|
*/
|
980
1556
|
declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
981
1557
|
declare type GetBranchListPathParams = {
|
1558
|
+
/**
|
1559
|
+
* The Database Name
|
1560
|
+
*/
|
982
1561
|
dbName: DBName;
|
983
1562
|
workspace: string;
|
984
1563
|
};
|
@@ -1000,6 +1579,9 @@ declare type GetBranchListVariables = {
|
|
1000
1579
|
*/
|
1001
1580
|
declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
1002
1581
|
declare type CreateDatabasePathParams = {
|
1582
|
+
/**
|
1583
|
+
* The Database Name
|
1584
|
+
*/
|
1003
1585
|
dbName: DBName;
|
1004
1586
|
workspace: string;
|
1005
1587
|
};
|
@@ -1011,11 +1593,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
|
|
1011
1593
|
payload: AuthError;
|
1012
1594
|
}>;
|
1013
1595
|
declare type CreateDatabaseResponse = {
|
1596
|
+
/**
|
1597
|
+
* @minLength 1
|
1598
|
+
*/
|
1014
1599
|
databaseName: string;
|
1015
1600
|
branchName?: string;
|
1016
1601
|
};
|
1017
1602
|
declare type CreateDatabaseRequestBody = {
|
1018
|
-
|
1603
|
+
/**
|
1604
|
+
* @minLength 1
|
1605
|
+
*/
|
1019
1606
|
branchName?: string;
|
1020
1607
|
ui?: {
|
1021
1608
|
color?: string;
|
@@ -1031,6 +1618,9 @@ declare type CreateDatabaseVariables = {
|
|
1031
1618
|
*/
|
1032
1619
|
declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
1033
1620
|
declare type DeleteDatabasePathParams = {
|
1621
|
+
/**
|
1622
|
+
* The Database Name
|
1623
|
+
*/
|
1034
1624
|
dbName: DBName;
|
1035
1625
|
workspace: string;
|
1036
1626
|
};
|
@@ -1051,7 +1641,67 @@ declare type DeleteDatabaseVariables = {
|
|
1051
1641
|
* Delete a database and all of its branches and tables permanently.
|
1052
1642
|
*/
|
1053
1643
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1644
|
+
declare type GetDatabaseMetadataPathParams = {
|
1645
|
+
/**
|
1646
|
+
* The Database Name
|
1647
|
+
*/
|
1648
|
+
dbName: DBName;
|
1649
|
+
workspace: string;
|
1650
|
+
};
|
1651
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
1652
|
+
status: 400;
|
1653
|
+
payload: BadRequestError;
|
1654
|
+
} | {
|
1655
|
+
status: 401;
|
1656
|
+
payload: AuthError;
|
1657
|
+
} | {
|
1658
|
+
status: 404;
|
1659
|
+
payload: SimpleError;
|
1660
|
+
}>;
|
1661
|
+
declare type GetDatabaseMetadataVariables = {
|
1662
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1663
|
+
} & FetcherExtraProps;
|
1664
|
+
/**
|
1665
|
+
* Retrieve metadata of the given database
|
1666
|
+
*/
|
1667
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1668
|
+
declare type UpdateDatabaseMetadataPathParams = {
|
1669
|
+
/**
|
1670
|
+
* The Database Name
|
1671
|
+
*/
|
1672
|
+
dbName: DBName;
|
1673
|
+
workspace: string;
|
1674
|
+
};
|
1675
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
1676
|
+
status: 400;
|
1677
|
+
payload: BadRequestError;
|
1678
|
+
} | {
|
1679
|
+
status: 401;
|
1680
|
+
payload: AuthError;
|
1681
|
+
} | {
|
1682
|
+
status: 404;
|
1683
|
+
payload: SimpleError;
|
1684
|
+
}>;
|
1685
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
1686
|
+
ui?: {
|
1687
|
+
/**
|
1688
|
+
* @minLength 1
|
1689
|
+
*/
|
1690
|
+
color?: string;
|
1691
|
+
};
|
1692
|
+
};
|
1693
|
+
declare type UpdateDatabaseMetadataVariables = {
|
1694
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
1695
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
1696
|
+
} & FetcherExtraProps;
|
1697
|
+
/**
|
1698
|
+
* Update the color of the selected database
|
1699
|
+
*/
|
1700
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1054
1701
|
declare type GetGitBranchesMappingPathParams = {
|
1702
|
+
/**
|
1703
|
+
* The Database Name
|
1704
|
+
*/
|
1055
1705
|
dbName: DBName;
|
1056
1706
|
workspace: string;
|
1057
1707
|
};
|
@@ -1091,6 +1741,9 @@ declare type GetGitBranchesMappingVariables = {
|
|
1091
1741
|
*/
|
1092
1742
|
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
1093
1743
|
declare type AddGitBranchesEntryPathParams = {
|
1744
|
+
/**
|
1745
|
+
* The Database Name
|
1746
|
+
*/
|
1094
1747
|
dbName: DBName;
|
1095
1748
|
workspace: string;
|
1096
1749
|
};
|
@@ -1102,10 +1755,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
|
|
1102
1755
|
payload: AuthError;
|
1103
1756
|
}>;
|
1104
1757
|
declare type AddGitBranchesEntryResponse = {
|
1758
|
+
/**
|
1759
|
+
* Warning message
|
1760
|
+
*/
|
1105
1761
|
warning?: string;
|
1106
1762
|
};
|
1107
1763
|
declare type AddGitBranchesEntryRequestBody = {
|
1764
|
+
/**
|
1765
|
+
* The name of the Git branch.
|
1766
|
+
*/
|
1108
1767
|
gitBranch: string;
|
1768
|
+
/**
|
1769
|
+
* The name of the Xata branch.
|
1770
|
+
*/
|
1109
1771
|
xataBranch: BranchName;
|
1110
1772
|
};
|
1111
1773
|
declare type AddGitBranchesEntryVariables = {
|
@@ -1129,10 +1791,16 @@ declare type AddGitBranchesEntryVariables = {
|
|
1129
1791
|
*/
|
1130
1792
|
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
1131
1793
|
declare type RemoveGitBranchesEntryPathParams = {
|
1794
|
+
/**
|
1795
|
+
* The Database Name
|
1796
|
+
*/
|
1132
1797
|
dbName: DBName;
|
1133
1798
|
workspace: string;
|
1134
1799
|
};
|
1135
1800
|
declare type RemoveGitBranchesEntryQueryParams = {
|
1801
|
+
/**
|
1802
|
+
* The Git Branch to remove from the mapping
|
1803
|
+
*/
|
1136
1804
|
gitBranch: string;
|
1137
1805
|
};
|
1138
1806
|
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
@@ -1157,11 +1825,20 @@ declare type RemoveGitBranchesEntryVariables = {
|
|
1157
1825
|
*/
|
1158
1826
|
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
1159
1827
|
declare type ResolveBranchPathParams = {
|
1828
|
+
/**
|
1829
|
+
* The Database Name
|
1830
|
+
*/
|
1160
1831
|
dbName: DBName;
|
1161
1832
|
workspace: string;
|
1162
1833
|
};
|
1163
1834
|
declare type ResolveBranchQueryParams = {
|
1835
|
+
/**
|
1836
|
+
* The Git Branch
|
1837
|
+
*/
|
1164
1838
|
gitBranch?: string;
|
1839
|
+
/**
|
1840
|
+
* Default branch to fallback to
|
1841
|
+
*/
|
1165
1842
|
fallbackBranch?: string;
|
1166
1843
|
};
|
1167
1844
|
declare type ResolveBranchError = ErrorWrapper<{
|
@@ -1208,7 +1885,285 @@ declare type ResolveBranchVariables = {
|
|
1208
1885
|
* ```
|
1209
1886
|
*/
|
1210
1887
|
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1888
|
+
declare type QueryMigrationRequestsPathParams = {
|
1889
|
+
/**
|
1890
|
+
* The Database Name
|
1891
|
+
*/
|
1892
|
+
dbName: DBName;
|
1893
|
+
workspace: string;
|
1894
|
+
};
|
1895
|
+
declare type QueryMigrationRequestsError = ErrorWrapper<{
|
1896
|
+
status: 400;
|
1897
|
+
payload: BadRequestError;
|
1898
|
+
} | {
|
1899
|
+
status: 401;
|
1900
|
+
payload: AuthError;
|
1901
|
+
} | {
|
1902
|
+
status: 404;
|
1903
|
+
payload: SimpleError;
|
1904
|
+
}>;
|
1905
|
+
declare type QueryMigrationRequestsResponse = {
|
1906
|
+
migrationRequests: MigrationRequest[];
|
1907
|
+
meta: RecordsMetadata;
|
1908
|
+
};
|
1909
|
+
declare type QueryMigrationRequestsRequestBody = {
|
1910
|
+
filter?: FilterExpression;
|
1911
|
+
sort?: SortExpression;
|
1912
|
+
page?: PageConfig;
|
1913
|
+
columns?: ColumnsProjection;
|
1914
|
+
};
|
1915
|
+
declare type QueryMigrationRequestsVariables = {
|
1916
|
+
body?: QueryMigrationRequestsRequestBody;
|
1917
|
+
pathParams: QueryMigrationRequestsPathParams;
|
1918
|
+
} & FetcherExtraProps;
|
1919
|
+
declare const queryMigrationRequests: (variables: QueryMigrationRequestsVariables) => Promise<QueryMigrationRequestsResponse>;
|
1920
|
+
declare type CreateMigrationRequestPathParams = {
|
1921
|
+
/**
|
1922
|
+
* The Database Name
|
1923
|
+
*/
|
1924
|
+
dbName: DBName;
|
1925
|
+
workspace: string;
|
1926
|
+
};
|
1927
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
1928
|
+
status: 400;
|
1929
|
+
payload: BadRequestError;
|
1930
|
+
} | {
|
1931
|
+
status: 401;
|
1932
|
+
payload: AuthError;
|
1933
|
+
} | {
|
1934
|
+
status: 404;
|
1935
|
+
payload: SimpleError;
|
1936
|
+
}>;
|
1937
|
+
declare type CreateMigrationRequestResponse = {
|
1938
|
+
number: number;
|
1939
|
+
};
|
1940
|
+
declare type CreateMigrationRequestRequestBody = {
|
1941
|
+
/**
|
1942
|
+
* The source branch.
|
1943
|
+
*/
|
1944
|
+
source: string;
|
1945
|
+
/**
|
1946
|
+
* The target branch.
|
1947
|
+
*/
|
1948
|
+
target: string;
|
1949
|
+
/**
|
1950
|
+
* The title.
|
1951
|
+
*/
|
1952
|
+
title: string;
|
1953
|
+
/**
|
1954
|
+
* Optional migration request description.
|
1955
|
+
*/
|
1956
|
+
body?: string;
|
1957
|
+
};
|
1958
|
+
declare type CreateMigrationRequestVariables = {
|
1959
|
+
body: CreateMigrationRequestRequestBody;
|
1960
|
+
pathParams: CreateMigrationRequestPathParams;
|
1961
|
+
} & FetcherExtraProps;
|
1962
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
1963
|
+
declare type GetMigrationRequestPathParams = {
|
1964
|
+
/**
|
1965
|
+
* The Database Name
|
1966
|
+
*/
|
1967
|
+
dbName: DBName;
|
1968
|
+
/**
|
1969
|
+
* The migration request number.
|
1970
|
+
*/
|
1971
|
+
mrNumber: number;
|
1972
|
+
workspace: string;
|
1973
|
+
};
|
1974
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
1975
|
+
status: 400;
|
1976
|
+
payload: BadRequestError;
|
1977
|
+
} | {
|
1978
|
+
status: 401;
|
1979
|
+
payload: AuthError;
|
1980
|
+
} | {
|
1981
|
+
status: 404;
|
1982
|
+
payload: SimpleError;
|
1983
|
+
}>;
|
1984
|
+
declare type GetMigrationRequestVariables = {
|
1985
|
+
pathParams: GetMigrationRequestPathParams;
|
1986
|
+
} & FetcherExtraProps;
|
1987
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
1988
|
+
declare type UpdateMigrationRequestPathParams = {
|
1989
|
+
/**
|
1990
|
+
* The Database Name
|
1991
|
+
*/
|
1992
|
+
dbName: DBName;
|
1993
|
+
/**
|
1994
|
+
* The migration request number.
|
1995
|
+
*/
|
1996
|
+
mrNumber: number;
|
1997
|
+
workspace: string;
|
1998
|
+
};
|
1999
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
2000
|
+
status: 400;
|
2001
|
+
payload: BadRequestError;
|
2002
|
+
} | {
|
2003
|
+
status: 401;
|
2004
|
+
payload: AuthError;
|
2005
|
+
} | {
|
2006
|
+
status: 404;
|
2007
|
+
payload: SimpleError;
|
2008
|
+
}>;
|
2009
|
+
declare type UpdateMigrationRequestRequestBody = {
|
2010
|
+
/**
|
2011
|
+
* New migration request title.
|
2012
|
+
*/
|
2013
|
+
title?: string;
|
2014
|
+
/**
|
2015
|
+
* New migration request description.
|
2016
|
+
*/
|
2017
|
+
body?: string;
|
2018
|
+
/**
|
2019
|
+
* Change the migration request status.
|
2020
|
+
*/
|
2021
|
+
status?: 'open' | 'closed';
|
2022
|
+
};
|
2023
|
+
declare type UpdateMigrationRequestVariables = {
|
2024
|
+
body?: UpdateMigrationRequestRequestBody;
|
2025
|
+
pathParams: UpdateMigrationRequestPathParams;
|
2026
|
+
} & FetcherExtraProps;
|
2027
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
2028
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
2029
|
+
/**
|
2030
|
+
* The Database Name
|
2031
|
+
*/
|
2032
|
+
dbName: DBName;
|
2033
|
+
/**
|
2034
|
+
* The migration request number.
|
2035
|
+
*/
|
2036
|
+
mrNumber: number;
|
2037
|
+
workspace: string;
|
2038
|
+
};
|
2039
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
2040
|
+
status: 400;
|
2041
|
+
payload: BadRequestError;
|
2042
|
+
} | {
|
2043
|
+
status: 401;
|
2044
|
+
payload: AuthError;
|
2045
|
+
} | {
|
2046
|
+
status: 404;
|
2047
|
+
payload: SimpleError;
|
2048
|
+
}>;
|
2049
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
2050
|
+
meta: {
|
2051
|
+
/**
|
2052
|
+
* last record id
|
2053
|
+
*/
|
2054
|
+
cursor: string;
|
2055
|
+
/**
|
2056
|
+
* true if more records can be fetch
|
2057
|
+
*/
|
2058
|
+
more: boolean;
|
2059
|
+
};
|
2060
|
+
logs: Commit[];
|
2061
|
+
};
|
2062
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
2063
|
+
page?: {
|
2064
|
+
/**
|
2065
|
+
* Query the next page that follow the cursor.
|
2066
|
+
*/
|
2067
|
+
after?: string;
|
2068
|
+
/**
|
2069
|
+
* Query the previous page before the cursor.
|
2070
|
+
*/
|
2071
|
+
before?: string;
|
2072
|
+
/**
|
2073
|
+
* 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.
|
2074
|
+
*
|
2075
|
+
* @default 20
|
2076
|
+
*/
|
2077
|
+
size?: number;
|
2078
|
+
};
|
2079
|
+
};
|
2080
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
2081
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
2082
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
2083
|
+
} & FetcherExtraProps;
|
2084
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
2085
|
+
declare type CompareMigrationRequestPathParams = {
|
2086
|
+
/**
|
2087
|
+
* The Database Name
|
2088
|
+
*/
|
2089
|
+
dbName: DBName;
|
2090
|
+
/**
|
2091
|
+
* The migration request number.
|
2092
|
+
*/
|
2093
|
+
mrNumber: number;
|
2094
|
+
workspace: string;
|
2095
|
+
};
|
2096
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
2097
|
+
status: 400;
|
2098
|
+
payload: BadRequestError;
|
2099
|
+
} | {
|
2100
|
+
status: 401;
|
2101
|
+
payload: AuthError;
|
2102
|
+
} | {
|
2103
|
+
status: 404;
|
2104
|
+
payload: SimpleError;
|
2105
|
+
}>;
|
2106
|
+
declare type CompareMigrationRequestVariables = {
|
2107
|
+
pathParams: CompareMigrationRequestPathParams;
|
2108
|
+
} & FetcherExtraProps;
|
2109
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
2110
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
2111
|
+
/**
|
2112
|
+
* The Database Name
|
2113
|
+
*/
|
2114
|
+
dbName: DBName;
|
2115
|
+
/**
|
2116
|
+
* The migration request number.
|
2117
|
+
*/
|
2118
|
+
mrNumber: number;
|
2119
|
+
workspace: string;
|
2120
|
+
};
|
2121
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
2122
|
+
status: 400;
|
2123
|
+
payload: BadRequestError;
|
2124
|
+
} | {
|
2125
|
+
status: 401;
|
2126
|
+
payload: AuthError;
|
2127
|
+
} | {
|
2128
|
+
status: 404;
|
2129
|
+
payload: SimpleError;
|
2130
|
+
}>;
|
2131
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
2132
|
+
merged?: boolean;
|
2133
|
+
};
|
2134
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
2135
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
2136
|
+
} & FetcherExtraProps;
|
2137
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
2138
|
+
declare type MergeMigrationRequestPathParams = {
|
2139
|
+
/**
|
2140
|
+
* The Database Name
|
2141
|
+
*/
|
2142
|
+
dbName: DBName;
|
2143
|
+
/**
|
2144
|
+
* The migration request number.
|
2145
|
+
*/
|
2146
|
+
mrNumber: number;
|
2147
|
+
workspace: string;
|
2148
|
+
};
|
2149
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
2150
|
+
status: 400;
|
2151
|
+
payload: BadRequestError;
|
2152
|
+
} | {
|
2153
|
+
status: 401;
|
2154
|
+
payload: AuthError;
|
2155
|
+
} | {
|
2156
|
+
status: 404;
|
2157
|
+
payload: SimpleError;
|
2158
|
+
}>;
|
2159
|
+
declare type MergeMigrationRequestVariables = {
|
2160
|
+
pathParams: MergeMigrationRequestPathParams;
|
2161
|
+
} & FetcherExtraProps;
|
2162
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
1211
2163
|
declare type GetBranchDetailsPathParams = {
|
2164
|
+
/**
|
2165
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2166
|
+
*/
|
1212
2167
|
dbBranchName: DBBranchName;
|
1213
2168
|
workspace: string;
|
1214
2169
|
};
|
@@ -1227,10 +2182,16 @@ declare type GetBranchDetailsVariables = {
|
|
1227
2182
|
} & FetcherExtraProps;
|
1228
2183
|
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
1229
2184
|
declare type CreateBranchPathParams = {
|
2185
|
+
/**
|
2186
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2187
|
+
*/
|
1230
2188
|
dbBranchName: DBBranchName;
|
1231
2189
|
workspace: string;
|
1232
2190
|
};
|
1233
2191
|
declare type CreateBranchQueryParams = {
|
2192
|
+
/**
|
2193
|
+
* Name of source branch to branch the new schema from
|
2194
|
+
*/
|
1234
2195
|
from?: string;
|
1235
2196
|
};
|
1236
2197
|
declare type CreateBranchError = ErrorWrapper<{
|
@@ -1243,7 +2204,17 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1243
2204
|
status: 404;
|
1244
2205
|
payload: SimpleError;
|
1245
2206
|
}>;
|
2207
|
+
declare type CreateBranchResponse = {
|
2208
|
+
/**
|
2209
|
+
* @minLength 1
|
2210
|
+
*/
|
2211
|
+
databaseName: string;
|
2212
|
+
branchName: string;
|
2213
|
+
};
|
1246
2214
|
declare type CreateBranchRequestBody = {
|
2215
|
+
/**
|
2216
|
+
* Select the branch to fork from. Defaults to 'main'
|
2217
|
+
*/
|
1247
2218
|
from?: string;
|
1248
2219
|
metadata?: BranchMetadata;
|
1249
2220
|
};
|
@@ -1252,8 +2223,11 @@ declare type CreateBranchVariables = {
|
|
1252
2223
|
pathParams: CreateBranchPathParams;
|
1253
2224
|
queryParams?: CreateBranchQueryParams;
|
1254
2225
|
} & FetcherExtraProps;
|
1255
|
-
declare const createBranch: (variables: CreateBranchVariables) => Promise<
|
2226
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
1256
2227
|
declare type DeleteBranchPathParams = {
|
2228
|
+
/**
|
2229
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2230
|
+
*/
|
1257
2231
|
dbBranchName: DBBranchName;
|
1258
2232
|
workspace: string;
|
1259
2233
|
};
|
@@ -1275,6 +2249,9 @@ declare type DeleteBranchVariables = {
|
|
1275
2249
|
*/
|
1276
2250
|
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
1277
2251
|
declare type UpdateBranchMetadataPathParams = {
|
2252
|
+
/**
|
2253
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2254
|
+
*/
|
1278
2255
|
dbBranchName: DBBranchName;
|
1279
2256
|
workspace: string;
|
1280
2257
|
};
|
@@ -1297,6 +2274,9 @@ declare type UpdateBranchMetadataVariables = {
|
|
1297
2274
|
*/
|
1298
2275
|
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
1299
2276
|
declare type GetBranchMetadataPathParams = {
|
2277
|
+
/**
|
2278
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2279
|
+
*/
|
1300
2280
|
dbBranchName: DBBranchName;
|
1301
2281
|
workspace: string;
|
1302
2282
|
};
|
@@ -1315,6 +2295,9 @@ declare type GetBranchMetadataVariables = {
|
|
1315
2295
|
} & FetcherExtraProps;
|
1316
2296
|
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
1317
2297
|
declare type GetBranchMigrationHistoryPathParams = {
|
2298
|
+
/**
|
2299
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2300
|
+
*/
|
1318
2301
|
dbBranchName: DBBranchName;
|
1319
2302
|
workspace: string;
|
1320
2303
|
};
|
@@ -1342,6 +2325,9 @@ declare type GetBranchMigrationHistoryVariables = {
|
|
1342
2325
|
} & FetcherExtraProps;
|
1343
2326
|
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
1344
2327
|
declare type ExecuteBranchMigrationPlanPathParams = {
|
2328
|
+
/**
|
2329
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2330
|
+
*/
|
1345
2331
|
dbBranchName: DBBranchName;
|
1346
2332
|
workspace: string;
|
1347
2333
|
};
|
@@ -1368,6 +2354,9 @@ declare type ExecuteBranchMigrationPlanVariables = {
|
|
1368
2354
|
*/
|
1369
2355
|
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
1370
2356
|
declare type GetBranchMigrationPlanPathParams = {
|
2357
|
+
/**
|
2358
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2359
|
+
*/
|
1371
2360
|
dbBranchName: DBBranchName;
|
1372
2361
|
workspace: string;
|
1373
2362
|
};
|
@@ -1389,7 +2378,199 @@ declare type GetBranchMigrationPlanVariables = {
|
|
1389
2378
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
1390
2379
|
*/
|
1391
2380
|
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2381
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
2382
|
+
/**
|
2383
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2384
|
+
*/
|
2385
|
+
dbBranchName: DBBranchName;
|
2386
|
+
workspace: string;
|
2387
|
+
};
|
2388
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
2389
|
+
status: 400;
|
2390
|
+
payload: BadRequestError;
|
2391
|
+
} | {
|
2392
|
+
status: 401;
|
2393
|
+
payload: AuthError;
|
2394
|
+
} | {
|
2395
|
+
status: 404;
|
2396
|
+
payload: SimpleError;
|
2397
|
+
}>;
|
2398
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
2399
|
+
schema: Schema;
|
2400
|
+
};
|
2401
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
2402
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
2403
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
2404
|
+
} & FetcherExtraProps;
|
2405
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
2406
|
+
declare type CompareBranchSchemasPathParams = {
|
2407
|
+
/**
|
2408
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2409
|
+
*/
|
2410
|
+
dbBranchName: DBBranchName;
|
2411
|
+
/**
|
2412
|
+
* The Database Name
|
2413
|
+
*/
|
2414
|
+
branchName: BranchName;
|
2415
|
+
workspace: string;
|
2416
|
+
};
|
2417
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
2418
|
+
status: 400;
|
2419
|
+
payload: BadRequestError;
|
2420
|
+
} | {
|
2421
|
+
status: 401;
|
2422
|
+
payload: AuthError;
|
2423
|
+
} | {
|
2424
|
+
status: 404;
|
2425
|
+
payload: SimpleError;
|
2426
|
+
}>;
|
2427
|
+
declare type CompareBranchSchemasVariables = {
|
2428
|
+
body?: Record<string, any>;
|
2429
|
+
pathParams: CompareBranchSchemasPathParams;
|
2430
|
+
} & FetcherExtraProps;
|
2431
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
2432
|
+
declare type UpdateBranchSchemaPathParams = {
|
2433
|
+
/**
|
2434
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2435
|
+
*/
|
2436
|
+
dbBranchName: DBBranchName;
|
2437
|
+
workspace: string;
|
2438
|
+
};
|
2439
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
2440
|
+
status: 400;
|
2441
|
+
payload: BadRequestError;
|
2442
|
+
} | {
|
2443
|
+
status: 401;
|
2444
|
+
payload: AuthError;
|
2445
|
+
} | {
|
2446
|
+
status: 404;
|
2447
|
+
payload: SimpleError;
|
2448
|
+
}>;
|
2449
|
+
declare type UpdateBranchSchemaResponse = {
|
2450
|
+
id: string;
|
2451
|
+
parentID: string;
|
2452
|
+
};
|
2453
|
+
declare type UpdateBranchSchemaVariables = {
|
2454
|
+
body: Migration;
|
2455
|
+
pathParams: UpdateBranchSchemaPathParams;
|
2456
|
+
} & FetcherExtraProps;
|
2457
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
2458
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
2459
|
+
/**
|
2460
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2461
|
+
*/
|
2462
|
+
dbBranchName: DBBranchName;
|
2463
|
+
workspace: string;
|
2464
|
+
};
|
2465
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
2466
|
+
status: 400;
|
2467
|
+
payload: BadRequestError;
|
2468
|
+
} | {
|
2469
|
+
status: 401;
|
2470
|
+
payload: AuthError;
|
2471
|
+
} | {
|
2472
|
+
status: 404;
|
2473
|
+
payload: SimpleError;
|
2474
|
+
}>;
|
2475
|
+
declare type PreviewBranchSchemaEditResponse = {
|
2476
|
+
original: Schema;
|
2477
|
+
updated: Schema;
|
2478
|
+
};
|
2479
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
2480
|
+
edits?: SchemaEditScript;
|
2481
|
+
operations?: MigrationOp[];
|
2482
|
+
};
|
2483
|
+
declare type PreviewBranchSchemaEditVariables = {
|
2484
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
2485
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
2486
|
+
} & FetcherExtraProps;
|
2487
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
2488
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
2489
|
+
/**
|
2490
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2491
|
+
*/
|
2492
|
+
dbBranchName: DBBranchName;
|
2493
|
+
workspace: string;
|
2494
|
+
};
|
2495
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
2496
|
+
status: 400;
|
2497
|
+
payload: BadRequestError;
|
2498
|
+
} | {
|
2499
|
+
status: 401;
|
2500
|
+
payload: AuthError;
|
2501
|
+
} | {
|
2502
|
+
status: 404;
|
2503
|
+
payload: SimpleError;
|
2504
|
+
}>;
|
2505
|
+
declare type ApplyBranchSchemaEditResponse = {
|
2506
|
+
id: string;
|
2507
|
+
parentID: string;
|
2508
|
+
};
|
2509
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
2510
|
+
edits: SchemaEditScript;
|
2511
|
+
};
|
2512
|
+
declare type ApplyBranchSchemaEditVariables = {
|
2513
|
+
body: ApplyBranchSchemaEditRequestBody;
|
2514
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
2515
|
+
} & FetcherExtraProps;
|
2516
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
2517
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
2518
|
+
/**
|
2519
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2520
|
+
*/
|
2521
|
+
dbBranchName: DBBranchName;
|
2522
|
+
workspace: string;
|
2523
|
+
};
|
2524
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
2525
|
+
status: 400;
|
2526
|
+
payload: BadRequestError;
|
2527
|
+
} | {
|
2528
|
+
status: 401;
|
2529
|
+
payload: AuthError;
|
2530
|
+
} | {
|
2531
|
+
status: 404;
|
2532
|
+
payload: SimpleError;
|
2533
|
+
}>;
|
2534
|
+
declare type GetBranchSchemaHistoryResponse = {
|
2535
|
+
meta: {
|
2536
|
+
/**
|
2537
|
+
* last record id
|
2538
|
+
*/
|
2539
|
+
cursor: string;
|
2540
|
+
/**
|
2541
|
+
* true if more records can be fetch
|
2542
|
+
*/
|
2543
|
+
more: boolean;
|
2544
|
+
};
|
2545
|
+
logs: Commit[];
|
2546
|
+
};
|
2547
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
2548
|
+
page?: {
|
2549
|
+
/**
|
2550
|
+
* Query the next page that follow the cursor.
|
2551
|
+
*/
|
2552
|
+
after?: string;
|
2553
|
+
/**
|
2554
|
+
* Query the previous page before the cursor.
|
2555
|
+
*/
|
2556
|
+
before?: string;
|
2557
|
+
/**
|
2558
|
+
* 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.
|
2559
|
+
*
|
2560
|
+
* @default 20
|
2561
|
+
*/
|
2562
|
+
size?: number;
|
2563
|
+
};
|
2564
|
+
};
|
2565
|
+
declare type GetBranchSchemaHistoryVariables = {
|
2566
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
2567
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
2568
|
+
} & FetcherExtraProps;
|
2569
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
1392
2570
|
declare type GetBranchStatsPathParams = {
|
2571
|
+
/**
|
2572
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2573
|
+
*/
|
1393
2574
|
dbBranchName: DBBranchName;
|
1394
2575
|
workspace: string;
|
1395
2576
|
};
|
@@ -1422,7 +2603,13 @@ declare type GetBranchStatsVariables = {
|
|
1422
2603
|
*/
|
1423
2604
|
declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
1424
2605
|
declare type CreateTablePathParams = {
|
2606
|
+
/**
|
2607
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2608
|
+
*/
|
1425
2609
|
dbBranchName: DBBranchName;
|
2610
|
+
/**
|
2611
|
+
* The Table name
|
2612
|
+
*/
|
1426
2613
|
tableName: TableName;
|
1427
2614
|
workspace: string;
|
1428
2615
|
};
|
@@ -1439,15 +2626,28 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1439
2626
|
status: 422;
|
1440
2627
|
payload: SimpleError;
|
1441
2628
|
}>;
|
2629
|
+
declare type CreateTableResponse = {
|
2630
|
+
branchName: string;
|
2631
|
+
/**
|
2632
|
+
* @minLength 1
|
2633
|
+
*/
|
2634
|
+
tableName: string;
|
2635
|
+
};
|
1442
2636
|
declare type CreateTableVariables = {
|
1443
2637
|
pathParams: CreateTablePathParams;
|
1444
2638
|
} & FetcherExtraProps;
|
1445
2639
|
/**
|
1446
2640
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1447
2641
|
*/
|
1448
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
2642
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1449
2643
|
declare type DeleteTablePathParams = {
|
2644
|
+
/**
|
2645
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2646
|
+
*/
|
1450
2647
|
dbBranchName: DBBranchName;
|
2648
|
+
/**
|
2649
|
+
* The Table name
|
2650
|
+
*/
|
1451
2651
|
tableName: TableName;
|
1452
2652
|
workspace: string;
|
1453
2653
|
};
|
@@ -1466,7 +2666,13 @@ declare type DeleteTableVariables = {
|
|
1466
2666
|
*/
|
1467
2667
|
declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
1468
2668
|
declare type UpdateTablePathParams = {
|
2669
|
+
/**
|
2670
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2671
|
+
*/
|
1469
2672
|
dbBranchName: DBBranchName;
|
2673
|
+
/**
|
2674
|
+
* The Table name
|
2675
|
+
*/
|
1470
2676
|
tableName: TableName;
|
1471
2677
|
workspace: string;
|
1472
2678
|
};
|
@@ -1481,6 +2687,9 @@ declare type UpdateTableError = ErrorWrapper<{
|
|
1481
2687
|
payload: SimpleError;
|
1482
2688
|
}>;
|
1483
2689
|
declare type UpdateTableRequestBody = {
|
2690
|
+
/**
|
2691
|
+
* @minLength 1
|
2692
|
+
*/
|
1484
2693
|
name: string;
|
1485
2694
|
};
|
1486
2695
|
declare type UpdateTableVariables = {
|
@@ -1502,7 +2711,13 @@ declare type UpdateTableVariables = {
|
|
1502
2711
|
*/
|
1503
2712
|
declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
1504
2713
|
declare type GetTableSchemaPathParams = {
|
2714
|
+
/**
|
2715
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2716
|
+
*/
|
1505
2717
|
dbBranchName: DBBranchName;
|
2718
|
+
/**
|
2719
|
+
* The Table name
|
2720
|
+
*/
|
1506
2721
|
tableName: TableName;
|
1507
2722
|
workspace: string;
|
1508
2723
|
};
|
@@ -1524,7 +2739,13 @@ declare type GetTableSchemaVariables = {
|
|
1524
2739
|
} & FetcherExtraProps;
|
1525
2740
|
declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
1526
2741
|
declare type SetTableSchemaPathParams = {
|
2742
|
+
/**
|
2743
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2744
|
+
*/
|
1527
2745
|
dbBranchName: DBBranchName;
|
2746
|
+
/**
|
2747
|
+
* The Table name
|
2748
|
+
*/
|
1528
2749
|
tableName: TableName;
|
1529
2750
|
workspace: string;
|
1530
2751
|
};
|
@@ -1550,7 +2771,13 @@ declare type SetTableSchemaVariables = {
|
|
1550
2771
|
} & FetcherExtraProps;
|
1551
2772
|
declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
|
1552
2773
|
declare type GetTableColumnsPathParams = {
|
2774
|
+
/**
|
2775
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2776
|
+
*/
|
1553
2777
|
dbBranchName: DBBranchName;
|
2778
|
+
/**
|
2779
|
+
* The Table name
|
2780
|
+
*/
|
1554
2781
|
tableName: TableName;
|
1555
2782
|
workspace: string;
|
1556
2783
|
};
|
@@ -1576,7 +2803,13 @@ declare type GetTableColumnsVariables = {
|
|
1576
2803
|
*/
|
1577
2804
|
declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
|
1578
2805
|
declare type AddTableColumnPathParams = {
|
2806
|
+
/**
|
2807
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2808
|
+
*/
|
1579
2809
|
dbBranchName: DBBranchName;
|
2810
|
+
/**
|
2811
|
+
* The Table name
|
2812
|
+
*/
|
1580
2813
|
tableName: TableName;
|
1581
2814
|
workspace: string;
|
1582
2815
|
};
|
@@ -1601,8 +2834,17 @@ declare type AddTableColumnVariables = {
|
|
1601
2834
|
*/
|
1602
2835
|
declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
|
1603
2836
|
declare type GetColumnPathParams = {
|
2837
|
+
/**
|
2838
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2839
|
+
*/
|
1604
2840
|
dbBranchName: DBBranchName;
|
2841
|
+
/**
|
2842
|
+
* The Table name
|
2843
|
+
*/
|
1605
2844
|
tableName: TableName;
|
2845
|
+
/**
|
2846
|
+
* The Column name
|
2847
|
+
*/
|
1606
2848
|
columnName: ColumnName;
|
1607
2849
|
workspace: string;
|
1608
2850
|
};
|
@@ -1624,8 +2866,17 @@ declare type GetColumnVariables = {
|
|
1624
2866
|
*/
|
1625
2867
|
declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
|
1626
2868
|
declare type DeleteColumnPathParams = {
|
2869
|
+
/**
|
2870
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2871
|
+
*/
|
1627
2872
|
dbBranchName: DBBranchName;
|
2873
|
+
/**
|
2874
|
+
* The Table name
|
2875
|
+
*/
|
1628
2876
|
tableName: TableName;
|
2877
|
+
/**
|
2878
|
+
* The Column name
|
2879
|
+
*/
|
1629
2880
|
columnName: ColumnName;
|
1630
2881
|
workspace: string;
|
1631
2882
|
};
|
@@ -1647,8 +2898,17 @@ declare type DeleteColumnVariables = {
|
|
1647
2898
|
*/
|
1648
2899
|
declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
|
1649
2900
|
declare type UpdateColumnPathParams = {
|
2901
|
+
/**
|
2902
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2903
|
+
*/
|
1650
2904
|
dbBranchName: DBBranchName;
|
2905
|
+
/**
|
2906
|
+
* The Table name
|
2907
|
+
*/
|
1651
2908
|
tableName: TableName;
|
2909
|
+
/**
|
2910
|
+
* The Column name
|
2911
|
+
*/
|
1652
2912
|
columnName: ColumnName;
|
1653
2913
|
workspace: string;
|
1654
2914
|
};
|
@@ -1663,6 +2923,9 @@ declare type UpdateColumnError = ErrorWrapper<{
|
|
1663
2923
|
payload: SimpleError;
|
1664
2924
|
}>;
|
1665
2925
|
declare type UpdateColumnRequestBody = {
|
2926
|
+
/**
|
2927
|
+
* @minLength 1
|
2928
|
+
*/
|
1666
2929
|
name: string;
|
1667
2930
|
};
|
1668
2931
|
declare type UpdateColumnVariables = {
|
@@ -1674,10 +2937,22 @@ declare type UpdateColumnVariables = {
|
|
1674
2937
|
*/
|
1675
2938
|
declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
1676
2939
|
declare type InsertRecordPathParams = {
|
2940
|
+
/**
|
2941
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2942
|
+
*/
|
1677
2943
|
dbBranchName: DBBranchName;
|
2944
|
+
/**
|
2945
|
+
* The Table name
|
2946
|
+
*/
|
1678
2947
|
tableName: TableName;
|
1679
2948
|
workspace: string;
|
1680
2949
|
};
|
2950
|
+
declare type InsertRecordQueryParams = {
|
2951
|
+
/**
|
2952
|
+
* Column filters
|
2953
|
+
*/
|
2954
|
+
columns?: ColumnsProjection;
|
2955
|
+
};
|
1681
2956
|
declare type InsertRecordError = ErrorWrapper<{
|
1682
2957
|
status: 400;
|
1683
2958
|
payload: BadRequestError;
|
@@ -1688,27 +2963,35 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1688
2963
|
status: 404;
|
1689
2964
|
payload: SimpleError;
|
1690
2965
|
}>;
|
1691
|
-
declare type InsertRecordResponse = {
|
1692
|
-
id: string;
|
1693
|
-
xata: {
|
1694
|
-
version: number;
|
1695
|
-
};
|
1696
|
-
};
|
1697
2966
|
declare type InsertRecordVariables = {
|
1698
2967
|
body?: Record<string, any>;
|
1699
2968
|
pathParams: InsertRecordPathParams;
|
2969
|
+
queryParams?: InsertRecordQueryParams;
|
1700
2970
|
} & FetcherExtraProps;
|
1701
2971
|
/**
|
1702
2972
|
* Insert a new Record into the Table
|
1703
2973
|
*/
|
1704
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
2974
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1705
2975
|
declare type InsertRecordWithIDPathParams = {
|
2976
|
+
/**
|
2977
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2978
|
+
*/
|
1706
2979
|
dbBranchName: DBBranchName;
|
2980
|
+
/**
|
2981
|
+
* The Table name
|
2982
|
+
*/
|
1707
2983
|
tableName: TableName;
|
2984
|
+
/**
|
2985
|
+
* The Record name
|
2986
|
+
*/
|
1708
2987
|
recordId: RecordID;
|
1709
2988
|
workspace: string;
|
1710
2989
|
};
|
1711
2990
|
declare type InsertRecordWithIDQueryParams = {
|
2991
|
+
/**
|
2992
|
+
* Column filters
|
2993
|
+
*/
|
2994
|
+
columns?: ColumnsProjection;
|
1712
2995
|
createOnly?: boolean;
|
1713
2996
|
ifVersion?: number;
|
1714
2997
|
};
|
@@ -1735,12 +3018,25 @@ declare type InsertRecordWithIDVariables = {
|
|
1735
3018
|
*/
|
1736
3019
|
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1737
3020
|
declare type UpdateRecordWithIDPathParams = {
|
3021
|
+
/**
|
3022
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3023
|
+
*/
|
1738
3024
|
dbBranchName: DBBranchName;
|
3025
|
+
/**
|
3026
|
+
* The Table name
|
3027
|
+
*/
|
1739
3028
|
tableName: TableName;
|
3029
|
+
/**
|
3030
|
+
* The Record name
|
3031
|
+
*/
|
1740
3032
|
recordId: RecordID;
|
1741
3033
|
workspace: string;
|
1742
3034
|
};
|
1743
3035
|
declare type UpdateRecordWithIDQueryParams = {
|
3036
|
+
/**
|
3037
|
+
* Column filters
|
3038
|
+
*/
|
3039
|
+
columns?: ColumnsProjection;
|
1744
3040
|
ifVersion?: number;
|
1745
3041
|
};
|
1746
3042
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1763,12 +3059,25 @@ declare type UpdateRecordWithIDVariables = {
|
|
1763
3059
|
} & FetcherExtraProps;
|
1764
3060
|
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1765
3061
|
declare type UpsertRecordWithIDPathParams = {
|
3062
|
+
/**
|
3063
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3064
|
+
*/
|
1766
3065
|
dbBranchName: DBBranchName;
|
3066
|
+
/**
|
3067
|
+
* The Table name
|
3068
|
+
*/
|
1767
3069
|
tableName: TableName;
|
3070
|
+
/**
|
3071
|
+
* The Record name
|
3072
|
+
*/
|
1768
3073
|
recordId: RecordID;
|
1769
3074
|
workspace: string;
|
1770
3075
|
};
|
1771
3076
|
declare type UpsertRecordWithIDQueryParams = {
|
3077
|
+
/**
|
3078
|
+
* Column filters
|
3079
|
+
*/
|
3080
|
+
columns?: ColumnsProjection;
|
1772
3081
|
ifVersion?: number;
|
1773
3082
|
};
|
1774
3083
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1791,11 +3100,26 @@ declare type UpsertRecordWithIDVariables = {
|
|
1791
3100
|
} & FetcherExtraProps;
|
1792
3101
|
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1793
3102
|
declare type DeleteRecordPathParams = {
|
3103
|
+
/**
|
3104
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3105
|
+
*/
|
1794
3106
|
dbBranchName: DBBranchName;
|
3107
|
+
/**
|
3108
|
+
* The Table name
|
3109
|
+
*/
|
1795
3110
|
tableName: TableName;
|
3111
|
+
/**
|
3112
|
+
* The Record name
|
3113
|
+
*/
|
1796
3114
|
recordId: RecordID;
|
1797
3115
|
workspace: string;
|
1798
3116
|
};
|
3117
|
+
declare type DeleteRecordQueryParams = {
|
3118
|
+
/**
|
3119
|
+
* Column filters
|
3120
|
+
*/
|
3121
|
+
columns?: ColumnsProjection;
|
3122
|
+
};
|
1799
3123
|
declare type DeleteRecordError = ErrorWrapper<{
|
1800
3124
|
status: 400;
|
1801
3125
|
payload: BadRequestError;
|
@@ -1808,14 +3132,30 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1808
3132
|
}>;
|
1809
3133
|
declare type DeleteRecordVariables = {
|
1810
3134
|
pathParams: DeleteRecordPathParams;
|
3135
|
+
queryParams?: DeleteRecordQueryParams;
|
1811
3136
|
} & FetcherExtraProps;
|
1812
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
3137
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1813
3138
|
declare type GetRecordPathParams = {
|
3139
|
+
/**
|
3140
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3141
|
+
*/
|
1814
3142
|
dbBranchName: DBBranchName;
|
3143
|
+
/**
|
3144
|
+
* The Table name
|
3145
|
+
*/
|
1815
3146
|
tableName: TableName;
|
3147
|
+
/**
|
3148
|
+
* The Record name
|
3149
|
+
*/
|
1816
3150
|
recordId: RecordID;
|
1817
3151
|
workspace: string;
|
1818
3152
|
};
|
3153
|
+
declare type GetRecordQueryParams = {
|
3154
|
+
/**
|
3155
|
+
* Column filters
|
3156
|
+
*/
|
3157
|
+
columns?: ColumnsProjection;
|
3158
|
+
};
|
1819
3159
|
declare type GetRecordError = ErrorWrapper<{
|
1820
3160
|
status: 400;
|
1821
3161
|
payload: BadRequestError;
|
@@ -1826,22 +3166,31 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1826
3166
|
status: 404;
|
1827
3167
|
payload: SimpleError;
|
1828
3168
|
}>;
|
1829
|
-
declare type GetRecordRequestBody = {
|
1830
|
-
columns?: ColumnsFilter;
|
1831
|
-
};
|
1832
3169
|
declare type GetRecordVariables = {
|
1833
|
-
body?: GetRecordRequestBody;
|
1834
3170
|
pathParams: GetRecordPathParams;
|
3171
|
+
queryParams?: GetRecordQueryParams;
|
1835
3172
|
} & FetcherExtraProps;
|
1836
3173
|
/**
|
1837
3174
|
* Retrieve record by ID
|
1838
3175
|
*/
|
1839
3176
|
declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
1840
3177
|
declare type BulkInsertTableRecordsPathParams = {
|
3178
|
+
/**
|
3179
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3180
|
+
*/
|
1841
3181
|
dbBranchName: DBBranchName;
|
3182
|
+
/**
|
3183
|
+
* The Table name
|
3184
|
+
*/
|
1842
3185
|
tableName: TableName;
|
1843
3186
|
workspace: string;
|
1844
3187
|
};
|
3188
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
3189
|
+
/**
|
3190
|
+
* Column filters
|
3191
|
+
*/
|
3192
|
+
columns?: ColumnsProjection;
|
3193
|
+
};
|
1845
3194
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1846
3195
|
status: 400;
|
1847
3196
|
payload: BulkError;
|
@@ -1851,23 +3200,30 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1851
3200
|
} | {
|
1852
3201
|
status: 404;
|
1853
3202
|
payload: SimpleError;
|
3203
|
+
} | {
|
3204
|
+
status: 422;
|
3205
|
+
payload: SimpleError;
|
1854
3206
|
}>;
|
1855
|
-
declare type BulkInsertTableRecordsResponse = {
|
1856
|
-
recordIDs: string[];
|
1857
|
-
};
|
1858
3207
|
declare type BulkInsertTableRecordsRequestBody = {
|
1859
3208
|
records: Record<string, any>[];
|
1860
3209
|
};
|
1861
3210
|
declare type BulkInsertTableRecordsVariables = {
|
1862
3211
|
body: BulkInsertTableRecordsRequestBody;
|
1863
3212
|
pathParams: BulkInsertTableRecordsPathParams;
|
3213
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1864
3214
|
} & FetcherExtraProps;
|
1865
3215
|
/**
|
1866
3216
|
* Bulk insert records
|
1867
3217
|
*/
|
1868
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
3218
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1869
3219
|
declare type QueryTablePathParams = {
|
3220
|
+
/**
|
3221
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3222
|
+
*/
|
1870
3223
|
dbBranchName: DBBranchName;
|
3224
|
+
/**
|
3225
|
+
* The Table name
|
3226
|
+
*/
|
1871
3227
|
tableName: TableName;
|
1872
3228
|
workspace: string;
|
1873
3229
|
};
|
@@ -1885,7 +3241,7 @@ declare type QueryTableRequestBody = {
|
|
1885
3241
|
filter?: FilterExpression;
|
1886
3242
|
sort?: SortExpression;
|
1887
3243
|
page?: PageConfig;
|
1888
|
-
columns?:
|
3244
|
+
columns?: ColumnsProjection;
|
1889
3245
|
};
|
1890
3246
|
declare type QueryTableVariables = {
|
1891
3247
|
body?: QueryTableRequestBody;
|
@@ -1921,8 +3277,9 @@ declare type QueryTableVariables = {
|
|
1921
3277
|
* If the `columns` array is not specified, all columns are included. For link
|
1922
3278
|
* fields, only the ID column of the linked records is included in the response.
|
1923
3279
|
*
|
1924
|
-
* If the `columns` array is specified, only the selected
|
1925
|
-
* The `*` wildcard can be used to
|
3280
|
+
* If the `columns` array is specified, only the selected and internal
|
3281
|
+
* columns `id` and `xata` are included. The `*` wildcard can be used to
|
3282
|
+
* select all columns.
|
1926
3283
|
*
|
1927
3284
|
* For objects and link fields, if the column name of the object is specified, we
|
1928
3285
|
* include all of its sub-keys. If only some sub-keys are specified (via dotted
|
@@ -2038,6 +3395,10 @@ declare type QueryTableVariables = {
|
|
2038
3395
|
*
|
2039
3396
|
* ```json
|
2040
3397
|
* {
|
3398
|
+
* "id": "id1"
|
3399
|
+
* "xata": {
|
3400
|
+
* "version": 0
|
3401
|
+
* }
|
2041
3402
|
* "name": "Kilian",
|
2042
3403
|
* "address": {
|
2043
3404
|
* "street": "New street"
|
@@ -2057,6 +3418,10 @@ declare type QueryTableVariables = {
|
|
2057
3418
|
*
|
2058
3419
|
* ```json
|
2059
3420
|
* {
|
3421
|
+
* "id": "id1"
|
3422
|
+
* "xata": {
|
3423
|
+
* "version": 0
|
3424
|
+
* }
|
2060
3425
|
* "name": "Kilian",
|
2061
3426
|
* "email": "kilian@gmail.com",
|
2062
3427
|
* "address": {
|
@@ -2086,6 +3451,10 @@ declare type QueryTableVariables = {
|
|
2086
3451
|
*
|
2087
3452
|
* ```json
|
2088
3453
|
* {
|
3454
|
+
* "id": "id1"
|
3455
|
+
* "xata": {
|
3456
|
+
* "version": 0
|
3457
|
+
* }
|
2089
3458
|
* "name": "Kilian",
|
2090
3459
|
* "email": "kilian@gmail.com",
|
2091
3460
|
* "address": {
|
@@ -2512,8 +3881,8 @@ declare type QueryTableVariables = {
|
|
2512
3881
|
*
|
2513
3882
|
* ### Pagination
|
2514
3883
|
*
|
2515
|
-
* We offer cursor pagination and offset pagination.
|
2516
|
-
*
|
3884
|
+
* We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
|
3885
|
+
* cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
|
2517
3886
|
*
|
2518
3887
|
* Example of size + offset pagination:
|
2519
3888
|
*
|
@@ -2614,7 +3983,13 @@ declare type QueryTableVariables = {
|
|
2614
3983
|
*/
|
2615
3984
|
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2616
3985
|
declare type SearchTablePathParams = {
|
3986
|
+
/**
|
3987
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3988
|
+
*/
|
2617
3989
|
dbBranchName: DBBranchName;
|
3990
|
+
/**
|
3991
|
+
* The Table name
|
3992
|
+
*/
|
2618
3993
|
tableName: TableName;
|
2619
3994
|
workspace: string;
|
2620
3995
|
};
|
@@ -2629,11 +4004,18 @@ declare type SearchTableError = ErrorWrapper<{
|
|
2629
4004
|
payload: SimpleError;
|
2630
4005
|
}>;
|
2631
4006
|
declare type SearchTableRequestBody = {
|
4007
|
+
/**
|
4008
|
+
* The query string.
|
4009
|
+
*
|
4010
|
+
* @minLength 1
|
4011
|
+
*/
|
2632
4012
|
query: string;
|
2633
4013
|
fuzziness?: FuzzinessExpression;
|
4014
|
+
target?: TargetExpression;
|
2634
4015
|
prefix?: PrefixExpression;
|
2635
4016
|
filter?: FilterExpression;
|
2636
4017
|
highlight?: HighlightExpression;
|
4018
|
+
boosters?: BoosterExpression[];
|
2637
4019
|
};
|
2638
4020
|
declare type SearchTableVariables = {
|
2639
4021
|
body: SearchTableRequestBody;
|
@@ -2648,6 +4030,9 @@ declare type SearchTableVariables = {
|
|
2648
4030
|
*/
|
2649
4031
|
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2650
4032
|
declare type SearchBranchPathParams = {
|
4033
|
+
/**
|
4034
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4035
|
+
*/
|
2651
4036
|
dbBranchName: DBBranchName;
|
2652
4037
|
workspace: string;
|
2653
4038
|
};
|
@@ -2662,12 +4047,26 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
2662
4047
|
payload: SimpleError;
|
2663
4048
|
}>;
|
2664
4049
|
declare type SearchBranchRequestBody = {
|
4050
|
+
/**
|
4051
|
+
* 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.
|
4052
|
+
*/
|
2665
4053
|
tables?: (string | {
|
4054
|
+
/**
|
4055
|
+
* The name of the table.
|
4056
|
+
*/
|
2666
4057
|
table: string;
|
2667
4058
|
filter?: FilterExpression;
|
4059
|
+
target?: TargetExpression;
|
4060
|
+
boosters?: BoosterExpression[];
|
2668
4061
|
})[];
|
4062
|
+
/**
|
4063
|
+
* The query string.
|
4064
|
+
*
|
4065
|
+
* @minLength 1
|
4066
|
+
*/
|
2669
4067
|
query: string;
|
2670
4068
|
fuzziness?: FuzzinessExpression;
|
4069
|
+
prefix?: PrefixExpression;
|
2671
4070
|
highlight?: HighlightExpression;
|
2672
4071
|
};
|
2673
4072
|
declare type SearchBranchVariables = {
|
@@ -2678,6 +4077,235 @@ declare type SearchBranchVariables = {
|
|
2678
4077
|
* Run a free text search operation across the database branch.
|
2679
4078
|
*/
|
2680
4079
|
declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
4080
|
+
declare type SummarizeTablePathParams = {
|
4081
|
+
/**
|
4082
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4083
|
+
*/
|
4084
|
+
dbBranchName: DBBranchName;
|
4085
|
+
/**
|
4086
|
+
* The Table name
|
4087
|
+
*/
|
4088
|
+
tableName: TableName;
|
4089
|
+
workspace: string;
|
4090
|
+
};
|
4091
|
+
declare type SummarizeTableError = ErrorWrapper<{
|
4092
|
+
status: 400;
|
4093
|
+
payload: BadRequestError;
|
4094
|
+
} | {
|
4095
|
+
status: 401;
|
4096
|
+
payload: AuthError;
|
4097
|
+
} | {
|
4098
|
+
status: 404;
|
4099
|
+
payload: SimpleError;
|
4100
|
+
}>;
|
4101
|
+
declare type SummarizeTableRequestBody = {
|
4102
|
+
filters?: FilterExpression;
|
4103
|
+
columns?: ColumnsProjection;
|
4104
|
+
summaries?: SummaryExpressionList;
|
4105
|
+
sort?: SortExpression;
|
4106
|
+
};
|
4107
|
+
declare type SummarizeTableVariables = {
|
4108
|
+
body?: SummarizeTableRequestBody;
|
4109
|
+
pathParams: SummarizeTablePathParams;
|
4110
|
+
} & FetcherExtraProps;
|
4111
|
+
/**
|
4112
|
+
* This endpoint allows you to (optionally) define groups, and then to run
|
4113
|
+
* calculations on the values in each group. This is most helpful when you'd
|
4114
|
+
* like to understand the data you have in your database.
|
4115
|
+
*
|
4116
|
+
* A group is a combination of unique values. If you create a group for `sold_by`,
|
4117
|
+
* `product_name`, we will return one row for every combination of `sold_by` and
|
4118
|
+
* `product_name` you have in your database. When you want to calculate statistics,
|
4119
|
+
* you define these groups and ask Xata to calculate data on each group.
|
4120
|
+
*
|
4121
|
+
* **Some questions you can ask of your data:**
|
4122
|
+
*
|
4123
|
+
* How many records do I have in this table?
|
4124
|
+
* - Set `columns: []` as we we want data from the entire table, so we ask for no groups.
|
4125
|
+
* - Set `summaries: {"total": {"count": "*"}}` in order to see the count of all records.
|
4126
|
+
* We use `count: *` here we'd like to know the total amount of rows; ignoring whether
|
4127
|
+
* they are `null` or not.
|
4128
|
+
*
|
4129
|
+
* What are the top total sales for each product in July 2022?
|
4130
|
+
* - Set `filter: {soldAt: {"$ge": "2022-07-01T00:00:00.000Z", "$lt": "2022-08-01T00:00:00.000Z"}}` in order to limit the result set to sales recorded in July 2022.
|
4131
|
+
* - Set `columns: [product_name]` as we'd like to run calculations on each unique product
|
4132
|
+
* name in our table. Setting `columns` like this will produce one row per unique product
|
4133
|
+
* name.
|
4134
|
+
* - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd like to create a
|
4135
|
+
* field called "total_sales" for each group. This field will count all rows in each group
|
4136
|
+
* with non-null product names.
|
4137
|
+
* - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with the highest
|
4138
|
+
* total_sales field to the top.
|
4139
|
+
*
|
4140
|
+
* `columns`: tells Xata how to create each group. If you add `product_id` we will create
|
4141
|
+
* a new group for every unique `product_id`.
|
4142
|
+
*
|
4143
|
+
* `summaries`: tells Xata which calculations to run on each group.
|
4144
|
+
*
|
4145
|
+
* `sort`: tells Xata in which order you'd like to see results. You may sort by fields
|
4146
|
+
* specified in `columns` as well as the summary names defined in `summaries`.
|
4147
|
+
*
|
4148
|
+
* note: Sorting on summarized values can be slower on very large tables; this will impact
|
4149
|
+
* your rate limit significantly more than other queries. Try use `filter` [coming soon] to
|
4150
|
+
* reduce the amount of data being processed in order to reduce impact on your limits.
|
4151
|
+
*/
|
4152
|
+
declare const summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
|
4153
|
+
declare type CPgetDatabaseListPathParams = {
|
4154
|
+
/**
|
4155
|
+
* Workspace name
|
4156
|
+
*/
|
4157
|
+
workspaceId: WorkspaceID;
|
4158
|
+
};
|
4159
|
+
declare type CPgetDatabaseListError = ErrorWrapper<{
|
4160
|
+
status: 400;
|
4161
|
+
payload: BadRequestError;
|
4162
|
+
} | {
|
4163
|
+
status: 401;
|
4164
|
+
payload: AuthError;
|
4165
|
+
}>;
|
4166
|
+
declare type CPgetDatabaseListVariables = {
|
4167
|
+
pathParams: CPgetDatabaseListPathParams;
|
4168
|
+
} & FetcherExtraProps;
|
4169
|
+
/**
|
4170
|
+
* List all databases available in your Workspace.
|
4171
|
+
*/
|
4172
|
+
declare const cPgetDatabaseList: (variables: CPgetDatabaseListVariables) => Promise<CPListDatabasesResponse>;
|
4173
|
+
declare type CPcreateDatabasePathParams = {
|
4174
|
+
/**
|
4175
|
+
* Workspace name
|
4176
|
+
*/
|
4177
|
+
workspaceId: WorkspaceID;
|
4178
|
+
/**
|
4179
|
+
* The Database Name
|
4180
|
+
*/
|
4181
|
+
dbName: DBName;
|
4182
|
+
};
|
4183
|
+
declare type CPcreateDatabaseError = ErrorWrapper<{
|
4184
|
+
status: 400;
|
4185
|
+
payload: BadRequestError;
|
4186
|
+
} | {
|
4187
|
+
status: 401;
|
4188
|
+
payload: AuthError;
|
4189
|
+
}>;
|
4190
|
+
declare type CPcreateDatabaseResponse = {
|
4191
|
+
/**
|
4192
|
+
* @minLength 1
|
4193
|
+
*/
|
4194
|
+
databaseName?: string;
|
4195
|
+
branchName?: string;
|
4196
|
+
};
|
4197
|
+
declare type CPcreateDatabaseRequestBody = {
|
4198
|
+
/**
|
4199
|
+
* @minLength 1
|
4200
|
+
*/
|
4201
|
+
branchName?: string;
|
4202
|
+
/**
|
4203
|
+
* @minLength 1
|
4204
|
+
*/
|
4205
|
+
region: string;
|
4206
|
+
ui?: {
|
4207
|
+
color?: string;
|
4208
|
+
};
|
4209
|
+
metadata?: BranchMetadata;
|
4210
|
+
};
|
4211
|
+
declare type CPcreateDatabaseVariables = {
|
4212
|
+
body: CPcreateDatabaseRequestBody;
|
4213
|
+
pathParams: CPcreateDatabasePathParams;
|
4214
|
+
} & FetcherExtraProps;
|
4215
|
+
/**
|
4216
|
+
* Create Database with identifier name
|
4217
|
+
*/
|
4218
|
+
declare const cPcreateDatabase: (variables: CPcreateDatabaseVariables) => Promise<CPcreateDatabaseResponse>;
|
4219
|
+
declare type CPdeleteDatabasePathParams = {
|
4220
|
+
/**
|
4221
|
+
* Workspace name
|
4222
|
+
*/
|
4223
|
+
workspaceId: WorkspaceID;
|
4224
|
+
/**
|
4225
|
+
* The Database Name
|
4226
|
+
*/
|
4227
|
+
dbName: DBName;
|
4228
|
+
};
|
4229
|
+
declare type CPdeleteDatabaseError = ErrorWrapper<{
|
4230
|
+
status: 400;
|
4231
|
+
payload: BadRequestError;
|
4232
|
+
} | {
|
4233
|
+
status: 401;
|
4234
|
+
payload: AuthError;
|
4235
|
+
} | {
|
4236
|
+
status: 404;
|
4237
|
+
payload: SimpleError;
|
4238
|
+
}>;
|
4239
|
+
declare type CPdeleteDatabaseVariables = {
|
4240
|
+
pathParams: CPdeleteDatabasePathParams;
|
4241
|
+
} & FetcherExtraProps;
|
4242
|
+
/**
|
4243
|
+
* Delete a database and all of its branches and tables permanently.
|
4244
|
+
*/
|
4245
|
+
declare const cPdeleteDatabase: (variables: CPdeleteDatabaseVariables) => Promise<undefined>;
|
4246
|
+
declare type CPgetCPDatabaseMetadataPathParams = {
|
4247
|
+
/**
|
4248
|
+
* Workspace name
|
4249
|
+
*/
|
4250
|
+
workspaceId: WorkspaceID;
|
4251
|
+
/**
|
4252
|
+
* The Database Name
|
4253
|
+
*/
|
4254
|
+
dbName: DBName;
|
4255
|
+
};
|
4256
|
+
declare type CPgetCPDatabaseMetadataError = ErrorWrapper<{
|
4257
|
+
status: 400;
|
4258
|
+
payload: BadRequestError;
|
4259
|
+
} | {
|
4260
|
+
status: 401;
|
4261
|
+
payload: AuthError;
|
4262
|
+
} | {
|
4263
|
+
status: 404;
|
4264
|
+
payload: SimpleError;
|
4265
|
+
}>;
|
4266
|
+
declare type CPgetCPDatabaseMetadataVariables = {
|
4267
|
+
pathParams: CPgetCPDatabaseMetadataPathParams;
|
4268
|
+
} & FetcherExtraProps;
|
4269
|
+
/**
|
4270
|
+
* Retrieve metadata of the given database
|
4271
|
+
*/
|
4272
|
+
declare const cPgetCPDatabaseMetadata: (variables: CPgetCPDatabaseMetadataVariables) => Promise<CPDatabaseMetadata>;
|
4273
|
+
declare type CPupdateCPDatabaseMetadataPathParams = {
|
4274
|
+
/**
|
4275
|
+
* Workspace name
|
4276
|
+
*/
|
4277
|
+
workspaceId: WorkspaceID;
|
4278
|
+
/**
|
4279
|
+
* The Database Name
|
4280
|
+
*/
|
4281
|
+
dbName: DBName;
|
4282
|
+
};
|
4283
|
+
declare type CPupdateCPDatabaseMetadataError = ErrorWrapper<{
|
4284
|
+
status: 400;
|
4285
|
+
payload: BadRequestError;
|
4286
|
+
} | {
|
4287
|
+
status: 401;
|
4288
|
+
payload: AuthError;
|
4289
|
+
} | {
|
4290
|
+
status: 404;
|
4291
|
+
payload: SimpleError;
|
4292
|
+
}>;
|
4293
|
+
declare type CPupdateCPDatabaseMetadataRequestBody = {
|
4294
|
+
ui?: {
|
4295
|
+
/**
|
4296
|
+
* @minLength 1
|
4297
|
+
*/
|
4298
|
+
color?: string;
|
4299
|
+
};
|
4300
|
+
};
|
4301
|
+
declare type CPupdateCPDatabaseMetadataVariables = {
|
4302
|
+
body?: CPupdateCPDatabaseMetadataRequestBody;
|
4303
|
+
pathParams: CPupdateCPDatabaseMetadataPathParams;
|
4304
|
+
} & FetcherExtraProps;
|
4305
|
+
/**
|
4306
|
+
* Update the color of the selected database
|
4307
|
+
*/
|
4308
|
+
declare const cPupdateCPDatabaseMetadata: (variables: CPupdateCPDatabaseMetadataVariables) => Promise<CPDatabaseMetadata>;
|
2681
4309
|
declare const operationsByTag: {
|
2682
4310
|
users: {
|
2683
4311
|
getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
@@ -2697,6 +4325,7 @@ declare const operationsByTag: {
|
|
2697
4325
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
2698
4326
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
2699
4327
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
4328
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
2700
4329
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2701
4330
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2702
4331
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
@@ -2705,6 +4334,8 @@ declare const operationsByTag: {
|
|
2705
4334
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2706
4335
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2707
4336
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
4337
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
4338
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
2708
4339
|
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
2709
4340
|
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
2710
4341
|
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
@@ -2713,17 +4344,35 @@ declare const operationsByTag: {
|
|
2713
4344
|
branch: {
|
2714
4345
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2715
4346
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2716
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
4347
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2717
4348
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2718
4349
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2719
4350
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
4351
|
+
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
4352
|
+
};
|
4353
|
+
migrationRequests: {
|
4354
|
+
queryMigrationRequests: (variables: QueryMigrationRequestsVariables) => Promise<QueryMigrationRequestsResponse>;
|
4355
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
4356
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
4357
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
4358
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
4359
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
4360
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
4361
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
4362
|
+
};
|
4363
|
+
branchSchema: {
|
2720
4364
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2721
4365
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
2722
4366
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2723
|
-
|
4367
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
4368
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
4369
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
4370
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
4371
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
4372
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
2724
4373
|
};
|
2725
4374
|
table: {
|
2726
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
4375
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2727
4376
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2728
4377
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2729
4378
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2735,16 +4384,24 @@ declare const operationsByTag: {
|
|
2735
4384
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2736
4385
|
};
|
2737
4386
|
records: {
|
2738
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
4387
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2739
4388
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2740
4389
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2741
4390
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2742
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
4391
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2743
4392
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2744
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
4393
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2745
4394
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2746
4395
|
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2747
4396
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
4397
|
+
summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
|
4398
|
+
};
|
4399
|
+
databases: {
|
4400
|
+
cPgetDatabaseList: (variables: CPgetDatabaseListVariables) => Promise<CPListDatabasesResponse>;
|
4401
|
+
cPcreateDatabase: (variables: CPcreateDatabaseVariables) => Promise<CPcreateDatabaseResponse>;
|
4402
|
+
cPdeleteDatabase: (variables: CPdeleteDatabaseVariables) => Promise<undefined>;
|
4403
|
+
cPgetCPDatabaseMetadata: (variables: CPgetCPDatabaseMetadataVariables) => Promise<CPDatabaseMetadata>;
|
4404
|
+
cPupdateCPDatabaseMetadata: (variables: CPupdateCPDatabaseMetadataVariables) => Promise<CPDatabaseMetadata>;
|
2748
4405
|
};
|
2749
4406
|
};
|
2750
4407
|
|
@@ -2759,10 +4416,8 @@ interface XataApiClientOptions {
|
|
2759
4416
|
fetch?: FetchImpl;
|
2760
4417
|
apiKey?: string;
|
2761
4418
|
host?: HostProvider;
|
4419
|
+
trace?: TraceFunction;
|
2762
4420
|
}
|
2763
|
-
/**
|
2764
|
-
* @deprecated Use XataApiPlugin instead
|
2765
|
-
*/
|
2766
4421
|
declare class XataApiClient {
|
2767
4422
|
#private;
|
2768
4423
|
constructor(options?: XataApiClientOptions);
|
@@ -2772,6 +4427,8 @@ declare class XataApiClient {
|
|
2772
4427
|
get branches(): BranchApi;
|
2773
4428
|
get tables(): TableApi;
|
2774
4429
|
get records(): RecordsApi;
|
4430
|
+
get migrationRequests(): MigrationRequestsApi;
|
4431
|
+
get branchSchema(): BranchSchemaApi;
|
2775
4432
|
}
|
2776
4433
|
declare class UserApi {
|
2777
4434
|
private extraProps;
|
@@ -2795,6 +4452,7 @@ declare class WorkspaceApi {
|
|
2795
4452
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
2796
4453
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
2797
4454
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
4455
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
2798
4456
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2799
4457
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2800
4458
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
@@ -2805,6 +4463,8 @@ declare class DatabaseApi {
|
|
2805
4463
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2806
4464
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2807
4465
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
4466
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
4467
|
+
updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
2808
4468
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2809
4469
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2810
4470
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
@@ -2815,19 +4475,16 @@ declare class BranchApi {
|
|
2815
4475
|
constructor(extraProps: FetcherExtraProps);
|
2816
4476
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2817
4477
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2818
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
4478
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
2819
4479
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2820
4480
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2821
4481
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2822
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
2823
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
2824
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
2825
4482
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2826
4483
|
}
|
2827
4484
|
declare class TableApi {
|
2828
4485
|
private extraProps;
|
2829
4486
|
constructor(extraProps: FetcherExtraProps);
|
2830
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
4487
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2831
4488
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2832
4489
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2833
4490
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2841,16 +4498,42 @@ declare class TableApi {
|
|
2841
4498
|
declare class RecordsApi {
|
2842
4499
|
private extraProps;
|
2843
4500
|
constructor(extraProps: FetcherExtraProps);
|
2844
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
4501
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
2845
4502
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2846
4503
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2847
4504
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2848
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2849
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2850
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
4505
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
4506
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
4507
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
2851
4508
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2852
4509
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2853
4510
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
4511
|
+
summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
|
4512
|
+
}
|
4513
|
+
declare class MigrationRequestsApi {
|
4514
|
+
private extraProps;
|
4515
|
+
constructor(extraProps: FetcherExtraProps);
|
4516
|
+
queryMigrationRequests(workspace: WorkspaceID, database: DBName, options?: QueryMigrationRequestsRequestBody): Promise<QueryMigrationRequestsResponse>;
|
4517
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
4518
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
4519
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
4520
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
4521
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
4522
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
4523
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
4524
|
+
}
|
4525
|
+
declare class BranchSchemaApi {
|
4526
|
+
private extraProps;
|
4527
|
+
constructor(extraProps: FetcherExtraProps);
|
4528
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
4529
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
4530
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
4531
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
4532
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
4533
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
4534
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
4535
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
4536
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
2854
4537
|
}
|
2855
4538
|
|
2856
4539
|
declare class XataApiPlugin implements XataPlugin {
|
@@ -2863,19 +4546,20 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2863
4546
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2864
4547
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2865
4548
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2866
|
-
declare type NonEmptyArray<T> = T[] & {
|
2867
|
-
0: T;
|
2868
|
-
};
|
2869
4549
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2870
4550
|
[P in K]-?: NonNullable<T[P]>;
|
2871
4551
|
};
|
2872
4552
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2873
4553
|
declare type SingleOrArray<T> = T | T[];
|
2874
4554
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
4555
|
+
declare type Without<T, U> = {
|
4556
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
4557
|
+
};
|
4558
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
2875
4559
|
|
2876
4560
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2877
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2878
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
4561
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
4562
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2879
4563
|
}>>;
|
2880
4564
|
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
|
2881
4565
|
V: ValueAtColumn<Item, V>;
|
@@ -2911,42 +4595,51 @@ interface BaseData {
|
|
2911
4595
|
/**
|
2912
4596
|
* Represents a persisted record from the database.
|
2913
4597
|
*/
|
2914
|
-
interface XataRecord<
|
4598
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2915
4599
|
/**
|
2916
4600
|
* Get metadata of this record.
|
2917
4601
|
*/
|
2918
|
-
getMetadata(): XataRecordMetadata
|
4602
|
+
getMetadata(): XataRecordMetadata;
|
4603
|
+
/**
|
4604
|
+
* Retrieves a refreshed copy of the current record from the database.
|
4605
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4606
|
+
* @returns The persisted record with the selected columns, null if not found.
|
4607
|
+
*/
|
4608
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2919
4609
|
/**
|
2920
4610
|
* Retrieves a refreshed copy of the current record from the database.
|
4611
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2921
4612
|
*/
|
2922
|
-
read(): Promise<Readonly<SelectedPick<
|
4613
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2923
4614
|
/**
|
2924
4615
|
* Performs a partial update of the current record. On success a new object is
|
2925
4616
|
* returned and the current object is not mutated.
|
2926
4617
|
* @param partialUpdate The columns and their values that have to be updated.
|
2927
|
-
* @
|
4618
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4619
|
+
* @returns The persisted record with the selected columns, null if not found.
|
2928
4620
|
*/
|
2929
|
-
update(partialUpdate: Partial<EditableData<
|
4621
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2930
4622
|
/**
|
2931
|
-
* Performs a
|
2932
|
-
*
|
2933
|
-
* @
|
4623
|
+
* Performs a partial update of the current record. On success a new object is
|
4624
|
+
* returned and the current object is not mutated.
|
4625
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
4626
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2934
4627
|
*/
|
2935
|
-
|
2936
|
-
}
|
2937
|
-
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
4628
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2938
4629
|
/**
|
2939
|
-
*
|
4630
|
+
* Performs a deletion of the current record in the database.
|
4631
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4632
|
+
* @returns The deleted record, null if not found.
|
2940
4633
|
*/
|
2941
|
-
|
4634
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2942
4635
|
/**
|
2943
|
-
* Performs a
|
2944
|
-
*
|
2945
|
-
|
2946
|
-
* @returns A new record containing the latest values for all the columns of the current record.
|
4636
|
+
* Performs a deletion of the current record in the database.
|
4637
|
+
* @returns The deleted record, null if not found.
|
4638
|
+
|
2947
4639
|
*/
|
2948
|
-
|
2949
|
-
}
|
4640
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
4641
|
+
}
|
4642
|
+
declare type Link<Record extends XataRecord> = XataRecord<Record>;
|
2950
4643
|
declare type XataRecordMetadata = {
|
2951
4644
|
/**
|
2952
4645
|
* Number that is increased every time the record is updated.
|
@@ -2956,13 +4649,13 @@ declare type XataRecordMetadata = {
|
|
2956
4649
|
};
|
2957
4650
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2958
4651
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2959
|
-
declare type EditableData<O extends
|
4652
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
2960
4653
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2961
4654
|
id: string;
|
2962
4655
|
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2963
4656
|
id: string;
|
2964
4657
|
} | string | null | undefined : O[K];
|
2965
|
-
}
|
4658
|
+
}, keyof XataRecord>;
|
2966
4659
|
|
2967
4660
|
/**
|
2968
4661
|
* PropertyMatchFilter
|
@@ -3056,7 +4749,101 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
3056
4749
|
declare type NestedApiFilter<T> = {
|
3057
4750
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3058
4751
|
};
|
3059
|
-
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
4752
|
+
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>;
|
4753
|
+
|
4754
|
+
declare type DateBooster = {
|
4755
|
+
origin?: string;
|
4756
|
+
scale: string;
|
4757
|
+
decay: number;
|
4758
|
+
};
|
4759
|
+
declare type NumericBooster = {
|
4760
|
+
factor: number;
|
4761
|
+
};
|
4762
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
4763
|
+
value: T;
|
4764
|
+
factor: number;
|
4765
|
+
};
|
4766
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
4767
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
4768
|
+
dateBooster: {
|
4769
|
+
column: K;
|
4770
|
+
} & DateBooster;
|
4771
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
4772
|
+
numericBooster?: {
|
4773
|
+
column: K;
|
4774
|
+
} & NumericBooster;
|
4775
|
+
}, {
|
4776
|
+
valueBooster?: {
|
4777
|
+
column: K;
|
4778
|
+
} & ValueBooster<number>;
|
4779
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
4780
|
+
valueBooster: {
|
4781
|
+
column: K;
|
4782
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
4783
|
+
} : never;
|
4784
|
+
}>;
|
4785
|
+
|
4786
|
+
declare type TargetColumn<T extends XataRecord> = SelectableColumn<T> | {
|
4787
|
+
/**
|
4788
|
+
* The name of the column.
|
4789
|
+
*/
|
4790
|
+
column: SelectableColumn<T>;
|
4791
|
+
/**
|
4792
|
+
* The weight of the column.
|
4793
|
+
*
|
4794
|
+
* @default 1
|
4795
|
+
* @maximum 10
|
4796
|
+
* @minimum 1
|
4797
|
+
*/
|
4798
|
+
weight?: number;
|
4799
|
+
};
|
4800
|
+
|
4801
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
4802
|
+
fuzziness?: FuzzinessExpression;
|
4803
|
+
prefix?: PrefixExpression;
|
4804
|
+
highlight?: HighlightExpression;
|
4805
|
+
tables?: Array<Tables | Values<{
|
4806
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
4807
|
+
table: Model;
|
4808
|
+
target?: TargetColumn<Schemas[Model] & XataRecord>[];
|
4809
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
4810
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
4811
|
+
};
|
4812
|
+
}>>;
|
4813
|
+
};
|
4814
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
4815
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
4816
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
4817
|
+
table: Model;
|
4818
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
4819
|
+
};
|
4820
|
+
}>[]>;
|
4821
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
4822
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
4823
|
+
}>;
|
4824
|
+
};
|
4825
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
4826
|
+
#private;
|
4827
|
+
private db;
|
4828
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
4829
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
4830
|
+
}
|
4831
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
4832
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
4833
|
+
};
|
4834
|
+
declare type SearchExtraProperties = {
|
4835
|
+
table: string;
|
4836
|
+
highlight?: {
|
4837
|
+
[key: string]: string[] | {
|
4838
|
+
[key: string]: any;
|
4839
|
+
};
|
4840
|
+
};
|
4841
|
+
score?: number;
|
4842
|
+
};
|
4843
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
4844
|
+
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 {
|
4845
|
+
table: infer Table;
|
4846
|
+
} ? ReturnTable<Table, Tables> : never;
|
3060
4847
|
|
3061
4848
|
declare type SortDirection = 'asc' | 'desc';
|
3062
4849
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -3069,7 +4856,7 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
3069
4856
|
};
|
3070
4857
|
|
3071
4858
|
declare type BaseOptions<T extends XataRecord> = {
|
3072
|
-
columns?:
|
4859
|
+
columns?: SelectableColumn<T>[];
|
3073
4860
|
cache?: number;
|
3074
4861
|
};
|
3075
4862
|
declare type CursorQueryOptions = {
|
@@ -3093,7 +4880,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3093
4880
|
#private;
|
3094
4881
|
readonly meta: PaginationQueryMeta;
|
3095
4882
|
readonly records: RecordArray<Result>;
|
3096
|
-
constructor(repository: Repository<Record> | null, table:
|
4883
|
+
constructor(repository: Repository<Record> | null, table: {
|
4884
|
+
name: string;
|
4885
|
+
schema?: Table;
|
4886
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3097
4887
|
getQueryOptions(): QueryOptions<Record>;
|
3098
4888
|
key(): string;
|
3099
4889
|
/**
|
@@ -3132,7 +4922,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3132
4922
|
* @param value The value to filter.
|
3133
4923
|
* @returns A new Query object.
|
3134
4924
|
*/
|
3135
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F
|
4925
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
3136
4926
|
/**
|
3137
4927
|
* Builds a new query object adding one or more constraints. Examples:
|
3138
4928
|
*
|
@@ -3146,20 +4936,20 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3146
4936
|
* @param filters A filter object
|
3147
4937
|
* @returns A new Query object.
|
3148
4938
|
*/
|
3149
|
-
filter(filters
|
4939
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
3150
4940
|
/**
|
3151
4941
|
* Builds a new query with a new sort option.
|
3152
4942
|
* @param column The column name.
|
3153
4943
|
* @param direction The direction. Either ascending or descending.
|
3154
4944
|
* @returns A new Query object.
|
3155
4945
|
*/
|
3156
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
4946
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
3157
4947
|
/**
|
3158
4948
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
3159
4949
|
* @param columns Array of column names to be returned by the query.
|
3160
4950
|
* @returns A new Query object.
|
3161
4951
|
*/
|
3162
|
-
select<K extends SelectableColumn<Record>>(columns:
|
4952
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
3163
4953
|
/**
|
3164
4954
|
* Get paginated results
|
3165
4955
|
*
|
@@ -3269,6 +5059,26 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3269
5059
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3270
5060
|
*/
|
3271
5061
|
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
5062
|
+
/**
|
5063
|
+
* Performs the query in the database and returns the first result.
|
5064
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5065
|
+
* @throws if there are no results.
|
5066
|
+
*/
|
5067
|
+
getFirstOrThrow(): Promise<Result>;
|
5068
|
+
/**
|
5069
|
+
* Performs the query in the database and returns the first result.
|
5070
|
+
* @param options Additional options to be used when performing the query.
|
5071
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5072
|
+
* @throws if there are no results.
|
5073
|
+
*/
|
5074
|
+
getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
|
5075
|
+
/**
|
5076
|
+
* Performs the query in the database and returns the first result.
|
5077
|
+
* @param options Additional options to be used when performing the query.
|
5078
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5079
|
+
* @throws if there are no results.
|
5080
|
+
*/
|
5081
|
+
getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
|
3272
5082
|
/**
|
3273
5083
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3274
5084
|
* @param ttl The cache TTL in milliseconds.
|
@@ -3390,6 +5200,8 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3390
5200
|
#private;
|
3391
5201
|
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
3392
5202
|
static parseConstructorParams(...args: any[]): any[];
|
5203
|
+
toArray(): Result[];
|
5204
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
3393
5205
|
/**
|
3394
5206
|
* Retrieve next page of records
|
3395
5207
|
*
|
@@ -3423,21 +5235,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3423
5235
|
/**
|
3424
5236
|
* Common interface for performing operations on a table.
|
3425
5237
|
*/
|
3426
|
-
declare abstract class Repository<
|
3427
|
-
abstract create(object: EditableData<
|
5238
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
5239
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5240
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5241
|
+
/**
|
5242
|
+
* Creates a single record in the table with a unique id.
|
5243
|
+
* @param id The unique id.
|
5244
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
5245
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5246
|
+
* @returns The full persisted record.
|
5247
|
+
*/
|
5248
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3428
5249
|
/**
|
3429
5250
|
* Creates a single record in the table with a unique id.
|
3430
5251
|
* @param id The unique id.
|
3431
5252
|
* @param object Object containing the column names with their values to be stored in the table.
|
3432
5253
|
* @returns The full persisted record.
|
3433
5254
|
*/
|
3434
|
-
abstract create(id: string, object: EditableData<
|
5255
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3435
5256
|
/**
|
3436
5257
|
* Creates multiple records in the table.
|
3437
5258
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3438
|
-
* @
|
5259
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5260
|
+
* @returns Array of the persisted records in order.
|
5261
|
+
*/
|
5262
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5263
|
+
/**
|
5264
|
+
* Creates multiple records in the table.
|
5265
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
5266
|
+
* @returns Array of the persisted records in order.
|
5267
|
+
*/
|
5268
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5269
|
+
/**
|
5270
|
+
* Queries a single record from the table given its unique id.
|
5271
|
+
* @param id The unique id.
|
5272
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5273
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3439
5274
|
*/
|
3440
|
-
abstract
|
5275
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3441
5276
|
/**
|
3442
5277
|
* Queries a single record from the table given its unique id.
|
3443
5278
|
* @param id The unique id.
|
@@ -3447,9 +5282,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3447
5282
|
/**
|
3448
5283
|
* Queries multiple records from the table given their unique id.
|
3449
5284
|
* @param ids The unique ids array.
|
3450
|
-
* @
|
5285
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5286
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5287
|
+
*/
|
5288
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5289
|
+
/**
|
5290
|
+
* Queries multiple records from the table given their unique id.
|
5291
|
+
* @param ids The unique ids array.
|
5292
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3451
5293
|
*/
|
3452
|
-
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']
|
5294
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5295
|
+
/**
|
5296
|
+
* Queries a single record from the table by the id in the object.
|
5297
|
+
* @param object Object containing the id of the record.
|
5298
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5299
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
5300
|
+
*/
|
5301
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3453
5302
|
/**
|
3454
5303
|
* Queries a single record from the table by the id in the object.
|
3455
5304
|
* @param object Object containing the id of the record.
|
@@ -3459,35 +5308,188 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3459
5308
|
/**
|
3460
5309
|
* Queries multiple records from the table by the ids in the objects.
|
3461
5310
|
* @param objects Array of objects containing the ids of the records.
|
3462
|
-
* @
|
5311
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5312
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5313
|
+
*/
|
5314
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5315
|
+
/**
|
5316
|
+
* Queries multiple records from the table by the ids in the objects.
|
5317
|
+
* @param objects Array of objects containing the ids of the records.
|
5318
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5319
|
+
*/
|
5320
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5321
|
+
/**
|
5322
|
+
* Queries a single record from the table given its unique id.
|
5323
|
+
* @param id The unique id.
|
5324
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5325
|
+
* @returns The persisted record for the given id.
|
5326
|
+
* @throws If the record could not be found.
|
5327
|
+
*/
|
5328
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5329
|
+
/**
|
5330
|
+
* Queries a single record from the table given its unique id.
|
5331
|
+
* @param id The unique id.
|
5332
|
+
* @returns The persisted record for the given id.
|
5333
|
+
* @throws If the record could not be found.
|
5334
|
+
*/
|
5335
|
+
abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5336
|
+
/**
|
5337
|
+
* Queries multiple records from the table given their unique id.
|
5338
|
+
* @param ids The unique ids array.
|
5339
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5340
|
+
* @returns The persisted records for the given ids in order.
|
5341
|
+
* @throws If one or more records could not be found.
|
5342
|
+
*/
|
5343
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5344
|
+
/**
|
5345
|
+
* Queries multiple records from the table given their unique id.
|
5346
|
+
* @param ids The unique ids array.
|
5347
|
+
* @returns The persisted records for the given ids in order.
|
5348
|
+
* @throws If one or more records could not be found.
|
5349
|
+
*/
|
5350
|
+
abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5351
|
+
/**
|
5352
|
+
* Queries a single record from the table by the id in the object.
|
5353
|
+
* @param object Object containing the id of the record.
|
5354
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5355
|
+
* @returns The persisted record for the given id.
|
5356
|
+
* @throws If the record could not be found.
|
5357
|
+
*/
|
5358
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5359
|
+
/**
|
5360
|
+
* Queries a single record from the table by the id in the object.
|
5361
|
+
* @param object Object containing the id of the record.
|
5362
|
+
* @returns The persisted record for the given id.
|
5363
|
+
* @throws If the record could not be found.
|
5364
|
+
*/
|
5365
|
+
abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5366
|
+
/**
|
5367
|
+
* Queries multiple records from the table by the ids in the objects.
|
5368
|
+
* @param objects Array of objects containing the ids of the records.
|
5369
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5370
|
+
* @returns The persisted records for the given ids in order.
|
5371
|
+
* @throws If one or more records could not be found.
|
5372
|
+
*/
|
5373
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5374
|
+
/**
|
5375
|
+
* Queries multiple records from the table by the ids in the objects.
|
5376
|
+
* @param objects Array of objects containing the ids of the records.
|
5377
|
+
* @returns The persisted records for the given ids in order.
|
5378
|
+
* @throws If one or more records could not be found.
|
5379
|
+
*/
|
5380
|
+
abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5381
|
+
/**
|
5382
|
+
* Partially update a single record.
|
5383
|
+
* @param object An object with its id and the columns to be updated.
|
5384
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5385
|
+
* @returns The full persisted record, null if the record could not be found.
|
5386
|
+
*/
|
5387
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5388
|
+
/**
|
5389
|
+
* Partially update a single record.
|
5390
|
+
* @param object An object with its id and the columns to be updated.
|
5391
|
+
* @returns The full persisted record, null if the record could not be found.
|
5392
|
+
*/
|
5393
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5394
|
+
/**
|
5395
|
+
* Partially update a single record given its unique id.
|
5396
|
+
* @param id The unique id.
|
5397
|
+
* @param object The column names and their values that have to be updated.
|
5398
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5399
|
+
* @returns The full persisted record, null if the record could not be found.
|
5400
|
+
*/
|
5401
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5402
|
+
/**
|
5403
|
+
* Partially update a single record given its unique id.
|
5404
|
+
* @param id The unique id.
|
5405
|
+
* @param object The column names and their values that have to be updated.
|
5406
|
+
* @returns The full persisted record, null if the record could not be found.
|
5407
|
+
*/
|
5408
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5409
|
+
/**
|
5410
|
+
* Partially updates multiple records.
|
5411
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5412
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5413
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
5414
|
+
*/
|
5415
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5416
|
+
/**
|
5417
|
+
* Partially updates multiple records.
|
5418
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5419
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
5420
|
+
*/
|
5421
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5422
|
+
/**
|
5423
|
+
* Partially update a single record.
|
5424
|
+
* @param object An object with its id and the columns to be updated.
|
5425
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5426
|
+
* @returns The full persisted record.
|
5427
|
+
* @throws If the record could not be found.
|
3463
5428
|
*/
|
3464
|
-
abstract
|
5429
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3465
5430
|
/**
|
3466
5431
|
* Partially update a single record.
|
3467
5432
|
* @param object An object with its id and the columns to be updated.
|
3468
5433
|
* @returns The full persisted record.
|
5434
|
+
* @throws If the record could not be found.
|
3469
5435
|
*/
|
3470
|
-
abstract
|
5436
|
+
abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3471
5437
|
/**
|
3472
5438
|
* Partially update a single record given its unique id.
|
3473
5439
|
* @param id The unique id.
|
3474
5440
|
* @param object The column names and their values that have to be updated.
|
5441
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3475
5442
|
* @returns The full persisted record.
|
5443
|
+
* @throws If the record could not be found.
|
3476
5444
|
*/
|
3477
|
-
abstract
|
5445
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5446
|
+
/**
|
5447
|
+
* Partially update a single record given its unique id.
|
5448
|
+
* @param id The unique id.
|
5449
|
+
* @param object The column names and their values that have to be updated.
|
5450
|
+
* @returns The full persisted record.
|
5451
|
+
* @throws If the record could not be found.
|
5452
|
+
*/
|
5453
|
+
abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3478
5454
|
/**
|
3479
5455
|
* Partially updates multiple records.
|
3480
5456
|
* @param objects An array of objects with their ids and columns to be updated.
|
3481
|
-
* @
|
5457
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5458
|
+
* @returns Array of the persisted records in order.
|
5459
|
+
* @throws If one or more records could not be found.
|
5460
|
+
*/
|
5461
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5462
|
+
/**
|
5463
|
+
* Partially updates multiple records.
|
5464
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5465
|
+
* @returns Array of the persisted records in order.
|
5466
|
+
* @throws If one or more records could not be found.
|
5467
|
+
*/
|
5468
|
+
abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5469
|
+
/**
|
5470
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5471
|
+
* it will be update, otherwise a new record will be created.
|
5472
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
5473
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5474
|
+
* @returns The full persisted record.
|
3482
5475
|
*/
|
3483
|
-
abstract
|
5476
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3484
5477
|
/**
|
3485
5478
|
* Creates or updates a single record. If a record exists with the given id,
|
3486
5479
|
* it will be update, otherwise a new record will be created.
|
3487
5480
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3488
5481
|
* @returns The full persisted record.
|
3489
5482
|
*/
|
3490
|
-
abstract createOrUpdate(object: EditableData<
|
5483
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5484
|
+
/**
|
5485
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5486
|
+
* it will be update, otherwise a new record will be created.
|
5487
|
+
* @param id A unique id.
|
5488
|
+
* @param object The column names and the values to be persisted.
|
5489
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5490
|
+
* @returns The full persisted record.
|
5491
|
+
*/
|
5492
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3491
5493
|
/**
|
3492
5494
|
* Creates or updates a single record. If a record exists with the given id,
|
3493
5495
|
* it will be update, otherwise a new record will be created.
|
@@ -3495,38 +5497,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3495
5497
|
* @param object The column names and the values to be persisted.
|
3496
5498
|
* @returns The full persisted record.
|
3497
5499
|
*/
|
3498
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
5500
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3499
5501
|
/**
|
3500
5502
|
* Creates or updates a single record. If a record exists with the given id,
|
3501
5503
|
* it will be update, otherwise a new record will be created.
|
3502
5504
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
5505
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3503
5506
|
* @returns Array of the persisted records.
|
3504
5507
|
*/
|
3505
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
5508
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5509
|
+
/**
|
5510
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5511
|
+
* it will be update, otherwise a new record will be created.
|
5512
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
5513
|
+
* @returns Array of the persisted records.
|
5514
|
+
*/
|
5515
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5516
|
+
/**
|
5517
|
+
* Deletes a record given its unique id.
|
5518
|
+
* @param object An object with a unique id.
|
5519
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5520
|
+
* @returns The deleted record, null if the record could not be found.
|
5521
|
+
*/
|
5522
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3506
5523
|
/**
|
3507
5524
|
* Deletes a record given its unique id.
|
5525
|
+
* @param object An object with a unique id.
|
5526
|
+
* @returns The deleted record, null if the record could not be found.
|
5527
|
+
*/
|
5528
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5529
|
+
/**
|
5530
|
+
* Deletes a record given a unique id.
|
5531
|
+
* @param id The unique id.
|
5532
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5533
|
+
* @returns The deleted record, null if the record could not be found.
|
5534
|
+
*/
|
5535
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5536
|
+
/**
|
5537
|
+
* Deletes a record given a unique id.
|
3508
5538
|
* @param id The unique id.
|
3509
|
-
* @
|
5539
|
+
* @returns The deleted record, null if the record could not be found.
|
5540
|
+
*/
|
5541
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5542
|
+
/**
|
5543
|
+
* Deletes multiple records given an array of objects with ids.
|
5544
|
+
* @param objects An array of objects with unique ids.
|
5545
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5546
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3510
5547
|
*/
|
3511
|
-
abstract delete(
|
5548
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5549
|
+
/**
|
5550
|
+
* Deletes multiple records given an array of objects with ids.
|
5551
|
+
* @param objects An array of objects with unique ids.
|
5552
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5553
|
+
*/
|
5554
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5555
|
+
/**
|
5556
|
+
* Deletes multiple records given an array of unique ids.
|
5557
|
+
* @param objects An array of ids.
|
5558
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5559
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5560
|
+
*/
|
5561
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5562
|
+
/**
|
5563
|
+
* Deletes multiple records given an array of unique ids.
|
5564
|
+
* @param objects An array of ids.
|
5565
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5566
|
+
*/
|
5567
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5568
|
+
/**
|
5569
|
+
* Deletes a record given its unique id.
|
5570
|
+
* @param object An object with a unique id.
|
5571
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5572
|
+
* @returns The deleted record, null if the record could not be found.
|
5573
|
+
* @throws If the record could not be found.
|
5574
|
+
*/
|
5575
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3512
5576
|
/**
|
3513
5577
|
* Deletes a record given its unique id.
|
3514
|
-
* @param
|
3515
|
-
* @
|
5578
|
+
* @param object An object with a unique id.
|
5579
|
+
* @returns The deleted record, null if the record could not be found.
|
5580
|
+
* @throws If the record could not be found.
|
5581
|
+
*/
|
5582
|
+
abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5583
|
+
/**
|
5584
|
+
* Deletes a record given a unique id.
|
5585
|
+
* @param id The unique id.
|
5586
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5587
|
+
* @returns The deleted record, null if the record could not be found.
|
5588
|
+
* @throws If the record could not be found.
|
5589
|
+
*/
|
5590
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5591
|
+
/**
|
5592
|
+
* Deletes a record given a unique id.
|
5593
|
+
* @param id The unique id.
|
5594
|
+
* @returns The deleted record, null if the record could not be found.
|
5595
|
+
* @throws If the record could not be found.
|
5596
|
+
*/
|
5597
|
+
abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5598
|
+
/**
|
5599
|
+
* Deletes multiple records given an array of objects with ids.
|
5600
|
+
* @param objects An array of objects with unique ids.
|
5601
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5602
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5603
|
+
* @throws If one or more records could not be found.
|
5604
|
+
*/
|
5605
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5606
|
+
/**
|
5607
|
+
* Deletes multiple records given an array of objects with ids.
|
5608
|
+
* @param objects An array of objects with unique ids.
|
5609
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5610
|
+
* @throws If one or more records could not be found.
|
3516
5611
|
*/
|
3517
|
-
abstract
|
5612
|
+
abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3518
5613
|
/**
|
3519
|
-
* Deletes
|
3520
|
-
* @param
|
3521
|
-
* @
|
5614
|
+
* Deletes multiple records given an array of unique ids.
|
5615
|
+
* @param objects An array of ids.
|
5616
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5617
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5618
|
+
* @throws If one or more records could not be found.
|
3522
5619
|
*/
|
3523
|
-
abstract
|
5620
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3524
5621
|
/**
|
3525
|
-
* Deletes
|
3526
|
-
* @param
|
3527
|
-
* @
|
5622
|
+
* Deletes multiple records given an array of unique ids.
|
5623
|
+
* @param objects An array of ids.
|
5624
|
+
* @returns Array of the deleted records in order.
|
5625
|
+
* @throws If one or more records could not be found.
|
3528
5626
|
*/
|
3529
|
-
abstract
|
5627
|
+
abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3530
5628
|
/**
|
3531
5629
|
* Search for records in the table.
|
3532
5630
|
* @param query The query to search for.
|
@@ -3535,39 +5633,84 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3535
5633
|
*/
|
3536
5634
|
abstract search(query: string, options?: {
|
3537
5635
|
fuzziness?: FuzzinessExpression;
|
5636
|
+
prefix?: PrefixExpression;
|
3538
5637
|
highlight?: HighlightExpression;
|
3539
5638
|
filter?: Filter<Record>;
|
3540
|
-
|
5639
|
+
boosters?: Boosters<Record>[];
|
5640
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3541
5641
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3542
5642
|
}
|
3543
|
-
declare class RestRepository<
|
5643
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3544
5644
|
#private;
|
3545
|
-
db: SchemaPluginResult<any>;
|
3546
5645
|
constructor(options: {
|
3547
5646
|
table: string;
|
3548
5647
|
db: SchemaPluginResult<any>;
|
3549
5648
|
pluginOptions: XataPluginOptions;
|
3550
5649
|
schemaTables?: Table[];
|
3551
5650
|
});
|
3552
|
-
create(object: EditableData<
|
3553
|
-
create(
|
3554
|
-
create(
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
read(
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
5651
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5652
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5653
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5654
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5655
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5656
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5657
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5658
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5659
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5660
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5661
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5662
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5663
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5664
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5665
|
+
readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5666
|
+
readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5667
|
+
readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5668
|
+
readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5669
|
+
readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5670
|
+
readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5671
|
+
readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5672
|
+
readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5673
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5674
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5675
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5676
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5677
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5678
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5679
|
+
updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5680
|
+
updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5681
|
+
updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5682
|
+
updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5683
|
+
updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5684
|
+
updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5685
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5686
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5687
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5688
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5689
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5690
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5691
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5692
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5693
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5694
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5695
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5696
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5697
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5698
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5699
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5700
|
+
deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5701
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5702
|
+
deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5703
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5704
|
+
deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5705
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5706
|
+
deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3566
5707
|
search(query: string, options?: {
|
3567
5708
|
fuzziness?: FuzzinessExpression;
|
5709
|
+
prefix?: PrefixExpression;
|
3568
5710
|
highlight?: HighlightExpression;
|
3569
5711
|
filter?: Filter<Record>;
|
3570
|
-
|
5712
|
+
boosters?: Boosters<Record>[];
|
5713
|
+
}): Promise<any>;
|
3571
5714
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3572
5715
|
}
|
3573
5716
|
|
@@ -3576,6 +5719,7 @@ declare type BaseSchema = {
|
|
3576
5719
|
columns: readonly ({
|
3577
5720
|
name: string;
|
3578
5721
|
type: Column['type'];
|
5722
|
+
notNull?: boolean;
|
3579
5723
|
} | {
|
3580
5724
|
name: string;
|
3581
5725
|
type: 'link';
|
@@ -3605,10 +5749,10 @@ declare type TableType<Tables, TableName> = Tables & {
|
|
3605
5749
|
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3606
5750
|
name: string;
|
3607
5751
|
type: string;
|
3608
|
-
} ? {
|
3609
|
-
[K in Columns[number]['name']]
|
3610
|
-
} : never : never : never : never;
|
3611
|
-
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
5752
|
+
} ? Identifiable & UnionToIntersection<Values<{
|
5753
|
+
[K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
|
5754
|
+
}>> : never : never : never : never;
|
5755
|
+
declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
|
3612
5756
|
name: PropertyName;
|
3613
5757
|
} extends infer Property ? Property extends {
|
3614
5758
|
name: string;
|
@@ -3617,13 +5761,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
|
3617
5761
|
table: infer LinkedTable;
|
3618
5762
|
};
|
3619
5763
|
columns?: infer ObjectColumns;
|
3620
|
-
|
5764
|
+
notNull?: infer NotNull;
|
5765
|
+
} ? NotNull extends true ? {
|
5766
|
+
[K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
|
5767
|
+
} : {
|
5768
|
+
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
5769
|
+
} : never : never;
|
5770
|
+
declare type InnerType<Type, ObjectColumns, Tables, LinkedTable> = Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
|
3621
5771
|
name: string;
|
3622
5772
|
type: string;
|
3623
|
-
} ? {
|
3624
|
-
[K in ObjectColumns[number]['name']]
|
3625
|
-
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never
|
5773
|
+
} ? UnionToIntersection<Values<{
|
5774
|
+
[K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
|
5775
|
+
}>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
|
3626
5776
|
|
5777
|
+
/**
|
5778
|
+
* Operator to restrict results to only values that are greater than the given value.
|
5779
|
+
*/
|
5780
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3627
5781
|
/**
|
3628
5782
|
* Operator to restrict results to only values that are greater than the given value.
|
3629
5783
|
*/
|
@@ -3631,15 +5785,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3631
5785
|
/**
|
3632
5786
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3633
5787
|
*/
|
3634
|
-
declare const
|
5788
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5789
|
+
/**
|
5790
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
5791
|
+
*/
|
5792
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3635
5793
|
/**
|
3636
5794
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3637
5795
|
*/
|
3638
5796
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5797
|
+
/**
|
5798
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
5799
|
+
*/
|
5800
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5801
|
+
/**
|
5802
|
+
* Operator to restrict results to only values that are lower than the given value.
|
5803
|
+
*/
|
5804
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3639
5805
|
/**
|
3640
5806
|
* Operator to restrict results to only values that are lower than the given value.
|
3641
5807
|
*/
|
3642
5808
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5809
|
+
/**
|
5810
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
5811
|
+
*/
|
5812
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5813
|
+
/**
|
5814
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
5815
|
+
*/
|
5816
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3643
5817
|
/**
|
3644
5818
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3645
5819
|
*/
|
@@ -3672,6 +5846,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3672
5846
|
* Operator to restrict results to only values that are equal to the given value.
|
3673
5847
|
*/
|
3674
5848
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
5849
|
+
/**
|
5850
|
+
* Operator to restrict results to only values that are equal to the given value.
|
5851
|
+
*/
|
5852
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
3675
5853
|
/**
|
3676
5854
|
* Operator to restrict results to only values that are not equal to the given value.
|
3677
5855
|
*/
|
@@ -3700,58 +5878,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3700
5878
|
declare type SchemaDefinition = {
|
3701
5879
|
table: string;
|
3702
5880
|
};
|
3703
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
5881
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
3704
5882
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3705
|
-
} & {
|
3706
|
-
[key: string]: Repository<XataRecord$1>;
|
3707
5883
|
};
|
3708
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
5884
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3709
5885
|
#private;
|
3710
5886
|
constructor(schemaTables?: Schemas.Table[]);
|
3711
5887
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3712
5888
|
}
|
3713
5889
|
|
3714
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3715
|
-
fuzziness?: FuzzinessExpression;
|
3716
|
-
highlight?: HighlightExpression;
|
3717
|
-
tables?: Array<Tables | Values<{
|
3718
|
-
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3719
|
-
table: Model;
|
3720
|
-
filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3721
|
-
};
|
3722
|
-
}>>;
|
3723
|
-
};
|
3724
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3725
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3726
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3727
|
-
table: Model;
|
3728
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3729
|
-
};
|
3730
|
-
}>[]>;
|
3731
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3732
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3733
|
-
}>;
|
3734
|
-
};
|
3735
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3736
|
-
#private;
|
3737
|
-
private db;
|
3738
|
-
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3739
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3740
|
-
}
|
3741
|
-
declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
|
3742
|
-
declare type SearchExtraProperties = {
|
3743
|
-
table: string;
|
3744
|
-
highlight?: {
|
3745
|
-
[key: string]: string[] | {
|
3746
|
-
[key: string]: any;
|
3747
|
-
};
|
3748
|
-
};
|
3749
|
-
};
|
3750
|
-
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3751
|
-
declare type ExtractTables<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>, TableOptions extends GetArrayInnerType<NonNullable<NonNullable<SearchOptions<Schemas, Tables>>['tables']>>> = TableOptions extends `${infer Table}` ? ReturnTable<Table, Tables> : TableOptions extends {
|
3752
|
-
table: infer Table;
|
3753
|
-
} ? ReturnTable<Table, Tables> : never;
|
3754
|
-
|
3755
5890
|
declare type BranchStrategyValue = string | undefined | null;
|
3756
5891
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3757
5892
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3763,19 +5898,34 @@ declare type BaseClientOptions = {
|
|
3763
5898
|
databaseURL?: string;
|
3764
5899
|
branch?: BranchStrategyOption;
|
3765
5900
|
cache?: CacheImpl;
|
5901
|
+
trace?: TraceFunction;
|
3766
5902
|
};
|
3767
5903
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3768
5904
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3769
|
-
new <
|
3770
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
3771
|
-
search: Awaited<ReturnType<SearchPlugin<
|
5905
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
5906
|
+
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
5907
|
+
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3772
5908
|
}, keyof Plugins> & {
|
3773
5909
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
5910
|
+
} & {
|
5911
|
+
getConfig(): Promise<{
|
5912
|
+
databaseURL: string;
|
5913
|
+
branch: string;
|
5914
|
+
}>;
|
3774
5915
|
};
|
3775
5916
|
}
|
3776
5917
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3777
|
-
declare class BaseClient extends BaseClient_base<
|
5918
|
+
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
5919
|
+
}
|
5920
|
+
|
5921
|
+
declare class Serializer {
|
5922
|
+
classes: Record<string, any>;
|
5923
|
+
add(clazz: any): void;
|
5924
|
+
toJSON<T>(data: T): string;
|
5925
|
+
fromJSON<T>(json: string): T;
|
3778
5926
|
}
|
5927
|
+
declare const serialize: <T>(data: T) => string;
|
5928
|
+
declare const deserialize: <T>(json: string) => T;
|
3779
5929
|
|
3780
5930
|
declare type BranchResolutionOptions = {
|
3781
5931
|
databaseURL?: string;
|
@@ -3788,9 +5938,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
3788
5938
|
|
3789
5939
|
declare function getAPIKey(): string | undefined;
|
3790
5940
|
|
5941
|
+
interface Body {
|
5942
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
5943
|
+
blob(): Promise<Blob>;
|
5944
|
+
formData(): Promise<FormData>;
|
5945
|
+
json(): Promise<any>;
|
5946
|
+
text(): Promise<string>;
|
5947
|
+
}
|
5948
|
+
interface Blob {
|
5949
|
+
readonly size: number;
|
5950
|
+
readonly type: string;
|
5951
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
5952
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
5953
|
+
text(): Promise<string>;
|
5954
|
+
}
|
5955
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
5956
|
+
interface File extends Blob {
|
5957
|
+
readonly lastModified: number;
|
5958
|
+
readonly name: string;
|
5959
|
+
readonly webkitRelativePath: string;
|
5960
|
+
}
|
5961
|
+
declare type FormDataEntryValue = File | string;
|
5962
|
+
/** 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". */
|
5963
|
+
interface FormData {
|
5964
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
5965
|
+
delete(name: string): void;
|
5966
|
+
get(name: string): FormDataEntryValue | null;
|
5967
|
+
getAll(name: string): FormDataEntryValue[];
|
5968
|
+
has(name: string): boolean;
|
5969
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
5970
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
5971
|
+
}
|
5972
|
+
/** 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. */
|
5973
|
+
interface Headers {
|
5974
|
+
append(name: string, value: string): void;
|
5975
|
+
delete(name: string): void;
|
5976
|
+
get(name: string): string | null;
|
5977
|
+
has(name: string): boolean;
|
5978
|
+
set(name: string, value: string): void;
|
5979
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
5980
|
+
}
|
5981
|
+
interface Request extends Body {
|
5982
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
5983
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
5984
|
+
/** 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. */
|
5985
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
5986
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
5987
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
5988
|
+
/** 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. */
|
5989
|
+
readonly headers: Headers;
|
5990
|
+
/** 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] */
|
5991
|
+
readonly integrity: string;
|
5992
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
5993
|
+
readonly keepalive: boolean;
|
5994
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
5995
|
+
readonly method: string;
|
5996
|
+
/** 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. */
|
5997
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
5998
|
+
/** 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. */
|
5999
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
6000
|
+
/** 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. */
|
6001
|
+
readonly referrer: string;
|
6002
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
6003
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
6004
|
+
/** Returns the URL of request as a string. */
|
6005
|
+
readonly url: string;
|
6006
|
+
clone(): Request;
|
6007
|
+
}
|
6008
|
+
|
6009
|
+
declare type XataWorkerContext<XataClient> = {
|
6010
|
+
xata: XataClient;
|
6011
|
+
request: Request;
|
6012
|
+
env: Record<string, string | undefined>;
|
6013
|
+
};
|
6014
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
6015
|
+
declare type WorkerRunnerConfig = {
|
6016
|
+
workspace: string;
|
6017
|
+
worker: string;
|
6018
|
+
};
|
6019
|
+
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>>>;
|
6020
|
+
|
3791
6021
|
declare class XataError extends Error {
|
3792
6022
|
readonly status: number;
|
3793
6023
|
constructor(message: string, status: number);
|
3794
6024
|
}
|
3795
6025
|
|
3796
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
6026
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditResponse, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CPcreateDatabaseError, CPcreateDatabasePathParams, CPcreateDatabaseRequestBody, CPcreateDatabaseResponse, CPcreateDatabaseVariables, CPdeleteDatabaseError, CPdeleteDatabasePathParams, CPdeleteDatabaseVariables, CPgetCPDatabaseMetadataError, CPgetCPDatabaseMetadataPathParams, CPgetCPDatabaseMetadataVariables, CPgetDatabaseListError, CPgetDatabaseListPathParams, CPgetDatabaseListVariables, CPupdateCPDatabaseMetadataError, CPupdateCPDatabaseMetadataPathParams, CPupdateCPDatabaseMetadataRequestBody, CPupdateCPDatabaseMetadataVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, 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, applyBranchSchemaEdit, buildClient, buildWorkerRunner, bulkInsertTableRecords, cPcreateDatabase, cPdeleteDatabase, cPgetCPDatabaseMetadata, cPgetDatabaseList, cPupdateCPDatabaseMetadata, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, lt, lte, mergeMigrationRequest, notExists, operationsByTag, 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 };
|