@xata.io/client 0.0.0-alpha.vf170c2c → 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/.eslintrc.cjs +1 -2
- package/CHANGELOG.md +271 -0
- package/README.md +273 -1
- package/Usage.md +451 -0
- package/dist/index.cjs +1485 -460
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3152 -375
- package/dist/index.mjs +1426 -461
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -5
- package/tsconfig.json +1 -0
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,25 +10,56 @@ 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>;
|
15
|
+
headers?: {
|
16
|
+
get(name: string): string | null;
|
17
|
+
};
|
9
18
|
}>;
|
10
|
-
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string
|
19
|
+
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
|
11
20
|
declare type FetcherExtraProps = {
|
12
21
|
apiUrl: string;
|
13
22
|
workspacesApiUrl: string | WorkspaceApiUrlBuilder;
|
14
23
|
fetchImpl: FetchImpl;
|
15
24
|
apiKey: string;
|
25
|
+
trace: TraceFunction;
|
16
26
|
};
|
17
27
|
declare type ErrorWrapper<TError> = TError | {
|
18
28
|
status: 'unknown';
|
19
29
|
payload: string;
|
20
30
|
};
|
21
31
|
|
32
|
+
interface CacheImpl {
|
33
|
+
defaultQueryTTL: number;
|
34
|
+
getAll(): Promise<Record<string, unknown>>;
|
35
|
+
get: <T>(key: string) => Promise<T | null>;
|
36
|
+
set: <T>(key: string, value: T) => Promise<void>;
|
37
|
+
delete: (key: string) => Promise<void>;
|
38
|
+
clear: () => Promise<void>;
|
39
|
+
}
|
40
|
+
interface SimpleCacheOptions {
|
41
|
+
max?: number;
|
42
|
+
defaultQueryTTL?: number;
|
43
|
+
}
|
44
|
+
declare class SimpleCache implements CacheImpl {
|
45
|
+
#private;
|
46
|
+
capacity: number;
|
47
|
+
defaultQueryTTL: number;
|
48
|
+
constructor(options?: SimpleCacheOptions);
|
49
|
+
getAll(): Promise<Record<string, unknown>>;
|
50
|
+
get<T>(key: string): Promise<T | null>;
|
51
|
+
set<T>(key: string, value: T): Promise<void>;
|
52
|
+
delete(key: string): Promise<void>;
|
53
|
+
clear(): Promise<void>;
|
54
|
+
}
|
55
|
+
|
22
56
|
declare abstract class XataPlugin {
|
23
57
|
abstract build(options: XataPluginOptions): unknown | Promise<unknown>;
|
24
58
|
}
|
25
59
|
declare type XataPluginOptions = {
|
26
60
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
61
|
+
cache: CacheImpl;
|
62
|
+
trace?: TraceFunction;
|
27
63
|
};
|
28
64
|
|
29
65
|
/**
|
@@ -32,6 +68,9 @@ declare type XataPluginOptions = {
|
|
32
68
|
* @version 1.0
|
33
69
|
*/
|
34
70
|
declare type User = {
|
71
|
+
/**
|
72
|
+
* @format email
|
73
|
+
*/
|
35
74
|
email: string;
|
36
75
|
fullname: string;
|
37
76
|
image: string;
|
@@ -63,7 +102,7 @@ declare type WorkspaceID = string;
|
|
63
102
|
declare type Role = 'owner' | 'maintainer';
|
64
103
|
declare type WorkspaceMeta = {
|
65
104
|
name: string;
|
66
|
-
slug
|
105
|
+
slug?: string;
|
67
106
|
};
|
68
107
|
declare type Workspace = WorkspaceMeta & {
|
69
108
|
id: WorkspaceID;
|
@@ -73,6 +112,9 @@ declare type Workspace = WorkspaceMeta & {
|
|
73
112
|
declare type WorkspaceMember = {
|
74
113
|
userId: UserID;
|
75
114
|
fullname: string;
|
115
|
+
/**
|
116
|
+
* @format email
|
117
|
+
*/
|
76
118
|
email: string;
|
77
119
|
role: Role;
|
78
120
|
};
|
@@ -82,7 +124,13 @@ declare type WorkspaceMember = {
|
|
82
124
|
declare type InviteID = string;
|
83
125
|
declare type WorkspaceInvite = {
|
84
126
|
inviteId: InviteID;
|
127
|
+
/**
|
128
|
+
* @format email
|
129
|
+
*/
|
85
130
|
email: string;
|
131
|
+
/**
|
132
|
+
* @format date-time
|
133
|
+
*/
|
86
134
|
expires: string;
|
87
135
|
role: Role;
|
88
136
|
};
|
@@ -94,22 +142,48 @@ declare type WorkspaceMembers = {
|
|
94
142
|
* @pattern ^ik_[a-zA-Z0-9]+
|
95
143
|
*/
|
96
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
|
+
};
|
97
171
|
declare type ListDatabasesResponse = {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
numberOfBranches: number;
|
103
|
-
ui?: {
|
104
|
-
color?: string;
|
105
|
-
};
|
106
|
-
}[];
|
172
|
+
/**
|
173
|
+
* A list of databases in a Xata workspace
|
174
|
+
*/
|
175
|
+
databases?: DatabaseMetadata[];
|
107
176
|
};
|
108
177
|
declare type ListBranchesResponse = {
|
109
178
|
databaseName: string;
|
110
|
-
displayName: string;
|
111
179
|
branches: Branch[];
|
112
180
|
};
|
181
|
+
declare type ListGitBranchesResponse = {
|
182
|
+
mapping: {
|
183
|
+
gitBranch: string;
|
184
|
+
xataBranch: string;
|
185
|
+
}[];
|
186
|
+
};
|
113
187
|
declare type Branch = {
|
114
188
|
name: string;
|
115
189
|
createdAt: DateTime;
|
@@ -119,8 +193,14 @@ declare type Branch = {
|
|
119
193
|
* @x-go-type xata.BranchMetadata
|
120
194
|
*/
|
121
195
|
declare type BranchMetadata = {
|
196
|
+
/**
|
197
|
+
* @minLength 1
|
198
|
+
*/
|
122
199
|
repository?: string;
|
123
200
|
branch?: BranchName;
|
201
|
+
/**
|
202
|
+
* @minLength 1
|
203
|
+
*/
|
124
204
|
stage?: string;
|
125
205
|
labels?: string[];
|
126
206
|
};
|
@@ -147,21 +227,39 @@ declare type Schema = {
|
|
147
227
|
tables: Table[];
|
148
228
|
tablesOrder?: string[];
|
149
229
|
};
|
230
|
+
/**
|
231
|
+
* @x-internal true
|
232
|
+
*/
|
233
|
+
declare type SchemaEditScript = {
|
234
|
+
sourceMigrationID?: string;
|
235
|
+
targetMigrationID?: string;
|
236
|
+
tables: TableEdit[];
|
237
|
+
};
|
150
238
|
declare type Table = {
|
151
239
|
id?: string;
|
152
240
|
name: TableName;
|
153
241
|
columns: Column[];
|
154
242
|
revLinks?: RevLink[];
|
155
243
|
};
|
244
|
+
/**
|
245
|
+
* @x-internal true
|
246
|
+
*/
|
247
|
+
declare type TableEdit = {
|
248
|
+
oldName?: string;
|
249
|
+
newName?: string;
|
250
|
+
columns?: MigrationColumnOp[];
|
251
|
+
};
|
156
252
|
/**
|
157
253
|
* @x-go-type xata.Column
|
158
254
|
*/
|
159
255
|
declare type Column = {
|
160
256
|
name: string;
|
161
|
-
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
|
257
|
+
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
|
162
258
|
link?: {
|
163
259
|
table: string;
|
164
260
|
};
|
261
|
+
notNull?: boolean;
|
262
|
+
unique?: boolean;
|
165
263
|
columns?: Column[];
|
166
264
|
};
|
167
265
|
declare type RevLink = {
|
@@ -228,12 +326,175 @@ declare type ColumnMigration = {
|
|
228
326
|
old: Column;
|
229
327
|
['new']: Column;
|
230
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
|
+
};
|
231
460
|
declare type SortExpression = string[] | {
|
232
461
|
[key: string]: SortOrder;
|
233
462
|
} | {
|
234
463
|
[key: string]: SortOrder;
|
235
464
|
}[];
|
236
465
|
declare type SortOrder = 'asc' | 'desc';
|
466
|
+
/**
|
467
|
+
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
468
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
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
|
470
|
+
* to allow two typos in a word.
|
471
|
+
*
|
472
|
+
* @default 1
|
473
|
+
* @maximum 2
|
474
|
+
* @minimum 0
|
475
|
+
*/
|
476
|
+
declare type FuzzinessExpression = number;
|
477
|
+
/**
|
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.
|
479
|
+
*/
|
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
|
+
})[];
|
237
498
|
/**
|
238
499
|
* @minProperties 1
|
239
500
|
*/
|
@@ -247,6 +508,122 @@ declare type FilterExpression = {
|
|
247
508
|
} & {
|
248
509
|
[key: string]: FilterColumn;
|
249
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>;
|
549
|
+
declare type HighlightExpression = {
|
550
|
+
/**
|
551
|
+
* Set to `false` to disable highlighting. By default it is `true`.
|
552
|
+
*/
|
553
|
+
enabled?: boolean;
|
554
|
+
/**
|
555
|
+
* Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
|
556
|
+
*/
|
557
|
+
encodeHTML?: boolean;
|
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
|
+
};
|
250
627
|
declare type FilterList = FilterExpression | FilterExpression[];
|
251
628
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
252
629
|
/**
|
@@ -296,14 +673,73 @@ declare type FilterValue = number | string | boolean;
|
|
296
673
|
* Pagination settings.
|
297
674
|
*/
|
298
675
|
declare type PageConfig = {
|
676
|
+
/**
|
677
|
+
* Query the next page that follow the cursor.
|
678
|
+
*/
|
299
679
|
after?: string;
|
680
|
+
/**
|
681
|
+
* Query the previous page before the cursor.
|
682
|
+
*/
|
300
683
|
before?: string;
|
684
|
+
/**
|
685
|
+
* Query the first page from the cursor.
|
686
|
+
*/
|
301
687
|
first?: string;
|
688
|
+
/**
|
689
|
+
* Query the last page from the cursor.
|
690
|
+
*/
|
302
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
|
+
*/
|
303
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
|
+
*/
|
304
703
|
offset?: number;
|
305
704
|
};
|
306
|
-
|
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
|
+
};
|
307
743
|
/**
|
308
744
|
* @pattern [a-zA-Z0-9_-~:]+
|
309
745
|
*/
|
@@ -312,7 +748,13 @@ declare type RecordID = string;
|
|
312
748
|
* @example {"newName":"newName","oldName":"oldName"}
|
313
749
|
*/
|
314
750
|
declare type TableRename = {
|
751
|
+
/**
|
752
|
+
* @minLength 1
|
753
|
+
*/
|
315
754
|
newName: string;
|
755
|
+
/**
|
756
|
+
* @minLength 1
|
757
|
+
*/
|
316
758
|
oldName: string;
|
317
759
|
};
|
318
760
|
/**
|
@@ -320,21 +762,52 @@ declare type TableRename = {
|
|
320
762
|
*/
|
321
763
|
declare type RecordsMetadata = {
|
322
764
|
page: {
|
765
|
+
/**
|
766
|
+
* last record id
|
767
|
+
*/
|
323
768
|
cursor: string;
|
769
|
+
/**
|
770
|
+
* true if more records can be fetch
|
771
|
+
*/
|
324
772
|
more: boolean;
|
325
773
|
};
|
326
774
|
};
|
327
775
|
/**
|
328
|
-
*
|
776
|
+
* Metadata of databases
|
329
777
|
*/
|
330
|
-
declare type
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
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;
|
336
799
|
};
|
337
|
-
}
|
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 & {
|
338
811
|
[key: string]: any;
|
339
812
|
};
|
340
813
|
|
@@ -352,14 +825,18 @@ type schemas_InviteID = InviteID;
|
|
352
825
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
353
826
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
354
827
|
type schemas_InviteKey = InviteKey;
|
828
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
355
829
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
356
830
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
831
|
+
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
357
832
|
type schemas_Branch = Branch;
|
358
833
|
type schemas_BranchMetadata = BranchMetadata;
|
359
834
|
type schemas_DBBranch = DBBranch;
|
360
835
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
361
836
|
type schemas_Schema = Schema;
|
837
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
362
838
|
type schemas_Table = Table;
|
839
|
+
type schemas_TableEdit = TableEdit;
|
363
840
|
type schemas_Column = Column;
|
364
841
|
type schemas_RevLink = RevLink;
|
365
842
|
type schemas_BranchName = BranchName;
|
@@ -372,9 +849,28 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
372
849
|
type schemas_BranchMigration = BranchMigration;
|
373
850
|
type schemas_TableMigration = TableMigration;
|
374
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;
|
375
864
|
type schemas_SortExpression = SortExpression;
|
376
865
|
type schemas_SortOrder = SortOrder;
|
866
|
+
type schemas_FuzzinessExpression = FuzzinessExpression;
|
867
|
+
type schemas_PrefixExpression = PrefixExpression;
|
868
|
+
type schemas_TargetExpression = TargetExpression;
|
377
869
|
type schemas_FilterExpression = FilterExpression;
|
870
|
+
type schemas_SummaryExpressionList = SummaryExpressionList;
|
871
|
+
type schemas_SummaryExpression = SummaryExpression;
|
872
|
+
type schemas_HighlightExpression = HighlightExpression;
|
873
|
+
type schemas_BoosterExpression = BoosterExpression;
|
378
874
|
type schemas_FilterList = FilterList;
|
379
875
|
type schemas_FilterColumn = FilterColumn;
|
380
876
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -384,10 +880,13 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
384
880
|
type schemas_FilterRangeValue = FilterRangeValue;
|
385
881
|
type schemas_FilterValue = FilterValue;
|
386
882
|
type schemas_PageConfig = PageConfig;
|
387
|
-
type
|
883
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
884
|
+
type schemas_RecordMeta = RecordMeta;
|
388
885
|
type schemas_RecordID = RecordID;
|
389
886
|
type schemas_TableRename = TableRename;
|
390
887
|
type schemas_RecordsMetadata = RecordsMetadata;
|
888
|
+
type schemas_CPDatabaseMetadata = CPDatabaseMetadata;
|
889
|
+
type schemas_CPListDatabasesResponse = CPListDatabasesResponse;
|
391
890
|
declare namespace schemas {
|
392
891
|
export {
|
393
892
|
schemas_User as User,
|
@@ -404,14 +903,18 @@ declare namespace schemas {
|
|
404
903
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
405
904
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
406
905
|
schemas_InviteKey as InviteKey,
|
906
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
407
907
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
408
908
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
909
|
+
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
409
910
|
schemas_Branch as Branch,
|
410
911
|
schemas_BranchMetadata as BranchMetadata,
|
411
912
|
schemas_DBBranch as DBBranch,
|
412
913
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
413
914
|
schemas_Schema as Schema,
|
915
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
414
916
|
schemas_Table as Table,
|
917
|
+
schemas_TableEdit as TableEdit,
|
415
918
|
schemas_Column as Column,
|
416
919
|
schemas_RevLink as RevLink,
|
417
920
|
schemas_BranchName as BranchName,
|
@@ -424,9 +927,31 @@ declare namespace schemas {
|
|
424
927
|
schemas_BranchMigration as BranchMigration,
|
425
928
|
schemas_TableMigration as TableMigration,
|
426
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,
|
427
942
|
schemas_SortExpression as SortExpression,
|
428
943
|
schemas_SortOrder as SortOrder,
|
944
|
+
schemas_FuzzinessExpression as FuzzinessExpression,
|
945
|
+
schemas_PrefixExpression as PrefixExpression,
|
946
|
+
schemas_TargetExpression as TargetExpression,
|
429
947
|
schemas_FilterExpression as FilterExpression,
|
948
|
+
schemas_SummaryExpressionList as SummaryExpressionList,
|
949
|
+
schemas_SummaryExpression as SummaryExpression,
|
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,
|
430
955
|
schemas_FilterList as FilterList,
|
431
956
|
schemas_FilterColumn as FilterColumn,
|
432
957
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -436,10 +961,13 @@ declare namespace schemas {
|
|
436
961
|
schemas_FilterRangeValue as FilterRangeValue,
|
437
962
|
schemas_FilterValue as FilterValue,
|
438
963
|
schemas_PageConfig as PageConfig,
|
439
|
-
|
964
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
965
|
+
schemas_RecordMeta as RecordMeta,
|
440
966
|
schemas_RecordID as RecordID,
|
441
967
|
schemas_TableRename as TableRename,
|
442
968
|
schemas_RecordsMetadata as RecordsMetadata,
|
969
|
+
schemas_CPDatabaseMetadata as CPDatabaseMetadata,
|
970
|
+
schemas_CPListDatabasesResponse as CPListDatabasesResponse,
|
443
971
|
XataRecord$1 as XataRecord,
|
444
972
|
};
|
445
973
|
}
|
@@ -471,11 +999,22 @@ declare type BulkError = {
|
|
471
999
|
status?: number;
|
472
1000
|
}[];
|
473
1001
|
};
|
474
|
-
declare type
|
475
|
-
|
476
|
-
|
1002
|
+
declare type BulkInsertResponse = {
|
1003
|
+
recordIDs: string[];
|
1004
|
+
} | {
|
1005
|
+
records: XataRecord$1[];
|
1006
|
+
};
|
1007
|
+
declare type BranchMigrationPlan = {
|
1008
|
+
version: number;
|
1009
|
+
migration: BranchMigration;
|
1010
|
+
};
|
1011
|
+
declare type RecordResponse = XataRecord$1;
|
1012
|
+
declare type SchemaCompareResponse = {
|
1013
|
+
source: Schema;
|
1014
|
+
target: Schema;
|
1015
|
+
edits: SchemaEditScript;
|
477
1016
|
};
|
478
|
-
declare type RecordUpdateResponse = {
|
1017
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
479
1018
|
id: string;
|
480
1019
|
xata: {
|
481
1020
|
version: number;
|
@@ -485,13 +1024,20 @@ declare type QueryResponse = {
|
|
485
1024
|
records: XataRecord$1[];
|
486
1025
|
meta: RecordsMetadata;
|
487
1026
|
};
|
1027
|
+
declare type SummarizeResponse = {
|
1028
|
+
summaries: Record<string, any>[];
|
1029
|
+
};
|
488
1030
|
declare type SearchResponse = {
|
489
1031
|
records: XataRecord$1[];
|
1032
|
+
warning?: string;
|
490
1033
|
};
|
491
1034
|
/**
|
492
1035
|
* @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
|
493
1036
|
*/
|
494
1037
|
declare type MigrationIdResponse = {
|
1038
|
+
/**
|
1039
|
+
* @minLength 1
|
1040
|
+
*/
|
495
1041
|
migrationID: string;
|
496
1042
|
};
|
497
1043
|
|
@@ -499,9 +1045,13 @@ type responses_SimpleError = SimpleError;
|
|
499
1045
|
type responses_BadRequestError = BadRequestError;
|
500
1046
|
type responses_AuthError = AuthError;
|
501
1047
|
type responses_BulkError = BulkError;
|
1048
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
502
1049
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
1050
|
+
type responses_RecordResponse = RecordResponse;
|
1051
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
503
1052
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
504
1053
|
type responses_QueryResponse = QueryResponse;
|
1054
|
+
type responses_SummarizeResponse = SummarizeResponse;
|
505
1055
|
type responses_SearchResponse = SearchResponse;
|
506
1056
|
type responses_MigrationIdResponse = MigrationIdResponse;
|
507
1057
|
declare namespace responses {
|
@@ -510,9 +1060,13 @@ declare namespace responses {
|
|
510
1060
|
responses_BadRequestError as BadRequestError,
|
511
1061
|
responses_AuthError as AuthError,
|
512
1062
|
responses_BulkError as BulkError,
|
1063
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
513
1064
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
1065
|
+
responses_RecordResponse as RecordResponse,
|
1066
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
514
1067
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
515
1068
|
responses_QueryResponse as QueryResponse,
|
1069
|
+
responses_SummarizeResponse as SummarizeResponse,
|
516
1070
|
responses_SearchResponse as SearchResponse,
|
517
1071
|
responses_MigrationIdResponse as MigrationIdResponse,
|
518
1072
|
};
|
@@ -593,6 +1147,9 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
|
|
593
1147
|
*/
|
594
1148
|
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
|
595
1149
|
declare type CreateUserAPIKeyPathParams = {
|
1150
|
+
/**
|
1151
|
+
* API Key name
|
1152
|
+
*/
|
596
1153
|
keyName: APIKeyName;
|
597
1154
|
};
|
598
1155
|
declare type CreateUserAPIKeyError = ErrorWrapper<{
|
@@ -618,6 +1175,9 @@ declare type CreateUserAPIKeyVariables = {
|
|
618
1175
|
*/
|
619
1176
|
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
|
620
1177
|
declare type DeleteUserAPIKeyPathParams = {
|
1178
|
+
/**
|
1179
|
+
* API Key name
|
1180
|
+
*/
|
621
1181
|
keyName: APIKeyName;
|
622
1182
|
};
|
623
1183
|
declare type DeleteUserAPIKeyError = ErrorWrapper<{
|
@@ -678,6 +1238,9 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
|
|
678
1238
|
*/
|
679
1239
|
declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
|
680
1240
|
declare type GetWorkspacePathParams = {
|
1241
|
+
/**
|
1242
|
+
* Workspace name
|
1243
|
+
*/
|
681
1244
|
workspaceId: WorkspaceID;
|
682
1245
|
};
|
683
1246
|
declare type GetWorkspaceError = ErrorWrapper<{
|
@@ -698,6 +1261,9 @@ declare type GetWorkspaceVariables = {
|
|
698
1261
|
*/
|
699
1262
|
declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
|
700
1263
|
declare type UpdateWorkspacePathParams = {
|
1264
|
+
/**
|
1265
|
+
* Workspace name
|
1266
|
+
*/
|
701
1267
|
workspaceId: WorkspaceID;
|
702
1268
|
};
|
703
1269
|
declare type UpdateWorkspaceError = ErrorWrapper<{
|
@@ -719,6 +1285,9 @@ declare type UpdateWorkspaceVariables = {
|
|
719
1285
|
*/
|
720
1286
|
declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
|
721
1287
|
declare type DeleteWorkspacePathParams = {
|
1288
|
+
/**
|
1289
|
+
* Workspace name
|
1290
|
+
*/
|
722
1291
|
workspaceId: WorkspaceID;
|
723
1292
|
};
|
724
1293
|
declare type DeleteWorkspaceError = ErrorWrapper<{
|
@@ -739,6 +1308,9 @@ declare type DeleteWorkspaceVariables = {
|
|
739
1308
|
*/
|
740
1309
|
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
|
741
1310
|
declare type GetWorkspaceMembersListPathParams = {
|
1311
|
+
/**
|
1312
|
+
* Workspace name
|
1313
|
+
*/
|
742
1314
|
workspaceId: WorkspaceID;
|
743
1315
|
};
|
744
1316
|
declare type GetWorkspaceMembersListError = ErrorWrapper<{
|
@@ -759,7 +1331,13 @@ declare type GetWorkspaceMembersListVariables = {
|
|
759
1331
|
*/
|
760
1332
|
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
|
761
1333
|
declare type UpdateWorkspaceMemberRolePathParams = {
|
1334
|
+
/**
|
1335
|
+
* Workspace name
|
1336
|
+
*/
|
762
1337
|
workspaceId: WorkspaceID;
|
1338
|
+
/**
|
1339
|
+
* UserID
|
1340
|
+
*/
|
763
1341
|
userId: UserID;
|
764
1342
|
};
|
765
1343
|
declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
|
@@ -784,7 +1362,13 @@ declare type UpdateWorkspaceMemberRoleVariables = {
|
|
784
1362
|
*/
|
785
1363
|
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
786
1364
|
declare type RemoveWorkspaceMemberPathParams = {
|
1365
|
+
/**
|
1366
|
+
* Workspace name
|
1367
|
+
*/
|
787
1368
|
workspaceId: WorkspaceID;
|
1369
|
+
/**
|
1370
|
+
* UserID
|
1371
|
+
*/
|
788
1372
|
userId: UserID;
|
789
1373
|
};
|
790
1374
|
declare type RemoveWorkspaceMemberError = ErrorWrapper<{
|
@@ -805,6 +1389,9 @@ declare type RemoveWorkspaceMemberVariables = {
|
|
805
1389
|
*/
|
806
1390
|
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
807
1391
|
declare type InviteWorkspaceMemberPathParams = {
|
1392
|
+
/**
|
1393
|
+
* Workspace name
|
1394
|
+
*/
|
808
1395
|
workspaceId: WorkspaceID;
|
809
1396
|
};
|
810
1397
|
declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
@@ -816,8 +1403,14 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
816
1403
|
} | {
|
817
1404
|
status: 404;
|
818
1405
|
payload: SimpleError;
|
1406
|
+
} | {
|
1407
|
+
status: 409;
|
1408
|
+
payload: SimpleError;
|
819
1409
|
}>;
|
820
1410
|
declare type InviteWorkspaceMemberRequestBody = {
|
1411
|
+
/**
|
1412
|
+
* @format email
|
1413
|
+
*/
|
821
1414
|
email: string;
|
822
1415
|
role: Role;
|
823
1416
|
};
|
@@ -829,8 +1422,48 @@ declare type InviteWorkspaceMemberVariables = {
|
|
829
1422
|
* Invite some user to join the workspace with the given role
|
830
1423
|
*/
|
831
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>;
|
832
1459
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
1460
|
+
/**
|
1461
|
+
* Workspace name
|
1462
|
+
*/
|
833
1463
|
workspaceId: WorkspaceID;
|
1464
|
+
/**
|
1465
|
+
* Invite identifier
|
1466
|
+
*/
|
834
1467
|
inviteId: InviteID;
|
835
1468
|
};
|
836
1469
|
declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -851,7 +1484,13 @@ declare type CancelWorkspaceMemberInviteVariables = {
|
|
851
1484
|
*/
|
852
1485
|
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
853
1486
|
declare type ResendWorkspaceMemberInvitePathParams = {
|
1487
|
+
/**
|
1488
|
+
* Workspace name
|
1489
|
+
*/
|
854
1490
|
workspaceId: WorkspaceID;
|
1491
|
+
/**
|
1492
|
+
* Invite identifier
|
1493
|
+
*/
|
855
1494
|
inviteId: InviteID;
|
856
1495
|
};
|
857
1496
|
declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -872,7 +1511,13 @@ declare type ResendWorkspaceMemberInviteVariables = {
|
|
872
1511
|
*/
|
873
1512
|
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
874
1513
|
declare type AcceptWorkspaceMemberInvitePathParams = {
|
1514
|
+
/**
|
1515
|
+
* Workspace name
|
1516
|
+
*/
|
875
1517
|
workspaceId: WorkspaceID;
|
1518
|
+
/**
|
1519
|
+
* Invite Key (secret) for the invited user
|
1520
|
+
*/
|
876
1521
|
inviteKey: InviteKey;
|
877
1522
|
};
|
878
1523
|
declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -910,6 +1555,9 @@ declare type GetDatabaseListVariables = {
|
|
910
1555
|
*/
|
911
1556
|
declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
912
1557
|
declare type GetBranchListPathParams = {
|
1558
|
+
/**
|
1559
|
+
* The Database Name
|
1560
|
+
*/
|
913
1561
|
dbName: DBName;
|
914
1562
|
workspace: string;
|
915
1563
|
};
|
@@ -931,6 +1579,9 @@ declare type GetBranchListVariables = {
|
|
931
1579
|
*/
|
932
1580
|
declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
933
1581
|
declare type CreateDatabasePathParams = {
|
1582
|
+
/**
|
1583
|
+
* The Database Name
|
1584
|
+
*/
|
934
1585
|
dbName: DBName;
|
935
1586
|
workspace: string;
|
936
1587
|
};
|
@@ -942,11 +1593,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
|
|
942
1593
|
payload: AuthError;
|
943
1594
|
}>;
|
944
1595
|
declare type CreateDatabaseResponse = {
|
1596
|
+
/**
|
1597
|
+
* @minLength 1
|
1598
|
+
*/
|
945
1599
|
databaseName: string;
|
946
1600
|
branchName?: string;
|
947
1601
|
};
|
948
1602
|
declare type CreateDatabaseRequestBody = {
|
949
|
-
|
1603
|
+
/**
|
1604
|
+
* @minLength 1
|
1605
|
+
*/
|
950
1606
|
branchName?: string;
|
951
1607
|
ui?: {
|
952
1608
|
color?: string;
|
@@ -962,6 +1618,9 @@ declare type CreateDatabaseVariables = {
|
|
962
1618
|
*/
|
963
1619
|
declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
964
1620
|
declare type DeleteDatabasePathParams = {
|
1621
|
+
/**
|
1622
|
+
* The Database Name
|
1623
|
+
*/
|
965
1624
|
dbName: DBName;
|
966
1625
|
workspace: string;
|
967
1626
|
};
|
@@ -982,11 +1641,14 @@ declare type DeleteDatabaseVariables = {
|
|
982
1641
|
* Delete a database and all of its branches and tables permanently.
|
983
1642
|
*/
|
984
1643
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
985
|
-
declare type
|
986
|
-
|
1644
|
+
declare type GetDatabaseMetadataPathParams = {
|
1645
|
+
/**
|
1646
|
+
* The Database Name
|
1647
|
+
*/
|
1648
|
+
dbName: DBName;
|
987
1649
|
workspace: string;
|
988
1650
|
};
|
989
|
-
declare type
|
1651
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
990
1652
|
status: 400;
|
991
1653
|
payload: BadRequestError;
|
992
1654
|
} | {
|
@@ -996,18 +1658,21 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
996
1658
|
status: 404;
|
997
1659
|
payload: SimpleError;
|
998
1660
|
}>;
|
999
|
-
declare type
|
1000
|
-
pathParams:
|
1661
|
+
declare type GetDatabaseMetadataVariables = {
|
1662
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1001
1663
|
} & FetcherExtraProps;
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
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;
|
1005
1673
|
workspace: string;
|
1006
1674
|
};
|
1007
|
-
declare type
|
1008
|
-
from?: string;
|
1009
|
-
};
|
1010
|
-
declare type CreateBranchError = ErrorWrapper<{
|
1675
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
1011
1676
|
status: 400;
|
1012
1677
|
payload: BadRequestError;
|
1013
1678
|
} | {
|
@@ -1017,82 +1682,217 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1017
1682
|
status: 404;
|
1018
1683
|
payload: SimpleError;
|
1019
1684
|
}>;
|
1020
|
-
declare type
|
1021
|
-
|
1022
|
-
|
1685
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
1686
|
+
ui?: {
|
1687
|
+
/**
|
1688
|
+
* @minLength 1
|
1689
|
+
*/
|
1690
|
+
color?: string;
|
1691
|
+
};
|
1023
1692
|
};
|
1024
|
-
declare type
|
1025
|
-
body?:
|
1026
|
-
pathParams:
|
1027
|
-
queryParams?: CreateBranchQueryParams;
|
1693
|
+
declare type UpdateDatabaseMetadataVariables = {
|
1694
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
1695
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
1028
1696
|
} & FetcherExtraProps;
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1697
|
+
/**
|
1698
|
+
* Update the color of the selected database
|
1699
|
+
*/
|
1700
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1701
|
+
declare type GetGitBranchesMappingPathParams = {
|
1702
|
+
/**
|
1703
|
+
* The Database Name
|
1704
|
+
*/
|
1705
|
+
dbName: DBName;
|
1032
1706
|
workspace: string;
|
1033
1707
|
};
|
1034
|
-
declare type
|
1708
|
+
declare type GetGitBranchesMappingError = ErrorWrapper<{
|
1035
1709
|
status: 400;
|
1036
1710
|
payload: BadRequestError;
|
1037
1711
|
} | {
|
1038
1712
|
status: 401;
|
1039
1713
|
payload: AuthError;
|
1040
|
-
} | {
|
1041
|
-
status: 404;
|
1042
|
-
payload: SimpleError;
|
1043
1714
|
}>;
|
1044
|
-
declare type
|
1045
|
-
pathParams:
|
1715
|
+
declare type GetGitBranchesMappingVariables = {
|
1716
|
+
pathParams: GetGitBranchesMappingPathParams;
|
1046
1717
|
} & FetcherExtraProps;
|
1047
1718
|
/**
|
1048
|
-
*
|
1719
|
+
* Lists all the git branches in the mapping, and their associated Xata branches.
|
1720
|
+
*
|
1721
|
+
* Example response:
|
1722
|
+
*
|
1723
|
+
* ```json
|
1724
|
+
* {
|
1725
|
+
* "mappings": [
|
1726
|
+
* {
|
1727
|
+
* "gitBranch": "main",
|
1728
|
+
* "xataBranch": "main"
|
1729
|
+
* },
|
1730
|
+
* {
|
1731
|
+
* "gitBranch": "gitBranch1",
|
1732
|
+
* "xataBranch": "xataBranch1"
|
1733
|
+
* }
|
1734
|
+
* {
|
1735
|
+
* "gitBranch": "xataBranch2",
|
1736
|
+
* "xataBranch": "xataBranch2"
|
1737
|
+
* }
|
1738
|
+
* ]
|
1739
|
+
* }
|
1740
|
+
* ```
|
1049
1741
|
*/
|
1050
|
-
declare const
|
1051
|
-
declare type
|
1052
|
-
|
1742
|
+
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
1743
|
+
declare type AddGitBranchesEntryPathParams = {
|
1744
|
+
/**
|
1745
|
+
* The Database Name
|
1746
|
+
*/
|
1747
|
+
dbName: DBName;
|
1053
1748
|
workspace: string;
|
1054
1749
|
};
|
1055
|
-
declare type
|
1750
|
+
declare type AddGitBranchesEntryError = ErrorWrapper<{
|
1056
1751
|
status: 400;
|
1057
1752
|
payload: BadRequestError;
|
1058
1753
|
} | {
|
1059
1754
|
status: 401;
|
1060
1755
|
payload: AuthError;
|
1061
|
-
} | {
|
1062
|
-
status: 404;
|
1063
|
-
payload: SimpleError;
|
1064
1756
|
}>;
|
1065
|
-
declare type
|
1066
|
-
|
1067
|
-
|
1757
|
+
declare type AddGitBranchesEntryResponse = {
|
1758
|
+
/**
|
1759
|
+
* Warning message
|
1760
|
+
*/
|
1761
|
+
warning?: string;
|
1762
|
+
};
|
1763
|
+
declare type AddGitBranchesEntryRequestBody = {
|
1764
|
+
/**
|
1765
|
+
* The name of the Git branch.
|
1766
|
+
*/
|
1767
|
+
gitBranch: string;
|
1768
|
+
/**
|
1769
|
+
* The name of the Xata branch.
|
1770
|
+
*/
|
1771
|
+
xataBranch: BranchName;
|
1772
|
+
};
|
1773
|
+
declare type AddGitBranchesEntryVariables = {
|
1774
|
+
body: AddGitBranchesEntryRequestBody;
|
1775
|
+
pathParams: AddGitBranchesEntryPathParams;
|
1068
1776
|
} & FetcherExtraProps;
|
1069
1777
|
/**
|
1070
|
-
*
|
1778
|
+
* Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.
|
1779
|
+
*
|
1780
|
+
* If the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.
|
1781
|
+
*
|
1782
|
+
* Example request:
|
1783
|
+
*
|
1784
|
+
* ```json
|
1785
|
+
* // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
|
1786
|
+
* {
|
1787
|
+
* "gitBranch": "fix/bug123",
|
1788
|
+
* "xataBranch": "fix_bug"
|
1789
|
+
* }
|
1790
|
+
* ```
|
1071
1791
|
*/
|
1072
|
-
declare const
|
1073
|
-
declare type
|
1074
|
-
|
1792
|
+
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
1793
|
+
declare type RemoveGitBranchesEntryPathParams = {
|
1794
|
+
/**
|
1795
|
+
* The Database Name
|
1796
|
+
*/
|
1797
|
+
dbName: DBName;
|
1075
1798
|
workspace: string;
|
1076
1799
|
};
|
1077
|
-
declare type
|
1800
|
+
declare type RemoveGitBranchesEntryQueryParams = {
|
1801
|
+
/**
|
1802
|
+
* The Git Branch to remove from the mapping
|
1803
|
+
*/
|
1804
|
+
gitBranch: string;
|
1805
|
+
};
|
1806
|
+
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
1078
1807
|
status: 400;
|
1079
1808
|
payload: BadRequestError;
|
1080
1809
|
} | {
|
1081
1810
|
status: 401;
|
1082
1811
|
payload: AuthError;
|
1812
|
+
}>;
|
1813
|
+
declare type RemoveGitBranchesEntryVariables = {
|
1814
|
+
pathParams: RemoveGitBranchesEntryPathParams;
|
1815
|
+
queryParams: RemoveGitBranchesEntryQueryParams;
|
1816
|
+
} & FetcherExtraProps;
|
1817
|
+
/**
|
1818
|
+
* Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
|
1819
|
+
*
|
1820
|
+
* Example request:
|
1821
|
+
*
|
1822
|
+
* ```json
|
1823
|
+
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
1824
|
+
* ```
|
1825
|
+
*/
|
1826
|
+
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
1827
|
+
declare type ResolveBranchPathParams = {
|
1828
|
+
/**
|
1829
|
+
* The Database Name
|
1830
|
+
*/
|
1831
|
+
dbName: DBName;
|
1832
|
+
workspace: string;
|
1833
|
+
};
|
1834
|
+
declare type ResolveBranchQueryParams = {
|
1835
|
+
/**
|
1836
|
+
* The Git Branch
|
1837
|
+
*/
|
1838
|
+
gitBranch?: string;
|
1839
|
+
/**
|
1840
|
+
* Default branch to fallback to
|
1841
|
+
*/
|
1842
|
+
fallbackBranch?: string;
|
1843
|
+
};
|
1844
|
+
declare type ResolveBranchError = ErrorWrapper<{
|
1845
|
+
status: 400;
|
1846
|
+
payload: BadRequestError;
|
1083
1847
|
} | {
|
1084
|
-
status:
|
1085
|
-
payload:
|
1848
|
+
status: 401;
|
1849
|
+
payload: AuthError;
|
1086
1850
|
}>;
|
1087
|
-
declare type
|
1088
|
-
|
1851
|
+
declare type ResolveBranchResponse = {
|
1852
|
+
branch: string;
|
1853
|
+
reason: {
|
1854
|
+
code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
|
1855
|
+
message: string;
|
1856
|
+
};
|
1857
|
+
};
|
1858
|
+
declare type ResolveBranchVariables = {
|
1859
|
+
pathParams: ResolveBranchPathParams;
|
1860
|
+
queryParams?: ResolveBranchQueryParams;
|
1089
1861
|
} & FetcherExtraProps;
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1862
|
+
/**
|
1863
|
+
* In order to resolve the database branch, the following algorithm is used:
|
1864
|
+
* * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
|
1865
|
+
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
1866
|
+
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
1867
|
+
* * else, return the default branch of the DB (`main` or the first branch)
|
1868
|
+
*
|
1869
|
+
* Example call:
|
1870
|
+
*
|
1871
|
+
* ```json
|
1872
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
1873
|
+
* ```
|
1874
|
+
*
|
1875
|
+
* Example response:
|
1876
|
+
*
|
1877
|
+
* ```json
|
1878
|
+
* {
|
1879
|
+
* "branch": "main",
|
1880
|
+
* "reason": {
|
1881
|
+
* "code": "DEFAULT_BRANCH",
|
1882
|
+
* "message": "Default branch for this database (main)"
|
1883
|
+
* }
|
1884
|
+
* }
|
1885
|
+
* ```
|
1886
|
+
*/
|
1887
|
+
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1888
|
+
declare type QueryMigrationRequestsPathParams = {
|
1889
|
+
/**
|
1890
|
+
* The Database Name
|
1891
|
+
*/
|
1892
|
+
dbName: DBName;
|
1093
1893
|
workspace: string;
|
1094
1894
|
};
|
1095
|
-
declare type
|
1895
|
+
declare type QueryMigrationRequestsError = ErrorWrapper<{
|
1096
1896
|
status: 400;
|
1097
1897
|
payload: BadRequestError;
|
1098
1898
|
} | {
|
@@ -1102,24 +1902,29 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
1102
1902
|
status: 404;
|
1103
1903
|
payload: SimpleError;
|
1104
1904
|
}>;
|
1105
|
-
declare type
|
1106
|
-
|
1107
|
-
|
1905
|
+
declare type QueryMigrationRequestsResponse = {
|
1906
|
+
migrationRequests: MigrationRequest[];
|
1907
|
+
meta: RecordsMetadata;
|
1108
1908
|
};
|
1109
|
-
declare type
|
1110
|
-
|
1111
|
-
|
1909
|
+
declare type QueryMigrationRequestsRequestBody = {
|
1910
|
+
filter?: FilterExpression;
|
1911
|
+
sort?: SortExpression;
|
1912
|
+
page?: PageConfig;
|
1913
|
+
columns?: ColumnsProjection;
|
1112
1914
|
};
|
1113
|
-
declare type
|
1114
|
-
body?:
|
1115
|
-
pathParams:
|
1915
|
+
declare type QueryMigrationRequestsVariables = {
|
1916
|
+
body?: QueryMigrationRequestsRequestBody;
|
1917
|
+
pathParams: QueryMigrationRequestsPathParams;
|
1116
1918
|
} & FetcherExtraProps;
|
1117
|
-
declare const
|
1118
|
-
declare type
|
1119
|
-
|
1919
|
+
declare const queryMigrationRequests: (variables: QueryMigrationRequestsVariables) => Promise<QueryMigrationRequestsResponse>;
|
1920
|
+
declare type CreateMigrationRequestPathParams = {
|
1921
|
+
/**
|
1922
|
+
* The Database Name
|
1923
|
+
*/
|
1924
|
+
dbName: DBName;
|
1120
1925
|
workspace: string;
|
1121
1926
|
};
|
1122
|
-
declare type
|
1927
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
1123
1928
|
status: 400;
|
1124
1929
|
payload: BadRequestError;
|
1125
1930
|
} | {
|
@@ -1129,11 +1934,418 @@ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
|
1129
1934
|
status: 404;
|
1130
1935
|
payload: SimpleError;
|
1131
1936
|
}>;
|
1132
|
-
declare type
|
1133
|
-
|
1134
|
-
migration: BranchMigration;
|
1937
|
+
declare type CreateMigrationRequestResponse = {
|
1938
|
+
number: number;
|
1135
1939
|
};
|
1136
|
-
declare type
|
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>;
|
2163
|
+
declare type GetBranchDetailsPathParams = {
|
2164
|
+
/**
|
2165
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2166
|
+
*/
|
2167
|
+
dbBranchName: DBBranchName;
|
2168
|
+
workspace: string;
|
2169
|
+
};
|
2170
|
+
declare type GetBranchDetailsError = ErrorWrapper<{
|
2171
|
+
status: 400;
|
2172
|
+
payload: BadRequestError;
|
2173
|
+
} | {
|
2174
|
+
status: 401;
|
2175
|
+
payload: AuthError;
|
2176
|
+
} | {
|
2177
|
+
status: 404;
|
2178
|
+
payload: SimpleError;
|
2179
|
+
}>;
|
2180
|
+
declare type GetBranchDetailsVariables = {
|
2181
|
+
pathParams: GetBranchDetailsPathParams;
|
2182
|
+
} & FetcherExtraProps;
|
2183
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2184
|
+
declare type CreateBranchPathParams = {
|
2185
|
+
/**
|
2186
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2187
|
+
*/
|
2188
|
+
dbBranchName: DBBranchName;
|
2189
|
+
workspace: string;
|
2190
|
+
};
|
2191
|
+
declare type CreateBranchQueryParams = {
|
2192
|
+
/**
|
2193
|
+
* Name of source branch to branch the new schema from
|
2194
|
+
*/
|
2195
|
+
from?: string;
|
2196
|
+
};
|
2197
|
+
declare type CreateBranchError = ErrorWrapper<{
|
2198
|
+
status: 400;
|
2199
|
+
payload: BadRequestError;
|
2200
|
+
} | {
|
2201
|
+
status: 401;
|
2202
|
+
payload: AuthError;
|
2203
|
+
} | {
|
2204
|
+
status: 404;
|
2205
|
+
payload: SimpleError;
|
2206
|
+
}>;
|
2207
|
+
declare type CreateBranchResponse = {
|
2208
|
+
/**
|
2209
|
+
* @minLength 1
|
2210
|
+
*/
|
2211
|
+
databaseName: string;
|
2212
|
+
branchName: string;
|
2213
|
+
};
|
2214
|
+
declare type CreateBranchRequestBody = {
|
2215
|
+
/**
|
2216
|
+
* Select the branch to fork from. Defaults to 'main'
|
2217
|
+
*/
|
2218
|
+
from?: string;
|
2219
|
+
metadata?: BranchMetadata;
|
2220
|
+
};
|
2221
|
+
declare type CreateBranchVariables = {
|
2222
|
+
body?: CreateBranchRequestBody;
|
2223
|
+
pathParams: CreateBranchPathParams;
|
2224
|
+
queryParams?: CreateBranchQueryParams;
|
2225
|
+
} & FetcherExtraProps;
|
2226
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2227
|
+
declare type DeleteBranchPathParams = {
|
2228
|
+
/**
|
2229
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2230
|
+
*/
|
2231
|
+
dbBranchName: DBBranchName;
|
2232
|
+
workspace: string;
|
2233
|
+
};
|
2234
|
+
declare type DeleteBranchError = ErrorWrapper<{
|
2235
|
+
status: 400;
|
2236
|
+
payload: BadRequestError;
|
2237
|
+
} | {
|
2238
|
+
status: 401;
|
2239
|
+
payload: AuthError;
|
2240
|
+
} | {
|
2241
|
+
status: 404;
|
2242
|
+
payload: SimpleError;
|
2243
|
+
}>;
|
2244
|
+
declare type DeleteBranchVariables = {
|
2245
|
+
pathParams: DeleteBranchPathParams;
|
2246
|
+
} & FetcherExtraProps;
|
2247
|
+
/**
|
2248
|
+
* Delete the branch in the database and all its resources
|
2249
|
+
*/
|
2250
|
+
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2251
|
+
declare type UpdateBranchMetadataPathParams = {
|
2252
|
+
/**
|
2253
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2254
|
+
*/
|
2255
|
+
dbBranchName: DBBranchName;
|
2256
|
+
workspace: string;
|
2257
|
+
};
|
2258
|
+
declare type UpdateBranchMetadataError = ErrorWrapper<{
|
2259
|
+
status: 400;
|
2260
|
+
payload: BadRequestError;
|
2261
|
+
} | {
|
2262
|
+
status: 401;
|
2263
|
+
payload: AuthError;
|
2264
|
+
} | {
|
2265
|
+
status: 404;
|
2266
|
+
payload: SimpleError;
|
2267
|
+
}>;
|
2268
|
+
declare type UpdateBranchMetadataVariables = {
|
2269
|
+
body?: BranchMetadata;
|
2270
|
+
pathParams: UpdateBranchMetadataPathParams;
|
2271
|
+
} & FetcherExtraProps;
|
2272
|
+
/**
|
2273
|
+
* Update the branch metadata
|
2274
|
+
*/
|
2275
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2276
|
+
declare type GetBranchMetadataPathParams = {
|
2277
|
+
/**
|
2278
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2279
|
+
*/
|
2280
|
+
dbBranchName: DBBranchName;
|
2281
|
+
workspace: string;
|
2282
|
+
};
|
2283
|
+
declare type GetBranchMetadataError = ErrorWrapper<{
|
2284
|
+
status: 400;
|
2285
|
+
payload: BadRequestError;
|
2286
|
+
} | {
|
2287
|
+
status: 401;
|
2288
|
+
payload: AuthError;
|
2289
|
+
} | {
|
2290
|
+
status: 404;
|
2291
|
+
payload: SimpleError;
|
2292
|
+
}>;
|
2293
|
+
declare type GetBranchMetadataVariables = {
|
2294
|
+
pathParams: GetBranchMetadataPathParams;
|
2295
|
+
} & FetcherExtraProps;
|
2296
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
2297
|
+
declare type GetBranchMigrationHistoryPathParams = {
|
2298
|
+
/**
|
2299
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2300
|
+
*/
|
2301
|
+
dbBranchName: DBBranchName;
|
2302
|
+
workspace: string;
|
2303
|
+
};
|
2304
|
+
declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
2305
|
+
status: 400;
|
2306
|
+
payload: BadRequestError;
|
2307
|
+
} | {
|
2308
|
+
status: 401;
|
2309
|
+
payload: AuthError;
|
2310
|
+
} | {
|
2311
|
+
status: 404;
|
2312
|
+
payload: SimpleError;
|
2313
|
+
}>;
|
2314
|
+
declare type GetBranchMigrationHistoryResponse = {
|
2315
|
+
startedFrom?: StartedFromMetadata;
|
2316
|
+
migrations?: BranchMigration[];
|
2317
|
+
};
|
2318
|
+
declare type GetBranchMigrationHistoryRequestBody = {
|
2319
|
+
limit?: number;
|
2320
|
+
startFrom?: string;
|
2321
|
+
};
|
2322
|
+
declare type GetBranchMigrationHistoryVariables = {
|
2323
|
+
body?: GetBranchMigrationHistoryRequestBody;
|
2324
|
+
pathParams: GetBranchMigrationHistoryPathParams;
|
2325
|
+
} & FetcherExtraProps;
|
2326
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2327
|
+
declare type ExecuteBranchMigrationPlanPathParams = {
|
2328
|
+
/**
|
2329
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2330
|
+
*/
|
2331
|
+
dbBranchName: DBBranchName;
|
2332
|
+
workspace: string;
|
2333
|
+
};
|
2334
|
+
declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
2335
|
+
status: 400;
|
2336
|
+
payload: BadRequestError;
|
2337
|
+
} | {
|
2338
|
+
status: 401;
|
2339
|
+
payload: AuthError;
|
2340
|
+
} | {
|
2341
|
+
status: 404;
|
2342
|
+
payload: SimpleError;
|
2343
|
+
}>;
|
2344
|
+
declare type ExecuteBranchMigrationPlanRequestBody = {
|
2345
|
+
version: number;
|
2346
|
+
migration: BranchMigration;
|
2347
|
+
};
|
2348
|
+
declare type ExecuteBranchMigrationPlanVariables = {
|
1137
2349
|
body: ExecuteBranchMigrationPlanRequestBody;
|
1138
2350
|
pathParams: ExecuteBranchMigrationPlanPathParams;
|
1139
2351
|
} & FetcherExtraProps;
|
@@ -1142,6 +2354,9 @@ declare type ExecuteBranchMigrationPlanVariables = {
|
|
1142
2354
|
*/
|
1143
2355
|
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
1144
2356
|
declare type GetBranchMigrationPlanPathParams = {
|
2357
|
+
/**
|
2358
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2359
|
+
*/
|
1145
2360
|
dbBranchName: DBBranchName;
|
1146
2361
|
workspace: string;
|
1147
2362
|
};
|
@@ -1163,7 +2378,199 @@ declare type GetBranchMigrationPlanVariables = {
|
|
1163
2378
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
1164
2379
|
*/
|
1165
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>;
|
1166
2570
|
declare type GetBranchStatsPathParams = {
|
2571
|
+
/**
|
2572
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2573
|
+
*/
|
1167
2574
|
dbBranchName: DBBranchName;
|
1168
2575
|
workspace: string;
|
1169
2576
|
};
|
@@ -1196,7 +2603,13 @@ declare type GetBranchStatsVariables = {
|
|
1196
2603
|
*/
|
1197
2604
|
declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
1198
2605
|
declare type CreateTablePathParams = {
|
2606
|
+
/**
|
2607
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2608
|
+
*/
|
1199
2609
|
dbBranchName: DBBranchName;
|
2610
|
+
/**
|
2611
|
+
* The Table name
|
2612
|
+
*/
|
1200
2613
|
tableName: TableName;
|
1201
2614
|
workspace: string;
|
1202
2615
|
};
|
@@ -1213,15 +2626,28 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1213
2626
|
status: 422;
|
1214
2627
|
payload: SimpleError;
|
1215
2628
|
}>;
|
2629
|
+
declare type CreateTableResponse = {
|
2630
|
+
branchName: string;
|
2631
|
+
/**
|
2632
|
+
* @minLength 1
|
2633
|
+
*/
|
2634
|
+
tableName: string;
|
2635
|
+
};
|
1216
2636
|
declare type CreateTableVariables = {
|
1217
2637
|
pathParams: CreateTablePathParams;
|
1218
2638
|
} & FetcherExtraProps;
|
1219
2639
|
/**
|
1220
2640
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1221
2641
|
*/
|
1222
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
2642
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1223
2643
|
declare type DeleteTablePathParams = {
|
2644
|
+
/**
|
2645
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2646
|
+
*/
|
1224
2647
|
dbBranchName: DBBranchName;
|
2648
|
+
/**
|
2649
|
+
* The Table name
|
2650
|
+
*/
|
1225
2651
|
tableName: TableName;
|
1226
2652
|
workspace: string;
|
1227
2653
|
};
|
@@ -1240,7 +2666,13 @@ declare type DeleteTableVariables = {
|
|
1240
2666
|
*/
|
1241
2667
|
declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
1242
2668
|
declare type UpdateTablePathParams = {
|
2669
|
+
/**
|
2670
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2671
|
+
*/
|
1243
2672
|
dbBranchName: DBBranchName;
|
2673
|
+
/**
|
2674
|
+
* The Table name
|
2675
|
+
*/
|
1244
2676
|
tableName: TableName;
|
1245
2677
|
workspace: string;
|
1246
2678
|
};
|
@@ -1255,6 +2687,9 @@ declare type UpdateTableError = ErrorWrapper<{
|
|
1255
2687
|
payload: SimpleError;
|
1256
2688
|
}>;
|
1257
2689
|
declare type UpdateTableRequestBody = {
|
2690
|
+
/**
|
2691
|
+
* @minLength 1
|
2692
|
+
*/
|
1258
2693
|
name: string;
|
1259
2694
|
};
|
1260
2695
|
declare type UpdateTableVariables = {
|
@@ -1266,8 +2701,9 @@ declare type UpdateTableVariables = {
|
|
1266
2701
|
*
|
1267
2702
|
* In the example below, we rename a table from “users” to “people”:
|
1268
2703
|
*
|
1269
|
-
* ```
|
1270
|
-
* PATCH /db/test:main/tables/users
|
2704
|
+
* ```json
|
2705
|
+
* // PATCH /db/test:main/tables/users
|
2706
|
+
*
|
1271
2707
|
* {
|
1272
2708
|
* "name": "people"
|
1273
2709
|
* }
|
@@ -1275,7 +2711,13 @@ declare type UpdateTableVariables = {
|
|
1275
2711
|
*/
|
1276
2712
|
declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
1277
2713
|
declare type GetTableSchemaPathParams = {
|
2714
|
+
/**
|
2715
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2716
|
+
*/
|
1278
2717
|
dbBranchName: DBBranchName;
|
2718
|
+
/**
|
2719
|
+
* The Table name
|
2720
|
+
*/
|
1279
2721
|
tableName: TableName;
|
1280
2722
|
workspace: string;
|
1281
2723
|
};
|
@@ -1297,7 +2739,13 @@ declare type GetTableSchemaVariables = {
|
|
1297
2739
|
} & FetcherExtraProps;
|
1298
2740
|
declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
1299
2741
|
declare type SetTableSchemaPathParams = {
|
2742
|
+
/**
|
2743
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2744
|
+
*/
|
1300
2745
|
dbBranchName: DBBranchName;
|
2746
|
+
/**
|
2747
|
+
* The Table name
|
2748
|
+
*/
|
1301
2749
|
tableName: TableName;
|
1302
2750
|
workspace: string;
|
1303
2751
|
};
|
@@ -1323,7 +2771,13 @@ declare type SetTableSchemaVariables = {
|
|
1323
2771
|
} & FetcherExtraProps;
|
1324
2772
|
declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
|
1325
2773
|
declare type GetTableColumnsPathParams = {
|
2774
|
+
/**
|
2775
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2776
|
+
*/
|
1326
2777
|
dbBranchName: DBBranchName;
|
2778
|
+
/**
|
2779
|
+
* The Table name
|
2780
|
+
*/
|
1327
2781
|
tableName: TableName;
|
1328
2782
|
workspace: string;
|
1329
2783
|
};
|
@@ -1349,7 +2803,13 @@ declare type GetTableColumnsVariables = {
|
|
1349
2803
|
*/
|
1350
2804
|
declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
|
1351
2805
|
declare type AddTableColumnPathParams = {
|
2806
|
+
/**
|
2807
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2808
|
+
*/
|
1352
2809
|
dbBranchName: DBBranchName;
|
2810
|
+
/**
|
2811
|
+
* The Table name
|
2812
|
+
*/
|
1353
2813
|
tableName: TableName;
|
1354
2814
|
workspace: string;
|
1355
2815
|
};
|
@@ -1374,8 +2834,17 @@ declare type AddTableColumnVariables = {
|
|
1374
2834
|
*/
|
1375
2835
|
declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
|
1376
2836
|
declare type GetColumnPathParams = {
|
2837
|
+
/**
|
2838
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2839
|
+
*/
|
1377
2840
|
dbBranchName: DBBranchName;
|
2841
|
+
/**
|
2842
|
+
* The Table name
|
2843
|
+
*/
|
1378
2844
|
tableName: TableName;
|
2845
|
+
/**
|
2846
|
+
* The Column name
|
2847
|
+
*/
|
1379
2848
|
columnName: ColumnName;
|
1380
2849
|
workspace: string;
|
1381
2850
|
};
|
@@ -1397,8 +2866,17 @@ declare type GetColumnVariables = {
|
|
1397
2866
|
*/
|
1398
2867
|
declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
|
1399
2868
|
declare type DeleteColumnPathParams = {
|
2869
|
+
/**
|
2870
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2871
|
+
*/
|
1400
2872
|
dbBranchName: DBBranchName;
|
2873
|
+
/**
|
2874
|
+
* The Table name
|
2875
|
+
*/
|
1401
2876
|
tableName: TableName;
|
2877
|
+
/**
|
2878
|
+
* The Column name
|
2879
|
+
*/
|
1402
2880
|
columnName: ColumnName;
|
1403
2881
|
workspace: string;
|
1404
2882
|
};
|
@@ -1420,8 +2898,17 @@ declare type DeleteColumnVariables = {
|
|
1420
2898
|
*/
|
1421
2899
|
declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
|
1422
2900
|
declare type UpdateColumnPathParams = {
|
2901
|
+
/**
|
2902
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2903
|
+
*/
|
1423
2904
|
dbBranchName: DBBranchName;
|
2905
|
+
/**
|
2906
|
+
* The Table name
|
2907
|
+
*/
|
1424
2908
|
tableName: TableName;
|
2909
|
+
/**
|
2910
|
+
* The Column name
|
2911
|
+
*/
|
1425
2912
|
columnName: ColumnName;
|
1426
2913
|
workspace: string;
|
1427
2914
|
};
|
@@ -1436,6 +2923,9 @@ declare type UpdateColumnError = ErrorWrapper<{
|
|
1436
2923
|
payload: SimpleError;
|
1437
2924
|
}>;
|
1438
2925
|
declare type UpdateColumnRequestBody = {
|
2926
|
+
/**
|
2927
|
+
* @minLength 1
|
2928
|
+
*/
|
1439
2929
|
name: string;
|
1440
2930
|
};
|
1441
2931
|
declare type UpdateColumnVariables = {
|
@@ -1447,10 +2937,22 @@ declare type UpdateColumnVariables = {
|
|
1447
2937
|
*/
|
1448
2938
|
declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
1449
2939
|
declare type InsertRecordPathParams = {
|
2940
|
+
/**
|
2941
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2942
|
+
*/
|
1450
2943
|
dbBranchName: DBBranchName;
|
2944
|
+
/**
|
2945
|
+
* The Table name
|
2946
|
+
*/
|
1451
2947
|
tableName: TableName;
|
1452
2948
|
workspace: string;
|
1453
2949
|
};
|
2950
|
+
declare type InsertRecordQueryParams = {
|
2951
|
+
/**
|
2952
|
+
* Column filters
|
2953
|
+
*/
|
2954
|
+
columns?: ColumnsProjection;
|
2955
|
+
};
|
1454
2956
|
declare type InsertRecordError = ErrorWrapper<{
|
1455
2957
|
status: 400;
|
1456
2958
|
payload: BadRequestError;
|
@@ -1461,27 +2963,35 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1461
2963
|
status: 404;
|
1462
2964
|
payload: SimpleError;
|
1463
2965
|
}>;
|
1464
|
-
declare type InsertRecordResponse = {
|
1465
|
-
id: string;
|
1466
|
-
xata: {
|
1467
|
-
version: number;
|
1468
|
-
};
|
1469
|
-
};
|
1470
2966
|
declare type InsertRecordVariables = {
|
1471
2967
|
body?: Record<string, any>;
|
1472
2968
|
pathParams: InsertRecordPathParams;
|
2969
|
+
queryParams?: InsertRecordQueryParams;
|
1473
2970
|
} & FetcherExtraProps;
|
1474
2971
|
/**
|
1475
2972
|
* Insert a new Record into the Table
|
1476
2973
|
*/
|
1477
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
2974
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1478
2975
|
declare type InsertRecordWithIDPathParams = {
|
2976
|
+
/**
|
2977
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2978
|
+
*/
|
1479
2979
|
dbBranchName: DBBranchName;
|
2980
|
+
/**
|
2981
|
+
* The Table name
|
2982
|
+
*/
|
1480
2983
|
tableName: TableName;
|
2984
|
+
/**
|
2985
|
+
* The Record name
|
2986
|
+
*/
|
1481
2987
|
recordId: RecordID;
|
1482
2988
|
workspace: string;
|
1483
2989
|
};
|
1484
2990
|
declare type InsertRecordWithIDQueryParams = {
|
2991
|
+
/**
|
2992
|
+
* Column filters
|
2993
|
+
*/
|
2994
|
+
columns?: ColumnsProjection;
|
1485
2995
|
createOnly?: boolean;
|
1486
2996
|
ifVersion?: number;
|
1487
2997
|
};
|
@@ -1508,12 +3018,25 @@ declare type InsertRecordWithIDVariables = {
|
|
1508
3018
|
*/
|
1509
3019
|
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1510
3020
|
declare type UpdateRecordWithIDPathParams = {
|
3021
|
+
/**
|
3022
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3023
|
+
*/
|
1511
3024
|
dbBranchName: DBBranchName;
|
3025
|
+
/**
|
3026
|
+
* The Table name
|
3027
|
+
*/
|
1512
3028
|
tableName: TableName;
|
3029
|
+
/**
|
3030
|
+
* The Record name
|
3031
|
+
*/
|
1513
3032
|
recordId: RecordID;
|
1514
3033
|
workspace: string;
|
1515
3034
|
};
|
1516
3035
|
declare type UpdateRecordWithIDQueryParams = {
|
3036
|
+
/**
|
3037
|
+
* Column filters
|
3038
|
+
*/
|
3039
|
+
columns?: ColumnsProjection;
|
1517
3040
|
ifVersion?: number;
|
1518
3041
|
};
|
1519
3042
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1536,12 +3059,25 @@ declare type UpdateRecordWithIDVariables = {
|
|
1536
3059
|
} & FetcherExtraProps;
|
1537
3060
|
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1538
3061
|
declare type UpsertRecordWithIDPathParams = {
|
3062
|
+
/**
|
3063
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3064
|
+
*/
|
1539
3065
|
dbBranchName: DBBranchName;
|
3066
|
+
/**
|
3067
|
+
* The Table name
|
3068
|
+
*/
|
1540
3069
|
tableName: TableName;
|
3070
|
+
/**
|
3071
|
+
* The Record name
|
3072
|
+
*/
|
1541
3073
|
recordId: RecordID;
|
1542
3074
|
workspace: string;
|
1543
3075
|
};
|
1544
3076
|
declare type UpsertRecordWithIDQueryParams = {
|
3077
|
+
/**
|
3078
|
+
* Column filters
|
3079
|
+
*/
|
3080
|
+
columns?: ColumnsProjection;
|
1545
3081
|
ifVersion?: number;
|
1546
3082
|
};
|
1547
3083
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1564,11 +3100,26 @@ declare type UpsertRecordWithIDVariables = {
|
|
1564
3100
|
} & FetcherExtraProps;
|
1565
3101
|
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1566
3102
|
declare type DeleteRecordPathParams = {
|
3103
|
+
/**
|
3104
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3105
|
+
*/
|
1567
3106
|
dbBranchName: DBBranchName;
|
3107
|
+
/**
|
3108
|
+
* The Table name
|
3109
|
+
*/
|
1568
3110
|
tableName: TableName;
|
3111
|
+
/**
|
3112
|
+
* The Record name
|
3113
|
+
*/
|
1569
3114
|
recordId: RecordID;
|
1570
3115
|
workspace: string;
|
1571
3116
|
};
|
3117
|
+
declare type DeleteRecordQueryParams = {
|
3118
|
+
/**
|
3119
|
+
* Column filters
|
3120
|
+
*/
|
3121
|
+
columns?: ColumnsProjection;
|
3122
|
+
};
|
1572
3123
|
declare type DeleteRecordError = ErrorWrapper<{
|
1573
3124
|
status: 400;
|
1574
3125
|
payload: BadRequestError;
|
@@ -1581,14 +3132,30 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1581
3132
|
}>;
|
1582
3133
|
declare type DeleteRecordVariables = {
|
1583
3134
|
pathParams: DeleteRecordPathParams;
|
3135
|
+
queryParams?: DeleteRecordQueryParams;
|
1584
3136
|
} & FetcherExtraProps;
|
1585
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
3137
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1586
3138
|
declare type GetRecordPathParams = {
|
3139
|
+
/**
|
3140
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3141
|
+
*/
|
1587
3142
|
dbBranchName: DBBranchName;
|
3143
|
+
/**
|
3144
|
+
* The Table name
|
3145
|
+
*/
|
1588
3146
|
tableName: TableName;
|
3147
|
+
/**
|
3148
|
+
* The Record name
|
3149
|
+
*/
|
1589
3150
|
recordId: RecordID;
|
1590
3151
|
workspace: string;
|
1591
3152
|
};
|
3153
|
+
declare type GetRecordQueryParams = {
|
3154
|
+
/**
|
3155
|
+
* Column filters
|
3156
|
+
*/
|
3157
|
+
columns?: ColumnsProjection;
|
3158
|
+
};
|
1592
3159
|
declare type GetRecordError = ErrorWrapper<{
|
1593
3160
|
status: 400;
|
1594
3161
|
payload: BadRequestError;
|
@@ -1599,22 +3166,31 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1599
3166
|
status: 404;
|
1600
3167
|
payload: SimpleError;
|
1601
3168
|
}>;
|
1602
|
-
declare type GetRecordRequestBody = {
|
1603
|
-
columns?: ColumnsFilter;
|
1604
|
-
};
|
1605
3169
|
declare type GetRecordVariables = {
|
1606
|
-
body?: GetRecordRequestBody;
|
1607
3170
|
pathParams: GetRecordPathParams;
|
3171
|
+
queryParams?: GetRecordQueryParams;
|
1608
3172
|
} & FetcherExtraProps;
|
1609
3173
|
/**
|
1610
3174
|
* Retrieve record by ID
|
1611
3175
|
*/
|
1612
3176
|
declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
1613
3177
|
declare type BulkInsertTableRecordsPathParams = {
|
3178
|
+
/**
|
3179
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3180
|
+
*/
|
1614
3181
|
dbBranchName: DBBranchName;
|
3182
|
+
/**
|
3183
|
+
* The Table name
|
3184
|
+
*/
|
1615
3185
|
tableName: TableName;
|
1616
3186
|
workspace: string;
|
1617
3187
|
};
|
3188
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
3189
|
+
/**
|
3190
|
+
* Column filters
|
3191
|
+
*/
|
3192
|
+
columns?: ColumnsProjection;
|
3193
|
+
};
|
1618
3194
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1619
3195
|
status: 400;
|
1620
3196
|
payload: BulkError;
|
@@ -1624,23 +3200,30 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1624
3200
|
} | {
|
1625
3201
|
status: 404;
|
1626
3202
|
payload: SimpleError;
|
3203
|
+
} | {
|
3204
|
+
status: 422;
|
3205
|
+
payload: SimpleError;
|
1627
3206
|
}>;
|
1628
|
-
declare type BulkInsertTableRecordsResponse = {
|
1629
|
-
recordIDs: string[];
|
1630
|
-
};
|
1631
3207
|
declare type BulkInsertTableRecordsRequestBody = {
|
1632
3208
|
records: Record<string, any>[];
|
1633
3209
|
};
|
1634
3210
|
declare type BulkInsertTableRecordsVariables = {
|
1635
3211
|
body: BulkInsertTableRecordsRequestBody;
|
1636
3212
|
pathParams: BulkInsertTableRecordsPathParams;
|
3213
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1637
3214
|
} & FetcherExtraProps;
|
1638
3215
|
/**
|
1639
3216
|
* Bulk insert records
|
1640
3217
|
*/
|
1641
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
3218
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1642
3219
|
declare type QueryTablePathParams = {
|
3220
|
+
/**
|
3221
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3222
|
+
*/
|
1643
3223
|
dbBranchName: DBBranchName;
|
3224
|
+
/**
|
3225
|
+
* The Table name
|
3226
|
+
*/
|
1644
3227
|
tableName: TableName;
|
1645
3228
|
workspace: string;
|
1646
3229
|
};
|
@@ -1658,7 +3241,7 @@ declare type QueryTableRequestBody = {
|
|
1658
3241
|
filter?: FilterExpression;
|
1659
3242
|
sort?: SortExpression;
|
1660
3243
|
page?: PageConfig;
|
1661
|
-
columns?:
|
3244
|
+
columns?: ColumnsProjection;
|
1662
3245
|
};
|
1663
3246
|
declare type QueryTableVariables = {
|
1664
3247
|
body?: QueryTableRequestBody;
|
@@ -1675,7 +3258,7 @@ declare type QueryTableVariables = {
|
|
1675
3258
|
* {
|
1676
3259
|
* "columns": [...],
|
1677
3260
|
* "filter": {
|
1678
|
-
* "$all": [...]
|
3261
|
+
* "$all": [...],
|
1679
3262
|
* "$any": [...]
|
1680
3263
|
* ...
|
1681
3264
|
* },
|
@@ -1694,8 +3277,9 @@ declare type QueryTableVariables = {
|
|
1694
3277
|
* If the `columns` array is not specified, all columns are included. For link
|
1695
3278
|
* fields, only the ID column of the linked records is included in the response.
|
1696
3279
|
*
|
1697
|
-
* If the `columns` array is specified, only the selected
|
1698
|
-
* 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.
|
1699
3283
|
*
|
1700
3284
|
* For objects and link fields, if the column name of the object is specified, we
|
1701
3285
|
* include all of its sub-keys. If only some sub-keys are specified (via dotted
|
@@ -1721,7 +3305,11 @@ declare type QueryTableVariables = {
|
|
1721
3305
|
* "link": {
|
1722
3306
|
* "table": "users"
|
1723
3307
|
* }
|
1724
|
-
* }
|
3308
|
+
* },
|
3309
|
+
* {
|
3310
|
+
* "name": "foundedDate",
|
3311
|
+
* "type": "datetime"
|
3312
|
+
* },
|
1725
3313
|
* ]
|
1726
3314
|
* },
|
1727
3315
|
* {
|
@@ -1807,9 +3395,13 @@ declare type QueryTableVariables = {
|
|
1807
3395
|
*
|
1808
3396
|
* ```json
|
1809
3397
|
* {
|
3398
|
+
* "id": "id1"
|
3399
|
+
* "xata": {
|
3400
|
+
* "version": 0
|
3401
|
+
* }
|
1810
3402
|
* "name": "Kilian",
|
1811
3403
|
* "address": {
|
1812
|
-
* "street": "New street"
|
3404
|
+
* "street": "New street"
|
1813
3405
|
* }
|
1814
3406
|
* }
|
1815
3407
|
* ```
|
@@ -1818,10 +3410,7 @@ declare type QueryTableVariables = {
|
|
1818
3410
|
*
|
1819
3411
|
* ```json
|
1820
3412
|
* {
|
1821
|
-
* "columns": [
|
1822
|
-
* "*",
|
1823
|
-
* "team.name"
|
1824
|
-
* ]
|
3413
|
+
* "columns": ["*", "team.name"]
|
1825
3414
|
* }
|
1826
3415
|
* ```
|
1827
3416
|
*
|
@@ -1829,6 +3418,10 @@ declare type QueryTableVariables = {
|
|
1829
3418
|
*
|
1830
3419
|
* ```json
|
1831
3420
|
* {
|
3421
|
+
* "id": "id1"
|
3422
|
+
* "xata": {
|
3423
|
+
* "version": 0
|
3424
|
+
* }
|
1832
3425
|
* "name": "Kilian",
|
1833
3426
|
* "email": "kilian@gmail.com",
|
1834
3427
|
* "address": {
|
@@ -1839,7 +3432,7 @@ declare type QueryTableVariables = {
|
|
1839
3432
|
* "team": {
|
1840
3433
|
* "id": "XX",
|
1841
3434
|
* "xata": {
|
1842
|
-
* "version": 0
|
3435
|
+
* "version": 0
|
1843
3436
|
* },
|
1844
3437
|
* "name": "first team"
|
1845
3438
|
* }
|
@@ -1850,10 +3443,7 @@ declare type QueryTableVariables = {
|
|
1850
3443
|
*
|
1851
3444
|
* ```json
|
1852
3445
|
* {
|
1853
|
-
* "columns": [
|
1854
|
-
* "*",
|
1855
|
-
* "team.*"
|
1856
|
-
* ]
|
3446
|
+
* "columns": ["*", "team.*"]
|
1857
3447
|
* }
|
1858
3448
|
* ```
|
1859
3449
|
*
|
@@ -1861,6 +3451,10 @@ declare type QueryTableVariables = {
|
|
1861
3451
|
*
|
1862
3452
|
* ```json
|
1863
3453
|
* {
|
3454
|
+
* "id": "id1"
|
3455
|
+
* "xata": {
|
3456
|
+
* "version": 0
|
3457
|
+
* }
|
1864
3458
|
* "name": "Kilian",
|
1865
3459
|
* "email": "kilian@gmail.com",
|
1866
3460
|
* "address": {
|
@@ -1871,10 +3465,11 @@ declare type QueryTableVariables = {
|
|
1871
3465
|
* "team": {
|
1872
3466
|
* "id": "XX",
|
1873
3467
|
* "xata": {
|
1874
|
-
* "version": 0
|
3468
|
+
* "version": 0
|
1875
3469
|
* },
|
1876
3470
|
* "name": "first team",
|
1877
|
-
* "code": "A1"
|
3471
|
+
* "code": "A1",
|
3472
|
+
* "foundedDate": "2020-03-04T10:43:54.32Z"
|
1878
3473
|
* }
|
1879
3474
|
* }
|
1880
3475
|
* ```
|
@@ -1889,7 +3484,7 @@ declare type QueryTableVariables = {
|
|
1889
3484
|
* `$none`, etc.
|
1890
3485
|
*
|
1891
3486
|
* All operators start with an `$` to differentiate them from column names
|
1892
|
-
* (which are not allowed to start with
|
3487
|
+
* (which are not allowed to start with a dollar sign).
|
1893
3488
|
*
|
1894
3489
|
* #### Exact matching and control operators
|
1895
3490
|
*
|
@@ -1920,7 +3515,7 @@ declare type QueryTableVariables = {
|
|
1920
3515
|
* ```json
|
1921
3516
|
* {
|
1922
3517
|
* "filter": {
|
1923
|
-
*
|
3518
|
+
* "name": "r2"
|
1924
3519
|
* }
|
1925
3520
|
* }
|
1926
3521
|
* ```
|
@@ -1942,7 +3537,7 @@ declare type QueryTableVariables = {
|
|
1942
3537
|
* ```json
|
1943
3538
|
* {
|
1944
3539
|
* "filter": {
|
1945
|
-
*
|
3540
|
+
* "settings.plan": "free"
|
1946
3541
|
* }
|
1947
3542
|
* }
|
1948
3543
|
* ```
|
@@ -1952,8 +3547,8 @@ declare type QueryTableVariables = {
|
|
1952
3547
|
* "filter": {
|
1953
3548
|
* "settings": {
|
1954
3549
|
* "plan": "free"
|
1955
|
-
* }
|
1956
|
-
* }
|
3550
|
+
* }
|
3551
|
+
* }
|
1957
3552
|
* }
|
1958
3553
|
* ```
|
1959
3554
|
*
|
@@ -1962,8 +3557,8 @@ declare type QueryTableVariables = {
|
|
1962
3557
|
* ```json
|
1963
3558
|
* {
|
1964
3559
|
* "filter": {
|
1965
|
-
* "settings.plan": {"$any": ["free", "paid"]}
|
1966
|
-
* }
|
3560
|
+
* "settings.plan": { "$any": ["free", "paid"] }
|
3561
|
+
* }
|
1967
3562
|
* }
|
1968
3563
|
* ```
|
1969
3564
|
*
|
@@ -1972,9 +3567,9 @@ declare type QueryTableVariables = {
|
|
1972
3567
|
* ```json
|
1973
3568
|
* {
|
1974
3569
|
* "filter": {
|
1975
|
-
*
|
1976
|
-
*
|
1977
|
-
* }
|
3570
|
+
* "settings.dark": true,
|
3571
|
+
* "settings.plan": "free"
|
3572
|
+
* }
|
1978
3573
|
* }
|
1979
3574
|
* ```
|
1980
3575
|
*
|
@@ -1985,11 +3580,11 @@ declare type QueryTableVariables = {
|
|
1985
3580
|
* ```json
|
1986
3581
|
* {
|
1987
3582
|
* "filter": {
|
1988
|
-
*
|
1989
|
-
*
|
1990
|
-
*
|
1991
|
-
*
|
1992
|
-
* }
|
3583
|
+
* "$any": {
|
3584
|
+
* "settings.dark": true,
|
3585
|
+
* "settings.plan": "free"
|
3586
|
+
* }
|
3587
|
+
* }
|
1993
3588
|
* }
|
1994
3589
|
* ```
|
1995
3590
|
*
|
@@ -2000,10 +3595,10 @@ declare type QueryTableVariables = {
|
|
2000
3595
|
* "filter": {
|
2001
3596
|
* "$any": [
|
2002
3597
|
* {
|
2003
|
-
* "name": "r1"
|
3598
|
+
* "name": "r1"
|
2004
3599
|
* },
|
2005
3600
|
* {
|
2006
|
-
* "name": "r2"
|
3601
|
+
* "name": "r2"
|
2007
3602
|
* }
|
2008
3603
|
* ]
|
2009
3604
|
* }
|
@@ -2015,7 +3610,7 @@ declare type QueryTableVariables = {
|
|
2015
3610
|
* ```json
|
2016
3611
|
* {
|
2017
3612
|
* "filter": {
|
2018
|
-
* "$exists": "settings"
|
3613
|
+
* "$exists": "settings"
|
2019
3614
|
* }
|
2020
3615
|
* }
|
2021
3616
|
* ```
|
@@ -2027,10 +3622,10 @@ declare type QueryTableVariables = {
|
|
2027
3622
|
* "filter": {
|
2028
3623
|
* "$all": [
|
2029
3624
|
* {
|
2030
|
-
* "$exists": "settings"
|
3625
|
+
* "$exists": "settings"
|
2031
3626
|
* },
|
2032
3627
|
* {
|
2033
|
-
* "$exists": "name"
|
3628
|
+
* "$exists": "name"
|
2034
3629
|
* }
|
2035
3630
|
* ]
|
2036
3631
|
* }
|
@@ -2042,7 +3637,7 @@ declare type QueryTableVariables = {
|
|
2042
3637
|
* ```json
|
2043
3638
|
* {
|
2044
3639
|
* "filter": {
|
2045
|
-
* "$notExists": "settings"
|
3640
|
+
* "$notExists": "settings"
|
2046
3641
|
* }
|
2047
3642
|
* }
|
2048
3643
|
* ```
|
@@ -2069,43 +3664,59 @@ declare type QueryTableVariables = {
|
|
2069
3664
|
* {
|
2070
3665
|
* "filter": {
|
2071
3666
|
* "<column_name>": {
|
2072
|
-
*
|
3667
|
+
* "$pattern": "v*alu?"
|
2073
3668
|
* }
|
2074
3669
|
* }
|
2075
3670
|
* }
|
2076
3671
|
* ```
|
2077
3672
|
*
|
3673
|
+
* The `$pattern` operator accepts two wildcard characters:
|
3674
|
+
* * `*` matches zero or more characters
|
3675
|
+
* * `?` matches exactly one character
|
3676
|
+
*
|
3677
|
+
* If you want to match a string that contains a wildcard character, you can escape them using a backslash (`\`). You can escape a backslash by usign another backslash.
|
3678
|
+
*
|
2078
3679
|
* We could also have `$endsWith` and `$startsWith` operators:
|
2079
3680
|
*
|
2080
3681
|
* ```json
|
2081
3682
|
* {
|
2082
3683
|
* "filter": {
|
2083
3684
|
* "<column_name>": {
|
2084
|
-
*
|
3685
|
+
* "$endsWith": ".gz"
|
2085
3686
|
* },
|
2086
3687
|
* "<column_name>": {
|
2087
|
-
*
|
3688
|
+
* "$startsWith": "tmp-"
|
2088
3689
|
* }
|
2089
3690
|
* }
|
2090
3691
|
* }
|
2091
3692
|
* ```
|
2092
3693
|
*
|
2093
|
-
* #### Numeric ranges
|
3694
|
+
* #### Numeric or datetime ranges
|
2094
3695
|
*
|
2095
3696
|
* ```json
|
2096
3697
|
* {
|
2097
3698
|
* "filter": {
|
2098
|
-
*
|
2099
|
-
*
|
2100
|
-
*
|
2101
|
-
*
|
3699
|
+
* "<column_name>": {
|
3700
|
+
* "$ge": 0,
|
3701
|
+
* "$lt": 100
|
3702
|
+
* }
|
3703
|
+
* }
|
3704
|
+
* }
|
3705
|
+
* ```
|
3706
|
+
* Date ranges support the same operators, with the date using the format defined in
|
3707
|
+
* [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
|
3708
|
+
* ```json
|
3709
|
+
* {
|
3710
|
+
* "filter": {
|
3711
|
+
* "<column_name>": {
|
3712
|
+
* "$gt": "2019-10-12T07:20:50.52Z",
|
3713
|
+
* "$lt": "2021-10-12T07:20:50.52Z"
|
3714
|
+
* }
|
2102
3715
|
* }
|
2103
3716
|
* }
|
2104
3717
|
* ```
|
2105
|
-
*
|
2106
3718
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
2107
3719
|
*
|
2108
|
-
*
|
2109
3720
|
* #### Negations
|
2110
3721
|
*
|
2111
3722
|
* A general `$not` operator can inverse any operation.
|
@@ -2130,15 +3741,21 @@ declare type QueryTableVariables = {
|
|
2130
3741
|
* {
|
2131
3742
|
* "filter": {
|
2132
3743
|
* "$not": {
|
2133
|
-
* "$any": [
|
2134
|
-
*
|
2135
|
-
*
|
2136
|
-
*
|
2137
|
-
*
|
2138
|
-
*
|
2139
|
-
*
|
2140
|
-
*
|
2141
|
-
*
|
3744
|
+
* "$any": [
|
3745
|
+
* {
|
3746
|
+
* "<column_name1>": "value1"
|
3747
|
+
* },
|
3748
|
+
* {
|
3749
|
+
* "$all": [
|
3750
|
+
* {
|
3751
|
+
* "<column_name2>": "value2"
|
3752
|
+
* },
|
3753
|
+
* {
|
3754
|
+
* "<column_name3>": "value3"
|
3755
|
+
* }
|
3756
|
+
* ]
|
3757
|
+
* }
|
3758
|
+
* ]
|
2142
3759
|
* }
|
2143
3760
|
* }
|
2144
3761
|
* }
|
@@ -2193,8 +3810,8 @@ declare type QueryTableVariables = {
|
|
2193
3810
|
* "<array name>": {
|
2194
3811
|
* "$includes": {
|
2195
3812
|
* "$all": [
|
2196
|
-
* {"$contains": "label"},
|
2197
|
-
* {"$not": {"$endsWith": "-debug"}}
|
3813
|
+
* { "$contains": "label" },
|
3814
|
+
* { "$not": { "$endsWith": "-debug" } }
|
2198
3815
|
* ]
|
2199
3816
|
* }
|
2200
3817
|
* }
|
@@ -2214,9 +3831,7 @@ declare type QueryTableVariables = {
|
|
2214
3831
|
* {
|
2215
3832
|
* "filter": {
|
2216
3833
|
* "settings.labels": {
|
2217
|
-
* "$includesAll": [
|
2218
|
-
* {"$contains": "label"},
|
2219
|
-
* ]
|
3834
|
+
* "$includesAll": [{ "$contains": "label" }]
|
2220
3835
|
* }
|
2221
3836
|
* }
|
2222
3837
|
* }
|
@@ -2264,11 +3879,10 @@ declare type QueryTableVariables = {
|
|
2264
3879
|
* }
|
2265
3880
|
* ```
|
2266
3881
|
*
|
2267
|
-
*
|
2268
3882
|
* ### Pagination
|
2269
3883
|
*
|
2270
|
-
* We offer cursor pagination and offset pagination.
|
2271
|
-
*
|
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.
|
2272
3886
|
*
|
2273
3887
|
* Example of size + offset pagination:
|
2274
3888
|
*
|
@@ -2330,8 +3944,8 @@ declare type QueryTableVariables = {
|
|
2330
3944
|
* can be queried by update `page.after` to the returned cursor while keeping the
|
2331
3945
|
* `page.before` cursor from the first range query.
|
2332
3946
|
*
|
2333
|
-
* The `filter` , `columns`,
|
2334
|
-
* encoded with the cursor.
|
3947
|
+
* The `filter` , `columns`, `sort` , and `page.size` configuration will be
|
3948
|
+
* encoded with the cursor. The pagination request will be invalid if
|
2335
3949
|
* `filter` or `sort` is set. The columns returned and page size can be changed
|
2336
3950
|
* anytime by passing the `columns` or `page.size` settings to the next query.
|
2337
3951
|
*
|
@@ -2367,12 +3981,252 @@ declare type QueryTableVariables = {
|
|
2367
3981
|
* }
|
2368
3982
|
* ```
|
2369
3983
|
*/
|
2370
|
-
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2371
|
-
declare type
|
2372
|
-
|
2373
|
-
|
3984
|
+
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
3985
|
+
declare type SearchTablePathParams = {
|
3986
|
+
/**
|
3987
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3988
|
+
*/
|
3989
|
+
dbBranchName: DBBranchName;
|
3990
|
+
/**
|
3991
|
+
* The Table name
|
3992
|
+
*/
|
3993
|
+
tableName: TableName;
|
3994
|
+
workspace: string;
|
3995
|
+
};
|
3996
|
+
declare type SearchTableError = ErrorWrapper<{
|
3997
|
+
status: 400;
|
3998
|
+
payload: BadRequestError;
|
3999
|
+
} | {
|
4000
|
+
status: 401;
|
4001
|
+
payload: AuthError;
|
4002
|
+
} | {
|
4003
|
+
status: 404;
|
4004
|
+
payload: SimpleError;
|
4005
|
+
}>;
|
4006
|
+
declare type SearchTableRequestBody = {
|
4007
|
+
/**
|
4008
|
+
* The query string.
|
4009
|
+
*
|
4010
|
+
* @minLength 1
|
4011
|
+
*/
|
4012
|
+
query: string;
|
4013
|
+
fuzziness?: FuzzinessExpression;
|
4014
|
+
target?: TargetExpression;
|
4015
|
+
prefix?: PrefixExpression;
|
4016
|
+
filter?: FilterExpression;
|
4017
|
+
highlight?: HighlightExpression;
|
4018
|
+
boosters?: BoosterExpression[];
|
4019
|
+
};
|
4020
|
+
declare type SearchTableVariables = {
|
4021
|
+
body: SearchTableRequestBody;
|
4022
|
+
pathParams: SearchTablePathParams;
|
4023
|
+
} & FetcherExtraProps;
|
4024
|
+
/**
|
4025
|
+
* Run a free text search operation in a particular table.
|
4026
|
+
*
|
4027
|
+
* The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
|
4028
|
+
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
4029
|
+
* * filtering on columns of type `multiple` is currently unsupported
|
4030
|
+
*/
|
4031
|
+
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
4032
|
+
declare type SearchBranchPathParams = {
|
4033
|
+
/**
|
4034
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4035
|
+
*/
|
4036
|
+
dbBranchName: DBBranchName;
|
4037
|
+
workspace: string;
|
4038
|
+
};
|
4039
|
+
declare type SearchBranchError = ErrorWrapper<{
|
4040
|
+
status: 400;
|
4041
|
+
payload: BadRequestError;
|
4042
|
+
} | {
|
4043
|
+
status: 401;
|
4044
|
+
payload: AuthError;
|
4045
|
+
} | {
|
4046
|
+
status: 404;
|
4047
|
+
payload: SimpleError;
|
4048
|
+
}>;
|
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
|
+
*/
|
4053
|
+
tables?: (string | {
|
4054
|
+
/**
|
4055
|
+
* The name of the table.
|
4056
|
+
*/
|
4057
|
+
table: string;
|
4058
|
+
filter?: FilterExpression;
|
4059
|
+
target?: TargetExpression;
|
4060
|
+
boosters?: BoosterExpression[];
|
4061
|
+
})[];
|
4062
|
+
/**
|
4063
|
+
* The query string.
|
4064
|
+
*
|
4065
|
+
* @minLength 1
|
4066
|
+
*/
|
4067
|
+
query: string;
|
4068
|
+
fuzziness?: FuzzinessExpression;
|
4069
|
+
prefix?: PrefixExpression;
|
4070
|
+
highlight?: HighlightExpression;
|
4071
|
+
};
|
4072
|
+
declare type SearchBranchVariables = {
|
4073
|
+
body: SearchBranchRequestBody;
|
4074
|
+
pathParams: SearchBranchPathParams;
|
4075
|
+
} & FetcherExtraProps;
|
4076
|
+
/**
|
4077
|
+
* Run a free text search operation across the database branch.
|
4078
|
+
*/
|
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;
|
2374
4158
|
};
|
2375
|
-
declare type
|
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<{
|
2376
4230
|
status: 400;
|
2377
4231
|
payload: BadRequestError;
|
2378
4232
|
} | {
|
@@ -2382,19 +4236,76 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
2382
4236
|
status: 404;
|
2383
4237
|
payload: SimpleError;
|
2384
4238
|
}>;
|
2385
|
-
declare type
|
2386
|
-
|
2387
|
-
|
2388
|
-
|
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;
|
2389
4255
|
};
|
2390
|
-
declare type
|
2391
|
-
|
2392
|
-
|
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;
|
2393
4268
|
} & FetcherExtraProps;
|
2394
4269
|
/**
|
2395
|
-
*
|
4270
|
+
* Retrieve metadata of the given database
|
2396
4271
|
*/
|
2397
|
-
declare const
|
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>;
|
2398
4309
|
declare const operationsByTag: {
|
2399
4310
|
users: {
|
2400
4311
|
getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
@@ -2414,6 +4325,7 @@ declare const operationsByTag: {
|
|
2414
4325
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
2415
4326
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
2416
4327
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
4328
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
2417
4329
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2418
4330
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2419
4331
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
@@ -2422,21 +4334,45 @@ declare const operationsByTag: {
|
|
2422
4334
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2423
4335
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2424
4336
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
4337
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
4338
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
4339
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
4340
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
4341
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
4342
|
+
resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
2425
4343
|
};
|
2426
4344
|
branch: {
|
2427
4345
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2428
4346
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2429
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
4347
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2430
4348
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2431
4349
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2432
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: {
|
2433
4364
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2434
4365
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
2435
4366
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2436
|
-
|
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>;
|
2437
4373
|
};
|
2438
4374
|
table: {
|
2439
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
4375
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2440
4376
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2441
4377
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2442
4378
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2448,15 +4384,24 @@ declare const operationsByTag: {
|
|
2448
4384
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2449
4385
|
};
|
2450
4386
|
records: {
|
2451
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
4387
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2452
4388
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2453
4389
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2454
4390
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2455
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
4391
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2456
4392
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2457
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
4393
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2458
4394
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
4395
|
+
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2459
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>;
|
2460
4405
|
};
|
2461
4406
|
};
|
2462
4407
|
|
@@ -2471,6 +4416,7 @@ interface XataApiClientOptions {
|
|
2471
4416
|
fetch?: FetchImpl;
|
2472
4417
|
apiKey?: string;
|
2473
4418
|
host?: HostProvider;
|
4419
|
+
trace?: TraceFunction;
|
2474
4420
|
}
|
2475
4421
|
declare class XataApiClient {
|
2476
4422
|
#private;
|
@@ -2481,6 +4427,8 @@ declare class XataApiClient {
|
|
2481
4427
|
get branches(): BranchApi;
|
2482
4428
|
get tables(): TableApi;
|
2483
4429
|
get records(): RecordsApi;
|
4430
|
+
get migrationRequests(): MigrationRequestsApi;
|
4431
|
+
get branchSchema(): BranchSchemaApi;
|
2484
4432
|
}
|
2485
4433
|
declare class UserApi {
|
2486
4434
|
private extraProps;
|
@@ -2504,6 +4452,7 @@ declare class WorkspaceApi {
|
|
2504
4452
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
2505
4453
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
2506
4454
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
4455
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
2507
4456
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2508
4457
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2509
4458
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
@@ -2514,25 +4463,28 @@ declare class DatabaseApi {
|
|
2514
4463
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2515
4464
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2516
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>;
|
4468
|
+
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
4469
|
+
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
4470
|
+
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
4471
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
2517
4472
|
}
|
2518
4473
|
declare class BranchApi {
|
2519
4474
|
private extraProps;
|
2520
4475
|
constructor(extraProps: FetcherExtraProps);
|
2521
4476
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2522
4477
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2523
|
-
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>;
|
2524
4479
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2525
4480
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2526
4481
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2527
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
2528
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
2529
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
2530
4482
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2531
4483
|
}
|
2532
4484
|
declare class TableApi {
|
2533
4485
|
private extraProps;
|
2534
4486
|
constructor(extraProps: FetcherExtraProps);
|
2535
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
4487
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2536
4488
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2537
4489
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2538
4490
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2546,15 +4498,42 @@ declare class TableApi {
|
|
2546
4498
|
declare class RecordsApi {
|
2547
4499
|
private extraProps;
|
2548
4500
|
constructor(extraProps: FetcherExtraProps);
|
2549
|
-
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>;
|
2550
4502
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2551
4503
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2552
4504
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2553
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2554
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2555
|
-
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>;
|
2556
4508
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
4509
|
+
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2557
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>;
|
2558
4537
|
}
|
2559
4538
|
|
2560
4539
|
declare class XataApiPlugin implements XataPlugin {
|
@@ -2567,28 +4546,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2567
4546
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2568
4547
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2569
4548
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2570
|
-
declare type NonEmptyArray<T> = T[] & {
|
2571
|
-
0: T;
|
2572
|
-
};
|
2573
4549
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2574
4550
|
[P in K]-?: NonNullable<T[P]>;
|
2575
4551
|
};
|
2576
4552
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2577
4553
|
declare type SingleOrArray<T> = T | T[];
|
2578
|
-
declare type
|
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;
|
2579
4559
|
|
2580
4560
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2581
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2582
|
-
[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>;
|
2583
4563
|
}>>;
|
2584
|
-
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<O[K] extends
|
2585
|
-
V: ValueAtColumn<
|
2586
|
-
} : never
|
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> ? {
|
4565
|
+
V: ValueAtColumn<Item, V>;
|
4566
|
+
} : never : O[K] : never> : never : never;
|
2587
4567
|
declare type MAX_RECURSION = 5;
|
2588
4568
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
2589
|
-
[K in DataProps<O>]:
|
2590
|
-
If<IsObject<
|
2591
|
-
K
|
4569
|
+
[K in DataProps<O>]: NonNullable<O[K]> extends infer Item ? If<IsArray<Item>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
|
4570
|
+
If<IsObject<Item>, Item extends XataRecord ? SelectableColumn<Item, [...RecursivePath, Item]> extends infer Column ? Column extends string ? K | `${K}.${Column}` : never : never : Item extends Date ? K : `${K}.${StringKeys<Item> | '*'}`, // This allows usage of objects that are not links
|
4571
|
+
K>> : never;
|
2592
4572
|
}>, never>;
|
2593
4573
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
2594
4574
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
@@ -2615,56 +4595,67 @@ interface BaseData {
|
|
2615
4595
|
/**
|
2616
4596
|
* Represents a persisted record from the database.
|
2617
4597
|
*/
|
2618
|
-
interface XataRecord extends Identifiable {
|
4598
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2619
4599
|
/**
|
2620
|
-
*
|
4600
|
+
* Get metadata of this record.
|
2621
4601
|
*/
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
|
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>;
|
2628
4609
|
/**
|
2629
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.
|
4612
|
+
*/
|
4613
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
4614
|
+
/**
|
4615
|
+
* Performs a partial update of the current record. On success a new object is
|
4616
|
+
* returned and the current object is not mutated.
|
4617
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
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.
|
2630
4620
|
*/
|
2631
|
-
|
4621
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2632
4622
|
/**
|
2633
4623
|
* Performs a partial update of the current record. On success a new object is
|
2634
4624
|
* returned and the current object is not mutated.
|
2635
|
-
* @param
|
2636
|
-
* @returns
|
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.
|
2637
4627
|
*/
|
2638
|
-
update(partialUpdate: Partial<EditableData<
|
4628
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2639
4629
|
/**
|
2640
4630
|
* Performs a deletion of the current record in the database.
|
2641
|
-
*
|
2642
|
-
* @
|
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.
|
2643
4633
|
*/
|
2644
|
-
delete(): Promise<
|
2645
|
-
}
|
2646
|
-
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
4634
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2647
4635
|
/**
|
2648
|
-
*
|
4636
|
+
* Performs a deletion of the current record in the database.
|
4637
|
+
* @returns The deleted record, null if not found.
|
4638
|
+
|
2649
4639
|
*/
|
2650
|
-
|
4640
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
4641
|
+
}
|
4642
|
+
declare type Link<Record extends XataRecord> = XataRecord<Record>;
|
4643
|
+
declare type XataRecordMetadata = {
|
2651
4644
|
/**
|
2652
|
-
*
|
2653
|
-
* returned and the current object is not mutated.
|
2654
|
-
* @param data The columns and their values that have to be updated.
|
2655
|
-
* @returns A new record containing the latest values for all the columns of the current record.
|
4645
|
+
* Number that is increased every time the record is updated.
|
2656
4646
|
*/
|
2657
|
-
|
4647
|
+
version: number;
|
4648
|
+
warnings?: string[];
|
2658
4649
|
};
|
2659
4650
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2660
4651
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2661
|
-
declare type EditableData<O extends
|
4652
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
2662
4653
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2663
4654
|
id: string;
|
2664
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
4655
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2665
4656
|
id: string;
|
2666
|
-
} | null | undefined : O[K];
|
2667
|
-
}
|
4657
|
+
} | string | null | undefined : O[K];
|
4658
|
+
}, keyof XataRecord>;
|
2668
4659
|
|
2669
4660
|
/**
|
2670
4661
|
* PropertyMatchFilter
|
@@ -2739,8 +4730,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
2739
4730
|
],
|
2740
4731
|
}
|
2741
4732
|
*/
|
2742
|
-
declare type AggregatorFilter<
|
2743
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
4733
|
+
declare type AggregatorFilter<T> = {
|
4734
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
2744
4735
|
};
|
2745
4736
|
/**
|
2746
4737
|
* Existance filter
|
@@ -2755,10 +4746,104 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
2755
4746
|
* Injects the Api filters on nested properties
|
2756
4747
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
2757
4748
|
*/
|
2758
|
-
declare type NestedApiFilter<T> =
|
4749
|
+
declare type NestedApiFilter<T> = {
|
2759
4750
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
2760
|
-
}
|
2761
|
-
declare type Filter<
|
4751
|
+
};
|
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;
|
2762
4847
|
|
2763
4848
|
declare type SortDirection = 'asc' | 'desc';
|
2764
4849
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -2770,12 +4855,21 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
2770
4855
|
[Key in StringKeys<T>]: SortDirection;
|
2771
4856
|
};
|
2772
4857
|
|
2773
|
-
declare type
|
2774
|
-
|
2775
|
-
|
4858
|
+
declare type BaseOptions<T extends XataRecord> = {
|
4859
|
+
columns?: SelectableColumn<T>[];
|
4860
|
+
cache?: number;
|
4861
|
+
};
|
4862
|
+
declare type CursorQueryOptions = {
|
4863
|
+
pagination?: CursorNavigationOptions & OffsetNavigationOptions;
|
4864
|
+
filter?: never;
|
4865
|
+
sort?: never;
|
4866
|
+
};
|
4867
|
+
declare type OffsetQueryOptions<T extends XataRecord> = {
|
4868
|
+
pagination?: OffsetNavigationOptions;
|
2776
4869
|
filter?: FilterExpression;
|
2777
4870
|
sort?: SortFilter<T> | SortFilter<T>[];
|
2778
4871
|
};
|
4872
|
+
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
2779
4873
|
/**
|
2780
4874
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
2781
4875
|
*
|
@@ -2785,9 +4879,13 @@ declare type QueryOptions<T extends XataRecord> = {
|
|
2785
4879
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
2786
4880
|
#private;
|
2787
4881
|
readonly meta: PaginationQueryMeta;
|
2788
|
-
readonly records: Result
|
2789
|
-
constructor(repository: Repository<Record> | null, table:
|
4882
|
+
readonly records: RecordArray<Result>;
|
4883
|
+
constructor(repository: Repository<Record> | null, table: {
|
4884
|
+
name: string;
|
4885
|
+
schema?: Table;
|
4886
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
2790
4887
|
getQueryOptions(): QueryOptions<Record>;
|
4888
|
+
key(): string;
|
2791
4889
|
/**
|
2792
4890
|
* Builds a new query object representing a logical OR between the given subqueries.
|
2793
4891
|
* @param queries An array of subqueries.
|
@@ -2817,67 +4915,203 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
2817
4915
|
*
|
2818
4916
|
* ```
|
2819
4917
|
* query.filter("columnName", columnValue)
|
2820
|
-
* query.filter(
|
2821
|
-
*
|
2822
|
-
*
|
4918
|
+
* query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
|
4919
|
+
* ```
|
4920
|
+
*
|
4921
|
+
* @param column The name of the column to filter.
|
4922
|
+
* @param value The value to filter.
|
4923
|
+
* @returns A new Query object.
|
4924
|
+
*/
|
4925
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
4926
|
+
/**
|
4927
|
+
* Builds a new query object adding one or more constraints. Examples:
|
4928
|
+
*
|
4929
|
+
* ```
|
4930
|
+
* query.filter({ "columnName": columnValue })
|
2823
4931
|
* query.filter({
|
2824
4932
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
2825
4933
|
* })
|
2826
4934
|
* ```
|
2827
4935
|
*
|
4936
|
+
* @param filters A filter object
|
2828
4937
|
* @returns A new Query object.
|
2829
4938
|
*/
|
2830
|
-
filter(filters
|
2831
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
4939
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
2832
4940
|
/**
|
2833
4941
|
* Builds a new query with a new sort option.
|
2834
4942
|
* @param column The column name.
|
2835
4943
|
* @param direction The direction. Either ascending or descending.
|
2836
4944
|
* @returns A new Query object.
|
2837
4945
|
*/
|
2838
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
4946
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
2839
4947
|
/**
|
2840
4948
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
2841
4949
|
* @param columns Array of column names to be returned by the query.
|
2842
4950
|
* @returns A new Query object.
|
2843
4951
|
*/
|
2844
|
-
select<K extends SelectableColumn<Record>>(columns:
|
4952
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
4953
|
+
/**
|
4954
|
+
* Get paginated results
|
4955
|
+
*
|
4956
|
+
* @returns A page of results
|
4957
|
+
*/
|
2845
4958
|
getPaginated(): Promise<Page<Record, Result>>;
|
2846
|
-
|
4959
|
+
/**
|
4960
|
+
* Get paginated results
|
4961
|
+
*
|
4962
|
+
* @param options Pagination options
|
4963
|
+
* @returns A page of results
|
4964
|
+
*/
|
4965
|
+
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
4966
|
+
/**
|
4967
|
+
* Get paginated results
|
4968
|
+
*
|
4969
|
+
* @param options Pagination options
|
4970
|
+
* @returns A page of results
|
4971
|
+
*/
|
2847
4972
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
4973
|
+
/**
|
4974
|
+
* Get results in an iterator
|
4975
|
+
*
|
4976
|
+
* @async
|
4977
|
+
* @returns Async interable of results
|
4978
|
+
*/
|
2848
4979
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
4980
|
+
/**
|
4981
|
+
* Build an iterator of results
|
4982
|
+
*
|
4983
|
+
* @returns Async generator of results array
|
4984
|
+
*/
|
4985
|
+
getIterator(): AsyncGenerator<Result[]>;
|
4986
|
+
/**
|
4987
|
+
* Build an iterator of results
|
4988
|
+
*
|
4989
|
+
* @param options Pagination options with batchSize
|
4990
|
+
* @returns Async generator of results array
|
4991
|
+
*/
|
4992
|
+
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
4993
|
+
batchSize?: number;
|
4994
|
+
}): AsyncGenerator<Result[]>;
|
4995
|
+
/**
|
4996
|
+
* Build an iterator of results
|
4997
|
+
*
|
4998
|
+
* @param options Pagination options with batchSize
|
4999
|
+
* @returns Async generator of results array
|
5000
|
+
*/
|
5001
|
+
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
5002
|
+
batchSize?: number;
|
5003
|
+
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
5004
|
+
/**
|
5005
|
+
* Performs the query in the database and returns a set of results.
|
5006
|
+
* @returns An array of records from the database.
|
5007
|
+
*/
|
5008
|
+
getMany(): Promise<RecordArray<Result>>;
|
5009
|
+
/**
|
5010
|
+
* Performs the query in the database and returns a set of results.
|
5011
|
+
* @param options Additional options to be used when performing the query.
|
5012
|
+
* @returns An array of records from the database.
|
5013
|
+
*/
|
5014
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
2852
5015
|
/**
|
2853
5016
|
* Performs the query in the database and returns a set of results.
|
2854
5017
|
* @param options Additional options to be used when performing the query.
|
2855
|
-
* @returns An array of records from the database.
|
5018
|
+
* @returns An array of records from the database.
|
5019
|
+
*/
|
5020
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
5021
|
+
/**
|
5022
|
+
* Performs the query in the database and returns all the results.
|
5023
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
5024
|
+
* @returns An array of records from the database.
|
5025
|
+
*/
|
5026
|
+
getAll(): Promise<Result[]>;
|
5027
|
+
/**
|
5028
|
+
* Performs the query in the database and returns all the results.
|
5029
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
5030
|
+
* @param options Additional options to be used when performing the query.
|
5031
|
+
* @returns An array of records from the database.
|
5032
|
+
*/
|
5033
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
5034
|
+
batchSize?: number;
|
5035
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
5036
|
+
/**
|
5037
|
+
* Performs the query in the database and returns all the results.
|
5038
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
5039
|
+
* @param options Additional options to be used when performing the query.
|
5040
|
+
* @returns An array of records from the database.
|
5041
|
+
*/
|
5042
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
5043
|
+
batchSize?: number;
|
5044
|
+
}): Promise<Result[]>;
|
5045
|
+
/**
|
5046
|
+
* Performs the query in the database and returns the first result.
|
5047
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5048
|
+
*/
|
5049
|
+
getFirst(): Promise<Result | null>;
|
5050
|
+
/**
|
5051
|
+
* Performs the query in the database and returns the first result.
|
5052
|
+
* @param options Additional options to be used when performing the query.
|
5053
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5054
|
+
*/
|
5055
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
5056
|
+
/**
|
5057
|
+
* Performs the query in the database and returns the first result.
|
5058
|
+
* @param options Additional options to be used when performing the query.
|
5059
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
2856
5060
|
*/
|
2857
|
-
|
2858
|
-
getMany(options: Omit<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
|
2859
|
-
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
5061
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
2860
5062
|
/**
|
2861
|
-
* Performs the query in the database and returns
|
2862
|
-
*
|
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.
|
2863
5070
|
* @param options Additional options to be used when performing the query.
|
2864
|
-
* @returns
|
5071
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
5072
|
+
* @throws if there are no results.
|
2865
5073
|
*/
|
2866
|
-
|
2867
|
-
getAll(chunk: number | undefined, options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result[]>;
|
2868
|
-
getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(chunk: number | undefined, options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
5074
|
+
getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
|
2869
5075
|
/**
|
2870
5076
|
* Performs the query in the database and returns the first result.
|
2871
5077
|
* @param options Additional options to be used when performing the query.
|
2872
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>;
|
5082
|
+
/**
|
5083
|
+
* Builds a new query object adding a cache TTL in milliseconds.
|
5084
|
+
* @param ttl The cache TTL in milliseconds.
|
5085
|
+
* @returns A new Query object.
|
5086
|
+
*/
|
5087
|
+
cache(ttl: number): Query<Record, Result>;
|
5088
|
+
/**
|
5089
|
+
* Retrieve next page of records
|
5090
|
+
*
|
5091
|
+
* @returns A new page object.
|
2873
5092
|
*/
|
2874
|
-
getOne(): Promise<Result | null>;
|
2875
|
-
getOne(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
|
2876
|
-
getOne<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
2877
5093
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
5094
|
+
/**
|
5095
|
+
* Retrieve previous page of records
|
5096
|
+
*
|
5097
|
+
* @returns A new page object
|
5098
|
+
*/
|
2878
5099
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
5100
|
+
/**
|
5101
|
+
* Retrieve first page of records
|
5102
|
+
*
|
5103
|
+
* @returns A new page object
|
5104
|
+
*/
|
2879
5105
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
5106
|
+
/**
|
5107
|
+
* Retrieve last page of records
|
5108
|
+
*
|
5109
|
+
* @returns A new page object
|
5110
|
+
*/
|
2880
5111
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
5112
|
+
/**
|
5113
|
+
* @returns Boolean indicating if there is a next page
|
5114
|
+
*/
|
2881
5115
|
hasNextPage(): boolean;
|
2882
5116
|
}
|
2883
5117
|
|
@@ -2889,7 +5123,7 @@ declare type PaginationQueryMeta = {
|
|
2889
5123
|
};
|
2890
5124
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
2891
5125
|
meta: PaginationQueryMeta;
|
2892
|
-
records: Result
|
5126
|
+
records: RecordArray<Result>;
|
2893
5127
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
2894
5128
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
2895
5129
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
@@ -2909,7 +5143,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
2909
5143
|
/**
|
2910
5144
|
* The set of results for this page.
|
2911
5145
|
*/
|
2912
|
-
readonly records: Result
|
5146
|
+
readonly records: RecordArray<Result>;
|
2913
5147
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
2914
5148
|
/**
|
2915
5149
|
* Retrieves the next page of results.
|
@@ -2957,103 +5191,440 @@ declare type OffsetNavigationOptions = {
|
|
2957
5191
|
size?: number;
|
2958
5192
|
offset?: number;
|
2959
5193
|
};
|
2960
|
-
declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
|
2961
5194
|
declare const PAGINATION_MAX_SIZE = 200;
|
2962
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
5195
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
2963
5196
|
declare const PAGINATION_MAX_OFFSET = 800;
|
2964
5197
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
5198
|
+
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
5199
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
5200
|
+
#private;
|
5201
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
5202
|
+
static parseConstructorParams(...args: any[]): any[];
|
5203
|
+
toArray(): Result[];
|
5204
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
5205
|
+
/**
|
5206
|
+
* Retrieve next page of records
|
5207
|
+
*
|
5208
|
+
* @returns A new array of objects
|
5209
|
+
*/
|
5210
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5211
|
+
/**
|
5212
|
+
* Retrieve previous page of records
|
5213
|
+
*
|
5214
|
+
* @returns A new array of objects
|
5215
|
+
*/
|
5216
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5217
|
+
/**
|
5218
|
+
* Retrieve first page of records
|
5219
|
+
*
|
5220
|
+
* @returns A new array of objects
|
5221
|
+
*/
|
5222
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5223
|
+
/**
|
5224
|
+
* Retrieve last page of records
|
5225
|
+
*
|
5226
|
+
* @returns A new array of objects
|
5227
|
+
*/
|
5228
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5229
|
+
/**
|
5230
|
+
* @returns Boolean indicating if there is a next page
|
5231
|
+
*/
|
5232
|
+
hasNextPage(): boolean;
|
5233
|
+
}
|
2965
5234
|
|
2966
|
-
declare type TableLink = string[];
|
2967
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
2968
5235
|
/**
|
2969
5236
|
* Common interface for performing operations on a table.
|
2970
5237
|
*/
|
2971
|
-
declare abstract class Repository<
|
2972
|
-
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>>>;
|
2973
5249
|
/**
|
2974
5250
|
* Creates a single record in the table with a unique id.
|
2975
5251
|
* @param id The unique id.
|
2976
5252
|
* @param object Object containing the column names with their values to be stored in the table.
|
2977
5253
|
* @returns The full persisted record.
|
2978
5254
|
*/
|
2979
|
-
abstract create(id: string, object: EditableData<
|
5255
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
2980
5256
|
/**
|
2981
5257
|
* Creates multiple records in the table.
|
2982
5258
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
2983
|
-
* @
|
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.
|
2984
5274
|
*/
|
2985
|
-
abstract
|
5275
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
2986
5276
|
/**
|
2987
5277
|
* Queries a single record from the table given its unique id.
|
2988
5278
|
* @param id The unique id.
|
2989
5279
|
* @returns The persisted record for the given id or null if the record could not be found.
|
2990
5280
|
*/
|
2991
5281
|
abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5282
|
+
/**
|
5283
|
+
* Queries multiple records from the table given their unique id.
|
5284
|
+
* @param ids The unique ids array.
|
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).
|
5293
|
+
*/
|
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>>;
|
5302
|
+
/**
|
5303
|
+
* Queries a single record from the table by the id in the object.
|
5304
|
+
* @param object Object containing the id of the record.
|
5305
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
5306
|
+
*/
|
5307
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5308
|
+
/**
|
5309
|
+
* Queries multiple records from the table by the ids in the objects.
|
5310
|
+
* @param objects Array of objects containing the ids of the records.
|
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, ['*']>>>>;
|
2992
5381
|
/**
|
2993
5382
|
* Partially update a single record.
|
2994
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.
|
5428
|
+
*/
|
5429
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5430
|
+
/**
|
5431
|
+
* Partially update a single record.
|
5432
|
+
* @param object An object with its id and the columns to be updated.
|
5433
|
+
* @returns The full persisted record.
|
5434
|
+
* @throws If the record could not be found.
|
5435
|
+
*/
|
5436
|
+
abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5437
|
+
/**
|
5438
|
+
* Partially update a single record given its unique id.
|
5439
|
+
* @param id The unique id.
|
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.
|
2995
5442
|
* @returns The full persisted record.
|
5443
|
+
* @throws If the record could not be found.
|
2996
5444
|
*/
|
2997
|
-
abstract
|
5445
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
2998
5446
|
/**
|
2999
5447
|
* Partially update a single record given its unique id.
|
3000
5448
|
* @param id The unique id.
|
3001
5449
|
* @param object The column names and their values that have to be updated.
|
3002
5450
|
* @returns The full persisted record.
|
5451
|
+
* @throws If the record could not be found.
|
3003
5452
|
*/
|
3004
|
-
abstract
|
5453
|
+
abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3005
5454
|
/**
|
3006
5455
|
* Partially updates multiple records.
|
3007
5456
|
* @param objects An array of objects with their ids and columns to be updated.
|
3008
|
-
* @
|
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.
|
3009
5475
|
*/
|
3010
|
-
abstract
|
5476
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3011
5477
|
/**
|
3012
5478
|
* Creates or updates a single record. If a record exists with the given id,
|
3013
5479
|
* it will be update, otherwise a new record will be created.
|
3014
5480
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3015
5481
|
* @returns The full persisted record.
|
3016
5482
|
*/
|
3017
|
-
abstract createOrUpdate(object: EditableData<
|
5483
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3018
5484
|
/**
|
3019
5485
|
* Creates or updates a single record. If a record exists with the given id,
|
3020
5486
|
* it will be update, otherwise a new record will be created.
|
3021
5487
|
* @param id A unique id.
|
3022
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.
|
3023
5490
|
* @returns The full persisted record.
|
3024
5491
|
*/
|
3025
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
5492
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5493
|
+
/**
|
5494
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5495
|
+
* it will be update, otherwise a new record will be created.
|
5496
|
+
* @param id A unique id.
|
5497
|
+
* @param object The column names and the values to be persisted.
|
5498
|
+
* @returns The full persisted record.
|
5499
|
+
*/
|
5500
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5501
|
+
/**
|
5502
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5503
|
+
* it will be update, otherwise a new record will be created.
|
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.
|
5506
|
+
* @returns Array of the persisted records.
|
5507
|
+
*/
|
5508
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3026
5509
|
/**
|
3027
5510
|
* Creates or updates a single record. If a record exists with the given id,
|
3028
5511
|
* it will be update, otherwise a new record will be created.
|
3029
5512
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3030
5513
|
* @returns Array of the persisted records.
|
3031
5514
|
*/
|
3032
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
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>;
|
3033
5523
|
/**
|
3034
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.
|
3035
5538
|
* @param id The unique id.
|
3036
|
-
* @
|
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).
|
5547
|
+
*/
|
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.
|
3037
5574
|
*/
|
3038
|
-
abstract
|
5575
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3039
5576
|
/**
|
3040
5577
|
* Deletes a record given its unique id.
|
3041
|
-
* @param
|
3042
|
-
* @
|
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.
|
3043
5581
|
*/
|
3044
|
-
abstract
|
5582
|
+
abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3045
5583
|
/**
|
3046
|
-
* Deletes a record given a
|
3047
|
-
* @param
|
3048
|
-
* @
|
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.
|
3049
5611
|
*/
|
3050
|
-
abstract
|
5612
|
+
abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3051
5613
|
/**
|
3052
|
-
* Deletes
|
3053
|
-
* @param
|
3054
|
-
* @
|
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.
|
3055
5619
|
*/
|
3056
|
-
abstract
|
5620
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5621
|
+
/**
|
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.
|
5626
|
+
*/
|
5627
|
+
abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3057
5628
|
/**
|
3058
5629
|
* Search for records in the table.
|
3059
5630
|
* @param query The query to search for.
|
@@ -3061,36 +5632,152 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3061
5632
|
* @returns The found records.
|
3062
5633
|
*/
|
3063
5634
|
abstract search(query: string, options?: {
|
3064
|
-
fuzziness?:
|
3065
|
-
|
5635
|
+
fuzziness?: FuzzinessExpression;
|
5636
|
+
prefix?: PrefixExpression;
|
5637
|
+
highlight?: HighlightExpression;
|
5638
|
+
filter?: Filter<Record>;
|
5639
|
+
boosters?: Boosters<Record>[];
|
5640
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3066
5641
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3067
5642
|
}
|
3068
|
-
declare class RestRepository<
|
5643
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3069
5644
|
#private;
|
3070
|
-
db: SchemaPluginResult<any>;
|
3071
5645
|
constructor(options: {
|
3072
5646
|
table: string;
|
3073
|
-
links?: LinkDictionary;
|
3074
|
-
getFetchProps: () => Promise<FetcherExtraProps>;
|
3075
5647
|
db: SchemaPluginResult<any>;
|
5648
|
+
pluginOptions: XataPluginOptions;
|
5649
|
+
schemaTables?: Table[];
|
3076
5650
|
});
|
3077
|
-
create(object: EditableData<
|
3078
|
-
create(
|
3079
|
-
create(
|
3080
|
-
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
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, ['*']>>>>;
|
3088
5707
|
search(query: string, options?: {
|
3089
|
-
fuzziness?:
|
3090
|
-
|
5708
|
+
fuzziness?: FuzzinessExpression;
|
5709
|
+
prefix?: PrefixExpression;
|
5710
|
+
highlight?: HighlightExpression;
|
5711
|
+
filter?: Filter<Record>;
|
5712
|
+
boosters?: Boosters<Record>[];
|
5713
|
+
}): Promise<any>;
|
3091
5714
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3092
5715
|
}
|
3093
5716
|
|
5717
|
+
declare type BaseSchema = {
|
5718
|
+
name: string;
|
5719
|
+
columns: readonly ({
|
5720
|
+
name: string;
|
5721
|
+
type: Column['type'];
|
5722
|
+
notNull?: boolean;
|
5723
|
+
} | {
|
5724
|
+
name: string;
|
5725
|
+
type: 'link';
|
5726
|
+
link: {
|
5727
|
+
table: string;
|
5728
|
+
};
|
5729
|
+
} | {
|
5730
|
+
name: string;
|
5731
|
+
type: 'object';
|
5732
|
+
columns: {
|
5733
|
+
name: string;
|
5734
|
+
type: string;
|
5735
|
+
}[];
|
5736
|
+
})[];
|
5737
|
+
};
|
5738
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
5739
|
+
name: string;
|
5740
|
+
columns: readonly unknown[];
|
5741
|
+
} ? {
|
5742
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
5743
|
+
} : never : never;
|
5744
|
+
declare type TableType<Tables, TableName> = Tables & {
|
5745
|
+
name: TableName;
|
5746
|
+
} extends infer Table ? Table extends {
|
5747
|
+
name: string;
|
5748
|
+
columns: infer Columns;
|
5749
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
5750
|
+
name: string;
|
5751
|
+
type: string;
|
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 & {
|
5756
|
+
name: PropertyName;
|
5757
|
+
} extends infer Property ? Property extends {
|
5758
|
+
name: string;
|
5759
|
+
type: infer Type;
|
5760
|
+
link?: {
|
5761
|
+
table: infer LinkedTable;
|
5762
|
+
};
|
5763
|
+
columns?: infer ObjectColumns;
|
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 {
|
5771
|
+
name: string;
|
5772
|
+
type: string;
|
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;
|
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>;
|
3094
5781
|
/**
|
3095
5782
|
* Operator to restrict results to only values that are greater than the given value.
|
3096
5783
|
*/
|
@@ -3098,15 +5785,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3098
5785
|
/**
|
3099
5786
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3100
5787
|
*/
|
3101
|
-
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>;
|
3102
5793
|
/**
|
3103
5794
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3104
5795
|
*/
|
3105
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>;
|
3106
5805
|
/**
|
3107
5806
|
* Operator to restrict results to only values that are lower than the given value.
|
3108
5807
|
*/
|
3109
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>;
|
3110
5817
|
/**
|
3111
5818
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3112
5819
|
*/
|
@@ -3139,6 +5846,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3139
5846
|
* Operator to restrict results to only values that are equal to the given value.
|
3140
5847
|
*/
|
3141
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>;
|
3142
5853
|
/**
|
3143
5854
|
* Operator to restrict results to only values that are not equal to the given value.
|
3144
5855
|
*/
|
@@ -3166,45 +5877,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3166
5877
|
|
3167
5878
|
declare type SchemaDefinition = {
|
3168
5879
|
table: string;
|
3169
|
-
links?: LinkDictionary;
|
3170
5880
|
};
|
3171
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
5881
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
3172
5882
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3173
5883
|
};
|
3174
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
3175
|
-
#private;
|
3176
|
-
private links?;
|
3177
|
-
constructor(links?: LinkDictionary | undefined);
|
3178
|
-
build(options: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3179
|
-
}
|
3180
|
-
|
3181
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3182
|
-
fuzziness?: number;
|
3183
|
-
tables?: Tables[];
|
3184
|
-
};
|
3185
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3186
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3187
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
|
3188
|
-
table: Model;
|
3189
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3190
|
-
};
|
3191
|
-
}>[]>;
|
3192
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3193
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3194
|
-
}>;
|
3195
|
-
};
|
3196
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
5884
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3197
5885
|
#private;
|
3198
|
-
|
3199
|
-
|
3200
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
3201
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
5886
|
+
constructor(schemaTables?: Schemas.Table[]);
|
5887
|
+
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3202
5888
|
}
|
3203
|
-
declare type SearchXataRecord = XataRecord & {
|
3204
|
-
xata: {
|
3205
|
-
table: string;
|
3206
|
-
};
|
3207
|
-
};
|
3208
5889
|
|
3209
5890
|
declare type BranchStrategyValue = string | undefined | null;
|
3210
5891
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
@@ -3216,34 +5897,130 @@ declare type BaseClientOptions = {
|
|
3216
5897
|
apiKey?: string;
|
3217
5898
|
databaseURL?: string;
|
3218
5899
|
branch?: BranchStrategyOption;
|
5900
|
+
cache?: CacheImpl;
|
5901
|
+
trace?: TraceFunction;
|
3219
5902
|
};
|
3220
5903
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3221
5904
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3222
|
-
new <Schemas extends Record<string,
|
5905
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
3223
5906
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
3224
5907
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3225
5908
|
}, keyof Plugins> & {
|
3226
5909
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
5910
|
+
} & {
|
5911
|
+
getConfig(): Promise<{
|
5912
|
+
databaseURL: string;
|
5913
|
+
branch: string;
|
5914
|
+
}>;
|
3227
5915
|
};
|
3228
5916
|
}
|
3229
5917
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3230
5918
|
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
3231
5919
|
}
|
3232
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;
|
5926
|
+
}
|
5927
|
+
declare const serialize: <T>(data: T) => string;
|
5928
|
+
declare const deserialize: <T>(json: string) => T;
|
5929
|
+
|
3233
5930
|
declare type BranchResolutionOptions = {
|
3234
5931
|
databaseURL?: string;
|
3235
5932
|
apiKey?: string;
|
3236
5933
|
fetchImpl?: FetchImpl;
|
3237
5934
|
};
|
3238
|
-
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string
|
5935
|
+
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
|
3239
5936
|
declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
|
3240
5937
|
declare function getDatabaseURL(): string | undefined;
|
3241
5938
|
|
3242
5939
|
declare function getAPIKey(): string | undefined;
|
3243
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
|
+
|
3244
6021
|
declare class XataError extends Error {
|
3245
6022
|
readonly status: number;
|
3246
6023
|
constructor(message: string, status: number);
|
3247
6024
|
}
|
3248
6025
|
|
3249
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, 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, 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, LinkDictionary, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, 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, 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, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, 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 };
|