@xata.io/client 0.0.0-alpha.vf603f80 → 0.0.0-alpha.vf683143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +27 -25
- package/Usage.md +62 -6
- package/dist/index.cjs +763 -357
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1482 -298
- package/dist/index.mjs +740 -358
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
declare type AttributeDictionary = Record<string, string | number | boolean | undefined>;
|
2
|
+
declare type TraceFunction = <T>(name: string, fn: (options: {
|
3
|
+
setAttributes: (attrs: AttributeDictionary) => void;
|
4
|
+
}) => T, options?: AttributeDictionary) => Promise<T>;
|
5
|
+
|
1
6
|
declare type FetchImpl = (url: string, init?: {
|
2
7
|
body?: string;
|
3
8
|
headers?: Record<string, string>;
|
@@ -5,17 +10,19 @@ declare type FetchImpl = (url: string, init?: {
|
|
5
10
|
}) => Promise<{
|
6
11
|
ok: boolean;
|
7
12
|
status: number;
|
13
|
+
url: string;
|
8
14
|
json(): Promise<any>;
|
9
15
|
headers?: {
|
10
16
|
get(name: string): string | null;
|
11
17
|
};
|
12
18
|
}>;
|
13
|
-
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string
|
19
|
+
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
|
14
20
|
declare type FetcherExtraProps = {
|
15
21
|
apiUrl: string;
|
16
22
|
workspacesApiUrl: string | WorkspaceApiUrlBuilder;
|
17
23
|
fetchImpl: FetchImpl;
|
18
24
|
apiKey: string;
|
25
|
+
trace: TraceFunction;
|
19
26
|
};
|
20
27
|
declare type ErrorWrapper<TError> = TError | {
|
21
28
|
status: 'unknown';
|
@@ -23,7 +30,6 @@ declare type ErrorWrapper<TError> = TError | {
|
|
23
30
|
};
|
24
31
|
|
25
32
|
interface CacheImpl {
|
26
|
-
cacheRecords: boolean;
|
27
33
|
defaultQueryTTL: number;
|
28
34
|
getAll(): Promise<Record<string, unknown>>;
|
29
35
|
get: <T>(key: string) => Promise<T | null>;
|
@@ -33,13 +39,11 @@ interface CacheImpl {
|
|
33
39
|
}
|
34
40
|
interface SimpleCacheOptions {
|
35
41
|
max?: number;
|
36
|
-
cacheRecords?: boolean;
|
37
42
|
defaultQueryTTL?: number;
|
38
43
|
}
|
39
44
|
declare class SimpleCache implements CacheImpl {
|
40
45
|
#private;
|
41
46
|
capacity: number;
|
42
|
-
cacheRecords: boolean;
|
43
47
|
defaultQueryTTL: number;
|
44
48
|
constructor(options?: SimpleCacheOptions);
|
45
49
|
getAll(): Promise<Record<string, unknown>>;
|
@@ -55,6 +59,7 @@ declare abstract class XataPlugin {
|
|
55
59
|
declare type XataPluginOptions = {
|
56
60
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
57
61
|
cache: CacheImpl;
|
62
|
+
trace?: TraceFunction;
|
58
63
|
};
|
59
64
|
|
60
65
|
/**
|
@@ -94,7 +99,7 @@ declare type WorkspaceID = string;
|
|
94
99
|
declare type Role = 'owner' | 'maintainer';
|
95
100
|
declare type WorkspaceMeta = {
|
96
101
|
name: string;
|
97
|
-
slug
|
102
|
+
slug?: string;
|
98
103
|
};
|
99
104
|
declare type Workspace = WorkspaceMeta & {
|
100
105
|
id: WorkspaceID;
|
@@ -125,20 +130,22 @@ declare type WorkspaceMembers = {
|
|
125
130
|
* @pattern ^ik_[a-zA-Z0-9]+
|
126
131
|
*/
|
127
132
|
declare type InviteKey = string;
|
133
|
+
/**
|
134
|
+
* Metadata of databases
|
135
|
+
*/
|
136
|
+
declare type DatabaseMetadata = {
|
137
|
+
name: string;
|
138
|
+
createdAt: DateTime;
|
139
|
+
numberOfBranches: number;
|
140
|
+
ui?: {
|
141
|
+
color?: string;
|
142
|
+
};
|
143
|
+
};
|
128
144
|
declare type ListDatabasesResponse = {
|
129
|
-
databases?:
|
130
|
-
name: string;
|
131
|
-
displayName: string;
|
132
|
-
createdAt: DateTime;
|
133
|
-
numberOfBranches: number;
|
134
|
-
ui?: {
|
135
|
-
color?: string;
|
136
|
-
};
|
137
|
-
}[];
|
145
|
+
databases?: DatabaseMetadata[];
|
138
146
|
};
|
139
147
|
declare type ListBranchesResponse = {
|
140
148
|
databaseName: string;
|
141
|
-
displayName: string;
|
142
149
|
branches: Branch[];
|
143
150
|
};
|
144
151
|
declare type ListGitBranchesResponse = {
|
@@ -184,12 +191,28 @@ declare type Schema = {
|
|
184
191
|
tables: Table[];
|
185
192
|
tablesOrder?: string[];
|
186
193
|
};
|
194
|
+
/**
|
195
|
+
* @x-internal true
|
196
|
+
*/
|
197
|
+
declare type SchemaEditScript = {
|
198
|
+
sourceMigrationID?: string;
|
199
|
+
targetMigrationID?: string;
|
200
|
+
tables: TableEdit[];
|
201
|
+
};
|
187
202
|
declare type Table = {
|
188
203
|
id?: string;
|
189
204
|
name: TableName;
|
190
205
|
columns: Column[];
|
191
206
|
revLinks?: RevLink[];
|
192
207
|
};
|
208
|
+
/**
|
209
|
+
* @x-internal true
|
210
|
+
*/
|
211
|
+
declare type TableEdit = {
|
212
|
+
oldName?: string;
|
213
|
+
newName?: string;
|
214
|
+
columns?: MigrationColumnOp[];
|
215
|
+
};
|
193
216
|
/**
|
194
217
|
* @x-go-type xata.Column
|
195
218
|
*/
|
@@ -199,6 +222,8 @@ declare type Column = {
|
|
199
222
|
link?: {
|
200
223
|
table: string;
|
201
224
|
};
|
225
|
+
notNull?: boolean;
|
226
|
+
unique?: boolean;
|
202
227
|
columns?: Column[];
|
203
228
|
};
|
204
229
|
declare type RevLink = {
|
@@ -265,6 +290,110 @@ declare type ColumnMigration = {
|
|
265
290
|
old: Column;
|
266
291
|
['new']: Column;
|
267
292
|
};
|
293
|
+
/**
|
294
|
+
* @x-internal true
|
295
|
+
*/
|
296
|
+
declare type Commit = {
|
297
|
+
meta?: {
|
298
|
+
title?: string;
|
299
|
+
message?: string;
|
300
|
+
id: string;
|
301
|
+
parentID?: string;
|
302
|
+
mergeParentID?: string;
|
303
|
+
status: string;
|
304
|
+
createdAt: DateTime;
|
305
|
+
modifiedAt?: DateTime;
|
306
|
+
};
|
307
|
+
operations: MigrationOp[];
|
308
|
+
};
|
309
|
+
/**
|
310
|
+
* Branch schema migration.
|
311
|
+
*
|
312
|
+
* @x-internal true
|
313
|
+
*/
|
314
|
+
declare type Migration = {
|
315
|
+
parentID?: string;
|
316
|
+
operations: MigrationOp[];
|
317
|
+
};
|
318
|
+
/**
|
319
|
+
* Branch schema migration operations.
|
320
|
+
*
|
321
|
+
* @x-internal true
|
322
|
+
*/
|
323
|
+
declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
|
324
|
+
/**
|
325
|
+
* @x-internal true
|
326
|
+
*/
|
327
|
+
declare type MigrationTableOp = {
|
328
|
+
addTable: TableOpAdd;
|
329
|
+
} | {
|
330
|
+
removeTable: TableOpRemove;
|
331
|
+
} | {
|
332
|
+
renameTable: TableOpRename;
|
333
|
+
};
|
334
|
+
/**
|
335
|
+
* @x-internal true
|
336
|
+
*/
|
337
|
+
declare type MigrationColumnOp = {
|
338
|
+
addColumn: ColumnOpAdd;
|
339
|
+
} | {
|
340
|
+
removeColumn: ColumnOpRemove;
|
341
|
+
} | {
|
342
|
+
renameColumn: ColumnOpRename;
|
343
|
+
};
|
344
|
+
/**
|
345
|
+
* @x-internal true
|
346
|
+
*/
|
347
|
+
declare type TableOpAdd = {
|
348
|
+
table: string;
|
349
|
+
};
|
350
|
+
/**
|
351
|
+
* @x-internal true
|
352
|
+
*/
|
353
|
+
declare type TableOpRemove = {
|
354
|
+
table: string;
|
355
|
+
};
|
356
|
+
/**
|
357
|
+
* @x-internal true
|
358
|
+
*/
|
359
|
+
declare type TableOpRename = {
|
360
|
+
oldName: string;
|
361
|
+
newName: string;
|
362
|
+
};
|
363
|
+
/**
|
364
|
+
* @x-internal true
|
365
|
+
*/
|
366
|
+
declare type ColumnOpAdd = {
|
367
|
+
table?: string;
|
368
|
+
column: Column;
|
369
|
+
};
|
370
|
+
/**
|
371
|
+
* @x-internal true
|
372
|
+
*/
|
373
|
+
declare type ColumnOpRemove = {
|
374
|
+
table?: string;
|
375
|
+
column: string;
|
376
|
+
};
|
377
|
+
/**
|
378
|
+
* @x-internal true
|
379
|
+
*/
|
380
|
+
declare type ColumnOpRename = {
|
381
|
+
table?: string;
|
382
|
+
oldName: string;
|
383
|
+
newName: string;
|
384
|
+
};
|
385
|
+
declare type MigrationRequest = {
|
386
|
+
number: number;
|
387
|
+
createdAt: DateTime;
|
388
|
+
modifiedAt?: DateTime;
|
389
|
+
closedAt?: DateTime;
|
390
|
+
mergedAt?: DateTime;
|
391
|
+
status: 'open' | 'closed' | 'merging' | 'merged';
|
392
|
+
title: string;
|
393
|
+
body: string;
|
394
|
+
source: string;
|
395
|
+
target: string;
|
396
|
+
};
|
268
397
|
declare type SortExpression = string[] | {
|
269
398
|
[key: string]: SortOrder;
|
270
399
|
} | {
|
@@ -273,7 +402,7 @@ declare type SortExpression = string[] | {
|
|
273
402
|
declare type SortOrder = 'asc' | 'desc';
|
274
403
|
/**
|
275
404
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
276
|
-
* distance is the number of one
|
405
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
277
406
|
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
278
407
|
* to allow two typos in a word.
|
279
408
|
*
|
@@ -286,6 +415,10 @@ declare type FuzzinessExpression = number;
|
|
286
415
|
* If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
|
287
416
|
*/
|
288
417
|
declare type PrefixExpression = 'phrase' | 'disabled';
|
418
|
+
/**
|
419
|
+
* The target expression is used to filter the search results by the target columns.
|
420
|
+
*/
|
421
|
+
declare type TargetExpression = string[];
|
289
422
|
/**
|
290
423
|
* @minProperties 1
|
291
424
|
*/
|
@@ -299,10 +432,64 @@ declare type FilterExpression = {
|
|
299
432
|
} & {
|
300
433
|
[key: string]: FilterColumn;
|
301
434
|
};
|
435
|
+
/**
|
436
|
+
* The full summary expression; the entire expression is a map of names to requests.
|
437
|
+
*
|
438
|
+
* @x-go-type xbquery.SummaryList
|
439
|
+
*/
|
440
|
+
declare type SummaryExpressionList = {
|
441
|
+
[key: string]: SummaryExpression;
|
442
|
+
};
|
443
|
+
/**
|
444
|
+
* A single summary expression. The key represents an aggregation function; the value a column to aggregate.
|
445
|
+
*
|
446
|
+
* You may only call one aggregation per key.
|
447
|
+
*
|
448
|
+
* @x-go-type xbquery.Summary
|
449
|
+
*/
|
450
|
+
declare type SummaryExpression = Record<string, any>;
|
302
451
|
declare type HighlightExpression = {
|
303
452
|
enabled?: boolean;
|
304
453
|
encodeHTML?: boolean;
|
305
454
|
};
|
455
|
+
/**
|
456
|
+
* Booster Expression
|
457
|
+
*
|
458
|
+
* @x-go-type xata.BoosterExpression
|
459
|
+
*/
|
460
|
+
declare type BoosterExpression = {
|
461
|
+
valueBooster?: ValueBooster$1;
|
462
|
+
} | {
|
463
|
+
numericBooster?: NumericBooster$1;
|
464
|
+
} | {
|
465
|
+
dateBooster?: DateBooster$1;
|
466
|
+
};
|
467
|
+
/**
|
468
|
+
* Boost records with a particular value for a column.
|
469
|
+
*/
|
470
|
+
declare type ValueBooster$1 = {
|
471
|
+
column: string;
|
472
|
+
value: string | number | boolean;
|
473
|
+
factor: number;
|
474
|
+
};
|
475
|
+
/**
|
476
|
+
* Boost records based on the value of a numeric column.
|
477
|
+
*/
|
478
|
+
declare type NumericBooster$1 = {
|
479
|
+
column: string;
|
480
|
+
factor: number;
|
481
|
+
};
|
482
|
+
/**
|
483
|
+
* Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
|
484
|
+
* 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
|
485
|
+
* 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.
|
486
|
+
*/
|
487
|
+
declare type DateBooster$1 = {
|
488
|
+
column: string;
|
489
|
+
origin?: string;
|
490
|
+
scale: string;
|
491
|
+
decay: number;
|
492
|
+
};
|
306
493
|
declare type FilterList = FilterExpression | FilterExpression[];
|
307
494
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
308
495
|
/**
|
@@ -359,7 +546,24 @@ declare type PageConfig = {
|
|
359
546
|
size?: number;
|
360
547
|
offset?: number;
|
361
548
|
};
|
362
|
-
declare type
|
549
|
+
declare type ColumnsProjection = string[];
|
550
|
+
/**
|
551
|
+
* Xata Table Record Metadata
|
552
|
+
*/
|
553
|
+
declare type RecordMeta = {
|
554
|
+
id: RecordID;
|
555
|
+
xata: {
|
556
|
+
version: number;
|
557
|
+
table?: string;
|
558
|
+
highlight?: {
|
559
|
+
[key: string]: string[] | {
|
560
|
+
[key: string]: any;
|
561
|
+
};
|
562
|
+
};
|
563
|
+
score?: number;
|
564
|
+
warnings?: string[];
|
565
|
+
};
|
566
|
+
};
|
363
567
|
/**
|
364
568
|
* @pattern [a-zA-Z0-9_-~:]+
|
365
569
|
*/
|
@@ -381,21 +585,9 @@ declare type RecordsMetadata = {
|
|
381
585
|
};
|
382
586
|
};
|
383
587
|
/**
|
384
|
-
* Xata Table Record
|
588
|
+
* Xata Table Record Metadata
|
385
589
|
*/
|
386
|
-
declare type XataRecord$1 = {
|
387
|
-
id: RecordID;
|
388
|
-
xata: {
|
389
|
-
version: number;
|
390
|
-
table?: string;
|
391
|
-
highlight?: {
|
392
|
-
[key: string]: string[] | {
|
393
|
-
[key: string]: any;
|
394
|
-
};
|
395
|
-
};
|
396
|
-
warnings?: string[];
|
397
|
-
};
|
398
|
-
} & {
|
590
|
+
declare type XataRecord$1 = RecordMeta & {
|
399
591
|
[key: string]: any;
|
400
592
|
};
|
401
593
|
|
@@ -413,6 +605,7 @@ type schemas_InviteID = InviteID;
|
|
413
605
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
414
606
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
415
607
|
type schemas_InviteKey = InviteKey;
|
608
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
416
609
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
417
610
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
418
611
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
@@ -421,7 +614,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
421
614
|
type schemas_DBBranch = DBBranch;
|
422
615
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
423
616
|
type schemas_Schema = Schema;
|
617
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
424
618
|
type schemas_Table = Table;
|
619
|
+
type schemas_TableEdit = TableEdit;
|
425
620
|
type schemas_Column = Column;
|
426
621
|
type schemas_RevLink = RevLink;
|
427
622
|
type schemas_BranchName = BranchName;
|
@@ -434,12 +629,28 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
434
629
|
type schemas_BranchMigration = BranchMigration;
|
435
630
|
type schemas_TableMigration = TableMigration;
|
436
631
|
type schemas_ColumnMigration = ColumnMigration;
|
632
|
+
type schemas_Commit = Commit;
|
633
|
+
type schemas_Migration = Migration;
|
634
|
+
type schemas_MigrationOp = MigrationOp;
|
635
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
636
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
637
|
+
type schemas_TableOpAdd = TableOpAdd;
|
638
|
+
type schemas_TableOpRemove = TableOpRemove;
|
639
|
+
type schemas_TableOpRename = TableOpRename;
|
640
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
641
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
642
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
643
|
+
type schemas_MigrationRequest = MigrationRequest;
|
437
644
|
type schemas_SortExpression = SortExpression;
|
438
645
|
type schemas_SortOrder = SortOrder;
|
439
646
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
440
647
|
type schemas_PrefixExpression = PrefixExpression;
|
648
|
+
type schemas_TargetExpression = TargetExpression;
|
441
649
|
type schemas_FilterExpression = FilterExpression;
|
650
|
+
type schemas_SummaryExpressionList = SummaryExpressionList;
|
651
|
+
type schemas_SummaryExpression = SummaryExpression;
|
442
652
|
type schemas_HighlightExpression = HighlightExpression;
|
653
|
+
type schemas_BoosterExpression = BoosterExpression;
|
443
654
|
type schemas_FilterList = FilterList;
|
444
655
|
type schemas_FilterColumn = FilterColumn;
|
445
656
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -449,7 +660,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
449
660
|
type schemas_FilterRangeValue = FilterRangeValue;
|
450
661
|
type schemas_FilterValue = FilterValue;
|
451
662
|
type schemas_PageConfig = PageConfig;
|
452
|
-
type
|
663
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
664
|
+
type schemas_RecordMeta = RecordMeta;
|
453
665
|
type schemas_RecordID = RecordID;
|
454
666
|
type schemas_TableRename = TableRename;
|
455
667
|
type schemas_RecordsMetadata = RecordsMetadata;
|
@@ -469,6 +681,7 @@ declare namespace schemas {
|
|
469
681
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
470
682
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
471
683
|
schemas_InviteKey as InviteKey,
|
684
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
472
685
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
473
686
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
474
687
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
@@ -477,7 +690,9 @@ declare namespace schemas {
|
|
477
690
|
schemas_DBBranch as DBBranch,
|
478
691
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
479
692
|
schemas_Schema as Schema,
|
693
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
480
694
|
schemas_Table as Table,
|
695
|
+
schemas_TableEdit as TableEdit,
|
481
696
|
schemas_Column as Column,
|
482
697
|
schemas_RevLink as RevLink,
|
483
698
|
schemas_BranchName as BranchName,
|
@@ -490,12 +705,31 @@ declare namespace schemas {
|
|
490
705
|
schemas_BranchMigration as BranchMigration,
|
491
706
|
schemas_TableMigration as TableMigration,
|
492
707
|
schemas_ColumnMigration as ColumnMigration,
|
708
|
+
schemas_Commit as Commit,
|
709
|
+
schemas_Migration as Migration,
|
710
|
+
schemas_MigrationOp as MigrationOp,
|
711
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
712
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
713
|
+
schemas_TableOpAdd as TableOpAdd,
|
714
|
+
schemas_TableOpRemove as TableOpRemove,
|
715
|
+
schemas_TableOpRename as TableOpRename,
|
716
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
717
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
718
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
719
|
+
schemas_MigrationRequest as MigrationRequest,
|
493
720
|
schemas_SortExpression as SortExpression,
|
494
721
|
schemas_SortOrder as SortOrder,
|
495
722
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
496
723
|
schemas_PrefixExpression as PrefixExpression,
|
724
|
+
schemas_TargetExpression as TargetExpression,
|
497
725
|
schemas_FilterExpression as FilterExpression,
|
726
|
+
schemas_SummaryExpressionList as SummaryExpressionList,
|
727
|
+
schemas_SummaryExpression as SummaryExpression,
|
498
728
|
schemas_HighlightExpression as HighlightExpression,
|
729
|
+
schemas_BoosterExpression as BoosterExpression,
|
730
|
+
ValueBooster$1 as ValueBooster,
|
731
|
+
NumericBooster$1 as NumericBooster,
|
732
|
+
DateBooster$1 as DateBooster,
|
499
733
|
schemas_FilterList as FilterList,
|
500
734
|
schemas_FilterColumn as FilterColumn,
|
501
735
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -505,7 +739,8 @@ declare namespace schemas {
|
|
505
739
|
schemas_FilterRangeValue as FilterRangeValue,
|
506
740
|
schemas_FilterValue as FilterValue,
|
507
741
|
schemas_PageConfig as PageConfig,
|
508
|
-
|
742
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
743
|
+
schemas_RecordMeta as RecordMeta,
|
509
744
|
schemas_RecordID as RecordID,
|
510
745
|
schemas_TableRename as TableRename,
|
511
746
|
schemas_RecordsMetadata as RecordsMetadata,
|
@@ -540,11 +775,22 @@ declare type BulkError = {
|
|
540
775
|
status?: number;
|
541
776
|
}[];
|
542
777
|
};
|
778
|
+
declare type BulkInsertResponse = {
|
779
|
+
recordIDs: string[];
|
780
|
+
} | {
|
781
|
+
records: XataRecord$1[];
|
782
|
+
};
|
543
783
|
declare type BranchMigrationPlan = {
|
544
784
|
version: number;
|
545
785
|
migration: BranchMigration;
|
546
786
|
};
|
547
|
-
declare type
|
787
|
+
declare type RecordResponse = XataRecord$1;
|
788
|
+
declare type SchemaCompareResponse = {
|
789
|
+
source: Schema;
|
790
|
+
target: Schema;
|
791
|
+
edits: SchemaEditScript;
|
792
|
+
};
|
793
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
548
794
|
id: string;
|
549
795
|
xata: {
|
550
796
|
version: number;
|
@@ -554,6 +800,9 @@ declare type QueryResponse = {
|
|
554
800
|
records: XataRecord$1[];
|
555
801
|
meta: RecordsMetadata;
|
556
802
|
};
|
803
|
+
declare type SummarizeResponse = {
|
804
|
+
summary: Record<string, any>[];
|
805
|
+
};
|
557
806
|
declare type SearchResponse = {
|
558
807
|
records: XataRecord$1[];
|
559
808
|
};
|
@@ -568,9 +817,13 @@ type responses_SimpleError = SimpleError;
|
|
568
817
|
type responses_BadRequestError = BadRequestError;
|
569
818
|
type responses_AuthError = AuthError;
|
570
819
|
type responses_BulkError = BulkError;
|
820
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
571
821
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
822
|
+
type responses_RecordResponse = RecordResponse;
|
823
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
572
824
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
573
825
|
type responses_QueryResponse = QueryResponse;
|
826
|
+
type responses_SummarizeResponse = SummarizeResponse;
|
574
827
|
type responses_SearchResponse = SearchResponse;
|
575
828
|
type responses_MigrationIdResponse = MigrationIdResponse;
|
576
829
|
declare namespace responses {
|
@@ -579,9 +832,13 @@ declare namespace responses {
|
|
579
832
|
responses_BadRequestError as BadRequestError,
|
580
833
|
responses_AuthError as AuthError,
|
581
834
|
responses_BulkError as BulkError,
|
835
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
582
836
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
837
|
+
responses_RecordResponse as RecordResponse,
|
838
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
583
839
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
584
840
|
responses_QueryResponse as QueryResponse,
|
841
|
+
responses_SummarizeResponse as SummarizeResponse,
|
585
842
|
responses_SearchResponse as SearchResponse,
|
586
843
|
responses_MigrationIdResponse as MigrationIdResponse,
|
587
844
|
};
|
@@ -926,8 +1183,7 @@ declare type UpdateWorkspaceMemberInviteVariables = {
|
|
926
1183
|
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
927
1184
|
} & FetcherExtraProps;
|
928
1185
|
/**
|
929
|
-
* This operation provides a way to update an existing invite. Updates are performed in-place; they do not
|
930
|
-
* change the invite link, the expiry time, nor do they re-notify the recipient of the invite.
|
1186
|
+
* 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.
|
931
1187
|
*/
|
932
1188
|
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
933
1189
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
@@ -1047,7 +1303,6 @@ declare type CreateDatabaseResponse = {
|
|
1047
1303
|
branchName?: string;
|
1048
1304
|
};
|
1049
1305
|
declare type CreateDatabaseRequestBody = {
|
1050
|
-
displayName?: string;
|
1051
1306
|
branchName?: string;
|
1052
1307
|
ui?: {
|
1053
1308
|
color?: string;
|
@@ -1083,6 +1338,54 @@ declare type DeleteDatabaseVariables = {
|
|
1083
1338
|
* Delete a database and all of its branches and tables permanently.
|
1084
1339
|
*/
|
1085
1340
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1341
|
+
declare type GetDatabaseMetadataPathParams = {
|
1342
|
+
dbName: DBName;
|
1343
|
+
workspace: string;
|
1344
|
+
};
|
1345
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
1346
|
+
status: 400;
|
1347
|
+
payload: BadRequestError;
|
1348
|
+
} | {
|
1349
|
+
status: 401;
|
1350
|
+
payload: AuthError;
|
1351
|
+
} | {
|
1352
|
+
status: 404;
|
1353
|
+
payload: SimpleError;
|
1354
|
+
}>;
|
1355
|
+
declare type GetDatabaseMetadataVariables = {
|
1356
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1357
|
+
} & FetcherExtraProps;
|
1358
|
+
/**
|
1359
|
+
* Retrieve metadata of the given database
|
1360
|
+
*/
|
1361
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1362
|
+
declare type UpdateDatabaseMetadataPathParams = {
|
1363
|
+
dbName: DBName;
|
1364
|
+
workspace: string;
|
1365
|
+
};
|
1366
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
1367
|
+
status: 400;
|
1368
|
+
payload: BadRequestError;
|
1369
|
+
} | {
|
1370
|
+
status: 401;
|
1371
|
+
payload: AuthError;
|
1372
|
+
} | {
|
1373
|
+
status: 404;
|
1374
|
+
payload: SimpleError;
|
1375
|
+
}>;
|
1376
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
1377
|
+
ui?: {
|
1378
|
+
color?: string;
|
1379
|
+
};
|
1380
|
+
};
|
1381
|
+
declare type UpdateDatabaseMetadataVariables = {
|
1382
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
1383
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
1384
|
+
} & FetcherExtraProps;
|
1385
|
+
/**
|
1386
|
+
* Update the color of the selected database
|
1387
|
+
*/
|
1388
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1086
1389
|
declare type GetGitBranchesMappingPathParams = {
|
1087
1390
|
dbName: DBName;
|
1088
1391
|
workspace: string;
|
@@ -1240,11 +1543,11 @@ declare type ResolveBranchVariables = {
|
|
1240
1543
|
* ```
|
1241
1544
|
*/
|
1242
1545
|
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1243
|
-
declare type
|
1244
|
-
|
1546
|
+
declare type ListMigrationRequestsPathParams = {
|
1547
|
+
dbName: DBName;
|
1245
1548
|
workspace: string;
|
1246
1549
|
};
|
1247
|
-
declare type
|
1550
|
+
declare type ListMigrationRequestsError = ErrorWrapper<{
|
1248
1551
|
status: 400;
|
1249
1552
|
payload: BadRequestError;
|
1250
1553
|
} | {
|
@@ -1254,18 +1557,26 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
1254
1557
|
status: 404;
|
1255
1558
|
payload: SimpleError;
|
1256
1559
|
}>;
|
1257
|
-
declare type
|
1258
|
-
|
1560
|
+
declare type ListMigrationRequestsResponse = {
|
1561
|
+
migrationRequests: MigrationRequest[];
|
1562
|
+
meta: RecordsMetadata;
|
1563
|
+
};
|
1564
|
+
declare type ListMigrationRequestsRequestBody = {
|
1565
|
+
filter?: FilterExpression;
|
1566
|
+
sort?: SortExpression;
|
1567
|
+
page?: PageConfig;
|
1568
|
+
columns?: ColumnsProjection;
|
1569
|
+
};
|
1570
|
+
declare type ListMigrationRequestsVariables = {
|
1571
|
+
body?: ListMigrationRequestsRequestBody;
|
1572
|
+
pathParams: ListMigrationRequestsPathParams;
|
1259
1573
|
} & FetcherExtraProps;
|
1260
|
-
declare const
|
1261
|
-
declare type
|
1262
|
-
|
1574
|
+
declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
1575
|
+
declare type CreateMigrationRequestPathParams = {
|
1576
|
+
dbName: DBName;
|
1263
1577
|
workspace: string;
|
1264
1578
|
};
|
1265
|
-
declare type
|
1266
|
-
from?: string;
|
1267
|
-
};
|
1268
|
-
declare type CreateBranchError = ErrorWrapper<{
|
1579
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
1269
1580
|
status: 400;
|
1270
1581
|
payload: BadRequestError;
|
1271
1582
|
} | {
|
@@ -1275,21 +1586,26 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1275
1586
|
status: 404;
|
1276
1587
|
payload: SimpleError;
|
1277
1588
|
}>;
|
1278
|
-
declare type
|
1279
|
-
|
1280
|
-
metadata?: BranchMetadata;
|
1589
|
+
declare type CreateMigrationRequestResponse = {
|
1590
|
+
number: number;
|
1281
1591
|
};
|
1282
|
-
declare type
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1592
|
+
declare type CreateMigrationRequestRequestBody = {
|
1593
|
+
source: string;
|
1594
|
+
target: string;
|
1595
|
+
title: string;
|
1596
|
+
body?: string;
|
1597
|
+
};
|
1598
|
+
declare type CreateMigrationRequestVariables = {
|
1599
|
+
body: CreateMigrationRequestRequestBody;
|
1600
|
+
pathParams: CreateMigrationRequestPathParams;
|
1286
1601
|
} & FetcherExtraProps;
|
1287
|
-
declare const
|
1288
|
-
declare type
|
1289
|
-
|
1602
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
1603
|
+
declare type GetMigrationRequestPathParams = {
|
1604
|
+
dbName: DBName;
|
1605
|
+
mrNumber: number;
|
1290
1606
|
workspace: string;
|
1291
1607
|
};
|
1292
|
-
declare type
|
1608
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
1293
1609
|
status: 400;
|
1294
1610
|
payload: BadRequestError;
|
1295
1611
|
} | {
|
@@ -1299,18 +1615,16 @@ declare type DeleteBranchError = ErrorWrapper<{
|
|
1299
1615
|
status: 404;
|
1300
1616
|
payload: SimpleError;
|
1301
1617
|
}>;
|
1302
|
-
declare type
|
1303
|
-
pathParams:
|
1618
|
+
declare type GetMigrationRequestVariables = {
|
1619
|
+
pathParams: GetMigrationRequestPathParams;
|
1304
1620
|
} & FetcherExtraProps;
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
declare type UpdateBranchMetadataPathParams = {
|
1310
|
-
dbBranchName: DBBranchName;
|
1621
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
1622
|
+
declare type UpdateMigrationRequestPathParams = {
|
1623
|
+
dbName: DBName;
|
1624
|
+
mrNumber: number;
|
1311
1625
|
workspace: string;
|
1312
1626
|
};
|
1313
|
-
declare type
|
1627
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
1314
1628
|
status: 400;
|
1315
1629
|
payload: BadRequestError;
|
1316
1630
|
} | {
|
@@ -1320,19 +1634,22 @@ declare type UpdateBranchMetadataError = ErrorWrapper<{
|
|
1320
1634
|
status: 404;
|
1321
1635
|
payload: SimpleError;
|
1322
1636
|
}>;
|
1323
|
-
declare type
|
1324
|
-
|
1325
|
-
|
1637
|
+
declare type UpdateMigrationRequestRequestBody = {
|
1638
|
+
title?: string;
|
1639
|
+
body?: string;
|
1640
|
+
status?: 'open' | 'closed';
|
1641
|
+
};
|
1642
|
+
declare type UpdateMigrationRequestVariables = {
|
1643
|
+
body?: UpdateMigrationRequestRequestBody;
|
1644
|
+
pathParams: UpdateMigrationRequestPathParams;
|
1326
1645
|
} & FetcherExtraProps;
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
declare type GetBranchMetadataPathParams = {
|
1332
|
-
dbBranchName: DBBranchName;
|
1646
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
1647
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
1648
|
+
dbName: DBName;
|
1649
|
+
mrNumber: number;
|
1333
1650
|
workspace: string;
|
1334
1651
|
};
|
1335
|
-
declare type
|
1652
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
1336
1653
|
status: 400;
|
1337
1654
|
payload: BadRequestError;
|
1338
1655
|
} | {
|
@@ -1342,15 +1659,31 @@ declare type GetBranchMetadataError = ErrorWrapper<{
|
|
1342
1659
|
status: 404;
|
1343
1660
|
payload: SimpleError;
|
1344
1661
|
}>;
|
1345
|
-
declare type
|
1346
|
-
|
1662
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
1663
|
+
meta: {
|
1664
|
+
cursor: string;
|
1665
|
+
more: boolean;
|
1666
|
+
};
|
1667
|
+
logs: Commit[];
|
1668
|
+
};
|
1669
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
1670
|
+
page?: {
|
1671
|
+
after?: string;
|
1672
|
+
before?: string;
|
1673
|
+
size?: number;
|
1674
|
+
};
|
1675
|
+
};
|
1676
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
1677
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
1678
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
1347
1679
|
} & FetcherExtraProps;
|
1348
|
-
declare const
|
1349
|
-
declare type
|
1350
|
-
|
1680
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
1681
|
+
declare type CompareMigrationRequestPathParams = {
|
1682
|
+
dbName: DBName;
|
1683
|
+
mrNumber: number;
|
1351
1684
|
workspace: string;
|
1352
1685
|
};
|
1353
|
-
declare type
|
1686
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
1354
1687
|
status: 400;
|
1355
1688
|
payload: BadRequestError;
|
1356
1689
|
} | {
|
@@ -1360,24 +1693,16 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
1360
1693
|
status: 404;
|
1361
1694
|
payload: SimpleError;
|
1362
1695
|
}>;
|
1363
|
-
declare type
|
1364
|
-
|
1365
|
-
migrations?: BranchMigration[];
|
1366
|
-
};
|
1367
|
-
declare type GetBranchMigrationHistoryRequestBody = {
|
1368
|
-
limit?: number;
|
1369
|
-
startFrom?: string;
|
1370
|
-
};
|
1371
|
-
declare type GetBranchMigrationHistoryVariables = {
|
1372
|
-
body?: GetBranchMigrationHistoryRequestBody;
|
1373
|
-
pathParams: GetBranchMigrationHistoryPathParams;
|
1696
|
+
declare type CompareMigrationRequestVariables = {
|
1697
|
+
pathParams: CompareMigrationRequestPathParams;
|
1374
1698
|
} & FetcherExtraProps;
|
1375
|
-
declare const
|
1376
|
-
declare type
|
1377
|
-
|
1699
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
1700
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
1701
|
+
dbName: DBName;
|
1702
|
+
mrNumber: number;
|
1378
1703
|
workspace: string;
|
1379
1704
|
};
|
1380
|
-
declare type
|
1705
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
1381
1706
|
status: 400;
|
1382
1707
|
payload: BadRequestError;
|
1383
1708
|
} | {
|
@@ -1387,17 +1712,194 @@ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
|
1387
1712
|
status: 404;
|
1388
1713
|
payload: SimpleError;
|
1389
1714
|
}>;
|
1390
|
-
declare type
|
1391
|
-
|
1392
|
-
migration: BranchMigration;
|
1715
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
1716
|
+
merged?: boolean;
|
1393
1717
|
};
|
1394
|
-
declare type
|
1395
|
-
|
1396
|
-
pathParams: ExecuteBranchMigrationPlanPathParams;
|
1718
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
1719
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
1397
1720
|
} & FetcherExtraProps;
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1721
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
1722
|
+
declare type MergeMigrationRequestPathParams = {
|
1723
|
+
dbName: DBName;
|
1724
|
+
mrNumber: number;
|
1725
|
+
workspace: string;
|
1726
|
+
};
|
1727
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
1728
|
+
status: 400;
|
1729
|
+
payload: BadRequestError;
|
1730
|
+
} | {
|
1731
|
+
status: 401;
|
1732
|
+
payload: AuthError;
|
1733
|
+
} | {
|
1734
|
+
status: 404;
|
1735
|
+
payload: SimpleError;
|
1736
|
+
}>;
|
1737
|
+
declare type MergeMigrationRequestVariables = {
|
1738
|
+
pathParams: MergeMigrationRequestPathParams;
|
1739
|
+
} & FetcherExtraProps;
|
1740
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
1741
|
+
declare type GetBranchDetailsPathParams = {
|
1742
|
+
dbBranchName: DBBranchName;
|
1743
|
+
workspace: string;
|
1744
|
+
};
|
1745
|
+
declare type GetBranchDetailsError = ErrorWrapper<{
|
1746
|
+
status: 400;
|
1747
|
+
payload: BadRequestError;
|
1748
|
+
} | {
|
1749
|
+
status: 401;
|
1750
|
+
payload: AuthError;
|
1751
|
+
} | {
|
1752
|
+
status: 404;
|
1753
|
+
payload: SimpleError;
|
1754
|
+
}>;
|
1755
|
+
declare type GetBranchDetailsVariables = {
|
1756
|
+
pathParams: GetBranchDetailsPathParams;
|
1757
|
+
} & FetcherExtraProps;
|
1758
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
1759
|
+
declare type CreateBranchPathParams = {
|
1760
|
+
dbBranchName: DBBranchName;
|
1761
|
+
workspace: string;
|
1762
|
+
};
|
1763
|
+
declare type CreateBranchQueryParams = {
|
1764
|
+
from?: string;
|
1765
|
+
};
|
1766
|
+
declare type CreateBranchError = ErrorWrapper<{
|
1767
|
+
status: 400;
|
1768
|
+
payload: BadRequestError;
|
1769
|
+
} | {
|
1770
|
+
status: 401;
|
1771
|
+
payload: AuthError;
|
1772
|
+
} | {
|
1773
|
+
status: 404;
|
1774
|
+
payload: SimpleError;
|
1775
|
+
}>;
|
1776
|
+
declare type CreateBranchResponse = {
|
1777
|
+
databaseName: string;
|
1778
|
+
branchName: string;
|
1779
|
+
};
|
1780
|
+
declare type CreateBranchRequestBody = {
|
1781
|
+
from?: string;
|
1782
|
+
metadata?: BranchMetadata;
|
1783
|
+
};
|
1784
|
+
declare type CreateBranchVariables = {
|
1785
|
+
body?: CreateBranchRequestBody;
|
1786
|
+
pathParams: CreateBranchPathParams;
|
1787
|
+
queryParams?: CreateBranchQueryParams;
|
1788
|
+
} & FetcherExtraProps;
|
1789
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
1790
|
+
declare type DeleteBranchPathParams = {
|
1791
|
+
dbBranchName: DBBranchName;
|
1792
|
+
workspace: string;
|
1793
|
+
};
|
1794
|
+
declare type DeleteBranchError = ErrorWrapper<{
|
1795
|
+
status: 400;
|
1796
|
+
payload: BadRequestError;
|
1797
|
+
} | {
|
1798
|
+
status: 401;
|
1799
|
+
payload: AuthError;
|
1800
|
+
} | {
|
1801
|
+
status: 404;
|
1802
|
+
payload: SimpleError;
|
1803
|
+
}>;
|
1804
|
+
declare type DeleteBranchVariables = {
|
1805
|
+
pathParams: DeleteBranchPathParams;
|
1806
|
+
} & FetcherExtraProps;
|
1807
|
+
/**
|
1808
|
+
* Delete the branch in the database and all its resources
|
1809
|
+
*/
|
1810
|
+
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
1811
|
+
declare type UpdateBranchMetadataPathParams = {
|
1812
|
+
dbBranchName: DBBranchName;
|
1813
|
+
workspace: string;
|
1814
|
+
};
|
1815
|
+
declare type UpdateBranchMetadataError = ErrorWrapper<{
|
1816
|
+
status: 400;
|
1817
|
+
payload: BadRequestError;
|
1818
|
+
} | {
|
1819
|
+
status: 401;
|
1820
|
+
payload: AuthError;
|
1821
|
+
} | {
|
1822
|
+
status: 404;
|
1823
|
+
payload: SimpleError;
|
1824
|
+
}>;
|
1825
|
+
declare type UpdateBranchMetadataVariables = {
|
1826
|
+
body?: BranchMetadata;
|
1827
|
+
pathParams: UpdateBranchMetadataPathParams;
|
1828
|
+
} & FetcherExtraProps;
|
1829
|
+
/**
|
1830
|
+
* Update the branch metadata
|
1831
|
+
*/
|
1832
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
1833
|
+
declare type GetBranchMetadataPathParams = {
|
1834
|
+
dbBranchName: DBBranchName;
|
1835
|
+
workspace: string;
|
1836
|
+
};
|
1837
|
+
declare type GetBranchMetadataError = ErrorWrapper<{
|
1838
|
+
status: 400;
|
1839
|
+
payload: BadRequestError;
|
1840
|
+
} | {
|
1841
|
+
status: 401;
|
1842
|
+
payload: AuthError;
|
1843
|
+
} | {
|
1844
|
+
status: 404;
|
1845
|
+
payload: SimpleError;
|
1846
|
+
}>;
|
1847
|
+
declare type GetBranchMetadataVariables = {
|
1848
|
+
pathParams: GetBranchMetadataPathParams;
|
1849
|
+
} & FetcherExtraProps;
|
1850
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
1851
|
+
declare type GetBranchMigrationHistoryPathParams = {
|
1852
|
+
dbBranchName: DBBranchName;
|
1853
|
+
workspace: string;
|
1854
|
+
};
|
1855
|
+
declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
1856
|
+
status: 400;
|
1857
|
+
payload: BadRequestError;
|
1858
|
+
} | {
|
1859
|
+
status: 401;
|
1860
|
+
payload: AuthError;
|
1861
|
+
} | {
|
1862
|
+
status: 404;
|
1863
|
+
payload: SimpleError;
|
1864
|
+
}>;
|
1865
|
+
declare type GetBranchMigrationHistoryResponse = {
|
1866
|
+
startedFrom?: StartedFromMetadata;
|
1867
|
+
migrations?: BranchMigration[];
|
1868
|
+
};
|
1869
|
+
declare type GetBranchMigrationHistoryRequestBody = {
|
1870
|
+
limit?: number;
|
1871
|
+
startFrom?: string;
|
1872
|
+
};
|
1873
|
+
declare type GetBranchMigrationHistoryVariables = {
|
1874
|
+
body?: GetBranchMigrationHistoryRequestBody;
|
1875
|
+
pathParams: GetBranchMigrationHistoryPathParams;
|
1876
|
+
} & FetcherExtraProps;
|
1877
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
1878
|
+
declare type ExecuteBranchMigrationPlanPathParams = {
|
1879
|
+
dbBranchName: DBBranchName;
|
1880
|
+
workspace: string;
|
1881
|
+
};
|
1882
|
+
declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
1883
|
+
status: 400;
|
1884
|
+
payload: BadRequestError;
|
1885
|
+
} | {
|
1886
|
+
status: 401;
|
1887
|
+
payload: AuthError;
|
1888
|
+
} | {
|
1889
|
+
status: 404;
|
1890
|
+
payload: SimpleError;
|
1891
|
+
}>;
|
1892
|
+
declare type ExecuteBranchMigrationPlanRequestBody = {
|
1893
|
+
version: number;
|
1894
|
+
migration: BranchMigration;
|
1895
|
+
};
|
1896
|
+
declare type ExecuteBranchMigrationPlanVariables = {
|
1897
|
+
body: ExecuteBranchMigrationPlanRequestBody;
|
1898
|
+
pathParams: ExecuteBranchMigrationPlanPathParams;
|
1899
|
+
} & FetcherExtraProps;
|
1900
|
+
/**
|
1901
|
+
* Apply a migration plan to the branch
|
1902
|
+
*/
|
1401
1903
|
declare const executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
1402
1904
|
declare type GetBranchMigrationPlanPathParams = {
|
1403
1905
|
dbBranchName: DBBranchName;
|
@@ -1421,6 +1923,157 @@ declare type GetBranchMigrationPlanVariables = {
|
|
1421
1923
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
1422
1924
|
*/
|
1423
1925
|
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
1926
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
1927
|
+
dbBranchName: DBBranchName;
|
1928
|
+
workspace: string;
|
1929
|
+
};
|
1930
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
1931
|
+
status: 400;
|
1932
|
+
payload: BadRequestError;
|
1933
|
+
} | {
|
1934
|
+
status: 401;
|
1935
|
+
payload: AuthError;
|
1936
|
+
} | {
|
1937
|
+
status: 404;
|
1938
|
+
payload: SimpleError;
|
1939
|
+
}>;
|
1940
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
1941
|
+
schema: Schema;
|
1942
|
+
};
|
1943
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
1944
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
1945
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
1946
|
+
} & FetcherExtraProps;
|
1947
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
1948
|
+
declare type CompareBranchSchemasPathParams = {
|
1949
|
+
dbBranchName: DBBranchName;
|
1950
|
+
branchName: BranchName;
|
1951
|
+
workspace: string;
|
1952
|
+
};
|
1953
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
1954
|
+
status: 400;
|
1955
|
+
payload: BadRequestError;
|
1956
|
+
} | {
|
1957
|
+
status: 401;
|
1958
|
+
payload: AuthError;
|
1959
|
+
} | {
|
1960
|
+
status: 404;
|
1961
|
+
payload: SimpleError;
|
1962
|
+
}>;
|
1963
|
+
declare type CompareBranchSchemasVariables = {
|
1964
|
+
body?: Record<string, any>;
|
1965
|
+
pathParams: CompareBranchSchemasPathParams;
|
1966
|
+
} & FetcherExtraProps;
|
1967
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
1968
|
+
declare type UpdateBranchSchemaPathParams = {
|
1969
|
+
dbBranchName: DBBranchName;
|
1970
|
+
workspace: string;
|
1971
|
+
};
|
1972
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
1973
|
+
status: 400;
|
1974
|
+
payload: BadRequestError;
|
1975
|
+
} | {
|
1976
|
+
status: 401;
|
1977
|
+
payload: AuthError;
|
1978
|
+
} | {
|
1979
|
+
status: 404;
|
1980
|
+
payload: SimpleError;
|
1981
|
+
}>;
|
1982
|
+
declare type UpdateBranchSchemaResponse = {
|
1983
|
+
id: string;
|
1984
|
+
parentID: string;
|
1985
|
+
};
|
1986
|
+
declare type UpdateBranchSchemaVariables = {
|
1987
|
+
body: Migration;
|
1988
|
+
pathParams: UpdateBranchSchemaPathParams;
|
1989
|
+
} & FetcherExtraProps;
|
1990
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
1991
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
1992
|
+
dbBranchName: DBBranchName;
|
1993
|
+
workspace: string;
|
1994
|
+
};
|
1995
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
1996
|
+
status: 400;
|
1997
|
+
payload: BadRequestError;
|
1998
|
+
} | {
|
1999
|
+
status: 401;
|
2000
|
+
payload: AuthError;
|
2001
|
+
} | {
|
2002
|
+
status: 404;
|
2003
|
+
payload: SimpleError;
|
2004
|
+
}>;
|
2005
|
+
declare type PreviewBranchSchemaEditResponse = {
|
2006
|
+
original: Schema;
|
2007
|
+
updated: Schema;
|
2008
|
+
};
|
2009
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
2010
|
+
edits?: SchemaEditScript;
|
2011
|
+
operations?: MigrationOp[];
|
2012
|
+
};
|
2013
|
+
declare type PreviewBranchSchemaEditVariables = {
|
2014
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
2015
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
2016
|
+
} & FetcherExtraProps;
|
2017
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
2018
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
2019
|
+
dbBranchName: DBBranchName;
|
2020
|
+
workspace: string;
|
2021
|
+
};
|
2022
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
2023
|
+
status: 400;
|
2024
|
+
payload: BadRequestError;
|
2025
|
+
} | {
|
2026
|
+
status: 401;
|
2027
|
+
payload: AuthError;
|
2028
|
+
} | {
|
2029
|
+
status: 404;
|
2030
|
+
payload: SimpleError;
|
2031
|
+
}>;
|
2032
|
+
declare type ApplyBranchSchemaEditResponse = {
|
2033
|
+
id: string;
|
2034
|
+
parentID: string;
|
2035
|
+
};
|
2036
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
2037
|
+
edits: SchemaEditScript;
|
2038
|
+
};
|
2039
|
+
declare type ApplyBranchSchemaEditVariables = {
|
2040
|
+
body: ApplyBranchSchemaEditRequestBody;
|
2041
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
2042
|
+
} & FetcherExtraProps;
|
2043
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
2044
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
2045
|
+
dbBranchName: DBBranchName;
|
2046
|
+
workspace: string;
|
2047
|
+
};
|
2048
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
2049
|
+
status: 400;
|
2050
|
+
payload: BadRequestError;
|
2051
|
+
} | {
|
2052
|
+
status: 401;
|
2053
|
+
payload: AuthError;
|
2054
|
+
} | {
|
2055
|
+
status: 404;
|
2056
|
+
payload: SimpleError;
|
2057
|
+
}>;
|
2058
|
+
declare type GetBranchSchemaHistoryResponse = {
|
2059
|
+
meta: {
|
2060
|
+
cursor: string;
|
2061
|
+
more: boolean;
|
2062
|
+
};
|
2063
|
+
logs: Commit[];
|
2064
|
+
};
|
2065
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
2066
|
+
page?: {
|
2067
|
+
after?: string;
|
2068
|
+
before?: string;
|
2069
|
+
size?: number;
|
2070
|
+
};
|
2071
|
+
};
|
2072
|
+
declare type GetBranchSchemaHistoryVariables = {
|
2073
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
2074
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
2075
|
+
} & FetcherExtraProps;
|
2076
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
1424
2077
|
declare type GetBranchStatsPathParams = {
|
1425
2078
|
dbBranchName: DBBranchName;
|
1426
2079
|
workspace: string;
|
@@ -1471,13 +2124,17 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1471
2124
|
status: 422;
|
1472
2125
|
payload: SimpleError;
|
1473
2126
|
}>;
|
2127
|
+
declare type CreateTableResponse = {
|
2128
|
+
branchName: string;
|
2129
|
+
tableName: string;
|
2130
|
+
};
|
1474
2131
|
declare type CreateTableVariables = {
|
1475
2132
|
pathParams: CreateTablePathParams;
|
1476
2133
|
} & FetcherExtraProps;
|
1477
2134
|
/**
|
1478
2135
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1479
2136
|
*/
|
1480
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
2137
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1481
2138
|
declare type DeleteTablePathParams = {
|
1482
2139
|
dbBranchName: DBBranchName;
|
1483
2140
|
tableName: TableName;
|
@@ -1710,6 +2367,9 @@ declare type InsertRecordPathParams = {
|
|
1710
2367
|
tableName: TableName;
|
1711
2368
|
workspace: string;
|
1712
2369
|
};
|
2370
|
+
declare type InsertRecordQueryParams = {
|
2371
|
+
columns?: ColumnsProjection;
|
2372
|
+
};
|
1713
2373
|
declare type InsertRecordError = ErrorWrapper<{
|
1714
2374
|
status: 400;
|
1715
2375
|
payload: BadRequestError;
|
@@ -1720,20 +2380,15 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1720
2380
|
status: 404;
|
1721
2381
|
payload: SimpleError;
|
1722
2382
|
}>;
|
1723
|
-
declare type InsertRecordResponse = {
|
1724
|
-
id: string;
|
1725
|
-
xata: {
|
1726
|
-
version: number;
|
1727
|
-
};
|
1728
|
-
};
|
1729
2383
|
declare type InsertRecordVariables = {
|
1730
2384
|
body?: Record<string, any>;
|
1731
2385
|
pathParams: InsertRecordPathParams;
|
2386
|
+
queryParams?: InsertRecordQueryParams;
|
1732
2387
|
} & FetcherExtraProps;
|
1733
2388
|
/**
|
1734
2389
|
* Insert a new Record into the Table
|
1735
2390
|
*/
|
1736
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
2391
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1737
2392
|
declare type InsertRecordWithIDPathParams = {
|
1738
2393
|
dbBranchName: DBBranchName;
|
1739
2394
|
tableName: TableName;
|
@@ -1741,6 +2396,7 @@ declare type InsertRecordWithIDPathParams = {
|
|
1741
2396
|
workspace: string;
|
1742
2397
|
};
|
1743
2398
|
declare type InsertRecordWithIDQueryParams = {
|
2399
|
+
columns?: ColumnsProjection;
|
1744
2400
|
createOnly?: boolean;
|
1745
2401
|
ifVersion?: number;
|
1746
2402
|
};
|
@@ -1773,6 +2429,7 @@ declare type UpdateRecordWithIDPathParams = {
|
|
1773
2429
|
workspace: string;
|
1774
2430
|
};
|
1775
2431
|
declare type UpdateRecordWithIDQueryParams = {
|
2432
|
+
columns?: ColumnsProjection;
|
1776
2433
|
ifVersion?: number;
|
1777
2434
|
};
|
1778
2435
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1801,6 +2458,7 @@ declare type UpsertRecordWithIDPathParams = {
|
|
1801
2458
|
workspace: string;
|
1802
2459
|
};
|
1803
2460
|
declare type UpsertRecordWithIDQueryParams = {
|
2461
|
+
columns?: ColumnsProjection;
|
1804
2462
|
ifVersion?: number;
|
1805
2463
|
};
|
1806
2464
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1828,6 +2486,9 @@ declare type DeleteRecordPathParams = {
|
|
1828
2486
|
recordId: RecordID;
|
1829
2487
|
workspace: string;
|
1830
2488
|
};
|
2489
|
+
declare type DeleteRecordQueryParams = {
|
2490
|
+
columns?: ColumnsProjection;
|
2491
|
+
};
|
1831
2492
|
declare type DeleteRecordError = ErrorWrapper<{
|
1832
2493
|
status: 400;
|
1833
2494
|
payload: BadRequestError;
|
@@ -1840,14 +2501,18 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1840
2501
|
}>;
|
1841
2502
|
declare type DeleteRecordVariables = {
|
1842
2503
|
pathParams: DeleteRecordPathParams;
|
2504
|
+
queryParams?: DeleteRecordQueryParams;
|
1843
2505
|
} & FetcherExtraProps;
|
1844
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
2506
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1845
2507
|
declare type GetRecordPathParams = {
|
1846
2508
|
dbBranchName: DBBranchName;
|
1847
2509
|
tableName: TableName;
|
1848
2510
|
recordId: RecordID;
|
1849
2511
|
workspace: string;
|
1850
2512
|
};
|
2513
|
+
declare type GetRecordQueryParams = {
|
2514
|
+
columns?: ColumnsProjection;
|
2515
|
+
};
|
1851
2516
|
declare type GetRecordError = ErrorWrapper<{
|
1852
2517
|
status: 400;
|
1853
2518
|
payload: BadRequestError;
|
@@ -1858,12 +2523,9 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1858
2523
|
status: 404;
|
1859
2524
|
payload: SimpleError;
|
1860
2525
|
}>;
|
1861
|
-
declare type GetRecordRequestBody = {
|
1862
|
-
columns?: ColumnsFilter;
|
1863
|
-
};
|
1864
2526
|
declare type GetRecordVariables = {
|
1865
|
-
body?: GetRecordRequestBody;
|
1866
2527
|
pathParams: GetRecordPathParams;
|
2528
|
+
queryParams?: GetRecordQueryParams;
|
1867
2529
|
} & FetcherExtraProps;
|
1868
2530
|
/**
|
1869
2531
|
* Retrieve record by ID
|
@@ -1874,6 +2536,9 @@ declare type BulkInsertTableRecordsPathParams = {
|
|
1874
2536
|
tableName: TableName;
|
1875
2537
|
workspace: string;
|
1876
2538
|
};
|
2539
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
2540
|
+
columns?: ColumnsProjection;
|
2541
|
+
};
|
1877
2542
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1878
2543
|
status: 400;
|
1879
2544
|
payload: BulkError;
|
@@ -1887,20 +2552,18 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1887
2552
|
status: 422;
|
1888
2553
|
payload: SimpleError;
|
1889
2554
|
}>;
|
1890
|
-
declare type BulkInsertTableRecordsResponse = {
|
1891
|
-
recordIDs: string[];
|
1892
|
-
};
|
1893
2555
|
declare type BulkInsertTableRecordsRequestBody = {
|
1894
2556
|
records: Record<string, any>[];
|
1895
2557
|
};
|
1896
2558
|
declare type BulkInsertTableRecordsVariables = {
|
1897
2559
|
body: BulkInsertTableRecordsRequestBody;
|
1898
2560
|
pathParams: BulkInsertTableRecordsPathParams;
|
2561
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1899
2562
|
} & FetcherExtraProps;
|
1900
2563
|
/**
|
1901
2564
|
* Bulk insert records
|
1902
2565
|
*/
|
1903
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
2566
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1904
2567
|
declare type QueryTablePathParams = {
|
1905
2568
|
dbBranchName: DBBranchName;
|
1906
2569
|
tableName: TableName;
|
@@ -1920,7 +2583,7 @@ declare type QueryTableRequestBody = {
|
|
1920
2583
|
filter?: FilterExpression;
|
1921
2584
|
sort?: SortExpression;
|
1922
2585
|
page?: PageConfig;
|
1923
|
-
columns?:
|
2586
|
+
columns?: ColumnsProjection;
|
1924
2587
|
};
|
1925
2588
|
declare type QueryTableVariables = {
|
1926
2589
|
body?: QueryTableRequestBody;
|
@@ -2666,9 +3329,11 @@ declare type SearchTableError = ErrorWrapper<{
|
|
2666
3329
|
declare type SearchTableRequestBody = {
|
2667
3330
|
query: string;
|
2668
3331
|
fuzziness?: FuzzinessExpression;
|
3332
|
+
target?: TargetExpression;
|
2669
3333
|
prefix?: PrefixExpression;
|
2670
3334
|
filter?: FilterExpression;
|
2671
3335
|
highlight?: HighlightExpression;
|
3336
|
+
boosters?: BoosterExpression[];
|
2672
3337
|
};
|
2673
3338
|
declare type SearchTableVariables = {
|
2674
3339
|
body: SearchTableRequestBody;
|
@@ -2700,9 +3365,12 @@ declare type SearchBranchRequestBody = {
|
|
2700
3365
|
tables?: (string | {
|
2701
3366
|
table: string;
|
2702
3367
|
filter?: FilterExpression;
|
3368
|
+
target?: TargetExpression;
|
3369
|
+
boosters?: BoosterExpression[];
|
2703
3370
|
})[];
|
2704
3371
|
query: string;
|
2705
3372
|
fuzziness?: FuzzinessExpression;
|
3373
|
+
prefix?: PrefixExpression;
|
2706
3374
|
highlight?: HighlightExpression;
|
2707
3375
|
};
|
2708
3376
|
declare type SearchBranchVariables = {
|
@@ -2713,6 +3381,33 @@ declare type SearchBranchVariables = {
|
|
2713
3381
|
* Run a free text search operation across the database branch.
|
2714
3382
|
*/
|
2715
3383
|
declare const searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
3384
|
+
declare type SummarizeTablePathParams = {
|
3385
|
+
dbBranchName: DBBranchName;
|
3386
|
+
tableName: TableName;
|
3387
|
+
workspace: string;
|
3388
|
+
};
|
3389
|
+
declare type SummarizeTableError = ErrorWrapper<{
|
3390
|
+
status: 400;
|
3391
|
+
payload: BadRequestError;
|
3392
|
+
} | {
|
3393
|
+
status: 401;
|
3394
|
+
payload: AuthError;
|
3395
|
+
} | {
|
3396
|
+
status: 404;
|
3397
|
+
payload: SimpleError;
|
3398
|
+
}>;
|
3399
|
+
declare type SummarizeTableRequestBody = {
|
3400
|
+
summaries?: SummaryExpressionList;
|
3401
|
+
columns?: ColumnsProjection;
|
3402
|
+
};
|
3403
|
+
declare type SummarizeTableVariables = {
|
3404
|
+
body?: SummarizeTableRequestBody;
|
3405
|
+
pathParams: SummarizeTablePathParams;
|
3406
|
+
} & FetcherExtraProps;
|
3407
|
+
/**
|
3408
|
+
* Summarize table
|
3409
|
+
*/
|
3410
|
+
declare const summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
|
2716
3411
|
declare const operationsByTag: {
|
2717
3412
|
users: {
|
2718
3413
|
getUser: (variables: GetUserVariables) => Promise<UserWithID>;
|
@@ -2741,6 +3436,8 @@ declare const operationsByTag: {
|
|
2741
3436
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2742
3437
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2743
3438
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
3439
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
3440
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
2744
3441
|
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
2745
3442
|
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
2746
3443
|
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
@@ -2749,17 +3446,35 @@ declare const operationsByTag: {
|
|
2749
3446
|
branch: {
|
2750
3447
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2751
3448
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2752
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
3449
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2753
3450
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2754
3451
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2755
3452
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
3453
|
+
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
3454
|
+
};
|
3455
|
+
migrationRequests: {
|
3456
|
+
listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
3457
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
3458
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
3459
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
3460
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
3461
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
3462
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
3463
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
3464
|
+
};
|
3465
|
+
branchSchema: {
|
2756
3466
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2757
3467
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
2758
3468
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2759
|
-
|
3469
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
3470
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
3471
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
3472
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
3473
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
3474
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
2760
3475
|
};
|
2761
3476
|
table: {
|
2762
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
3477
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2763
3478
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2764
3479
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2765
3480
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2771,16 +3486,17 @@ declare const operationsByTag: {
|
|
2771
3486
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2772
3487
|
};
|
2773
3488
|
records: {
|
2774
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
3489
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2775
3490
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2776
3491
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2777
3492
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2778
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
3493
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2779
3494
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2780
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
3495
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2781
3496
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2782
3497
|
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2783
3498
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
3499
|
+
summarizeTable: (variables: SummarizeTableVariables) => Promise<SummarizeResponse>;
|
2784
3500
|
};
|
2785
3501
|
};
|
2786
3502
|
|
@@ -2795,10 +3511,8 @@ interface XataApiClientOptions {
|
|
2795
3511
|
fetch?: FetchImpl;
|
2796
3512
|
apiKey?: string;
|
2797
3513
|
host?: HostProvider;
|
3514
|
+
trace?: TraceFunction;
|
2798
3515
|
}
|
2799
|
-
/**
|
2800
|
-
* @deprecated Use XataApiPlugin instead
|
2801
|
-
*/
|
2802
3516
|
declare class XataApiClient {
|
2803
3517
|
#private;
|
2804
3518
|
constructor(options?: XataApiClientOptions);
|
@@ -2808,6 +3522,8 @@ declare class XataApiClient {
|
|
2808
3522
|
get branches(): BranchApi;
|
2809
3523
|
get tables(): TableApi;
|
2810
3524
|
get records(): RecordsApi;
|
3525
|
+
get migrationRequests(): MigrationRequestsApi;
|
3526
|
+
get branchSchema(): BranchSchemaApi;
|
2811
3527
|
}
|
2812
3528
|
declare class UserApi {
|
2813
3529
|
private extraProps;
|
@@ -2842,6 +3558,8 @@ declare class DatabaseApi {
|
|
2842
3558
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2843
3559
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2844
3560
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
3561
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
3562
|
+
updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
2845
3563
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2846
3564
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2847
3565
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
@@ -2852,19 +3570,16 @@ declare class BranchApi {
|
|
2852
3570
|
constructor(extraProps: FetcherExtraProps);
|
2853
3571
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2854
3572
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2855
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
3573
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
2856
3574
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2857
3575
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2858
3576
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2859
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
2860
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
2861
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
2862
3577
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2863
3578
|
}
|
2864
3579
|
declare class TableApi {
|
2865
3580
|
private extraProps;
|
2866
3581
|
constructor(extraProps: FetcherExtraProps);
|
2867
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
3582
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2868
3583
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2869
3584
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2870
3585
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2878,16 +3593,42 @@ declare class TableApi {
|
|
2878
3593
|
declare class RecordsApi {
|
2879
3594
|
private extraProps;
|
2880
3595
|
constructor(extraProps: FetcherExtraProps);
|
2881
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
3596
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
2882
3597
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2883
3598
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2884
3599
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2885
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2886
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2887
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
3600
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
3601
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
3602
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
2888
3603
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2889
3604
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2890
3605
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
3606
|
+
summarizeTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SummarizeTableRequestBody): Promise<SummarizeResponse>;
|
3607
|
+
}
|
3608
|
+
declare class MigrationRequestsApi {
|
3609
|
+
private extraProps;
|
3610
|
+
constructor(extraProps: FetcherExtraProps);
|
3611
|
+
listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
|
3612
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
3613
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
3614
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
3615
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
3616
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
3617
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
3618
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
3619
|
+
}
|
3620
|
+
declare class BranchSchemaApi {
|
3621
|
+
private extraProps;
|
3622
|
+
constructor(extraProps: FetcherExtraProps);
|
3623
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
3624
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
3625
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
3626
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
3627
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
3628
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
3629
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
3630
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
3631
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
2891
3632
|
}
|
2892
3633
|
|
2893
3634
|
declare class XataApiPlugin implements XataPlugin {
|
@@ -2900,19 +3641,20 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2900
3641
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2901
3642
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2902
3643
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2903
|
-
declare type NonEmptyArray<T> = T[] & {
|
2904
|
-
0: T;
|
2905
|
-
};
|
2906
3644
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2907
3645
|
[P in K]-?: NonNullable<T[P]>;
|
2908
3646
|
};
|
2909
3647
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2910
3648
|
declare type SingleOrArray<T> = T | T[];
|
2911
3649
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
3650
|
+
declare type Without<T, U> = {
|
3651
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
3652
|
+
};
|
3653
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
2912
3654
|
|
2913
3655
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2914
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2915
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
3656
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
3657
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2916
3658
|
}>>;
|
2917
3659
|
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> ? {
|
2918
3660
|
V: ValueAtColumn<Item, V>;
|
@@ -2948,42 +3690,51 @@ interface BaseData {
|
|
2948
3690
|
/**
|
2949
3691
|
* Represents a persisted record from the database.
|
2950
3692
|
*/
|
2951
|
-
interface XataRecord<
|
3693
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2952
3694
|
/**
|
2953
3695
|
* Get metadata of this record.
|
2954
3696
|
*/
|
2955
|
-
getMetadata(): XataRecordMetadata
|
3697
|
+
getMetadata(): XataRecordMetadata;
|
3698
|
+
/**
|
3699
|
+
* Retrieves a refreshed copy of the current record from the database.
|
3700
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3701
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3702
|
+
*/
|
3703
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2956
3704
|
/**
|
2957
3705
|
* Retrieves a refreshed copy of the current record from the database.
|
3706
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2958
3707
|
*/
|
2959
|
-
read(): Promise<Readonly<SelectedPick<
|
3708
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2960
3709
|
/**
|
2961
3710
|
* Performs a partial update of the current record. On success a new object is
|
2962
3711
|
* returned and the current object is not mutated.
|
2963
3712
|
* @param partialUpdate The columns and their values that have to be updated.
|
2964
|
-
* @
|
3713
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3714
|
+
* @returns The persisted record with the selected columns, null if not found.
|
2965
3715
|
*/
|
2966
|
-
update(partialUpdate: Partial<EditableData<
|
3716
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2967
3717
|
/**
|
2968
|
-
* Performs a
|
2969
|
-
*
|
2970
|
-
* @
|
3718
|
+
* Performs a partial update of the current record. On success a new object is
|
3719
|
+
* returned and the current object is not mutated.
|
3720
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
3721
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2971
3722
|
*/
|
2972
|
-
|
2973
|
-
}
|
2974
|
-
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
3723
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2975
3724
|
/**
|
2976
|
-
*
|
3725
|
+
* Performs a deletion of the current record in the database.
|
3726
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3727
|
+
* @returns The deleted record, null if not found.
|
2977
3728
|
*/
|
2978
|
-
|
3729
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2979
3730
|
/**
|
2980
|
-
* Performs a
|
2981
|
-
*
|
2982
|
-
|
2983
|
-
* @returns A new record containing the latest values for all the columns of the current record.
|
3731
|
+
* Performs a deletion of the current record in the database.
|
3732
|
+
* @returns The deleted record, null if not found.
|
3733
|
+
|
2984
3734
|
*/
|
2985
|
-
|
2986
|
-
}
|
3735
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
3736
|
+
}
|
3737
|
+
declare type Link<Record extends XataRecord> = XataRecord<Record>;
|
2987
3738
|
declare type XataRecordMetadata = {
|
2988
3739
|
/**
|
2989
3740
|
* Number that is increased every time the record is updated.
|
@@ -2993,13 +3744,13 @@ declare type XataRecordMetadata = {
|
|
2993
3744
|
};
|
2994
3745
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2995
3746
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2996
|
-
declare type EditableData<O extends
|
3747
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
2997
3748
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2998
3749
|
id: string;
|
2999
3750
|
} | string : NonNullable<O[K]> extends XataRecord ? {
|
3000
3751
|
id: string;
|
3001
3752
|
} | string | null | undefined : O[K];
|
3002
|
-
}
|
3753
|
+
}, keyof XataRecord>;
|
3003
3754
|
|
3004
3755
|
/**
|
3005
3756
|
* PropertyMatchFilter
|
@@ -3084,16 +3835,94 @@ declare type AggregatorFilter<T> = {
|
|
3084
3835
|
declare type ExistanceFilter<Record> = {
|
3085
3836
|
[key in '$exists' | '$notExists']?: SelectableColumn<Record>;
|
3086
3837
|
};
|
3087
|
-
declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
|
3088
|
-
/**
|
3089
|
-
* Nested filter
|
3090
|
-
* Injects the Api filters on nested properties
|
3091
|
-
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
3092
|
-
*/
|
3093
|
-
declare type NestedApiFilter<T> = {
|
3094
|
-
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3838
|
+
declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFilter<Record> | ExistanceFilter<Record>;
|
3839
|
+
/**
|
3840
|
+
* Nested filter
|
3841
|
+
* Injects the Api filters on nested properties
|
3842
|
+
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
3843
|
+
*/
|
3844
|
+
declare type NestedApiFilter<T> = {
|
3845
|
+
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3846
|
+
};
|
3847
|
+
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>;
|
3848
|
+
|
3849
|
+
declare type DateBooster = {
|
3850
|
+
origin?: string;
|
3851
|
+
scale: string;
|
3852
|
+
decay: number;
|
3853
|
+
};
|
3854
|
+
declare type NumericBooster = {
|
3855
|
+
factor: number;
|
3856
|
+
};
|
3857
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
3858
|
+
value: T;
|
3859
|
+
factor: number;
|
3860
|
+
};
|
3861
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
3862
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
3863
|
+
dateBooster: {
|
3864
|
+
column: K;
|
3865
|
+
} & DateBooster;
|
3866
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
3867
|
+
numericBooster?: {
|
3868
|
+
column: K;
|
3869
|
+
} & NumericBooster;
|
3870
|
+
}, {
|
3871
|
+
valueBooster?: {
|
3872
|
+
column: K;
|
3873
|
+
} & ValueBooster<number>;
|
3874
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
3875
|
+
valueBooster: {
|
3876
|
+
column: K;
|
3877
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
3878
|
+
} : never;
|
3879
|
+
}>;
|
3880
|
+
|
3881
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3882
|
+
fuzziness?: FuzzinessExpression;
|
3883
|
+
prefix?: PrefixExpression;
|
3884
|
+
highlight?: HighlightExpression;
|
3885
|
+
tables?: Array<Tables | Values<{
|
3886
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3887
|
+
table: Model;
|
3888
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
3889
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
3890
|
+
};
|
3891
|
+
}>>;
|
3892
|
+
};
|
3893
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3894
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3895
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3896
|
+
table: Model;
|
3897
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
3898
|
+
};
|
3899
|
+
}>[]>;
|
3900
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3901
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
3902
|
+
}>;
|
3903
|
+
};
|
3904
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3905
|
+
#private;
|
3906
|
+
private db;
|
3907
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3908
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3909
|
+
}
|
3910
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
3911
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
3912
|
+
};
|
3913
|
+
declare type SearchExtraProperties = {
|
3914
|
+
table: string;
|
3915
|
+
highlight?: {
|
3916
|
+
[key: string]: string[] | {
|
3917
|
+
[key: string]: any;
|
3918
|
+
};
|
3919
|
+
};
|
3920
|
+
score?: number;
|
3095
3921
|
};
|
3096
|
-
declare type
|
3922
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3923
|
+
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 {
|
3924
|
+
table: infer Table;
|
3925
|
+
} ? ReturnTable<Table, Tables> : never;
|
3097
3926
|
|
3098
3927
|
declare type SortDirection = 'asc' | 'desc';
|
3099
3928
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -3106,7 +3935,7 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
3106
3935
|
};
|
3107
3936
|
|
3108
3937
|
declare type BaseOptions<T extends XataRecord> = {
|
3109
|
-
columns?:
|
3938
|
+
columns?: SelectableColumn<T>[];
|
3110
3939
|
cache?: number;
|
3111
3940
|
};
|
3112
3941
|
declare type CursorQueryOptions = {
|
@@ -3130,7 +3959,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3130
3959
|
#private;
|
3131
3960
|
readonly meta: PaginationQueryMeta;
|
3132
3961
|
readonly records: RecordArray<Result>;
|
3133
|
-
constructor(repository: Repository<Record> | null, table:
|
3962
|
+
constructor(repository: Repository<Record> | null, table: {
|
3963
|
+
name: string;
|
3964
|
+
schema?: Table;
|
3965
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3134
3966
|
getQueryOptions(): QueryOptions<Record>;
|
3135
3967
|
key(): string;
|
3136
3968
|
/**
|
@@ -3169,7 +4001,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3169
4001
|
* @param value The value to filter.
|
3170
4002
|
* @returns A new Query object.
|
3171
4003
|
*/
|
3172
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F
|
4004
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
3173
4005
|
/**
|
3174
4006
|
* Builds a new query object adding one or more constraints. Examples:
|
3175
4007
|
*
|
@@ -3183,20 +4015,23 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3183
4015
|
* @param filters A filter object
|
3184
4016
|
* @returns A new Query object.
|
3185
4017
|
*/
|
3186
|
-
filter(filters
|
4018
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
4019
|
+
defaultFilter<T>(column: string, value: T): T | {
|
4020
|
+
$includes: (T & string) | (T & string[]);
|
4021
|
+
};
|
3187
4022
|
/**
|
3188
4023
|
* Builds a new query with a new sort option.
|
3189
4024
|
* @param column The column name.
|
3190
4025
|
* @param direction The direction. Either ascending or descending.
|
3191
4026
|
* @returns A new Query object.
|
3192
4027
|
*/
|
3193
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
4028
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
3194
4029
|
/**
|
3195
4030
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
3196
4031
|
* @param columns Array of column names to be returned by the query.
|
3197
4032
|
* @returns A new Query object.
|
3198
4033
|
*/
|
3199
|
-
select<K extends SelectableColumn<Record>>(columns:
|
4034
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
3200
4035
|
/**
|
3201
4036
|
* Get paginated results
|
3202
4037
|
*
|
@@ -3306,6 +4141,26 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3306
4141
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3307
4142
|
*/
|
3308
4143
|
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
4144
|
+
/**
|
4145
|
+
* Performs the query in the database and returns the first result.
|
4146
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4147
|
+
* @throws if there are no results.
|
4148
|
+
*/
|
4149
|
+
getFirstOrThrow(): Promise<Result>;
|
4150
|
+
/**
|
4151
|
+
* Performs the query in the database and returns the first result.
|
4152
|
+
* @param options Additional options to be used when performing the query.
|
4153
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4154
|
+
* @throws if there are no results.
|
4155
|
+
*/
|
4156
|
+
getFirstOrThrow<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>>;
|
4157
|
+
/**
|
4158
|
+
* Performs the query in the database and returns the first result.
|
4159
|
+
* @param options Additional options to be used when performing the query.
|
4160
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
4161
|
+
* @throws if there are no results.
|
4162
|
+
*/
|
4163
|
+
getFirstOrThrow(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result>;
|
3309
4164
|
/**
|
3310
4165
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3311
4166
|
* @param ttl The cache TTL in milliseconds.
|
@@ -3462,21 +4317,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3462
4317
|
/**
|
3463
4318
|
* Common interface for performing operations on a table.
|
3464
4319
|
*/
|
3465
|
-
declare abstract class Repository<
|
3466
|
-
abstract create(object: Omit<EditableData<
|
4320
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
4321
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4322
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4323
|
+
/**
|
4324
|
+
* Creates a single record in the table with a unique id.
|
4325
|
+
* @param id The unique id.
|
4326
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
4327
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4328
|
+
* @returns The full persisted record.
|
4329
|
+
*/
|
4330
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3467
4331
|
/**
|
3468
4332
|
* Creates a single record in the table with a unique id.
|
3469
4333
|
* @param id The unique id.
|
3470
4334
|
* @param object Object containing the column names with their values to be stored in the table.
|
3471
4335
|
* @returns The full persisted record.
|
3472
4336
|
*/
|
3473
|
-
abstract create(id: string, object: Omit<EditableData<
|
4337
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3474
4338
|
/**
|
3475
4339
|
* Creates multiple records in the table.
|
3476
4340
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3477
|
-
* @
|
4341
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4342
|
+
* @returns Array of the persisted records in order.
|
4343
|
+
*/
|
4344
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4345
|
+
/**
|
4346
|
+
* Creates multiple records in the table.
|
4347
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
4348
|
+
* @returns Array of the persisted records in order.
|
4349
|
+
*/
|
4350
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4351
|
+
/**
|
4352
|
+
* Queries a single record from the table given its unique id.
|
4353
|
+
* @param id The unique id.
|
4354
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4355
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3478
4356
|
*/
|
3479
|
-
abstract
|
4357
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3480
4358
|
/**
|
3481
4359
|
* Queries a single record from the table given its unique id.
|
3482
4360
|
* @param id The unique id.
|
@@ -3486,9 +4364,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3486
4364
|
/**
|
3487
4365
|
* Queries multiple records from the table given their unique id.
|
3488
4366
|
* @param ids The unique ids array.
|
3489
|
-
* @
|
4367
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4368
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4369
|
+
*/
|
4370
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4371
|
+
/**
|
4372
|
+
* Queries multiple records from the table given their unique id.
|
4373
|
+
* @param ids The unique ids array.
|
4374
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4375
|
+
*/
|
4376
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4377
|
+
/**
|
4378
|
+
* Queries a single record from the table by the id in the object.
|
4379
|
+
* @param object Object containing the id of the record.
|
4380
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4381
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3490
4382
|
*/
|
3491
|
-
abstract read(
|
4383
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3492
4384
|
/**
|
3493
4385
|
* Queries a single record from the table by the id in the object.
|
3494
4386
|
* @param object Object containing the id of the record.
|
@@ -3498,35 +4390,188 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3498
4390
|
/**
|
3499
4391
|
* Queries multiple records from the table by the ids in the objects.
|
3500
4392
|
* @param objects Array of objects containing the ids of the records.
|
3501
|
-
* @
|
4393
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4394
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4395
|
+
*/
|
4396
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4397
|
+
/**
|
4398
|
+
* Queries multiple records from the table by the ids in the objects.
|
4399
|
+
* @param objects Array of objects containing the ids of the records.
|
4400
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4401
|
+
*/
|
4402
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4403
|
+
/**
|
4404
|
+
* Queries a single record from the table given its unique id.
|
4405
|
+
* @param id The unique id.
|
4406
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4407
|
+
* @returns The persisted record for the given id.
|
4408
|
+
* @throws If the record could not be found.
|
4409
|
+
*/
|
4410
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4411
|
+
/**
|
4412
|
+
* Queries a single record from the table given its unique id.
|
4413
|
+
* @param id The unique id.
|
4414
|
+
* @returns The persisted record for the given id.
|
4415
|
+
* @throws If the record could not be found.
|
4416
|
+
*/
|
4417
|
+
abstract readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4418
|
+
/**
|
4419
|
+
* Queries multiple records from the table given their unique id.
|
4420
|
+
* @param ids The unique ids array.
|
4421
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4422
|
+
* @returns The persisted records for the given ids in order.
|
4423
|
+
* @throws If one or more records could not be found.
|
4424
|
+
*/
|
4425
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4426
|
+
/**
|
4427
|
+
* Queries multiple records from the table given their unique id.
|
4428
|
+
* @param ids The unique ids array.
|
4429
|
+
* @returns The persisted records for the given ids in order.
|
4430
|
+
* @throws If one or more records could not be found.
|
4431
|
+
*/
|
4432
|
+
abstract readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
4433
|
+
/**
|
4434
|
+
* Queries a single record from the table by the id in the object.
|
4435
|
+
* @param object Object containing the id of the record.
|
4436
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4437
|
+
* @returns The persisted record for the given id.
|
4438
|
+
* @throws If the record could not be found.
|
4439
|
+
*/
|
4440
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4441
|
+
/**
|
4442
|
+
* Queries a single record from the table by the id in the object.
|
4443
|
+
* @param object Object containing the id of the record.
|
4444
|
+
* @returns The persisted record for the given id.
|
4445
|
+
* @throws If the record could not be found.
|
4446
|
+
*/
|
4447
|
+
abstract readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4448
|
+
/**
|
4449
|
+
* Queries multiple records from the table by the ids in the objects.
|
4450
|
+
* @param objects Array of objects containing the ids of the records.
|
4451
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4452
|
+
* @returns The persisted records for the given ids in order.
|
4453
|
+
* @throws If one or more records could not be found.
|
4454
|
+
*/
|
4455
|
+
abstract readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4456
|
+
/**
|
4457
|
+
* Queries multiple records from the table by the ids in the objects.
|
4458
|
+
* @param objects Array of objects containing the ids of the records.
|
4459
|
+
* @returns The persisted records for the given ids in order.
|
4460
|
+
* @throws If one or more records could not be found.
|
4461
|
+
*/
|
4462
|
+
abstract readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
4463
|
+
/**
|
4464
|
+
* Partially update a single record.
|
4465
|
+
* @param object An object with its id and the columns to be updated.
|
4466
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4467
|
+
* @returns The full persisted record, null if the record could not be found.
|
4468
|
+
*/
|
4469
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4470
|
+
/**
|
4471
|
+
* Partially update a single record.
|
4472
|
+
* @param object An object with its id and the columns to be updated.
|
4473
|
+
* @returns The full persisted record, null if the record could not be found.
|
4474
|
+
*/
|
4475
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4476
|
+
/**
|
4477
|
+
* Partially update a single record given its unique id.
|
4478
|
+
* @param id The unique id.
|
4479
|
+
* @param object The column names and their values that have to be updated.
|
4480
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4481
|
+
* @returns The full persisted record, null if the record could not be found.
|
4482
|
+
*/
|
4483
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4484
|
+
/**
|
4485
|
+
* Partially update a single record given its unique id.
|
4486
|
+
* @param id The unique id.
|
4487
|
+
* @param object The column names and their values that have to be updated.
|
4488
|
+
* @returns The full persisted record, null if the record could not be found.
|
4489
|
+
*/
|
4490
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4491
|
+
/**
|
4492
|
+
* Partially updates multiple records.
|
4493
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
4494
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4495
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
4496
|
+
*/
|
4497
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4498
|
+
/**
|
4499
|
+
* Partially updates multiple records.
|
4500
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
4501
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
4502
|
+
*/
|
4503
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4504
|
+
/**
|
4505
|
+
* Partially update a single record.
|
4506
|
+
* @param object An object with its id and the columns to be updated.
|
4507
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4508
|
+
* @returns The full persisted record.
|
4509
|
+
* @throws If the record could not be found.
|
3502
4510
|
*/
|
3503
|
-
abstract
|
4511
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3504
4512
|
/**
|
3505
4513
|
* Partially update a single record.
|
3506
4514
|
* @param object An object with its id and the columns to be updated.
|
3507
4515
|
* @returns The full persisted record.
|
4516
|
+
* @throws If the record could not be found.
|
4517
|
+
*/
|
4518
|
+
abstract updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4519
|
+
/**
|
4520
|
+
* Partially update a single record given its unique id.
|
4521
|
+
* @param id The unique id.
|
4522
|
+
* @param object The column names and their values that have to be updated.
|
4523
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4524
|
+
* @returns The full persisted record.
|
4525
|
+
* @throws If the record could not be found.
|
3508
4526
|
*/
|
3509
|
-
abstract
|
4527
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3510
4528
|
/**
|
3511
4529
|
* Partially update a single record given its unique id.
|
3512
4530
|
* @param id The unique id.
|
3513
4531
|
* @param object The column names and their values that have to be updated.
|
3514
4532
|
* @returns The full persisted record.
|
4533
|
+
* @throws If the record could not be found.
|
3515
4534
|
*/
|
3516
|
-
abstract
|
4535
|
+
abstract updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3517
4536
|
/**
|
3518
4537
|
* Partially updates multiple records.
|
3519
4538
|
* @param objects An array of objects with their ids and columns to be updated.
|
3520
|
-
* @
|
4539
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4540
|
+
* @returns Array of the persisted records in order.
|
4541
|
+
* @throws If one or more records could not be found.
|
4542
|
+
*/
|
4543
|
+
abstract updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4544
|
+
/**
|
4545
|
+
* Partially updates multiple records.
|
4546
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
4547
|
+
* @returns Array of the persisted records in order.
|
4548
|
+
* @throws If one or more records could not be found.
|
4549
|
+
*/
|
4550
|
+
abstract updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4551
|
+
/**
|
4552
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4553
|
+
* it will be update, otherwise a new record will be created.
|
4554
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
4555
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4556
|
+
* @returns The full persisted record.
|
3521
4557
|
*/
|
3522
|
-
abstract
|
4558
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3523
4559
|
/**
|
3524
4560
|
* Creates or updates a single record. If a record exists with the given id,
|
3525
4561
|
* it will be update, otherwise a new record will be created.
|
3526
4562
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3527
4563
|
* @returns The full persisted record.
|
3528
4564
|
*/
|
3529
|
-
abstract createOrUpdate(object: EditableData<
|
4565
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4566
|
+
/**
|
4567
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4568
|
+
* it will be update, otherwise a new record will be created.
|
4569
|
+
* @param id A unique id.
|
4570
|
+
* @param object The column names and the values to be persisted.
|
4571
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4572
|
+
* @returns The full persisted record.
|
4573
|
+
*/
|
4574
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3530
4575
|
/**
|
3531
4576
|
* Creates or updates a single record. If a record exists with the given id,
|
3532
4577
|
* it will be update, otherwise a new record will be created.
|
@@ -3534,38 +4579,134 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3534
4579
|
* @param object The column names and the values to be persisted.
|
3535
4580
|
* @returns The full persisted record.
|
3536
4581
|
*/
|
3537
|
-
abstract createOrUpdate(id: string, object: Omit<EditableData<
|
4582
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4583
|
+
/**
|
4584
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4585
|
+
* it will be update, otherwise a new record will be created.
|
4586
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
4587
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4588
|
+
* @returns Array of the persisted records.
|
4589
|
+
*/
|
4590
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3538
4591
|
/**
|
3539
4592
|
* Creates or updates a single record. If a record exists with the given id,
|
3540
4593
|
* it will be update, otherwise a new record will be created.
|
3541
4594
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3542
4595
|
* @returns Array of the persisted records.
|
3543
4596
|
*/
|
3544
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
4597
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3545
4598
|
/**
|
3546
4599
|
* Deletes a record given its unique id.
|
4600
|
+
* @param object An object with a unique id.
|
4601
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4602
|
+
* @returns The deleted record, null if the record could not be found.
|
4603
|
+
*/
|
4604
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4605
|
+
/**
|
4606
|
+
* Deletes a record given its unique id.
|
4607
|
+
* @param object An object with a unique id.
|
4608
|
+
* @returns The deleted record, null if the record could not be found.
|
4609
|
+
*/
|
4610
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4611
|
+
/**
|
4612
|
+
* Deletes a record given a unique id.
|
4613
|
+
* @param id The unique id.
|
4614
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4615
|
+
* @returns The deleted record, null if the record could not be found.
|
4616
|
+
*/
|
4617
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4618
|
+
/**
|
4619
|
+
* Deletes a record given a unique id.
|
3547
4620
|
* @param id The unique id.
|
3548
|
-
* @
|
4621
|
+
* @returns The deleted record, null if the record could not be found.
|
4622
|
+
*/
|
4623
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4624
|
+
/**
|
4625
|
+
* Deletes multiple records given an array of objects with ids.
|
4626
|
+
* @param objects An array of objects with unique ids.
|
4627
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4628
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4629
|
+
*/
|
4630
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4631
|
+
/**
|
4632
|
+
* Deletes multiple records given an array of objects with ids.
|
4633
|
+
* @param objects An array of objects with unique ids.
|
4634
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3549
4635
|
*/
|
3550
|
-
abstract delete(
|
4636
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4637
|
+
/**
|
4638
|
+
* Deletes multiple records given an array of unique ids.
|
4639
|
+
* @param objects An array of ids.
|
4640
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4641
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4642
|
+
*/
|
4643
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4644
|
+
/**
|
4645
|
+
* Deletes multiple records given an array of unique ids.
|
4646
|
+
* @param objects An array of ids.
|
4647
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4648
|
+
*/
|
4649
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3551
4650
|
/**
|
3552
4651
|
* Deletes a record given its unique id.
|
3553
|
-
* @param
|
3554
|
-
* @
|
4652
|
+
* @param object An object with a unique id.
|
4653
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4654
|
+
* @returns The deleted record, null if the record could not be found.
|
4655
|
+
* @throws If the record could not be found.
|
4656
|
+
*/
|
4657
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4658
|
+
/**
|
4659
|
+
* Deletes a record given its unique id.
|
4660
|
+
* @param object An object with a unique id.
|
4661
|
+
* @returns The deleted record, null if the record could not be found.
|
4662
|
+
* @throws If the record could not be found.
|
4663
|
+
*/
|
4664
|
+
abstract deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4665
|
+
/**
|
4666
|
+
* Deletes a record given a unique id.
|
4667
|
+
* @param id The unique id.
|
4668
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4669
|
+
* @returns The deleted record, null if the record could not be found.
|
4670
|
+
* @throws If the record could not be found.
|
4671
|
+
*/
|
4672
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4673
|
+
/**
|
4674
|
+
* Deletes a record given a unique id.
|
4675
|
+
* @param id The unique id.
|
4676
|
+
* @returns The deleted record, null if the record could not be found.
|
4677
|
+
* @throws If the record could not be found.
|
4678
|
+
*/
|
4679
|
+
abstract deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4680
|
+
/**
|
4681
|
+
* Deletes multiple records given an array of objects with ids.
|
4682
|
+
* @param objects An array of objects with unique ids.
|
4683
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4684
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4685
|
+
* @throws If one or more records could not be found.
|
4686
|
+
*/
|
4687
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4688
|
+
/**
|
4689
|
+
* Deletes multiple records given an array of objects with ids.
|
4690
|
+
* @param objects An array of objects with unique ids.
|
4691
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4692
|
+
* @throws If one or more records could not be found.
|
3555
4693
|
*/
|
3556
|
-
abstract
|
4694
|
+
abstract deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3557
4695
|
/**
|
3558
|
-
* Deletes
|
3559
|
-
* @param
|
3560
|
-
* @
|
4696
|
+
* Deletes multiple records given an array of unique ids.
|
4697
|
+
* @param objects An array of ids.
|
4698
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4699
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4700
|
+
* @throws If one or more records could not be found.
|
3561
4701
|
*/
|
3562
|
-
abstract
|
4702
|
+
abstract deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3563
4703
|
/**
|
3564
|
-
* Deletes
|
3565
|
-
* @param
|
3566
|
-
* @
|
4704
|
+
* Deletes multiple records given an array of unique ids.
|
4705
|
+
* @param objects An array of ids.
|
4706
|
+
* @returns Array of the deleted records in order.
|
4707
|
+
* @throws If one or more records could not be found.
|
3567
4708
|
*/
|
3568
|
-
abstract
|
4709
|
+
abstract deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3569
4710
|
/**
|
3570
4711
|
* Search for records in the table.
|
3571
4712
|
* @param query The query to search for.
|
@@ -3574,39 +4715,84 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3574
4715
|
*/
|
3575
4716
|
abstract search(query: string, options?: {
|
3576
4717
|
fuzziness?: FuzzinessExpression;
|
4718
|
+
prefix?: PrefixExpression;
|
3577
4719
|
highlight?: HighlightExpression;
|
3578
4720
|
filter?: Filter<Record>;
|
3579
|
-
|
4721
|
+
boosters?: Boosters<Record>[];
|
4722
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3580
4723
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3581
4724
|
}
|
3582
|
-
declare class RestRepository<
|
4725
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3583
4726
|
#private;
|
3584
|
-
db: SchemaPluginResult<any>;
|
3585
4727
|
constructor(options: {
|
3586
4728
|
table: string;
|
3587
4729
|
db: SchemaPluginResult<any>;
|
3588
4730
|
pluginOptions: XataPluginOptions;
|
3589
4731
|
schemaTables?: Table[];
|
3590
4732
|
});
|
3591
|
-
create(object: EditableData<
|
3592
|
-
create(
|
3593
|
-
create(
|
3594
|
-
|
3595
|
-
|
3596
|
-
|
3597
|
-
read(
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3601
|
-
|
3602
|
-
|
3603
|
-
|
3604
|
-
|
4733
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4734
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4735
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4736
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4737
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4738
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4739
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
4740
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
4741
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4742
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4743
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
4744
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
4745
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4746
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4747
|
+
readOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4748
|
+
readOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4749
|
+
readOrThrow<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4750
|
+
readOrThrow(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
4751
|
+
readOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4752
|
+
readOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4753
|
+
readOrThrow<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4754
|
+
readOrThrow(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
4755
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4756
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4757
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4758
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4759
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4760
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4761
|
+
updateOrThrow<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4762
|
+
updateOrThrow(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4763
|
+
updateOrThrow<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4764
|
+
updateOrThrow(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4765
|
+
updateOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4766
|
+
updateOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4767
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4768
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4769
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4770
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4771
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4772
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4773
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4774
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4775
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4776
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4777
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4778
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4779
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4780
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4781
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4782
|
+
deleteOrThrow(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4783
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4784
|
+
deleteOrThrow(id: string): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4785
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4786
|
+
deleteOrThrow(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
4787
|
+
deleteOrThrow<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
4788
|
+
deleteOrThrow(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3605
4789
|
search(query: string, options?: {
|
3606
4790
|
fuzziness?: FuzzinessExpression;
|
4791
|
+
prefix?: PrefixExpression;
|
3607
4792
|
highlight?: HighlightExpression;
|
3608
4793
|
filter?: Filter<Record>;
|
3609
|
-
|
4794
|
+
boosters?: Boosters<Record>[];
|
4795
|
+
}): Promise<any>;
|
3610
4796
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3611
4797
|
}
|
3612
4798
|
|
@@ -3615,6 +4801,7 @@ declare type BaseSchema = {
|
|
3615
4801
|
columns: readonly ({
|
3616
4802
|
name: string;
|
3617
4803
|
type: Column['type'];
|
4804
|
+
notNull?: boolean;
|
3618
4805
|
} | {
|
3619
4806
|
name: string;
|
3620
4807
|
type: 'link';
|
@@ -3644,10 +4831,10 @@ declare type TableType<Tables, TableName> = Tables & {
|
|
3644
4831
|
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3645
4832
|
name: string;
|
3646
4833
|
type: string;
|
3647
|
-
} ? Identifiable & {
|
3648
|
-
[K in Columns[number]['name']]
|
3649
|
-
} : never : never : never : never;
|
3650
|
-
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
4834
|
+
} ? Identifiable & UnionToIntersection<Values<{
|
4835
|
+
[K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
|
4836
|
+
}>> : never : never : never : never;
|
4837
|
+
declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
|
3651
4838
|
name: PropertyName;
|
3652
4839
|
} extends infer Property ? Property extends {
|
3653
4840
|
name: string;
|
@@ -3656,13 +4843,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
|
3656
4843
|
table: infer LinkedTable;
|
3657
4844
|
};
|
3658
4845
|
columns?: infer ObjectColumns;
|
3659
|
-
|
4846
|
+
notNull?: infer NotNull;
|
4847
|
+
} ? NotNull extends true ? {
|
4848
|
+
[K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
|
4849
|
+
} : {
|
4850
|
+
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
4851
|
+
} : never : never;
|
4852
|
+
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 {
|
3660
4853
|
name: string;
|
3661
4854
|
type: string;
|
3662
|
-
} ? {
|
3663
|
-
[K in ObjectColumns[number]['name']]
|
3664
|
-
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never
|
4855
|
+
} ? UnionToIntersection<Values<{
|
4856
|
+
[K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
|
4857
|
+
}>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
|
3665
4858
|
|
4859
|
+
/**
|
4860
|
+
* Operator to restrict results to only values that are greater than the given value.
|
4861
|
+
*/
|
4862
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3666
4863
|
/**
|
3667
4864
|
* Operator to restrict results to only values that are greater than the given value.
|
3668
4865
|
*/
|
@@ -3670,15 +4867,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3670
4867
|
/**
|
3671
4868
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3672
4869
|
*/
|
3673
|
-
declare const
|
4870
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4871
|
+
/**
|
4872
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
4873
|
+
*/
|
4874
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3674
4875
|
/**
|
3675
4876
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3676
4877
|
*/
|
3677
4878
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4879
|
+
/**
|
4880
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
4881
|
+
*/
|
4882
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4883
|
+
/**
|
4884
|
+
* Operator to restrict results to only values that are lower than the given value.
|
4885
|
+
*/
|
4886
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3678
4887
|
/**
|
3679
4888
|
* Operator to restrict results to only values that are lower than the given value.
|
3680
4889
|
*/
|
3681
4890
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4891
|
+
/**
|
4892
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
4893
|
+
*/
|
4894
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4895
|
+
/**
|
4896
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
4897
|
+
*/
|
4898
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3682
4899
|
/**
|
3683
4900
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3684
4901
|
*/
|
@@ -3711,6 +4928,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3711
4928
|
* Operator to restrict results to only values that are equal to the given value.
|
3712
4929
|
*/
|
3713
4930
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
4931
|
+
/**
|
4932
|
+
* Operator to restrict results to only values that are equal to the given value.
|
4933
|
+
*/
|
4934
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
3714
4935
|
/**
|
3715
4936
|
* Operator to restrict results to only values that are not equal to the given value.
|
3716
4937
|
*/
|
@@ -3739,58 +4960,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3739
4960
|
declare type SchemaDefinition = {
|
3740
4961
|
table: string;
|
3741
4962
|
};
|
3742
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
4963
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
3743
4964
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3744
|
-
} & {
|
3745
|
-
[key: string]: Repository<XataRecord$1>;
|
3746
4965
|
};
|
3747
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
4966
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3748
4967
|
#private;
|
3749
4968
|
constructor(schemaTables?: Schemas.Table[]);
|
3750
4969
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3751
4970
|
}
|
3752
4971
|
|
3753
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3754
|
-
fuzziness?: FuzzinessExpression;
|
3755
|
-
highlight?: HighlightExpression;
|
3756
|
-
tables?: Array<Tables | Values<{
|
3757
|
-
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3758
|
-
table: Model;
|
3759
|
-
filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3760
|
-
};
|
3761
|
-
}>>;
|
3762
|
-
};
|
3763
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3764
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3765
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3766
|
-
table: Model;
|
3767
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3768
|
-
};
|
3769
|
-
}>[]>;
|
3770
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3771
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3772
|
-
}>;
|
3773
|
-
};
|
3774
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3775
|
-
#private;
|
3776
|
-
private db;
|
3777
|
-
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3778
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3779
|
-
}
|
3780
|
-
declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
|
3781
|
-
declare type SearchExtraProperties = {
|
3782
|
-
table: string;
|
3783
|
-
highlight?: {
|
3784
|
-
[key: string]: string[] | {
|
3785
|
-
[key: string]: any;
|
3786
|
-
};
|
3787
|
-
};
|
3788
|
-
};
|
3789
|
-
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3790
|
-
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 {
|
3791
|
-
table: infer Table;
|
3792
|
-
} ? ReturnTable<Table, Tables> : never;
|
3793
|
-
|
3794
4972
|
declare type BranchStrategyValue = string | undefined | null;
|
3795
4973
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3796
4974
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3802,28 +4980,34 @@ declare type BaseClientOptions = {
|
|
3802
4980
|
databaseURL?: string;
|
3803
4981
|
branch?: BranchStrategyOption;
|
3804
4982
|
cache?: CacheImpl;
|
4983
|
+
trace?: TraceFunction;
|
3805
4984
|
};
|
3806
4985
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3807
4986
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3808
|
-
new <
|
3809
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
3810
|
-
search: Awaited<ReturnType<SearchPlugin<
|
4987
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
4988
|
+
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
4989
|
+
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3811
4990
|
}, keyof Plugins> & {
|
3812
4991
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
4992
|
+
} & {
|
4993
|
+
getConfig(): Promise<{
|
4994
|
+
databaseURL: string;
|
4995
|
+
branch: string;
|
4996
|
+
}>;
|
3813
4997
|
};
|
3814
4998
|
}
|
3815
4999
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3816
|
-
declare class BaseClient extends BaseClient_base<
|
5000
|
+
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
3817
5001
|
}
|
3818
5002
|
|
3819
5003
|
declare class Serializer {
|
3820
|
-
classes:
|
5004
|
+
classes: Record<string, any>;
|
3821
5005
|
add(clazz: any): void;
|
3822
|
-
toJSON(data:
|
3823
|
-
fromJSON(json:
|
5006
|
+
toJSON<T>(data: T): string;
|
5007
|
+
fromJSON<T>(json: string): T;
|
3824
5008
|
}
|
3825
|
-
declare const serialize: () =>
|
3826
|
-
declare const deserialize: () =>
|
5009
|
+
declare const serialize: <T>(data: T) => string;
|
5010
|
+
declare const deserialize: <T>(json: string) => T;
|
3827
5011
|
|
3828
5012
|
declare type BranchResolutionOptions = {
|
3829
5013
|
databaseURL?: string;
|
@@ -3911,8 +5095,8 @@ declare type XataWorkerContext<XataClient> = {
|
|
3911
5095
|
};
|
3912
5096
|
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
3913
5097
|
declare type WorkerRunnerConfig = {
|
5098
|
+
workspace: string;
|
3914
5099
|
worker: string;
|
3915
|
-
publicKey: string;
|
3916
5100
|
};
|
3917
5101
|
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>>>;
|
3918
5102
|
|
@@ -3921,4 +5105,4 @@ declare class XataError extends Error {
|
|
3921
5105
|
constructor(message: string, status: number);
|
3922
5106
|
}
|
3923
5107
|
|
3924
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, Serializer, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|
5108
|
+
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 };
|