@xata.io/client 0.0.0-alpha.vfb4a018 → 0.0.0-alpha.vfba793c
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 +236 -0
- package/README.md +273 -1
- package/Usage.md +451 -0
- package/dist/index.cjs +1276 -512
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2708 -371
- package/dist/index.mjs +1227 -513
- 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,14 +10,19 @@ declare type FetchImpl = (url: string, init?: {
|
|
5
10
|
}) => Promise<{
|
6
11
|
ok: boolean;
|
7
12
|
status: number;
|
13
|
+
url: string;
|
8
14
|
json(): Promise<any>;
|
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';
|
@@ -20,7 +30,6 @@ declare type ErrorWrapper<TError> = TError | {
|
|
20
30
|
};
|
21
31
|
|
22
32
|
interface CacheImpl {
|
23
|
-
cacheRecords: boolean;
|
24
33
|
defaultQueryTTL: number;
|
25
34
|
getAll(): Promise<Record<string, unknown>>;
|
26
35
|
get: <T>(key: string) => Promise<T | null>;
|
@@ -30,13 +39,11 @@ interface CacheImpl {
|
|
30
39
|
}
|
31
40
|
interface SimpleCacheOptions {
|
32
41
|
max?: number;
|
33
|
-
cacheRecords?: boolean;
|
34
42
|
defaultQueryTTL?: number;
|
35
43
|
}
|
36
44
|
declare class SimpleCache implements CacheImpl {
|
37
45
|
#private;
|
38
46
|
capacity: number;
|
39
|
-
cacheRecords: boolean;
|
40
47
|
defaultQueryTTL: number;
|
41
48
|
constructor(options?: SimpleCacheOptions);
|
42
49
|
getAll(): Promise<Record<string, unknown>>;
|
@@ -52,6 +59,7 @@ declare abstract class XataPlugin {
|
|
52
59
|
declare type XataPluginOptions = {
|
53
60
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
54
61
|
cache: CacheImpl;
|
62
|
+
trace?: TraceFunction;
|
55
63
|
};
|
56
64
|
|
57
65
|
/**
|
@@ -60,6 +68,9 @@ declare type XataPluginOptions = {
|
|
60
68
|
* @version 1.0
|
61
69
|
*/
|
62
70
|
declare type User = {
|
71
|
+
/**
|
72
|
+
* @format email
|
73
|
+
*/
|
63
74
|
email: string;
|
64
75
|
fullname: string;
|
65
76
|
image: string;
|
@@ -91,7 +102,7 @@ declare type WorkspaceID = string;
|
|
91
102
|
declare type Role = 'owner' | 'maintainer';
|
92
103
|
declare type WorkspaceMeta = {
|
93
104
|
name: string;
|
94
|
-
slug
|
105
|
+
slug?: string;
|
95
106
|
};
|
96
107
|
declare type Workspace = WorkspaceMeta & {
|
97
108
|
id: WorkspaceID;
|
@@ -101,6 +112,9 @@ declare type Workspace = WorkspaceMeta & {
|
|
101
112
|
declare type WorkspaceMember = {
|
102
113
|
userId: UserID;
|
103
114
|
fullname: string;
|
115
|
+
/**
|
116
|
+
* @format email
|
117
|
+
*/
|
104
118
|
email: string;
|
105
119
|
role: Role;
|
106
120
|
};
|
@@ -110,7 +124,13 @@ declare type WorkspaceMember = {
|
|
110
124
|
declare type InviteID = string;
|
111
125
|
declare type WorkspaceInvite = {
|
112
126
|
inviteId: InviteID;
|
127
|
+
/**
|
128
|
+
* @format email
|
129
|
+
*/
|
113
130
|
email: string;
|
131
|
+
/**
|
132
|
+
* @format date-time
|
133
|
+
*/
|
114
134
|
expires: string;
|
115
135
|
role: Role;
|
116
136
|
};
|
@@ -122,20 +142,40 @@ declare type WorkspaceMembers = {
|
|
122
142
|
* @pattern ^ik_[a-zA-Z0-9]+
|
123
143
|
*/
|
124
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
|
+
};
|
125
171
|
declare type ListDatabasesResponse = {
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
numberOfBranches: number;
|
131
|
-
ui?: {
|
132
|
-
color?: string;
|
133
|
-
};
|
134
|
-
}[];
|
172
|
+
/**
|
173
|
+
* A list of databases in a Xata workspace
|
174
|
+
*/
|
175
|
+
databases?: DatabaseMetadata[];
|
135
176
|
};
|
136
177
|
declare type ListBranchesResponse = {
|
137
178
|
databaseName: string;
|
138
|
-
displayName: string;
|
139
179
|
branches: Branch[];
|
140
180
|
};
|
141
181
|
declare type ListGitBranchesResponse = {
|
@@ -153,8 +193,14 @@ declare type Branch = {
|
|
153
193
|
* @x-go-type xata.BranchMetadata
|
154
194
|
*/
|
155
195
|
declare type BranchMetadata = {
|
196
|
+
/**
|
197
|
+
* @minLength 1
|
198
|
+
*/
|
156
199
|
repository?: string;
|
157
200
|
branch?: BranchName;
|
201
|
+
/**
|
202
|
+
* @minLength 1
|
203
|
+
*/
|
158
204
|
stage?: string;
|
159
205
|
labels?: string[];
|
160
206
|
};
|
@@ -181,12 +227,28 @@ declare type Schema = {
|
|
181
227
|
tables: Table[];
|
182
228
|
tablesOrder?: string[];
|
183
229
|
};
|
230
|
+
/**
|
231
|
+
* @x-internal true
|
232
|
+
*/
|
233
|
+
declare type SchemaEditScript = {
|
234
|
+
sourceMigrationID?: string;
|
235
|
+
targetMigrationID?: string;
|
236
|
+
tables: TableEdit[];
|
237
|
+
};
|
184
238
|
declare type Table = {
|
185
239
|
id?: string;
|
186
240
|
name: TableName;
|
187
241
|
columns: Column[];
|
188
242
|
revLinks?: RevLink[];
|
189
243
|
};
|
244
|
+
/**
|
245
|
+
* @x-internal true
|
246
|
+
*/
|
247
|
+
declare type TableEdit = {
|
248
|
+
oldName?: string;
|
249
|
+
newName?: string;
|
250
|
+
columns?: MigrationColumnOp[];
|
251
|
+
};
|
190
252
|
/**
|
191
253
|
* @x-go-type xata.Column
|
192
254
|
*/
|
@@ -196,6 +258,8 @@ declare type Column = {
|
|
196
258
|
link?: {
|
197
259
|
table: string;
|
198
260
|
};
|
261
|
+
notNull?: boolean;
|
262
|
+
unique?: boolean;
|
199
263
|
columns?: Column[];
|
200
264
|
};
|
201
265
|
declare type RevLink = {
|
@@ -262,12 +326,175 @@ declare type ColumnMigration = {
|
|
262
326
|
old: Column;
|
263
327
|
['new']: Column;
|
264
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
|
+
};
|
265
460
|
declare type SortExpression = string[] | {
|
266
461
|
[key: string]: SortOrder;
|
267
462
|
} | {
|
268
463
|
[key: string]: SortOrder;
|
269
464
|
}[];
|
270
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
|
+
})[];
|
271
498
|
/**
|
272
499
|
* @minProperties 1
|
273
500
|
*/
|
@@ -281,6 +508,122 @@ declare type FilterExpression = {
|
|
281
508
|
} & {
|
282
509
|
[key: string]: FilterColumn;
|
283
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
|
+
};
|
284
627
|
declare type FilterList = FilterExpression | FilterExpression[];
|
285
628
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
286
629
|
/**
|
@@ -330,14 +673,73 @@ declare type FilterValue = number | string | boolean;
|
|
330
673
|
* Pagination settings.
|
331
674
|
*/
|
332
675
|
declare type PageConfig = {
|
676
|
+
/**
|
677
|
+
* Query the next page that follow the cursor.
|
678
|
+
*/
|
333
679
|
after?: string;
|
680
|
+
/**
|
681
|
+
* Query the previous page before the cursor.
|
682
|
+
*/
|
334
683
|
before?: string;
|
684
|
+
/**
|
685
|
+
* Query the first page from the cursor.
|
686
|
+
*/
|
335
687
|
first?: string;
|
688
|
+
/**
|
689
|
+
* Query the last page from the cursor.
|
690
|
+
*/
|
336
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
|
+
*/
|
337
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
|
+
*/
|
338
703
|
offset?: number;
|
339
704
|
};
|
340
|
-
|
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
|
+
};
|
341
743
|
/**
|
342
744
|
* @pattern [a-zA-Z0-9_-~:]+
|
343
745
|
*/
|
@@ -346,7 +748,13 @@ declare type RecordID = string;
|
|
346
748
|
* @example {"newName":"newName","oldName":"oldName"}
|
347
749
|
*/
|
348
750
|
declare type TableRename = {
|
751
|
+
/**
|
752
|
+
* @minLength 1
|
753
|
+
*/
|
349
754
|
newName: string;
|
755
|
+
/**
|
756
|
+
* @minLength 1
|
757
|
+
*/
|
350
758
|
oldName: string;
|
351
759
|
};
|
352
760
|
/**
|
@@ -354,21 +762,20 @@ declare type TableRename = {
|
|
354
762
|
*/
|
355
763
|
declare type RecordsMetadata = {
|
356
764
|
page: {
|
765
|
+
/**
|
766
|
+
* last record id
|
767
|
+
*/
|
357
768
|
cursor: string;
|
769
|
+
/**
|
770
|
+
* true if more records can be fetch
|
771
|
+
*/
|
358
772
|
more: boolean;
|
359
773
|
};
|
360
774
|
};
|
361
775
|
/**
|
362
|
-
* Xata Table Record
|
776
|
+
* Xata Table Record Metadata
|
363
777
|
*/
|
364
|
-
declare type XataRecord$1 = {
|
365
|
-
id: RecordID;
|
366
|
-
xata: {
|
367
|
-
version: number;
|
368
|
-
table?: string;
|
369
|
-
warnings?: string[];
|
370
|
-
};
|
371
|
-
} & {
|
778
|
+
declare type XataRecord$1 = RecordMeta & {
|
372
779
|
[key: string]: any;
|
373
780
|
};
|
374
781
|
|
@@ -386,6 +793,7 @@ type schemas_InviteID = InviteID;
|
|
386
793
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
387
794
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
388
795
|
type schemas_InviteKey = InviteKey;
|
796
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
389
797
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
390
798
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
391
799
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
@@ -394,7 +802,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
394
802
|
type schemas_DBBranch = DBBranch;
|
395
803
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
396
804
|
type schemas_Schema = Schema;
|
805
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
397
806
|
type schemas_Table = Table;
|
807
|
+
type schemas_TableEdit = TableEdit;
|
398
808
|
type schemas_Column = Column;
|
399
809
|
type schemas_RevLink = RevLink;
|
400
810
|
type schemas_BranchName = BranchName;
|
@@ -407,9 +817,28 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
407
817
|
type schemas_BranchMigration = BranchMigration;
|
408
818
|
type schemas_TableMigration = TableMigration;
|
409
819
|
type schemas_ColumnMigration = ColumnMigration;
|
820
|
+
type schemas_Commit = Commit;
|
821
|
+
type schemas_Migration = Migration;
|
822
|
+
type schemas_MigrationOp = MigrationOp;
|
823
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
824
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
825
|
+
type schemas_TableOpAdd = TableOpAdd;
|
826
|
+
type schemas_TableOpRemove = TableOpRemove;
|
827
|
+
type schemas_TableOpRename = TableOpRename;
|
828
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
829
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
830
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
831
|
+
type schemas_MigrationRequest = MigrationRequest;
|
410
832
|
type schemas_SortExpression = SortExpression;
|
411
833
|
type schemas_SortOrder = SortOrder;
|
834
|
+
type schemas_FuzzinessExpression = FuzzinessExpression;
|
835
|
+
type schemas_PrefixExpression = PrefixExpression;
|
836
|
+
type schemas_TargetExpression = TargetExpression;
|
412
837
|
type schemas_FilterExpression = FilterExpression;
|
838
|
+
type schemas_SummaryExpressionList = SummaryExpressionList;
|
839
|
+
type schemas_SummaryExpression = SummaryExpression;
|
840
|
+
type schemas_HighlightExpression = HighlightExpression;
|
841
|
+
type schemas_BoosterExpression = BoosterExpression;
|
413
842
|
type schemas_FilterList = FilterList;
|
414
843
|
type schemas_FilterColumn = FilterColumn;
|
415
844
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -419,7 +848,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
419
848
|
type schemas_FilterRangeValue = FilterRangeValue;
|
420
849
|
type schemas_FilterValue = FilterValue;
|
421
850
|
type schemas_PageConfig = PageConfig;
|
422
|
-
type
|
851
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
852
|
+
type schemas_RecordMeta = RecordMeta;
|
423
853
|
type schemas_RecordID = RecordID;
|
424
854
|
type schemas_TableRename = TableRename;
|
425
855
|
type schemas_RecordsMetadata = RecordsMetadata;
|
@@ -439,6 +869,7 @@ declare namespace schemas {
|
|
439
869
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
440
870
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
441
871
|
schemas_InviteKey as InviteKey,
|
872
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
442
873
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
443
874
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
444
875
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
@@ -447,7 +878,9 @@ declare namespace schemas {
|
|
447
878
|
schemas_DBBranch as DBBranch,
|
448
879
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
449
880
|
schemas_Schema as Schema,
|
881
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
450
882
|
schemas_Table as Table,
|
883
|
+
schemas_TableEdit as TableEdit,
|
451
884
|
schemas_Column as Column,
|
452
885
|
schemas_RevLink as RevLink,
|
453
886
|
schemas_BranchName as BranchName,
|
@@ -460,9 +893,31 @@ declare namespace schemas {
|
|
460
893
|
schemas_BranchMigration as BranchMigration,
|
461
894
|
schemas_TableMigration as TableMigration,
|
462
895
|
schemas_ColumnMigration as ColumnMigration,
|
896
|
+
schemas_Commit as Commit,
|
897
|
+
schemas_Migration as Migration,
|
898
|
+
schemas_MigrationOp as MigrationOp,
|
899
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
900
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
901
|
+
schemas_TableOpAdd as TableOpAdd,
|
902
|
+
schemas_TableOpRemove as TableOpRemove,
|
903
|
+
schemas_TableOpRename as TableOpRename,
|
904
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
905
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
906
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
907
|
+
schemas_MigrationRequest as MigrationRequest,
|
463
908
|
schemas_SortExpression as SortExpression,
|
464
909
|
schemas_SortOrder as SortOrder,
|
910
|
+
schemas_FuzzinessExpression as FuzzinessExpression,
|
911
|
+
schemas_PrefixExpression as PrefixExpression,
|
912
|
+
schemas_TargetExpression as TargetExpression,
|
465
913
|
schemas_FilterExpression as FilterExpression,
|
914
|
+
schemas_SummaryExpressionList as SummaryExpressionList,
|
915
|
+
schemas_SummaryExpression as SummaryExpression,
|
916
|
+
schemas_HighlightExpression as HighlightExpression,
|
917
|
+
schemas_BoosterExpression as BoosterExpression,
|
918
|
+
ValueBooster$1 as ValueBooster,
|
919
|
+
NumericBooster$1 as NumericBooster,
|
920
|
+
DateBooster$1 as DateBooster,
|
466
921
|
schemas_FilterList as FilterList,
|
467
922
|
schemas_FilterColumn as FilterColumn,
|
468
923
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -472,7 +927,8 @@ declare namespace schemas {
|
|
472
927
|
schemas_FilterRangeValue as FilterRangeValue,
|
473
928
|
schemas_FilterValue as FilterValue,
|
474
929
|
schemas_PageConfig as PageConfig,
|
475
|
-
|
930
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
931
|
+
schemas_RecordMeta as RecordMeta,
|
476
932
|
schemas_RecordID as RecordID,
|
477
933
|
schemas_TableRename as TableRename,
|
478
934
|
schemas_RecordsMetadata as RecordsMetadata,
|
@@ -507,11 +963,22 @@ declare type BulkError = {
|
|
507
963
|
status?: number;
|
508
964
|
}[];
|
509
965
|
};
|
966
|
+
declare type BulkInsertResponse = {
|
967
|
+
recordIDs: string[];
|
968
|
+
} | {
|
969
|
+
records: XataRecord$1[];
|
970
|
+
};
|
510
971
|
declare type BranchMigrationPlan = {
|
511
972
|
version: number;
|
512
973
|
migration: BranchMigration;
|
513
974
|
};
|
514
|
-
declare type
|
975
|
+
declare type RecordResponse = XataRecord$1;
|
976
|
+
declare type SchemaCompareResponse = {
|
977
|
+
source: Schema;
|
978
|
+
target: Schema;
|
979
|
+
edits: SchemaEditScript;
|
980
|
+
};
|
981
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
515
982
|
id: string;
|
516
983
|
xata: {
|
517
984
|
version: number;
|
@@ -521,13 +988,20 @@ declare type QueryResponse = {
|
|
521
988
|
records: XataRecord$1[];
|
522
989
|
meta: RecordsMetadata;
|
523
990
|
};
|
991
|
+
declare type SummarizeResponse = {
|
992
|
+
summary: Record<string, any>[];
|
993
|
+
};
|
524
994
|
declare type SearchResponse = {
|
525
995
|
records: XataRecord$1[];
|
996
|
+
warning?: string;
|
526
997
|
};
|
527
998
|
/**
|
528
999
|
* @example {"migrationID":"mig_c7m19ilcefoebpqj12p0"}
|
529
1000
|
*/
|
530
1001
|
declare type MigrationIdResponse = {
|
1002
|
+
/**
|
1003
|
+
* @minLength 1
|
1004
|
+
*/
|
531
1005
|
migrationID: string;
|
532
1006
|
};
|
533
1007
|
|
@@ -535,9 +1009,13 @@ type responses_SimpleError = SimpleError;
|
|
535
1009
|
type responses_BadRequestError = BadRequestError;
|
536
1010
|
type responses_AuthError = AuthError;
|
537
1011
|
type responses_BulkError = BulkError;
|
1012
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
538
1013
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
1014
|
+
type responses_RecordResponse = RecordResponse;
|
1015
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
539
1016
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
540
1017
|
type responses_QueryResponse = QueryResponse;
|
1018
|
+
type responses_SummarizeResponse = SummarizeResponse;
|
541
1019
|
type responses_SearchResponse = SearchResponse;
|
542
1020
|
type responses_MigrationIdResponse = MigrationIdResponse;
|
543
1021
|
declare namespace responses {
|
@@ -546,9 +1024,13 @@ declare namespace responses {
|
|
546
1024
|
responses_BadRequestError as BadRequestError,
|
547
1025
|
responses_AuthError as AuthError,
|
548
1026
|
responses_BulkError as BulkError,
|
1027
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
549
1028
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
1029
|
+
responses_RecordResponse as RecordResponse,
|
1030
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
550
1031
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
551
1032
|
responses_QueryResponse as QueryResponse,
|
1033
|
+
responses_SummarizeResponse as SummarizeResponse,
|
552
1034
|
responses_SearchResponse as SearchResponse,
|
553
1035
|
responses_MigrationIdResponse as MigrationIdResponse,
|
554
1036
|
};
|
@@ -629,6 +1111,9 @@ declare type GetUserAPIKeysVariables = FetcherExtraProps;
|
|
629
1111
|
*/
|
630
1112
|
declare const getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>;
|
631
1113
|
declare type CreateUserAPIKeyPathParams = {
|
1114
|
+
/**
|
1115
|
+
* API Key name
|
1116
|
+
*/
|
632
1117
|
keyName: APIKeyName;
|
633
1118
|
};
|
634
1119
|
declare type CreateUserAPIKeyError = ErrorWrapper<{
|
@@ -654,6 +1139,9 @@ declare type CreateUserAPIKeyVariables = {
|
|
654
1139
|
*/
|
655
1140
|
declare const createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>;
|
656
1141
|
declare type DeleteUserAPIKeyPathParams = {
|
1142
|
+
/**
|
1143
|
+
* API Key name
|
1144
|
+
*/
|
657
1145
|
keyName: APIKeyName;
|
658
1146
|
};
|
659
1147
|
declare type DeleteUserAPIKeyError = ErrorWrapper<{
|
@@ -714,6 +1202,9 @@ declare type GetWorkspacesListVariables = FetcherExtraProps;
|
|
714
1202
|
*/
|
715
1203
|
declare const getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>;
|
716
1204
|
declare type GetWorkspacePathParams = {
|
1205
|
+
/**
|
1206
|
+
* Workspace name
|
1207
|
+
*/
|
717
1208
|
workspaceId: WorkspaceID;
|
718
1209
|
};
|
719
1210
|
declare type GetWorkspaceError = ErrorWrapper<{
|
@@ -734,6 +1225,9 @@ declare type GetWorkspaceVariables = {
|
|
734
1225
|
*/
|
735
1226
|
declare const getWorkspace: (variables: GetWorkspaceVariables) => Promise<Workspace>;
|
736
1227
|
declare type UpdateWorkspacePathParams = {
|
1228
|
+
/**
|
1229
|
+
* Workspace name
|
1230
|
+
*/
|
737
1231
|
workspaceId: WorkspaceID;
|
738
1232
|
};
|
739
1233
|
declare type UpdateWorkspaceError = ErrorWrapper<{
|
@@ -755,6 +1249,9 @@ declare type UpdateWorkspaceVariables = {
|
|
755
1249
|
*/
|
756
1250
|
declare const updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Workspace>;
|
757
1251
|
declare type DeleteWorkspacePathParams = {
|
1252
|
+
/**
|
1253
|
+
* Workspace name
|
1254
|
+
*/
|
758
1255
|
workspaceId: WorkspaceID;
|
759
1256
|
};
|
760
1257
|
declare type DeleteWorkspaceError = ErrorWrapper<{
|
@@ -775,6 +1272,9 @@ declare type DeleteWorkspaceVariables = {
|
|
775
1272
|
*/
|
776
1273
|
declare const deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>;
|
777
1274
|
declare type GetWorkspaceMembersListPathParams = {
|
1275
|
+
/**
|
1276
|
+
* Workspace name
|
1277
|
+
*/
|
778
1278
|
workspaceId: WorkspaceID;
|
779
1279
|
};
|
780
1280
|
declare type GetWorkspaceMembersListError = ErrorWrapper<{
|
@@ -795,7 +1295,13 @@ declare type GetWorkspaceMembersListVariables = {
|
|
795
1295
|
*/
|
796
1296
|
declare const getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<WorkspaceMembers>;
|
797
1297
|
declare type UpdateWorkspaceMemberRolePathParams = {
|
1298
|
+
/**
|
1299
|
+
* Workspace name
|
1300
|
+
*/
|
798
1301
|
workspaceId: WorkspaceID;
|
1302
|
+
/**
|
1303
|
+
* UserID
|
1304
|
+
*/
|
799
1305
|
userId: UserID;
|
800
1306
|
};
|
801
1307
|
declare type UpdateWorkspaceMemberRoleError = ErrorWrapper<{
|
@@ -820,7 +1326,13 @@ declare type UpdateWorkspaceMemberRoleVariables = {
|
|
820
1326
|
*/
|
821
1327
|
declare const updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
822
1328
|
declare type RemoveWorkspaceMemberPathParams = {
|
1329
|
+
/**
|
1330
|
+
* Workspace name
|
1331
|
+
*/
|
823
1332
|
workspaceId: WorkspaceID;
|
1333
|
+
/**
|
1334
|
+
* UserID
|
1335
|
+
*/
|
824
1336
|
userId: UserID;
|
825
1337
|
};
|
826
1338
|
declare type RemoveWorkspaceMemberError = ErrorWrapper<{
|
@@ -841,7 +1353,10 @@ declare type RemoveWorkspaceMemberVariables = {
|
|
841
1353
|
*/
|
842
1354
|
declare const removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
843
1355
|
declare type InviteWorkspaceMemberPathParams = {
|
844
|
-
|
1356
|
+
/**
|
1357
|
+
* Workspace name
|
1358
|
+
*/
|
1359
|
+
workspaceId: WorkspaceID;
|
845
1360
|
};
|
846
1361
|
declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
847
1362
|
status: 400;
|
@@ -852,8 +1367,14 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
852
1367
|
} | {
|
853
1368
|
status: 404;
|
854
1369
|
payload: SimpleError;
|
1370
|
+
} | {
|
1371
|
+
status: 409;
|
1372
|
+
payload: SimpleError;
|
855
1373
|
}>;
|
856
1374
|
declare type InviteWorkspaceMemberRequestBody = {
|
1375
|
+
/**
|
1376
|
+
* @format email
|
1377
|
+
*/
|
857
1378
|
email: string;
|
858
1379
|
role: Role;
|
859
1380
|
};
|
@@ -865,8 +1386,48 @@ declare type InviteWorkspaceMemberVariables = {
|
|
865
1386
|
* Invite some user to join the workspace with the given role
|
866
1387
|
*/
|
867
1388
|
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
1389
|
+
declare type UpdateWorkspaceMemberInvitePathParams = {
|
1390
|
+
/**
|
1391
|
+
* Workspace name
|
1392
|
+
*/
|
1393
|
+
workspaceId: WorkspaceID;
|
1394
|
+
/**
|
1395
|
+
* Invite identifier
|
1396
|
+
*/
|
1397
|
+
inviteId: InviteID;
|
1398
|
+
};
|
1399
|
+
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
1400
|
+
status: 400;
|
1401
|
+
payload: BadRequestError;
|
1402
|
+
} | {
|
1403
|
+
status: 401;
|
1404
|
+
payload: AuthError;
|
1405
|
+
} | {
|
1406
|
+
status: 404;
|
1407
|
+
payload: SimpleError;
|
1408
|
+
} | {
|
1409
|
+
status: 422;
|
1410
|
+
payload: SimpleError;
|
1411
|
+
}>;
|
1412
|
+
declare type UpdateWorkspaceMemberInviteRequestBody = {
|
1413
|
+
role: Role;
|
1414
|
+
};
|
1415
|
+
declare type UpdateWorkspaceMemberInviteVariables = {
|
1416
|
+
body: UpdateWorkspaceMemberInviteRequestBody;
|
1417
|
+
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
1418
|
+
} & FetcherExtraProps;
|
1419
|
+
/**
|
1420
|
+
* 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.
|
1421
|
+
*/
|
1422
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
868
1423
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
1424
|
+
/**
|
1425
|
+
* Workspace name
|
1426
|
+
*/
|
869
1427
|
workspaceId: WorkspaceID;
|
1428
|
+
/**
|
1429
|
+
* Invite identifier
|
1430
|
+
*/
|
870
1431
|
inviteId: InviteID;
|
871
1432
|
};
|
872
1433
|
declare type CancelWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -887,7 +1448,13 @@ declare type CancelWorkspaceMemberInviteVariables = {
|
|
887
1448
|
*/
|
888
1449
|
declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
889
1450
|
declare type ResendWorkspaceMemberInvitePathParams = {
|
1451
|
+
/**
|
1452
|
+
* Workspace name
|
1453
|
+
*/
|
890
1454
|
workspaceId: WorkspaceID;
|
1455
|
+
/**
|
1456
|
+
* Invite identifier
|
1457
|
+
*/
|
891
1458
|
inviteId: InviteID;
|
892
1459
|
};
|
893
1460
|
declare type ResendWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -908,7 +1475,13 @@ declare type ResendWorkspaceMemberInviteVariables = {
|
|
908
1475
|
*/
|
909
1476
|
declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
910
1477
|
declare type AcceptWorkspaceMemberInvitePathParams = {
|
1478
|
+
/**
|
1479
|
+
* Workspace name
|
1480
|
+
*/
|
911
1481
|
workspaceId: WorkspaceID;
|
1482
|
+
/**
|
1483
|
+
* Invite Key (secret) for the invited user
|
1484
|
+
*/
|
912
1485
|
inviteKey: InviteKey;
|
913
1486
|
};
|
914
1487
|
declare type AcceptWorkspaceMemberInviteError = ErrorWrapper<{
|
@@ -946,6 +1519,9 @@ declare type GetDatabaseListVariables = {
|
|
946
1519
|
*/
|
947
1520
|
declare const getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
948
1521
|
declare type GetBranchListPathParams = {
|
1522
|
+
/**
|
1523
|
+
* The Database Name
|
1524
|
+
*/
|
949
1525
|
dbName: DBName;
|
950
1526
|
workspace: string;
|
951
1527
|
};
|
@@ -967,6 +1543,9 @@ declare type GetBranchListVariables = {
|
|
967
1543
|
*/
|
968
1544
|
declare const getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
969
1545
|
declare type CreateDatabasePathParams = {
|
1546
|
+
/**
|
1547
|
+
* The Database Name
|
1548
|
+
*/
|
970
1549
|
dbName: DBName;
|
971
1550
|
workspace: string;
|
972
1551
|
};
|
@@ -978,11 +1557,16 @@ declare type CreateDatabaseError = ErrorWrapper<{
|
|
978
1557
|
payload: AuthError;
|
979
1558
|
}>;
|
980
1559
|
declare type CreateDatabaseResponse = {
|
1560
|
+
/**
|
1561
|
+
* @minLength 1
|
1562
|
+
*/
|
981
1563
|
databaseName: string;
|
982
1564
|
branchName?: string;
|
983
1565
|
};
|
984
1566
|
declare type CreateDatabaseRequestBody = {
|
985
|
-
|
1567
|
+
/**
|
1568
|
+
* @minLength 1
|
1569
|
+
*/
|
986
1570
|
branchName?: string;
|
987
1571
|
ui?: {
|
988
1572
|
color?: string;
|
@@ -998,6 +1582,9 @@ declare type CreateDatabaseVariables = {
|
|
998
1582
|
*/
|
999
1583
|
declare const createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
1000
1584
|
declare type DeleteDatabasePathParams = {
|
1585
|
+
/**
|
1586
|
+
* The Database Name
|
1587
|
+
*/
|
1001
1588
|
dbName: DBName;
|
1002
1589
|
workspace: string;
|
1003
1590
|
};
|
@@ -1018,7 +1605,67 @@ declare type DeleteDatabaseVariables = {
|
|
1018
1605
|
* Delete a database and all of its branches and tables permanently.
|
1019
1606
|
*/
|
1020
1607
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1608
|
+
declare type GetDatabaseMetadataPathParams = {
|
1609
|
+
/**
|
1610
|
+
* The Database Name
|
1611
|
+
*/
|
1612
|
+
dbName: DBName;
|
1613
|
+
workspace: string;
|
1614
|
+
};
|
1615
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
1616
|
+
status: 400;
|
1617
|
+
payload: BadRequestError;
|
1618
|
+
} | {
|
1619
|
+
status: 401;
|
1620
|
+
payload: AuthError;
|
1621
|
+
} | {
|
1622
|
+
status: 404;
|
1623
|
+
payload: SimpleError;
|
1624
|
+
}>;
|
1625
|
+
declare type GetDatabaseMetadataVariables = {
|
1626
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1627
|
+
} & FetcherExtraProps;
|
1628
|
+
/**
|
1629
|
+
* Retrieve metadata of the given database
|
1630
|
+
*/
|
1631
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1632
|
+
declare type UpdateDatabaseMetadataPathParams = {
|
1633
|
+
/**
|
1634
|
+
* The Database Name
|
1635
|
+
*/
|
1636
|
+
dbName: DBName;
|
1637
|
+
workspace: string;
|
1638
|
+
};
|
1639
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
1640
|
+
status: 400;
|
1641
|
+
payload: BadRequestError;
|
1642
|
+
} | {
|
1643
|
+
status: 401;
|
1644
|
+
payload: AuthError;
|
1645
|
+
} | {
|
1646
|
+
status: 404;
|
1647
|
+
payload: SimpleError;
|
1648
|
+
}>;
|
1649
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
1650
|
+
ui?: {
|
1651
|
+
/**
|
1652
|
+
* @minLength 1
|
1653
|
+
*/
|
1654
|
+
color?: string;
|
1655
|
+
};
|
1656
|
+
};
|
1657
|
+
declare type UpdateDatabaseMetadataVariables = {
|
1658
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
1659
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
1660
|
+
} & FetcherExtraProps;
|
1661
|
+
/**
|
1662
|
+
* Update the color of the selected database
|
1663
|
+
*/
|
1664
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1021
1665
|
declare type GetGitBranchesMappingPathParams = {
|
1666
|
+
/**
|
1667
|
+
* The Database Name
|
1668
|
+
*/
|
1022
1669
|
dbName: DBName;
|
1023
1670
|
workspace: string;
|
1024
1671
|
};
|
@@ -1058,6 +1705,9 @@ declare type GetGitBranchesMappingVariables = {
|
|
1058
1705
|
*/
|
1059
1706
|
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
1060
1707
|
declare type AddGitBranchesEntryPathParams = {
|
1708
|
+
/**
|
1709
|
+
* The Database Name
|
1710
|
+
*/
|
1061
1711
|
dbName: DBName;
|
1062
1712
|
workspace: string;
|
1063
1713
|
};
|
@@ -1069,10 +1719,19 @@ declare type AddGitBranchesEntryError = ErrorWrapper<{
|
|
1069
1719
|
payload: AuthError;
|
1070
1720
|
}>;
|
1071
1721
|
declare type AddGitBranchesEntryResponse = {
|
1722
|
+
/**
|
1723
|
+
* Warning message
|
1724
|
+
*/
|
1072
1725
|
warning?: string;
|
1073
1726
|
};
|
1074
1727
|
declare type AddGitBranchesEntryRequestBody = {
|
1728
|
+
/**
|
1729
|
+
* The name of the Git branch.
|
1730
|
+
*/
|
1075
1731
|
gitBranch: string;
|
1732
|
+
/**
|
1733
|
+
* The name of the Xata branch.
|
1734
|
+
*/
|
1076
1735
|
xataBranch: BranchName;
|
1077
1736
|
};
|
1078
1737
|
declare type AddGitBranchesEntryVariables = {
|
@@ -1096,10 +1755,16 @@ declare type AddGitBranchesEntryVariables = {
|
|
1096
1755
|
*/
|
1097
1756
|
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
1098
1757
|
declare type RemoveGitBranchesEntryPathParams = {
|
1758
|
+
/**
|
1759
|
+
* The Database Name
|
1760
|
+
*/
|
1099
1761
|
dbName: DBName;
|
1100
1762
|
workspace: string;
|
1101
1763
|
};
|
1102
1764
|
declare type RemoveGitBranchesEntryQueryParams = {
|
1765
|
+
/**
|
1766
|
+
* The Git Branch to remove from the mapping
|
1767
|
+
*/
|
1103
1768
|
gitBranch: string;
|
1104
1769
|
};
|
1105
1770
|
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
@@ -1124,11 +1789,20 @@ declare type RemoveGitBranchesEntryVariables = {
|
|
1124
1789
|
*/
|
1125
1790
|
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
1126
1791
|
declare type ResolveBranchPathParams = {
|
1792
|
+
/**
|
1793
|
+
* The Database Name
|
1794
|
+
*/
|
1127
1795
|
dbName: DBName;
|
1128
1796
|
workspace: string;
|
1129
1797
|
};
|
1130
1798
|
declare type ResolveBranchQueryParams = {
|
1799
|
+
/**
|
1800
|
+
* The Git Branch
|
1801
|
+
*/
|
1131
1802
|
gitBranch?: string;
|
1803
|
+
/**
|
1804
|
+
* Default branch to fallback to
|
1805
|
+
*/
|
1132
1806
|
fallbackBranch?: string;
|
1133
1807
|
};
|
1134
1808
|
declare type ResolveBranchError = ErrorWrapper<{
|
@@ -1151,14 +1825,15 @@ declare type ResolveBranchVariables = {
|
|
1151
1825
|
} & FetcherExtraProps;
|
1152
1826
|
/**
|
1153
1827
|
* In order to resolve the database branch, the following algorithm is used:
|
1154
|
-
* * if the `gitBranch` is found in the [git branches mapping](), the associated Xata branch is returned
|
1828
|
+
* * 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
|
1155
1829
|
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
1156
|
-
* * else,
|
1830
|
+
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
1831
|
+
* * else, return the default branch of the DB (`main` or the first branch)
|
1157
1832
|
*
|
1158
1833
|
* Example call:
|
1159
1834
|
*
|
1160
1835
|
* ```json
|
1161
|
-
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test
|
1836
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
1162
1837
|
* ```
|
1163
1838
|
*
|
1164
1839
|
* Example response:
|
@@ -1174,11 +1849,14 @@ declare type ResolveBranchVariables = {
|
|
1174
1849
|
* ```
|
1175
1850
|
*/
|
1176
1851
|
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1177
|
-
declare type
|
1178
|
-
|
1852
|
+
declare type ListMigrationRequestsPathParams = {
|
1853
|
+
/**
|
1854
|
+
* The Database Name
|
1855
|
+
*/
|
1856
|
+
dbName: DBName;
|
1179
1857
|
workspace: string;
|
1180
1858
|
};
|
1181
|
-
declare type
|
1859
|
+
declare type ListMigrationRequestsError = ErrorWrapper<{
|
1182
1860
|
status: 400;
|
1183
1861
|
payload: BadRequestError;
|
1184
1862
|
} | {
|
@@ -1188,18 +1866,29 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
1188
1866
|
status: 404;
|
1189
1867
|
payload: SimpleError;
|
1190
1868
|
}>;
|
1191
|
-
declare type
|
1192
|
-
|
1869
|
+
declare type ListMigrationRequestsResponse = {
|
1870
|
+
migrationRequests: MigrationRequest[];
|
1871
|
+
meta: RecordsMetadata;
|
1872
|
+
};
|
1873
|
+
declare type ListMigrationRequestsRequestBody = {
|
1874
|
+
filter?: FilterExpression;
|
1875
|
+
sort?: SortExpression;
|
1876
|
+
page?: PageConfig;
|
1877
|
+
columns?: ColumnsProjection;
|
1878
|
+
};
|
1879
|
+
declare type ListMigrationRequestsVariables = {
|
1880
|
+
body?: ListMigrationRequestsRequestBody;
|
1881
|
+
pathParams: ListMigrationRequestsPathParams;
|
1193
1882
|
} & FetcherExtraProps;
|
1194
|
-
declare const
|
1195
|
-
declare type
|
1196
|
-
|
1883
|
+
declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
1884
|
+
declare type CreateMigrationRequestPathParams = {
|
1885
|
+
/**
|
1886
|
+
* The Database Name
|
1887
|
+
*/
|
1888
|
+
dbName: DBName;
|
1197
1889
|
workspace: string;
|
1198
1890
|
};
|
1199
|
-
declare type
|
1200
|
-
from?: string;
|
1201
|
-
};
|
1202
|
-
declare type CreateBranchError = ErrorWrapper<{
|
1891
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
1203
1892
|
status: 400;
|
1204
1893
|
payload: BadRequestError;
|
1205
1894
|
} | {
|
@@ -1209,21 +1898,44 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1209
1898
|
status: 404;
|
1210
1899
|
payload: SimpleError;
|
1211
1900
|
}>;
|
1212
|
-
declare type
|
1213
|
-
|
1214
|
-
metadata?: BranchMetadata;
|
1901
|
+
declare type CreateMigrationRequestResponse = {
|
1902
|
+
number: number;
|
1215
1903
|
};
|
1216
|
-
declare type
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1904
|
+
declare type CreateMigrationRequestRequestBody = {
|
1905
|
+
/**
|
1906
|
+
* The source branch.
|
1907
|
+
*/
|
1908
|
+
source: string;
|
1909
|
+
/**
|
1910
|
+
* The target branch.
|
1911
|
+
*/
|
1912
|
+
target: string;
|
1913
|
+
/**
|
1914
|
+
* The title.
|
1915
|
+
*/
|
1916
|
+
title: string;
|
1917
|
+
/**
|
1918
|
+
* Optional migration request description.
|
1919
|
+
*/
|
1920
|
+
body?: string;
|
1921
|
+
};
|
1922
|
+
declare type CreateMigrationRequestVariables = {
|
1923
|
+
body: CreateMigrationRequestRequestBody;
|
1924
|
+
pathParams: CreateMigrationRequestPathParams;
|
1220
1925
|
} & FetcherExtraProps;
|
1221
|
-
declare const
|
1222
|
-
declare type
|
1223
|
-
|
1926
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
1927
|
+
declare type GetMigrationRequestPathParams = {
|
1928
|
+
/**
|
1929
|
+
* The Database Name
|
1930
|
+
*/
|
1931
|
+
dbName: DBName;
|
1932
|
+
/**
|
1933
|
+
* The migration request number.
|
1934
|
+
*/
|
1935
|
+
mrNumber: number;
|
1224
1936
|
workspace: string;
|
1225
1937
|
};
|
1226
|
-
declare type
|
1938
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
1227
1939
|
status: 400;
|
1228
1940
|
payload: BadRequestError;
|
1229
1941
|
} | {
|
@@ -1233,18 +1945,22 @@ declare type DeleteBranchError = ErrorWrapper<{
|
|
1233
1945
|
status: 404;
|
1234
1946
|
payload: SimpleError;
|
1235
1947
|
}>;
|
1236
|
-
declare type
|
1237
|
-
pathParams:
|
1948
|
+
declare type GetMigrationRequestVariables = {
|
1949
|
+
pathParams: GetMigrationRequestPathParams;
|
1238
1950
|
} & FetcherExtraProps;
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1951
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
1952
|
+
declare type UpdateMigrationRequestPathParams = {
|
1953
|
+
/**
|
1954
|
+
* The Database Name
|
1955
|
+
*/
|
1956
|
+
dbName: DBName;
|
1957
|
+
/**
|
1958
|
+
* The migration request number.
|
1959
|
+
*/
|
1960
|
+
mrNumber: number;
|
1245
1961
|
workspace: string;
|
1246
1962
|
};
|
1247
|
-
declare type
|
1963
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
1248
1964
|
status: 400;
|
1249
1965
|
payload: BadRequestError;
|
1250
1966
|
} | {
|
@@ -1254,19 +1970,37 @@ declare type UpdateBranchMetadataError = ErrorWrapper<{
|
|
1254
1970
|
status: 404;
|
1255
1971
|
payload: SimpleError;
|
1256
1972
|
}>;
|
1257
|
-
declare type
|
1258
|
-
|
1259
|
-
|
1973
|
+
declare type UpdateMigrationRequestRequestBody = {
|
1974
|
+
/**
|
1975
|
+
* New migration request title.
|
1976
|
+
*/
|
1977
|
+
title?: string;
|
1978
|
+
/**
|
1979
|
+
* New migration request description.
|
1980
|
+
*/
|
1981
|
+
body?: string;
|
1982
|
+
/**
|
1983
|
+
* Change the migration request status.
|
1984
|
+
*/
|
1985
|
+
status?: 'open' | 'closed';
|
1986
|
+
};
|
1987
|
+
declare type UpdateMigrationRequestVariables = {
|
1988
|
+
body?: UpdateMigrationRequestRequestBody;
|
1989
|
+
pathParams: UpdateMigrationRequestPathParams;
|
1260
1990
|
} & FetcherExtraProps;
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1991
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
1992
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
1993
|
+
/**
|
1994
|
+
* The Database Name
|
1995
|
+
*/
|
1996
|
+
dbName: DBName;
|
1997
|
+
/**
|
1998
|
+
* The migration request number.
|
1999
|
+
*/
|
2000
|
+
mrNumber: number;
|
1267
2001
|
workspace: string;
|
1268
2002
|
};
|
1269
|
-
declare type
|
2003
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
1270
2004
|
status: 400;
|
1271
2005
|
payload: BadRequestError;
|
1272
2006
|
} | {
|
@@ -1276,15 +2010,54 @@ declare type GetBranchMetadataError = ErrorWrapper<{
|
|
1276
2010
|
status: 404;
|
1277
2011
|
payload: SimpleError;
|
1278
2012
|
}>;
|
1279
|
-
declare type
|
1280
|
-
|
2013
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
2014
|
+
meta: {
|
2015
|
+
/**
|
2016
|
+
* last record id
|
2017
|
+
*/
|
2018
|
+
cursor: string;
|
2019
|
+
/**
|
2020
|
+
* true if more records can be fetch
|
2021
|
+
*/
|
2022
|
+
more: boolean;
|
2023
|
+
};
|
2024
|
+
logs: Commit[];
|
2025
|
+
};
|
2026
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
2027
|
+
page?: {
|
2028
|
+
/**
|
2029
|
+
* Query the next page that follow the cursor.
|
2030
|
+
*/
|
2031
|
+
after?: string;
|
2032
|
+
/**
|
2033
|
+
* Query the previous page before the cursor.
|
2034
|
+
*/
|
2035
|
+
before?: string;
|
2036
|
+
/**
|
2037
|
+
* 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.
|
2038
|
+
*
|
2039
|
+
* @default 20
|
2040
|
+
*/
|
2041
|
+
size?: number;
|
2042
|
+
};
|
2043
|
+
};
|
2044
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
2045
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
2046
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
1281
2047
|
} & FetcherExtraProps;
|
1282
|
-
declare const
|
1283
|
-
declare type
|
1284
|
-
|
2048
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
2049
|
+
declare type CompareMigrationRequestPathParams = {
|
2050
|
+
/**
|
2051
|
+
* The Database Name
|
2052
|
+
*/
|
2053
|
+
dbName: DBName;
|
2054
|
+
/**
|
2055
|
+
* The migration request number.
|
2056
|
+
*/
|
2057
|
+
mrNumber: number;
|
1285
2058
|
workspace: string;
|
1286
2059
|
};
|
1287
|
-
declare type
|
2060
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
1288
2061
|
status: 400;
|
1289
2062
|
payload: BadRequestError;
|
1290
2063
|
} | {
|
@@ -1294,24 +2067,22 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
1294
2067
|
status: 404;
|
1295
2068
|
payload: SimpleError;
|
1296
2069
|
}>;
|
1297
|
-
declare type
|
1298
|
-
|
1299
|
-
migrations?: BranchMigration[];
|
1300
|
-
};
|
1301
|
-
declare type GetBranchMigrationHistoryRequestBody = {
|
1302
|
-
limit?: number;
|
1303
|
-
startFrom?: string;
|
1304
|
-
};
|
1305
|
-
declare type GetBranchMigrationHistoryVariables = {
|
1306
|
-
body?: GetBranchMigrationHistoryRequestBody;
|
1307
|
-
pathParams: GetBranchMigrationHistoryPathParams;
|
2070
|
+
declare type CompareMigrationRequestVariables = {
|
2071
|
+
pathParams: CompareMigrationRequestPathParams;
|
1308
2072
|
} & FetcherExtraProps;
|
1309
|
-
declare const
|
1310
|
-
declare type
|
1311
|
-
|
2073
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
2074
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
2075
|
+
/**
|
2076
|
+
* The Database Name
|
2077
|
+
*/
|
2078
|
+
dbName: DBName;
|
2079
|
+
/**
|
2080
|
+
* The migration request number.
|
2081
|
+
*/
|
2082
|
+
mrNumber: number;
|
1312
2083
|
workspace: string;
|
1313
2084
|
};
|
1314
|
-
declare type
|
2085
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
1315
2086
|
status: 400;
|
1316
2087
|
payload: BadRequestError;
|
1317
2088
|
} | {
|
@@ -1321,19 +2092,235 @@ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
|
1321
2092
|
status: 404;
|
1322
2093
|
payload: SimpleError;
|
1323
2094
|
}>;
|
1324
|
-
declare type
|
1325
|
-
|
1326
|
-
migration: BranchMigration;
|
2095
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
2096
|
+
merged?: boolean;
|
1327
2097
|
};
|
1328
|
-
declare type
|
1329
|
-
|
1330
|
-
pathParams: ExecuteBranchMigrationPlanPathParams;
|
2098
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
2099
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
1331
2100
|
} & FetcherExtraProps;
|
1332
|
-
|
1333
|
-
|
2101
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
2102
|
+
declare type MergeMigrationRequestPathParams = {
|
2103
|
+
/**
|
2104
|
+
* The Database Name
|
2105
|
+
*/
|
2106
|
+
dbName: DBName;
|
2107
|
+
/**
|
2108
|
+
* The migration request number.
|
2109
|
+
*/
|
2110
|
+
mrNumber: number;
|
2111
|
+
workspace: string;
|
2112
|
+
};
|
2113
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
2114
|
+
status: 400;
|
2115
|
+
payload: BadRequestError;
|
2116
|
+
} | {
|
2117
|
+
status: 401;
|
2118
|
+
payload: AuthError;
|
2119
|
+
} | {
|
2120
|
+
status: 404;
|
2121
|
+
payload: SimpleError;
|
2122
|
+
}>;
|
2123
|
+
declare type MergeMigrationRequestVariables = {
|
2124
|
+
pathParams: MergeMigrationRequestPathParams;
|
2125
|
+
} & FetcherExtraProps;
|
2126
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
2127
|
+
declare type GetBranchDetailsPathParams = {
|
2128
|
+
/**
|
2129
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2130
|
+
*/
|
2131
|
+
dbBranchName: DBBranchName;
|
2132
|
+
workspace: string;
|
2133
|
+
};
|
2134
|
+
declare type GetBranchDetailsError = ErrorWrapper<{
|
2135
|
+
status: 400;
|
2136
|
+
payload: BadRequestError;
|
2137
|
+
} | {
|
2138
|
+
status: 401;
|
2139
|
+
payload: AuthError;
|
2140
|
+
} | {
|
2141
|
+
status: 404;
|
2142
|
+
payload: SimpleError;
|
2143
|
+
}>;
|
2144
|
+
declare type GetBranchDetailsVariables = {
|
2145
|
+
pathParams: GetBranchDetailsPathParams;
|
2146
|
+
} & FetcherExtraProps;
|
2147
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2148
|
+
declare type CreateBranchPathParams = {
|
2149
|
+
/**
|
2150
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2151
|
+
*/
|
2152
|
+
dbBranchName: DBBranchName;
|
2153
|
+
workspace: string;
|
2154
|
+
};
|
2155
|
+
declare type CreateBranchQueryParams = {
|
2156
|
+
/**
|
2157
|
+
* Name of source branch to branch the new schema from
|
2158
|
+
*/
|
2159
|
+
from?: string;
|
2160
|
+
};
|
2161
|
+
declare type CreateBranchError = ErrorWrapper<{
|
2162
|
+
status: 400;
|
2163
|
+
payload: BadRequestError;
|
2164
|
+
} | {
|
2165
|
+
status: 401;
|
2166
|
+
payload: AuthError;
|
2167
|
+
} | {
|
2168
|
+
status: 404;
|
2169
|
+
payload: SimpleError;
|
2170
|
+
}>;
|
2171
|
+
declare type CreateBranchResponse = {
|
2172
|
+
/**
|
2173
|
+
* @minLength 1
|
2174
|
+
*/
|
2175
|
+
databaseName: string;
|
2176
|
+
branchName: string;
|
2177
|
+
};
|
2178
|
+
declare type CreateBranchRequestBody = {
|
2179
|
+
/**
|
2180
|
+
* Select the branch to fork from. Defaults to 'main'
|
2181
|
+
*/
|
2182
|
+
from?: string;
|
2183
|
+
metadata?: BranchMetadata;
|
2184
|
+
};
|
2185
|
+
declare type CreateBranchVariables = {
|
2186
|
+
body?: CreateBranchRequestBody;
|
2187
|
+
pathParams: CreateBranchPathParams;
|
2188
|
+
queryParams?: CreateBranchQueryParams;
|
2189
|
+
} & FetcherExtraProps;
|
2190
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2191
|
+
declare type DeleteBranchPathParams = {
|
2192
|
+
/**
|
2193
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2194
|
+
*/
|
2195
|
+
dbBranchName: DBBranchName;
|
2196
|
+
workspace: string;
|
2197
|
+
};
|
2198
|
+
declare type DeleteBranchError = ErrorWrapper<{
|
2199
|
+
status: 400;
|
2200
|
+
payload: BadRequestError;
|
2201
|
+
} | {
|
2202
|
+
status: 401;
|
2203
|
+
payload: AuthError;
|
2204
|
+
} | {
|
2205
|
+
status: 404;
|
2206
|
+
payload: SimpleError;
|
2207
|
+
}>;
|
2208
|
+
declare type DeleteBranchVariables = {
|
2209
|
+
pathParams: DeleteBranchPathParams;
|
2210
|
+
} & FetcherExtraProps;
|
2211
|
+
/**
|
2212
|
+
* Delete the branch in the database and all its resources
|
2213
|
+
*/
|
2214
|
+
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2215
|
+
declare type UpdateBranchMetadataPathParams = {
|
2216
|
+
/**
|
2217
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2218
|
+
*/
|
2219
|
+
dbBranchName: DBBranchName;
|
2220
|
+
workspace: string;
|
2221
|
+
};
|
2222
|
+
declare type UpdateBranchMetadataError = ErrorWrapper<{
|
2223
|
+
status: 400;
|
2224
|
+
payload: BadRequestError;
|
2225
|
+
} | {
|
2226
|
+
status: 401;
|
2227
|
+
payload: AuthError;
|
2228
|
+
} | {
|
2229
|
+
status: 404;
|
2230
|
+
payload: SimpleError;
|
2231
|
+
}>;
|
2232
|
+
declare type UpdateBranchMetadataVariables = {
|
2233
|
+
body?: BranchMetadata;
|
2234
|
+
pathParams: UpdateBranchMetadataPathParams;
|
2235
|
+
} & FetcherExtraProps;
|
2236
|
+
/**
|
2237
|
+
* Update the branch metadata
|
2238
|
+
*/
|
2239
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2240
|
+
declare type GetBranchMetadataPathParams = {
|
2241
|
+
/**
|
2242
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2243
|
+
*/
|
2244
|
+
dbBranchName: DBBranchName;
|
2245
|
+
workspace: string;
|
2246
|
+
};
|
2247
|
+
declare type GetBranchMetadataError = ErrorWrapper<{
|
2248
|
+
status: 400;
|
2249
|
+
payload: BadRequestError;
|
2250
|
+
} | {
|
2251
|
+
status: 401;
|
2252
|
+
payload: AuthError;
|
2253
|
+
} | {
|
2254
|
+
status: 404;
|
2255
|
+
payload: SimpleError;
|
2256
|
+
}>;
|
2257
|
+
declare type GetBranchMetadataVariables = {
|
2258
|
+
pathParams: GetBranchMetadataPathParams;
|
2259
|
+
} & FetcherExtraProps;
|
2260
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
2261
|
+
declare type GetBranchMigrationHistoryPathParams = {
|
2262
|
+
/**
|
2263
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2264
|
+
*/
|
2265
|
+
dbBranchName: DBBranchName;
|
2266
|
+
workspace: string;
|
2267
|
+
};
|
2268
|
+
declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
2269
|
+
status: 400;
|
2270
|
+
payload: BadRequestError;
|
2271
|
+
} | {
|
2272
|
+
status: 401;
|
2273
|
+
payload: AuthError;
|
2274
|
+
} | {
|
2275
|
+
status: 404;
|
2276
|
+
payload: SimpleError;
|
2277
|
+
}>;
|
2278
|
+
declare type GetBranchMigrationHistoryResponse = {
|
2279
|
+
startedFrom?: StartedFromMetadata;
|
2280
|
+
migrations?: BranchMigration[];
|
2281
|
+
};
|
2282
|
+
declare type GetBranchMigrationHistoryRequestBody = {
|
2283
|
+
limit?: number;
|
2284
|
+
startFrom?: string;
|
2285
|
+
};
|
2286
|
+
declare type GetBranchMigrationHistoryVariables = {
|
2287
|
+
body?: GetBranchMigrationHistoryRequestBody;
|
2288
|
+
pathParams: GetBranchMigrationHistoryPathParams;
|
2289
|
+
} & FetcherExtraProps;
|
2290
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2291
|
+
declare type ExecuteBranchMigrationPlanPathParams = {
|
2292
|
+
/**
|
2293
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2294
|
+
*/
|
2295
|
+
dbBranchName: DBBranchName;
|
2296
|
+
workspace: string;
|
2297
|
+
};
|
2298
|
+
declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
2299
|
+
status: 400;
|
2300
|
+
payload: BadRequestError;
|
2301
|
+
} | {
|
2302
|
+
status: 401;
|
2303
|
+
payload: AuthError;
|
2304
|
+
} | {
|
2305
|
+
status: 404;
|
2306
|
+
payload: SimpleError;
|
2307
|
+
}>;
|
2308
|
+
declare type ExecuteBranchMigrationPlanRequestBody = {
|
2309
|
+
version: number;
|
2310
|
+
migration: BranchMigration;
|
2311
|
+
};
|
2312
|
+
declare type ExecuteBranchMigrationPlanVariables = {
|
2313
|
+
body: ExecuteBranchMigrationPlanRequestBody;
|
2314
|
+
pathParams: ExecuteBranchMigrationPlanPathParams;
|
2315
|
+
} & FetcherExtraProps;
|
2316
|
+
/**
|
2317
|
+
* Apply a migration plan to the branch
|
1334
2318
|
*/
|
1335
2319
|
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
1336
2320
|
declare type GetBranchMigrationPlanPathParams = {
|
2321
|
+
/**
|
2322
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2323
|
+
*/
|
1337
2324
|
dbBranchName: DBBranchName;
|
1338
2325
|
workspace: string;
|
1339
2326
|
};
|
@@ -1355,7 +2342,199 @@ declare type GetBranchMigrationPlanVariables = {
|
|
1355
2342
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
1356
2343
|
*/
|
1357
2344
|
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2345
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
2346
|
+
/**
|
2347
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2348
|
+
*/
|
2349
|
+
dbBranchName: DBBranchName;
|
2350
|
+
workspace: string;
|
2351
|
+
};
|
2352
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
2353
|
+
status: 400;
|
2354
|
+
payload: BadRequestError;
|
2355
|
+
} | {
|
2356
|
+
status: 401;
|
2357
|
+
payload: AuthError;
|
2358
|
+
} | {
|
2359
|
+
status: 404;
|
2360
|
+
payload: SimpleError;
|
2361
|
+
}>;
|
2362
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
2363
|
+
schema: Schema;
|
2364
|
+
};
|
2365
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
2366
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
2367
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
2368
|
+
} & FetcherExtraProps;
|
2369
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
2370
|
+
declare type CompareBranchSchemasPathParams = {
|
2371
|
+
/**
|
2372
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2373
|
+
*/
|
2374
|
+
dbBranchName: DBBranchName;
|
2375
|
+
/**
|
2376
|
+
* The Database Name
|
2377
|
+
*/
|
2378
|
+
branchName: BranchName;
|
2379
|
+
workspace: string;
|
2380
|
+
};
|
2381
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
2382
|
+
status: 400;
|
2383
|
+
payload: BadRequestError;
|
2384
|
+
} | {
|
2385
|
+
status: 401;
|
2386
|
+
payload: AuthError;
|
2387
|
+
} | {
|
2388
|
+
status: 404;
|
2389
|
+
payload: SimpleError;
|
2390
|
+
}>;
|
2391
|
+
declare type CompareBranchSchemasVariables = {
|
2392
|
+
body?: Record<string, any>;
|
2393
|
+
pathParams: CompareBranchSchemasPathParams;
|
2394
|
+
} & FetcherExtraProps;
|
2395
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
2396
|
+
declare type UpdateBranchSchemaPathParams = {
|
2397
|
+
/**
|
2398
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2399
|
+
*/
|
2400
|
+
dbBranchName: DBBranchName;
|
2401
|
+
workspace: string;
|
2402
|
+
};
|
2403
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
2404
|
+
status: 400;
|
2405
|
+
payload: BadRequestError;
|
2406
|
+
} | {
|
2407
|
+
status: 401;
|
2408
|
+
payload: AuthError;
|
2409
|
+
} | {
|
2410
|
+
status: 404;
|
2411
|
+
payload: SimpleError;
|
2412
|
+
}>;
|
2413
|
+
declare type UpdateBranchSchemaResponse = {
|
2414
|
+
id: string;
|
2415
|
+
parentID: string;
|
2416
|
+
};
|
2417
|
+
declare type UpdateBranchSchemaVariables = {
|
2418
|
+
body: Migration;
|
2419
|
+
pathParams: UpdateBranchSchemaPathParams;
|
2420
|
+
} & FetcherExtraProps;
|
2421
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
2422
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
2423
|
+
/**
|
2424
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2425
|
+
*/
|
2426
|
+
dbBranchName: DBBranchName;
|
2427
|
+
workspace: string;
|
2428
|
+
};
|
2429
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
2430
|
+
status: 400;
|
2431
|
+
payload: BadRequestError;
|
2432
|
+
} | {
|
2433
|
+
status: 401;
|
2434
|
+
payload: AuthError;
|
2435
|
+
} | {
|
2436
|
+
status: 404;
|
2437
|
+
payload: SimpleError;
|
2438
|
+
}>;
|
2439
|
+
declare type PreviewBranchSchemaEditResponse = {
|
2440
|
+
original: Schema;
|
2441
|
+
updated: Schema;
|
2442
|
+
};
|
2443
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
2444
|
+
edits?: SchemaEditScript;
|
2445
|
+
operations?: MigrationOp[];
|
2446
|
+
};
|
2447
|
+
declare type PreviewBranchSchemaEditVariables = {
|
2448
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
2449
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
2450
|
+
} & FetcherExtraProps;
|
2451
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
2452
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
2453
|
+
/**
|
2454
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2455
|
+
*/
|
2456
|
+
dbBranchName: DBBranchName;
|
2457
|
+
workspace: string;
|
2458
|
+
};
|
2459
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
2460
|
+
status: 400;
|
2461
|
+
payload: BadRequestError;
|
2462
|
+
} | {
|
2463
|
+
status: 401;
|
2464
|
+
payload: AuthError;
|
2465
|
+
} | {
|
2466
|
+
status: 404;
|
2467
|
+
payload: SimpleError;
|
2468
|
+
}>;
|
2469
|
+
declare type ApplyBranchSchemaEditResponse = {
|
2470
|
+
id: string;
|
2471
|
+
parentID: string;
|
2472
|
+
};
|
2473
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
2474
|
+
edits: SchemaEditScript;
|
2475
|
+
};
|
2476
|
+
declare type ApplyBranchSchemaEditVariables = {
|
2477
|
+
body: ApplyBranchSchemaEditRequestBody;
|
2478
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
2479
|
+
} & FetcherExtraProps;
|
2480
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
2481
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
2482
|
+
/**
|
2483
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2484
|
+
*/
|
2485
|
+
dbBranchName: DBBranchName;
|
2486
|
+
workspace: string;
|
2487
|
+
};
|
2488
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
2489
|
+
status: 400;
|
2490
|
+
payload: BadRequestError;
|
2491
|
+
} | {
|
2492
|
+
status: 401;
|
2493
|
+
payload: AuthError;
|
2494
|
+
} | {
|
2495
|
+
status: 404;
|
2496
|
+
payload: SimpleError;
|
2497
|
+
}>;
|
2498
|
+
declare type GetBranchSchemaHistoryResponse = {
|
2499
|
+
meta: {
|
2500
|
+
/**
|
2501
|
+
* last record id
|
2502
|
+
*/
|
2503
|
+
cursor: string;
|
2504
|
+
/**
|
2505
|
+
* true if more records can be fetch
|
2506
|
+
*/
|
2507
|
+
more: boolean;
|
2508
|
+
};
|
2509
|
+
logs: Commit[];
|
2510
|
+
};
|
2511
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
2512
|
+
page?: {
|
2513
|
+
/**
|
2514
|
+
* Query the next page that follow the cursor.
|
2515
|
+
*/
|
2516
|
+
after?: string;
|
2517
|
+
/**
|
2518
|
+
* Query the previous page before the cursor.
|
2519
|
+
*/
|
2520
|
+
before?: string;
|
2521
|
+
/**
|
2522
|
+
* 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.
|
2523
|
+
*
|
2524
|
+
* @default 20
|
2525
|
+
*/
|
2526
|
+
size?: number;
|
2527
|
+
};
|
2528
|
+
};
|
2529
|
+
declare type GetBranchSchemaHistoryVariables = {
|
2530
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
2531
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
2532
|
+
} & FetcherExtraProps;
|
2533
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
1358
2534
|
declare type GetBranchStatsPathParams = {
|
2535
|
+
/**
|
2536
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2537
|
+
*/
|
1359
2538
|
dbBranchName: DBBranchName;
|
1360
2539
|
workspace: string;
|
1361
2540
|
};
|
@@ -1388,7 +2567,13 @@ declare type GetBranchStatsVariables = {
|
|
1388
2567
|
*/
|
1389
2568
|
declare const getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
1390
2569
|
declare type CreateTablePathParams = {
|
2570
|
+
/**
|
2571
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2572
|
+
*/
|
1391
2573
|
dbBranchName: DBBranchName;
|
2574
|
+
/**
|
2575
|
+
* The Table name
|
2576
|
+
*/
|
1392
2577
|
tableName: TableName;
|
1393
2578
|
workspace: string;
|
1394
2579
|
};
|
@@ -1405,15 +2590,28 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1405
2590
|
status: 422;
|
1406
2591
|
payload: SimpleError;
|
1407
2592
|
}>;
|
2593
|
+
declare type CreateTableResponse = {
|
2594
|
+
branchName: string;
|
2595
|
+
/**
|
2596
|
+
* @minLength 1
|
2597
|
+
*/
|
2598
|
+
tableName: string;
|
2599
|
+
};
|
1408
2600
|
declare type CreateTableVariables = {
|
1409
2601
|
pathParams: CreateTablePathParams;
|
1410
2602
|
} & FetcherExtraProps;
|
1411
2603
|
/**
|
1412
2604
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1413
2605
|
*/
|
1414
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
2606
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1415
2607
|
declare type DeleteTablePathParams = {
|
2608
|
+
/**
|
2609
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2610
|
+
*/
|
1416
2611
|
dbBranchName: DBBranchName;
|
2612
|
+
/**
|
2613
|
+
* The Table name
|
2614
|
+
*/
|
1417
2615
|
tableName: TableName;
|
1418
2616
|
workspace: string;
|
1419
2617
|
};
|
@@ -1432,7 +2630,13 @@ declare type DeleteTableVariables = {
|
|
1432
2630
|
*/
|
1433
2631
|
declare const deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
1434
2632
|
declare type UpdateTablePathParams = {
|
2633
|
+
/**
|
2634
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2635
|
+
*/
|
1435
2636
|
dbBranchName: DBBranchName;
|
2637
|
+
/**
|
2638
|
+
* The Table name
|
2639
|
+
*/
|
1436
2640
|
tableName: TableName;
|
1437
2641
|
workspace: string;
|
1438
2642
|
};
|
@@ -1447,6 +2651,9 @@ declare type UpdateTableError = ErrorWrapper<{
|
|
1447
2651
|
payload: SimpleError;
|
1448
2652
|
}>;
|
1449
2653
|
declare type UpdateTableRequestBody = {
|
2654
|
+
/**
|
2655
|
+
* @minLength 1
|
2656
|
+
*/
|
1450
2657
|
name: string;
|
1451
2658
|
};
|
1452
2659
|
declare type UpdateTableVariables = {
|
@@ -1458,8 +2665,9 @@ declare type UpdateTableVariables = {
|
|
1458
2665
|
*
|
1459
2666
|
* In the example below, we rename a table from “users” to “people”:
|
1460
2667
|
*
|
1461
|
-
* ```
|
1462
|
-
* PATCH /db/test:main/tables/users
|
2668
|
+
* ```json
|
2669
|
+
* // PATCH /db/test:main/tables/users
|
2670
|
+
*
|
1463
2671
|
* {
|
1464
2672
|
* "name": "people"
|
1465
2673
|
* }
|
@@ -1467,7 +2675,13 @@ declare type UpdateTableVariables = {
|
|
1467
2675
|
*/
|
1468
2676
|
declare const updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
1469
2677
|
declare type GetTableSchemaPathParams = {
|
2678
|
+
/**
|
2679
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2680
|
+
*/
|
1470
2681
|
dbBranchName: DBBranchName;
|
2682
|
+
/**
|
2683
|
+
* The Table name
|
2684
|
+
*/
|
1471
2685
|
tableName: TableName;
|
1472
2686
|
workspace: string;
|
1473
2687
|
};
|
@@ -1489,7 +2703,13 @@ declare type GetTableSchemaVariables = {
|
|
1489
2703
|
} & FetcherExtraProps;
|
1490
2704
|
declare const getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
1491
2705
|
declare type SetTableSchemaPathParams = {
|
2706
|
+
/**
|
2707
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2708
|
+
*/
|
1492
2709
|
dbBranchName: DBBranchName;
|
2710
|
+
/**
|
2711
|
+
* The Table name
|
2712
|
+
*/
|
1493
2713
|
tableName: TableName;
|
1494
2714
|
workspace: string;
|
1495
2715
|
};
|
@@ -1515,7 +2735,13 @@ declare type SetTableSchemaVariables = {
|
|
1515
2735
|
} & FetcherExtraProps;
|
1516
2736
|
declare const setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>;
|
1517
2737
|
declare type GetTableColumnsPathParams = {
|
2738
|
+
/**
|
2739
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2740
|
+
*/
|
1518
2741
|
dbBranchName: DBBranchName;
|
2742
|
+
/**
|
2743
|
+
* The Table name
|
2744
|
+
*/
|
1519
2745
|
tableName: TableName;
|
1520
2746
|
workspace: string;
|
1521
2747
|
};
|
@@ -1541,7 +2767,13 @@ declare type GetTableColumnsVariables = {
|
|
1541
2767
|
*/
|
1542
2768
|
declare const getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>;
|
1543
2769
|
declare type AddTableColumnPathParams = {
|
2770
|
+
/**
|
2771
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2772
|
+
*/
|
1544
2773
|
dbBranchName: DBBranchName;
|
2774
|
+
/**
|
2775
|
+
* The Table name
|
2776
|
+
*/
|
1545
2777
|
tableName: TableName;
|
1546
2778
|
workspace: string;
|
1547
2779
|
};
|
@@ -1566,8 +2798,17 @@ declare type AddTableColumnVariables = {
|
|
1566
2798
|
*/
|
1567
2799
|
declare const addTableColumn: (variables: AddTableColumnVariables) => Promise<MigrationIdResponse>;
|
1568
2800
|
declare type GetColumnPathParams = {
|
2801
|
+
/**
|
2802
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2803
|
+
*/
|
1569
2804
|
dbBranchName: DBBranchName;
|
2805
|
+
/**
|
2806
|
+
* The Table name
|
2807
|
+
*/
|
1570
2808
|
tableName: TableName;
|
2809
|
+
/**
|
2810
|
+
* The Column name
|
2811
|
+
*/
|
1571
2812
|
columnName: ColumnName;
|
1572
2813
|
workspace: string;
|
1573
2814
|
};
|
@@ -1589,8 +2830,17 @@ declare type GetColumnVariables = {
|
|
1589
2830
|
*/
|
1590
2831
|
declare const getColumn: (variables: GetColumnVariables) => Promise<Column>;
|
1591
2832
|
declare type DeleteColumnPathParams = {
|
2833
|
+
/**
|
2834
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2835
|
+
*/
|
1592
2836
|
dbBranchName: DBBranchName;
|
2837
|
+
/**
|
2838
|
+
* The Table name
|
2839
|
+
*/
|
1593
2840
|
tableName: TableName;
|
2841
|
+
/**
|
2842
|
+
* The Column name
|
2843
|
+
*/
|
1594
2844
|
columnName: ColumnName;
|
1595
2845
|
workspace: string;
|
1596
2846
|
};
|
@@ -1612,8 +2862,17 @@ declare type DeleteColumnVariables = {
|
|
1612
2862
|
*/
|
1613
2863
|
declare const deleteColumn: (variables: DeleteColumnVariables) => Promise<MigrationIdResponse>;
|
1614
2864
|
declare type UpdateColumnPathParams = {
|
2865
|
+
/**
|
2866
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2867
|
+
*/
|
1615
2868
|
dbBranchName: DBBranchName;
|
2869
|
+
/**
|
2870
|
+
* The Table name
|
2871
|
+
*/
|
1616
2872
|
tableName: TableName;
|
2873
|
+
/**
|
2874
|
+
* The Column name
|
2875
|
+
*/
|
1617
2876
|
columnName: ColumnName;
|
1618
2877
|
workspace: string;
|
1619
2878
|
};
|
@@ -1628,6 +2887,9 @@ declare type UpdateColumnError = ErrorWrapper<{
|
|
1628
2887
|
payload: SimpleError;
|
1629
2888
|
}>;
|
1630
2889
|
declare type UpdateColumnRequestBody = {
|
2890
|
+
/**
|
2891
|
+
* @minLength 1
|
2892
|
+
*/
|
1631
2893
|
name: string;
|
1632
2894
|
};
|
1633
2895
|
declare type UpdateColumnVariables = {
|
@@ -1639,10 +2901,22 @@ declare type UpdateColumnVariables = {
|
|
1639
2901
|
*/
|
1640
2902
|
declare const updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
1641
2903
|
declare type InsertRecordPathParams = {
|
2904
|
+
/**
|
2905
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2906
|
+
*/
|
1642
2907
|
dbBranchName: DBBranchName;
|
2908
|
+
/**
|
2909
|
+
* The Table name
|
2910
|
+
*/
|
1643
2911
|
tableName: TableName;
|
1644
2912
|
workspace: string;
|
1645
2913
|
};
|
2914
|
+
declare type InsertRecordQueryParams = {
|
2915
|
+
/**
|
2916
|
+
* Column filters
|
2917
|
+
*/
|
2918
|
+
columns?: ColumnsProjection;
|
2919
|
+
};
|
1646
2920
|
declare type InsertRecordError = ErrorWrapper<{
|
1647
2921
|
status: 400;
|
1648
2922
|
payload: BadRequestError;
|
@@ -1653,27 +2927,35 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1653
2927
|
status: 404;
|
1654
2928
|
payload: SimpleError;
|
1655
2929
|
}>;
|
1656
|
-
declare type InsertRecordResponse = {
|
1657
|
-
id: string;
|
1658
|
-
xata: {
|
1659
|
-
version: number;
|
1660
|
-
};
|
1661
|
-
};
|
1662
2930
|
declare type InsertRecordVariables = {
|
1663
2931
|
body?: Record<string, any>;
|
1664
2932
|
pathParams: InsertRecordPathParams;
|
2933
|
+
queryParams?: InsertRecordQueryParams;
|
1665
2934
|
} & FetcherExtraProps;
|
1666
2935
|
/**
|
1667
2936
|
* Insert a new Record into the Table
|
1668
2937
|
*/
|
1669
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
2938
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1670
2939
|
declare type InsertRecordWithIDPathParams = {
|
2940
|
+
/**
|
2941
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2942
|
+
*/
|
1671
2943
|
dbBranchName: DBBranchName;
|
2944
|
+
/**
|
2945
|
+
* The Table name
|
2946
|
+
*/
|
1672
2947
|
tableName: TableName;
|
2948
|
+
/**
|
2949
|
+
* The Record name
|
2950
|
+
*/
|
1673
2951
|
recordId: RecordID;
|
1674
2952
|
workspace: string;
|
1675
2953
|
};
|
1676
2954
|
declare type InsertRecordWithIDQueryParams = {
|
2955
|
+
/**
|
2956
|
+
* Column filters
|
2957
|
+
*/
|
2958
|
+
columns?: ColumnsProjection;
|
1677
2959
|
createOnly?: boolean;
|
1678
2960
|
ifVersion?: number;
|
1679
2961
|
};
|
@@ -1700,12 +2982,25 @@ declare type InsertRecordWithIDVariables = {
|
|
1700
2982
|
*/
|
1701
2983
|
declare const insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1702
2984
|
declare type UpdateRecordWithIDPathParams = {
|
2985
|
+
/**
|
2986
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
2987
|
+
*/
|
1703
2988
|
dbBranchName: DBBranchName;
|
2989
|
+
/**
|
2990
|
+
* The Table name
|
2991
|
+
*/
|
1704
2992
|
tableName: TableName;
|
2993
|
+
/**
|
2994
|
+
* The Record name
|
2995
|
+
*/
|
1705
2996
|
recordId: RecordID;
|
1706
2997
|
workspace: string;
|
1707
2998
|
};
|
1708
2999
|
declare type UpdateRecordWithIDQueryParams = {
|
3000
|
+
/**
|
3001
|
+
* Column filters
|
3002
|
+
*/
|
3003
|
+
columns?: ColumnsProjection;
|
1709
3004
|
ifVersion?: number;
|
1710
3005
|
};
|
1711
3006
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1728,12 +3023,25 @@ declare type UpdateRecordWithIDVariables = {
|
|
1728
3023
|
} & FetcherExtraProps;
|
1729
3024
|
declare const updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1730
3025
|
declare type UpsertRecordWithIDPathParams = {
|
3026
|
+
/**
|
3027
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3028
|
+
*/
|
1731
3029
|
dbBranchName: DBBranchName;
|
3030
|
+
/**
|
3031
|
+
* The Table name
|
3032
|
+
*/
|
1732
3033
|
tableName: TableName;
|
3034
|
+
/**
|
3035
|
+
* The Record name
|
3036
|
+
*/
|
1733
3037
|
recordId: RecordID;
|
1734
3038
|
workspace: string;
|
1735
3039
|
};
|
1736
3040
|
declare type UpsertRecordWithIDQueryParams = {
|
3041
|
+
/**
|
3042
|
+
* Column filters
|
3043
|
+
*/
|
3044
|
+
columns?: ColumnsProjection;
|
1737
3045
|
ifVersion?: number;
|
1738
3046
|
};
|
1739
3047
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1756,11 +3064,26 @@ declare type UpsertRecordWithIDVariables = {
|
|
1756
3064
|
} & FetcherExtraProps;
|
1757
3065
|
declare const upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
1758
3066
|
declare type DeleteRecordPathParams = {
|
3067
|
+
/**
|
3068
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3069
|
+
*/
|
1759
3070
|
dbBranchName: DBBranchName;
|
3071
|
+
/**
|
3072
|
+
* The Table name
|
3073
|
+
*/
|
1760
3074
|
tableName: TableName;
|
3075
|
+
/**
|
3076
|
+
* The Record name
|
3077
|
+
*/
|
1761
3078
|
recordId: RecordID;
|
1762
3079
|
workspace: string;
|
1763
3080
|
};
|
3081
|
+
declare type DeleteRecordQueryParams = {
|
3082
|
+
/**
|
3083
|
+
* Column filters
|
3084
|
+
*/
|
3085
|
+
columns?: ColumnsProjection;
|
3086
|
+
};
|
1764
3087
|
declare type DeleteRecordError = ErrorWrapper<{
|
1765
3088
|
status: 400;
|
1766
3089
|
payload: BadRequestError;
|
@@ -1773,14 +3096,30 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1773
3096
|
}>;
|
1774
3097
|
declare type DeleteRecordVariables = {
|
1775
3098
|
pathParams: DeleteRecordPathParams;
|
3099
|
+
queryParams?: DeleteRecordQueryParams;
|
1776
3100
|
} & FetcherExtraProps;
|
1777
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
3101
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1778
3102
|
declare type GetRecordPathParams = {
|
3103
|
+
/**
|
3104
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3105
|
+
*/
|
1779
3106
|
dbBranchName: DBBranchName;
|
3107
|
+
/**
|
3108
|
+
* The Table name
|
3109
|
+
*/
|
1780
3110
|
tableName: TableName;
|
3111
|
+
/**
|
3112
|
+
* The Record name
|
3113
|
+
*/
|
1781
3114
|
recordId: RecordID;
|
1782
3115
|
workspace: string;
|
1783
3116
|
};
|
3117
|
+
declare type GetRecordQueryParams = {
|
3118
|
+
/**
|
3119
|
+
* Column filters
|
3120
|
+
*/
|
3121
|
+
columns?: ColumnsProjection;
|
3122
|
+
};
|
1784
3123
|
declare type GetRecordError = ErrorWrapper<{
|
1785
3124
|
status: 400;
|
1786
3125
|
payload: BadRequestError;
|
@@ -1791,22 +3130,31 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1791
3130
|
status: 404;
|
1792
3131
|
payload: SimpleError;
|
1793
3132
|
}>;
|
1794
|
-
declare type GetRecordRequestBody = {
|
1795
|
-
columns?: ColumnsFilter;
|
1796
|
-
};
|
1797
3133
|
declare type GetRecordVariables = {
|
1798
|
-
body?: GetRecordRequestBody;
|
1799
3134
|
pathParams: GetRecordPathParams;
|
3135
|
+
queryParams?: GetRecordQueryParams;
|
1800
3136
|
} & FetcherExtraProps;
|
1801
3137
|
/**
|
1802
3138
|
* Retrieve record by ID
|
1803
3139
|
*/
|
1804
3140
|
declare const getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
1805
3141
|
declare type BulkInsertTableRecordsPathParams = {
|
3142
|
+
/**
|
3143
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3144
|
+
*/
|
1806
3145
|
dbBranchName: DBBranchName;
|
3146
|
+
/**
|
3147
|
+
* The Table name
|
3148
|
+
*/
|
1807
3149
|
tableName: TableName;
|
1808
3150
|
workspace: string;
|
1809
3151
|
};
|
3152
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
3153
|
+
/**
|
3154
|
+
* Column filters
|
3155
|
+
*/
|
3156
|
+
columns?: ColumnsProjection;
|
3157
|
+
};
|
1810
3158
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1811
3159
|
status: 400;
|
1812
3160
|
payload: BulkError;
|
@@ -1816,23 +3164,30 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1816
3164
|
} | {
|
1817
3165
|
status: 404;
|
1818
3166
|
payload: SimpleError;
|
3167
|
+
} | {
|
3168
|
+
status: 422;
|
3169
|
+
payload: SimpleError;
|
1819
3170
|
}>;
|
1820
|
-
declare type BulkInsertTableRecordsResponse = {
|
1821
|
-
recordIDs: string[];
|
1822
|
-
};
|
1823
3171
|
declare type BulkInsertTableRecordsRequestBody = {
|
1824
3172
|
records: Record<string, any>[];
|
1825
3173
|
};
|
1826
3174
|
declare type BulkInsertTableRecordsVariables = {
|
1827
3175
|
body: BulkInsertTableRecordsRequestBody;
|
1828
3176
|
pathParams: BulkInsertTableRecordsPathParams;
|
3177
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1829
3178
|
} & FetcherExtraProps;
|
1830
3179
|
/**
|
1831
3180
|
* Bulk insert records
|
1832
3181
|
*/
|
1833
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
3182
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1834
3183
|
declare type QueryTablePathParams = {
|
3184
|
+
/**
|
3185
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3186
|
+
*/
|
1835
3187
|
dbBranchName: DBBranchName;
|
3188
|
+
/**
|
3189
|
+
* The Table name
|
3190
|
+
*/
|
1836
3191
|
tableName: TableName;
|
1837
3192
|
workspace: string;
|
1838
3193
|
};
|
@@ -1850,7 +3205,7 @@ declare type QueryTableRequestBody = {
|
|
1850
3205
|
filter?: FilterExpression;
|
1851
3206
|
sort?: SortExpression;
|
1852
3207
|
page?: PageConfig;
|
1853
|
-
columns?:
|
3208
|
+
columns?: ColumnsProjection;
|
1854
3209
|
};
|
1855
3210
|
declare type QueryTableVariables = {
|
1856
3211
|
body?: QueryTableRequestBody;
|
@@ -1867,7 +3222,7 @@ declare type QueryTableVariables = {
|
|
1867
3222
|
* {
|
1868
3223
|
* "columns": [...],
|
1869
3224
|
* "filter": {
|
1870
|
-
* "$all": [...]
|
3225
|
+
* "$all": [...],
|
1871
3226
|
* "$any": [...]
|
1872
3227
|
* ...
|
1873
3228
|
* },
|
@@ -1886,8 +3241,9 @@ declare type QueryTableVariables = {
|
|
1886
3241
|
* If the `columns` array is not specified, all columns are included. For link
|
1887
3242
|
* fields, only the ID column of the linked records is included in the response.
|
1888
3243
|
*
|
1889
|
-
* If the `columns` array is specified, only the selected
|
1890
|
-
* The `*` wildcard can be used to
|
3244
|
+
* If the `columns` array is specified, only the selected and internal
|
3245
|
+
* columns `id` and `xata` are included. The `*` wildcard can be used to
|
3246
|
+
* select all columns.
|
1891
3247
|
*
|
1892
3248
|
* For objects and link fields, if the column name of the object is specified, we
|
1893
3249
|
* include all of its sub-keys. If only some sub-keys are specified (via dotted
|
@@ -2003,9 +3359,13 @@ declare type QueryTableVariables = {
|
|
2003
3359
|
*
|
2004
3360
|
* ```json
|
2005
3361
|
* {
|
3362
|
+
* "id": "id1"
|
3363
|
+
* "xata": {
|
3364
|
+
* "version": 0
|
3365
|
+
* }
|
2006
3366
|
* "name": "Kilian",
|
2007
3367
|
* "address": {
|
2008
|
-
* "street": "New street"
|
3368
|
+
* "street": "New street"
|
2009
3369
|
* }
|
2010
3370
|
* }
|
2011
3371
|
* ```
|
@@ -2014,10 +3374,7 @@ declare type QueryTableVariables = {
|
|
2014
3374
|
*
|
2015
3375
|
* ```json
|
2016
3376
|
* {
|
2017
|
-
* "columns": [
|
2018
|
-
* "*",
|
2019
|
-
* "team.name"
|
2020
|
-
* ]
|
3377
|
+
* "columns": ["*", "team.name"]
|
2021
3378
|
* }
|
2022
3379
|
* ```
|
2023
3380
|
*
|
@@ -2025,6 +3382,10 @@ declare type QueryTableVariables = {
|
|
2025
3382
|
*
|
2026
3383
|
* ```json
|
2027
3384
|
* {
|
3385
|
+
* "id": "id1"
|
3386
|
+
* "xata": {
|
3387
|
+
* "version": 0
|
3388
|
+
* }
|
2028
3389
|
* "name": "Kilian",
|
2029
3390
|
* "email": "kilian@gmail.com",
|
2030
3391
|
* "address": {
|
@@ -2035,7 +3396,7 @@ declare type QueryTableVariables = {
|
|
2035
3396
|
* "team": {
|
2036
3397
|
* "id": "XX",
|
2037
3398
|
* "xata": {
|
2038
|
-
* "version": 0
|
3399
|
+
* "version": 0
|
2039
3400
|
* },
|
2040
3401
|
* "name": "first team"
|
2041
3402
|
* }
|
@@ -2046,10 +3407,7 @@ declare type QueryTableVariables = {
|
|
2046
3407
|
*
|
2047
3408
|
* ```json
|
2048
3409
|
* {
|
2049
|
-
* "columns": [
|
2050
|
-
* "*",
|
2051
|
-
* "team.*"
|
2052
|
-
* ]
|
3410
|
+
* "columns": ["*", "team.*"]
|
2053
3411
|
* }
|
2054
3412
|
* ```
|
2055
3413
|
*
|
@@ -2057,6 +3415,10 @@ declare type QueryTableVariables = {
|
|
2057
3415
|
*
|
2058
3416
|
* ```json
|
2059
3417
|
* {
|
3418
|
+
* "id": "id1"
|
3419
|
+
* "xata": {
|
3420
|
+
* "version": 0
|
3421
|
+
* }
|
2060
3422
|
* "name": "Kilian",
|
2061
3423
|
* "email": "kilian@gmail.com",
|
2062
3424
|
* "address": {
|
@@ -2067,7 +3429,7 @@ declare type QueryTableVariables = {
|
|
2067
3429
|
* "team": {
|
2068
3430
|
* "id": "XX",
|
2069
3431
|
* "xata": {
|
2070
|
-
* "version": 0
|
3432
|
+
* "version": 0
|
2071
3433
|
* },
|
2072
3434
|
* "name": "first team",
|
2073
3435
|
* "code": "A1",
|
@@ -2117,7 +3479,7 @@ declare type QueryTableVariables = {
|
|
2117
3479
|
* ```json
|
2118
3480
|
* {
|
2119
3481
|
* "filter": {
|
2120
|
-
*
|
3482
|
+
* "name": "r2"
|
2121
3483
|
* }
|
2122
3484
|
* }
|
2123
3485
|
* ```
|
@@ -2139,7 +3501,7 @@ declare type QueryTableVariables = {
|
|
2139
3501
|
* ```json
|
2140
3502
|
* {
|
2141
3503
|
* "filter": {
|
2142
|
-
*
|
3504
|
+
* "settings.plan": "free"
|
2143
3505
|
* }
|
2144
3506
|
* }
|
2145
3507
|
* ```
|
@@ -2149,8 +3511,8 @@ declare type QueryTableVariables = {
|
|
2149
3511
|
* "filter": {
|
2150
3512
|
* "settings": {
|
2151
3513
|
* "plan": "free"
|
2152
|
-
* }
|
2153
|
-
* }
|
3514
|
+
* }
|
3515
|
+
* }
|
2154
3516
|
* }
|
2155
3517
|
* ```
|
2156
3518
|
*
|
@@ -2159,8 +3521,8 @@ declare type QueryTableVariables = {
|
|
2159
3521
|
* ```json
|
2160
3522
|
* {
|
2161
3523
|
* "filter": {
|
2162
|
-
* "settings.plan": {"$any": ["free", "paid"]}
|
2163
|
-
* }
|
3524
|
+
* "settings.plan": { "$any": ["free", "paid"] }
|
3525
|
+
* }
|
2164
3526
|
* }
|
2165
3527
|
* ```
|
2166
3528
|
*
|
@@ -2169,9 +3531,9 @@ declare type QueryTableVariables = {
|
|
2169
3531
|
* ```json
|
2170
3532
|
* {
|
2171
3533
|
* "filter": {
|
2172
|
-
*
|
2173
|
-
*
|
2174
|
-
* }
|
3534
|
+
* "settings.dark": true,
|
3535
|
+
* "settings.plan": "free"
|
3536
|
+
* }
|
2175
3537
|
* }
|
2176
3538
|
* ```
|
2177
3539
|
*
|
@@ -2182,11 +3544,11 @@ declare type QueryTableVariables = {
|
|
2182
3544
|
* ```json
|
2183
3545
|
* {
|
2184
3546
|
* "filter": {
|
2185
|
-
*
|
2186
|
-
*
|
2187
|
-
*
|
2188
|
-
*
|
2189
|
-
* }
|
3547
|
+
* "$any": {
|
3548
|
+
* "settings.dark": true,
|
3549
|
+
* "settings.plan": "free"
|
3550
|
+
* }
|
3551
|
+
* }
|
2190
3552
|
* }
|
2191
3553
|
* ```
|
2192
3554
|
*
|
@@ -2197,10 +3559,10 @@ declare type QueryTableVariables = {
|
|
2197
3559
|
* "filter": {
|
2198
3560
|
* "$any": [
|
2199
3561
|
* {
|
2200
|
-
* "name": "r1"
|
3562
|
+
* "name": "r1"
|
2201
3563
|
* },
|
2202
3564
|
* {
|
2203
|
-
* "name": "r2"
|
3565
|
+
* "name": "r2"
|
2204
3566
|
* }
|
2205
3567
|
* ]
|
2206
3568
|
* }
|
@@ -2212,7 +3574,7 @@ declare type QueryTableVariables = {
|
|
2212
3574
|
* ```json
|
2213
3575
|
* {
|
2214
3576
|
* "filter": {
|
2215
|
-
* "$exists": "settings"
|
3577
|
+
* "$exists": "settings"
|
2216
3578
|
* }
|
2217
3579
|
* }
|
2218
3580
|
* ```
|
@@ -2224,10 +3586,10 @@ declare type QueryTableVariables = {
|
|
2224
3586
|
* "filter": {
|
2225
3587
|
* "$all": [
|
2226
3588
|
* {
|
2227
|
-
* "$exists": "settings"
|
3589
|
+
* "$exists": "settings"
|
2228
3590
|
* },
|
2229
3591
|
* {
|
2230
|
-
* "$exists": "name"
|
3592
|
+
* "$exists": "name"
|
2231
3593
|
* }
|
2232
3594
|
* ]
|
2233
3595
|
* }
|
@@ -2239,7 +3601,7 @@ declare type QueryTableVariables = {
|
|
2239
3601
|
* ```json
|
2240
3602
|
* {
|
2241
3603
|
* "filter": {
|
2242
|
-
* "$notExists": "settings"
|
3604
|
+
* "$notExists": "settings"
|
2243
3605
|
* }
|
2244
3606
|
* }
|
2245
3607
|
* ```
|
@@ -2266,22 +3628,28 @@ declare type QueryTableVariables = {
|
|
2266
3628
|
* {
|
2267
3629
|
* "filter": {
|
2268
3630
|
* "<column_name>": {
|
2269
|
-
*
|
3631
|
+
* "$pattern": "v*alu?"
|
2270
3632
|
* }
|
2271
3633
|
* }
|
2272
3634
|
* }
|
2273
3635
|
* ```
|
2274
3636
|
*
|
3637
|
+
* The `$pattern` operator accepts two wildcard characters:
|
3638
|
+
* * `*` matches zero or more characters
|
3639
|
+
* * `?` matches exactly one character
|
3640
|
+
*
|
3641
|
+
* 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.
|
3642
|
+
*
|
2275
3643
|
* We could also have `$endsWith` and `$startsWith` operators:
|
2276
3644
|
*
|
2277
3645
|
* ```json
|
2278
3646
|
* {
|
2279
3647
|
* "filter": {
|
2280
3648
|
* "<column_name>": {
|
2281
|
-
*
|
3649
|
+
* "$endsWith": ".gz"
|
2282
3650
|
* },
|
2283
3651
|
* "<column_name>": {
|
2284
|
-
*
|
3652
|
+
* "$startsWith": "tmp-"
|
2285
3653
|
* }
|
2286
3654
|
* }
|
2287
3655
|
* }
|
@@ -2292,10 +3660,10 @@ declare type QueryTableVariables = {
|
|
2292
3660
|
* ```json
|
2293
3661
|
* {
|
2294
3662
|
* "filter": {
|
2295
|
-
*
|
2296
|
-
*
|
2297
|
-
*
|
2298
|
-
*
|
3663
|
+
* "<column_name>": {
|
3664
|
+
* "$ge": 0,
|
3665
|
+
* "$lt": 100
|
3666
|
+
* }
|
2299
3667
|
* }
|
2300
3668
|
* }
|
2301
3669
|
* ```
|
@@ -2313,7 +3681,6 @@ declare type QueryTableVariables = {
|
|
2313
3681
|
* ```
|
2314
3682
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
2315
3683
|
*
|
2316
|
-
*
|
2317
3684
|
* #### Negations
|
2318
3685
|
*
|
2319
3686
|
* A general `$not` operator can inverse any operation.
|
@@ -2338,15 +3705,21 @@ declare type QueryTableVariables = {
|
|
2338
3705
|
* {
|
2339
3706
|
* "filter": {
|
2340
3707
|
* "$not": {
|
2341
|
-
* "$any": [
|
2342
|
-
*
|
2343
|
-
*
|
2344
|
-
*
|
2345
|
-
*
|
2346
|
-
*
|
2347
|
-
*
|
2348
|
-
*
|
2349
|
-
*
|
3708
|
+
* "$any": [
|
3709
|
+
* {
|
3710
|
+
* "<column_name1>": "value1"
|
3711
|
+
* },
|
3712
|
+
* {
|
3713
|
+
* "$all": [
|
3714
|
+
* {
|
3715
|
+
* "<column_name2>": "value2"
|
3716
|
+
* },
|
3717
|
+
* {
|
3718
|
+
* "<column_name3>": "value3"
|
3719
|
+
* }
|
3720
|
+
* ]
|
3721
|
+
* }
|
3722
|
+
* ]
|
2350
3723
|
* }
|
2351
3724
|
* }
|
2352
3725
|
* }
|
@@ -2401,8 +3774,8 @@ declare type QueryTableVariables = {
|
|
2401
3774
|
* "<array name>": {
|
2402
3775
|
* "$includes": {
|
2403
3776
|
* "$all": [
|
2404
|
-
* {"$contains": "label"},
|
2405
|
-
* {"$not": {"$endsWith": "-debug"}}
|
3777
|
+
* { "$contains": "label" },
|
3778
|
+
* { "$not": { "$endsWith": "-debug" } }
|
2406
3779
|
* ]
|
2407
3780
|
* }
|
2408
3781
|
* }
|
@@ -2422,9 +3795,7 @@ declare type QueryTableVariables = {
|
|
2422
3795
|
* {
|
2423
3796
|
* "filter": {
|
2424
3797
|
* "settings.labels": {
|
2425
|
-
* "$includesAll": [
|
2426
|
-
* {"$contains": "label"},
|
2427
|
-
* ]
|
3798
|
+
* "$includesAll": [{ "$contains": "label" }]
|
2428
3799
|
* }
|
2429
3800
|
* }
|
2430
3801
|
* }
|
@@ -2472,11 +3843,10 @@ declare type QueryTableVariables = {
|
|
2472
3843
|
* }
|
2473
3844
|
* ```
|
2474
3845
|
*
|
2475
|
-
*
|
2476
3846
|
* ### Pagination
|
2477
3847
|
*
|
2478
|
-
* We offer cursor pagination and offset pagination.
|
2479
|
-
*
|
3848
|
+
* We offer cursor pagination and offset pagination. For queries that are expected to return more than 1000 records,
|
3849
|
+
* cursor pagination is needed in order to retrieve all of their results. The offset pagination method is limited to 1000 records.
|
2480
3850
|
*
|
2481
3851
|
* Example of size + offset pagination:
|
2482
3852
|
*
|
@@ -2538,8 +3908,8 @@ declare type QueryTableVariables = {
|
|
2538
3908
|
* can be queried by update `page.after` to the returned cursor while keeping the
|
2539
3909
|
* `page.before` cursor from the first range query.
|
2540
3910
|
*
|
2541
|
-
* The `filter` , `columns`,
|
2542
|
-
* encoded with the cursor.
|
3911
|
+
* The `filter` , `columns`, `sort` , and `page.size` configuration will be
|
3912
|
+
* encoded with the cursor. The pagination request will be invalid if
|
2543
3913
|
* `filter` or `sort` is set. The columns returned and page size can be changed
|
2544
3914
|
* anytime by passing the `columns` or `page.size` settings to the next query.
|
2545
3915
|
*
|
@@ -2576,7 +3946,57 @@ declare type QueryTableVariables = {
|
|
2576
3946
|
* ```
|
2577
3947
|
*/
|
2578
3948
|
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
3949
|
+
declare type SearchTablePathParams = {
|
3950
|
+
/**
|
3951
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3952
|
+
*/
|
3953
|
+
dbBranchName: DBBranchName;
|
3954
|
+
/**
|
3955
|
+
* The Table name
|
3956
|
+
*/
|
3957
|
+
tableName: TableName;
|
3958
|
+
workspace: string;
|
3959
|
+
};
|
3960
|
+
declare type SearchTableError = ErrorWrapper<{
|
3961
|
+
status: 400;
|
3962
|
+
payload: BadRequestError;
|
3963
|
+
} | {
|
3964
|
+
status: 401;
|
3965
|
+
payload: AuthError;
|
3966
|
+
} | {
|
3967
|
+
status: 404;
|
3968
|
+
payload: SimpleError;
|
3969
|
+
}>;
|
3970
|
+
declare type SearchTableRequestBody = {
|
3971
|
+
/**
|
3972
|
+
* The query string.
|
3973
|
+
*
|
3974
|
+
* @minLength 1
|
3975
|
+
*/
|
3976
|
+
query: string;
|
3977
|
+
fuzziness?: FuzzinessExpression;
|
3978
|
+
target?: TargetExpression;
|
3979
|
+
prefix?: PrefixExpression;
|
3980
|
+
filter?: FilterExpression;
|
3981
|
+
highlight?: HighlightExpression;
|
3982
|
+
boosters?: BoosterExpression[];
|
3983
|
+
};
|
3984
|
+
declare type SearchTableVariables = {
|
3985
|
+
body: SearchTableRequestBody;
|
3986
|
+
pathParams: SearchTablePathParams;
|
3987
|
+
} & FetcherExtraProps;
|
3988
|
+
/**
|
3989
|
+
* Run a free text search operation in a particular table.
|
3990
|
+
*
|
3991
|
+
* 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:
|
3992
|
+
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
3993
|
+
* * filtering on columns of type `multiple` is currently unsupported
|
3994
|
+
*/
|
3995
|
+
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2579
3996
|
declare type SearchBranchPathParams = {
|
3997
|
+
/**
|
3998
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
3999
|
+
*/
|
2580
4000
|
dbBranchName: DBBranchName;
|
2581
4001
|
workspace: string;
|
2582
4002
|
};
|
@@ -2591,9 +4011,27 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
2591
4011
|
payload: SimpleError;
|
2592
4012
|
}>;
|
2593
4013
|
declare type SearchBranchRequestBody = {
|
2594
|
-
|
4014
|
+
/**
|
4015
|
+
* 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.
|
4016
|
+
*/
|
4017
|
+
tables?: (string | {
|
4018
|
+
/**
|
4019
|
+
* The name of the table.
|
4020
|
+
*/
|
4021
|
+
table: string;
|
4022
|
+
filter?: FilterExpression;
|
4023
|
+
target?: TargetExpression;
|
4024
|
+
boosters?: BoosterExpression[];
|
4025
|
+
})[];
|
4026
|
+
/**
|
4027
|
+
* The query string.
|
4028
|
+
*
|
4029
|
+
* @minLength 1
|
4030
|
+
*/
|
2595
4031
|
query: string;
|
2596
|
-
fuzziness?:
|
4032
|
+
fuzziness?: FuzzinessExpression;
|
4033
|
+
prefix?: PrefixExpression;
|
4034
|
+
highlight?: HighlightExpression;
|
2597
4035
|
};
|
2598
4036
|
declare type SearchBranchVariables = {
|
2599
4037
|
body: SearchBranchRequestBody;
|
@@ -2603,6 +4041,77 @@ declare type SearchBranchVariables = {
|
|
2603
4041
|
* Run a free text search operation across the database branch.
|
2604
4042
|
*/
|
2605
4043
|
declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
4044
|
+
declare type SummarizeTablePathParams = {
|
4045
|
+
/**
|
4046
|
+
* The DBBranchName matches the pattern `{db_name}:{branch_name}`.
|
4047
|
+
*/
|
4048
|
+
dbBranchName: DBBranchName;
|
4049
|
+
/**
|
4050
|
+
* The Table name
|
4051
|
+
*/
|
4052
|
+
tableName: TableName;
|
4053
|
+
workspace: string;
|
4054
|
+
};
|
4055
|
+
declare type SummarizeTableError = ErrorWrapper<{
|
4056
|
+
status: 400;
|
4057
|
+
payload: BadRequestError;
|
4058
|
+
} | {
|
4059
|
+
status: 401;
|
4060
|
+
payload: AuthError;
|
4061
|
+
} | {
|
4062
|
+
status: 404;
|
4063
|
+
payload: SimpleError;
|
4064
|
+
}>;
|
4065
|
+
declare type SummarizeTableRequestBody = {
|
4066
|
+
columns?: ColumnsProjection;
|
4067
|
+
summaries?: SummaryExpressionList;
|
4068
|
+
sort?: SortExpression;
|
4069
|
+
};
|
4070
|
+
declare type SummarizeTableVariables = {
|
4071
|
+
body?: SummarizeTableRequestBody;
|
4072
|
+
pathParams: SummarizeTablePathParams;
|
4073
|
+
} & FetcherExtraProps;
|
4074
|
+
/**
|
4075
|
+
* This endpoint allows you to (optionally) define groups, and then to run
|
4076
|
+
* calculations on the values in each group. This is most helpful when you'd
|
4077
|
+
* like to understand the data you have in your database.
|
4078
|
+
*
|
4079
|
+
* A group is a combination of unique values. If you create a group for `sold_by`,
|
4080
|
+
* `product_name`, we will return one row for every combination of `sold_by` and
|
4081
|
+
* `product_name` you have in your database. When you want to calculate statistics,
|
4082
|
+
* you define these groups and ask Xata to calculate data on each group.
|
4083
|
+
*
|
4084
|
+
* **Some questions you can ask of your data:**
|
4085
|
+
*
|
4086
|
+
* How many records do I have in this table?
|
4087
|
+
* - Set `columns: []` as we we want data from the entire table, so we ask for no groups.
|
4088
|
+
* - Set `summaries: {"total": {"count": "*"}}` in order to see the count of all records.
|
4089
|
+
* We use `count: *` here we'd like to know the total amount of rows; ignoring whether
|
4090
|
+
* they are `null` or not.
|
4091
|
+
*
|
4092
|
+
* What are the top total sales for each product?
|
4093
|
+
* - Set `columns: [product_name]` as we'd like to run calculations on each unique product
|
4094
|
+
* name in our table. Setting `columns` like this will produce one row per unique product
|
4095
|
+
* name.
|
4096
|
+
* - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd like to create a
|
4097
|
+
* field called "total_sales" for each group. This field will count all rows in each group
|
4098
|
+
* with non-null product names.
|
4099
|
+
* - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with the highest
|
4100
|
+
* total_sales field to the top.
|
4101
|
+
*
|
4102
|
+
* `columns`: tells Xata how to create each group. If you add `product_id` we will create
|
4103
|
+
* a new group for every unique `product_id`.
|
4104
|
+
*
|
4105
|
+
* `summaries`: tells Xata which calculations to run on each group.
|
4106
|
+
*
|
4107
|
+
* `sort`: tells Xata in which order you'd like to see results. You may sort by fields
|
4108
|
+
* specified in `columns` as well as the summary names defined in `summaries`.
|
4109
|
+
*
|
4110
|
+
* note: Sorting on summarized values can be slower on very large tables; this will impact
|
4111
|
+
* your rate limit significantly more than other queries. Try use `filter` [coming soon] to
|
4112
|
+
* reduce the amount of data being processed in order to reduce impact on your limits.
|
4113
|
+
*/
|
4114
|
+
declare const summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
|
2606
4115
|
declare const operationsByTag: {
|
2607
4116
|
users: {
|
2608
4117
|
getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
@@ -2622,6 +4131,7 @@ declare const operationsByTag: {
|
|
2622
4131
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
2623
4132
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
2624
4133
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
4134
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
2625
4135
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2626
4136
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2627
4137
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
@@ -2630,6 +4140,8 @@ declare const operationsByTag: {
|
|
2630
4140
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2631
4141
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2632
4142
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
4143
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
4144
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
2633
4145
|
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
2634
4146
|
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
2635
4147
|
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
@@ -2638,17 +4150,35 @@ declare const operationsByTag: {
|
|
2638
4150
|
branch: {
|
2639
4151
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2640
4152
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2641
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
4153
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2642
4154
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2643
4155
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2644
4156
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
4157
|
+
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
4158
|
+
};
|
4159
|
+
migrationRequests: {
|
4160
|
+
listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
4161
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
4162
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
4163
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
4164
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
4165
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
4166
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
4167
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
4168
|
+
};
|
4169
|
+
branchSchema: {
|
2645
4170
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2646
4171
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
2647
4172
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2648
|
-
|
4173
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
4174
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
4175
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
4176
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
4177
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
4178
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
2649
4179
|
};
|
2650
4180
|
table: {
|
2651
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
4181
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2652
4182
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2653
4183
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2654
4184
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2660,15 +4190,17 @@ declare const operationsByTag: {
|
|
2660
4190
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2661
4191
|
};
|
2662
4192
|
records: {
|
2663
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
4193
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2664
4194
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2665
4195
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2666
4196
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2667
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
4197
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2668
4198
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2669
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
4199
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2670
4200
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
4201
|
+
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2671
4202
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
4203
|
+
summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
|
2672
4204
|
};
|
2673
4205
|
};
|
2674
4206
|
|
@@ -2683,10 +4215,8 @@ interface XataApiClientOptions {
|
|
2683
4215
|
fetch?: FetchImpl;
|
2684
4216
|
apiKey?: string;
|
2685
4217
|
host?: HostProvider;
|
4218
|
+
trace?: TraceFunction;
|
2686
4219
|
}
|
2687
|
-
/**
|
2688
|
-
* @deprecated Use XataApiPlugin instead
|
2689
|
-
*/
|
2690
4220
|
declare class XataApiClient {
|
2691
4221
|
#private;
|
2692
4222
|
constructor(options?: XataApiClientOptions);
|
@@ -2696,6 +4226,8 @@ declare class XataApiClient {
|
|
2696
4226
|
get branches(): BranchApi;
|
2697
4227
|
get tables(): TableApi;
|
2698
4228
|
get records(): RecordsApi;
|
4229
|
+
get migrationRequests(): MigrationRequestsApi;
|
4230
|
+
get branchSchema(): BranchSchemaApi;
|
2699
4231
|
}
|
2700
4232
|
declare class UserApi {
|
2701
4233
|
private extraProps;
|
@@ -2719,6 +4251,7 @@ declare class WorkspaceApi {
|
|
2719
4251
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
2720
4252
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
2721
4253
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
4254
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
2722
4255
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2723
4256
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2724
4257
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
@@ -2729,29 +4262,28 @@ declare class DatabaseApi {
|
|
2729
4262
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2730
4263
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2731
4264
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
4265
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
4266
|
+
updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
2732
4267
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2733
4268
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2734
4269
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
2735
|
-
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch
|
4270
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
2736
4271
|
}
|
2737
4272
|
declare class BranchApi {
|
2738
4273
|
private extraProps;
|
2739
4274
|
constructor(extraProps: FetcherExtraProps);
|
2740
4275
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2741
4276
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2742
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
4277
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
2743
4278
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2744
4279
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2745
4280
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2746
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
2747
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
2748
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
2749
4281
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2750
4282
|
}
|
2751
4283
|
declare class TableApi {
|
2752
4284
|
private extraProps;
|
2753
4285
|
constructor(extraProps: FetcherExtraProps);
|
2754
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
4286
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2755
4287
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2756
4288
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2757
4289
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2765,15 +4297,42 @@ declare class TableApi {
|
|
2765
4297
|
declare class RecordsApi {
|
2766
4298
|
private extraProps;
|
2767
4299
|
constructor(extraProps: FetcherExtraProps);
|
2768
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
4300
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
2769
4301
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2770
4302
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2771
4303
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2772
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2773
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2774
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
4304
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
4305
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
4306
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
2775
4307
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
4308
|
+
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2776
4309
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
4310
|
+
summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
|
4311
|
+
}
|
4312
|
+
declare class MigrationRequestsApi {
|
4313
|
+
private extraProps;
|
4314
|
+
constructor(extraProps: FetcherExtraProps);
|
4315
|
+
listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
|
4316
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
4317
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
4318
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
4319
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
4320
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
4321
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
4322
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
4323
|
+
}
|
4324
|
+
declare class BranchSchemaApi {
|
4325
|
+
private extraProps;
|
4326
|
+
constructor(extraProps: FetcherExtraProps);
|
4327
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
4328
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
4329
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
4330
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
4331
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
4332
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
4333
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
4334
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
4335
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
2777
4336
|
}
|
2778
4337
|
|
2779
4338
|
declare class XataApiPlugin implements XataPlugin {
|
@@ -2786,28 +4345,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2786
4345
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2787
4346
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2788
4347
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2789
|
-
declare type NonEmptyArray<T> = T[] & {
|
2790
|
-
0: T;
|
2791
|
-
};
|
2792
4348
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2793
4349
|
[P in K]-?: NonNullable<T[P]>;
|
2794
4350
|
};
|
2795
4351
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2796
4352
|
declare type SingleOrArray<T> = T | T[];
|
2797
|
-
declare type
|
4353
|
+
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
4354
|
+
declare type Without<T, U> = {
|
4355
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
4356
|
+
};
|
4357
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
2798
4358
|
|
2799
4359
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2800
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2801
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
4360
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
4361
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2802
4362
|
}>>;
|
2803
|
-
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
|
2804
|
-
V: ValueAtColumn<
|
2805
|
-
} : never
|
4363
|
+
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> ? {
|
4364
|
+
V: ValueAtColumn<Item, V>;
|
4365
|
+
} : never : O[K] : never> : never : never;
|
2806
4366
|
declare type MAX_RECURSION = 5;
|
2807
4367
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
2808
|
-
[K in DataProps<O>]:
|
2809
|
-
If<IsObject<
|
2810
|
-
K
|
4368
|
+
[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
|
4369
|
+
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
|
4370
|
+
K>> : never;
|
2811
4371
|
}>, never>;
|
2812
4372
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
2813
4373
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
@@ -2834,56 +4394,67 @@ interface BaseData {
|
|
2834
4394
|
/**
|
2835
4395
|
* Represents a persisted record from the database.
|
2836
4396
|
*/
|
2837
|
-
interface XataRecord extends Identifiable {
|
4397
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2838
4398
|
/**
|
2839
|
-
*
|
4399
|
+
* Get metadata of this record.
|
2840
4400
|
*/
|
2841
|
-
|
2842
|
-
/**
|
2843
|
-
* Number that is increased every time the record is updated.
|
2844
|
-
*/
|
2845
|
-
version: number;
|
2846
|
-
};
|
4401
|
+
getMetadata(): XataRecordMetadata;
|
2847
4402
|
/**
|
2848
4403
|
* Retrieves a refreshed copy of the current record from the database.
|
4404
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4405
|
+
* @returns The persisted record with the selected columns, null if not found.
|
4406
|
+
*/
|
4407
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
4408
|
+
/**
|
4409
|
+
* Retrieves a refreshed copy of the current record from the database.
|
4410
|
+
* @returns The persisted record with all first level properties, null if not found.
|
4411
|
+
*/
|
4412
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
4413
|
+
/**
|
4414
|
+
* Performs a partial update of the current record. On success a new object is
|
4415
|
+
* returned and the current object is not mutated.
|
4416
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
4417
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4418
|
+
* @returns The persisted record with the selected columns, null if not found.
|
2849
4419
|
*/
|
2850
|
-
|
4420
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2851
4421
|
/**
|
2852
4422
|
* Performs a partial update of the current record. On success a new object is
|
2853
4423
|
* returned and the current object is not mutated.
|
2854
|
-
* @param
|
2855
|
-
* @returns
|
4424
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
4425
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2856
4426
|
*/
|
2857
|
-
update(partialUpdate: Partial<EditableData<
|
4427
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2858
4428
|
/**
|
2859
4429
|
* Performs a deletion of the current record in the database.
|
2860
|
-
*
|
2861
|
-
* @
|
4430
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
4431
|
+
* @returns The deleted record, null if not found.
|
2862
4432
|
*/
|
2863
|
-
delete(): Promise<
|
2864
|
-
}
|
2865
|
-
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
4433
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2866
4434
|
/**
|
2867
|
-
*
|
4435
|
+
* Performs a deletion of the current record in the database.
|
4436
|
+
* @returns The deleted record, null if not found.
|
4437
|
+
|
2868
4438
|
*/
|
2869
|
-
|
4439
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
4440
|
+
}
|
4441
|
+
declare type Link<Record extends XataRecord> = XataRecord<Record>;
|
4442
|
+
declare type XataRecordMetadata = {
|
2870
4443
|
/**
|
2871
|
-
*
|
2872
|
-
* returned and the current object is not mutated.
|
2873
|
-
* @param data The columns and their values that have to be updated.
|
2874
|
-
* @returns A new record containing the latest values for all the columns of the current record.
|
4444
|
+
* Number that is increased every time the record is updated.
|
2875
4445
|
*/
|
2876
|
-
|
4446
|
+
version: number;
|
4447
|
+
warnings?: string[];
|
2877
4448
|
};
|
2878
4449
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2879
4450
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2880
|
-
declare type EditableData<O extends
|
4451
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
2881
4452
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2882
4453
|
id: string;
|
2883
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
4454
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2884
4455
|
id: string;
|
2885
|
-
} | null | undefined : O[K];
|
2886
|
-
}
|
4456
|
+
} | string | null | undefined : O[K];
|
4457
|
+
}, keyof XataRecord>;
|
2887
4458
|
|
2888
4459
|
/**
|
2889
4460
|
* PropertyMatchFilter
|
@@ -2958,8 +4529,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
2958
4529
|
],
|
2959
4530
|
}
|
2960
4531
|
*/
|
2961
|
-
declare type AggregatorFilter<
|
2962
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
4532
|
+
declare type AggregatorFilter<T> = {
|
4533
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
2963
4534
|
};
|
2964
4535
|
/**
|
2965
4536
|
* Existance filter
|
@@ -2974,10 +4545,104 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
2974
4545
|
* Injects the Api filters on nested properties
|
2975
4546
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
2976
4547
|
*/
|
2977
|
-
declare type NestedApiFilter<T> =
|
4548
|
+
declare type NestedApiFilter<T> = {
|
2978
4549
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
2979
|
-
}
|
2980
|
-
declare type Filter<
|
4550
|
+
};
|
4551
|
+
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>;
|
4552
|
+
|
4553
|
+
declare type DateBooster = {
|
4554
|
+
origin?: string;
|
4555
|
+
scale: string;
|
4556
|
+
decay: number;
|
4557
|
+
};
|
4558
|
+
declare type NumericBooster = {
|
4559
|
+
factor: number;
|
4560
|
+
};
|
4561
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
4562
|
+
value: T;
|
4563
|
+
factor: number;
|
4564
|
+
};
|
4565
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
4566
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
4567
|
+
dateBooster: {
|
4568
|
+
column: K;
|
4569
|
+
} & DateBooster;
|
4570
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
4571
|
+
numericBooster?: {
|
4572
|
+
column: K;
|
4573
|
+
} & NumericBooster;
|
4574
|
+
}, {
|
4575
|
+
valueBooster?: {
|
4576
|
+
column: K;
|
4577
|
+
} & ValueBooster<number>;
|
4578
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
4579
|
+
valueBooster: {
|
4580
|
+
column: K;
|
4581
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
4582
|
+
} : never;
|
4583
|
+
}>;
|
4584
|
+
|
4585
|
+
declare type TargetColumn<T extends XataRecord> = SelectableColumn<T> | {
|
4586
|
+
/**
|
4587
|
+
* The name of the column.
|
4588
|
+
*/
|
4589
|
+
column: SelectableColumn<T>;
|
4590
|
+
/**
|
4591
|
+
* The weight of the column.
|
4592
|
+
*
|
4593
|
+
* @default 1
|
4594
|
+
* @maximum 10
|
4595
|
+
* @minimum 1
|
4596
|
+
*/
|
4597
|
+
weight?: number;
|
4598
|
+
};
|
4599
|
+
|
4600
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
4601
|
+
fuzziness?: FuzzinessExpression;
|
4602
|
+
prefix?: PrefixExpression;
|
4603
|
+
highlight?: HighlightExpression;
|
4604
|
+
tables?: Array<Tables | Values<{
|
4605
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
4606
|
+
table: Model;
|
4607
|
+
target?: TargetColumn<Schemas[Model] & XataRecord>[];
|
4608
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
4609
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
4610
|
+
};
|
4611
|
+
}>>;
|
4612
|
+
};
|
4613
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
4614
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
4615
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
4616
|
+
table: Model;
|
4617
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
4618
|
+
};
|
4619
|
+
}>[]>;
|
4620
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
4621
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
4622
|
+
}>;
|
4623
|
+
};
|
4624
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
4625
|
+
#private;
|
4626
|
+
private db;
|
4627
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
4628
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
4629
|
+
}
|
4630
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
4631
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
4632
|
+
};
|
4633
|
+
declare type SearchExtraProperties = {
|
4634
|
+
table: string;
|
4635
|
+
highlight?: {
|
4636
|
+
[key: string]: string[] | {
|
4637
|
+
[key: string]: any;
|
4638
|
+
};
|
4639
|
+
};
|
4640
|
+
score?: number;
|
4641
|
+
};
|
4642
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
4643
|
+
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 {
|
4644
|
+
table: infer Table;
|
4645
|
+
} ? ReturnTable<Table, Tables> : never;
|
2981
4646
|
|
2982
4647
|
declare type SortDirection = 'asc' | 'desc';
|
2983
4648
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -2989,13 +4654,21 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
2989
4654
|
[Key in StringKeys<T>]: SortDirection;
|
2990
4655
|
};
|
2991
4656
|
|
2992
|
-
declare type
|
2993
|
-
|
2994
|
-
|
4657
|
+
declare type BaseOptions<T extends XataRecord> = {
|
4658
|
+
columns?: SelectableColumn<T>[];
|
4659
|
+
cache?: number;
|
4660
|
+
};
|
4661
|
+
declare type CursorQueryOptions = {
|
4662
|
+
pagination?: CursorNavigationOptions & OffsetNavigationOptions;
|
4663
|
+
filter?: never;
|
4664
|
+
sort?: never;
|
4665
|
+
};
|
4666
|
+
declare type OffsetQueryOptions<T extends XataRecord> = {
|
4667
|
+
pagination?: OffsetNavigationOptions;
|
2995
4668
|
filter?: FilterExpression;
|
2996
4669
|
sort?: SortFilter<T> | SortFilter<T>[];
|
2997
|
-
cache?: number;
|
2998
4670
|
};
|
4671
|
+
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
2999
4672
|
/**
|
3000
4673
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
3001
4674
|
*
|
@@ -3005,8 +4678,11 @@ declare type QueryOptions<T extends XataRecord> = {
|
|
3005
4678
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
3006
4679
|
#private;
|
3007
4680
|
readonly meta: PaginationQueryMeta;
|
3008
|
-
readonly records: Result
|
3009
|
-
constructor(repository: Repository<Record> | null, table:
|
4681
|
+
readonly records: RecordArray<Result>;
|
4682
|
+
constructor(repository: Repository<Record> | null, table: {
|
4683
|
+
name: string;
|
4684
|
+
schema?: Table;
|
4685
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3010
4686
|
getQueryOptions(): QueryOptions<Record>;
|
3011
4687
|
key(): string;
|
3012
4688
|
/**
|
@@ -3038,81 +4714,203 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3038
4714
|
*
|
3039
4715
|
* ```
|
3040
4716
|
* query.filter("columnName", columnValue)
|
3041
|
-
* query.filter(
|
3042
|
-
*
|
3043
|
-
*
|
4717
|
+
* query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
|
4718
|
+
* ```
|
4719
|
+
*
|
4720
|
+
* @param column The name of the column to filter.
|
4721
|
+
* @param value The value to filter.
|
4722
|
+
* @returns A new Query object.
|
4723
|
+
*/
|
4724
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
4725
|
+
/**
|
4726
|
+
* Builds a new query object adding one or more constraints. Examples:
|
4727
|
+
*
|
4728
|
+
* ```
|
4729
|
+
* query.filter({ "columnName": columnValue })
|
3044
4730
|
* query.filter({
|
3045
4731
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
3046
4732
|
* })
|
3047
4733
|
* ```
|
3048
4734
|
*
|
4735
|
+
* @param filters A filter object
|
3049
4736
|
* @returns A new Query object.
|
3050
4737
|
*/
|
3051
|
-
filter(filters
|
3052
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
4738
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
3053
4739
|
/**
|
3054
4740
|
* Builds a new query with a new sort option.
|
3055
4741
|
* @param column The column name.
|
3056
4742
|
* @param direction The direction. Either ascending or descending.
|
3057
4743
|
* @returns A new Query object.
|
3058
4744
|
*/
|
3059
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
4745
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
3060
4746
|
/**
|
3061
4747
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
3062
4748
|
* @param columns Array of column names to be returned by the query.
|
3063
4749
|
* @returns A new Query object.
|
3064
4750
|
*/
|
3065
|
-
select<K extends SelectableColumn<Record>>(columns:
|
4751
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
4752
|
+
/**
|
4753
|
+
* Get paginated results
|
4754
|
+
*
|
4755
|
+
* @returns A page of results
|
4756
|
+
*/
|
3066
4757
|
getPaginated(): Promise<Page<Record, Result>>;
|
3067
|
-
|
4758
|
+
/**
|
4759
|
+
* Get paginated results
|
4760
|
+
*
|
4761
|
+
* @param options Pagination options
|
4762
|
+
* @returns A page of results
|
4763
|
+
*/
|
4764
|
+
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
4765
|
+
/**
|
4766
|
+
* Get paginated results
|
4767
|
+
*
|
4768
|
+
* @param options Pagination options
|
4769
|
+
* @returns A page of results
|
4770
|
+
*/
|
3068
4771
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
4772
|
+
/**
|
4773
|
+
* Get results in an iterator
|
4774
|
+
*
|
4775
|
+
* @async
|
4776
|
+
* @returns Async interable of results
|
4777
|
+
*/
|
3069
4778
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
4779
|
+
/**
|
4780
|
+
* Build an iterator of results
|
4781
|
+
*
|
4782
|
+
* @returns Async generator of results array
|
4783
|
+
*/
|
3070
4784
|
getIterator(): AsyncGenerator<Result[]>;
|
3071
|
-
|
4785
|
+
/**
|
4786
|
+
* Build an iterator of results
|
4787
|
+
*
|
4788
|
+
* @param options Pagination options with batchSize
|
4789
|
+
* @returns Async generator of results array
|
4790
|
+
*/
|
4791
|
+
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3072
4792
|
batchSize?: number;
|
3073
4793
|
}): AsyncGenerator<Result[]>;
|
3074
|
-
|
4794
|
+
/**
|
4795
|
+
* Build an iterator of results
|
4796
|
+
*
|
4797
|
+
* @param options Pagination options with batchSize
|
4798
|
+
* @returns Async generator of results array
|
4799
|
+
*/
|
4800
|
+
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3075
4801
|
batchSize?: number;
|
3076
4802
|
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
3077
4803
|
/**
|
3078
4804
|
* Performs the query in the database and returns a set of results.
|
4805
|
+
* @returns An array of records from the database.
|
4806
|
+
*/
|
4807
|
+
getMany(): Promise<RecordArray<Result>>;
|
4808
|
+
/**
|
4809
|
+
* Performs the query in the database and returns a set of results.
|
4810
|
+
* @param options Additional options to be used when performing the query.
|
4811
|
+
* @returns An array of records from the database.
|
4812
|
+
*/
|
4813
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
4814
|
+
/**
|
4815
|
+
* Performs the query in the database and returns a set of results.
|
4816
|
+
* @param options Additional options to be used when performing the query.
|
4817
|
+
* @returns An array of records from the database.
|
4818
|
+
*/
|
4819
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
4820
|
+
/**
|
4821
|
+
* Performs the query in the database and returns all the results.
|
4822
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
4823
|
+
* @returns An array of records from the database.
|
4824
|
+
*/
|
4825
|
+
getAll(): Promise<Result[]>;
|
4826
|
+
/**
|
4827
|
+
* Performs the query in the database and returns all the results.
|
4828
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
4829
|
+
* @param options Additional options to be used when performing the query.
|
4830
|
+
* @returns An array of records from the database.
|
4831
|
+
*/
|
4832
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
4833
|
+
batchSize?: number;
|
4834
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
4835
|
+
/**
|
4836
|
+
* Performs the query in the database and returns all the results.
|
4837
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
3079
4838
|
* @param options Additional options to be used when performing the query.
|
3080
4839
|
* @returns An array of records from the database.
|
3081
4840
|
*/
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
4841
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
4842
|
+
batchSize?: number;
|
4843
|
+
}): Promise<Result[]>;
|
4844
|
+
/**
|
4845
|
+
* Performs the query in the database and returns the first result.
|
4846
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4847
|
+
*/
|
4848
|
+
getFirst(): Promise<Result | null>;
|
4849
|
+
/**
|
4850
|
+
* Performs the query in the database and returns the first result.
|
4851
|
+
* @param options Additional options to be used when performing the query.
|
4852
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4853
|
+
*/
|
4854
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
4855
|
+
/**
|
4856
|
+
* Performs the query in the database and returns the first result.
|
4857
|
+
* @param options Additional options to be used when performing the query.
|
4858
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4859
|
+
*/
|
4860
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
4861
|
+
/**
|
4862
|
+
* Performs the query in the database and returns the first result.
|
4863
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4864
|
+
* @throws if there are no results.
|
4865
|
+
*/
|
4866
|
+
getFirstOrThrow(): Promise<Result>;
|
3085
4867
|
/**
|
3086
|
-
* Performs the query in the database and returns
|
3087
|
-
* Warning: If there are a large number of results, this method can have performance implications.
|
4868
|
+
* Performs the query in the database and returns the first result.
|
3088
4869
|
* @param options Additional options to be used when performing the query.
|
3089
|
-
* @returns
|
4870
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4871
|
+
* @throws if there are no results.
|
3090
4872
|
*/
|
3091
|
-
|
3092
|
-
getAll(options: Omit<QueryOptions<Record>, 'columns' | 'page'> & {
|
3093
|
-
batchSize?: number;
|
3094
|
-
}): Promise<Result[]>;
|
3095
|
-
getAll<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'> & {
|
3096
|
-
batchSize?: number;
|
3097
|
-
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
4873
|
+
getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
|
3098
4874
|
/**
|
3099
4875
|
* Performs the query in the database and returns the first result.
|
3100
4876
|
* @param options Additional options to be used when performing the query.
|
3101
4877
|
* @returns The first record that matches the query, or null if no record matched the query.
|
4878
|
+
* @throws if there are no results.
|
3102
4879
|
*/
|
3103
|
-
|
3104
|
-
getFirst(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
|
3105
|
-
getFirst<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
4880
|
+
getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
|
3106
4881
|
/**
|
3107
4882
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3108
4883
|
* @param ttl The cache TTL in milliseconds.
|
3109
4884
|
* @returns A new Query object.
|
3110
4885
|
*/
|
3111
4886
|
cache(ttl: number): Query<Record, Result>;
|
4887
|
+
/**
|
4888
|
+
* Retrieve next page of records
|
4889
|
+
*
|
4890
|
+
* @returns A new page object.
|
4891
|
+
*/
|
3112
4892
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
4893
|
+
/**
|
4894
|
+
* Retrieve previous page of records
|
4895
|
+
*
|
4896
|
+
* @returns A new page object
|
4897
|
+
*/
|
3113
4898
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
4899
|
+
/**
|
4900
|
+
* Retrieve first page of records
|
4901
|
+
*
|
4902
|
+
* @returns A new page object
|
4903
|
+
*/
|
3114
4904
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
4905
|
+
/**
|
4906
|
+
* Retrieve last page of records
|
4907
|
+
*
|
4908
|
+
* @returns A new page object
|
4909
|
+
*/
|
3115
4910
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
4911
|
+
/**
|
4912
|
+
* @returns Boolean indicating if there is a next page
|
4913
|
+
*/
|
3116
4914
|
hasNextPage(): boolean;
|
3117
4915
|
}
|
3118
4916
|
|
@@ -3124,7 +4922,7 @@ declare type PaginationQueryMeta = {
|
|
3124
4922
|
};
|
3125
4923
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
3126
4924
|
meta: PaginationQueryMeta;
|
3127
|
-
records: Result
|
4925
|
+
records: RecordArray<Result>;
|
3128
4926
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3129
4927
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3130
4928
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
@@ -3144,7 +4942,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
3144
4942
|
/**
|
3145
4943
|
* The set of results for this page.
|
3146
4944
|
*/
|
3147
|
-
readonly records: Result
|
4945
|
+
readonly records: RecordArray<Result>;
|
3148
4946
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
3149
4947
|
/**
|
3150
4948
|
* Retrieves the next page of results.
|
@@ -3192,64 +4990,305 @@ declare type OffsetNavigationOptions = {
|
|
3192
4990
|
size?: number;
|
3193
4991
|
offset?: number;
|
3194
4992
|
};
|
3195
|
-
declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
|
3196
4993
|
declare const PAGINATION_MAX_SIZE = 200;
|
3197
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
4994
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
3198
4995
|
declare const PAGINATION_MAX_OFFSET = 800;
|
3199
4996
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
4997
|
+
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
4998
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
4999
|
+
#private;
|
5000
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
5001
|
+
static parseConstructorParams(...args: any[]): any[];
|
5002
|
+
toArray(): Result[];
|
5003
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
5004
|
+
/**
|
5005
|
+
* Retrieve next page of records
|
5006
|
+
*
|
5007
|
+
* @returns A new array of objects
|
5008
|
+
*/
|
5009
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5010
|
+
/**
|
5011
|
+
* Retrieve previous page of records
|
5012
|
+
*
|
5013
|
+
* @returns A new array of objects
|
5014
|
+
*/
|
5015
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5016
|
+
/**
|
5017
|
+
* Retrieve first page of records
|
5018
|
+
*
|
5019
|
+
* @returns A new array of objects
|
5020
|
+
*/
|
5021
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5022
|
+
/**
|
5023
|
+
* Retrieve last page of records
|
5024
|
+
*
|
5025
|
+
* @returns A new array of objects
|
5026
|
+
*/
|
5027
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
5028
|
+
/**
|
5029
|
+
* @returns Boolean indicating if there is a next page
|
5030
|
+
*/
|
5031
|
+
hasNextPage(): boolean;
|
5032
|
+
}
|
3200
5033
|
|
3201
|
-
declare type TableLink = string[];
|
3202
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
3203
5034
|
/**
|
3204
5035
|
* Common interface for performing operations on a table.
|
3205
5036
|
*/
|
3206
|
-
declare abstract class Repository<
|
3207
|
-
abstract create(object: EditableData<
|
5037
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
5038
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5039
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5040
|
+
/**
|
5041
|
+
* Creates a single record in the table with a unique id.
|
5042
|
+
* @param id The unique id.
|
5043
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
5044
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5045
|
+
* @returns The full persisted record.
|
5046
|
+
*/
|
5047
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3208
5048
|
/**
|
3209
5049
|
* Creates a single record in the table with a unique id.
|
3210
5050
|
* @param id The unique id.
|
3211
5051
|
* @param object Object containing the column names with their values to be stored in the table.
|
3212
5052
|
* @returns The full persisted record.
|
3213
5053
|
*/
|
3214
|
-
abstract create(id: string, object: EditableData<
|
5054
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3215
5055
|
/**
|
3216
5056
|
* Creates multiple records in the table.
|
3217
5057
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3218
|
-
* @
|
5058
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5059
|
+
* @returns Array of the persisted records in order.
|
5060
|
+
*/
|
5061
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5062
|
+
/**
|
5063
|
+
* Creates multiple records in the table.
|
5064
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
5065
|
+
* @returns Array of the persisted records in order.
|
3219
5066
|
*/
|
3220
|
-
abstract create(objects: Array<EditableData<
|
5067
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5068
|
+
/**
|
5069
|
+
* Queries a single record from the table given its unique id.
|
5070
|
+
* @param id The unique id.
|
5071
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5072
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
5073
|
+
*/
|
5074
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3221
5075
|
/**
|
3222
5076
|
* Queries a single record from the table given its unique id.
|
3223
5077
|
* @param id The unique id.
|
3224
5078
|
* @returns The persisted record for the given id or null if the record could not be found.
|
3225
5079
|
*/
|
3226
5080
|
abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5081
|
+
/**
|
5082
|
+
* Queries multiple records from the table given their unique id.
|
5083
|
+
* @param ids The unique ids array.
|
5084
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5085
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5086
|
+
*/
|
5087
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5088
|
+
/**
|
5089
|
+
* Queries multiple records from the table given their unique id.
|
5090
|
+
* @param ids The unique ids array.
|
5091
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5092
|
+
*/
|
5093
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5094
|
+
/**
|
5095
|
+
* Queries a single record from the table by the id in the object.
|
5096
|
+
* @param object Object containing the id of the record.
|
5097
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5098
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
5099
|
+
*/
|
5100
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5101
|
+
/**
|
5102
|
+
* Queries a single record from the table by the id in the object.
|
5103
|
+
* @param object Object containing the id of the record.
|
5104
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
5105
|
+
*/
|
5106
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5107
|
+
/**
|
5108
|
+
* Queries multiple records from the table by the ids in the objects.
|
5109
|
+
* @param objects Array of objects containing the ids of the records.
|
5110
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5111
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5112
|
+
*/
|
5113
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5114
|
+
/**
|
5115
|
+
* Queries multiple records from the table by the ids in the objects.
|
5116
|
+
* @param objects Array of objects containing the ids of the records.
|
5117
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
5118
|
+
*/
|
5119
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5120
|
+
/**
|
5121
|
+
* Queries a single record from the table given its unique id.
|
5122
|
+
* @param id The unique id.
|
5123
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5124
|
+
* @returns The persisted record for the given id.
|
5125
|
+
* @throws If the record could not be found.
|
5126
|
+
*/
|
5127
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5128
|
+
/**
|
5129
|
+
* Queries a single record from the table given its unique id.
|
5130
|
+
* @param id The unique id.
|
5131
|
+
* @returns The persisted record for the given id.
|
5132
|
+
* @throws If the record could not be found.
|
5133
|
+
*/
|
5134
|
+
abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5135
|
+
/**
|
5136
|
+
* Queries multiple records from the table given their unique id.
|
5137
|
+
* @param ids The unique ids array.
|
5138
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5139
|
+
* @returns The persisted records for the given ids in order.
|
5140
|
+
* @throws If one or more records could not be found.
|
5141
|
+
*/
|
5142
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5143
|
+
/**
|
5144
|
+
* Queries multiple records from the table given their unique id.
|
5145
|
+
* @param ids The unique ids array.
|
5146
|
+
* @returns The persisted records for the given ids in order.
|
5147
|
+
* @throws If one or more records could not be found.
|
5148
|
+
*/
|
5149
|
+
abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5150
|
+
/**
|
5151
|
+
* Queries a single record from the table by the id in the object.
|
5152
|
+
* @param object Object containing the id of the record.
|
5153
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5154
|
+
* @returns The persisted record for the given id.
|
5155
|
+
* @throws If the record could not be found.
|
5156
|
+
*/
|
5157
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5158
|
+
/**
|
5159
|
+
* Queries a single record from the table by the id in the object.
|
5160
|
+
* @param object Object containing the id of the record.
|
5161
|
+
* @returns The persisted record for the given id.
|
5162
|
+
* @throws If the record could not be found.
|
5163
|
+
*/
|
5164
|
+
abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5165
|
+
/**
|
5166
|
+
* Queries multiple records from the table by the ids in the objects.
|
5167
|
+
* @param objects Array of objects containing the ids of the records.
|
5168
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5169
|
+
* @returns The persisted records for the given ids in order.
|
5170
|
+
* @throws If one or more records could not be found.
|
5171
|
+
*/
|
5172
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5173
|
+
/**
|
5174
|
+
* Queries multiple records from the table by the ids in the objects.
|
5175
|
+
* @param objects Array of objects containing the ids of the records.
|
5176
|
+
* @returns The persisted records for the given ids in order.
|
5177
|
+
* @throws If one or more records could not be found.
|
5178
|
+
*/
|
5179
|
+
abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5180
|
+
/**
|
5181
|
+
* Partially update a single record.
|
5182
|
+
* @param object An object with its id and the columns to be updated.
|
5183
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5184
|
+
* @returns The full persisted record, null if the record could not be found.
|
5185
|
+
*/
|
5186
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5187
|
+
/**
|
5188
|
+
* Partially update a single record.
|
5189
|
+
* @param object An object with its id and the columns to be updated.
|
5190
|
+
* @returns The full persisted record, null if the record could not be found.
|
5191
|
+
*/
|
5192
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5193
|
+
/**
|
5194
|
+
* Partially update a single record given its unique id.
|
5195
|
+
* @param id The unique id.
|
5196
|
+
* @param object The column names and their values that have to be updated.
|
5197
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5198
|
+
* @returns The full persisted record, null if the record could not be found.
|
5199
|
+
*/
|
5200
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5201
|
+
/**
|
5202
|
+
* Partially update a single record given its unique id.
|
5203
|
+
* @param id The unique id.
|
5204
|
+
* @param object The column names and their values that have to be updated.
|
5205
|
+
* @returns The full persisted record, null if the record could not be found.
|
5206
|
+
*/
|
5207
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5208
|
+
/**
|
5209
|
+
* Partially updates multiple records.
|
5210
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5211
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5212
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
5213
|
+
*/
|
5214
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5215
|
+
/**
|
5216
|
+
* Partially updates multiple records.
|
5217
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5218
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
5219
|
+
*/
|
5220
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5221
|
+
/**
|
5222
|
+
* Partially update a single record.
|
5223
|
+
* @param object An object with its id and the columns to be updated.
|
5224
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5225
|
+
* @returns The full persisted record.
|
5226
|
+
* @throws If the record could not be found.
|
5227
|
+
*/
|
5228
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3227
5229
|
/**
|
3228
5230
|
* Partially update a single record.
|
3229
5231
|
* @param object An object with its id and the columns to be updated.
|
3230
5232
|
* @returns The full persisted record.
|
5233
|
+
* @throws If the record could not be found.
|
5234
|
+
*/
|
5235
|
+
abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5236
|
+
/**
|
5237
|
+
* Partially update a single record given its unique id.
|
5238
|
+
* @param id The unique id.
|
5239
|
+
* @param object The column names and their values that have to be updated.
|
5240
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5241
|
+
* @returns The full persisted record.
|
5242
|
+
* @throws If the record could not be found.
|
3231
5243
|
*/
|
3232
|
-
abstract
|
5244
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3233
5245
|
/**
|
3234
5246
|
* Partially update a single record given its unique id.
|
3235
5247
|
* @param id The unique id.
|
3236
5248
|
* @param object The column names and their values that have to be updated.
|
3237
5249
|
* @returns The full persisted record.
|
5250
|
+
* @throws If the record could not be found.
|
3238
5251
|
*/
|
3239
|
-
abstract
|
5252
|
+
abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3240
5253
|
/**
|
3241
5254
|
* Partially updates multiple records.
|
3242
5255
|
* @param objects An array of objects with their ids and columns to be updated.
|
3243
|
-
* @
|
5256
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5257
|
+
* @returns Array of the persisted records in order.
|
5258
|
+
* @throws If one or more records could not be found.
|
5259
|
+
*/
|
5260
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5261
|
+
/**
|
5262
|
+
* Partially updates multiple records.
|
5263
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
5264
|
+
* @returns Array of the persisted records in order.
|
5265
|
+
* @throws If one or more records could not be found.
|
5266
|
+
*/
|
5267
|
+
abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5268
|
+
/**
|
5269
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5270
|
+
* it will be update, otherwise a new record will be created.
|
5271
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
5272
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5273
|
+
* @returns The full persisted record.
|
3244
5274
|
*/
|
3245
|
-
abstract
|
5275
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3246
5276
|
/**
|
3247
5277
|
* Creates or updates a single record. If a record exists with the given id,
|
3248
5278
|
* it will be update, otherwise a new record will be created.
|
3249
5279
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3250
5280
|
* @returns The full persisted record.
|
3251
5281
|
*/
|
3252
|
-
abstract createOrUpdate(object: EditableData<
|
5282
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5283
|
+
/**
|
5284
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5285
|
+
* it will be update, otherwise a new record will be created.
|
5286
|
+
* @param id A unique id.
|
5287
|
+
* @param object The column names and the values to be persisted.
|
5288
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5289
|
+
* @returns The full persisted record.
|
5290
|
+
*/
|
5291
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3253
5292
|
/**
|
3254
5293
|
* Creates or updates a single record. If a record exists with the given id,
|
3255
5294
|
* it will be update, otherwise a new record will be created.
|
@@ -3257,38 +5296,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3257
5296
|
* @param object The column names and the values to be persisted.
|
3258
5297
|
* @returns The full persisted record.
|
3259
5298
|
*/
|
3260
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
5299
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5300
|
+
/**
|
5301
|
+
* Creates or updates a single record. If a record exists with the given id,
|
5302
|
+
* it will be update, otherwise a new record will be created.
|
5303
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
5304
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5305
|
+
* @returns Array of the persisted records.
|
5306
|
+
*/
|
5307
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3261
5308
|
/**
|
3262
5309
|
* Creates or updates a single record. If a record exists with the given id,
|
3263
5310
|
* it will be update, otherwise a new record will be created.
|
3264
5311
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3265
5312
|
* @returns Array of the persisted records.
|
3266
5313
|
*/
|
3267
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
5314
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3268
5315
|
/**
|
3269
5316
|
* Deletes a record given its unique id.
|
5317
|
+
* @param object An object with a unique id.
|
5318
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5319
|
+
* @returns The deleted record, null if the record could not be found.
|
5320
|
+
*/
|
5321
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5322
|
+
/**
|
5323
|
+
* Deletes a record given its unique id.
|
5324
|
+
* @param object An object with a unique id.
|
5325
|
+
* @returns The deleted record, null if the record could not be found.
|
5326
|
+
*/
|
5327
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5328
|
+
/**
|
5329
|
+
* Deletes a record given a unique id.
|
5330
|
+
* @param id The unique id.
|
5331
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5332
|
+
* @returns The deleted record, null if the record could not be found.
|
5333
|
+
*/
|
5334
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5335
|
+
/**
|
5336
|
+
* Deletes a record given a unique id.
|
3270
5337
|
* @param id The unique id.
|
3271
|
-
* @
|
5338
|
+
* @returns The deleted record, null if the record could not be found.
|
5339
|
+
*/
|
5340
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5341
|
+
/**
|
5342
|
+
* Deletes multiple records given an array of objects with ids.
|
5343
|
+
* @param objects An array of objects with unique ids.
|
5344
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5345
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5346
|
+
*/
|
5347
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5348
|
+
/**
|
5349
|
+
* Deletes multiple records given an array of objects with ids.
|
5350
|
+
* @param objects An array of objects with unique ids.
|
5351
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3272
5352
|
*/
|
3273
|
-
abstract delete(
|
5353
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5354
|
+
/**
|
5355
|
+
* Deletes multiple records given an array of unique ids.
|
5356
|
+
* @param objects An array of ids.
|
5357
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5358
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5359
|
+
*/
|
5360
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5361
|
+
/**
|
5362
|
+
* Deletes multiple records given an array of unique ids.
|
5363
|
+
* @param objects An array of ids.
|
5364
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5365
|
+
*/
|
5366
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3274
5367
|
/**
|
3275
5368
|
* Deletes a record given its unique id.
|
3276
|
-
* @param
|
3277
|
-
* @
|
5369
|
+
* @param object An object with a unique id.
|
5370
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5371
|
+
* @returns The deleted record, null if the record could not be found.
|
5372
|
+
* @throws If the record could not be found.
|
5373
|
+
*/
|
5374
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5375
|
+
/**
|
5376
|
+
* Deletes a record given its unique id.
|
5377
|
+
* @param object An object with a unique id.
|
5378
|
+
* @returns The deleted record, null if the record could not be found.
|
5379
|
+
* @throws If the record could not be found.
|
5380
|
+
*/
|
5381
|
+
abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5382
|
+
/**
|
5383
|
+
* Deletes a record given a unique id.
|
5384
|
+
* @param id The unique id.
|
5385
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5386
|
+
* @returns The deleted record, null if the record could not be found.
|
5387
|
+
* @throws If the record could not be found.
|
5388
|
+
*/
|
5389
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5390
|
+
/**
|
5391
|
+
* Deletes a record given a unique id.
|
5392
|
+
* @param id The unique id.
|
5393
|
+
* @returns The deleted record, null if the record could not be found.
|
5394
|
+
* @throws If the record could not be found.
|
5395
|
+
*/
|
5396
|
+
abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5397
|
+
/**
|
5398
|
+
* Deletes multiple records given an array of objects with ids.
|
5399
|
+
* @param objects An array of objects with unique ids.
|
5400
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5401
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5402
|
+
* @throws If one or more records could not be found.
|
5403
|
+
*/
|
5404
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5405
|
+
/**
|
5406
|
+
* Deletes multiple records given an array of objects with ids.
|
5407
|
+
* @param objects An array of objects with unique ids.
|
5408
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5409
|
+
* @throws If one or more records could not be found.
|
3278
5410
|
*/
|
3279
|
-
abstract
|
5411
|
+
abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3280
5412
|
/**
|
3281
|
-
* Deletes
|
3282
|
-
* @param
|
3283
|
-
* @
|
5413
|
+
* Deletes multiple records given an array of unique ids.
|
5414
|
+
* @param objects An array of ids.
|
5415
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
5416
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
5417
|
+
* @throws If one or more records could not be found.
|
3284
5418
|
*/
|
3285
|
-
abstract
|
5419
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3286
5420
|
/**
|
3287
|
-
* Deletes
|
3288
|
-
* @param
|
3289
|
-
* @
|
5421
|
+
* Deletes multiple records given an array of unique ids.
|
5422
|
+
* @param objects An array of ids.
|
5423
|
+
* @returns Array of the deleted records in order.
|
5424
|
+
* @throws If one or more records could not be found.
|
3290
5425
|
*/
|
3291
|
-
abstract
|
5426
|
+
abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3292
5427
|
/**
|
3293
5428
|
* Search for records in the table.
|
3294
5429
|
* @param query The query to search for.
|
@@ -3296,36 +5431,152 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3296
5431
|
* @returns The found records.
|
3297
5432
|
*/
|
3298
5433
|
abstract search(query: string, options?: {
|
3299
|
-
fuzziness?:
|
3300
|
-
|
5434
|
+
fuzziness?: FuzzinessExpression;
|
5435
|
+
prefix?: PrefixExpression;
|
5436
|
+
highlight?: HighlightExpression;
|
5437
|
+
filter?: Filter<Record>;
|
5438
|
+
boosters?: Boosters<Record>[];
|
5439
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3301
5440
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3302
5441
|
}
|
3303
|
-
declare class RestRepository<
|
5442
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3304
5443
|
#private;
|
3305
|
-
db: SchemaPluginResult<any>;
|
3306
5444
|
constructor(options: {
|
3307
5445
|
table: string;
|
3308
|
-
links?: LinkDictionary;
|
3309
5446
|
db: SchemaPluginResult<any>;
|
3310
5447
|
pluginOptions: XataPluginOptions;
|
5448
|
+
schemaTables?: Table[];
|
3311
5449
|
});
|
3312
|
-
create(object: EditableData<
|
3313
|
-
create(
|
3314
|
-
create(
|
3315
|
-
|
3316
|
-
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3320
|
-
|
3321
|
-
|
3322
|
-
|
5450
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5451
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5452
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5453
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5454
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5455
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5456
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5457
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5458
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5459
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5460
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
5461
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
5462
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5463
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5464
|
+
readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5465
|
+
readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5466
|
+
readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5467
|
+
readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5468
|
+
readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5469
|
+
readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5470
|
+
readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5471
|
+
readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5472
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5473
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5474
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5475
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5476
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5477
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5478
|
+
updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5479
|
+
updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5480
|
+
updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5481
|
+
updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5482
|
+
updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5483
|
+
updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5484
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5485
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5486
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5487
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5488
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
5489
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
5490
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5491
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5492
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
5493
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
5494
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5495
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5496
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
5497
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
5498
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5499
|
+
deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5500
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
5501
|
+
deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
5502
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5503
|
+
deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
5504
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
5505
|
+
deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3323
5506
|
search(query: string, options?: {
|
3324
|
-
fuzziness?:
|
3325
|
-
|
5507
|
+
fuzziness?: FuzzinessExpression;
|
5508
|
+
prefix?: PrefixExpression;
|
5509
|
+
highlight?: HighlightExpression;
|
5510
|
+
filter?: Filter<Record>;
|
5511
|
+
boosters?: Boosters<Record>[];
|
5512
|
+
}): Promise<any>;
|
3326
5513
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3327
5514
|
}
|
3328
5515
|
|
5516
|
+
declare type BaseSchema = {
|
5517
|
+
name: string;
|
5518
|
+
columns: readonly ({
|
5519
|
+
name: string;
|
5520
|
+
type: Column['type'];
|
5521
|
+
notNull?: boolean;
|
5522
|
+
} | {
|
5523
|
+
name: string;
|
5524
|
+
type: 'link';
|
5525
|
+
link: {
|
5526
|
+
table: string;
|
5527
|
+
};
|
5528
|
+
} | {
|
5529
|
+
name: string;
|
5530
|
+
type: 'object';
|
5531
|
+
columns: {
|
5532
|
+
name: string;
|
5533
|
+
type: string;
|
5534
|
+
}[];
|
5535
|
+
})[];
|
5536
|
+
};
|
5537
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
5538
|
+
name: string;
|
5539
|
+
columns: readonly unknown[];
|
5540
|
+
} ? {
|
5541
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
5542
|
+
} : never : never;
|
5543
|
+
declare type TableType<Tables, TableName> = Tables & {
|
5544
|
+
name: TableName;
|
5545
|
+
} extends infer Table ? Table extends {
|
5546
|
+
name: string;
|
5547
|
+
columns: infer Columns;
|
5548
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
5549
|
+
name: string;
|
5550
|
+
type: string;
|
5551
|
+
} ? Identifiable & UnionToIntersection<Values<{
|
5552
|
+
[K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
|
5553
|
+
}>> : never : never : never : never;
|
5554
|
+
declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
|
5555
|
+
name: PropertyName;
|
5556
|
+
} extends infer Property ? Property extends {
|
5557
|
+
name: string;
|
5558
|
+
type: infer Type;
|
5559
|
+
link?: {
|
5560
|
+
table: infer LinkedTable;
|
5561
|
+
};
|
5562
|
+
columns?: infer ObjectColumns;
|
5563
|
+
notNull?: infer NotNull;
|
5564
|
+
} ? NotNull extends true ? {
|
5565
|
+
[K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
|
5566
|
+
} : {
|
5567
|
+
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
5568
|
+
} : never : never;
|
5569
|
+
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 {
|
5570
|
+
name: string;
|
5571
|
+
type: string;
|
5572
|
+
} ? UnionToIntersection<Values<{
|
5573
|
+
[K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
|
5574
|
+
}>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
|
5575
|
+
|
5576
|
+
/**
|
5577
|
+
* Operator to restrict results to only values that are greater than the given value.
|
5578
|
+
*/
|
5579
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3329
5580
|
/**
|
3330
5581
|
* Operator to restrict results to only values that are greater than the given value.
|
3331
5582
|
*/
|
@@ -3333,15 +5584,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3333
5584
|
/**
|
3334
5585
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3335
5586
|
*/
|
3336
|
-
declare const
|
5587
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5588
|
+
/**
|
5589
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
5590
|
+
*/
|
5591
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3337
5592
|
/**
|
3338
5593
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3339
5594
|
*/
|
3340
5595
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5596
|
+
/**
|
5597
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
5598
|
+
*/
|
5599
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5600
|
+
/**
|
5601
|
+
* Operator to restrict results to only values that are lower than the given value.
|
5602
|
+
*/
|
5603
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3341
5604
|
/**
|
3342
5605
|
* Operator to restrict results to only values that are lower than the given value.
|
3343
5606
|
*/
|
3344
5607
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5608
|
+
/**
|
5609
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
5610
|
+
*/
|
5611
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
5612
|
+
/**
|
5613
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
5614
|
+
*/
|
5615
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3345
5616
|
/**
|
3346
5617
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3347
5618
|
*/
|
@@ -3374,6 +5645,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3374
5645
|
* Operator to restrict results to only values that are equal to the given value.
|
3375
5646
|
*/
|
3376
5647
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
5648
|
+
/**
|
5649
|
+
* Operator to restrict results to only values that are equal to the given value.
|
5650
|
+
*/
|
5651
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
3377
5652
|
/**
|
3378
5653
|
* Operator to restrict results to only values that are not equal to the given value.
|
3379
5654
|
*/
|
@@ -3401,49 +5676,16 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3401
5676
|
|
3402
5677
|
declare type SchemaDefinition = {
|
3403
5678
|
table: string;
|
3404
|
-
links?: LinkDictionary;
|
3405
5679
|
};
|
3406
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
5680
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
3407
5681
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3408
|
-
} & {
|
3409
|
-
[key: string]: Repository<XataRecord$1>;
|
3410
5682
|
};
|
3411
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
5683
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3412
5684
|
#private;
|
3413
|
-
|
3414
|
-
private tableNames?;
|
3415
|
-
constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
|
5685
|
+
constructor(schemaTables?: Schemas.Table[]);
|
3416
5686
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3417
5687
|
}
|
3418
5688
|
|
3419
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3420
|
-
fuzziness?: number;
|
3421
|
-
tables?: Tables[];
|
3422
|
-
};
|
3423
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3424
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3425
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
|
3426
|
-
table: Model;
|
3427
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3428
|
-
};
|
3429
|
-
}>[]>;
|
3430
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3431
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3432
|
-
}>;
|
3433
|
-
};
|
3434
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3435
|
-
#private;
|
3436
|
-
private db;
|
3437
|
-
private links;
|
3438
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
3439
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3440
|
-
}
|
3441
|
-
declare type SearchXataRecord = XataRecord & {
|
3442
|
-
xata: {
|
3443
|
-
table: string;
|
3444
|
-
};
|
3445
|
-
};
|
3446
|
-
|
3447
5689
|
declare type BranchStrategyValue = string | undefined | null;
|
3448
5690
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3449
5691
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3455,20 +5697,35 @@ declare type BaseClientOptions = {
|
|
3455
5697
|
databaseURL?: string;
|
3456
5698
|
branch?: BranchStrategyOption;
|
3457
5699
|
cache?: CacheImpl;
|
5700
|
+
trace?: TraceFunction;
|
3458
5701
|
};
|
3459
5702
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3460
5703
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3461
|
-
new <Schemas extends Record<string,
|
5704
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
3462
5705
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
3463
5706
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3464
5707
|
}, keyof Plugins> & {
|
3465
5708
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
5709
|
+
} & {
|
5710
|
+
getConfig(): Promise<{
|
5711
|
+
databaseURL: string;
|
5712
|
+
branch: string;
|
5713
|
+
}>;
|
3466
5714
|
};
|
3467
5715
|
}
|
3468
5716
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3469
5717
|
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
3470
5718
|
}
|
3471
5719
|
|
5720
|
+
declare class Serializer {
|
5721
|
+
classes: Record<string, any>;
|
5722
|
+
add(clazz: any): void;
|
5723
|
+
toJSON<T>(data: T): string;
|
5724
|
+
fromJSON<T>(json: string): T;
|
5725
|
+
}
|
5726
|
+
declare const serialize: <T>(data: T) => string;
|
5727
|
+
declare const deserialize: <T>(json: string) => T;
|
5728
|
+
|
3472
5729
|
declare type BranchResolutionOptions = {
|
3473
5730
|
databaseURL?: string;
|
3474
5731
|
apiKey?: string;
|
@@ -3480,9 +5737,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
3480
5737
|
|
3481
5738
|
declare function getAPIKey(): string | undefined;
|
3482
5739
|
|
5740
|
+
interface Body {
|
5741
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
5742
|
+
blob(): Promise<Blob>;
|
5743
|
+
formData(): Promise<FormData>;
|
5744
|
+
json(): Promise<any>;
|
5745
|
+
text(): Promise<string>;
|
5746
|
+
}
|
5747
|
+
interface Blob {
|
5748
|
+
readonly size: number;
|
5749
|
+
readonly type: string;
|
5750
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
5751
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
5752
|
+
text(): Promise<string>;
|
5753
|
+
}
|
5754
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
5755
|
+
interface File extends Blob {
|
5756
|
+
readonly lastModified: number;
|
5757
|
+
readonly name: string;
|
5758
|
+
readonly webkitRelativePath: string;
|
5759
|
+
}
|
5760
|
+
declare type FormDataEntryValue = File | string;
|
5761
|
+
/** 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". */
|
5762
|
+
interface FormData {
|
5763
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
5764
|
+
delete(name: string): void;
|
5765
|
+
get(name: string): FormDataEntryValue | null;
|
5766
|
+
getAll(name: string): FormDataEntryValue[];
|
5767
|
+
has(name: string): boolean;
|
5768
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
5769
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
5770
|
+
}
|
5771
|
+
/** 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. */
|
5772
|
+
interface Headers {
|
5773
|
+
append(name: string, value: string): void;
|
5774
|
+
delete(name: string): void;
|
5775
|
+
get(name: string): string | null;
|
5776
|
+
has(name: string): boolean;
|
5777
|
+
set(name: string, value: string): void;
|
5778
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
5779
|
+
}
|
5780
|
+
interface Request extends Body {
|
5781
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
5782
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
5783
|
+
/** 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. */
|
5784
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
5785
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
5786
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
5787
|
+
/** 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. */
|
5788
|
+
readonly headers: Headers;
|
5789
|
+
/** 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] */
|
5790
|
+
readonly integrity: string;
|
5791
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
5792
|
+
readonly keepalive: boolean;
|
5793
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
5794
|
+
readonly method: string;
|
5795
|
+
/** 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. */
|
5796
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
5797
|
+
/** 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. */
|
5798
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
5799
|
+
/** 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. */
|
5800
|
+
readonly referrer: string;
|
5801
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
5802
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
5803
|
+
/** Returns the URL of request as a string. */
|
5804
|
+
readonly url: string;
|
5805
|
+
clone(): Request;
|
5806
|
+
}
|
5807
|
+
|
5808
|
+
declare type XataWorkerContext<XataClient> = {
|
5809
|
+
xata: XataClient;
|
5810
|
+
request: Request;
|
5811
|
+
env: Record<string, string | undefined>;
|
5812
|
+
};
|
5813
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
5814
|
+
declare type WorkerRunnerConfig = {
|
5815
|
+
workspace: string;
|
5816
|
+
worker: string;
|
5817
|
+
};
|
5818
|
+
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>>>;
|
5819
|
+
|
3483
5820
|
declare class XataError extends Error {
|
3484
5821
|
readonly status: number;
|
3485
5822
|
constructor(message: string, status: number);
|
3486
5823
|
}
|
3487
5824
|
|
3488
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, 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, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
5825
|
+
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, 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, ListMigrationRequestsError, ListMigrationRequestsPathParams, ListMigrationRequestsRequestBody, ListMigrationRequestsResponse, ListMigrationRequestsVariables, 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, 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, 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, listMigrationRequests, listMigrationRequestsCommits, lt, lte, mergeMigrationRequest, notExists, operationsByTag, pattern, previewBranchSchemaEdit, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|