@xata.io/client 0.0.0-alpha.vfbac5b5 → 0.0.0-alpha.vfc5c289
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 +770 -350
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1266 -209
- package/dist/index.mjs +743 -351
- 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
|
/**
|
@@ -94,7 +99,7 @@ declare type WorkspaceID = string;
|
|
94
99
|
declare type Role = 'owner' | 'maintainer';
|
95
100
|
declare type WorkspaceMeta = {
|
96
101
|
name: string;
|
97
|
-
slug
|
102
|
+
slug?: string;
|
98
103
|
};
|
99
104
|
declare type Workspace = WorkspaceMeta & {
|
100
105
|
id: WorkspaceID;
|
@@ -125,20 +130,22 @@ declare type WorkspaceMembers = {
|
|
125
130
|
* @pattern ^ik_[a-zA-Z0-9]+
|
126
131
|
*/
|
127
132
|
declare type InviteKey = string;
|
133
|
+
/**
|
134
|
+
* Metadata of databases
|
135
|
+
*/
|
136
|
+
declare type DatabaseMetadata = {
|
137
|
+
name: string;
|
138
|
+
createdAt: DateTime;
|
139
|
+
numberOfBranches: number;
|
140
|
+
ui?: {
|
141
|
+
color?: string;
|
142
|
+
};
|
143
|
+
};
|
128
144
|
declare type ListDatabasesResponse = {
|
129
|
-
databases?:
|
130
|
-
name: string;
|
131
|
-
displayName: string;
|
132
|
-
createdAt: DateTime;
|
133
|
-
numberOfBranches: number;
|
134
|
-
ui?: {
|
135
|
-
color?: string;
|
136
|
-
};
|
137
|
-
}[];
|
145
|
+
databases?: DatabaseMetadata[];
|
138
146
|
};
|
139
147
|
declare type ListBranchesResponse = {
|
140
148
|
databaseName: string;
|
141
|
-
displayName: string;
|
142
149
|
branches: Branch[];
|
143
150
|
};
|
144
151
|
declare type ListGitBranchesResponse = {
|
@@ -184,12 +191,28 @@ declare type Schema = {
|
|
184
191
|
tables: Table[];
|
185
192
|
tablesOrder?: string[];
|
186
193
|
};
|
194
|
+
/**
|
195
|
+
* @x-internal true
|
196
|
+
*/
|
197
|
+
declare type SchemaEditScript = {
|
198
|
+
sourceMigrationID?: string;
|
199
|
+
targetMigrationID?: string;
|
200
|
+
tables: TableEdit[];
|
201
|
+
};
|
187
202
|
declare type Table = {
|
188
203
|
id?: string;
|
189
204
|
name: TableName;
|
190
205
|
columns: Column[];
|
191
206
|
revLinks?: RevLink[];
|
192
207
|
};
|
208
|
+
/**
|
209
|
+
* @x-internal true
|
210
|
+
*/
|
211
|
+
declare type TableEdit = {
|
212
|
+
oldName?: string;
|
213
|
+
newName?: string;
|
214
|
+
columns?: MigrationColumnOp[];
|
215
|
+
};
|
193
216
|
/**
|
194
217
|
* @x-go-type xata.Column
|
195
218
|
*/
|
@@ -199,6 +222,8 @@ declare type Column = {
|
|
199
222
|
link?: {
|
200
223
|
table: string;
|
201
224
|
};
|
225
|
+
notNull?: boolean;
|
226
|
+
unique?: boolean;
|
202
227
|
columns?: Column[];
|
203
228
|
};
|
204
229
|
declare type RevLink = {
|
@@ -265,6 +290,110 @@ declare type ColumnMigration = {
|
|
265
290
|
old: Column;
|
266
291
|
['new']: Column;
|
267
292
|
};
|
293
|
+
/**
|
294
|
+
* @x-internal true
|
295
|
+
*/
|
296
|
+
declare type Commit = {
|
297
|
+
meta?: {
|
298
|
+
title?: string;
|
299
|
+
message?: string;
|
300
|
+
id: string;
|
301
|
+
parentID?: string;
|
302
|
+
mergeParentID?: string;
|
303
|
+
status: string;
|
304
|
+
createdAt: DateTime;
|
305
|
+
modifiedAt?: DateTime;
|
306
|
+
};
|
307
|
+
operations: MigrationOp[];
|
308
|
+
};
|
309
|
+
/**
|
310
|
+
* Branch schema migration.
|
311
|
+
*
|
312
|
+
* @x-internal true
|
313
|
+
*/
|
314
|
+
declare type Migration = {
|
315
|
+
parentID?: string;
|
316
|
+
operations: MigrationOp[];
|
317
|
+
};
|
318
|
+
/**
|
319
|
+
* Branch schema migration operations.
|
320
|
+
*
|
321
|
+
* @x-internal true
|
322
|
+
*/
|
323
|
+
declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
|
324
|
+
/**
|
325
|
+
* @x-internal true
|
326
|
+
*/
|
327
|
+
declare type MigrationTableOp = {
|
328
|
+
addTable: TableOpAdd;
|
329
|
+
} | {
|
330
|
+
removeTable: TableOpRemove;
|
331
|
+
} | {
|
332
|
+
renameTable: TableOpRename;
|
333
|
+
};
|
334
|
+
/**
|
335
|
+
* @x-internal true
|
336
|
+
*/
|
337
|
+
declare type MigrationColumnOp = {
|
338
|
+
addColumn: ColumnOpAdd;
|
339
|
+
} | {
|
340
|
+
removeColumn: ColumnOpRemove;
|
341
|
+
} | {
|
342
|
+
renameColumn: ColumnOpRename;
|
343
|
+
};
|
344
|
+
/**
|
345
|
+
* @x-internal true
|
346
|
+
*/
|
347
|
+
declare type TableOpAdd = {
|
348
|
+
table: string;
|
349
|
+
};
|
350
|
+
/**
|
351
|
+
* @x-internal true
|
352
|
+
*/
|
353
|
+
declare type TableOpRemove = {
|
354
|
+
table: string;
|
355
|
+
};
|
356
|
+
/**
|
357
|
+
* @x-internal true
|
358
|
+
*/
|
359
|
+
declare type TableOpRename = {
|
360
|
+
oldName: string;
|
361
|
+
newName: string;
|
362
|
+
};
|
363
|
+
/**
|
364
|
+
* @x-internal true
|
365
|
+
*/
|
366
|
+
declare type ColumnOpAdd = {
|
367
|
+
table?: string;
|
368
|
+
column: Column;
|
369
|
+
};
|
370
|
+
/**
|
371
|
+
* @x-internal true
|
372
|
+
*/
|
373
|
+
declare type ColumnOpRemove = {
|
374
|
+
table?: string;
|
375
|
+
column: string;
|
376
|
+
};
|
377
|
+
/**
|
378
|
+
* @x-internal true
|
379
|
+
*/
|
380
|
+
declare type ColumnOpRename = {
|
381
|
+
table?: string;
|
382
|
+
oldName: string;
|
383
|
+
newName: string;
|
384
|
+
};
|
385
|
+
declare type MigrationRequest = {
|
386
|
+
number: number;
|
387
|
+
createdAt: DateTime;
|
388
|
+
modifiedAt?: DateTime;
|
389
|
+
closedAt?: DateTime;
|
390
|
+
mergedAt?: DateTime;
|
391
|
+
status: 'open' | 'closed' | 'merging' | 'merged';
|
392
|
+
title: string;
|
393
|
+
body: string;
|
394
|
+
source: string;
|
395
|
+
target: string;
|
396
|
+
};
|
268
397
|
declare type SortExpression = string[] | {
|
269
398
|
[key: string]: SortOrder;
|
270
399
|
} | {
|
@@ -273,7 +402,7 @@ declare type SortExpression = string[] | {
|
|
273
402
|
declare type SortOrder = 'asc' | 'desc';
|
274
403
|
/**
|
275
404
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
276
|
-
* distance is the number of one
|
405
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
277
406
|
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
278
407
|
* to allow two typos in a word.
|
279
408
|
*
|
@@ -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;
|
@@ -1015,7 +1272,6 @@ declare type CreateDatabaseResponse = {
|
|
1015
1272
|
branchName?: string;
|
1016
1273
|
};
|
1017
1274
|
declare type CreateDatabaseRequestBody = {
|
1018
|
-
displayName?: string;
|
1019
1275
|
branchName?: string;
|
1020
1276
|
ui?: {
|
1021
1277
|
color?: string;
|
@@ -1051,6 +1307,54 @@ declare type DeleteDatabaseVariables = {
|
|
1051
1307
|
* Delete a database and all of its branches and tables permanently.
|
1052
1308
|
*/
|
1053
1309
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1310
|
+
declare type GetDatabaseMetadataPathParams = {
|
1311
|
+
dbName: DBName;
|
1312
|
+
workspace: string;
|
1313
|
+
};
|
1314
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
1315
|
+
status: 400;
|
1316
|
+
payload: BadRequestError;
|
1317
|
+
} | {
|
1318
|
+
status: 401;
|
1319
|
+
payload: AuthError;
|
1320
|
+
} | {
|
1321
|
+
status: 404;
|
1322
|
+
payload: SimpleError;
|
1323
|
+
}>;
|
1324
|
+
declare type GetDatabaseMetadataVariables = {
|
1325
|
+
pathParams: GetDatabaseMetadataPathParams;
|
1326
|
+
} & FetcherExtraProps;
|
1327
|
+
/**
|
1328
|
+
* Retrieve metadata of the given database
|
1329
|
+
*/
|
1330
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1331
|
+
declare type UpdateDatabaseMetadataPathParams = {
|
1332
|
+
dbName: DBName;
|
1333
|
+
workspace: string;
|
1334
|
+
};
|
1335
|
+
declare type UpdateDatabaseMetadataError = ErrorWrapper<{
|
1336
|
+
status: 400;
|
1337
|
+
payload: BadRequestError;
|
1338
|
+
} | {
|
1339
|
+
status: 401;
|
1340
|
+
payload: AuthError;
|
1341
|
+
} | {
|
1342
|
+
status: 404;
|
1343
|
+
payload: SimpleError;
|
1344
|
+
}>;
|
1345
|
+
declare type UpdateDatabaseMetadataRequestBody = {
|
1346
|
+
ui?: {
|
1347
|
+
color?: string;
|
1348
|
+
};
|
1349
|
+
};
|
1350
|
+
declare type UpdateDatabaseMetadataVariables = {
|
1351
|
+
body?: UpdateDatabaseMetadataRequestBody;
|
1352
|
+
pathParams: UpdateDatabaseMetadataPathParams;
|
1353
|
+
} & FetcherExtraProps;
|
1354
|
+
/**
|
1355
|
+
* Update the color of the selected database
|
1356
|
+
*/
|
1357
|
+
declare const updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
1054
1358
|
declare type GetGitBranchesMappingPathParams = {
|
1055
1359
|
dbName: DBName;
|
1056
1360
|
workspace: string;
|
@@ -1208,6 +1512,201 @@ declare type ResolveBranchVariables = {
|
|
1208
1512
|
* ```
|
1209
1513
|
*/
|
1210
1514
|
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1515
|
+
declare type ListMigrationRequestsPathParams = {
|
1516
|
+
dbName: DBName;
|
1517
|
+
workspace: string;
|
1518
|
+
};
|
1519
|
+
declare type ListMigrationRequestsError = ErrorWrapper<{
|
1520
|
+
status: 400;
|
1521
|
+
payload: BadRequestError;
|
1522
|
+
} | {
|
1523
|
+
status: 401;
|
1524
|
+
payload: AuthError;
|
1525
|
+
} | {
|
1526
|
+
status: 404;
|
1527
|
+
payload: SimpleError;
|
1528
|
+
}>;
|
1529
|
+
declare type ListMigrationRequestsResponse = {
|
1530
|
+
migrationRequests: MigrationRequest[];
|
1531
|
+
meta: RecordsMetadata;
|
1532
|
+
};
|
1533
|
+
declare type ListMigrationRequestsRequestBody = {
|
1534
|
+
filter?: FilterExpression;
|
1535
|
+
sort?: SortExpression;
|
1536
|
+
page?: PageConfig;
|
1537
|
+
columns?: ColumnsProjection;
|
1538
|
+
};
|
1539
|
+
declare type ListMigrationRequestsVariables = {
|
1540
|
+
body?: ListMigrationRequestsRequestBody;
|
1541
|
+
pathParams: ListMigrationRequestsPathParams;
|
1542
|
+
} & FetcherExtraProps;
|
1543
|
+
declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
1544
|
+
declare type CreateMigrationRequestPathParams = {
|
1545
|
+
dbName: DBName;
|
1546
|
+
workspace: string;
|
1547
|
+
};
|
1548
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
1549
|
+
status: 400;
|
1550
|
+
payload: BadRequestError;
|
1551
|
+
} | {
|
1552
|
+
status: 401;
|
1553
|
+
payload: AuthError;
|
1554
|
+
} | {
|
1555
|
+
status: 404;
|
1556
|
+
payload: SimpleError;
|
1557
|
+
}>;
|
1558
|
+
declare type CreateMigrationRequestResponse = {
|
1559
|
+
number: number;
|
1560
|
+
};
|
1561
|
+
declare type CreateMigrationRequestRequestBody = {
|
1562
|
+
source: string;
|
1563
|
+
target: string;
|
1564
|
+
title: string;
|
1565
|
+
body?: string;
|
1566
|
+
};
|
1567
|
+
declare type CreateMigrationRequestVariables = {
|
1568
|
+
body: CreateMigrationRequestRequestBody;
|
1569
|
+
pathParams: CreateMigrationRequestPathParams;
|
1570
|
+
} & FetcherExtraProps;
|
1571
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
1572
|
+
declare type GetMigrationRequestPathParams = {
|
1573
|
+
dbName: DBName;
|
1574
|
+
mrNumber: number;
|
1575
|
+
workspace: string;
|
1576
|
+
};
|
1577
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
1578
|
+
status: 400;
|
1579
|
+
payload: BadRequestError;
|
1580
|
+
} | {
|
1581
|
+
status: 401;
|
1582
|
+
payload: AuthError;
|
1583
|
+
} | {
|
1584
|
+
status: 404;
|
1585
|
+
payload: SimpleError;
|
1586
|
+
}>;
|
1587
|
+
declare type GetMigrationRequestVariables = {
|
1588
|
+
pathParams: GetMigrationRequestPathParams;
|
1589
|
+
} & FetcherExtraProps;
|
1590
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
1591
|
+
declare type UpdateMigrationRequestPathParams = {
|
1592
|
+
dbName: DBName;
|
1593
|
+
mrNumber: number;
|
1594
|
+
workspace: string;
|
1595
|
+
};
|
1596
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
1597
|
+
status: 400;
|
1598
|
+
payload: BadRequestError;
|
1599
|
+
} | {
|
1600
|
+
status: 401;
|
1601
|
+
payload: AuthError;
|
1602
|
+
} | {
|
1603
|
+
status: 404;
|
1604
|
+
payload: SimpleError;
|
1605
|
+
}>;
|
1606
|
+
declare type UpdateMigrationRequestRequestBody = {
|
1607
|
+
title?: string;
|
1608
|
+
body?: string;
|
1609
|
+
status?: 'open' | 'closed';
|
1610
|
+
};
|
1611
|
+
declare type UpdateMigrationRequestVariables = {
|
1612
|
+
body?: UpdateMigrationRequestRequestBody;
|
1613
|
+
pathParams: UpdateMigrationRequestPathParams;
|
1614
|
+
} & FetcherExtraProps;
|
1615
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
1616
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
1617
|
+
dbName: DBName;
|
1618
|
+
mrNumber: number;
|
1619
|
+
workspace: string;
|
1620
|
+
};
|
1621
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
1622
|
+
status: 400;
|
1623
|
+
payload: BadRequestError;
|
1624
|
+
} | {
|
1625
|
+
status: 401;
|
1626
|
+
payload: AuthError;
|
1627
|
+
} | {
|
1628
|
+
status: 404;
|
1629
|
+
payload: SimpleError;
|
1630
|
+
}>;
|
1631
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
1632
|
+
meta: {
|
1633
|
+
cursor: string;
|
1634
|
+
more: boolean;
|
1635
|
+
};
|
1636
|
+
logs: Commit[];
|
1637
|
+
};
|
1638
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
1639
|
+
page?: {
|
1640
|
+
after?: string;
|
1641
|
+
before?: string;
|
1642
|
+
size?: number;
|
1643
|
+
};
|
1644
|
+
};
|
1645
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
1646
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
1647
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
1648
|
+
} & FetcherExtraProps;
|
1649
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
1650
|
+
declare type CompareMigrationRequestPathParams = {
|
1651
|
+
dbName: DBName;
|
1652
|
+
mrNumber: number;
|
1653
|
+
workspace: string;
|
1654
|
+
};
|
1655
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
1656
|
+
status: 400;
|
1657
|
+
payload: BadRequestError;
|
1658
|
+
} | {
|
1659
|
+
status: 401;
|
1660
|
+
payload: AuthError;
|
1661
|
+
} | {
|
1662
|
+
status: 404;
|
1663
|
+
payload: SimpleError;
|
1664
|
+
}>;
|
1665
|
+
declare type CompareMigrationRequestVariables = {
|
1666
|
+
pathParams: CompareMigrationRequestPathParams;
|
1667
|
+
} & FetcherExtraProps;
|
1668
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
1669
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
1670
|
+
dbName: DBName;
|
1671
|
+
mrNumber: number;
|
1672
|
+
workspace: string;
|
1673
|
+
};
|
1674
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
1675
|
+
status: 400;
|
1676
|
+
payload: BadRequestError;
|
1677
|
+
} | {
|
1678
|
+
status: 401;
|
1679
|
+
payload: AuthError;
|
1680
|
+
} | {
|
1681
|
+
status: 404;
|
1682
|
+
payload: SimpleError;
|
1683
|
+
}>;
|
1684
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
1685
|
+
merged?: boolean;
|
1686
|
+
};
|
1687
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
1688
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
1689
|
+
} & FetcherExtraProps;
|
1690
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
1691
|
+
declare type MergeMigrationRequestPathParams = {
|
1692
|
+
dbName: DBName;
|
1693
|
+
mrNumber: number;
|
1694
|
+
workspace: string;
|
1695
|
+
};
|
1696
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
1697
|
+
status: 400;
|
1698
|
+
payload: BadRequestError;
|
1699
|
+
} | {
|
1700
|
+
status: 401;
|
1701
|
+
payload: AuthError;
|
1702
|
+
} | {
|
1703
|
+
status: 404;
|
1704
|
+
payload: SimpleError;
|
1705
|
+
}>;
|
1706
|
+
declare type MergeMigrationRequestVariables = {
|
1707
|
+
pathParams: MergeMigrationRequestPathParams;
|
1708
|
+
} & FetcherExtraProps;
|
1709
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
1211
1710
|
declare type GetBranchDetailsPathParams = {
|
1212
1711
|
dbBranchName: DBBranchName;
|
1213
1712
|
workspace: string;
|
@@ -1243,6 +1742,10 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1243
1742
|
status: 404;
|
1244
1743
|
payload: SimpleError;
|
1245
1744
|
}>;
|
1745
|
+
declare type CreateBranchResponse = {
|
1746
|
+
databaseName: string;
|
1747
|
+
branchName: string;
|
1748
|
+
};
|
1246
1749
|
declare type CreateBranchRequestBody = {
|
1247
1750
|
from?: string;
|
1248
1751
|
metadata?: BranchMetadata;
|
@@ -1252,7 +1755,7 @@ declare type CreateBranchVariables = {
|
|
1252
1755
|
pathParams: CreateBranchPathParams;
|
1253
1756
|
queryParams?: CreateBranchQueryParams;
|
1254
1757
|
} & FetcherExtraProps;
|
1255
|
-
declare const createBranch: (variables: CreateBranchVariables) => Promise<
|
1758
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
1256
1759
|
declare type DeleteBranchPathParams = {
|
1257
1760
|
dbBranchName: DBBranchName;
|
1258
1761
|
workspace: string;
|
@@ -1385,10 +1888,161 @@ declare type GetBranchMigrationPlanVariables = {
|
|
1385
1888
|
body: Schema;
|
1386
1889
|
pathParams: GetBranchMigrationPlanPathParams;
|
1387
1890
|
} & FetcherExtraProps;
|
1388
|
-
/**
|
1389
|
-
* Compute a migration plan from a target schema the branch should be migrated too.
|
1390
|
-
*/
|
1391
|
-
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
1891
|
+
/**
|
1892
|
+
* Compute a migration plan from a target schema the branch should be migrated too.
|
1893
|
+
*/
|
1894
|
+
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
1895
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
1896
|
+
dbBranchName: DBBranchName;
|
1897
|
+
workspace: string;
|
1898
|
+
};
|
1899
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
1900
|
+
status: 400;
|
1901
|
+
payload: BadRequestError;
|
1902
|
+
} | {
|
1903
|
+
status: 401;
|
1904
|
+
payload: AuthError;
|
1905
|
+
} | {
|
1906
|
+
status: 404;
|
1907
|
+
payload: SimpleError;
|
1908
|
+
}>;
|
1909
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
1910
|
+
schema: Schema;
|
1911
|
+
};
|
1912
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
1913
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
1914
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
1915
|
+
} & FetcherExtraProps;
|
1916
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
1917
|
+
declare type CompareBranchSchemasPathParams = {
|
1918
|
+
dbBranchName: DBBranchName;
|
1919
|
+
branchName: BranchName;
|
1920
|
+
workspace: string;
|
1921
|
+
};
|
1922
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
1923
|
+
status: 400;
|
1924
|
+
payload: BadRequestError;
|
1925
|
+
} | {
|
1926
|
+
status: 401;
|
1927
|
+
payload: AuthError;
|
1928
|
+
} | {
|
1929
|
+
status: 404;
|
1930
|
+
payload: SimpleError;
|
1931
|
+
}>;
|
1932
|
+
declare type CompareBranchSchemasVariables = {
|
1933
|
+
body?: Record<string, any>;
|
1934
|
+
pathParams: CompareBranchSchemasPathParams;
|
1935
|
+
} & FetcherExtraProps;
|
1936
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
1937
|
+
declare type UpdateBranchSchemaPathParams = {
|
1938
|
+
dbBranchName: DBBranchName;
|
1939
|
+
workspace: string;
|
1940
|
+
};
|
1941
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
1942
|
+
status: 400;
|
1943
|
+
payload: BadRequestError;
|
1944
|
+
} | {
|
1945
|
+
status: 401;
|
1946
|
+
payload: AuthError;
|
1947
|
+
} | {
|
1948
|
+
status: 404;
|
1949
|
+
payload: SimpleError;
|
1950
|
+
}>;
|
1951
|
+
declare type UpdateBranchSchemaResponse = {
|
1952
|
+
id: string;
|
1953
|
+
parentID: string;
|
1954
|
+
};
|
1955
|
+
declare type UpdateBranchSchemaVariables = {
|
1956
|
+
body: Migration;
|
1957
|
+
pathParams: UpdateBranchSchemaPathParams;
|
1958
|
+
} & FetcherExtraProps;
|
1959
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
1960
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
1961
|
+
dbBranchName: DBBranchName;
|
1962
|
+
workspace: string;
|
1963
|
+
};
|
1964
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
1965
|
+
status: 400;
|
1966
|
+
payload: BadRequestError;
|
1967
|
+
} | {
|
1968
|
+
status: 401;
|
1969
|
+
payload: AuthError;
|
1970
|
+
} | {
|
1971
|
+
status: 404;
|
1972
|
+
payload: SimpleError;
|
1973
|
+
}>;
|
1974
|
+
declare type PreviewBranchSchemaEditResponse = {
|
1975
|
+
original: Schema;
|
1976
|
+
updated: Schema;
|
1977
|
+
};
|
1978
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
1979
|
+
edits?: SchemaEditScript;
|
1980
|
+
operations?: MigrationOp[];
|
1981
|
+
};
|
1982
|
+
declare type PreviewBranchSchemaEditVariables = {
|
1983
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
1984
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
1985
|
+
} & FetcherExtraProps;
|
1986
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
1987
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
1988
|
+
dbBranchName: DBBranchName;
|
1989
|
+
workspace: string;
|
1990
|
+
};
|
1991
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
1992
|
+
status: 400;
|
1993
|
+
payload: BadRequestError;
|
1994
|
+
} | {
|
1995
|
+
status: 401;
|
1996
|
+
payload: AuthError;
|
1997
|
+
} | {
|
1998
|
+
status: 404;
|
1999
|
+
payload: SimpleError;
|
2000
|
+
}>;
|
2001
|
+
declare type ApplyBranchSchemaEditResponse = {
|
2002
|
+
id: string;
|
2003
|
+
parentID: string;
|
2004
|
+
};
|
2005
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
2006
|
+
edits: SchemaEditScript;
|
2007
|
+
};
|
2008
|
+
declare type ApplyBranchSchemaEditVariables = {
|
2009
|
+
body: ApplyBranchSchemaEditRequestBody;
|
2010
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
2011
|
+
} & FetcherExtraProps;
|
2012
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
2013
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
2014
|
+
dbBranchName: DBBranchName;
|
2015
|
+
workspace: string;
|
2016
|
+
};
|
2017
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
2018
|
+
status: 400;
|
2019
|
+
payload: BadRequestError;
|
2020
|
+
} | {
|
2021
|
+
status: 401;
|
2022
|
+
payload: AuthError;
|
2023
|
+
} | {
|
2024
|
+
status: 404;
|
2025
|
+
payload: SimpleError;
|
2026
|
+
}>;
|
2027
|
+
declare type GetBranchSchemaHistoryResponse = {
|
2028
|
+
meta: {
|
2029
|
+
cursor: string;
|
2030
|
+
more: boolean;
|
2031
|
+
};
|
2032
|
+
logs: Commit[];
|
2033
|
+
};
|
2034
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
2035
|
+
page?: {
|
2036
|
+
after?: string;
|
2037
|
+
before?: string;
|
2038
|
+
size?: number;
|
2039
|
+
};
|
2040
|
+
};
|
2041
|
+
declare type GetBranchSchemaHistoryVariables = {
|
2042
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
2043
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
2044
|
+
} & FetcherExtraProps;
|
2045
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
1392
2046
|
declare type GetBranchStatsPathParams = {
|
1393
2047
|
dbBranchName: DBBranchName;
|
1394
2048
|
workspace: string;
|
@@ -1439,13 +2093,17 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1439
2093
|
status: 422;
|
1440
2094
|
payload: SimpleError;
|
1441
2095
|
}>;
|
2096
|
+
declare type CreateTableResponse = {
|
2097
|
+
branchName: string;
|
2098
|
+
tableName: string;
|
2099
|
+
};
|
1442
2100
|
declare type CreateTableVariables = {
|
1443
2101
|
pathParams: CreateTablePathParams;
|
1444
2102
|
} & FetcherExtraProps;
|
1445
2103
|
/**
|
1446
2104
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1447
2105
|
*/
|
1448
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
2106
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1449
2107
|
declare type DeleteTablePathParams = {
|
1450
2108
|
dbBranchName: DBBranchName;
|
1451
2109
|
tableName: TableName;
|
@@ -1678,6 +2336,9 @@ declare type InsertRecordPathParams = {
|
|
1678
2336
|
tableName: TableName;
|
1679
2337
|
workspace: string;
|
1680
2338
|
};
|
2339
|
+
declare type InsertRecordQueryParams = {
|
2340
|
+
columns?: ColumnsProjection;
|
2341
|
+
};
|
1681
2342
|
declare type InsertRecordError = ErrorWrapper<{
|
1682
2343
|
status: 400;
|
1683
2344
|
payload: BadRequestError;
|
@@ -1688,20 +2349,15 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1688
2349
|
status: 404;
|
1689
2350
|
payload: SimpleError;
|
1690
2351
|
}>;
|
1691
|
-
declare type InsertRecordResponse = {
|
1692
|
-
id: string;
|
1693
|
-
xata: {
|
1694
|
-
version: number;
|
1695
|
-
};
|
1696
|
-
};
|
1697
2352
|
declare type InsertRecordVariables = {
|
1698
2353
|
body?: Record<string, any>;
|
1699
2354
|
pathParams: InsertRecordPathParams;
|
2355
|
+
queryParams?: InsertRecordQueryParams;
|
1700
2356
|
} & FetcherExtraProps;
|
1701
2357
|
/**
|
1702
2358
|
* Insert a new Record into the Table
|
1703
2359
|
*/
|
1704
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
2360
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1705
2361
|
declare type InsertRecordWithIDPathParams = {
|
1706
2362
|
dbBranchName: DBBranchName;
|
1707
2363
|
tableName: TableName;
|
@@ -1709,6 +2365,7 @@ declare type InsertRecordWithIDPathParams = {
|
|
1709
2365
|
workspace: string;
|
1710
2366
|
};
|
1711
2367
|
declare type InsertRecordWithIDQueryParams = {
|
2368
|
+
columns?: ColumnsProjection;
|
1712
2369
|
createOnly?: boolean;
|
1713
2370
|
ifVersion?: number;
|
1714
2371
|
};
|
@@ -1741,6 +2398,7 @@ declare type UpdateRecordWithIDPathParams = {
|
|
1741
2398
|
workspace: string;
|
1742
2399
|
};
|
1743
2400
|
declare type UpdateRecordWithIDQueryParams = {
|
2401
|
+
columns?: ColumnsProjection;
|
1744
2402
|
ifVersion?: number;
|
1745
2403
|
};
|
1746
2404
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1769,6 +2427,7 @@ declare type UpsertRecordWithIDPathParams = {
|
|
1769
2427
|
workspace: string;
|
1770
2428
|
};
|
1771
2429
|
declare type UpsertRecordWithIDQueryParams = {
|
2430
|
+
columns?: ColumnsProjection;
|
1772
2431
|
ifVersion?: number;
|
1773
2432
|
};
|
1774
2433
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1796,6 +2455,9 @@ declare type DeleteRecordPathParams = {
|
|
1796
2455
|
recordId: RecordID;
|
1797
2456
|
workspace: string;
|
1798
2457
|
};
|
2458
|
+
declare type DeleteRecordQueryParams = {
|
2459
|
+
columns?: ColumnsProjection;
|
2460
|
+
};
|
1799
2461
|
declare type DeleteRecordError = ErrorWrapper<{
|
1800
2462
|
status: 400;
|
1801
2463
|
payload: BadRequestError;
|
@@ -1808,14 +2470,18 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1808
2470
|
}>;
|
1809
2471
|
declare type DeleteRecordVariables = {
|
1810
2472
|
pathParams: DeleteRecordPathParams;
|
2473
|
+
queryParams?: DeleteRecordQueryParams;
|
1811
2474
|
} & FetcherExtraProps;
|
1812
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
2475
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1813
2476
|
declare type GetRecordPathParams = {
|
1814
2477
|
dbBranchName: DBBranchName;
|
1815
2478
|
tableName: TableName;
|
1816
2479
|
recordId: RecordID;
|
1817
2480
|
workspace: string;
|
1818
2481
|
};
|
2482
|
+
declare type GetRecordQueryParams = {
|
2483
|
+
columns?: ColumnsProjection;
|
2484
|
+
};
|
1819
2485
|
declare type GetRecordError = ErrorWrapper<{
|
1820
2486
|
status: 400;
|
1821
2487
|
payload: BadRequestError;
|
@@ -1826,12 +2492,9 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1826
2492
|
status: 404;
|
1827
2493
|
payload: SimpleError;
|
1828
2494
|
}>;
|
1829
|
-
declare type GetRecordRequestBody = {
|
1830
|
-
columns?: ColumnsFilter;
|
1831
|
-
};
|
1832
2495
|
declare type GetRecordVariables = {
|
1833
|
-
body?: GetRecordRequestBody;
|
1834
2496
|
pathParams: GetRecordPathParams;
|
2497
|
+
queryParams?: GetRecordQueryParams;
|
1835
2498
|
} & FetcherExtraProps;
|
1836
2499
|
/**
|
1837
2500
|
* Retrieve record by ID
|
@@ -1842,6 +2505,9 @@ declare type BulkInsertTableRecordsPathParams = {
|
|
1842
2505
|
tableName: TableName;
|
1843
2506
|
workspace: string;
|
1844
2507
|
};
|
2508
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
2509
|
+
columns?: ColumnsProjection;
|
2510
|
+
};
|
1845
2511
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1846
2512
|
status: 400;
|
1847
2513
|
payload: BulkError;
|
@@ -1851,21 +2517,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1851
2517
|
} | {
|
1852
2518
|
status: 404;
|
1853
2519
|
payload: SimpleError;
|
2520
|
+
} | {
|
2521
|
+
status: 422;
|
2522
|
+
payload: SimpleError;
|
1854
2523
|
}>;
|
1855
|
-
declare type BulkInsertTableRecordsResponse = {
|
1856
|
-
recordIDs: string[];
|
1857
|
-
};
|
1858
2524
|
declare type BulkInsertTableRecordsRequestBody = {
|
1859
2525
|
records: Record<string, any>[];
|
1860
2526
|
};
|
1861
2527
|
declare type BulkInsertTableRecordsVariables = {
|
1862
2528
|
body: BulkInsertTableRecordsRequestBody;
|
1863
2529
|
pathParams: BulkInsertTableRecordsPathParams;
|
2530
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1864
2531
|
} & FetcherExtraProps;
|
1865
2532
|
/**
|
1866
2533
|
* Bulk insert records
|
1867
2534
|
*/
|
1868
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
2535
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1869
2536
|
declare type QueryTablePathParams = {
|
1870
2537
|
dbBranchName: DBBranchName;
|
1871
2538
|
tableName: TableName;
|
@@ -1885,7 +2552,7 @@ declare type QueryTableRequestBody = {
|
|
1885
2552
|
filter?: FilterExpression;
|
1886
2553
|
sort?: SortExpression;
|
1887
2554
|
page?: PageConfig;
|
1888
|
-
columns?:
|
2555
|
+
columns?: ColumnsProjection;
|
1889
2556
|
};
|
1890
2557
|
declare type QueryTableVariables = {
|
1891
2558
|
body?: QueryTableRequestBody;
|
@@ -2634,6 +3301,7 @@ declare type SearchTableRequestBody = {
|
|
2634
3301
|
prefix?: PrefixExpression;
|
2635
3302
|
filter?: FilterExpression;
|
2636
3303
|
highlight?: HighlightExpression;
|
3304
|
+
boosters?: BoosterExpression[];
|
2637
3305
|
};
|
2638
3306
|
declare type SearchTableVariables = {
|
2639
3307
|
body: SearchTableRequestBody;
|
@@ -2665,9 +3333,11 @@ declare type SearchBranchRequestBody = {
|
|
2665
3333
|
tables?: (string | {
|
2666
3334
|
table: string;
|
2667
3335
|
filter?: FilterExpression;
|
3336
|
+
boosters?: BoosterExpression[];
|
2668
3337
|
})[];
|
2669
3338
|
query: string;
|
2670
3339
|
fuzziness?: FuzzinessExpression;
|
3340
|
+
prefix?: PrefixExpression;
|
2671
3341
|
highlight?: HighlightExpression;
|
2672
3342
|
};
|
2673
3343
|
declare type SearchBranchVariables = {
|
@@ -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
|
+
updateDatabaseMetadata: (variables: UpdateDatabaseMetadataVariables) => 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,8 @@ 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>;
|
3501
|
+
updateDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: UpdateDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
2808
3502
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2809
3503
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2810
3504
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
@@ -2815,19 +3509,16 @@ declare class BranchApi {
|
|
2815
3509
|
constructor(extraProps: FetcherExtraProps);
|
2816
3510
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2817
3511
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2818
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
3512
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
2819
3513
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2820
3514
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2821
3515
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
2822
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
2823
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
2824
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
2825
3516
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
2826
3517
|
}
|
2827
3518
|
declare class TableApi {
|
2828
3519
|
private extraProps;
|
2829
3520
|
constructor(extraProps: FetcherExtraProps);
|
2830
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
3521
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2831
3522
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2832
3523
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2833
3524
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2841,17 +3532,42 @@ declare class TableApi {
|
|
2841
3532
|
declare class RecordsApi {
|
2842
3533
|
private extraProps;
|
2843
3534
|
constructor(extraProps: FetcherExtraProps);
|
2844
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
3535
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
2845
3536
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2846
3537
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2847
3538
|
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<
|
3539
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
3540
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
3541
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
2851
3542
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2852
3543
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2853
3544
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
2854
3545
|
}
|
3546
|
+
declare class MigrationRequestsApi {
|
3547
|
+
private extraProps;
|
3548
|
+
constructor(extraProps: FetcherExtraProps);
|
3549
|
+
listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
|
3550
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
3551
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
3552
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
3553
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
3554
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
3555
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
3556
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
3557
|
+
}
|
3558
|
+
declare class BranchSchemaApi {
|
3559
|
+
private extraProps;
|
3560
|
+
constructor(extraProps: FetcherExtraProps);
|
3561
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
3562
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
3563
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
3564
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
3565
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
3566
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
3567
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
3568
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
3569
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
3570
|
+
}
|
2855
3571
|
|
2856
3572
|
declare class XataApiPlugin implements XataPlugin {
|
2857
3573
|
build(options: XataPluginOptions): Promise<XataApiClient>;
|
@@ -2863,19 +3579,20 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2863
3579
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2864
3580
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2865
3581
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2866
|
-
declare type NonEmptyArray<T> = T[] & {
|
2867
|
-
0: T;
|
2868
|
-
};
|
2869
3582
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2870
3583
|
[P in K]-?: NonNullable<T[P]>;
|
2871
3584
|
};
|
2872
3585
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2873
3586
|
declare type SingleOrArray<T> = T | T[];
|
2874
3587
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
3588
|
+
declare type Without<T, U> = {
|
3589
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
3590
|
+
};
|
3591
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
2875
3592
|
|
2876
3593
|
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
|
3594
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
3595
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2879
3596
|
}>>;
|
2880
3597
|
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
3598
|
V: ValueAtColumn<Item, V>;
|
@@ -2911,41 +3628,68 @@ interface BaseData {
|
|
2911
3628
|
/**
|
2912
3629
|
* Represents a persisted record from the database.
|
2913
3630
|
*/
|
2914
|
-
interface XataRecord<
|
3631
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2915
3632
|
/**
|
2916
3633
|
* Get metadata of this record.
|
2917
3634
|
*/
|
2918
|
-
getMetadata(): XataRecordMetadata
|
3635
|
+
getMetadata(): XataRecordMetadata;
|
3636
|
+
/**
|
3637
|
+
* Retrieves a refreshed copy of the current record from the database.
|
3638
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3639
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3640
|
+
*/
|
3641
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2919
3642
|
/**
|
2920
3643
|
* Retrieves a refreshed copy of the current record from the database.
|
3644
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2921
3645
|
*/
|
2922
|
-
read(): Promise<Readonly<SelectedPick<
|
3646
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2923
3647
|
/**
|
2924
3648
|
* Performs a partial update of the current record. On success a new object is
|
2925
3649
|
* returned and the current object is not mutated.
|
2926
3650
|
* @param partialUpdate The columns and their values that have to be updated.
|
2927
|
-
* @
|
3651
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3652
|
+
* @returns The persisted record with the selected columns, null if not found.
|
3653
|
+
*/
|
3654
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3655
|
+
/**
|
3656
|
+
* Performs a partial update of the current record. On success a new object is
|
3657
|
+
* returned and the current object is not mutated.
|
3658
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
3659
|
+
* @returns The persisted record with all first level properties, null if not found.
|
2928
3660
|
*/
|
2929
|
-
update(partialUpdate: Partial<EditableData<
|
3661
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2930
3662
|
/**
|
2931
3663
|
* Performs a deletion of the current record in the database.
|
2932
|
-
*
|
2933
|
-
* @
|
3664
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3665
|
+
* @returns The deleted record, null if not found.
|
2934
3666
|
*/
|
2935
|
-
delete(): Promise<
|
3667
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3668
|
+
/**
|
3669
|
+
* Performs a deletion of the current record in the database.
|
3670
|
+
* @returns The deleted record, null if not found.
|
3671
|
+
|
3672
|
+
*/
|
3673
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2936
3674
|
}
|
2937
3675
|
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
2938
3676
|
/**
|
2939
3677
|
* Retrieves a refreshed copy of the current record from the database.
|
2940
3678
|
*/
|
2941
|
-
read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3679
|
+
read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
|
2942
3680
|
/**
|
2943
3681
|
* Performs a partial update of the current record. On success a new object is
|
2944
3682
|
* returned and the current object is not mutated.
|
2945
3683
|
* @param partialUpdate The columns and their values that have to be updated.
|
2946
3684
|
* @returns A new record containing the latest values for all the columns of the current record.
|
2947
3685
|
*/
|
2948
|
-
update(partialUpdate: Partial<EditableData<
|
3686
|
+
update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Record>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
|
3687
|
+
/**
|
3688
|
+
* Performs a deletion of the current record in the database.
|
3689
|
+
*
|
3690
|
+
* @throws If the record was already deleted or if an error happened while performing the deletion.
|
3691
|
+
*/
|
3692
|
+
delete(): Promise<void>;
|
2949
3693
|
};
|
2950
3694
|
declare type XataRecordMetadata = {
|
2951
3695
|
/**
|
@@ -2956,13 +3700,13 @@ declare type XataRecordMetadata = {
|
|
2956
3700
|
};
|
2957
3701
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2958
3702
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2959
|
-
declare type EditableData<O extends
|
3703
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
2960
3704
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2961
3705
|
id: string;
|
2962
3706
|
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2963
3707
|
id: string;
|
2964
3708
|
} | string | null | undefined : O[K];
|
2965
|
-
}
|
3709
|
+
}, keyof XataRecord>;
|
2966
3710
|
|
2967
3711
|
/**
|
2968
3712
|
* PropertyMatchFilter
|
@@ -3056,7 +3800,85 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
3056
3800
|
declare type NestedApiFilter<T> = {
|
3057
3801
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3058
3802
|
};
|
3059
|
-
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
3803
|
+
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>;
|
3804
|
+
|
3805
|
+
declare type DateBooster = {
|
3806
|
+
origin?: string;
|
3807
|
+
scale: string;
|
3808
|
+
decay: number;
|
3809
|
+
};
|
3810
|
+
declare type NumericBooster = {
|
3811
|
+
factor: number;
|
3812
|
+
};
|
3813
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
3814
|
+
value: T;
|
3815
|
+
factor: number;
|
3816
|
+
};
|
3817
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
3818
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
3819
|
+
dateBooster: {
|
3820
|
+
column: K;
|
3821
|
+
} & DateBooster;
|
3822
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
3823
|
+
numericBooster?: {
|
3824
|
+
column: K;
|
3825
|
+
} & NumericBooster;
|
3826
|
+
}, {
|
3827
|
+
valueBooster?: {
|
3828
|
+
column: K;
|
3829
|
+
} & ValueBooster<number>;
|
3830
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
3831
|
+
valueBooster: {
|
3832
|
+
column: K;
|
3833
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
3834
|
+
} : never;
|
3835
|
+
}>;
|
3836
|
+
|
3837
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3838
|
+
fuzziness?: FuzzinessExpression;
|
3839
|
+
prefix?: PrefixExpression;
|
3840
|
+
highlight?: HighlightExpression;
|
3841
|
+
tables?: Array<Tables | Values<{
|
3842
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3843
|
+
table: Model;
|
3844
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
3845
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
3846
|
+
};
|
3847
|
+
}>>;
|
3848
|
+
};
|
3849
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3850
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3851
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3852
|
+
table: Model;
|
3853
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
3854
|
+
};
|
3855
|
+
}>[]>;
|
3856
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3857
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
3858
|
+
}>;
|
3859
|
+
};
|
3860
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3861
|
+
#private;
|
3862
|
+
private db;
|
3863
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3864
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3865
|
+
}
|
3866
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
3867
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
3868
|
+
};
|
3869
|
+
declare type SearchExtraProperties = {
|
3870
|
+
table: string;
|
3871
|
+
highlight?: {
|
3872
|
+
[key: string]: string[] | {
|
3873
|
+
[key: string]: any;
|
3874
|
+
};
|
3875
|
+
};
|
3876
|
+
score?: number;
|
3877
|
+
};
|
3878
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3879
|
+
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 {
|
3880
|
+
table: infer Table;
|
3881
|
+
} ? ReturnTable<Table, Tables> : never;
|
3060
3882
|
|
3061
3883
|
declare type SortDirection = 'asc' | 'desc';
|
3062
3884
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -3069,7 +3891,7 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
3069
3891
|
};
|
3070
3892
|
|
3071
3893
|
declare type BaseOptions<T extends XataRecord> = {
|
3072
|
-
columns?:
|
3894
|
+
columns?: SelectableColumn<T>[];
|
3073
3895
|
cache?: number;
|
3074
3896
|
};
|
3075
3897
|
declare type CursorQueryOptions = {
|
@@ -3093,7 +3915,10 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3093
3915
|
#private;
|
3094
3916
|
readonly meta: PaginationQueryMeta;
|
3095
3917
|
readonly records: RecordArray<Result>;
|
3096
|
-
constructor(repository: Repository<Record> | null, table:
|
3918
|
+
constructor(repository: Repository<Record> | null, table: {
|
3919
|
+
name: string;
|
3920
|
+
schema?: Table;
|
3921
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3097
3922
|
getQueryOptions(): QueryOptions<Record>;
|
3098
3923
|
key(): string;
|
3099
3924
|
/**
|
@@ -3132,7 +3957,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3132
3957
|
* @param value The value to filter.
|
3133
3958
|
* @returns A new Query object.
|
3134
3959
|
*/
|
3135
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F
|
3960
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
3136
3961
|
/**
|
3137
3962
|
* Builds a new query object adding one or more constraints. Examples:
|
3138
3963
|
*
|
@@ -3146,20 +3971,23 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3146
3971
|
* @param filters A filter object
|
3147
3972
|
* @returns A new Query object.
|
3148
3973
|
*/
|
3149
|
-
filter(filters
|
3974
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
3975
|
+
defaultFilter<T>(column: string, value: T): T | {
|
3976
|
+
$includes: (T & string) | (T & string[]);
|
3977
|
+
};
|
3150
3978
|
/**
|
3151
3979
|
* Builds a new query with a new sort option.
|
3152
3980
|
* @param column The column name.
|
3153
3981
|
* @param direction The direction. Either ascending or descending.
|
3154
3982
|
* @returns A new Query object.
|
3155
3983
|
*/
|
3156
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
3984
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
3157
3985
|
/**
|
3158
3986
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
3159
3987
|
* @param columns Array of column names to be returned by the query.
|
3160
3988
|
* @returns A new Query object.
|
3161
3989
|
*/
|
3162
|
-
select<K extends SelectableColumn<Record>>(columns:
|
3990
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
3163
3991
|
/**
|
3164
3992
|
* Get paginated results
|
3165
3993
|
*
|
@@ -3425,21 +4253,44 @@ declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
3425
4253
|
/**
|
3426
4254
|
* Common interface for performing operations on a table.
|
3427
4255
|
*/
|
3428
|
-
declare abstract class Repository<
|
3429
|
-
abstract create(object: EditableData<
|
4256
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
4257
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4258
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4259
|
+
/**
|
4260
|
+
* Creates a single record in the table with a unique id.
|
4261
|
+
* @param id The unique id.
|
4262
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
4263
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4264
|
+
* @returns The full persisted record.
|
4265
|
+
*/
|
4266
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3430
4267
|
/**
|
3431
4268
|
* Creates a single record in the table with a unique id.
|
3432
4269
|
* @param id The unique id.
|
3433
4270
|
* @param object Object containing the column names with their values to be stored in the table.
|
3434
4271
|
* @returns The full persisted record.
|
3435
4272
|
*/
|
3436
|
-
abstract create(id: string, object: EditableData<
|
4273
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3437
4274
|
/**
|
3438
4275
|
* Creates multiple records in the table.
|
3439
4276
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3440
|
-
* @
|
4277
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4278
|
+
* @returns Array of the persisted records in order.
|
3441
4279
|
*/
|
3442
|
-
abstract create(objects: Array<EditableData<
|
4280
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4281
|
+
/**
|
4282
|
+
* Creates multiple records in the table.
|
4283
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
4284
|
+
* @returns Array of the persisted records in order.
|
4285
|
+
*/
|
4286
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4287
|
+
/**
|
4288
|
+
* Queries a single record from the table given its unique id.
|
4289
|
+
* @param id The unique id.
|
4290
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4291
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
4292
|
+
*/
|
4293
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3443
4294
|
/**
|
3444
4295
|
* Queries a single record from the table given its unique id.
|
3445
4296
|
* @param id The unique id.
|
@@ -3449,9 +4300,23 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3449
4300
|
/**
|
3450
4301
|
* Queries multiple records from the table given their unique id.
|
3451
4302
|
* @param ids The unique ids array.
|
3452
|
-
* @
|
4303
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4304
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4305
|
+
*/
|
4306
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4307
|
+
/**
|
4308
|
+
* Queries multiple records from the table given their unique id.
|
4309
|
+
* @param ids The unique ids array.
|
4310
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4311
|
+
*/
|
4312
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4313
|
+
/**
|
4314
|
+
* Queries a single record from the table by the id in the object.
|
4315
|
+
* @param object Object containing the id of the record.
|
4316
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4317
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3453
4318
|
*/
|
3454
|
-
abstract read(
|
4319
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3455
4320
|
/**
|
3456
4321
|
* Queries a single record from the table by the id in the object.
|
3457
4322
|
* @param object Object containing the id of the record.
|
@@ -3461,35 +4326,81 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3461
4326
|
/**
|
3462
4327
|
* Queries multiple records from the table by the ids in the objects.
|
3463
4328
|
* @param objects Array of objects containing the ids of the records.
|
3464
|
-
* @
|
4329
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4330
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
4331
|
+
*/
|
4332
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4333
|
+
/**
|
4334
|
+
* Queries multiple records from the table by the ids in the objects.
|
4335
|
+
* @param objects Array of objects containing the ids of the records.
|
4336
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3465
4337
|
*/
|
3466
|
-
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']
|
4338
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3467
4339
|
/**
|
3468
4340
|
* Partially update a single record.
|
3469
4341
|
* @param object An object with its id and the columns to be updated.
|
3470
|
-
* @
|
4342
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4343
|
+
* @returns The full persisted record, null if the record could not be found.
|
4344
|
+
*/
|
4345
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4346
|
+
/**
|
4347
|
+
* Partially update a single record.
|
4348
|
+
* @param object An object with its id and the columns to be updated.
|
4349
|
+
* @returns The full persisted record, null if the record could not be found.
|
3471
4350
|
*/
|
3472
|
-
abstract update(object: Partial<EditableData<
|
4351
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3473
4352
|
/**
|
3474
4353
|
* Partially update a single record given its unique id.
|
3475
4354
|
* @param id The unique id.
|
3476
4355
|
* @param object The column names and their values that have to be updated.
|
3477
|
-
* @
|
4356
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4357
|
+
* @returns The full persisted record, null if the record could not be found.
|
4358
|
+
*/
|
4359
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4360
|
+
/**
|
4361
|
+
* Partially update a single record given its unique id.
|
4362
|
+
* @param id The unique id.
|
4363
|
+
* @param object The column names and their values that have to be updated.
|
4364
|
+
* @returns The full persisted record, null if the record could not be found.
|
3478
4365
|
*/
|
3479
|
-
abstract update(id: string, object: Partial<EditableData<
|
4366
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3480
4367
|
/**
|
3481
4368
|
* Partially updates multiple records.
|
3482
4369
|
* @param objects An array of objects with their ids and columns to be updated.
|
3483
|
-
* @
|
4370
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4371
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
4372
|
+
*/
|
4373
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4374
|
+
/**
|
4375
|
+
* Partially updates multiple records.
|
4376
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
4377
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
4378
|
+
*/
|
4379
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4380
|
+
/**
|
4381
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4382
|
+
* it will be update, otherwise a new record will be created.
|
4383
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
4384
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4385
|
+
* @returns The full persisted record.
|
3484
4386
|
*/
|
3485
|
-
abstract
|
4387
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3486
4388
|
/**
|
3487
4389
|
* Creates or updates a single record. If a record exists with the given id,
|
3488
4390
|
* it will be update, otherwise a new record will be created.
|
3489
4391
|
* @param object Object containing the column names with their values to be persisted in the table.
|
3490
4392
|
* @returns The full persisted record.
|
3491
4393
|
*/
|
3492
|
-
abstract createOrUpdate(object: EditableData<
|
4394
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4395
|
+
/**
|
4396
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4397
|
+
* it will be update, otherwise a new record will be created.
|
4398
|
+
* @param id A unique id.
|
4399
|
+
* @param object The column names and the values to be persisted.
|
4400
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4401
|
+
* @returns The full persisted record.
|
4402
|
+
*/
|
4403
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3493
4404
|
/**
|
3494
4405
|
* Creates or updates a single record. If a record exists with the given id,
|
3495
4406
|
* it will be update, otherwise a new record will be created.
|
@@ -3497,38 +4408,74 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3497
4408
|
* @param object The column names and the values to be persisted.
|
3498
4409
|
* @returns The full persisted record.
|
3499
4410
|
*/
|
3500
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
4411
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4412
|
+
/**
|
4413
|
+
* Creates or updates a single record. If a record exists with the given id,
|
4414
|
+
* it will be update, otherwise a new record will be created.
|
4415
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
4416
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4417
|
+
* @returns Array of the persisted records.
|
4418
|
+
*/
|
4419
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3501
4420
|
/**
|
3502
4421
|
* Creates or updates a single record. If a record exists with the given id,
|
3503
4422
|
* it will be update, otherwise a new record will be created.
|
3504
4423
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3505
4424
|
* @returns Array of the persisted records.
|
3506
4425
|
*/
|
3507
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
4426
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3508
4427
|
/**
|
3509
4428
|
* Deletes a record given its unique id.
|
3510
|
-
* @param
|
3511
|
-
* @
|
4429
|
+
* @param object An object with a unique id.
|
4430
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4431
|
+
* @returns The deleted record, null if the record could not be found.
|
3512
4432
|
*/
|
3513
|
-
abstract delete(
|
4433
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3514
4434
|
/**
|
3515
4435
|
* Deletes a record given its unique id.
|
3516
|
-
* @param
|
3517
|
-
* @
|
4436
|
+
* @param object An object with a unique id.
|
4437
|
+
* @returns The deleted record, null if the record could not be found.
|
4438
|
+
*/
|
4439
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4440
|
+
/**
|
4441
|
+
* Deletes a record given a unique id.
|
4442
|
+
* @param id The unique id.
|
4443
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4444
|
+
* @returns The deleted record, null if the record could not be found.
|
4445
|
+
*/
|
4446
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4447
|
+
/**
|
4448
|
+
* Deletes a record given a unique id.
|
4449
|
+
* @param id The unique id.
|
4450
|
+
* @returns The deleted record, null if the record could not be found.
|
3518
4451
|
*/
|
3519
|
-
abstract delete(id:
|
4452
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3520
4453
|
/**
|
3521
|
-
* Deletes
|
3522
|
-
* @param
|
3523
|
-
* @
|
4454
|
+
* Deletes multiple records given an array of objects with ids.
|
4455
|
+
* @param objects An array of objects with unique ids.
|
4456
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4457
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3524
4458
|
*/
|
3525
|
-
abstract delete(
|
4459
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
3526
4460
|
/**
|
3527
|
-
* Deletes
|
3528
|
-
* @param
|
3529
|
-
* @
|
4461
|
+
* Deletes multiple records given an array of objects with ids.
|
4462
|
+
* @param objects An array of objects with unique ids.
|
4463
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
3530
4464
|
*/
|
3531
|
-
abstract delete(
|
4465
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4466
|
+
/**
|
4467
|
+
* Deletes multiple records given an array of unique ids.
|
4468
|
+
* @param objects An array of ids.
|
4469
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
4470
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4471
|
+
*/
|
4472
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4473
|
+
/**
|
4474
|
+
* Deletes multiple records given an array of unique ids.
|
4475
|
+
* @param objects An array of ids.
|
4476
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
4477
|
+
*/
|
4478
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3532
4479
|
/**
|
3533
4480
|
* Search for records in the table.
|
3534
4481
|
* @param query The query to search for.
|
@@ -3537,39 +4484,62 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3537
4484
|
*/
|
3538
4485
|
abstract search(query: string, options?: {
|
3539
4486
|
fuzziness?: FuzzinessExpression;
|
4487
|
+
prefix?: PrefixExpression;
|
3540
4488
|
highlight?: HighlightExpression;
|
3541
4489
|
filter?: Filter<Record>;
|
3542
|
-
|
4490
|
+
boosters?: Boosters<Record>[];
|
4491
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3543
4492
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3544
4493
|
}
|
3545
|
-
declare class RestRepository<
|
4494
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
3546
4495
|
#private;
|
3547
|
-
db: SchemaPluginResult<any>;
|
3548
4496
|
constructor(options: {
|
3549
4497
|
table: string;
|
3550
4498
|
db: SchemaPluginResult<any>;
|
3551
4499
|
pluginOptions: XataPluginOptions;
|
3552
4500
|
schemaTables?: Table[];
|
3553
4501
|
});
|
3554
|
-
create(object: EditableData<
|
3555
|
-
create(
|
3556
|
-
create(
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
read(
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
4502
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4503
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4504
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4505
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4506
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4507
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4508
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
4509
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
4510
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4511
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4512
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
4513
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
4514
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4515
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4516
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4517
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4518
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4519
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4520
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4521
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4522
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4523
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4524
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
4525
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
4526
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
4527
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
4528
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4529
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4530
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
4531
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
4532
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4533
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
4534
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
4535
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3568
4536
|
search(query: string, options?: {
|
3569
4537
|
fuzziness?: FuzzinessExpression;
|
4538
|
+
prefix?: PrefixExpression;
|
3570
4539
|
highlight?: HighlightExpression;
|
3571
4540
|
filter?: Filter<Record>;
|
3572
|
-
|
4541
|
+
boosters?: Boosters<Record>[];
|
4542
|
+
}): Promise<any>;
|
3573
4543
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3574
4544
|
}
|
3575
4545
|
|
@@ -3578,6 +4548,7 @@ declare type BaseSchema = {
|
|
3578
4548
|
columns: readonly ({
|
3579
4549
|
name: string;
|
3580
4550
|
type: Column['type'];
|
4551
|
+
notNull?: boolean;
|
3581
4552
|
} | {
|
3582
4553
|
name: string;
|
3583
4554
|
type: 'link';
|
@@ -3607,10 +4578,10 @@ declare type TableType<Tables, TableName> = Tables & {
|
|
3607
4578
|
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3608
4579
|
name: string;
|
3609
4580
|
type: string;
|
3610
|
-
} ? Identifiable & {
|
3611
|
-
[K in Columns[number]['name']]
|
3612
|
-
} : never : never : never : never;
|
3613
|
-
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
4581
|
+
} ? Identifiable & UnionToIntersection<Values<{
|
4582
|
+
[K in Columns[number]['name']]: PropertyType<Tables, Columns[number], K>;
|
4583
|
+
}>> : never : never : never : never;
|
4584
|
+
declare type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Properties & {
|
3614
4585
|
name: PropertyName;
|
3615
4586
|
} extends infer Property ? Property extends {
|
3616
4587
|
name: string;
|
@@ -3619,13 +4590,23 @@ declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
|
3619
4590
|
table: infer LinkedTable;
|
3620
4591
|
};
|
3621
4592
|
columns?: infer ObjectColumns;
|
3622
|
-
|
4593
|
+
notNull?: infer NotNull;
|
4594
|
+
} ? NotNull extends true ? {
|
4595
|
+
[K in PropertyName]: InnerType<Type, ObjectColumns, Tables, LinkedTable>;
|
4596
|
+
} : {
|
4597
|
+
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
4598
|
+
} : never : never;
|
4599
|
+
declare type InnerType<Type, ObjectColumns, Tables, LinkedTable> = Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
|
3623
4600
|
name: string;
|
3624
4601
|
type: string;
|
3625
|
-
} ? {
|
3626
|
-
[K in ObjectColumns[number]['name']]
|
3627
|
-
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never
|
4602
|
+
} ? UnionToIntersection<Values<{
|
4603
|
+
[K in ObjectColumns[number]['name']]: PropertyType<Tables, ObjectColumns[number], K>;
|
4604
|
+
}>> : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never;
|
3628
4605
|
|
4606
|
+
/**
|
4607
|
+
* Operator to restrict results to only values that are greater than the given value.
|
4608
|
+
*/
|
4609
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3629
4610
|
/**
|
3630
4611
|
* Operator to restrict results to only values that are greater than the given value.
|
3631
4612
|
*/
|
@@ -3633,15 +4614,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
3633
4614
|
/**
|
3634
4615
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3635
4616
|
*/
|
3636
|
-
declare const
|
4617
|
+
declare const greaterThanEquals: <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 greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3637
4622
|
/**
|
3638
4623
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
3639
4624
|
*/
|
3640
4625
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4626
|
+
/**
|
4627
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
4628
|
+
*/
|
4629
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4630
|
+
/**
|
4631
|
+
* Operator to restrict results to only values that are lower than the given value.
|
4632
|
+
*/
|
4633
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3641
4634
|
/**
|
3642
4635
|
* Operator to restrict results to only values that are lower than the given value.
|
3643
4636
|
*/
|
3644
4637
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4638
|
+
/**
|
4639
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
4640
|
+
*/
|
4641
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
4642
|
+
/**
|
4643
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
4644
|
+
*/
|
4645
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
3645
4646
|
/**
|
3646
4647
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
3647
4648
|
*/
|
@@ -3674,6 +4675,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
3674
4675
|
* Operator to restrict results to only values that are equal to the given value.
|
3675
4676
|
*/
|
3676
4677
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
4678
|
+
/**
|
4679
|
+
* Operator to restrict results to only values that are equal to the given value.
|
4680
|
+
*/
|
4681
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
3677
4682
|
/**
|
3678
4683
|
* Operator to restrict results to only values that are not equal to the given value.
|
3679
4684
|
*/
|
@@ -3702,58 +4707,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3702
4707
|
declare type SchemaDefinition = {
|
3703
4708
|
table: string;
|
3704
4709
|
};
|
3705
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
4710
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
3706
4711
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3707
|
-
} & {
|
3708
|
-
[key: string]: Repository<XataRecord$1>;
|
3709
4712
|
};
|
3710
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
4713
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
3711
4714
|
#private;
|
3712
4715
|
constructor(schemaTables?: Schemas.Table[]);
|
3713
4716
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3714
4717
|
}
|
3715
4718
|
|
3716
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3717
|
-
fuzziness?: FuzzinessExpression;
|
3718
|
-
highlight?: HighlightExpression;
|
3719
|
-
tables?: Array<Tables | Values<{
|
3720
|
-
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3721
|
-
table: Model;
|
3722
|
-
filter?: Filter<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3723
|
-
};
|
3724
|
-
}>>;
|
3725
|
-
};
|
3726
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3727
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3728
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3729
|
-
table: Model;
|
3730
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3731
|
-
};
|
3732
|
-
}>[]>;
|
3733
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3734
|
-
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3735
|
-
}>;
|
3736
|
-
};
|
3737
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3738
|
-
#private;
|
3739
|
-
private db;
|
3740
|
-
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3741
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3742
|
-
}
|
3743
|
-
declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
|
3744
|
-
declare type SearchExtraProperties = {
|
3745
|
-
table: string;
|
3746
|
-
highlight?: {
|
3747
|
-
[key: string]: string[] | {
|
3748
|
-
[key: string]: any;
|
3749
|
-
};
|
3750
|
-
};
|
3751
|
-
};
|
3752
|
-
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3753
|
-
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 {
|
3754
|
-
table: infer Table;
|
3755
|
-
} ? ReturnTable<Table, Tables> : never;
|
3756
|
-
|
3757
4719
|
declare type BranchStrategyValue = string | undefined | null;
|
3758
4720
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3759
4721
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3765,19 +4727,34 @@ declare type BaseClientOptions = {
|
|
3765
4727
|
databaseURL?: string;
|
3766
4728
|
branch?: BranchStrategyOption;
|
3767
4729
|
cache?: CacheImpl;
|
4730
|
+
trace?: TraceFunction;
|
3768
4731
|
};
|
3769
4732
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3770
4733
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3771
|
-
new <
|
3772
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
3773
|
-
search: Awaited<ReturnType<SearchPlugin<
|
4734
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
4735
|
+
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
4736
|
+
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3774
4737
|
}, keyof Plugins> & {
|
3775
4738
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
4739
|
+
} & {
|
4740
|
+
getConfig(): Promise<{
|
4741
|
+
databaseURL: string;
|
4742
|
+
branch: string;
|
4743
|
+
}>;
|
3776
4744
|
};
|
3777
4745
|
}
|
3778
4746
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3779
|
-
declare class BaseClient extends BaseClient_base<
|
4747
|
+
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
4748
|
+
}
|
4749
|
+
|
4750
|
+
declare class Serializer {
|
4751
|
+
classes: Record<string, any>;
|
4752
|
+
add(clazz: any): void;
|
4753
|
+
toJSON<T>(data: T): string;
|
4754
|
+
fromJSON<T>(json: string): T;
|
3780
4755
|
}
|
4756
|
+
declare const serialize: <T>(data: T) => string;
|
4757
|
+
declare const deserialize: <T>(json: string) => T;
|
3781
4758
|
|
3782
4759
|
declare type BranchResolutionOptions = {
|
3783
4760
|
databaseURL?: string;
|
@@ -3790,9 +4767,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
3790
4767
|
|
3791
4768
|
declare function getAPIKey(): string | undefined;
|
3792
4769
|
|
4770
|
+
interface Body {
|
4771
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
4772
|
+
blob(): Promise<Blob>;
|
4773
|
+
formData(): Promise<FormData>;
|
4774
|
+
json(): Promise<any>;
|
4775
|
+
text(): Promise<string>;
|
4776
|
+
}
|
4777
|
+
interface Blob {
|
4778
|
+
readonly size: number;
|
4779
|
+
readonly type: string;
|
4780
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
4781
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
4782
|
+
text(): Promise<string>;
|
4783
|
+
}
|
4784
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
4785
|
+
interface File extends Blob {
|
4786
|
+
readonly lastModified: number;
|
4787
|
+
readonly name: string;
|
4788
|
+
readonly webkitRelativePath: string;
|
4789
|
+
}
|
4790
|
+
declare type FormDataEntryValue = File | string;
|
4791
|
+
/** 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". */
|
4792
|
+
interface FormData {
|
4793
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
4794
|
+
delete(name: string): void;
|
4795
|
+
get(name: string): FormDataEntryValue | null;
|
4796
|
+
getAll(name: string): FormDataEntryValue[];
|
4797
|
+
has(name: string): boolean;
|
4798
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
4799
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
4800
|
+
}
|
4801
|
+
/** 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. */
|
4802
|
+
interface Headers {
|
4803
|
+
append(name: string, value: string): void;
|
4804
|
+
delete(name: string): void;
|
4805
|
+
get(name: string): string | null;
|
4806
|
+
has(name: string): boolean;
|
4807
|
+
set(name: string, value: string): void;
|
4808
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
4809
|
+
}
|
4810
|
+
interface Request extends Body {
|
4811
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
4812
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
4813
|
+
/** 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. */
|
4814
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
4815
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
4816
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
4817
|
+
/** 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. */
|
4818
|
+
readonly headers: Headers;
|
4819
|
+
/** 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] */
|
4820
|
+
readonly integrity: string;
|
4821
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
4822
|
+
readonly keepalive: boolean;
|
4823
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
4824
|
+
readonly method: string;
|
4825
|
+
/** 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. */
|
4826
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
4827
|
+
/** 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. */
|
4828
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
4829
|
+
/** 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. */
|
4830
|
+
readonly referrer: string;
|
4831
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
4832
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
4833
|
+
/** Returns the URL of request as a string. */
|
4834
|
+
readonly url: string;
|
4835
|
+
clone(): Request;
|
4836
|
+
}
|
4837
|
+
|
4838
|
+
declare type XataWorkerContext<XataClient> = {
|
4839
|
+
xata: XataClient;
|
4840
|
+
request: Request;
|
4841
|
+
env: Record<string, string | undefined>;
|
4842
|
+
};
|
4843
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
4844
|
+
declare type WorkerRunnerConfig = {
|
4845
|
+
workspace: string;
|
4846
|
+
worker: string;
|
4847
|
+
};
|
4848
|
+
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>>>;
|
4849
|
+
|
3793
4850
|
declare class XataError extends Error {
|
3794
4851
|
readonly status: number;
|
3795
4852
|
constructor(message: string, status: number);
|
3796
4853
|
}
|
3797
4854
|
|
3798
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
4855
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditResponse, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListMigrationRequestsError, ListMigrationRequestsPathParams, ListMigrationRequestsRequestBody, ListMigrationRequestsResponse, ListMigrationRequestsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, Serializer, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaResponse, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateDatabaseMetadataError, UpdateDatabaseMetadataPathParams, UpdateDatabaseMetadataRequestBody, UpdateDatabaseMetadataVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, applyBranchSchemaEdit, buildClient, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequests, listMigrationRequestsCommits, lt, lte, mergeMigrationRequest, notExists, operationsByTag, pattern, previewBranchSchemaEdit, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|