@xata.io/client 0.0.0-alpha.vf45a2df → 0.0.0-alpha.vf4752f8
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 +88 -0
- package/README.md +27 -25
- package/Usage.md +60 -6
- package/dist/index.cjs +904 -435
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1365 -261
- package/dist/index.mjs +859 -436
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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
|
/**
|
@@ -125,16 +130,20 @@ 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
|
+
displayName: string;
|
139
|
+
createdAt: DateTime;
|
140
|
+
numberOfBranches: number;
|
141
|
+
ui?: {
|
142
|
+
color?: string;
|
143
|
+
};
|
144
|
+
};
|
128
145
|
declare type ListDatabasesResponse = {
|
129
|
-
databases?:
|
130
|
-
name: string;
|
131
|
-
displayName: string;
|
132
|
-
createdAt: DateTime;
|
133
|
-
numberOfBranches: number;
|
134
|
-
ui?: {
|
135
|
-
color?: string;
|
136
|
-
};
|
137
|
-
}[];
|
146
|
+
databases?: DatabaseMetadata[];
|
138
147
|
};
|
139
148
|
declare type ListBranchesResponse = {
|
140
149
|
databaseName: string;
|
@@ -184,12 +193,28 @@ declare type Schema = {
|
|
184
193
|
tables: Table[];
|
185
194
|
tablesOrder?: string[];
|
186
195
|
};
|
196
|
+
/**
|
197
|
+
* @x-internal true
|
198
|
+
*/
|
199
|
+
declare type SchemaEditScript = {
|
200
|
+
sourceMigrationID?: string;
|
201
|
+
targetMigrationID?: string;
|
202
|
+
tables: TableEdit[];
|
203
|
+
};
|
187
204
|
declare type Table = {
|
188
205
|
id?: string;
|
189
206
|
name: TableName;
|
190
207
|
columns: Column[];
|
191
208
|
revLinks?: RevLink[];
|
192
209
|
};
|
210
|
+
/**
|
211
|
+
* @x-internal true
|
212
|
+
*/
|
213
|
+
declare type TableEdit = {
|
214
|
+
oldName?: string;
|
215
|
+
newName?: string;
|
216
|
+
columns?: MigrationColumnOp[];
|
217
|
+
};
|
193
218
|
/**
|
194
219
|
* @x-go-type xata.Column
|
195
220
|
*/
|
@@ -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
|
} | {
|
@@ -303,6 +432,44 @@ declare type HighlightExpression = {
|
|
303
432
|
enabled?: boolean;
|
304
433
|
encodeHTML?: boolean;
|
305
434
|
};
|
435
|
+
/**
|
436
|
+
* Booster Expression
|
437
|
+
*
|
438
|
+
* @x-go-type xata.BoosterExpression
|
439
|
+
*/
|
440
|
+
declare type BoosterExpression = {
|
441
|
+
valueBooster?: ValueBooster$1;
|
442
|
+
} | {
|
443
|
+
numericBooster?: NumericBooster$1;
|
444
|
+
} | {
|
445
|
+
dateBooster?: DateBooster$1;
|
446
|
+
};
|
447
|
+
/**
|
448
|
+
* Boost records with a particular value for a column.
|
449
|
+
*/
|
450
|
+
declare type ValueBooster$1 = {
|
451
|
+
column: string;
|
452
|
+
value: string | number | boolean;
|
453
|
+
factor: number;
|
454
|
+
};
|
455
|
+
/**
|
456
|
+
* Boost records based on the value of a numeric column.
|
457
|
+
*/
|
458
|
+
declare type NumericBooster$1 = {
|
459
|
+
column: string;
|
460
|
+
factor: number;
|
461
|
+
};
|
462
|
+
/**
|
463
|
+
* Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
|
464
|
+
* 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
|
465
|
+
* 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.
|
466
|
+
*/
|
467
|
+
declare type DateBooster$1 = {
|
468
|
+
column: string;
|
469
|
+
origin?: string;
|
470
|
+
scale: string;
|
471
|
+
decay: number;
|
472
|
+
};
|
306
473
|
declare type FilterList = FilterExpression | FilterExpression[];
|
307
474
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
308
475
|
/**
|
@@ -359,7 +526,24 @@ declare type PageConfig = {
|
|
359
526
|
size?: number;
|
360
527
|
offset?: number;
|
361
528
|
};
|
362
|
-
declare type
|
529
|
+
declare type ColumnsProjection = string[];
|
530
|
+
/**
|
531
|
+
* Xata Table Record Metadata
|
532
|
+
*/
|
533
|
+
declare type RecordMeta = {
|
534
|
+
id: RecordID;
|
535
|
+
xata: {
|
536
|
+
version: number;
|
537
|
+
table?: string;
|
538
|
+
highlight?: {
|
539
|
+
[key: string]: string[] | {
|
540
|
+
[key: string]: any;
|
541
|
+
};
|
542
|
+
};
|
543
|
+
score?: number;
|
544
|
+
warnings?: string[];
|
545
|
+
};
|
546
|
+
};
|
363
547
|
/**
|
364
548
|
* @pattern [a-zA-Z0-9_-~:]+
|
365
549
|
*/
|
@@ -381,21 +565,9 @@ declare type RecordsMetadata = {
|
|
381
565
|
};
|
382
566
|
};
|
383
567
|
/**
|
384
|
-
* Xata Table Record
|
568
|
+
* Xata Table Record Metadata
|
385
569
|
*/
|
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
|
-
} & {
|
570
|
+
declare type XataRecord$1 = RecordMeta & {
|
399
571
|
[key: string]: any;
|
400
572
|
};
|
401
573
|
|
@@ -413,6 +585,7 @@ type schemas_InviteID = InviteID;
|
|
413
585
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
414
586
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
415
587
|
type schemas_InviteKey = InviteKey;
|
588
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
416
589
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
417
590
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
418
591
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
@@ -421,7 +594,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
421
594
|
type schemas_DBBranch = DBBranch;
|
422
595
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
423
596
|
type schemas_Schema = Schema;
|
597
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
424
598
|
type schemas_Table = Table;
|
599
|
+
type schemas_TableEdit = TableEdit;
|
425
600
|
type schemas_Column = Column;
|
426
601
|
type schemas_RevLink = RevLink;
|
427
602
|
type schemas_BranchName = BranchName;
|
@@ -434,12 +609,25 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
434
609
|
type schemas_BranchMigration = BranchMigration;
|
435
610
|
type schemas_TableMigration = TableMigration;
|
436
611
|
type schemas_ColumnMigration = ColumnMigration;
|
612
|
+
type schemas_Commit = Commit;
|
613
|
+
type schemas_Migration = Migration;
|
614
|
+
type schemas_MigrationOp = MigrationOp;
|
615
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
616
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
617
|
+
type schemas_TableOpAdd = TableOpAdd;
|
618
|
+
type schemas_TableOpRemove = TableOpRemove;
|
619
|
+
type schemas_TableOpRename = TableOpRename;
|
620
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
621
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
622
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
623
|
+
type schemas_MigrationRequest = MigrationRequest;
|
437
624
|
type schemas_SortExpression = SortExpression;
|
438
625
|
type schemas_SortOrder = SortOrder;
|
439
626
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
440
627
|
type schemas_PrefixExpression = PrefixExpression;
|
441
628
|
type schemas_FilterExpression = FilterExpression;
|
442
629
|
type schemas_HighlightExpression = HighlightExpression;
|
630
|
+
type schemas_BoosterExpression = BoosterExpression;
|
443
631
|
type schemas_FilterList = FilterList;
|
444
632
|
type schemas_FilterColumn = FilterColumn;
|
445
633
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -449,7 +637,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
449
637
|
type schemas_FilterRangeValue = FilterRangeValue;
|
450
638
|
type schemas_FilterValue = FilterValue;
|
451
639
|
type schemas_PageConfig = PageConfig;
|
452
|
-
type
|
640
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
641
|
+
type schemas_RecordMeta = RecordMeta;
|
453
642
|
type schemas_RecordID = RecordID;
|
454
643
|
type schemas_TableRename = TableRename;
|
455
644
|
type schemas_RecordsMetadata = RecordsMetadata;
|
@@ -469,6 +658,7 @@ declare namespace schemas {
|
|
469
658
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
470
659
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
471
660
|
schemas_InviteKey as InviteKey,
|
661
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
472
662
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
473
663
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
474
664
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
@@ -477,7 +667,9 @@ declare namespace schemas {
|
|
477
667
|
schemas_DBBranch as DBBranch,
|
478
668
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
479
669
|
schemas_Schema as Schema,
|
670
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
480
671
|
schemas_Table as Table,
|
672
|
+
schemas_TableEdit as TableEdit,
|
481
673
|
schemas_Column as Column,
|
482
674
|
schemas_RevLink as RevLink,
|
483
675
|
schemas_BranchName as BranchName,
|
@@ -490,12 +682,28 @@ declare namespace schemas {
|
|
490
682
|
schemas_BranchMigration as BranchMigration,
|
491
683
|
schemas_TableMigration as TableMigration,
|
492
684
|
schemas_ColumnMigration as ColumnMigration,
|
685
|
+
schemas_Commit as Commit,
|
686
|
+
schemas_Migration as Migration,
|
687
|
+
schemas_MigrationOp as MigrationOp,
|
688
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
689
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
690
|
+
schemas_TableOpAdd as TableOpAdd,
|
691
|
+
schemas_TableOpRemove as TableOpRemove,
|
692
|
+
schemas_TableOpRename as TableOpRename,
|
693
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
694
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
695
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
696
|
+
schemas_MigrationRequest as MigrationRequest,
|
493
697
|
schemas_SortExpression as SortExpression,
|
494
698
|
schemas_SortOrder as SortOrder,
|
495
699
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
496
700
|
schemas_PrefixExpression as PrefixExpression,
|
497
701
|
schemas_FilterExpression as FilterExpression,
|
498
702
|
schemas_HighlightExpression as HighlightExpression,
|
703
|
+
schemas_BoosterExpression as BoosterExpression,
|
704
|
+
ValueBooster$1 as ValueBooster,
|
705
|
+
NumericBooster$1 as NumericBooster,
|
706
|
+
DateBooster$1 as DateBooster,
|
499
707
|
schemas_FilterList as FilterList,
|
500
708
|
schemas_FilterColumn as FilterColumn,
|
501
709
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -505,7 +713,8 @@ declare namespace schemas {
|
|
505
713
|
schemas_FilterRangeValue as FilterRangeValue,
|
506
714
|
schemas_FilterValue as FilterValue,
|
507
715
|
schemas_PageConfig as PageConfig,
|
508
|
-
|
716
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
717
|
+
schemas_RecordMeta as RecordMeta,
|
509
718
|
schemas_RecordID as RecordID,
|
510
719
|
schemas_TableRename as TableRename,
|
511
720
|
schemas_RecordsMetadata as RecordsMetadata,
|
@@ -540,11 +749,22 @@ declare type BulkError = {
|
|
540
749
|
status?: number;
|
541
750
|
}[];
|
542
751
|
};
|
752
|
+
declare type BulkInsertResponse = {
|
753
|
+
recordIDs: string[];
|
754
|
+
} | {
|
755
|
+
records: XataRecord$1[];
|
756
|
+
};
|
543
757
|
declare type BranchMigrationPlan = {
|
544
758
|
version: number;
|
545
759
|
migration: BranchMigration;
|
546
760
|
};
|
547
|
-
declare type
|
761
|
+
declare type RecordResponse = XataRecord$1;
|
762
|
+
declare type SchemaCompareResponse = {
|
763
|
+
source: Schema;
|
764
|
+
target: Schema;
|
765
|
+
edits: SchemaEditScript;
|
766
|
+
};
|
767
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
548
768
|
id: string;
|
549
769
|
xata: {
|
550
770
|
version: number;
|
@@ -568,7 +788,10 @@ type responses_SimpleError = SimpleError;
|
|
568
788
|
type responses_BadRequestError = BadRequestError;
|
569
789
|
type responses_AuthError = AuthError;
|
570
790
|
type responses_BulkError = BulkError;
|
791
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
571
792
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
793
|
+
type responses_RecordResponse = RecordResponse;
|
794
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
572
795
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
573
796
|
type responses_QueryResponse = QueryResponse;
|
574
797
|
type responses_SearchResponse = SearchResponse;
|
@@ -579,7 +802,10 @@ declare namespace responses {
|
|
579
802
|
responses_BadRequestError as BadRequestError,
|
580
803
|
responses_AuthError as AuthError,
|
581
804
|
responses_BulkError as BulkError,
|
805
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
582
806
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
807
|
+
responses_RecordResponse as RecordResponse,
|
808
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
583
809
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
584
810
|
responses_QueryResponse as QueryResponse,
|
585
811
|
responses_SearchResponse as SearchResponse,
|
@@ -885,6 +1111,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
885
1111
|
} | {
|
886
1112
|
status: 404;
|
887
1113
|
payload: SimpleError;
|
1114
|
+
} | {
|
1115
|
+
status: 409;
|
1116
|
+
payload: SimpleError;
|
888
1117
|
}>;
|
889
1118
|
declare type InviteWorkspaceMemberRequestBody = {
|
890
1119
|
email: string;
|
@@ -898,6 +1127,34 @@ declare type InviteWorkspaceMemberVariables = {
|
|
898
1127
|
* Invite some user to join the workspace with the given role
|
899
1128
|
*/
|
900
1129
|
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
1130
|
+
declare type UpdateWorkspaceMemberInvitePathParams = {
|
1131
|
+
workspaceId: WorkspaceID;
|
1132
|
+
inviteId: InviteID;
|
1133
|
+
};
|
1134
|
+
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
1135
|
+
status: 400;
|
1136
|
+
payload: BadRequestError;
|
1137
|
+
} | {
|
1138
|
+
status: 401;
|
1139
|
+
payload: AuthError;
|
1140
|
+
} | {
|
1141
|
+
status: 404;
|
1142
|
+
payload: SimpleError;
|
1143
|
+
} | {
|
1144
|
+
status: 422;
|
1145
|
+
payload: SimpleError;
|
1146
|
+
}>;
|
1147
|
+
declare type UpdateWorkspaceMemberInviteRequestBody = {
|
1148
|
+
role: Role;
|
1149
|
+
};
|
1150
|
+
declare type UpdateWorkspaceMemberInviteVariables = {
|
1151
|
+
body: UpdateWorkspaceMemberInviteRequestBody;
|
1152
|
+
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
1153
|
+
} & FetcherExtraProps;
|
1154
|
+
/**
|
1155
|
+
* 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.
|
1156
|
+
*/
|
1157
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
901
1158
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
902
1159
|
workspaceId: WorkspaceID;
|
903
1160
|
inviteId: InviteID;
|
@@ -1051,6 +1308,54 @@ declare type DeleteDatabaseVariables = {
|
|
1051
1308
|
* Delete a database and all of its branches and tables permanently.
|
1052
1309
|
*/
|
1053
1310
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1311
|
+
declare type GetDatabaseMetadataPathParams = {
|
1312
|
+
dbName: DBName;
|
1313
|
+
workspace: string;
|
1314
|
+
};
|
1315
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
1316
|
+
status: 400;
|
1317
|
+
payload: BadRequestError;
|
1318
|
+
} | {
|
1319
|
+
status: 401;
|
1320
|
+
payload: AuthError;
|
1321
|
+
} | {
|
1322
|
+
status: 404;
|
1323
|
+
payload: SimpleError;
|
1324
|
+
}>;
|
1325
|
+
declare type GetDatabaseMetadataVariables = {
|
1326
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1327
|
+
} & FetcherExtraProps;
|
1328
|
+
/**
|
1329
|
+
* Retrieve metadata of the given database
|
1330
|
+
*/
|
1331
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1332
|
+
declare type PatchDatabaseMetadataPathParams = {
|
1333
|
+
dbName: DBName;
|
1334
|
+
workspace: string;
|
1335
|
+
};
|
1336
|
+
declare type PatchDatabaseMetadataError = ErrorWrapper<{
|
1337
|
+
status: 400;
|
1338
|
+
payload: BadRequestError;
|
1339
|
+
} | {
|
1340
|
+
status: 401;
|
1341
|
+
payload: AuthError;
|
1342
|
+
} | {
|
1343
|
+
status: 404;
|
1344
|
+
payload: SimpleError;
|
1345
|
+
}>;
|
1346
|
+
declare type PatchDatabaseMetadataRequestBody = {
|
1347
|
+
ui?: {
|
1348
|
+
color?: string;
|
1349
|
+
};
|
1350
|
+
};
|
1351
|
+
declare type PatchDatabaseMetadataVariables = {
|
1352
|
+
body?: PatchDatabaseMetadataRequestBody;
|
1353
|
+
pathParams: PatchDatabaseMetadataPathParams;
|
1354
|
+
} & FetcherExtraProps;
|
1355
|
+
/**
|
1356
|
+
* Update the color of the selected database
|
1357
|
+
*/
|
1358
|
+
declare const patchDatabaseMetadata: (variables: PatchDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1054
1359
|
declare type GetGitBranchesMappingPathParams = {
|
1055
1360
|
dbName: DBName;
|
1056
1361
|
workspace: string;
|
@@ -1208,11 +1513,11 @@ declare type ResolveBranchVariables = {
|
|
1208
1513
|
* ```
|
1209
1514
|
*/
|
1210
1515
|
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1211
|
-
declare type
|
1212
|
-
|
1516
|
+
declare type ListMigrationRequestsPathParams = {
|
1517
|
+
dbName: DBName;
|
1213
1518
|
workspace: string;
|
1214
1519
|
};
|
1215
|
-
declare type
|
1520
|
+
declare type ListMigrationRequestsError = ErrorWrapper<{
|
1216
1521
|
status: 400;
|
1217
1522
|
payload: BadRequestError;
|
1218
1523
|
} | {
|
@@ -1222,18 +1527,26 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
1222
1527
|
status: 404;
|
1223
1528
|
payload: SimpleError;
|
1224
1529
|
}>;
|
1225
|
-
declare type
|
1226
|
-
|
1530
|
+
declare type ListMigrationRequestsResponse = {
|
1531
|
+
migrationRequests: MigrationRequest[];
|
1532
|
+
meta: RecordsMetadata;
|
1533
|
+
};
|
1534
|
+
declare type ListMigrationRequestsRequestBody = {
|
1535
|
+
filter?: FilterExpression;
|
1536
|
+
sort?: SortExpression;
|
1537
|
+
page?: PageConfig;
|
1538
|
+
columns?: ColumnsProjection;
|
1539
|
+
};
|
1540
|
+
declare type ListMigrationRequestsVariables = {
|
1541
|
+
body?: ListMigrationRequestsRequestBody;
|
1542
|
+
pathParams: ListMigrationRequestsPathParams;
|
1227
1543
|
} & FetcherExtraProps;
|
1228
|
-
declare const
|
1229
|
-
declare type
|
1230
|
-
|
1544
|
+
declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
1545
|
+
declare type CreateMigrationRequestPathParams = {
|
1546
|
+
dbName: DBName;
|
1231
1547
|
workspace: string;
|
1232
1548
|
};
|
1233
|
-
declare type
|
1234
|
-
from?: string;
|
1235
|
-
};
|
1236
|
-
declare type CreateBranchError = ErrorWrapper<{
|
1549
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
1237
1550
|
status: 400;
|
1238
1551
|
payload: BadRequestError;
|
1239
1552
|
} | {
|
@@ -1243,21 +1556,26 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1243
1556
|
status: 404;
|
1244
1557
|
payload: SimpleError;
|
1245
1558
|
}>;
|
1246
|
-
declare type
|
1247
|
-
|
1248
|
-
metadata?: BranchMetadata;
|
1559
|
+
declare type CreateMigrationRequestResponse = {
|
1560
|
+
number: number;
|
1249
1561
|
};
|
1250
|
-
declare type
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1562
|
+
declare type CreateMigrationRequestRequestBody = {
|
1563
|
+
source: string;
|
1564
|
+
target: string;
|
1565
|
+
title: string;
|
1566
|
+
body?: string;
|
1567
|
+
};
|
1568
|
+
declare type CreateMigrationRequestVariables = {
|
1569
|
+
body: CreateMigrationRequestRequestBody;
|
1570
|
+
pathParams: CreateMigrationRequestPathParams;
|
1254
1571
|
} & FetcherExtraProps;
|
1255
|
-
declare const
|
1256
|
-
declare type
|
1257
|
-
|
1572
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
1573
|
+
declare type GetMigrationRequestPathParams = {
|
1574
|
+
dbName: DBName;
|
1575
|
+
mrNumber: number;
|
1258
1576
|
workspace: string;
|
1259
1577
|
};
|
1260
|
-
declare type
|
1578
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
1261
1579
|
status: 400;
|
1262
1580
|
payload: BadRequestError;
|
1263
1581
|
} | {
|
@@ -1267,18 +1585,16 @@ declare type DeleteBranchError = ErrorWrapper<{
|
|
1267
1585
|
status: 404;
|
1268
1586
|
payload: SimpleError;
|
1269
1587
|
}>;
|
1270
|
-
declare type
|
1271
|
-
pathParams:
|
1588
|
+
declare type GetMigrationRequestVariables = {
|
1589
|
+
pathParams: GetMigrationRequestPathParams;
|
1272
1590
|
} & FetcherExtraProps;
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
declare type UpdateBranchMetadataPathParams = {
|
1278
|
-
dbBranchName: DBBranchName;
|
1591
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
1592
|
+
declare type UpdateMigrationRequestPathParams = {
|
1593
|
+
dbName: DBName;
|
1594
|
+
mrNumber: number;
|
1279
1595
|
workspace: string;
|
1280
1596
|
};
|
1281
|
-
declare type
|
1597
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
1282
1598
|
status: 400;
|
1283
1599
|
payload: BadRequestError;
|
1284
1600
|
} | {
|
@@ -1288,19 +1604,22 @@ declare type UpdateBranchMetadataError = ErrorWrapper<{
|
|
1288
1604
|
status: 404;
|
1289
1605
|
payload: SimpleError;
|
1290
1606
|
}>;
|
1291
|
-
declare type
|
1292
|
-
|
1293
|
-
|
1607
|
+
declare type UpdateMigrationRequestRequestBody = {
|
1608
|
+
title?: string;
|
1609
|
+
body?: string;
|
1610
|
+
status?: 'open' | 'closed';
|
1611
|
+
};
|
1612
|
+
declare type UpdateMigrationRequestVariables = {
|
1613
|
+
body?: UpdateMigrationRequestRequestBody;
|
1614
|
+
pathParams: UpdateMigrationRequestPathParams;
|
1294
1615
|
} & FetcherExtraProps;
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
declare type GetBranchMetadataPathParams = {
|
1300
|
-
dbBranchName: DBBranchName;
|
1616
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
1617
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
1618
|
+
dbName: DBName;
|
1619
|
+
mrNumber: number;
|
1301
1620
|
workspace: string;
|
1302
1621
|
};
|
1303
|
-
declare type
|
1622
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
1304
1623
|
status: 400;
|
1305
1624
|
payload: BadRequestError;
|
1306
1625
|
} | {
|
@@ -1310,15 +1629,31 @@ declare type GetBranchMetadataError = ErrorWrapper<{
|
|
1310
1629
|
status: 404;
|
1311
1630
|
payload: SimpleError;
|
1312
1631
|
}>;
|
1313
|
-
declare type
|
1314
|
-
|
1632
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
1633
|
+
meta: {
|
1634
|
+
cursor: string;
|
1635
|
+
more: boolean;
|
1636
|
+
};
|
1637
|
+
logs: Commit[];
|
1638
|
+
};
|
1639
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
1640
|
+
page?: {
|
1641
|
+
after?: string;
|
1642
|
+
before?: string;
|
1643
|
+
size?: number;
|
1644
|
+
};
|
1645
|
+
};
|
1646
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
1647
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
1648
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
1315
1649
|
} & FetcherExtraProps;
|
1316
|
-
declare const
|
1317
|
-
declare type
|
1318
|
-
|
1650
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
1651
|
+
declare type CompareMigrationRequestPathParams = {
|
1652
|
+
dbName: DBName;
|
1653
|
+
mrNumber: number;
|
1319
1654
|
workspace: string;
|
1320
1655
|
};
|
1321
|
-
declare type
|
1656
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
1322
1657
|
status: 400;
|
1323
1658
|
payload: BadRequestError;
|
1324
1659
|
} | {
|
@@ -1328,19 +1663,188 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
1328
1663
|
status: 404;
|
1329
1664
|
payload: SimpleError;
|
1330
1665
|
}>;
|
1331
|
-
declare type
|
1332
|
-
|
1333
|
-
migrations?: BranchMigration[];
|
1334
|
-
};
|
1335
|
-
declare type GetBranchMigrationHistoryRequestBody = {
|
1336
|
-
limit?: number;
|
1337
|
-
startFrom?: string;
|
1338
|
-
};
|
1339
|
-
declare type GetBranchMigrationHistoryVariables = {
|
1340
|
-
body?: GetBranchMigrationHistoryRequestBody;
|
1341
|
-
pathParams: GetBranchMigrationHistoryPathParams;
|
1666
|
+
declare type CompareMigrationRequestVariables = {
|
1667
|
+
pathParams: CompareMigrationRequestPathParams;
|
1342
1668
|
} & FetcherExtraProps;
|
1343
|
-
declare const
|
1669
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
1670
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
1671
|
+
dbName: DBName;
|
1672
|
+
mrNumber: number;
|
1673
|
+
workspace: string;
|
1674
|
+
};
|
1675
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
1676
|
+
status: 400;
|
1677
|
+
payload: BadRequestError;
|
1678
|
+
} | {
|
1679
|
+
status: 401;
|
1680
|
+
payload: AuthError;
|
1681
|
+
} | {
|
1682
|
+
status: 404;
|
1683
|
+
payload: SimpleError;
|
1684
|
+
}>;
|
1685
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
1686
|
+
merged?: boolean;
|
1687
|
+
};
|
1688
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
1689
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
1690
|
+
} & FetcherExtraProps;
|
1691
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
1692
|
+
declare type MergeMigrationRequestPathParams = {
|
1693
|
+
dbName: DBName;
|
1694
|
+
mrNumber: number;
|
1695
|
+
workspace: string;
|
1696
|
+
};
|
1697
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
1698
|
+
status: 400;
|
1699
|
+
payload: BadRequestError;
|
1700
|
+
} | {
|
1701
|
+
status: 401;
|
1702
|
+
payload: AuthError;
|
1703
|
+
} | {
|
1704
|
+
status: 404;
|
1705
|
+
payload: SimpleError;
|
1706
|
+
}>;
|
1707
|
+
declare type MergeMigrationRequestVariables = {
|
1708
|
+
pathParams: MergeMigrationRequestPathParams;
|
1709
|
+
} & FetcherExtraProps;
|
1710
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
1711
|
+
declare type GetBranchDetailsPathParams = {
|
1712
|
+
dbBranchName: DBBranchName;
|
1713
|
+
workspace: string;
|
1714
|
+
};
|
1715
|
+
declare type GetBranchDetailsError = ErrorWrapper<{
|
1716
|
+
status: 400;
|
1717
|
+
payload: BadRequestError;
|
1718
|
+
} | {
|
1719
|
+
status: 401;
|
1720
|
+
payload: AuthError;
|
1721
|
+
} | {
|
1722
|
+
status: 404;
|
1723
|
+
payload: SimpleError;
|
1724
|
+
}>;
|
1725
|
+
declare type GetBranchDetailsVariables = {
|
1726
|
+
pathParams: GetBranchDetailsPathParams;
|
1727
|
+
} & FetcherExtraProps;
|
1728
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
1729
|
+
declare type CreateBranchPathParams = {
|
1730
|
+
dbBranchName: DBBranchName;
|
1731
|
+
workspace: string;
|
1732
|
+
};
|
1733
|
+
declare type CreateBranchQueryParams = {
|
1734
|
+
from?: string;
|
1735
|
+
};
|
1736
|
+
declare type CreateBranchError = ErrorWrapper<{
|
1737
|
+
status: 400;
|
1738
|
+
payload: BadRequestError;
|
1739
|
+
} | {
|
1740
|
+
status: 401;
|
1741
|
+
payload: AuthError;
|
1742
|
+
} | {
|
1743
|
+
status: 404;
|
1744
|
+
payload: SimpleError;
|
1745
|
+
}>;
|
1746
|
+
declare type CreateBranchResponse = {
|
1747
|
+
databaseName: string;
|
1748
|
+
branchName: string;
|
1749
|
+
};
|
1750
|
+
declare type CreateBranchRequestBody = {
|
1751
|
+
from?: string;
|
1752
|
+
metadata?: BranchMetadata;
|
1753
|
+
};
|
1754
|
+
declare type CreateBranchVariables = {
|
1755
|
+
body?: CreateBranchRequestBody;
|
1756
|
+
pathParams: CreateBranchPathParams;
|
1757
|
+
queryParams?: CreateBranchQueryParams;
|
1758
|
+
} & FetcherExtraProps;
|
1759
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
1760
|
+
declare type DeleteBranchPathParams = {
|
1761
|
+
dbBranchName: DBBranchName;
|
1762
|
+
workspace: string;
|
1763
|
+
};
|
1764
|
+
declare type DeleteBranchError = ErrorWrapper<{
|
1765
|
+
status: 400;
|
1766
|
+
payload: BadRequestError;
|
1767
|
+
} | {
|
1768
|
+
status: 401;
|
1769
|
+
payload: AuthError;
|
1770
|
+
} | {
|
1771
|
+
status: 404;
|
1772
|
+
payload: SimpleError;
|
1773
|
+
}>;
|
1774
|
+
declare type DeleteBranchVariables = {
|
1775
|
+
pathParams: DeleteBranchPathParams;
|
1776
|
+
} & FetcherExtraProps;
|
1777
|
+
/**
|
1778
|
+
* Delete the branch in the database and all its resources
|
1779
|
+
*/
|
1780
|
+
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
1781
|
+
declare type UpdateBranchMetadataPathParams = {
|
1782
|
+
dbBranchName: DBBranchName;
|
1783
|
+
workspace: string;
|
1784
|
+
};
|
1785
|
+
declare type UpdateBranchMetadataError = ErrorWrapper<{
|
1786
|
+
status: 400;
|
1787
|
+
payload: BadRequestError;
|
1788
|
+
} | {
|
1789
|
+
status: 401;
|
1790
|
+
payload: AuthError;
|
1791
|
+
} | {
|
1792
|
+
status: 404;
|
1793
|
+
payload: SimpleError;
|
1794
|
+
}>;
|
1795
|
+
declare type UpdateBranchMetadataVariables = {
|
1796
|
+
body?: BranchMetadata;
|
1797
|
+
pathParams: UpdateBranchMetadataPathParams;
|
1798
|
+
} & FetcherExtraProps;
|
1799
|
+
/**
|
1800
|
+
* Update the branch metadata
|
1801
|
+
*/
|
1802
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
1803
|
+
declare type GetBranchMetadataPathParams = {
|
1804
|
+
dbBranchName: DBBranchName;
|
1805
|
+
workspace: string;
|
1806
|
+
};
|
1807
|
+
declare type GetBranchMetadataError = ErrorWrapper<{
|
1808
|
+
status: 400;
|
1809
|
+
payload: BadRequestError;
|
1810
|
+
} | {
|
1811
|
+
status: 401;
|
1812
|
+
payload: AuthError;
|
1813
|
+
} | {
|
1814
|
+
status: 404;
|
1815
|
+
payload: SimpleError;
|
1816
|
+
}>;
|
1817
|
+
declare type GetBranchMetadataVariables = {
|
1818
|
+
pathParams: GetBranchMetadataPathParams;
|
1819
|
+
} & FetcherExtraProps;
|
1820
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
1821
|
+
declare type GetBranchMigrationHistoryPathParams = {
|
1822
|
+
dbBranchName: DBBranchName;
|
1823
|
+
workspace: string;
|
1824
|
+
};
|
1825
|
+
declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
1826
|
+
status: 400;
|
1827
|
+
payload: BadRequestError;
|
1828
|
+
} | {
|
1829
|
+
status: 401;
|
1830
|
+
payload: AuthError;
|
1831
|
+
} | {
|
1832
|
+
status: 404;
|
1833
|
+
payload: SimpleError;
|
1834
|
+
}>;
|
1835
|
+
declare type GetBranchMigrationHistoryResponse = {
|
1836
|
+
startedFrom?: StartedFromMetadata;
|
1837
|
+
migrations?: BranchMigration[];
|
1838
|
+
};
|
1839
|
+
declare type GetBranchMigrationHistoryRequestBody = {
|
1840
|
+
limit?: number;
|
1841
|
+
startFrom?: string;
|
1842
|
+
};
|
1843
|
+
declare type GetBranchMigrationHistoryVariables = {
|
1844
|
+
body?: GetBranchMigrationHistoryRequestBody;
|
1845
|
+
pathParams: GetBranchMigrationHistoryPathParams;
|
1846
|
+
} & FetcherExtraProps;
|
1847
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
1344
1848
|
declare type ExecuteBranchMigrationPlanPathParams = {
|
1345
1849
|
dbBranchName: DBBranchName;
|
1346
1850
|
workspace: string;
|
@@ -1389,6 +1893,157 @@ declare type GetBranchMigrationPlanVariables = {
|
|
1389
1893
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
1390
1894
|
*/
|
1391
1895
|
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
1896
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
1897
|
+
dbBranchName: DBBranchName;
|
1898
|
+
workspace: string;
|
1899
|
+
};
|
1900
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
1901
|
+
status: 400;
|
1902
|
+
payload: BadRequestError;
|
1903
|
+
} | {
|
1904
|
+
status: 401;
|
1905
|
+
payload: AuthError;
|
1906
|
+
} | {
|
1907
|
+
status: 404;
|
1908
|
+
payload: SimpleError;
|
1909
|
+
}>;
|
1910
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
1911
|
+
schema: Schema;
|
1912
|
+
};
|
1913
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
1914
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
1915
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
1916
|
+
} & FetcherExtraProps;
|
1917
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
1918
|
+
declare type CompareBranchSchemasPathParams = {
|
1919
|
+
dbBranchName: DBBranchName;
|
1920
|
+
branchName: BranchName;
|
1921
|
+
workspace: string;
|
1922
|
+
};
|
1923
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
1924
|
+
status: 400;
|
1925
|
+
payload: BadRequestError;
|
1926
|
+
} | {
|
1927
|
+
status: 401;
|
1928
|
+
payload: AuthError;
|
1929
|
+
} | {
|
1930
|
+
status: 404;
|
1931
|
+
payload: SimpleError;
|
1932
|
+
}>;
|
1933
|
+
declare type CompareBranchSchemasVariables = {
|
1934
|
+
body?: Record<string, any>;
|
1935
|
+
pathParams: CompareBranchSchemasPathParams;
|
1936
|
+
} & FetcherExtraProps;
|
1937
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
1938
|
+
declare type UpdateBranchSchemaPathParams = {
|
1939
|
+
dbBranchName: DBBranchName;
|
1940
|
+
workspace: string;
|
1941
|
+
};
|
1942
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
1943
|
+
status: 400;
|
1944
|
+
payload: BadRequestError;
|
1945
|
+
} | {
|
1946
|
+
status: 401;
|
1947
|
+
payload: AuthError;
|
1948
|
+
} | {
|
1949
|
+
status: 404;
|
1950
|
+
payload: SimpleError;
|
1951
|
+
}>;
|
1952
|
+
declare type UpdateBranchSchemaResponse = {
|
1953
|
+
id: string;
|
1954
|
+
parentID: string;
|
1955
|
+
};
|
1956
|
+
declare type UpdateBranchSchemaVariables = {
|
1957
|
+
body: Migration;
|
1958
|
+
pathParams: UpdateBranchSchemaPathParams;
|
1959
|
+
} & FetcherExtraProps;
|
1960
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
1961
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
1962
|
+
dbBranchName: DBBranchName;
|
1963
|
+
workspace: string;
|
1964
|
+
};
|
1965
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
1966
|
+
status: 400;
|
1967
|
+
payload: BadRequestError;
|
1968
|
+
} | {
|
1969
|
+
status: 401;
|
1970
|
+
payload: AuthError;
|
1971
|
+
} | {
|
1972
|
+
status: 404;
|
1973
|
+
payload: SimpleError;
|
1974
|
+
}>;
|
1975
|
+
declare type PreviewBranchSchemaEditResponse = {
|
1976
|
+
original: Schema;
|
1977
|
+
updated: Schema;
|
1978
|
+
};
|
1979
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
1980
|
+
edits?: SchemaEditScript;
|
1981
|
+
operations?: MigrationOp[];
|
1982
|
+
};
|
1983
|
+
declare type PreviewBranchSchemaEditVariables = {
|
1984
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
1985
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
1986
|
+
} & FetcherExtraProps;
|
1987
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
1988
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
1989
|
+
dbBranchName: DBBranchName;
|
1990
|
+
workspace: string;
|
1991
|
+
};
|
1992
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
1993
|
+
status: 400;
|
1994
|
+
payload: BadRequestError;
|
1995
|
+
} | {
|
1996
|
+
status: 401;
|
1997
|
+
payload: AuthError;
|
1998
|
+
} | {
|
1999
|
+
status: 404;
|
2000
|
+
payload: SimpleError;
|
2001
|
+
}>;
|
2002
|
+
declare type ApplyBranchSchemaEditResponse = {
|
2003
|
+
id: string;
|
2004
|
+
parentID: string;
|
2005
|
+
};
|
2006
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
2007
|
+
edits: SchemaEditScript;
|
2008
|
+
};
|
2009
|
+
declare type ApplyBranchSchemaEditVariables = {
|
2010
|
+
body: ApplyBranchSchemaEditRequestBody;
|
2011
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
2012
|
+
} & FetcherExtraProps;
|
2013
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
2014
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
2015
|
+
dbBranchName: DBBranchName;
|
2016
|
+
workspace: string;
|
2017
|
+
};
|
2018
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
2019
|
+
status: 400;
|
2020
|
+
payload: BadRequestError;
|
2021
|
+
} | {
|
2022
|
+
status: 401;
|
2023
|
+
payload: AuthError;
|
2024
|
+
} | {
|
2025
|
+
status: 404;
|
2026
|
+
payload: SimpleError;
|
2027
|
+
}>;
|
2028
|
+
declare type GetBranchSchemaHistoryResponse = {
|
2029
|
+
meta: {
|
2030
|
+
cursor: string;
|
2031
|
+
more: boolean;
|
2032
|
+
};
|
2033
|
+
logs: Commit[];
|
2034
|
+
};
|
2035
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
2036
|
+
page?: {
|
2037
|
+
after?: string;
|
2038
|
+
before?: string;
|
2039
|
+
size?: number;
|
2040
|
+
};
|
2041
|
+
};
|
2042
|
+
declare type GetBranchSchemaHistoryVariables = {
|
2043
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
2044
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
2045
|
+
} & FetcherExtraProps;
|
2046
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
1392
2047
|
declare type GetBranchStatsPathParams = {
|
1393
2048
|
dbBranchName: DBBranchName;
|
1394
2049
|
workspace: string;
|
@@ -1439,13 +2094,17 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1439
2094
|
status: 422;
|
1440
2095
|
payload: SimpleError;
|
1441
2096
|
}>;
|
2097
|
+
declare type CreateTableResponse = {
|
2098
|
+
branchName: string;
|
2099
|
+
tableName: string;
|
2100
|
+
};
|
1442
2101
|
declare type CreateTableVariables = {
|
1443
2102
|
pathParams: CreateTablePathParams;
|
1444
2103
|
} & FetcherExtraProps;
|
1445
2104
|
/**
|
1446
2105
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1447
2106
|
*/
|
1448
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
2107
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1449
2108
|
declare type DeleteTablePathParams = {
|
1450
2109
|
dbBranchName: DBBranchName;
|
1451
2110
|
tableName: TableName;
|
@@ -1678,6 +2337,9 @@ declare type InsertRecordPathParams = {
|
|
1678
2337
|
tableName: TableName;
|
1679
2338
|
workspace: string;
|
1680
2339
|
};
|
2340
|
+
declare type InsertRecordQueryParams = {
|
2341
|
+
columns?: ColumnsProjection;
|
2342
|
+
};
|
1681
2343
|
declare type InsertRecordError = ErrorWrapper<{
|
1682
2344
|
status: 400;
|
1683
2345
|
payload: BadRequestError;
|
@@ -1688,20 +2350,15 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1688
2350
|
status: 404;
|
1689
2351
|
payload: SimpleError;
|
1690
2352
|
}>;
|
1691
|
-
declare type InsertRecordResponse = {
|
1692
|
-
id: string;
|
1693
|
-
xata: {
|
1694
|
-
version: number;
|
1695
|
-
};
|
1696
|
-
};
|
1697
2353
|
declare type InsertRecordVariables = {
|
1698
2354
|
body?: Record<string, any>;
|
1699
2355
|
pathParams: InsertRecordPathParams;
|
2356
|
+
queryParams?: InsertRecordQueryParams;
|
1700
2357
|
} & FetcherExtraProps;
|
1701
2358
|
/**
|
1702
2359
|
* Insert a new Record into the Table
|
1703
2360
|
*/
|
1704
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
2361
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1705
2362
|
declare type InsertRecordWithIDPathParams = {
|
1706
2363
|
dbBranchName: DBBranchName;
|
1707
2364
|
tableName: TableName;
|
@@ -1709,6 +2366,7 @@ declare type InsertRecordWithIDPathParams = {
|
|
1709
2366
|
workspace: string;
|
1710
2367
|
};
|
1711
2368
|
declare type InsertRecordWithIDQueryParams = {
|
2369
|
+
columns?: ColumnsProjection;
|
1712
2370
|
createOnly?: boolean;
|
1713
2371
|
ifVersion?: number;
|
1714
2372
|
};
|
@@ -1741,6 +2399,7 @@ declare type UpdateRecordWithIDPathParams = {
|
|
1741
2399
|
workspace: string;
|
1742
2400
|
};
|
1743
2401
|
declare type UpdateRecordWithIDQueryParams = {
|
2402
|
+
columns?: ColumnsProjection;
|
1744
2403
|
ifVersion?: number;
|
1745
2404
|
};
|
1746
2405
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1769,6 +2428,7 @@ declare type UpsertRecordWithIDPathParams = {
|
|
1769
2428
|
workspace: string;
|
1770
2429
|
};
|
1771
2430
|
declare type UpsertRecordWithIDQueryParams = {
|
2431
|
+
columns?: ColumnsProjection;
|
1772
2432
|
ifVersion?: number;
|
1773
2433
|
};
|
1774
2434
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1796,6 +2456,9 @@ declare type DeleteRecordPathParams = {
|
|
1796
2456
|
recordId: RecordID;
|
1797
2457
|
workspace: string;
|
1798
2458
|
};
|
2459
|
+
declare type DeleteRecordQueryParams = {
|
2460
|
+
columns?: ColumnsProjection;
|
2461
|
+
};
|
1799
2462
|
declare type DeleteRecordError = ErrorWrapper<{
|
1800
2463
|
status: 400;
|
1801
2464
|
payload: BadRequestError;
|
@@ -1808,14 +2471,18 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1808
2471
|
}>;
|
1809
2472
|
declare type DeleteRecordVariables = {
|
1810
2473
|
pathParams: DeleteRecordPathParams;
|
2474
|
+
queryParams?: DeleteRecordQueryParams;
|
1811
2475
|
} & FetcherExtraProps;
|
1812
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
2476
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1813
2477
|
declare type GetRecordPathParams = {
|
1814
2478
|
dbBranchName: DBBranchName;
|
1815
2479
|
tableName: TableName;
|
1816
2480
|
recordId: RecordID;
|
1817
2481
|
workspace: string;
|
1818
2482
|
};
|
2483
|
+
declare type GetRecordQueryParams = {
|
2484
|
+
columns?: ColumnsProjection;
|
2485
|
+
};
|
1819
2486
|
declare type GetRecordError = ErrorWrapper<{
|
1820
2487
|
status: 400;
|
1821
2488
|
payload: BadRequestError;
|
@@ -1826,12 +2493,9 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1826
2493
|
status: 404;
|
1827
2494
|
payload: SimpleError;
|
1828
2495
|
}>;
|
1829
|
-
declare type GetRecordRequestBody = {
|
1830
|
-
columns?: ColumnsFilter;
|
1831
|
-
};
|
1832
2496
|
declare type GetRecordVariables = {
|
1833
|
-
body?: GetRecordRequestBody;
|
1834
2497
|
pathParams: GetRecordPathParams;
|
2498
|
+
queryParams?: GetRecordQueryParams;
|
1835
2499
|
} & FetcherExtraProps;
|
1836
2500
|
/**
|
1837
2501
|
* Retrieve record by ID
|
@@ -1842,6 +2506,9 @@ declare type BulkInsertTableRecordsPathParams = {
|
|
1842
2506
|
tableName: TableName;
|
1843
2507
|
workspace: string;
|
1844
2508
|
};
|
2509
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
2510
|
+
columns?: ColumnsProjection;
|
2511
|
+
};
|
1845
2512
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1846
2513
|
status: 400;
|
1847
2514
|
payload: BulkError;
|
@@ -1851,21 +2518,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1851
2518
|
} | {
|
1852
2519
|
status: 404;
|
1853
2520
|
payload: SimpleError;
|
2521
|
+
} | {
|
2522
|
+
status: 422;
|
2523
|
+
payload: SimpleError;
|
1854
2524
|
}>;
|
1855
|
-
declare type BulkInsertTableRecordsResponse = {
|
1856
|
-
recordIDs: string[];
|
1857
|
-
};
|
1858
2525
|
declare type BulkInsertTableRecordsRequestBody = {
|
1859
2526
|
records: Record<string, any>[];
|
1860
2527
|
};
|
1861
2528
|
declare type BulkInsertTableRecordsVariables = {
|
1862
2529
|
body: BulkInsertTableRecordsRequestBody;
|
1863
2530
|
pathParams: BulkInsertTableRecordsPathParams;
|
2531
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1864
2532
|
} & FetcherExtraProps;
|
1865
2533
|
/**
|
1866
2534
|
* Bulk insert records
|
1867
2535
|
*/
|
1868
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
2536
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1869
2537
|
declare type QueryTablePathParams = {
|
1870
2538
|
dbBranchName: DBBranchName;
|
1871
2539
|
tableName: TableName;
|
@@ -1885,7 +2553,7 @@ declare type QueryTableRequestBody = {
|
|
1885
2553
|
filter?: FilterExpression;
|
1886
2554
|
sort?: SortExpression;
|
1887
2555
|
page?: PageConfig;
|
1888
|
-
columns?:
|
2556
|
+
columns?: ColumnsProjection;
|
1889
2557
|
};
|
1890
2558
|
declare type QueryTableVariables = {
|
1891
2559
|
body?: QueryTableRequestBody;
|
@@ -2634,6 +3302,7 @@ declare type SearchTableRequestBody = {
|
|
2634
3302
|
prefix?: PrefixExpression;
|
2635
3303
|
filter?: FilterExpression;
|
2636
3304
|
highlight?: HighlightExpression;
|
3305
|
+
boosters?: BoosterExpression[];
|
2637
3306
|
};
|
2638
3307
|
declare type SearchTableVariables = {
|
2639
3308
|
body: SearchTableRequestBody;
|
@@ -2665,6 +3334,7 @@ declare type SearchBranchRequestBody = {
|
|
2665
3334
|
tables?: (string | {
|
2666
3335
|
table: string;
|
2667
3336
|
filter?: FilterExpression;
|
3337
|
+
boosters?: BoosterExpression[];
|
2668
3338
|
})[];
|
2669
3339
|
query: string;
|
2670
3340
|
fuzziness?: FuzzinessExpression;
|
@@ -2697,6 +3367,7 @@ declare const operationsByTag: {
|
|
2697
3367
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
2698
3368
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
2699
3369
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
3370
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
2700
3371
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2701
3372
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2702
3373
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
@@ -2705,6 +3376,8 @@ declare const operationsByTag: {
|
|
2705
3376
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2706
3377
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2707
3378
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
3379
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
3380
|
+
patchDatabaseMetadata: (variables: PatchDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
2708
3381
|
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
2709
3382
|
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
2710
3383
|
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
@@ -2713,17 +3386,35 @@ declare const operationsByTag: {
|
|
2713
3386
|
branch: {
|
2714
3387
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2715
3388
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2716
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
3389
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2717
3390
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2718
3391
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2719
3392
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
3393
|
+
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
3394
|
+
};
|
3395
|
+
migrationRequests: {
|
3396
|
+
listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
3397
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
3398
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
3399
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
3400
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
3401
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
3402
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
3403
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
3404
|
+
};
|
3405
|
+
branchSchema: {
|
2720
3406
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
2721
3407
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
2722
3408
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
2723
|
-
|
3409
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
3410
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
3411
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
3412
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
3413
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
3414
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
2724
3415
|
};
|
2725
3416
|
table: {
|
2726
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
3417
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2727
3418
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2728
3419
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2729
3420
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2735,13 +3426,13 @@ declare const operationsByTag: {
|
|
2735
3426
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2736
3427
|
};
|
2737
3428
|
records: {
|
2738
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
3429
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2739
3430
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2740
3431
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2741
3432
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2742
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
3433
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2743
3434
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2744
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
3435
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2745
3436
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2746
3437
|
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2747
3438
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
@@ -2759,10 +3450,8 @@ interface XataApiClientOptions {
|
|
2759
3450
|
fetch?: FetchImpl;
|
2760
3451
|
apiKey?: string;
|
2761
3452
|
host?: HostProvider;
|
3453
|
+
trace?: TraceFunction;
|
2762
3454
|
}
|
2763
|
-
/**
|
2764
|
-
* @deprecated Use XataApiPlugin instead
|
2765
|
-
*/
|
2766
3455
|
declare class XataApiClient {
|
2767
3456
|
#private;
|
2768
3457
|
constructor(options?: XataApiClientOptions);
|
@@ -2772,6 +3461,8 @@ declare class XataApiClient {
|
|
2772
3461
|
get branches(): BranchApi;
|
2773
3462
|
get tables(): TableApi;
|
2774
3463
|
get records(): RecordsApi;
|
3464
|
+
get migrationRequests(): MigrationRequestsApi;
|
3465
|
+
get branchSchema(): BranchSchemaApi;
|
2775
3466
|
}
|
2776
3467
|
declare class UserApi {
|
2777
3468
|
private extraProps;
|
@@ -2795,6 +3486,7 @@ declare class WorkspaceApi {
|
|
2795
3486
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
2796
3487
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
2797
3488
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
3489
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
2798
3490
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2799
3491
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2800
3492
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
@@ -2805,6 +3497,7 @@ declare class DatabaseApi {
|
|
2805
3497
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2806
3498
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2807
3499
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
3500
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
2808
3501
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2809
3502
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2810
3503
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
@@ -2815,19 +3508,16 @@ declare class BranchApi {
|
|
2815
3508
|
constructor(extraProps: FetcherExtraProps);
|
2816
3509
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2817
3510
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2818
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
3511
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
2819
3512
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2820
|
-
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2821
|
-
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2822
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
2823
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
2824
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
3513
|
+
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
3514
|
+
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2825
3515
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2826
3516
|
}
|
2827
3517
|
declare class TableApi {
|
2828
3518
|
private extraProps;
|
2829
3519
|
constructor(extraProps: FetcherExtraProps);
|
2830
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
3520
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2831
3521
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2832
3522
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2833
3523
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2841,17 +3531,42 @@ declare class TableApi {
|
|
2841
3531
|
declare class RecordsApi {
|
2842
3532
|
private extraProps;
|
2843
3533
|
constructor(extraProps: FetcherExtraProps);
|
2844
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
3534
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
2845
3535
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2846
3536
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2847
3537
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2848
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2849
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2850
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
3538
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
3539
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
3540
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
2851
3541
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2852
3542
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2853
3543
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
2854
3544
|
}
|
3545
|
+
declare class MigrationRequestsApi {
|
3546
|
+
private extraProps;
|
3547
|
+
constructor(extraProps: FetcherExtraProps);
|
3548
|
+
listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
|
3549
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
3550
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
3551
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
3552
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
3553
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
3554
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
3555
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
3556
|
+
}
|
3557
|
+
declare class BranchSchemaApi {
|
3558
|
+
private extraProps;
|
3559
|
+
constructor(extraProps: FetcherExtraProps);
|
3560
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
3561
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
3562
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
3563
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
3564
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
3565
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
3566
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
3567
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
3568
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
3569
|
+
}
|
2855
3570
|
|
2856
3571
|
declare class XataApiPlugin implements XataPlugin {
|
2857
3572
|
build(options: XataPluginOptions): Promise<XataApiClient>;
|
@@ -2863,19 +3578,20 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2863
3578
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2864
3579
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2865
3580
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2866
|
-
declare type NonEmptyArray<T> = T[] & {
|
2867
|
-
0: T;
|
2868
|
-
};
|
2869
3581
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2870
3582
|
[P in K]-?: NonNullable<T[P]>;
|
2871
3583
|
};
|
2872
3584
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2873
3585
|
declare type SingleOrArray<T> = T | T[];
|
2874
3586
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
3587
|
+
declare type Without<T, U> = {
|
3588
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
3589
|
+
};
|
3590
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
2875
3591
|
|
2876
3592
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2877
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2878
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
3593
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
3594
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2879
3595
|
}>>;
|
2880
3596
|
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
|
2881
3597
|
V: ValueAtColumn<Item, V>;
|
@@ -2911,41 +3627,68 @@ interface BaseData {
|
|
2911
3627
|
/**
|
2912
3628
|
* Represents a persisted record from the database.
|
2913
3629
|
*/
|
2914
|
-
interface XataRecord<
|
3630
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2915
3631
|
/**
|
2916
3632
|
* Get metadata of this record.
|
2917
3633
|
*/
|
2918
|
-
getMetadata(): XataRecordMetadata
|
3634
|
+
getMetadata(): XataRecordMetadata;
|
3635
|
+
/**
|
3636
|
+
* Retrieves a refreshed copy of the current record from the database.
|
3637
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3638
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3639
|
+
*/
|
3640
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2919
3641
|
/**
|
2920
3642
|
* Retrieves a refreshed copy of the current record from the database.
|
3643
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2921
3644
|
*/
|
2922
|
-
read(): Promise<Readonly<SelectedPick<
|
3645
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2923
3646
|
/**
|
2924
3647
|
* Performs a partial update of the current record. On success a new object is
|
2925
3648
|
* returned and the current object is not mutated.
|
2926
3649
|
* @param partialUpdate The columns and their values that have to be updated.
|
2927
|
-
* @
|
3650
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3651
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3652
|
+
*/
|
3653
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3654
|
+
/**
|
3655
|
+
* Performs a partial update of the current record. On success a new object is
|
3656
|
+
* returned and the current object is not mutated.
|
3657
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
3658
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2928
3659
|
*/
|
2929
|
-
update(partialUpdate: Partial<EditableData<
|
3660
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2930
3661
|
/**
|
2931
3662
|
* Performs a deletion of the current record in the database.
|
2932
|
-
*
|
2933
|
-
* @
|
3663
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3664
|
+
* @returns The deleted record, null if not found.
|
2934
3665
|
*/
|
2935
|
-
delete(): Promise<
|
3666
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3667
|
+
/**
|
3668
|
+
* Performs a deletion of the current record in the database.
|
3669
|
+
* @returns The deleted record, null if not found.
|
3670
|
+
|
3671
|
+
*/
|
3672
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2936
3673
|
}
|
2937
3674
|
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
2938
3675
|
/**
|
2939
3676
|
* Retrieves a refreshed copy of the current record from the database.
|
2940
3677
|
*/
|
2941
|
-
read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3678
|
+
read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
|
2942
3679
|
/**
|
2943
3680
|
* Performs a partial update of the current record. On success a new object is
|
2944
3681
|
* returned and the current object is not mutated.
|
2945
3682
|
* @param partialUpdate The columns and their values that have to be updated.
|
2946
3683
|
* @returns A new record containing the latest values for all the columns of the current record.
|
2947
3684
|
*/
|
2948
|
-
update(partialUpdate: Partial<EditableData<
|
3685
|
+
update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Record>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
|
3686
|
+
/**
|
3687
|
+
* Performs a deletion of the current record in the database.
|
3688
|
+
*
|
3689
|
+
* @throws If the record was already deleted or if an error happened while performing the deletion.
|
3690
|
+
*/
|
3691
|
+
delete(): Promise<void>;
|
2949
3692
|
};
|
2950
3693
|
declare type XataRecordMetadata = {
|
2951
3694
|
/**
|
@@ -2956,13 +3699,13 @@ declare type XataRecordMetadata = {
|
|
2956
3699
|
};
|
2957
3700
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2958
3701
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2959
|
-
declare type EditableData<O extends
|
3702
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
2960
3703
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2961
3704
|
id: string;
|
2962
3705
|
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2963
3706
|
id: string;
|
2964
3707
|
} | string | null | undefined : O[K];
|
2965
|
-
}
|
3708
|
+
}, keyof XataRecord>;
|
2966
3709
|
|
2967
3710
|
/**
|
2968
3711
|
* PropertyMatchFilter
|
@@ -3056,7 +3799,85 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
3056
3799
|
declare type NestedApiFilter<T> = {
|
3057
3800
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3058
3801
|
};
|
3059
|
-
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
3802
|
+
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>;
|
3803
|
+
|
3804
|
+
declare type DateBooster = {
|
3805
|
+
origin?: string;
|
3806
|
+
scale: string;
|
3807
|
+
decay: number;
|
3808
|
+
};
|
3809
|
+
declare type NumericBooster = {
|
3810
|
+
factor: number;
|
3811
|
+
};
|
3812
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
3813
|
+
value: T;
|
3814
|
+
factor: number;
|
3815
|
+
};
|
3816
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
3817
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
3818
|
+
dateBooster: {
|
3819
|
+
column: K;
|
3820
|
+
} & DateBooster;
|
3821
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
3822
|
+
numericBooster?: {
|
3823
|
+
column: K;
|
3824
|
+
} & NumericBooster;
|
3825
|
+
}, {
|
3826
|
+
valueBooster?: {
|
3827
|
+
column: K;
|
3828
|
+
} & ValueBooster<number>;
|
3829
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
3830
|
+
valueBooster: {
|
3831
|
+
column: K;
|
3832
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
3833
|
+
} : never;
|
3834
|
+
}>;
|
3835
|
+
|
3836
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3837
|
+
fuzziness?: FuzzinessExpression;
|
3838
|
+
prefix?: PrefixExpression;
|
3839
|
+
highlight?: HighlightExpression;
|
3840
|
+
tables?: Array<Tables | Values<{
|
3841
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3842
|
+
table: Model;
|
3843
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
3844
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
3845
|
+
};
|
3846
|
+
}>>;
|
3847
|
+
};
|
3848
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3849
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3850
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3851
|
+
table: Model;
|
3852
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
3853
|
+
};
|
3854
|
+
}>[]>;
|
3855
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3856
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
3857
|
+
}>;
|
3858
|
+
};
|
3859
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3860
|
+
#private;
|
3861
|
+
private db;
|
3862
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3863
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3864
|
+
}
|
3865
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
3866
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
3867
|
+
};
|
3868
|
+
declare type SearchExtraProperties = {
|
3869
|
+
table: string;
|
3870
|
+
highlight?: {
|
3871
|
+
[key: string]: string[] | {
|
3872
|
+
[key: string]: any;
|
3873
|
+
};
|
3874
|
+
};
|
3875
|
+
score?: number;
|
3876
|
+
};
|
3877
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3878
|
+
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 {
|
3879
|
+
table: infer Table;
|
3880
|
+
} ? ReturnTable<Table, Tables> : never;
|
3060
3881
|
|
3061
3882
|
declare type SortDirection = 'asc' | 'desc';
|
3062
3883
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -3069,7 +3890,7 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
3069
3890
|
};
|
3070
3891
|
|
3071
3892
|
declare type BaseOptions<T extends XataRecord> = {
|
3072
|
-
columns?:
|
3893
|
+
columns?: SelectableColumn<T>[];
|
3073
3894
|
cache?: number;
|
3074
3895
|
};
|
3075
3896
|
declare type CursorQueryOptions = {
|
@@ -3093,7 +3914,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3093
3914
|
#private;
|
3094
3915
|
readonly meta: PaginationQueryMeta;
|
3095
3916
|
readonly records: RecordArray<Result>;
|
3096
|
-
constructor(repository: Repository<Record> | null, table:
|
3917
|
+
constructor(repository: Repository<Record> | null, table: {
|
3918
|
+
name: string;
|
3919
|
+
schema?: Table;
|
3920
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3097
3921
|
getQueryOptions(): QueryOptions<Record>;
|
3098
3922
|
key(): string;
|
3099
3923
|
/**
|
@@ -3132,7 +3956,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3132
3956
|
* @param value The value to filter.
|
3133
3957
|
* @returns A new Query object.
|
3134
3958
|
*/
|
3135
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F
|
3959
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
3136
3960
|
/**
|
3137
3961
|
* Builds a new query object adding one or more constraints. Examples:
|
3138
3962
|
*
|
@@ -3146,20 +3970,23 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3146
3970
|
* @param filters A filter object
|
3147
3971
|
* @returns A new Query object.
|
3148
3972
|
*/
|
3149
|
-
filter(filters
|
3973
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
3974
|
+
defaultFilter<T>(column: string, value: T): T | {
|
3975
|
+
$includes: (T & string) | (T & string[]);
|
3976
|
+
};
|
3150
3977
|
/**
|
3151
3978
|
* Builds a new query with a new sort option.
|
3152
3979
|
* @param column The column name.
|
3153
3980
|
* @param direction The direction. Either ascending or descending.
|
3154
3981
|
* @returns A new Query object.
|
3155
3982
|
*/
|
3156
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
3983
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
3157
3984
|
/**
|
3158
3985
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
3159
3986
|
* @param columns Array of column names to be returned by the query.
|
3160
3987
|
* @returns A new Query object.
|
3161
3988
|
*/
|
3162
|
-
select<K extends SelectableColumn<Record>>(columns:
|
3989
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
3163
3990
|
/**
|
3164
3991
|
* Get paginated results
|
3165
3992
|
*
|
@@ -3221,13 +4048,13 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3221
4048
|
* @param options Additional options to be used when performing the query.
|
3222
4049
|
* @returns An array of records from the database.
|
3223
4050
|
*/
|
3224
|
-
getMany
|
4051
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
3225
4052
|
/**
|
3226
4053
|
* Performs the query in the database and returns a set of results.
|
3227
4054
|
* @param options Additional options to be used when performing the query.
|
3228
4055
|
* @returns An array of records from the database.
|
3229
4056
|
*/
|
3230
|
-
getMany
|
4057
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
3231
4058
|
/**
|
3232
4059
|
* Performs the query in the database and returns all the results.
|
3233
4060
|
* Warning: If there are a large number of results, this method can have performance implications.
|
@@ -3240,18 +4067,18 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3240
4067
|
* @param options Additional options to be used when performing the query.
|
3241
4068
|
* @returns An array of records from the database.
|
3242
4069
|
*/
|
3243
|
-
getAll
|
4070
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3244
4071
|
batchSize?: number;
|
3245
|
-
}): Promise<
|
4072
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
3246
4073
|
/**
|
3247
4074
|
* Performs the query in the database and returns all the results.
|
3248
4075
|
* Warning: If there are a large number of results, this method can have performance implications.
|
3249
4076
|
* @param options Additional options to be used when performing the query.
|
3250
4077
|
* @returns An array of records from the database.
|
3251
4078
|
*/
|
3252
|
-
getAll
|
4079
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3253
4080
|
batchSize?: number;
|
3254
|
-
}
|
4081
|
+
}): Promise<Result[]>;
|
3255
4082
|
/**
|
3256
4083
|
* Performs the query in the database and returns the first result.
|
3257
4084
|
* @returns The first record that matches the query, or null if no record matched the query.
|
@@ -3262,13 +4089,13 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3262
4089
|
* @param options Additional options to be used when performing the query.
|
3263
4090
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3264
4091
|
*/
|
3265
|
-
getFirst
|
4092
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
3266
4093
|
/**
|
3267
4094
|
* Performs the query in the database and returns the first result.
|
3268
4095
|
* @param options Additional options to be used when performing the query.
|
3269
4096
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3270
4097
|
*/
|
3271
|
-
getFirst
|
4098
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
3272
4099
|
/**
|
3273
4100
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3274
4101
|
* @param ttl The cache TTL in milliseconds.
|
@@ -3390,6 +4217,8 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3390
4217
|
#private;
|
3391
4218
|
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
3392
4219
|
static parseConstructorParams(...args: any[]): any[];
|
4220
|
+
toArray(): Result[];
|
4221
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
3393
4222
|
/**
|
3394
4223
|
* Retrieve next page of records
|
3395
4224
|
*
|
@@ -3423,21 +4252,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3423
4252
|
/**
|
3424
4253
|
* Common interface for performing operations on a table.
|
3425
4254
|
*/
|
3426
|
-
declare abstract class Repository<
|
3427
|
-
abstract create(object: EditableData<
|
4255
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
4256
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4257
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4258
|
+
/**
|
4259
|
+
* Creates a single record in the table with a unique id.
|
4260
|
+
* @param id The unique id.
|
4261
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
4262
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4263
|
+
* @returns The full persisted record.
|
4264
|
+
*/
|
4265
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3428
4266
|
/**
|
3429
4267
|
* Creates a single record in the table with a unique id.
|
3430
4268
|
* @param id The unique id.
|
3431
4269
|
* @param object Object containing the column names with their values to be stored in the table.
|
3432
4270
|
* @returns The full persisted record.
|
3433
4271
|
*/
|
3434
|
-
abstract create(id: string, object: EditableData<
|
4272
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3435
4273
|
/**
|
3436
4274
|
* Creates multiple records in the table.
|
3437
4275
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3438
|
-
* @
|
4276
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4277
|
+
* @returns Array of the persisted records in order.
|
4278
|
+
*/
|
4279
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4280
|
+
/**
|
4281
|
+
* Creates multiple records in the table.
|
4282
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
4283
|
+
* @returns Array of the persisted records in order.
|
4284
|
+
*/
|
4285
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4286
|
+
/**
|
4287
|
+
* Queries a single record from the table given its unique id.
|
4288
|
+
* @param id The unique id.
|
4289
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4290
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3439
4291
|
*/
|
3440
|
-
abstract
|
4292
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3441
4293
|
/**
|
3442
4294
|
* Queries a single record from the table given its unique id.
|
3443
4295
|
* @param id The unique id.
|
@@ -3447,9 +4299,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3447
4299
|
/**
|
3448
4300
|
* Queries multiple records from the table given their unique id.
|
3449
4301
|
* @param ids The unique ids array.
|
3450
|
-
* @
|
4302
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4303
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4304
|
+
*/
|
4305
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4306
|
+
/**
|
4307
|
+
* Queries multiple records from the table given their unique id.
|
4308
|
+
* @param ids The unique ids array.
|
4309
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3451
4310
|
*/
|
3452
|
-
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']
|
4311
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4312
|
+
/**
|
4313
|
+
* Queries a single record from the table by the id in the object.
|
4314
|
+
* @param object Object containing the id of the record.
|
4315
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4316
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
4317
|
+
*/
|
4318
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3453
4319
|
/**
|
3454
4320
|
* Queries a single record from the table by the id in the object.
|
3455
4321
|
* @param object Object containing the id of the record.
|
@@ -3459,35 +4325,81 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3459
4325
|
/**
|
3460
4326
|
* Queries multiple records from the table by the ids in the objects.
|
3461
4327
|
* @param objects Array of objects containing the ids of the records.
|
3462
|
-
* @
|
4328
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4329
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4330
|
+
*/
|
4331
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4332
|
+
/**
|
4333
|
+
* Queries multiple records from the table by the ids in the objects.
|
4334
|
+
* @param objects Array of objects containing the ids of the records.
|
4335
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3463
4336
|
*/
|
3464
|
-
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']
|
4337
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3465
4338
|
/**
|
3466
4339
|
* Partially update a single record.
|
3467
4340
|
* @param object An object with its id and the columns to be updated.
|
3468
|
-
* @
|
4341
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4342
|
+
* @returns The full persisted record, null if the record could not be found.
|
4343
|
+
*/
|
4344
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4345
|
+
/**
|
4346
|
+
* Partially update a single record.
|
4347
|
+
* @param object An object with its id and the columns to be updated.
|
4348
|
+
* @returns The full persisted record, null if the record could not be found.
|
3469
4349
|
*/
|
3470
|
-
abstract update(object: Partial<EditableData<
|
4350
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3471
4351
|
/**
|
3472
4352
|
* Partially update a single record given its unique id.
|
3473
4353
|
* @param id The unique id.
|
3474
4354
|
* @param object The column names and their values that have to be updated.
|
3475
|
-
* @
|
4355
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4356
|
+
* @returns The full persisted record, null if the record could not be found.
|
4357
|
+
*/
|
4358
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4359
|
+
/**
|
4360
|
+
* Partially update a single record given its unique id.
|
4361
|
+
* @param id The unique id.
|
4362
|
+
* @param object The column names and their values that have to be updated.
|
4363
|
+
* @returns The full persisted record, null if the record could not be found.
|
3476
4364
|
*/
|
3477
|
-
abstract update(id: string, object: Partial<EditableData<
|
4365
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3478
4366
|
/**
|
3479
4367
|
* Partially updates multiple records.
|
3480
4368
|
* @param objects An array of objects with their ids and columns to be updated.
|
3481
|
-
* @
|
4369
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4370
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
4371
|
+
*/
|
4372
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4373
|
+
/**
|
4374
|
+
* Partially updates multiple records.
|
4375
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
4376
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
4377
|
+
*/
|
4378
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4379
|
+
/**
|
4380
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4381
|
+
* it will be update, otherwise a new record will be created.
|
4382
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
4383
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4384
|
+
* @returns The full persisted record.
|
3482
4385
|
*/
|
3483
|
-
abstract
|
4386
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3484
4387
|
/**
|
3485
4388
|
* Creates or updates a single record. If a record exists with the given id,
|
3486
4389
|
* it will be update, otherwise a new record will be created.
|
3487
4390
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3488
4391
|
* @returns The full persisted record.
|
3489
4392
|
*/
|
3490
|
-
abstract createOrUpdate(object: EditableData<
|
4393
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4394
|
+
/**
|
4395
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4396
|
+
* it will be update, otherwise a new record will be created.
|
4397
|
+
* @param id A unique id.
|
4398
|
+
* @param object The column names and the values to be persisted.
|
4399
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4400
|
+
* @returns The full persisted record.
|
4401
|
+
*/
|
4402
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3491
4403
|
/**
|
3492
4404
|
* Creates or updates a single record. If a record exists with the given id,
|
3493
4405
|
* it will be update, otherwise a new record will be created.
|
@@ -3495,38 +4407,74 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3495
4407
|
* @param object The column names and the values to be persisted.
|
3496
4408
|
* @returns The full persisted record.
|
3497
4409
|
*/
|
3498
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
4410
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4411
|
+
/**
|
4412
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4413
|
+
* it will be update, otherwise a new record will be created.
|
4414
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
4415
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4416
|
+
* @returns Array of the persisted records.
|
4417
|
+
*/
|
4418
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3499
4419
|
/**
|
3500
4420
|
* Creates or updates a single record. If a record exists with the given id,
|
3501
4421
|
* it will be update, otherwise a new record will be created.
|
3502
4422
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3503
4423
|
* @returns Array of the persisted records.
|
3504
4424
|
*/
|
3505
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
4425
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3506
4426
|
/**
|
3507
4427
|
* Deletes a record given its unique id.
|
3508
|
-
* @param
|
3509
|
-
* @
|
4428
|
+
* @param object An object with a unique id.
|
4429
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4430
|
+
* @returns The deleted record, null if the record could not be found.
|
3510
4431
|
*/
|
3511
|
-
abstract delete(
|
4432
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3512
4433
|
/**
|
3513
4434
|
* Deletes a record given its unique id.
|
3514
|
-
* @param
|
3515
|
-
* @
|
4435
|
+
* @param object An object with a unique id.
|
4436
|
+
* @returns The deleted record, null if the record could not be found.
|
4437
|
+
*/
|
4438
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4439
|
+
/**
|
4440
|
+
* Deletes a record given a unique id.
|
4441
|
+
* @param id The unique id.
|
4442
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4443
|
+
* @returns The deleted record, null if the record could not be found.
|
3516
4444
|
*/
|
3517
|
-
abstract delete(id:
|
4445
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3518
4446
|
/**
|
3519
|
-
* Deletes a record given a
|
3520
|
-
* @param
|
3521
|
-
* @
|
4447
|
+
* Deletes a record given a unique id.
|
4448
|
+
* @param id The unique id.
|
4449
|
+
* @returns The deleted record, null if the record could not be found.
|
4450
|
+
*/
|
4451
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4452
|
+
/**
|
4453
|
+
* Deletes multiple records given an array of objects with ids.
|
4454
|
+
* @param objects An array of objects with unique ids.
|
4455
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4456
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4457
|
+
*/
|
4458
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4459
|
+
/**
|
4460
|
+
* Deletes multiple records given an array of objects with ids.
|
4461
|
+
* @param objects An array of objects with unique ids.
|
4462
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4463
|
+
*/
|
4464
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4465
|
+
/**
|
4466
|
+
* Deletes multiple records given an array of unique ids.
|
4467
|
+
* @param objects An array of ids.
|
4468
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4469
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3522
4470
|
*/
|
3523
|
-
abstract delete(
|
4471
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
3524
4472
|
/**
|
3525
|
-
* Deletes
|
3526
|
-
* @param
|
3527
|
-
* @
|
4473
|
+
* Deletes multiple records given an array of unique ids.
|
4474
|
+
* @param objects An array of ids.
|
4475
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3528
4476
|
*/
|
3529
|
-
abstract delete(
|
4477
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3530
4478
|
/**
|
3531
4479
|
* Search for records in the table.
|
3532
4480
|
* @param query The query to search for.
|
@@ -3535,41 +4483,122 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3535
4483
|
*/
|
3536
4484
|
abstract search(query: string, options?: {
|
3537
4485
|
fuzziness?: FuzzinessExpression;
|
4486
|
+
prefix?: PrefixExpression;
|
3538
4487
|
highlight?: HighlightExpression;
|
3539
4488
|
filter?: Filter<Record>;
|
3540
|
-
|
4489
|
+
boosters?: Boosters<Record>[];
|
4490
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3541
4491
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3542
4492
|
}
|
3543
|
-
declare class RestRepository<
|
4493
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3544
4494
|
#private;
|
3545
|
-
db: SchemaPluginResult<any>;
|
3546
4495
|
constructor(options: {
|
3547
4496
|
table: string;
|
3548
4497
|
db: SchemaPluginResult<any>;
|
3549
4498
|
pluginOptions: XataPluginOptions;
|
4499
|
+
schemaTables?: Table[];
|
3550
4500
|
});
|
3551
|
-
create(object: EditableData<
|
3552
|
-
create(
|
3553
|
-
create(
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
read(
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
4501
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4502
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4503
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4504
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4505
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4506
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4507
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
4508
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
4509
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4510
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4511
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
4512
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
4513
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4514
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4515
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4516
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4517
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4518
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4519
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4520
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4521
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4522
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4523
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4524
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4525
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4526
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4527
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4528
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4529
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4530
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4531
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4532
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4533
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4534
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3565
4535
|
search(query: string, options?: {
|
3566
4536
|
fuzziness?: FuzzinessExpression;
|
4537
|
+
prefix?: PrefixExpression;
|
3567
4538
|
highlight?: HighlightExpression;
|
3568
4539
|
filter?: Filter<Record>;
|
3569
|
-
|
4540
|
+
boosters?: Boosters<Record>[];
|
4541
|
+
}): Promise<any>;
|
3570
4542
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3571
4543
|
}
|
3572
4544
|
|
4545
|
+
declare type BaseSchema = {
|
4546
|
+
name: string;
|
4547
|
+
columns: readonly ({
|
4548
|
+
name: string;
|
4549
|
+
type: Column['type'];
|
4550
|
+
} | {
|
4551
|
+
name: string;
|
4552
|
+
type: 'link';
|
4553
|
+
link: {
|
4554
|
+
table: string;
|
4555
|
+
};
|
4556
|
+
} | {
|
4557
|
+
name: string;
|
4558
|
+
type: 'object';
|
4559
|
+
columns: {
|
4560
|
+
name: string;
|
4561
|
+
type: string;
|
4562
|
+
}[];
|
4563
|
+
})[];
|
4564
|
+
};
|
4565
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
4566
|
+
name: string;
|
4567
|
+
columns: readonly unknown[];
|
4568
|
+
} ? {
|
4569
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
4570
|
+
} : never : never;
|
4571
|
+
declare type TableType<Tables, TableName> = Tables & {
|
4572
|
+
name: TableName;
|
4573
|
+
} extends infer Table ? Table extends {
|
4574
|
+
name: string;
|
4575
|
+
columns: infer Columns;
|
4576
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
4577
|
+
name: string;
|
4578
|
+
type: string;
|
4579
|
+
} ? Identifiable & {
|
4580
|
+
[K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
|
4581
|
+
} : never : never : never : never;
|
4582
|
+
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
4583
|
+
name: PropertyName;
|
4584
|
+
} extends infer Property ? Property extends {
|
4585
|
+
name: string;
|
4586
|
+
type: infer Type;
|
4587
|
+
link?: {
|
4588
|
+
table: infer LinkedTable;
|
4589
|
+
};
|
4590
|
+
columns?: infer ObjectColumns;
|
4591
|
+
} ? (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 {
|
4592
|
+
name: string;
|
4593
|
+
type: string;
|
4594
|
+
} ? {
|
4595
|
+
[K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
|
4596
|
+
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
|
4597
|
+
|
4598
|
+
/**
|
4599
|
+
* Operator to restrict results to only values that are greater than the given value.
|
4600
|
+
*/
|
4601
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3573
4602
|
/**
|
3574
4603
|
* Operator to restrict results to only values that are greater than the given value.
|
3575
4604
|
*/
|
@@ -3577,15 +4606,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3577
4606
|
/**
|
3578
4607
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3579
4608
|
*/
|
3580
|
-
declare const
|
4609
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4610
|
+
/**
|
4611
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
4612
|
+
*/
|
4613
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3581
4614
|
/**
|
3582
4615
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3583
4616
|
*/
|
3584
4617
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4618
|
+
/**
|
4619
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
4620
|
+
*/
|
4621
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4622
|
+
/**
|
4623
|
+
* Operator to restrict results to only values that are lower than the given value.
|
4624
|
+
*/
|
4625
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3585
4626
|
/**
|
3586
4627
|
* Operator to restrict results to only values that are lower than the given value.
|
3587
4628
|
*/
|
3588
4629
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4630
|
+
/**
|
4631
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
4632
|
+
*/
|
4633
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4634
|
+
/**
|
4635
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
4636
|
+
*/
|
4637
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3589
4638
|
/**
|
3590
4639
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3591
4640
|
*/
|
@@ -3618,6 +4667,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3618
4667
|
* Operator to restrict results to only values that are equal to the given value.
|
3619
4668
|
*/
|
3620
4669
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
4670
|
+
/**
|
4671
|
+
* Operator to restrict results to only values that are equal to the given value.
|
4672
|
+
*/
|
4673
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
3621
4674
|
/**
|
3622
4675
|
* Operator to restrict results to only values that are not equal to the given value.
|
3623
4676
|
*/
|
@@ -3646,59 +4699,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3646
4699
|
declare type SchemaDefinition = {
|
3647
4700
|
table: string;
|
3648
4701
|
};
|
3649
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
4702
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
3650
4703
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3651
|
-
} & {
|
3652
|
-
[key: string]: Repository<XataRecord$1>;
|
3653
4704
|
};
|
3654
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
4705
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3655
4706
|
#private;
|
3656
|
-
|
3657
|
-
constructor(tableNames?: string[] | undefined);
|
4707
|
+
constructor(schemaTables?: Schemas.Table[]);
|
3658
4708
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3659
4709
|
}
|
3660
4710
|
|
3661
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3662
|
-
fuzziness?: FuzzinessExpression;
|
3663
|
-
highlight?: HighlightExpression;
|
3664
|
-
tables?: Array<Tables | Values<{
|
3665
|
-
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3666
|
-
table: Model;
|
3667
|
-
filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3668
|
-
};
|
3669
|
-
}>>;
|
3670
|
-
};
|
3671
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3672
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3673
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3674
|
-
table: Model;
|
3675
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3676
|
-
};
|
3677
|
-
}>[]>;
|
3678
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3679
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3680
|
-
}>;
|
3681
|
-
};
|
3682
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3683
|
-
#private;
|
3684
|
-
private db;
|
3685
|
-
constructor(db: SchemaPluginResult<Schemas>);
|
3686
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3687
|
-
}
|
3688
|
-
declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
|
3689
|
-
declare type SearchExtraProperties = {
|
3690
|
-
table: string;
|
3691
|
-
highlight?: {
|
3692
|
-
[key: string]: string[] | {
|
3693
|
-
[key: string]: any;
|
3694
|
-
};
|
3695
|
-
};
|
3696
|
-
};
|
3697
|
-
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3698
|
-
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 {
|
3699
|
-
table: infer Table;
|
3700
|
-
} ? ReturnTable<Table, Tables> : never;
|
3701
|
-
|
3702
4711
|
declare type BranchStrategyValue = string | undefined | null;
|
3703
4712
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3704
4713
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3710,20 +4719,35 @@ declare type BaseClientOptions = {
|
|
3710
4719
|
databaseURL?: string;
|
3711
4720
|
branch?: BranchStrategyOption;
|
3712
4721
|
cache?: CacheImpl;
|
4722
|
+
trace?: TraceFunction;
|
3713
4723
|
};
|
3714
4724
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3715
4725
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3716
|
-
new <Schemas extends Record<string,
|
4726
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
3717
4727
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
3718
4728
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3719
4729
|
}, keyof Plugins> & {
|
3720
4730
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
4731
|
+
} & {
|
4732
|
+
getConfig(): Promise<{
|
4733
|
+
databaseURL: string;
|
4734
|
+
branch: string;
|
4735
|
+
}>;
|
3721
4736
|
};
|
3722
4737
|
}
|
3723
4738
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3724
4739
|
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
3725
4740
|
}
|
3726
4741
|
|
4742
|
+
declare class Serializer {
|
4743
|
+
classes: Record<string, any>;
|
4744
|
+
add(clazz: any): void;
|
4745
|
+
toJSON<T>(data: T): string;
|
4746
|
+
fromJSON<T>(json: string): T;
|
4747
|
+
}
|
4748
|
+
declare const serialize: <T>(data: T) => string;
|
4749
|
+
declare const deserialize: <T>(json: string) => T;
|
4750
|
+
|
3727
4751
|
declare type BranchResolutionOptions = {
|
3728
4752
|
databaseURL?: string;
|
3729
4753
|
apiKey?: string;
|
@@ -3735,9 +4759,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
3735
4759
|
|
3736
4760
|
declare function getAPIKey(): string | undefined;
|
3737
4761
|
|
4762
|
+
interface Body {
|
4763
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
4764
|
+
blob(): Promise<Blob>;
|
4765
|
+
formData(): Promise<FormData>;
|
4766
|
+
json(): Promise<any>;
|
4767
|
+
text(): Promise<string>;
|
4768
|
+
}
|
4769
|
+
interface Blob {
|
4770
|
+
readonly size: number;
|
4771
|
+
readonly type: string;
|
4772
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
4773
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
4774
|
+
text(): Promise<string>;
|
4775
|
+
}
|
4776
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
4777
|
+
interface File extends Blob {
|
4778
|
+
readonly lastModified: number;
|
4779
|
+
readonly name: string;
|
4780
|
+
readonly webkitRelativePath: string;
|
4781
|
+
}
|
4782
|
+
declare type FormDataEntryValue = File | string;
|
4783
|
+
/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
|
4784
|
+
interface FormData {
|
4785
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
4786
|
+
delete(name: string): void;
|
4787
|
+
get(name: string): FormDataEntryValue | null;
|
4788
|
+
getAll(name: string): FormDataEntryValue[];
|
4789
|
+
has(name: string): boolean;
|
4790
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
4791
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
4792
|
+
}
|
4793
|
+
/** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
|
4794
|
+
interface Headers {
|
4795
|
+
append(name: string, value: string): void;
|
4796
|
+
delete(name: string): void;
|
4797
|
+
get(name: string): string | null;
|
4798
|
+
has(name: string): boolean;
|
4799
|
+
set(name: string, value: string): void;
|
4800
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
4801
|
+
}
|
4802
|
+
interface Request extends Body {
|
4803
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
4804
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
4805
|
+
/** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. */
|
4806
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
4807
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
4808
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
4809
|
+
/** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header. */
|
4810
|
+
readonly headers: Headers;
|
4811
|
+
/** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] */
|
4812
|
+
readonly integrity: string;
|
4813
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
4814
|
+
readonly keepalive: boolean;
|
4815
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
4816
|
+
readonly method: string;
|
4817
|
+
/** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. */
|
4818
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
4819
|
+
/** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. */
|
4820
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
4821
|
+
/** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made. */
|
4822
|
+
readonly referrer: string;
|
4823
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
4824
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
4825
|
+
/** Returns the URL of request as a string. */
|
4826
|
+
readonly url: string;
|
4827
|
+
clone(): Request;
|
4828
|
+
}
|
4829
|
+
|
4830
|
+
declare type XataWorkerContext<XataClient> = {
|
4831
|
+
xata: XataClient;
|
4832
|
+
request: Request;
|
4833
|
+
env: Record<string, string | undefined>;
|
4834
|
+
};
|
4835
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
4836
|
+
declare type WorkerRunnerConfig = {
|
4837
|
+
workspace: string;
|
4838
|
+
worker: string;
|
4839
|
+
};
|
4840
|
+
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>>>;
|
4841
|
+
|
3738
4842
|
declare class XataError extends Error {
|
3739
4843
|
readonly status: number;
|
3740
4844
|
constructor(message: string, status: number);
|
3741
4845
|
}
|
3742
4846
|
|
3743
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
4847
|
+
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, PatchDatabaseMetadataError, PatchDatabaseMetadataPathParams, PatchDatabaseMetadataRequestBody, PatchDatabaseMetadataVariables, 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, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaResponse, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, 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, patchDatabaseMetadata, pattern, previewBranchSchemaEdit, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, updateBranchMetadata, updateBranchSchema, updateColumn, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|