@xata.io/client 0.0.0-alpha.vecada6d → 0.0.0-alpha.ved155c7
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 +182 -0
- package/README.md +273 -1
- package/Usage.md +449 -0
- package/dist/index.cjs +1011 -434
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1579 -271
- package/dist/index.mjs +964 -435
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
declare type AttributeDictionary = Record<string, string | number | boolean | undefined>;
|
|
2
|
+
declare type TraceFunction = <T>(name: string, fn: (options: {
|
|
3
|
+
setAttributes: (attrs: AttributeDictionary) => void;
|
|
4
|
+
}) => T, options?: AttributeDictionary) => Promise<T>;
|
|
5
|
+
|
|
1
6
|
declare type FetchImpl = (url: string, init?: {
|
|
2
7
|
body?: string;
|
|
3
8
|
headers?: Record<string, string>;
|
|
@@ -5,14 +10,19 @@ declare type FetchImpl = (url: string, init?: {
|
|
|
5
10
|
}) => Promise<{
|
|
6
11
|
ok: boolean;
|
|
7
12
|
status: number;
|
|
13
|
+
url: string;
|
|
8
14
|
json(): Promise<any>;
|
|
15
|
+
headers?: {
|
|
16
|
+
get(name: string): string | null;
|
|
17
|
+
};
|
|
9
18
|
}>;
|
|
10
|
-
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string
|
|
19
|
+
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Partial<Record<string, string | number>>) => string;
|
|
11
20
|
declare type FetcherExtraProps = {
|
|
12
21
|
apiUrl: string;
|
|
13
22
|
workspacesApiUrl: string | WorkspaceApiUrlBuilder;
|
|
14
23
|
fetchImpl: FetchImpl;
|
|
15
24
|
apiKey: string;
|
|
25
|
+
trace: TraceFunction;
|
|
16
26
|
};
|
|
17
27
|
declare type ErrorWrapper<TError> = TError | {
|
|
18
28
|
status: 'unknown';
|
|
@@ -20,7 +30,6 @@ declare type ErrorWrapper<TError> = TError | {
|
|
|
20
30
|
};
|
|
21
31
|
|
|
22
32
|
interface CacheImpl {
|
|
23
|
-
cacheRecords: boolean;
|
|
24
33
|
defaultQueryTTL: number;
|
|
25
34
|
getAll(): Promise<Record<string, unknown>>;
|
|
26
35
|
get: <T>(key: string) => Promise<T | null>;
|
|
@@ -30,13 +39,11 @@ interface CacheImpl {
|
|
|
30
39
|
}
|
|
31
40
|
interface SimpleCacheOptions {
|
|
32
41
|
max?: number;
|
|
33
|
-
cacheRecords?: boolean;
|
|
34
42
|
defaultQueryTTL?: number;
|
|
35
43
|
}
|
|
36
44
|
declare class SimpleCache implements CacheImpl {
|
|
37
45
|
#private;
|
|
38
46
|
capacity: number;
|
|
39
|
-
cacheRecords: boolean;
|
|
40
47
|
defaultQueryTTL: number;
|
|
41
48
|
constructor(options?: SimpleCacheOptions);
|
|
42
49
|
getAll(): Promise<Record<string, unknown>>;
|
|
@@ -52,6 +59,7 @@ declare abstract class XataPlugin {
|
|
|
52
59
|
declare type XataPluginOptions = {
|
|
53
60
|
getFetchProps: () => Promise<FetcherExtraProps>;
|
|
54
61
|
cache: CacheImpl;
|
|
62
|
+
trace?: TraceFunction;
|
|
55
63
|
};
|
|
56
64
|
|
|
57
65
|
/**
|
|
@@ -91,7 +99,7 @@ declare type WorkspaceID = string;
|
|
|
91
99
|
declare type Role = 'owner' | 'maintainer';
|
|
92
100
|
declare type WorkspaceMeta = {
|
|
93
101
|
name: string;
|
|
94
|
-
slug
|
|
102
|
+
slug?: string;
|
|
95
103
|
};
|
|
96
104
|
declare type Workspace = WorkspaceMeta & {
|
|
97
105
|
id: WorkspaceID;
|
|
@@ -122,16 +130,20 @@ declare type WorkspaceMembers = {
|
|
|
122
130
|
* @pattern ^ik_[a-zA-Z0-9]+
|
|
123
131
|
*/
|
|
124
132
|
declare type InviteKey = string;
|
|
133
|
+
/**
|
|
134
|
+
* Metadata of databases
|
|
135
|
+
*/
|
|
136
|
+
declare type DatabaseMetadata = {
|
|
137
|
+
name: string;
|
|
138
|
+
displayName: string;
|
|
139
|
+
createdAt: DateTime;
|
|
140
|
+
numberOfBranches: number;
|
|
141
|
+
ui?: {
|
|
142
|
+
color?: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
125
145
|
declare type ListDatabasesResponse = {
|
|
126
|
-
databases?:
|
|
127
|
-
name: string;
|
|
128
|
-
displayName: string;
|
|
129
|
-
createdAt: DateTime;
|
|
130
|
-
numberOfBranches: number;
|
|
131
|
-
ui?: {
|
|
132
|
-
color?: string;
|
|
133
|
-
};
|
|
134
|
-
}[];
|
|
146
|
+
databases?: DatabaseMetadata[];
|
|
135
147
|
};
|
|
136
148
|
declare type ListBranchesResponse = {
|
|
137
149
|
databaseName: string;
|
|
@@ -181,12 +193,28 @@ declare type Schema = {
|
|
|
181
193
|
tables: Table[];
|
|
182
194
|
tablesOrder?: string[];
|
|
183
195
|
};
|
|
196
|
+
/**
|
|
197
|
+
* @x-internal true
|
|
198
|
+
*/
|
|
199
|
+
declare type SchemaEditScript = {
|
|
200
|
+
sourceMigrationID?: string;
|
|
201
|
+
targetMigrationID?: string;
|
|
202
|
+
tables: TableEdit[];
|
|
203
|
+
};
|
|
184
204
|
declare type Table = {
|
|
185
205
|
id?: string;
|
|
186
206
|
name: TableName;
|
|
187
207
|
columns: Column[];
|
|
188
208
|
revLinks?: RevLink[];
|
|
189
209
|
};
|
|
210
|
+
/**
|
|
211
|
+
* @x-internal true
|
|
212
|
+
*/
|
|
213
|
+
declare type TableEdit = {
|
|
214
|
+
oldName?: string;
|
|
215
|
+
newName?: string;
|
|
216
|
+
columns?: MigrationColumnOp[];
|
|
217
|
+
};
|
|
190
218
|
/**
|
|
191
219
|
* @x-go-type xata.Column
|
|
192
220
|
*/
|
|
@@ -196,6 +224,7 @@ declare type Column = {
|
|
|
196
224
|
link?: {
|
|
197
225
|
table: string;
|
|
198
226
|
};
|
|
227
|
+
notNull?: boolean;
|
|
199
228
|
columns?: Column[];
|
|
200
229
|
};
|
|
201
230
|
declare type RevLink = {
|
|
@@ -262,6 +291,110 @@ declare type ColumnMigration = {
|
|
|
262
291
|
old: Column;
|
|
263
292
|
['new']: Column;
|
|
264
293
|
};
|
|
294
|
+
/**
|
|
295
|
+
* @x-internal true
|
|
296
|
+
*/
|
|
297
|
+
declare type Commit = {
|
|
298
|
+
meta?: {
|
|
299
|
+
title?: string;
|
|
300
|
+
message?: string;
|
|
301
|
+
id: string;
|
|
302
|
+
parentID?: string;
|
|
303
|
+
mergeParentID?: string;
|
|
304
|
+
status: string;
|
|
305
|
+
createdAt: DateTime;
|
|
306
|
+
modifiedAt?: DateTime;
|
|
307
|
+
};
|
|
308
|
+
operations: MigrationOp[];
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* Branch schema migration.
|
|
312
|
+
*
|
|
313
|
+
* @x-internal true
|
|
314
|
+
*/
|
|
315
|
+
declare type Migration = {
|
|
316
|
+
parentID?: string;
|
|
317
|
+
operations: MigrationOp[];
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Branch schema migration operations.
|
|
321
|
+
*
|
|
322
|
+
* @x-internal true
|
|
323
|
+
*/
|
|
324
|
+
declare type MigrationOp = MigrationTableOp | MigrationColumnOp;
|
|
325
|
+
/**
|
|
326
|
+
* @x-internal true
|
|
327
|
+
*/
|
|
328
|
+
declare type MigrationTableOp = {
|
|
329
|
+
addTable: TableOpAdd;
|
|
330
|
+
} | {
|
|
331
|
+
removeTable: TableOpRemove;
|
|
332
|
+
} | {
|
|
333
|
+
renameTable: TableOpRename;
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* @x-internal true
|
|
337
|
+
*/
|
|
338
|
+
declare type MigrationColumnOp = {
|
|
339
|
+
addColumn: ColumnOpAdd;
|
|
340
|
+
} | {
|
|
341
|
+
removeColumn: ColumnOpRemove;
|
|
342
|
+
} | {
|
|
343
|
+
renameColumn: ColumnOpRename;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* @x-internal true
|
|
347
|
+
*/
|
|
348
|
+
declare type TableOpAdd = {
|
|
349
|
+
table: string;
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* @x-internal true
|
|
353
|
+
*/
|
|
354
|
+
declare type TableOpRemove = {
|
|
355
|
+
table: string;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* @x-internal true
|
|
359
|
+
*/
|
|
360
|
+
declare type TableOpRename = {
|
|
361
|
+
oldName: string;
|
|
362
|
+
newName: string;
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* @x-internal true
|
|
366
|
+
*/
|
|
367
|
+
declare type ColumnOpAdd = {
|
|
368
|
+
table?: string;
|
|
369
|
+
column: Column;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* @x-internal true
|
|
373
|
+
*/
|
|
374
|
+
declare type ColumnOpRemove = {
|
|
375
|
+
table?: string;
|
|
376
|
+
column: string;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* @x-internal true
|
|
380
|
+
*/
|
|
381
|
+
declare type ColumnOpRename = {
|
|
382
|
+
table?: string;
|
|
383
|
+
oldName: string;
|
|
384
|
+
newName: string;
|
|
385
|
+
};
|
|
386
|
+
declare type MigrationRequest = {
|
|
387
|
+
number: number;
|
|
388
|
+
createdAt: DateTime;
|
|
389
|
+
modifiedAt?: DateTime;
|
|
390
|
+
closedAt?: DateTime;
|
|
391
|
+
mergedAt?: DateTime;
|
|
392
|
+
status: 'open' | 'closed' | 'merging' | 'merged';
|
|
393
|
+
title: string;
|
|
394
|
+
body: string;
|
|
395
|
+
source: string;
|
|
396
|
+
target: string;
|
|
397
|
+
};
|
|
265
398
|
declare type SortExpression = string[] | {
|
|
266
399
|
[key: string]: SortOrder;
|
|
267
400
|
} | {
|
|
@@ -270,7 +403,7 @@ declare type SortExpression = string[] | {
|
|
|
270
403
|
declare type SortOrder = 'asc' | 'desc';
|
|
271
404
|
/**
|
|
272
405
|
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
|
273
|
-
* distance is the number of one
|
|
406
|
+
* distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
|
|
274
407
|
* character typos per word are tollerated by search. You can set it to 0 to remove the typo tollerance or set it to 2
|
|
275
408
|
* to allow two typos in a word.
|
|
276
409
|
*
|
|
@@ -279,6 +412,10 @@ declare type SortOrder = 'asc' | 'desc';
|
|
|
279
412
|
* @minimum 0
|
|
280
413
|
*/
|
|
281
414
|
declare type FuzzinessExpression = number;
|
|
415
|
+
/**
|
|
416
|
+
* If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
|
|
417
|
+
*/
|
|
418
|
+
declare type PrefixExpression = 'phrase' | 'disabled';
|
|
282
419
|
/**
|
|
283
420
|
* @minProperties 1
|
|
284
421
|
*/
|
|
@@ -292,6 +429,48 @@ declare type FilterExpression = {
|
|
|
292
429
|
} & {
|
|
293
430
|
[key: string]: FilterColumn;
|
|
294
431
|
};
|
|
432
|
+
declare type HighlightExpression = {
|
|
433
|
+
enabled?: boolean;
|
|
434
|
+
encodeHTML?: boolean;
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Booster Expression
|
|
438
|
+
*
|
|
439
|
+
* @x-go-type xata.BoosterExpression
|
|
440
|
+
*/
|
|
441
|
+
declare type BoosterExpression = {
|
|
442
|
+
valueBooster?: ValueBooster$1;
|
|
443
|
+
} | {
|
|
444
|
+
numericBooster?: NumericBooster$1;
|
|
445
|
+
} | {
|
|
446
|
+
dateBooster?: DateBooster$1;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* Boost records with a particular value for a column.
|
|
450
|
+
*/
|
|
451
|
+
declare type ValueBooster$1 = {
|
|
452
|
+
column: string;
|
|
453
|
+
value: string | number | boolean;
|
|
454
|
+
factor: number;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Boost records based on the value of a numeric column.
|
|
458
|
+
*/
|
|
459
|
+
declare type NumericBooster$1 = {
|
|
460
|
+
column: string;
|
|
461
|
+
factor: number;
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
|
|
465
|
+
* 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
|
|
466
|
+
* 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.
|
|
467
|
+
*/
|
|
468
|
+
declare type DateBooster$1 = {
|
|
469
|
+
column: string;
|
|
470
|
+
origin?: string;
|
|
471
|
+
scale: string;
|
|
472
|
+
decay: number;
|
|
473
|
+
};
|
|
295
474
|
declare type FilterList = FilterExpression | FilterExpression[];
|
|
296
475
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
|
297
476
|
/**
|
|
@@ -348,7 +527,24 @@ declare type PageConfig = {
|
|
|
348
527
|
size?: number;
|
|
349
528
|
offset?: number;
|
|
350
529
|
};
|
|
351
|
-
declare type
|
|
530
|
+
declare type ColumnsProjection = string[];
|
|
531
|
+
/**
|
|
532
|
+
* Xata Table Record Metadata
|
|
533
|
+
*/
|
|
534
|
+
declare type RecordMeta = {
|
|
535
|
+
id: RecordID;
|
|
536
|
+
xata: {
|
|
537
|
+
version: number;
|
|
538
|
+
table?: string;
|
|
539
|
+
highlight?: {
|
|
540
|
+
[key: string]: string[] | {
|
|
541
|
+
[key: string]: any;
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
score?: number;
|
|
545
|
+
warnings?: string[];
|
|
546
|
+
};
|
|
547
|
+
};
|
|
352
548
|
/**
|
|
353
549
|
* @pattern [a-zA-Z0-9_-~:]+
|
|
354
550
|
*/
|
|
@@ -370,16 +566,9 @@ declare type RecordsMetadata = {
|
|
|
370
566
|
};
|
|
371
567
|
};
|
|
372
568
|
/**
|
|
373
|
-
* Xata Table Record
|
|
569
|
+
* Xata Table Record Metadata
|
|
374
570
|
*/
|
|
375
|
-
declare type XataRecord$1 = {
|
|
376
|
-
id: RecordID;
|
|
377
|
-
xata: {
|
|
378
|
-
version: number;
|
|
379
|
-
table?: string;
|
|
380
|
-
warnings?: string[];
|
|
381
|
-
};
|
|
382
|
-
} & {
|
|
571
|
+
declare type XataRecord$1 = RecordMeta & {
|
|
383
572
|
[key: string]: any;
|
|
384
573
|
};
|
|
385
574
|
|
|
@@ -397,6 +586,7 @@ type schemas_InviteID = InviteID;
|
|
|
397
586
|
type schemas_WorkspaceInvite = WorkspaceInvite;
|
|
398
587
|
type schemas_WorkspaceMembers = WorkspaceMembers;
|
|
399
588
|
type schemas_InviteKey = InviteKey;
|
|
589
|
+
type schemas_DatabaseMetadata = DatabaseMetadata;
|
|
400
590
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
|
401
591
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
|
402
592
|
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
|
@@ -405,7 +595,9 @@ type schemas_BranchMetadata = BranchMetadata;
|
|
|
405
595
|
type schemas_DBBranch = DBBranch;
|
|
406
596
|
type schemas_StartedFromMetadata = StartedFromMetadata;
|
|
407
597
|
type schemas_Schema = Schema;
|
|
598
|
+
type schemas_SchemaEditScript = SchemaEditScript;
|
|
408
599
|
type schemas_Table = Table;
|
|
600
|
+
type schemas_TableEdit = TableEdit;
|
|
409
601
|
type schemas_Column = Column;
|
|
410
602
|
type schemas_RevLink = RevLink;
|
|
411
603
|
type schemas_BranchName = BranchName;
|
|
@@ -418,10 +610,25 @@ type schemas_MetricsLatency = MetricsLatency;
|
|
|
418
610
|
type schemas_BranchMigration = BranchMigration;
|
|
419
611
|
type schemas_TableMigration = TableMigration;
|
|
420
612
|
type schemas_ColumnMigration = ColumnMigration;
|
|
613
|
+
type schemas_Commit = Commit;
|
|
614
|
+
type schemas_Migration = Migration;
|
|
615
|
+
type schemas_MigrationOp = MigrationOp;
|
|
616
|
+
type schemas_MigrationTableOp = MigrationTableOp;
|
|
617
|
+
type schemas_MigrationColumnOp = MigrationColumnOp;
|
|
618
|
+
type schemas_TableOpAdd = TableOpAdd;
|
|
619
|
+
type schemas_TableOpRemove = TableOpRemove;
|
|
620
|
+
type schemas_TableOpRename = TableOpRename;
|
|
621
|
+
type schemas_ColumnOpAdd = ColumnOpAdd;
|
|
622
|
+
type schemas_ColumnOpRemove = ColumnOpRemove;
|
|
623
|
+
type schemas_ColumnOpRename = ColumnOpRename;
|
|
624
|
+
type schemas_MigrationRequest = MigrationRequest;
|
|
421
625
|
type schemas_SortExpression = SortExpression;
|
|
422
626
|
type schemas_SortOrder = SortOrder;
|
|
423
627
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
|
628
|
+
type schemas_PrefixExpression = PrefixExpression;
|
|
424
629
|
type schemas_FilterExpression = FilterExpression;
|
|
630
|
+
type schemas_HighlightExpression = HighlightExpression;
|
|
631
|
+
type schemas_BoosterExpression = BoosterExpression;
|
|
425
632
|
type schemas_FilterList = FilterList;
|
|
426
633
|
type schemas_FilterColumn = FilterColumn;
|
|
427
634
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
|
@@ -431,7 +638,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
|
431
638
|
type schemas_FilterRangeValue = FilterRangeValue;
|
|
432
639
|
type schemas_FilterValue = FilterValue;
|
|
433
640
|
type schemas_PageConfig = PageConfig;
|
|
434
|
-
type
|
|
641
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
|
642
|
+
type schemas_RecordMeta = RecordMeta;
|
|
435
643
|
type schemas_RecordID = RecordID;
|
|
436
644
|
type schemas_TableRename = TableRename;
|
|
437
645
|
type schemas_RecordsMetadata = RecordsMetadata;
|
|
@@ -451,6 +659,7 @@ declare namespace schemas {
|
|
|
451
659
|
schemas_WorkspaceInvite as WorkspaceInvite,
|
|
452
660
|
schemas_WorkspaceMembers as WorkspaceMembers,
|
|
453
661
|
schemas_InviteKey as InviteKey,
|
|
662
|
+
schemas_DatabaseMetadata as DatabaseMetadata,
|
|
454
663
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
|
455
664
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
|
456
665
|
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
|
@@ -459,7 +668,9 @@ declare namespace schemas {
|
|
|
459
668
|
schemas_DBBranch as DBBranch,
|
|
460
669
|
schemas_StartedFromMetadata as StartedFromMetadata,
|
|
461
670
|
schemas_Schema as Schema,
|
|
671
|
+
schemas_SchemaEditScript as SchemaEditScript,
|
|
462
672
|
schemas_Table as Table,
|
|
673
|
+
schemas_TableEdit as TableEdit,
|
|
463
674
|
schemas_Column as Column,
|
|
464
675
|
schemas_RevLink as RevLink,
|
|
465
676
|
schemas_BranchName as BranchName,
|
|
@@ -472,10 +683,28 @@ declare namespace schemas {
|
|
|
472
683
|
schemas_BranchMigration as BranchMigration,
|
|
473
684
|
schemas_TableMigration as TableMigration,
|
|
474
685
|
schemas_ColumnMigration as ColumnMigration,
|
|
686
|
+
schemas_Commit as Commit,
|
|
687
|
+
schemas_Migration as Migration,
|
|
688
|
+
schemas_MigrationOp as MigrationOp,
|
|
689
|
+
schemas_MigrationTableOp as MigrationTableOp,
|
|
690
|
+
schemas_MigrationColumnOp as MigrationColumnOp,
|
|
691
|
+
schemas_TableOpAdd as TableOpAdd,
|
|
692
|
+
schemas_TableOpRemove as TableOpRemove,
|
|
693
|
+
schemas_TableOpRename as TableOpRename,
|
|
694
|
+
schemas_ColumnOpAdd as ColumnOpAdd,
|
|
695
|
+
schemas_ColumnOpRemove as ColumnOpRemove,
|
|
696
|
+
schemas_ColumnOpRename as ColumnOpRename,
|
|
697
|
+
schemas_MigrationRequest as MigrationRequest,
|
|
475
698
|
schemas_SortExpression as SortExpression,
|
|
476
699
|
schemas_SortOrder as SortOrder,
|
|
477
700
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
|
701
|
+
schemas_PrefixExpression as PrefixExpression,
|
|
478
702
|
schemas_FilterExpression as FilterExpression,
|
|
703
|
+
schemas_HighlightExpression as HighlightExpression,
|
|
704
|
+
schemas_BoosterExpression as BoosterExpression,
|
|
705
|
+
ValueBooster$1 as ValueBooster,
|
|
706
|
+
NumericBooster$1 as NumericBooster,
|
|
707
|
+
DateBooster$1 as DateBooster,
|
|
479
708
|
schemas_FilterList as FilterList,
|
|
480
709
|
schemas_FilterColumn as FilterColumn,
|
|
481
710
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
|
@@ -485,7 +714,8 @@ declare namespace schemas {
|
|
|
485
714
|
schemas_FilterRangeValue as FilterRangeValue,
|
|
486
715
|
schemas_FilterValue as FilterValue,
|
|
487
716
|
schemas_PageConfig as PageConfig,
|
|
488
|
-
|
|
717
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
|
718
|
+
schemas_RecordMeta as RecordMeta,
|
|
489
719
|
schemas_RecordID as RecordID,
|
|
490
720
|
schemas_TableRename as TableRename,
|
|
491
721
|
schemas_RecordsMetadata as RecordsMetadata,
|
|
@@ -520,11 +750,22 @@ declare type BulkError = {
|
|
|
520
750
|
status?: number;
|
|
521
751
|
}[];
|
|
522
752
|
};
|
|
753
|
+
declare type BulkInsertResponse = {
|
|
754
|
+
recordIDs: string[];
|
|
755
|
+
} | {
|
|
756
|
+
records: XataRecord$1[];
|
|
757
|
+
};
|
|
523
758
|
declare type BranchMigrationPlan = {
|
|
524
759
|
version: number;
|
|
525
760
|
migration: BranchMigration;
|
|
526
761
|
};
|
|
527
|
-
declare type
|
|
762
|
+
declare type RecordResponse = XataRecord$1;
|
|
763
|
+
declare type SchemaCompareResponse = {
|
|
764
|
+
source: Schema;
|
|
765
|
+
target: Schema;
|
|
766
|
+
edits: SchemaEditScript;
|
|
767
|
+
};
|
|
768
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
|
528
769
|
id: string;
|
|
529
770
|
xata: {
|
|
530
771
|
version: number;
|
|
@@ -548,7 +789,10 @@ type responses_SimpleError = SimpleError;
|
|
|
548
789
|
type responses_BadRequestError = BadRequestError;
|
|
549
790
|
type responses_AuthError = AuthError;
|
|
550
791
|
type responses_BulkError = BulkError;
|
|
792
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
|
551
793
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
|
794
|
+
type responses_RecordResponse = RecordResponse;
|
|
795
|
+
type responses_SchemaCompareResponse = SchemaCompareResponse;
|
|
552
796
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
|
553
797
|
type responses_QueryResponse = QueryResponse;
|
|
554
798
|
type responses_SearchResponse = SearchResponse;
|
|
@@ -559,7 +803,10 @@ declare namespace responses {
|
|
|
559
803
|
responses_BadRequestError as BadRequestError,
|
|
560
804
|
responses_AuthError as AuthError,
|
|
561
805
|
responses_BulkError as BulkError,
|
|
806
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
|
562
807
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
|
808
|
+
responses_RecordResponse as RecordResponse,
|
|
809
|
+
responses_SchemaCompareResponse as SchemaCompareResponse,
|
|
563
810
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
|
564
811
|
responses_QueryResponse as QueryResponse,
|
|
565
812
|
responses_SearchResponse as SearchResponse,
|
|
@@ -865,6 +1112,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
|
865
1112
|
} | {
|
|
866
1113
|
status: 404;
|
|
867
1114
|
payload: SimpleError;
|
|
1115
|
+
} | {
|
|
1116
|
+
status: 409;
|
|
1117
|
+
payload: SimpleError;
|
|
868
1118
|
}>;
|
|
869
1119
|
declare type InviteWorkspaceMemberRequestBody = {
|
|
870
1120
|
email: string;
|
|
@@ -878,6 +1128,34 @@ declare type InviteWorkspaceMemberVariables = {
|
|
|
878
1128
|
* Invite some user to join the workspace with the given role
|
|
879
1129
|
*/
|
|
880
1130
|
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
|
1131
|
+
declare type UpdateWorkspaceMemberInvitePathParams = {
|
|
1132
|
+
workspaceId: WorkspaceID;
|
|
1133
|
+
inviteId: InviteID;
|
|
1134
|
+
};
|
|
1135
|
+
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
|
1136
|
+
status: 400;
|
|
1137
|
+
payload: BadRequestError;
|
|
1138
|
+
} | {
|
|
1139
|
+
status: 401;
|
|
1140
|
+
payload: AuthError;
|
|
1141
|
+
} | {
|
|
1142
|
+
status: 404;
|
|
1143
|
+
payload: SimpleError;
|
|
1144
|
+
} | {
|
|
1145
|
+
status: 422;
|
|
1146
|
+
payload: SimpleError;
|
|
1147
|
+
}>;
|
|
1148
|
+
declare type UpdateWorkspaceMemberInviteRequestBody = {
|
|
1149
|
+
role: Role;
|
|
1150
|
+
};
|
|
1151
|
+
declare type UpdateWorkspaceMemberInviteVariables = {
|
|
1152
|
+
body: UpdateWorkspaceMemberInviteRequestBody;
|
|
1153
|
+
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
|
1154
|
+
} & FetcherExtraProps;
|
|
1155
|
+
/**
|
|
1156
|
+
* 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.
|
|
1157
|
+
*/
|
|
1158
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
|
881
1159
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
|
882
1160
|
workspaceId: WorkspaceID;
|
|
883
1161
|
inviteId: InviteID;
|
|
@@ -1031,6 +1309,54 @@ declare type DeleteDatabaseVariables = {
|
|
|
1031
1309
|
* Delete a database and all of its branches and tables permanently.
|
|
1032
1310
|
*/
|
|
1033
1311
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
1312
|
+
declare type GetDatabaseMetadataPathParams = {
|
|
1313
|
+
dbName: DBName;
|
|
1314
|
+
workspace: string;
|
|
1315
|
+
};
|
|
1316
|
+
declare type GetDatabaseMetadataError = ErrorWrapper<{
|
|
1317
|
+
status: 400;
|
|
1318
|
+
payload: BadRequestError;
|
|
1319
|
+
} | {
|
|
1320
|
+
status: 401;
|
|
1321
|
+
payload: AuthError;
|
|
1322
|
+
} | {
|
|
1323
|
+
status: 404;
|
|
1324
|
+
payload: SimpleError;
|
|
1325
|
+
}>;
|
|
1326
|
+
declare type GetDatabaseMetadataVariables = {
|
|
1327
|
+
pathParams: GetDatabaseMetadataPathParams;
|
|
1328
|
+
} & FetcherExtraProps;
|
|
1329
|
+
/**
|
|
1330
|
+
* Retrieve metadata of the given database
|
|
1331
|
+
*/
|
|
1332
|
+
declare const getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
|
1333
|
+
declare type PatchDatabaseMetadataPathParams = {
|
|
1334
|
+
dbName: DBName;
|
|
1335
|
+
workspace: string;
|
|
1336
|
+
};
|
|
1337
|
+
declare type PatchDatabaseMetadataError = ErrorWrapper<{
|
|
1338
|
+
status: 400;
|
|
1339
|
+
payload: BadRequestError;
|
|
1340
|
+
} | {
|
|
1341
|
+
status: 401;
|
|
1342
|
+
payload: AuthError;
|
|
1343
|
+
} | {
|
|
1344
|
+
status: 404;
|
|
1345
|
+
payload: SimpleError;
|
|
1346
|
+
}>;
|
|
1347
|
+
declare type PatchDatabaseMetadataRequestBody = {
|
|
1348
|
+
ui?: {
|
|
1349
|
+
color?: string;
|
|
1350
|
+
};
|
|
1351
|
+
};
|
|
1352
|
+
declare type PatchDatabaseMetadataVariables = {
|
|
1353
|
+
body?: PatchDatabaseMetadataRequestBody;
|
|
1354
|
+
pathParams: PatchDatabaseMetadataPathParams;
|
|
1355
|
+
} & FetcherExtraProps;
|
|
1356
|
+
/**
|
|
1357
|
+
* Update the color of the selected database
|
|
1358
|
+
*/
|
|
1359
|
+
declare const patchDatabaseMetadata: (variables: PatchDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
|
1034
1360
|
declare type GetGitBranchesMappingPathParams = {
|
|
1035
1361
|
dbName: DBName;
|
|
1036
1362
|
workspace: string;
|
|
@@ -1188,11 +1514,11 @@ declare type ResolveBranchVariables = {
|
|
|
1188
1514
|
* ```
|
|
1189
1515
|
*/
|
|
1190
1516
|
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
|
1191
|
-
declare type
|
|
1192
|
-
|
|
1517
|
+
declare type ListMigrationRequestsPathParams = {
|
|
1518
|
+
dbName: DBName;
|
|
1193
1519
|
workspace: string;
|
|
1194
1520
|
};
|
|
1195
|
-
declare type
|
|
1521
|
+
declare type ListMigrationRequestsError = ErrorWrapper<{
|
|
1196
1522
|
status: 400;
|
|
1197
1523
|
payload: BadRequestError;
|
|
1198
1524
|
} | {
|
|
@@ -1202,18 +1528,26 @@ declare type GetBranchDetailsError = ErrorWrapper<{
|
|
|
1202
1528
|
status: 404;
|
|
1203
1529
|
payload: SimpleError;
|
|
1204
1530
|
}>;
|
|
1205
|
-
declare type
|
|
1206
|
-
|
|
1531
|
+
declare type ListMigrationRequestsResponse = {
|
|
1532
|
+
migrationRequests: MigrationRequest[];
|
|
1533
|
+
meta: RecordsMetadata;
|
|
1534
|
+
};
|
|
1535
|
+
declare type ListMigrationRequestsRequestBody = {
|
|
1536
|
+
filter?: FilterExpression;
|
|
1537
|
+
sort?: SortExpression;
|
|
1538
|
+
page?: PageConfig;
|
|
1539
|
+
columns?: ColumnsProjection;
|
|
1540
|
+
};
|
|
1541
|
+
declare type ListMigrationRequestsVariables = {
|
|
1542
|
+
body?: ListMigrationRequestsRequestBody;
|
|
1543
|
+
pathParams: ListMigrationRequestsPathParams;
|
|
1207
1544
|
} & FetcherExtraProps;
|
|
1208
|
-
declare const
|
|
1209
|
-
declare type
|
|
1210
|
-
|
|
1545
|
+
declare const listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
|
1546
|
+
declare type CreateMigrationRequestPathParams = {
|
|
1547
|
+
dbName: DBName;
|
|
1211
1548
|
workspace: string;
|
|
1212
1549
|
};
|
|
1213
|
-
declare type
|
|
1214
|
-
from?: string;
|
|
1215
|
-
};
|
|
1216
|
-
declare type CreateBranchError = ErrorWrapper<{
|
|
1550
|
+
declare type CreateMigrationRequestError = ErrorWrapper<{
|
|
1217
1551
|
status: 400;
|
|
1218
1552
|
payload: BadRequestError;
|
|
1219
1553
|
} | {
|
|
@@ -1223,21 +1557,26 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
|
1223
1557
|
status: 404;
|
|
1224
1558
|
payload: SimpleError;
|
|
1225
1559
|
}>;
|
|
1226
|
-
declare type
|
|
1227
|
-
|
|
1228
|
-
metadata?: BranchMetadata;
|
|
1560
|
+
declare type CreateMigrationRequestResponse = {
|
|
1561
|
+
number: number;
|
|
1229
1562
|
};
|
|
1230
|
-
declare type
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1563
|
+
declare type CreateMigrationRequestRequestBody = {
|
|
1564
|
+
source: string;
|
|
1565
|
+
target: string;
|
|
1566
|
+
title: string;
|
|
1567
|
+
body?: string;
|
|
1568
|
+
};
|
|
1569
|
+
declare type CreateMigrationRequestVariables = {
|
|
1570
|
+
body: CreateMigrationRequestRequestBody;
|
|
1571
|
+
pathParams: CreateMigrationRequestPathParams;
|
|
1234
1572
|
} & FetcherExtraProps;
|
|
1235
|
-
declare const
|
|
1236
|
-
declare type
|
|
1237
|
-
|
|
1573
|
+
declare const createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
|
1574
|
+
declare type GetMigrationRequestPathParams = {
|
|
1575
|
+
dbName: DBName;
|
|
1576
|
+
mrNumber: number;
|
|
1238
1577
|
workspace: string;
|
|
1239
1578
|
};
|
|
1240
|
-
declare type
|
|
1579
|
+
declare type GetMigrationRequestError = ErrorWrapper<{
|
|
1241
1580
|
status: 400;
|
|
1242
1581
|
payload: BadRequestError;
|
|
1243
1582
|
} | {
|
|
@@ -1247,18 +1586,16 @@ declare type DeleteBranchError = ErrorWrapper<{
|
|
|
1247
1586
|
status: 404;
|
|
1248
1587
|
payload: SimpleError;
|
|
1249
1588
|
}>;
|
|
1250
|
-
declare type
|
|
1251
|
-
pathParams:
|
|
1589
|
+
declare type GetMigrationRequestVariables = {
|
|
1590
|
+
pathParams: GetMigrationRequestPathParams;
|
|
1252
1591
|
} & FetcherExtraProps;
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
declare type UpdateBranchMetadataPathParams = {
|
|
1258
|
-
dbBranchName: DBBranchName;
|
|
1592
|
+
declare const getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
|
1593
|
+
declare type UpdateMigrationRequestPathParams = {
|
|
1594
|
+
dbName: DBName;
|
|
1595
|
+
mrNumber: number;
|
|
1259
1596
|
workspace: string;
|
|
1260
1597
|
};
|
|
1261
|
-
declare type
|
|
1598
|
+
declare type UpdateMigrationRequestError = ErrorWrapper<{
|
|
1262
1599
|
status: 400;
|
|
1263
1600
|
payload: BadRequestError;
|
|
1264
1601
|
} | {
|
|
@@ -1268,19 +1605,22 @@ declare type UpdateBranchMetadataError = ErrorWrapper<{
|
|
|
1268
1605
|
status: 404;
|
|
1269
1606
|
payload: SimpleError;
|
|
1270
1607
|
}>;
|
|
1271
|
-
declare type
|
|
1272
|
-
|
|
1273
|
-
|
|
1608
|
+
declare type UpdateMigrationRequestRequestBody = {
|
|
1609
|
+
title?: string;
|
|
1610
|
+
body?: string;
|
|
1611
|
+
status?: 'open' | 'closed';
|
|
1612
|
+
};
|
|
1613
|
+
declare type UpdateMigrationRequestVariables = {
|
|
1614
|
+
body?: UpdateMigrationRequestRequestBody;
|
|
1615
|
+
pathParams: UpdateMigrationRequestPathParams;
|
|
1274
1616
|
} & FetcherExtraProps;
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
declare type GetBranchMetadataPathParams = {
|
|
1280
|
-
dbBranchName: DBBranchName;
|
|
1617
|
+
declare const updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
|
1618
|
+
declare type ListMigrationRequestsCommitsPathParams = {
|
|
1619
|
+
dbName: DBName;
|
|
1620
|
+
mrNumber: number;
|
|
1281
1621
|
workspace: string;
|
|
1282
1622
|
};
|
|
1283
|
-
declare type
|
|
1623
|
+
declare type ListMigrationRequestsCommitsError = ErrorWrapper<{
|
|
1284
1624
|
status: 400;
|
|
1285
1625
|
payload: BadRequestError;
|
|
1286
1626
|
} | {
|
|
@@ -1290,15 +1630,31 @@ declare type GetBranchMetadataError = ErrorWrapper<{
|
|
|
1290
1630
|
status: 404;
|
|
1291
1631
|
payload: SimpleError;
|
|
1292
1632
|
}>;
|
|
1293
|
-
declare type
|
|
1294
|
-
|
|
1633
|
+
declare type ListMigrationRequestsCommitsResponse = {
|
|
1634
|
+
meta: {
|
|
1635
|
+
cursor: string;
|
|
1636
|
+
more: boolean;
|
|
1637
|
+
};
|
|
1638
|
+
logs: Commit[];
|
|
1639
|
+
};
|
|
1640
|
+
declare type ListMigrationRequestsCommitsRequestBody = {
|
|
1641
|
+
page?: {
|
|
1642
|
+
after?: string;
|
|
1643
|
+
before?: string;
|
|
1644
|
+
size?: number;
|
|
1645
|
+
};
|
|
1646
|
+
};
|
|
1647
|
+
declare type ListMigrationRequestsCommitsVariables = {
|
|
1648
|
+
body?: ListMigrationRequestsCommitsRequestBody;
|
|
1649
|
+
pathParams: ListMigrationRequestsCommitsPathParams;
|
|
1295
1650
|
} & FetcherExtraProps;
|
|
1296
|
-
declare const
|
|
1297
|
-
declare type
|
|
1298
|
-
|
|
1651
|
+
declare const listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
|
1652
|
+
declare type CompareMigrationRequestPathParams = {
|
|
1653
|
+
dbName: DBName;
|
|
1654
|
+
mrNumber: number;
|
|
1299
1655
|
workspace: string;
|
|
1300
1656
|
};
|
|
1301
|
-
declare type
|
|
1657
|
+
declare type CompareMigrationRequestError = ErrorWrapper<{
|
|
1302
1658
|
status: 400;
|
|
1303
1659
|
payload: BadRequestError;
|
|
1304
1660
|
} | {
|
|
@@ -1308,24 +1664,16 @@ declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
|
1308
1664
|
status: 404;
|
|
1309
1665
|
payload: SimpleError;
|
|
1310
1666
|
}>;
|
|
1311
|
-
declare type
|
|
1312
|
-
|
|
1313
|
-
migrations?: BranchMigration[];
|
|
1314
|
-
};
|
|
1315
|
-
declare type GetBranchMigrationHistoryRequestBody = {
|
|
1316
|
-
limit?: number;
|
|
1317
|
-
startFrom?: string;
|
|
1318
|
-
};
|
|
1319
|
-
declare type GetBranchMigrationHistoryVariables = {
|
|
1320
|
-
body?: GetBranchMigrationHistoryRequestBody;
|
|
1321
|
-
pathParams: GetBranchMigrationHistoryPathParams;
|
|
1667
|
+
declare type CompareMigrationRequestVariables = {
|
|
1668
|
+
pathParams: CompareMigrationRequestPathParams;
|
|
1322
1669
|
} & FetcherExtraProps;
|
|
1323
|
-
declare const
|
|
1324
|
-
declare type
|
|
1325
|
-
|
|
1670
|
+
declare const compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
|
1671
|
+
declare type GetMigrationRequestIsMergedPathParams = {
|
|
1672
|
+
dbName: DBName;
|
|
1673
|
+
mrNumber: number;
|
|
1326
1674
|
workspace: string;
|
|
1327
1675
|
};
|
|
1328
|
-
declare type
|
|
1676
|
+
declare type GetMigrationRequestIsMergedError = ErrorWrapper<{
|
|
1329
1677
|
status: 400;
|
|
1330
1678
|
payload: BadRequestError;
|
|
1331
1679
|
} | {
|
|
@@ -1335,7 +1683,184 @@ declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
|
|
1335
1683
|
status: 404;
|
|
1336
1684
|
payload: SimpleError;
|
|
1337
1685
|
}>;
|
|
1338
|
-
declare type
|
|
1686
|
+
declare type GetMigrationRequestIsMergedResponse = {
|
|
1687
|
+
merged?: boolean;
|
|
1688
|
+
};
|
|
1689
|
+
declare type GetMigrationRequestIsMergedVariables = {
|
|
1690
|
+
pathParams: GetMigrationRequestIsMergedPathParams;
|
|
1691
|
+
} & FetcherExtraProps;
|
|
1692
|
+
declare const getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
|
1693
|
+
declare type MergeMigrationRequestPathParams = {
|
|
1694
|
+
dbName: DBName;
|
|
1695
|
+
mrNumber: number;
|
|
1696
|
+
workspace: string;
|
|
1697
|
+
};
|
|
1698
|
+
declare type MergeMigrationRequestError = ErrorWrapper<{
|
|
1699
|
+
status: 400;
|
|
1700
|
+
payload: BadRequestError;
|
|
1701
|
+
} | {
|
|
1702
|
+
status: 401;
|
|
1703
|
+
payload: AuthError;
|
|
1704
|
+
} | {
|
|
1705
|
+
status: 404;
|
|
1706
|
+
payload: SimpleError;
|
|
1707
|
+
}>;
|
|
1708
|
+
declare type MergeMigrationRequestVariables = {
|
|
1709
|
+
pathParams: MergeMigrationRequestPathParams;
|
|
1710
|
+
} & FetcherExtraProps;
|
|
1711
|
+
declare const mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
|
1712
|
+
declare type GetBranchDetailsPathParams = {
|
|
1713
|
+
dbBranchName: DBBranchName;
|
|
1714
|
+
workspace: string;
|
|
1715
|
+
};
|
|
1716
|
+
declare type GetBranchDetailsError = ErrorWrapper<{
|
|
1717
|
+
status: 400;
|
|
1718
|
+
payload: BadRequestError;
|
|
1719
|
+
} | {
|
|
1720
|
+
status: 401;
|
|
1721
|
+
payload: AuthError;
|
|
1722
|
+
} | {
|
|
1723
|
+
status: 404;
|
|
1724
|
+
payload: SimpleError;
|
|
1725
|
+
}>;
|
|
1726
|
+
declare type GetBranchDetailsVariables = {
|
|
1727
|
+
pathParams: GetBranchDetailsPathParams;
|
|
1728
|
+
} & FetcherExtraProps;
|
|
1729
|
+
declare const getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
|
1730
|
+
declare type CreateBranchPathParams = {
|
|
1731
|
+
dbBranchName: DBBranchName;
|
|
1732
|
+
workspace: string;
|
|
1733
|
+
};
|
|
1734
|
+
declare type CreateBranchQueryParams = {
|
|
1735
|
+
from?: string;
|
|
1736
|
+
};
|
|
1737
|
+
declare type CreateBranchError = ErrorWrapper<{
|
|
1738
|
+
status: 400;
|
|
1739
|
+
payload: BadRequestError;
|
|
1740
|
+
} | {
|
|
1741
|
+
status: 401;
|
|
1742
|
+
payload: AuthError;
|
|
1743
|
+
} | {
|
|
1744
|
+
status: 404;
|
|
1745
|
+
payload: SimpleError;
|
|
1746
|
+
}>;
|
|
1747
|
+
declare type CreateBranchResponse = {
|
|
1748
|
+
databaseName: string;
|
|
1749
|
+
branchName: string;
|
|
1750
|
+
};
|
|
1751
|
+
declare type CreateBranchRequestBody = {
|
|
1752
|
+
from?: string;
|
|
1753
|
+
metadata?: BranchMetadata;
|
|
1754
|
+
};
|
|
1755
|
+
declare type CreateBranchVariables = {
|
|
1756
|
+
body?: CreateBranchRequestBody;
|
|
1757
|
+
pathParams: CreateBranchPathParams;
|
|
1758
|
+
queryParams?: CreateBranchQueryParams;
|
|
1759
|
+
} & FetcherExtraProps;
|
|
1760
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
|
1761
|
+
declare type DeleteBranchPathParams = {
|
|
1762
|
+
dbBranchName: DBBranchName;
|
|
1763
|
+
workspace: string;
|
|
1764
|
+
};
|
|
1765
|
+
declare type DeleteBranchError = ErrorWrapper<{
|
|
1766
|
+
status: 400;
|
|
1767
|
+
payload: BadRequestError;
|
|
1768
|
+
} | {
|
|
1769
|
+
status: 401;
|
|
1770
|
+
payload: AuthError;
|
|
1771
|
+
} | {
|
|
1772
|
+
status: 404;
|
|
1773
|
+
payload: SimpleError;
|
|
1774
|
+
}>;
|
|
1775
|
+
declare type DeleteBranchVariables = {
|
|
1776
|
+
pathParams: DeleteBranchPathParams;
|
|
1777
|
+
} & FetcherExtraProps;
|
|
1778
|
+
/**
|
|
1779
|
+
* Delete the branch in the database and all its resources
|
|
1780
|
+
*/
|
|
1781
|
+
declare const deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
|
1782
|
+
declare type UpdateBranchMetadataPathParams = {
|
|
1783
|
+
dbBranchName: DBBranchName;
|
|
1784
|
+
workspace: string;
|
|
1785
|
+
};
|
|
1786
|
+
declare type UpdateBranchMetadataError = ErrorWrapper<{
|
|
1787
|
+
status: 400;
|
|
1788
|
+
payload: BadRequestError;
|
|
1789
|
+
} | {
|
|
1790
|
+
status: 401;
|
|
1791
|
+
payload: AuthError;
|
|
1792
|
+
} | {
|
|
1793
|
+
status: 404;
|
|
1794
|
+
payload: SimpleError;
|
|
1795
|
+
}>;
|
|
1796
|
+
declare type UpdateBranchMetadataVariables = {
|
|
1797
|
+
body?: BranchMetadata;
|
|
1798
|
+
pathParams: UpdateBranchMetadataPathParams;
|
|
1799
|
+
} & FetcherExtraProps;
|
|
1800
|
+
/**
|
|
1801
|
+
* Update the branch metadata
|
|
1802
|
+
*/
|
|
1803
|
+
declare const updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
|
1804
|
+
declare type GetBranchMetadataPathParams = {
|
|
1805
|
+
dbBranchName: DBBranchName;
|
|
1806
|
+
workspace: string;
|
|
1807
|
+
};
|
|
1808
|
+
declare type GetBranchMetadataError = ErrorWrapper<{
|
|
1809
|
+
status: 400;
|
|
1810
|
+
payload: BadRequestError;
|
|
1811
|
+
} | {
|
|
1812
|
+
status: 401;
|
|
1813
|
+
payload: AuthError;
|
|
1814
|
+
} | {
|
|
1815
|
+
status: 404;
|
|
1816
|
+
payload: SimpleError;
|
|
1817
|
+
}>;
|
|
1818
|
+
declare type GetBranchMetadataVariables = {
|
|
1819
|
+
pathParams: GetBranchMetadataPathParams;
|
|
1820
|
+
} & FetcherExtraProps;
|
|
1821
|
+
declare const getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
|
1822
|
+
declare type GetBranchMigrationHistoryPathParams = {
|
|
1823
|
+
dbBranchName: DBBranchName;
|
|
1824
|
+
workspace: string;
|
|
1825
|
+
};
|
|
1826
|
+
declare type GetBranchMigrationHistoryError = ErrorWrapper<{
|
|
1827
|
+
status: 400;
|
|
1828
|
+
payload: BadRequestError;
|
|
1829
|
+
} | {
|
|
1830
|
+
status: 401;
|
|
1831
|
+
payload: AuthError;
|
|
1832
|
+
} | {
|
|
1833
|
+
status: 404;
|
|
1834
|
+
payload: SimpleError;
|
|
1835
|
+
}>;
|
|
1836
|
+
declare type GetBranchMigrationHistoryResponse = {
|
|
1837
|
+
startedFrom?: StartedFromMetadata;
|
|
1838
|
+
migrations?: BranchMigration[];
|
|
1839
|
+
};
|
|
1840
|
+
declare type GetBranchMigrationHistoryRequestBody = {
|
|
1841
|
+
limit?: number;
|
|
1842
|
+
startFrom?: string;
|
|
1843
|
+
};
|
|
1844
|
+
declare type GetBranchMigrationHistoryVariables = {
|
|
1845
|
+
body?: GetBranchMigrationHistoryRequestBody;
|
|
1846
|
+
pathParams: GetBranchMigrationHistoryPathParams;
|
|
1847
|
+
} & FetcherExtraProps;
|
|
1848
|
+
declare const getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
|
1849
|
+
declare type ExecuteBranchMigrationPlanPathParams = {
|
|
1850
|
+
dbBranchName: DBBranchName;
|
|
1851
|
+
workspace: string;
|
|
1852
|
+
};
|
|
1853
|
+
declare type ExecuteBranchMigrationPlanError = ErrorWrapper<{
|
|
1854
|
+
status: 400;
|
|
1855
|
+
payload: BadRequestError;
|
|
1856
|
+
} | {
|
|
1857
|
+
status: 401;
|
|
1858
|
+
payload: AuthError;
|
|
1859
|
+
} | {
|
|
1860
|
+
status: 404;
|
|
1861
|
+
payload: SimpleError;
|
|
1862
|
+
}>;
|
|
1863
|
+
declare type ExecuteBranchMigrationPlanRequestBody = {
|
|
1339
1864
|
version: number;
|
|
1340
1865
|
migration: BranchMigration;
|
|
1341
1866
|
};
|
|
@@ -1369,6 +1894,157 @@ declare type GetBranchMigrationPlanVariables = {
|
|
|
1369
1894
|
* Compute a migration plan from a target schema the branch should be migrated too.
|
|
1370
1895
|
*/
|
|
1371
1896
|
declare const getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
|
1897
|
+
declare type CompareBranchWithUserSchemaPathParams = {
|
|
1898
|
+
dbBranchName: DBBranchName;
|
|
1899
|
+
workspace: string;
|
|
1900
|
+
};
|
|
1901
|
+
declare type CompareBranchWithUserSchemaError = ErrorWrapper<{
|
|
1902
|
+
status: 400;
|
|
1903
|
+
payload: BadRequestError;
|
|
1904
|
+
} | {
|
|
1905
|
+
status: 401;
|
|
1906
|
+
payload: AuthError;
|
|
1907
|
+
} | {
|
|
1908
|
+
status: 404;
|
|
1909
|
+
payload: SimpleError;
|
|
1910
|
+
}>;
|
|
1911
|
+
declare type CompareBranchWithUserSchemaRequestBody = {
|
|
1912
|
+
schema: Schema;
|
|
1913
|
+
};
|
|
1914
|
+
declare type CompareBranchWithUserSchemaVariables = {
|
|
1915
|
+
body: CompareBranchWithUserSchemaRequestBody;
|
|
1916
|
+
pathParams: CompareBranchWithUserSchemaPathParams;
|
|
1917
|
+
} & FetcherExtraProps;
|
|
1918
|
+
declare const compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
|
1919
|
+
declare type CompareBranchSchemasPathParams = {
|
|
1920
|
+
dbBranchName: DBBranchName;
|
|
1921
|
+
branchName: BranchName;
|
|
1922
|
+
workspace: string;
|
|
1923
|
+
};
|
|
1924
|
+
declare type CompareBranchSchemasError = ErrorWrapper<{
|
|
1925
|
+
status: 400;
|
|
1926
|
+
payload: BadRequestError;
|
|
1927
|
+
} | {
|
|
1928
|
+
status: 401;
|
|
1929
|
+
payload: AuthError;
|
|
1930
|
+
} | {
|
|
1931
|
+
status: 404;
|
|
1932
|
+
payload: SimpleError;
|
|
1933
|
+
}>;
|
|
1934
|
+
declare type CompareBranchSchemasVariables = {
|
|
1935
|
+
body?: Record<string, any>;
|
|
1936
|
+
pathParams: CompareBranchSchemasPathParams;
|
|
1937
|
+
} & FetcherExtraProps;
|
|
1938
|
+
declare const compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
|
1939
|
+
declare type UpdateBranchSchemaPathParams = {
|
|
1940
|
+
dbBranchName: DBBranchName;
|
|
1941
|
+
workspace: string;
|
|
1942
|
+
};
|
|
1943
|
+
declare type UpdateBranchSchemaError = ErrorWrapper<{
|
|
1944
|
+
status: 400;
|
|
1945
|
+
payload: BadRequestError;
|
|
1946
|
+
} | {
|
|
1947
|
+
status: 401;
|
|
1948
|
+
payload: AuthError;
|
|
1949
|
+
} | {
|
|
1950
|
+
status: 404;
|
|
1951
|
+
payload: SimpleError;
|
|
1952
|
+
}>;
|
|
1953
|
+
declare type UpdateBranchSchemaResponse = {
|
|
1954
|
+
id: string;
|
|
1955
|
+
parentID: string;
|
|
1956
|
+
};
|
|
1957
|
+
declare type UpdateBranchSchemaVariables = {
|
|
1958
|
+
body: Migration;
|
|
1959
|
+
pathParams: UpdateBranchSchemaPathParams;
|
|
1960
|
+
} & FetcherExtraProps;
|
|
1961
|
+
declare const updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
|
1962
|
+
declare type PreviewBranchSchemaEditPathParams = {
|
|
1963
|
+
dbBranchName: DBBranchName;
|
|
1964
|
+
workspace: string;
|
|
1965
|
+
};
|
|
1966
|
+
declare type PreviewBranchSchemaEditError = ErrorWrapper<{
|
|
1967
|
+
status: 400;
|
|
1968
|
+
payload: BadRequestError;
|
|
1969
|
+
} | {
|
|
1970
|
+
status: 401;
|
|
1971
|
+
payload: AuthError;
|
|
1972
|
+
} | {
|
|
1973
|
+
status: 404;
|
|
1974
|
+
payload: SimpleError;
|
|
1975
|
+
}>;
|
|
1976
|
+
declare type PreviewBranchSchemaEditResponse = {
|
|
1977
|
+
original: Schema;
|
|
1978
|
+
updated: Schema;
|
|
1979
|
+
};
|
|
1980
|
+
declare type PreviewBranchSchemaEditRequestBody = {
|
|
1981
|
+
edits?: SchemaEditScript;
|
|
1982
|
+
operations?: MigrationOp[];
|
|
1983
|
+
};
|
|
1984
|
+
declare type PreviewBranchSchemaEditVariables = {
|
|
1985
|
+
body?: PreviewBranchSchemaEditRequestBody;
|
|
1986
|
+
pathParams: PreviewBranchSchemaEditPathParams;
|
|
1987
|
+
} & FetcherExtraProps;
|
|
1988
|
+
declare const previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
|
1989
|
+
declare type ApplyBranchSchemaEditPathParams = {
|
|
1990
|
+
dbBranchName: DBBranchName;
|
|
1991
|
+
workspace: string;
|
|
1992
|
+
};
|
|
1993
|
+
declare type ApplyBranchSchemaEditError = ErrorWrapper<{
|
|
1994
|
+
status: 400;
|
|
1995
|
+
payload: BadRequestError;
|
|
1996
|
+
} | {
|
|
1997
|
+
status: 401;
|
|
1998
|
+
payload: AuthError;
|
|
1999
|
+
} | {
|
|
2000
|
+
status: 404;
|
|
2001
|
+
payload: SimpleError;
|
|
2002
|
+
}>;
|
|
2003
|
+
declare type ApplyBranchSchemaEditResponse = {
|
|
2004
|
+
id: string;
|
|
2005
|
+
parentID: string;
|
|
2006
|
+
};
|
|
2007
|
+
declare type ApplyBranchSchemaEditRequestBody = {
|
|
2008
|
+
edits: SchemaEditScript;
|
|
2009
|
+
};
|
|
2010
|
+
declare type ApplyBranchSchemaEditVariables = {
|
|
2011
|
+
body: ApplyBranchSchemaEditRequestBody;
|
|
2012
|
+
pathParams: ApplyBranchSchemaEditPathParams;
|
|
2013
|
+
} & FetcherExtraProps;
|
|
2014
|
+
declare const applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
|
2015
|
+
declare type GetBranchSchemaHistoryPathParams = {
|
|
2016
|
+
dbBranchName: DBBranchName;
|
|
2017
|
+
workspace: string;
|
|
2018
|
+
};
|
|
2019
|
+
declare type GetBranchSchemaHistoryError = ErrorWrapper<{
|
|
2020
|
+
status: 400;
|
|
2021
|
+
payload: BadRequestError;
|
|
2022
|
+
} | {
|
|
2023
|
+
status: 401;
|
|
2024
|
+
payload: AuthError;
|
|
2025
|
+
} | {
|
|
2026
|
+
status: 404;
|
|
2027
|
+
payload: SimpleError;
|
|
2028
|
+
}>;
|
|
2029
|
+
declare type GetBranchSchemaHistoryResponse = {
|
|
2030
|
+
meta: {
|
|
2031
|
+
cursor: string;
|
|
2032
|
+
more: boolean;
|
|
2033
|
+
};
|
|
2034
|
+
logs: Commit[];
|
|
2035
|
+
};
|
|
2036
|
+
declare type GetBranchSchemaHistoryRequestBody = {
|
|
2037
|
+
page?: {
|
|
2038
|
+
after?: string;
|
|
2039
|
+
before?: string;
|
|
2040
|
+
size?: number;
|
|
2041
|
+
};
|
|
2042
|
+
};
|
|
2043
|
+
declare type GetBranchSchemaHistoryVariables = {
|
|
2044
|
+
body?: GetBranchSchemaHistoryRequestBody;
|
|
2045
|
+
pathParams: GetBranchSchemaHistoryPathParams;
|
|
2046
|
+
} & FetcherExtraProps;
|
|
2047
|
+
declare const getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
|
1372
2048
|
declare type GetBranchStatsPathParams = {
|
|
1373
2049
|
dbBranchName: DBBranchName;
|
|
1374
2050
|
workspace: string;
|
|
@@ -1419,13 +2095,17 @@ declare type CreateTableError = ErrorWrapper<{
|
|
|
1419
2095
|
status: 422;
|
|
1420
2096
|
payload: SimpleError;
|
|
1421
2097
|
}>;
|
|
2098
|
+
declare type CreateTableResponse = {
|
|
2099
|
+
branchName: string;
|
|
2100
|
+
tableName: string;
|
|
2101
|
+
};
|
|
1422
2102
|
declare type CreateTableVariables = {
|
|
1423
2103
|
pathParams: CreateTablePathParams;
|
|
1424
2104
|
} & FetcherExtraProps;
|
|
1425
2105
|
/**
|
|
1426
2106
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
|
1427
2107
|
*/
|
|
1428
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
|
2108
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
|
1429
2109
|
declare type DeleteTablePathParams = {
|
|
1430
2110
|
dbBranchName: DBBranchName;
|
|
1431
2111
|
tableName: TableName;
|
|
@@ -1658,6 +2338,9 @@ declare type InsertRecordPathParams = {
|
|
|
1658
2338
|
tableName: TableName;
|
|
1659
2339
|
workspace: string;
|
|
1660
2340
|
};
|
|
2341
|
+
declare type InsertRecordQueryParams = {
|
|
2342
|
+
columns?: ColumnsProjection;
|
|
2343
|
+
};
|
|
1661
2344
|
declare type InsertRecordError = ErrorWrapper<{
|
|
1662
2345
|
status: 400;
|
|
1663
2346
|
payload: BadRequestError;
|
|
@@ -1668,20 +2351,15 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
|
1668
2351
|
status: 404;
|
|
1669
2352
|
payload: SimpleError;
|
|
1670
2353
|
}>;
|
|
1671
|
-
declare type InsertRecordResponse = {
|
|
1672
|
-
id: string;
|
|
1673
|
-
xata: {
|
|
1674
|
-
version: number;
|
|
1675
|
-
};
|
|
1676
|
-
};
|
|
1677
2354
|
declare type InsertRecordVariables = {
|
|
1678
2355
|
body?: Record<string, any>;
|
|
1679
2356
|
pathParams: InsertRecordPathParams;
|
|
2357
|
+
queryParams?: InsertRecordQueryParams;
|
|
1680
2358
|
} & FetcherExtraProps;
|
|
1681
2359
|
/**
|
|
1682
2360
|
* Insert a new Record into the Table
|
|
1683
2361
|
*/
|
|
1684
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
|
2362
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
|
1685
2363
|
declare type InsertRecordWithIDPathParams = {
|
|
1686
2364
|
dbBranchName: DBBranchName;
|
|
1687
2365
|
tableName: TableName;
|
|
@@ -1689,6 +2367,7 @@ declare type InsertRecordWithIDPathParams = {
|
|
|
1689
2367
|
workspace: string;
|
|
1690
2368
|
};
|
|
1691
2369
|
declare type InsertRecordWithIDQueryParams = {
|
|
2370
|
+
columns?: ColumnsProjection;
|
|
1692
2371
|
createOnly?: boolean;
|
|
1693
2372
|
ifVersion?: number;
|
|
1694
2373
|
};
|
|
@@ -1721,6 +2400,7 @@ declare type UpdateRecordWithIDPathParams = {
|
|
|
1721
2400
|
workspace: string;
|
|
1722
2401
|
};
|
|
1723
2402
|
declare type UpdateRecordWithIDQueryParams = {
|
|
2403
|
+
columns?: ColumnsProjection;
|
|
1724
2404
|
ifVersion?: number;
|
|
1725
2405
|
};
|
|
1726
2406
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
|
@@ -1749,6 +2429,7 @@ declare type UpsertRecordWithIDPathParams = {
|
|
|
1749
2429
|
workspace: string;
|
|
1750
2430
|
};
|
|
1751
2431
|
declare type UpsertRecordWithIDQueryParams = {
|
|
2432
|
+
columns?: ColumnsProjection;
|
|
1752
2433
|
ifVersion?: number;
|
|
1753
2434
|
};
|
|
1754
2435
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
|
@@ -1776,6 +2457,9 @@ declare type DeleteRecordPathParams = {
|
|
|
1776
2457
|
recordId: RecordID;
|
|
1777
2458
|
workspace: string;
|
|
1778
2459
|
};
|
|
2460
|
+
declare type DeleteRecordQueryParams = {
|
|
2461
|
+
columns?: ColumnsProjection;
|
|
2462
|
+
};
|
|
1779
2463
|
declare type DeleteRecordError = ErrorWrapper<{
|
|
1780
2464
|
status: 400;
|
|
1781
2465
|
payload: BadRequestError;
|
|
@@ -1788,14 +2472,18 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
|
1788
2472
|
}>;
|
|
1789
2473
|
declare type DeleteRecordVariables = {
|
|
1790
2474
|
pathParams: DeleteRecordPathParams;
|
|
2475
|
+
queryParams?: DeleteRecordQueryParams;
|
|
1791
2476
|
} & FetcherExtraProps;
|
|
1792
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
|
2477
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
|
1793
2478
|
declare type GetRecordPathParams = {
|
|
1794
2479
|
dbBranchName: DBBranchName;
|
|
1795
2480
|
tableName: TableName;
|
|
1796
2481
|
recordId: RecordID;
|
|
1797
2482
|
workspace: string;
|
|
1798
2483
|
};
|
|
2484
|
+
declare type GetRecordQueryParams = {
|
|
2485
|
+
columns?: ColumnsProjection;
|
|
2486
|
+
};
|
|
1799
2487
|
declare type GetRecordError = ErrorWrapper<{
|
|
1800
2488
|
status: 400;
|
|
1801
2489
|
payload: BadRequestError;
|
|
@@ -1806,12 +2494,9 @@ declare type GetRecordError = ErrorWrapper<{
|
|
|
1806
2494
|
status: 404;
|
|
1807
2495
|
payload: SimpleError;
|
|
1808
2496
|
}>;
|
|
1809
|
-
declare type GetRecordRequestBody = {
|
|
1810
|
-
columns?: ColumnsFilter;
|
|
1811
|
-
};
|
|
1812
2497
|
declare type GetRecordVariables = {
|
|
1813
|
-
body?: GetRecordRequestBody;
|
|
1814
2498
|
pathParams: GetRecordPathParams;
|
|
2499
|
+
queryParams?: GetRecordQueryParams;
|
|
1815
2500
|
} & FetcherExtraProps;
|
|
1816
2501
|
/**
|
|
1817
2502
|
* Retrieve record by ID
|
|
@@ -1822,6 +2507,9 @@ declare type BulkInsertTableRecordsPathParams = {
|
|
|
1822
2507
|
tableName: TableName;
|
|
1823
2508
|
workspace: string;
|
|
1824
2509
|
};
|
|
2510
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
|
2511
|
+
columns?: ColumnsProjection;
|
|
2512
|
+
};
|
|
1825
2513
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1826
2514
|
status: 400;
|
|
1827
2515
|
payload: BulkError;
|
|
@@ -1831,21 +2519,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
|
1831
2519
|
} | {
|
|
1832
2520
|
status: 404;
|
|
1833
2521
|
payload: SimpleError;
|
|
2522
|
+
} | {
|
|
2523
|
+
status: 422;
|
|
2524
|
+
payload: SimpleError;
|
|
1834
2525
|
}>;
|
|
1835
|
-
declare type BulkInsertTableRecordsResponse = {
|
|
1836
|
-
recordIDs: string[];
|
|
1837
|
-
};
|
|
1838
2526
|
declare type BulkInsertTableRecordsRequestBody = {
|
|
1839
2527
|
records: Record<string, any>[];
|
|
1840
2528
|
};
|
|
1841
2529
|
declare type BulkInsertTableRecordsVariables = {
|
|
1842
2530
|
body: BulkInsertTableRecordsRequestBody;
|
|
1843
2531
|
pathParams: BulkInsertTableRecordsPathParams;
|
|
2532
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
|
1844
2533
|
} & FetcherExtraProps;
|
|
1845
2534
|
/**
|
|
1846
2535
|
* Bulk insert records
|
|
1847
2536
|
*/
|
|
1848
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
|
2537
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
|
1849
2538
|
declare type QueryTablePathParams = {
|
|
1850
2539
|
dbBranchName: DBBranchName;
|
|
1851
2540
|
tableName: TableName;
|
|
@@ -1865,7 +2554,7 @@ declare type QueryTableRequestBody = {
|
|
|
1865
2554
|
filter?: FilterExpression;
|
|
1866
2555
|
sort?: SortExpression;
|
|
1867
2556
|
page?: PageConfig;
|
|
1868
|
-
columns?:
|
|
2557
|
+
columns?: ColumnsProjection;
|
|
1869
2558
|
};
|
|
1870
2559
|
declare type QueryTableVariables = {
|
|
1871
2560
|
body?: QueryTableRequestBody;
|
|
@@ -2611,7 +3300,10 @@ declare type SearchTableError = ErrorWrapper<{
|
|
|
2611
3300
|
declare type SearchTableRequestBody = {
|
|
2612
3301
|
query: string;
|
|
2613
3302
|
fuzziness?: FuzzinessExpression;
|
|
3303
|
+
prefix?: PrefixExpression;
|
|
2614
3304
|
filter?: FilterExpression;
|
|
3305
|
+
highlight?: HighlightExpression;
|
|
3306
|
+
boosters?: BoosterExpression[];
|
|
2615
3307
|
};
|
|
2616
3308
|
declare type SearchTableVariables = {
|
|
2617
3309
|
body: SearchTableRequestBody;
|
|
@@ -2640,9 +3332,15 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
|
2640
3332
|
payload: SimpleError;
|
|
2641
3333
|
}>;
|
|
2642
3334
|
declare type SearchBranchRequestBody = {
|
|
2643
|
-
tables?: string
|
|
3335
|
+
tables?: (string | {
|
|
3336
|
+
table: string;
|
|
3337
|
+
filter?: FilterExpression;
|
|
3338
|
+
boosters?: BoosterExpression[];
|
|
3339
|
+
})[];
|
|
2644
3340
|
query: string;
|
|
2645
3341
|
fuzziness?: FuzzinessExpression;
|
|
3342
|
+
prefix?: PrefixExpression;
|
|
3343
|
+
highlight?: HighlightExpression;
|
|
2646
3344
|
};
|
|
2647
3345
|
declare type SearchBranchVariables = {
|
|
2648
3346
|
body: SearchBranchRequestBody;
|
|
@@ -2671,6 +3369,7 @@ declare const operationsByTag: {
|
|
|
2671
3369
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
|
2672
3370
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
|
2673
3371
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
|
3372
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
|
2674
3373
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
|
2675
3374
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
|
2676
3375
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
|
@@ -2679,6 +3378,8 @@ declare const operationsByTag: {
|
|
|
2679
3378
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
|
2680
3379
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
|
2681
3380
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
|
3381
|
+
getDatabaseMetadata: (variables: GetDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
|
3382
|
+
patchDatabaseMetadata: (variables: PatchDatabaseMetadataVariables) => Promise<DatabaseMetadata>;
|
|
2682
3383
|
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
|
2683
3384
|
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
|
2684
3385
|
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
|
@@ -2687,17 +3388,35 @@ declare const operationsByTag: {
|
|
|
2687
3388
|
branch: {
|
|
2688
3389
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
|
2689
3390
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
|
2690
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
|
3391
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
|
2691
3392
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
|
2692
3393
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
|
2693
3394
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
|
3395
|
+
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
|
3396
|
+
};
|
|
3397
|
+
migrationRequests: {
|
|
3398
|
+
listMigrationRequests: (variables: ListMigrationRequestsVariables) => Promise<ListMigrationRequestsResponse>;
|
|
3399
|
+
createMigrationRequest: (variables: CreateMigrationRequestVariables) => Promise<CreateMigrationRequestResponse>;
|
|
3400
|
+
getMigrationRequest: (variables: GetMigrationRequestVariables) => Promise<MigrationRequest>;
|
|
3401
|
+
updateMigrationRequest: (variables: UpdateMigrationRequestVariables) => Promise<undefined>;
|
|
3402
|
+
listMigrationRequestsCommits: (variables: ListMigrationRequestsCommitsVariables) => Promise<ListMigrationRequestsCommitsResponse>;
|
|
3403
|
+
compareMigrationRequest: (variables: CompareMigrationRequestVariables) => Promise<SchemaCompareResponse>;
|
|
3404
|
+
getMigrationRequestIsMerged: (variables: GetMigrationRequestIsMergedVariables) => Promise<GetMigrationRequestIsMergedResponse>;
|
|
3405
|
+
mergeMigrationRequest: (variables: MergeMigrationRequestVariables) => Promise<Commit>;
|
|
3406
|
+
};
|
|
3407
|
+
branchSchema: {
|
|
2694
3408
|
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>;
|
|
2695
3409
|
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>;
|
|
2696
3410
|
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<BranchMigrationPlan>;
|
|
2697
|
-
|
|
3411
|
+
compareBranchWithUserSchema: (variables: CompareBranchWithUserSchemaVariables) => Promise<SchemaCompareResponse>;
|
|
3412
|
+
compareBranchSchemas: (variables: CompareBranchSchemasVariables) => Promise<SchemaCompareResponse>;
|
|
3413
|
+
updateBranchSchema: (variables: UpdateBranchSchemaVariables) => Promise<UpdateBranchSchemaResponse>;
|
|
3414
|
+
previewBranchSchemaEdit: (variables: PreviewBranchSchemaEditVariables) => Promise<PreviewBranchSchemaEditResponse>;
|
|
3415
|
+
applyBranchSchemaEdit: (variables: ApplyBranchSchemaEditVariables) => Promise<ApplyBranchSchemaEditResponse>;
|
|
3416
|
+
getBranchSchemaHistory: (variables: GetBranchSchemaHistoryVariables) => Promise<GetBranchSchemaHistoryResponse>;
|
|
2698
3417
|
};
|
|
2699
3418
|
table: {
|
|
2700
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
|
3419
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
|
2701
3420
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
|
2702
3421
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
|
2703
3422
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
|
@@ -2709,13 +3428,13 @@ declare const operationsByTag: {
|
|
|
2709
3428
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
|
2710
3429
|
};
|
|
2711
3430
|
records: {
|
|
2712
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
|
3431
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
|
2713
3432
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
2714
3433
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
2715
3434
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
|
2716
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
|
3435
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
|
2717
3436
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
|
2718
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
|
3437
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
|
2719
3438
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
|
2720
3439
|
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
|
2721
3440
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
|
@@ -2733,10 +3452,8 @@ interface XataApiClientOptions {
|
|
|
2733
3452
|
fetch?: FetchImpl;
|
|
2734
3453
|
apiKey?: string;
|
|
2735
3454
|
host?: HostProvider;
|
|
3455
|
+
trace?: TraceFunction;
|
|
2736
3456
|
}
|
|
2737
|
-
/**
|
|
2738
|
-
* @deprecated Use XataApiPlugin instead
|
|
2739
|
-
*/
|
|
2740
3457
|
declare class XataApiClient {
|
|
2741
3458
|
#private;
|
|
2742
3459
|
constructor(options?: XataApiClientOptions);
|
|
@@ -2746,6 +3463,8 @@ declare class XataApiClient {
|
|
|
2746
3463
|
get branches(): BranchApi;
|
|
2747
3464
|
get tables(): TableApi;
|
|
2748
3465
|
get records(): RecordsApi;
|
|
3466
|
+
get migrationRequests(): MigrationRequestsApi;
|
|
3467
|
+
get branchSchema(): BranchSchemaApi;
|
|
2749
3468
|
}
|
|
2750
3469
|
declare class UserApi {
|
|
2751
3470
|
private extraProps;
|
|
@@ -2769,6 +3488,7 @@ declare class WorkspaceApi {
|
|
|
2769
3488
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
|
2770
3489
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
|
2771
3490
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
|
3491
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
|
2772
3492
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
|
2773
3493
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
|
2774
3494
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
|
@@ -2779,29 +3499,28 @@ declare class DatabaseApi {
|
|
|
2779
3499
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
|
2780
3500
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
|
2781
3501
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
|
3502
|
+
getDatabaseMetadata(workspace: WorkspaceID, dbName: DBName): Promise<DatabaseMetadata>;
|
|
3503
|
+
patchDatabaseMetadata(workspace: WorkspaceID, dbName: DBName, options?: PatchDatabaseMetadataRequestBody): Promise<DatabaseMetadata>;
|
|
2782
3504
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
|
2783
3505
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
|
2784
3506
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
|
2785
|
-
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch
|
|
3507
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
|
2786
3508
|
}
|
|
2787
3509
|
declare class BranchApi {
|
|
2788
3510
|
private extraProps;
|
|
2789
3511
|
constructor(extraProps: FetcherExtraProps);
|
|
2790
3512
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
|
2791
3513
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
|
2792
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
|
3514
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
|
2793
3515
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
|
2794
3516
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
|
2795
3517
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
|
2796
|
-
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
|
2797
|
-
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
|
2798
|
-
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
|
2799
3518
|
getBranchStats(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<GetBranchStatsResponse>;
|
|
2800
3519
|
}
|
|
2801
3520
|
declare class TableApi {
|
|
2802
3521
|
private extraProps;
|
|
2803
3522
|
constructor(extraProps: FetcherExtraProps);
|
|
2804
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
|
3523
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
|
2805
3524
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
|
2806
3525
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
|
2807
3526
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
|
@@ -2815,17 +3534,42 @@ declare class TableApi {
|
|
|
2815
3534
|
declare class RecordsApi {
|
|
2816
3535
|
private extraProps;
|
|
2817
3536
|
constructor(extraProps: FetcherExtraProps);
|
|
2818
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
|
3537
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
|
2819
3538
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
|
2820
3539
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
|
2821
3540
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
|
2822
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
|
2823
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
|
2824
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
|
3541
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
|
3542
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
|
3543
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
|
2825
3544
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
|
2826
3545
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
|
2827
3546
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
|
2828
3547
|
}
|
|
3548
|
+
declare class MigrationRequestsApi {
|
|
3549
|
+
private extraProps;
|
|
3550
|
+
constructor(extraProps: FetcherExtraProps);
|
|
3551
|
+
listMigrationRequests(workspace: WorkspaceID, database: DBName, options?: ListMigrationRequestsRequestBody): Promise<ListMigrationRequestsResponse>;
|
|
3552
|
+
createMigrationRequest(workspace: WorkspaceID, database: DBName, options: CreateMigrationRequestRequestBody): Promise<CreateMigrationRequestResponse>;
|
|
3553
|
+
getMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<MigrationRequest>;
|
|
3554
|
+
updateMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number, options: UpdateMigrationRequestRequestBody): Promise<void>;
|
|
3555
|
+
listMigrationRequestsCommits(workspace: WorkspaceID, database: DBName, migrationRequest: number, options?: ListMigrationRequestsCommitsRequestBody): Promise<ListMigrationRequestsCommitsResponse>;
|
|
3556
|
+
compareMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<SchemaCompareResponse>;
|
|
3557
|
+
getMigrationRequestIsMerged(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<GetMigrationRequestIsMergedResponse>;
|
|
3558
|
+
mergeMigrationRequest(workspace: WorkspaceID, database: DBName, migrationRequest: number): Promise<Commit>;
|
|
3559
|
+
}
|
|
3560
|
+
declare class BranchSchemaApi {
|
|
3561
|
+
private extraProps;
|
|
3562
|
+
constructor(extraProps: FetcherExtraProps);
|
|
3563
|
+
getBranchMigrationHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchMigrationHistoryRequestBody): Promise<GetBranchMigrationHistoryResponse>;
|
|
3564
|
+
executeBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, migrationPlan: ExecuteBranchMigrationPlanRequestBody): Promise<void>;
|
|
3565
|
+
getBranchMigrationPlan(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<BranchMigrationPlan>;
|
|
3566
|
+
compareBranchWithUserSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
|
3567
|
+
compareBranchSchemas(workspace: WorkspaceID, database: DBName, branch: BranchName, branchName: BranchName, schema: Schema): Promise<SchemaCompareResponse>;
|
|
3568
|
+
updateBranchSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<UpdateBranchSchemaResponse>;
|
|
3569
|
+
previewBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, migration: Migration): Promise<PreviewBranchSchemaEditResponse>;
|
|
3570
|
+
applyBranchSchemaEdit(workspace: WorkspaceID, database: DBName, branch: BranchName, edits: SchemaEditScript): Promise<ApplyBranchSchemaEditResponse>;
|
|
3571
|
+
getBranchSchemaHistory(workspace: WorkspaceID, database: DBName, branch: BranchName, options?: GetBranchSchemaHistoryRequestBody): Promise<GetBranchSchemaHistoryResponse>;
|
|
3572
|
+
}
|
|
2829
3573
|
|
|
2830
3574
|
declare class XataApiPlugin implements XataPlugin {
|
|
2831
3575
|
build(options: XataPluginOptions): Promise<XataApiClient>;
|
|
@@ -2837,28 +3581,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
|
2837
3581
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
|
2838
3582
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
|
2839
3583
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
|
2840
|
-
declare type NonEmptyArray<T> = T[] & {
|
|
2841
|
-
0: T;
|
|
2842
|
-
};
|
|
2843
3584
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
|
2844
3585
|
[P in K]-?: NonNullable<T[P]>;
|
|
2845
3586
|
};
|
|
2846
3587
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
|
2847
3588
|
declare type SingleOrArray<T> = T | T[];
|
|
2848
3589
|
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
|
3590
|
+
declare type Without<T, U> = {
|
|
3591
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
|
3592
|
+
};
|
|
3593
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
|
2849
3594
|
|
|
2850
3595
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
|
2851
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
|
2852
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
|
3596
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
|
3597
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
|
2853
3598
|
}>>;
|
|
2854
|
-
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends
|
|
2855
|
-
V: ValueAtColumn<
|
|
2856
|
-
} : never
|
|
3599
|
+
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> ? {
|
|
3600
|
+
V: ValueAtColumn<Item, V>;
|
|
3601
|
+
} : never : O[K] : never> : never : never;
|
|
2857
3602
|
declare type MAX_RECURSION = 5;
|
|
2858
3603
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
|
2859
|
-
[K in DataProps<O>]:
|
|
2860
|
-
If<IsObject<
|
|
2861
|
-
K
|
|
3604
|
+
[K in DataProps<O>]: NonNullable<O[K]> extends infer Item ? If<IsArray<Item>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
|
|
3605
|
+
If<IsObject<Item>, Item extends XataRecord ? SelectableColumn<Item, [...RecursivePath, Item]> extends infer Column ? Column extends string ? K | `${K}.${Column}` : never : never : Item extends Date ? K : `${K}.${StringKeys<Item> | '*'}`, // This allows usage of objects that are not links
|
|
3606
|
+
K>> : never;
|
|
2862
3607
|
}>, never>;
|
|
2863
3608
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
|
2864
3609
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
|
@@ -2885,56 +3630,85 @@ interface BaseData {
|
|
|
2885
3630
|
/**
|
|
2886
3631
|
* Represents a persisted record from the database.
|
|
2887
3632
|
*/
|
|
2888
|
-
interface XataRecord extends Identifiable {
|
|
3633
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
|
2889
3634
|
/**
|
|
2890
|
-
*
|
|
3635
|
+
* Get metadata of this record.
|
|
2891
3636
|
*/
|
|
2892
|
-
|
|
2893
|
-
/**
|
|
2894
|
-
* Number that is increased every time the record is updated.
|
|
2895
|
-
*/
|
|
2896
|
-
version: number;
|
|
2897
|
-
};
|
|
3637
|
+
getMetadata(): XataRecordMetadata;
|
|
2898
3638
|
/**
|
|
2899
3639
|
* Retrieves a refreshed copy of the current record from the database.
|
|
3640
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
|
3641
|
+
* @returns The persisted record with the selected columns, null if not found.
|
|
2900
3642
|
*/
|
|
2901
|
-
read(): Promise<Readonly<SelectedPick<
|
|
3643
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
|
3644
|
+
/**
|
|
3645
|
+
* Retrieves a refreshed copy of the current record from the database.
|
|
3646
|
+
* @returns The persisted record with all first level properties, null if not found.
|
|
3647
|
+
*/
|
|
3648
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
|
2902
3649
|
/**
|
|
2903
3650
|
* Performs a partial update of the current record. On success a new object is
|
|
2904
3651
|
* returned and the current object is not mutated.
|
|
2905
|
-
* @param
|
|
2906
|
-
* @
|
|
3652
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
3653
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
|
3654
|
+
* @returns The persisted record with the selected columns, null if not found.
|
|
2907
3655
|
*/
|
|
2908
|
-
update(partialUpdate: Partial<EditableData<
|
|
3656
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<OriginalRecord>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
|
3657
|
+
/**
|
|
3658
|
+
* Performs a partial update of the current record. On success a new object is
|
|
3659
|
+
* returned and the current object is not mutated.
|
|
3660
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
3661
|
+
* @returns The persisted record with all first level properties, null if not found.
|
|
3662
|
+
*/
|
|
3663
|
+
update(partialUpdate: Partial<EditableData<OriginalRecord>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
|
2909
3664
|
/**
|
|
2910
3665
|
* Performs a deletion of the current record in the database.
|
|
2911
|
-
*
|
|
2912
|
-
* @
|
|
3666
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
|
3667
|
+
* @returns The deleted record, null if not found.
|
|
2913
3668
|
*/
|
|
2914
|
-
delete(): Promise<
|
|
3669
|
+
delete<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
|
3670
|
+
/**
|
|
3671
|
+
* Performs a deletion of the current record in the database.
|
|
3672
|
+
* @returns The deleted record, null if not found.
|
|
3673
|
+
|
|
3674
|
+
*/
|
|
3675
|
+
delete(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
|
2915
3676
|
}
|
|
2916
3677
|
declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update'> & {
|
|
2917
3678
|
/**
|
|
2918
3679
|
* Retrieves a refreshed copy of the current record from the database.
|
|
2919
3680
|
*/
|
|
2920
|
-
read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
3681
|
+
read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
|
|
2921
3682
|
/**
|
|
2922
3683
|
* Performs a partial update of the current record. On success a new object is
|
|
2923
3684
|
* returned and the current object is not mutated.
|
|
2924
|
-
* @param
|
|
3685
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
|
2925
3686
|
* @returns A new record containing the latest values for all the columns of the current record.
|
|
2926
3687
|
*/
|
|
2927
|
-
update(partialUpdate: Partial<EditableData<
|
|
3688
|
+
update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Record>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
|
|
3689
|
+
/**
|
|
3690
|
+
* Performs a deletion of the current record in the database.
|
|
3691
|
+
*
|
|
3692
|
+
* @throws If the record was already deleted or if an error happened while performing the deletion.
|
|
3693
|
+
*/
|
|
3694
|
+
delete(): Promise<void>;
|
|
3695
|
+
};
|
|
3696
|
+
declare type XataRecordMetadata = {
|
|
3697
|
+
/**
|
|
3698
|
+
* Number that is increased every time the record is updated.
|
|
3699
|
+
*/
|
|
3700
|
+
version: number;
|
|
3701
|
+
warnings?: string[];
|
|
2928
3702
|
};
|
|
2929
3703
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
|
2930
3704
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
|
2931
|
-
declare type EditableData<O extends
|
|
3705
|
+
declare type EditableData<O extends XataRecord> = Identifiable & Omit<{
|
|
2932
3706
|
[K in keyof O]: O[K] extends XataRecord ? {
|
|
2933
3707
|
id: string;
|
|
2934
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
|
3708
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
|
2935
3709
|
id: string;
|
|
2936
|
-
} | null | undefined : O[K];
|
|
2937
|
-
}
|
|
3710
|
+
} | string | null | undefined : O[K];
|
|
3711
|
+
}, keyof XataRecord>;
|
|
2938
3712
|
|
|
2939
3713
|
/**
|
|
2940
3714
|
* PropertyMatchFilter
|
|
@@ -3009,8 +3783,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
|
3009
3783
|
],
|
|
3010
3784
|
}
|
|
3011
3785
|
*/
|
|
3012
|
-
declare type AggregatorFilter<
|
|
3013
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
|
3786
|
+
declare type AggregatorFilter<T> = {
|
|
3787
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
|
3014
3788
|
};
|
|
3015
3789
|
/**
|
|
3016
3790
|
* Existance filter
|
|
@@ -3025,10 +3799,88 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
|
3025
3799
|
* Injects the Api filters on nested properties
|
|
3026
3800
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
|
3027
3801
|
*/
|
|
3028
|
-
declare type NestedApiFilter<T> =
|
|
3802
|
+
declare type NestedApiFilter<T> = {
|
|
3029
3803
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
|
3030
|
-
}
|
|
3031
|
-
declare type Filter<
|
|
3804
|
+
};
|
|
3805
|
+
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>;
|
|
3806
|
+
|
|
3807
|
+
declare type DateBooster = {
|
|
3808
|
+
origin?: string;
|
|
3809
|
+
scale: string;
|
|
3810
|
+
decay: number;
|
|
3811
|
+
};
|
|
3812
|
+
declare type NumericBooster = {
|
|
3813
|
+
factor: number;
|
|
3814
|
+
};
|
|
3815
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
|
3816
|
+
value: T;
|
|
3817
|
+
factor: number;
|
|
3818
|
+
};
|
|
3819
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
|
3820
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
|
3821
|
+
dateBooster: {
|
|
3822
|
+
column: K;
|
|
3823
|
+
} & DateBooster;
|
|
3824
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
|
3825
|
+
numericBooster?: {
|
|
3826
|
+
column: K;
|
|
3827
|
+
} & NumericBooster;
|
|
3828
|
+
}, {
|
|
3829
|
+
valueBooster?: {
|
|
3830
|
+
column: K;
|
|
3831
|
+
} & ValueBooster<number>;
|
|
3832
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
|
3833
|
+
valueBooster: {
|
|
3834
|
+
column: K;
|
|
3835
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
|
3836
|
+
} : never;
|
|
3837
|
+
}>;
|
|
3838
|
+
|
|
3839
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
|
3840
|
+
fuzziness?: FuzzinessExpression;
|
|
3841
|
+
prefix?: PrefixExpression;
|
|
3842
|
+
highlight?: HighlightExpression;
|
|
3843
|
+
tables?: Array<Tables | Values<{
|
|
3844
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
|
3845
|
+
table: Model;
|
|
3846
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
|
3847
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
|
3848
|
+
};
|
|
3849
|
+
}>>;
|
|
3850
|
+
};
|
|
3851
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3852
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
|
3853
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
|
3854
|
+
table: Model;
|
|
3855
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
|
3856
|
+
};
|
|
3857
|
+
}>[]>;
|
|
3858
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
|
3859
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
|
3860
|
+
}>;
|
|
3861
|
+
};
|
|
3862
|
+
declare class SearchPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
|
3863
|
+
#private;
|
|
3864
|
+
private db;
|
|
3865
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
|
3866
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
|
3867
|
+
}
|
|
3868
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
|
3869
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
|
3870
|
+
};
|
|
3871
|
+
declare type SearchExtraProperties = {
|
|
3872
|
+
table: string;
|
|
3873
|
+
highlight?: {
|
|
3874
|
+
[key: string]: string[] | {
|
|
3875
|
+
[key: string]: any;
|
|
3876
|
+
};
|
|
3877
|
+
};
|
|
3878
|
+
score?: number;
|
|
3879
|
+
};
|
|
3880
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
|
3881
|
+
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 {
|
|
3882
|
+
table: infer Table;
|
|
3883
|
+
} ? ReturnTable<Table, Tables> : never;
|
|
3032
3884
|
|
|
3033
3885
|
declare type SortDirection = 'asc' | 'desc';
|
|
3034
3886
|
declare type SortFilterExtended<T extends XataRecord> = {
|
|
@@ -3041,7 +3893,7 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
|
3041
3893
|
};
|
|
3042
3894
|
|
|
3043
3895
|
declare type BaseOptions<T extends XataRecord> = {
|
|
3044
|
-
columns?:
|
|
3896
|
+
columns?: SelectableColumn<T>[];
|
|
3045
3897
|
cache?: number;
|
|
3046
3898
|
};
|
|
3047
3899
|
declare type CursorQueryOptions = {
|
|
@@ -3064,8 +3916,11 @@ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryO
|
|
|
3064
3916
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
|
3065
3917
|
#private;
|
|
3066
3918
|
readonly meta: PaginationQueryMeta;
|
|
3067
|
-
readonly records: Result
|
|
3068
|
-
constructor(repository: Repository<Record> | null, table:
|
|
3919
|
+
readonly records: RecordArray<Result>;
|
|
3920
|
+
constructor(repository: Repository<Record> | null, table: {
|
|
3921
|
+
name: string;
|
|
3922
|
+
schema?: Table;
|
|
3923
|
+
}, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
|
3069
3924
|
getQueryOptions(): QueryOptions<Record>;
|
|
3070
3925
|
key(): string;
|
|
3071
3926
|
/**
|
|
@@ -3097,81 +3952,186 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
|
3097
3952
|
*
|
|
3098
3953
|
* ```
|
|
3099
3954
|
* query.filter("columnName", columnValue)
|
|
3100
|
-
* query.filter(
|
|
3101
|
-
*
|
|
3102
|
-
*
|
|
3955
|
+
* query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
|
|
3956
|
+
* ```
|
|
3957
|
+
*
|
|
3958
|
+
* @param column The name of the column to filter.
|
|
3959
|
+
* @param value The value to filter.
|
|
3960
|
+
* @returns A new Query object.
|
|
3961
|
+
*/
|
|
3962
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<NonNullable<ValueAtColumn<Record, F>>>): Query<Record, Result>;
|
|
3963
|
+
/**
|
|
3964
|
+
* Builds a new query object adding one or more constraints. Examples:
|
|
3965
|
+
*
|
|
3966
|
+
* ```
|
|
3967
|
+
* query.filter({ "columnName": columnValue })
|
|
3103
3968
|
* query.filter({
|
|
3104
3969
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
|
3105
3970
|
* })
|
|
3106
3971
|
* ```
|
|
3107
3972
|
*
|
|
3973
|
+
* @param filters A filter object
|
|
3108
3974
|
* @returns A new Query object.
|
|
3109
3975
|
*/
|
|
3110
|
-
filter(filters
|
|
3111
|
-
|
|
3976
|
+
filter(filters?: Filter<Record>): Query<Record, Result>;
|
|
3977
|
+
defaultFilter<T>(column: string, value: T): T | {
|
|
3978
|
+
$includes: (T & string) | (T & string[]);
|
|
3979
|
+
};
|
|
3112
3980
|
/**
|
|
3113
3981
|
* Builds a new query with a new sort option.
|
|
3114
3982
|
* @param column The column name.
|
|
3115
3983
|
* @param direction The direction. Either ascending or descending.
|
|
3116
3984
|
* @returns A new Query object.
|
|
3117
3985
|
*/
|
|
3118
|
-
sort<F extends SelectableColumn<Record>>(column: F, direction
|
|
3986
|
+
sort<F extends SelectableColumn<Record>>(column: F, direction?: SortDirection): Query<Record, Result>;
|
|
3119
3987
|
/**
|
|
3120
3988
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
|
3121
3989
|
* @param columns Array of column names to be returned by the query.
|
|
3122
3990
|
* @returns A new Query object.
|
|
3123
3991
|
*/
|
|
3124
|
-
select<K extends SelectableColumn<Record>>(columns:
|
|
3992
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
|
3993
|
+
/**
|
|
3994
|
+
* Get paginated results
|
|
3995
|
+
*
|
|
3996
|
+
* @returns A page of results
|
|
3997
|
+
*/
|
|
3125
3998
|
getPaginated(): Promise<Page<Record, Result>>;
|
|
3999
|
+
/**
|
|
4000
|
+
* Get paginated results
|
|
4001
|
+
*
|
|
4002
|
+
* @param options Pagination options
|
|
4003
|
+
* @returns A page of results
|
|
4004
|
+
*/
|
|
3126
4005
|
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
|
4006
|
+
/**
|
|
4007
|
+
* Get paginated results
|
|
4008
|
+
*
|
|
4009
|
+
* @param options Pagination options
|
|
4010
|
+
* @returns A page of results
|
|
4011
|
+
*/
|
|
3127
4012
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
|
4013
|
+
/**
|
|
4014
|
+
* Get results in an iterator
|
|
4015
|
+
*
|
|
4016
|
+
* @async
|
|
4017
|
+
* @returns Async interable of results
|
|
4018
|
+
*/
|
|
3128
4019
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
|
4020
|
+
/**
|
|
4021
|
+
* Build an iterator of results
|
|
4022
|
+
*
|
|
4023
|
+
* @returns Async generator of results array
|
|
4024
|
+
*/
|
|
3129
4025
|
getIterator(): AsyncGenerator<Result[]>;
|
|
4026
|
+
/**
|
|
4027
|
+
* Build an iterator of results
|
|
4028
|
+
*
|
|
4029
|
+
* @param options Pagination options with batchSize
|
|
4030
|
+
* @returns Async generator of results array
|
|
4031
|
+
*/
|
|
3130
4032
|
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
3131
4033
|
batchSize?: number;
|
|
3132
4034
|
}): AsyncGenerator<Result[]>;
|
|
4035
|
+
/**
|
|
4036
|
+
* Build an iterator of results
|
|
4037
|
+
*
|
|
4038
|
+
* @param options Pagination options with batchSize
|
|
4039
|
+
* @returns Async generator of results array
|
|
4040
|
+
*/
|
|
3133
4041
|
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3134
4042
|
batchSize?: number;
|
|
3135
4043
|
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
|
4044
|
+
/**
|
|
4045
|
+
* Performs the query in the database and returns a set of results.
|
|
4046
|
+
* @returns An array of records from the database.
|
|
4047
|
+
*/
|
|
4048
|
+
getMany(): Promise<RecordArray<Result>>;
|
|
4049
|
+
/**
|
|
4050
|
+
* Performs the query in the database and returns a set of results.
|
|
4051
|
+
* @param options Additional options to be used when performing the query.
|
|
4052
|
+
* @returns An array of records from the database.
|
|
4053
|
+
*/
|
|
4054
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
|
3136
4055
|
/**
|
|
3137
4056
|
* Performs the query in the database and returns a set of results.
|
|
3138
4057
|
* @param options Additional options to be used when performing the query.
|
|
3139
4058
|
* @returns An array of records from the database.
|
|
3140
4059
|
*/
|
|
3141
|
-
getMany(): Promise<Result
|
|
3142
|
-
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
|
|
3143
|
-
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
|
4060
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
|
3144
4061
|
/**
|
|
3145
4062
|
* Performs the query in the database and returns all the results.
|
|
3146
4063
|
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3147
|
-
* @param options Additional options to be used when performing the query.
|
|
3148
4064
|
* @returns An array of records from the database.
|
|
3149
4065
|
*/
|
|
3150
4066
|
getAll(): Promise<Result[]>;
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
4067
|
+
/**
|
|
4068
|
+
* Performs the query in the database and returns all the results.
|
|
4069
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
|
4070
|
+
* @param options Additional options to be used when performing the query.
|
|
4071
|
+
* @returns An array of records from the database.
|
|
4072
|
+
*/
|
|
3154
4073
|
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
|
3155
4074
|
batchSize?: number;
|
|
3156
4075
|
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
|
3157
4076
|
/**
|
|
3158
|
-
* Performs the query in the database and returns the
|
|
4077
|
+
* Performs the query in the database and returns all the results.
|
|
4078
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
|
3159
4079
|
* @param options Additional options to be used when performing the query.
|
|
4080
|
+
* @returns An array of records from the database.
|
|
4081
|
+
*/
|
|
4082
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
|
4083
|
+
batchSize?: number;
|
|
4084
|
+
}): Promise<Result[]>;
|
|
4085
|
+
/**
|
|
4086
|
+
* Performs the query in the database and returns the first result.
|
|
3160
4087
|
* @returns The first record that matches the query, or null if no record matched the query.
|
|
3161
4088
|
*/
|
|
3162
4089
|
getFirst(): Promise<Result | null>;
|
|
3163
|
-
|
|
4090
|
+
/**
|
|
4091
|
+
* Performs the query in the database and returns the first result.
|
|
4092
|
+
* @param options Additional options to be used when performing the query.
|
|
4093
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
4094
|
+
*/
|
|
3164
4095
|
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
|
4096
|
+
/**
|
|
4097
|
+
* Performs the query in the database and returns the first result.
|
|
4098
|
+
* @param options Additional options to be used when performing the query.
|
|
4099
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
|
4100
|
+
*/
|
|
4101
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
|
3165
4102
|
/**
|
|
3166
4103
|
* Builds a new query object adding a cache TTL in milliseconds.
|
|
3167
4104
|
* @param ttl The cache TTL in milliseconds.
|
|
3168
4105
|
* @returns A new Query object.
|
|
3169
4106
|
*/
|
|
3170
4107
|
cache(ttl: number): Query<Record, Result>;
|
|
4108
|
+
/**
|
|
4109
|
+
* Retrieve next page of records
|
|
4110
|
+
*
|
|
4111
|
+
* @returns A new page object.
|
|
4112
|
+
*/
|
|
3171
4113
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
4114
|
+
/**
|
|
4115
|
+
* Retrieve previous page of records
|
|
4116
|
+
*
|
|
4117
|
+
* @returns A new page object
|
|
4118
|
+
*/
|
|
3172
4119
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
4120
|
+
/**
|
|
4121
|
+
* Retrieve first page of records
|
|
4122
|
+
*
|
|
4123
|
+
* @returns A new page object
|
|
4124
|
+
*/
|
|
3173
4125
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
4126
|
+
/**
|
|
4127
|
+
* Retrieve last page of records
|
|
4128
|
+
*
|
|
4129
|
+
* @returns A new page object
|
|
4130
|
+
*/
|
|
3174
4131
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
4132
|
+
/**
|
|
4133
|
+
* @returns Boolean indicating if there is a next page
|
|
4134
|
+
*/
|
|
3175
4135
|
hasNextPage(): boolean;
|
|
3176
4136
|
}
|
|
3177
4137
|
|
|
@@ -3183,7 +4143,7 @@ declare type PaginationQueryMeta = {
|
|
|
3183
4143
|
};
|
|
3184
4144
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
|
3185
4145
|
meta: PaginationQueryMeta;
|
|
3186
|
-
records: Result
|
|
4146
|
+
records: RecordArray<Result>;
|
|
3187
4147
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3188
4148
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
3189
4149
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
|
@@ -3203,7 +4163,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
|
3203
4163
|
/**
|
|
3204
4164
|
* The set of results for this page.
|
|
3205
4165
|
*/
|
|
3206
|
-
readonly records: Result
|
|
4166
|
+
readonly records: RecordArray<Result>;
|
|
3207
4167
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
|
3208
4168
|
/**
|
|
3209
4169
|
* Retrieves the next page of results.
|
|
@@ -3252,60 +4212,197 @@ declare type OffsetNavigationOptions = {
|
|
|
3252
4212
|
offset?: number;
|
|
3253
4213
|
};
|
|
3254
4214
|
declare const PAGINATION_MAX_SIZE = 200;
|
|
3255
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
|
4215
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
|
3256
4216
|
declare const PAGINATION_MAX_OFFSET = 800;
|
|
3257
4217
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
|
4218
|
+
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
|
4219
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
|
4220
|
+
#private;
|
|
4221
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
|
4222
|
+
static parseConstructorParams(...args: any[]): any[];
|
|
4223
|
+
toArray(): Result[];
|
|
4224
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
|
4225
|
+
/**
|
|
4226
|
+
* Retrieve next page of records
|
|
4227
|
+
*
|
|
4228
|
+
* @returns A new array of objects
|
|
4229
|
+
*/
|
|
4230
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
4231
|
+
/**
|
|
4232
|
+
* Retrieve previous page of records
|
|
4233
|
+
*
|
|
4234
|
+
* @returns A new array of objects
|
|
4235
|
+
*/
|
|
4236
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
4237
|
+
/**
|
|
4238
|
+
* Retrieve first page of records
|
|
4239
|
+
*
|
|
4240
|
+
* @returns A new array of objects
|
|
4241
|
+
*/
|
|
4242
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
4243
|
+
/**
|
|
4244
|
+
* Retrieve last page of records
|
|
4245
|
+
*
|
|
4246
|
+
* @returns A new array of objects
|
|
4247
|
+
*/
|
|
4248
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
|
4249
|
+
/**
|
|
4250
|
+
* @returns Boolean indicating if there is a next page
|
|
4251
|
+
*/
|
|
4252
|
+
hasNextPage(): boolean;
|
|
4253
|
+
}
|
|
3258
4254
|
|
|
3259
4255
|
/**
|
|
3260
4256
|
* Common interface for performing operations on a table.
|
|
3261
4257
|
*/
|
|
3262
|
-
declare abstract class Repository<
|
|
3263
|
-
abstract create(object: EditableData<
|
|
4258
|
+
declare abstract class Repository<Record extends XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
|
4259
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
4260
|
+
abstract create(object: Omit<EditableData<Record>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
4261
|
+
/**
|
|
4262
|
+
* Creates a single record in the table with a unique id.
|
|
4263
|
+
* @param id The unique id.
|
|
4264
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
|
4265
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4266
|
+
* @returns The full persisted record.
|
|
4267
|
+
*/
|
|
4268
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3264
4269
|
/**
|
|
3265
4270
|
* Creates a single record in the table with a unique id.
|
|
3266
4271
|
* @param id The unique id.
|
|
3267
4272
|
* @param object Object containing the column names with their values to be stored in the table.
|
|
3268
4273
|
* @returns The full persisted record.
|
|
3269
4274
|
*/
|
|
3270
|
-
abstract create(id: string, object: EditableData<
|
|
4275
|
+
abstract create(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
3271
4276
|
/**
|
|
3272
4277
|
* Creates multiple records in the table.
|
|
3273
4278
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
3274
|
-
* @
|
|
4279
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4280
|
+
* @returns Array of the persisted records in order.
|
|
4281
|
+
*/
|
|
4282
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
4283
|
+
/**
|
|
4284
|
+
* Creates multiple records in the table.
|
|
4285
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
4286
|
+
* @returns Array of the persisted records in order.
|
|
3275
4287
|
*/
|
|
3276
|
-
abstract create(objects: Array<EditableData<
|
|
4288
|
+
abstract create(objects: Array<Omit<EditableData<Record>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
4289
|
+
/**
|
|
4290
|
+
* Queries a single record from the table given its unique id.
|
|
4291
|
+
* @param id The unique id.
|
|
4292
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4293
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
4294
|
+
*/
|
|
4295
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
3277
4296
|
/**
|
|
3278
4297
|
* Queries a single record from the table given its unique id.
|
|
3279
4298
|
* @param id The unique id.
|
|
3280
4299
|
* @returns The persisted record for the given id or null if the record could not be found.
|
|
3281
4300
|
*/
|
|
3282
4301
|
abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
4302
|
+
/**
|
|
4303
|
+
* Queries multiple records from the table given their unique id.
|
|
4304
|
+
* @param ids The unique ids array.
|
|
4305
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4306
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
4307
|
+
*/
|
|
4308
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4309
|
+
/**
|
|
4310
|
+
* Queries multiple records from the table given their unique id.
|
|
4311
|
+
* @param ids The unique ids array.
|
|
4312
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
4313
|
+
*/
|
|
4314
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
4315
|
+
/**
|
|
4316
|
+
* Queries a single record from the table by the id in the object.
|
|
4317
|
+
* @param object Object containing the id of the record.
|
|
4318
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4319
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
4320
|
+
*/
|
|
4321
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
4322
|
+
/**
|
|
4323
|
+
* Queries a single record from the table by the id in the object.
|
|
4324
|
+
* @param object Object containing the id of the record.
|
|
4325
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
|
4326
|
+
*/
|
|
4327
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
4328
|
+
/**
|
|
4329
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
4330
|
+
* @param objects Array of objects containing the ids of the records.
|
|
4331
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4332
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
4333
|
+
*/
|
|
4334
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4335
|
+
/**
|
|
4336
|
+
* Queries multiple records from the table by the ids in the objects.
|
|
4337
|
+
* @param objects Array of objects containing the ids of the records.
|
|
4338
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
|
4339
|
+
*/
|
|
4340
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
3283
4341
|
/**
|
|
3284
4342
|
* Partially update a single record.
|
|
3285
4343
|
* @param object An object with its id and the columns to be updated.
|
|
3286
|
-
* @
|
|
4344
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4345
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
4346
|
+
*/
|
|
4347
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4348
|
+
/**
|
|
4349
|
+
* Partially update a single record.
|
|
4350
|
+
* @param object An object with its id and the columns to be updated.
|
|
4351
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
3287
4352
|
*/
|
|
3288
|
-
abstract update(object: Partial<EditableData<
|
|
4353
|
+
abstract update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
3289
4354
|
/**
|
|
3290
4355
|
* Partially update a single record given its unique id.
|
|
3291
4356
|
* @param id The unique id.
|
|
3292
4357
|
* @param object The column names and their values that have to be updated.
|
|
3293
|
-
* @
|
|
4358
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4359
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
4360
|
+
*/
|
|
4361
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4362
|
+
/**
|
|
4363
|
+
* Partially update a single record given its unique id.
|
|
4364
|
+
* @param id The unique id.
|
|
4365
|
+
* @param object The column names and their values that have to be updated.
|
|
4366
|
+
* @returns The full persisted record, null if the record could not be found.
|
|
3294
4367
|
*/
|
|
3295
|
-
abstract update(id: string, object: Partial<EditableData<
|
|
4368
|
+
abstract update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
3296
4369
|
/**
|
|
3297
4370
|
* Partially updates multiple records.
|
|
3298
4371
|
* @param objects An array of objects with their ids and columns to be updated.
|
|
3299
|
-
* @
|
|
4372
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4373
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
|
4374
|
+
*/
|
|
4375
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4376
|
+
/**
|
|
4377
|
+
* Partially updates multiple records.
|
|
4378
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
|
4379
|
+
* @returns Array of the persisted records in order (if a record could not be found null is returned).
|
|
4380
|
+
*/
|
|
4381
|
+
abstract update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
4382
|
+
/**
|
|
4383
|
+
* Creates or updates a single record. If a record exists with the given id,
|
|
4384
|
+
* it will be update, otherwise a new record will be created.
|
|
4385
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
|
4386
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4387
|
+
* @returns The full persisted record.
|
|
3300
4388
|
*/
|
|
3301
|
-
abstract
|
|
4389
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3302
4390
|
/**
|
|
3303
4391
|
* Creates or updates a single record. If a record exists with the given id,
|
|
3304
4392
|
* it will be update, otherwise a new record will be created.
|
|
3305
4393
|
* @param object Object containing the column names with their values to be persisted in the table.
|
|
3306
4394
|
* @returns The full persisted record.
|
|
3307
4395
|
*/
|
|
3308
|
-
abstract createOrUpdate(object: EditableData<
|
|
4396
|
+
abstract createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
4397
|
+
/**
|
|
4398
|
+
* Creates or updates a single record. If a record exists with the given id,
|
|
4399
|
+
* it will be update, otherwise a new record will be created.
|
|
4400
|
+
* @param id A unique id.
|
|
4401
|
+
* @param object The column names and the values to be persisted.
|
|
4402
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4403
|
+
* @returns The full persisted record.
|
|
4404
|
+
*/
|
|
4405
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
3309
4406
|
/**
|
|
3310
4407
|
* Creates or updates a single record. If a record exists with the given id,
|
|
3311
4408
|
* it will be update, otherwise a new record will be created.
|
|
@@ -3313,38 +4410,74 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3313
4410
|
* @param object The column names and the values to be persisted.
|
|
3314
4411
|
* @returns The full persisted record.
|
|
3315
4412
|
*/
|
|
3316
|
-
abstract createOrUpdate(id: string, object: EditableData<
|
|
4413
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
3317
4414
|
/**
|
|
3318
4415
|
* Creates or updates a single record. If a record exists with the given id,
|
|
3319
4416
|
* it will be update, otherwise a new record will be created.
|
|
3320
4417
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
4418
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
3321
4419
|
* @returns Array of the persisted records.
|
|
3322
4420
|
*/
|
|
3323
|
-
abstract createOrUpdate(objects: Array<EditableData<
|
|
4421
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
4422
|
+
/**
|
|
4423
|
+
* Creates or updates a single record. If a record exists with the given id,
|
|
4424
|
+
* it will be update, otherwise a new record will be created.
|
|
4425
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
|
4426
|
+
* @returns Array of the persisted records.
|
|
4427
|
+
*/
|
|
4428
|
+
abstract createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
3324
4429
|
/**
|
|
3325
4430
|
* Deletes a record given its unique id.
|
|
3326
|
-
* @param
|
|
3327
|
-
* @
|
|
4431
|
+
* @param object An object with a unique id.
|
|
4432
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4433
|
+
* @returns The deleted record, null if the record could not be found.
|
|
3328
4434
|
*/
|
|
3329
|
-
abstract delete(
|
|
4435
|
+
abstract delete<K extends SelectableColumn<Record>>(object: Identifiable & Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
3330
4436
|
/**
|
|
3331
4437
|
* Deletes a record given its unique id.
|
|
3332
|
-
* @param
|
|
3333
|
-
* @
|
|
4438
|
+
* @param object An object with a unique id.
|
|
4439
|
+
* @returns The deleted record, null if the record could not be found.
|
|
4440
|
+
*/
|
|
4441
|
+
abstract delete(object: Identifiable & Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
4442
|
+
/**
|
|
4443
|
+
* Deletes a record given a unique id.
|
|
4444
|
+
* @param id The unique id.
|
|
4445
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4446
|
+
* @returns The deleted record, null if the record could not be found.
|
|
4447
|
+
*/
|
|
4448
|
+
abstract delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4449
|
+
/**
|
|
4450
|
+
* Deletes a record given a unique id.
|
|
4451
|
+
* @param id The unique id.
|
|
4452
|
+
* @returns The deleted record, null if the record could not be found.
|
|
4453
|
+
*/
|
|
4454
|
+
abstract delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
4455
|
+
/**
|
|
4456
|
+
* Deletes multiple records given an array of objects with ids.
|
|
4457
|
+
* @param objects An array of objects with unique ids.
|
|
4458
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4459
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
4460
|
+
*/
|
|
4461
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4462
|
+
/**
|
|
4463
|
+
* Deletes multiple records given an array of objects with ids.
|
|
4464
|
+
* @param objects An array of objects with unique ids.
|
|
4465
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
3334
4466
|
*/
|
|
3335
|
-
abstract delete(
|
|
4467
|
+
abstract delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
3336
4468
|
/**
|
|
3337
|
-
* Deletes
|
|
3338
|
-
* @param
|
|
3339
|
-
* @
|
|
4469
|
+
* Deletes multiple records given an array of unique ids.
|
|
4470
|
+
* @param objects An array of ids.
|
|
4471
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
|
4472
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
3340
4473
|
*/
|
|
3341
|
-
abstract delete(
|
|
4474
|
+
abstract delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
3342
4475
|
/**
|
|
3343
|
-
* Deletes
|
|
3344
|
-
* @param
|
|
3345
|
-
* @
|
|
4476
|
+
* Deletes multiple records given an array of unique ids.
|
|
4477
|
+
* @param objects An array of ids.
|
|
4478
|
+
* @returns Array of the deleted records in order (if a record could not be found null is returned).
|
|
3346
4479
|
*/
|
|
3347
|
-
abstract delete(
|
|
4480
|
+
abstract delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
3348
4481
|
/**
|
|
3349
4482
|
* Search for records in the table.
|
|
3350
4483
|
* @param query The query to search for.
|
|
@@ -3352,37 +4485,123 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
|
3352
4485
|
* @returns The found records.
|
|
3353
4486
|
*/
|
|
3354
4487
|
abstract search(query: string, options?: {
|
|
3355
|
-
fuzziness?:
|
|
4488
|
+
fuzziness?: FuzzinessExpression;
|
|
4489
|
+
prefix?: PrefixExpression;
|
|
4490
|
+
highlight?: HighlightExpression;
|
|
3356
4491
|
filter?: Filter<Record>;
|
|
3357
|
-
|
|
4492
|
+
boosters?: Boosters<Record>[];
|
|
4493
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
|
3358
4494
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3359
4495
|
}
|
|
3360
|
-
declare class RestRepository<
|
|
4496
|
+
declare class RestRepository<Record extends XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Record> {
|
|
3361
4497
|
#private;
|
|
3362
|
-
db: SchemaPluginResult<any>;
|
|
3363
4498
|
constructor(options: {
|
|
3364
4499
|
table: string;
|
|
3365
4500
|
db: SchemaPluginResult<any>;
|
|
3366
4501
|
pluginOptions: XataPluginOptions;
|
|
4502
|
+
schemaTables?: Table[];
|
|
3367
4503
|
});
|
|
3368
|
-
create(object: EditableData<
|
|
3369
|
-
create(
|
|
3370
|
-
create(
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
4504
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Record> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
4505
|
+
create(object: EditableData<Record> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
4506
|
+
create<K extends SelectableColumn<Record>>(id: string, object: EditableData<Record>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
4507
|
+
create(id: string, object: EditableData<Record>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
4508
|
+
create<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
4509
|
+
create(objects: Array<EditableData<Record> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
4510
|
+
read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
4511
|
+
read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
4512
|
+
read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4513
|
+
read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
4514
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
|
4515
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
|
4516
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4517
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
4518
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Record>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4519
|
+
update(object: Partial<EditableData<Record>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
4520
|
+
update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Record>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4521
|
+
update(id: string, object: Partial<EditableData<Record>>): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
4522
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4523
|
+
update(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
4524
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Record> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
4525
|
+
createOrUpdate(object: EditableData<Record> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
4526
|
+
createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Record>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
|
4527
|
+
createOrUpdate(id: string, object: Omit<EditableData<Record>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
|
4528
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Record> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
|
4529
|
+
createOrUpdate(objects: Array<EditableData<Record> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
|
4530
|
+
delete<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4531
|
+
delete(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
4532
|
+
delete<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
|
4533
|
+
delete(id: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
|
4534
|
+
delete<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Record>> & Identifiable>, columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4535
|
+
delete(objects: Array<Partial<EditableData<Record>> & Identifiable>): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
4536
|
+
delete<K extends SelectableColumn<Record>>(objects: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
|
4537
|
+
delete(objects: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
|
3379
4538
|
search(query: string, options?: {
|
|
3380
|
-
fuzziness?:
|
|
4539
|
+
fuzziness?: FuzzinessExpression;
|
|
4540
|
+
prefix?: PrefixExpression;
|
|
4541
|
+
highlight?: HighlightExpression;
|
|
3381
4542
|
filter?: Filter<Record>;
|
|
3382
|
-
|
|
4543
|
+
boosters?: Boosters<Record>[];
|
|
4544
|
+
}): Promise<any>;
|
|
3383
4545
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
|
3384
4546
|
}
|
|
3385
4547
|
|
|
4548
|
+
declare type BaseSchema = {
|
|
4549
|
+
name: string;
|
|
4550
|
+
columns: readonly ({
|
|
4551
|
+
name: string;
|
|
4552
|
+
type: Column['type'];
|
|
4553
|
+
} | {
|
|
4554
|
+
name: string;
|
|
4555
|
+
type: 'link';
|
|
4556
|
+
link: {
|
|
4557
|
+
table: string;
|
|
4558
|
+
};
|
|
4559
|
+
} | {
|
|
4560
|
+
name: string;
|
|
4561
|
+
type: 'object';
|
|
4562
|
+
columns: {
|
|
4563
|
+
name: string;
|
|
4564
|
+
type: string;
|
|
4565
|
+
}[];
|
|
4566
|
+
})[];
|
|
4567
|
+
};
|
|
4568
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
|
4569
|
+
name: string;
|
|
4570
|
+
columns: readonly unknown[];
|
|
4571
|
+
} ? {
|
|
4572
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
|
4573
|
+
} : never : never;
|
|
4574
|
+
declare type TableType<Tables, TableName> = Tables & {
|
|
4575
|
+
name: TableName;
|
|
4576
|
+
} extends infer Table ? Table extends {
|
|
4577
|
+
name: string;
|
|
4578
|
+
columns: infer Columns;
|
|
4579
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
|
4580
|
+
name: string;
|
|
4581
|
+
type: string;
|
|
4582
|
+
} ? Identifiable & {
|
|
4583
|
+
[K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
|
|
4584
|
+
} : never : never : never : never;
|
|
4585
|
+
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
|
4586
|
+
name: PropertyName;
|
|
4587
|
+
} extends infer Property ? Property extends {
|
|
4588
|
+
name: string;
|
|
4589
|
+
type: infer Type;
|
|
4590
|
+
link?: {
|
|
4591
|
+
table: infer LinkedTable;
|
|
4592
|
+
};
|
|
4593
|
+
columns?: infer ObjectColumns;
|
|
4594
|
+
} ? (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 {
|
|
4595
|
+
name: string;
|
|
4596
|
+
type: string;
|
|
4597
|
+
} ? {
|
|
4598
|
+
[K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
|
|
4599
|
+
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
|
|
4600
|
+
|
|
4601
|
+
/**
|
|
4602
|
+
* Operator to restrict results to only values that are greater than the given value.
|
|
4603
|
+
*/
|
|
4604
|
+
declare const greaterThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3386
4605
|
/**
|
|
3387
4606
|
* Operator to restrict results to only values that are greater than the given value.
|
|
3388
4607
|
*/
|
|
@@ -3390,15 +4609,35 @@ declare const gt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T
|
|
|
3390
4609
|
/**
|
|
3391
4610
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
3392
4611
|
*/
|
|
3393
|
-
declare const
|
|
4612
|
+
declare const greaterThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
4613
|
+
/**
|
|
4614
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
4615
|
+
*/
|
|
4616
|
+
declare const greaterEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3394
4617
|
/**
|
|
3395
4618
|
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
3396
4619
|
*/
|
|
3397
4620
|
declare const gte: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
4621
|
+
/**
|
|
4622
|
+
* Operator to restrict results to only values that are greater than or equal to the given value.
|
|
4623
|
+
*/
|
|
4624
|
+
declare const ge: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
4625
|
+
/**
|
|
4626
|
+
* Operator to restrict results to only values that are lower than the given value.
|
|
4627
|
+
*/
|
|
4628
|
+
declare const lessThan: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3398
4629
|
/**
|
|
3399
4630
|
* Operator to restrict results to only values that are lower than the given value.
|
|
3400
4631
|
*/
|
|
3401
4632
|
declare const lt: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
4633
|
+
/**
|
|
4634
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
|
4635
|
+
*/
|
|
4636
|
+
declare const lessThanEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
4637
|
+
/**
|
|
4638
|
+
* Operator to restrict results to only values that are lower than or equal to the given value.
|
|
4639
|
+
*/
|
|
4640
|
+
declare const lessEquals: <T extends ComparableType>(value: T) => ComparableTypeFilter<T>;
|
|
3402
4641
|
/**
|
|
3403
4642
|
* Operator to restrict results to only values that are lower than or equal to the given value.
|
|
3404
4643
|
*/
|
|
@@ -3431,6 +4670,10 @@ declare const pattern: (value: string) => StringTypeFilter;
|
|
|
3431
4670
|
* Operator to restrict results to only values that are equal to the given value.
|
|
3432
4671
|
*/
|
|
3433
4672
|
declare const is: <T>(value: T) => PropertyFilter<T>;
|
|
4673
|
+
/**
|
|
4674
|
+
* Operator to restrict results to only values that are equal to the given value.
|
|
4675
|
+
*/
|
|
4676
|
+
declare const equals: <T>(value: T) => PropertyFilter<T>;
|
|
3434
4677
|
/**
|
|
3435
4678
|
* Operator to restrict results to only values that are not equal to the given value.
|
|
3436
4679
|
*/
|
|
@@ -3459,45 +4702,15 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
|
3459
4702
|
declare type SchemaDefinition = {
|
|
3460
4703
|
table: string;
|
|
3461
4704
|
};
|
|
3462
|
-
declare type SchemaPluginResult<Schemas extends Record<string,
|
|
4705
|
+
declare type SchemaPluginResult<Schemas extends Record<string, XataRecord>> = {
|
|
3463
4706
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
|
3464
|
-
} & {
|
|
3465
|
-
[key: string]: Repository<XataRecord$1>;
|
|
3466
4707
|
};
|
|
3467
|
-
declare class SchemaPlugin<Schemas extends Record<string,
|
|
4708
|
+
declare class SchemaPlugin<Schemas extends Record<string, XataRecord>> extends XataPlugin {
|
|
3468
4709
|
#private;
|
|
3469
|
-
|
|
3470
|
-
constructor(tableNames?: string[] | undefined);
|
|
4710
|
+
constructor(schemaTables?: Schemas.Table[]);
|
|
3471
4711
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
|
3472
4712
|
}
|
|
3473
4713
|
|
|
3474
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
|
3475
|
-
fuzziness?: number;
|
|
3476
|
-
tables?: Tables[];
|
|
3477
|
-
};
|
|
3478
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3479
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
|
3480
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
|
|
3481
|
-
table: Model;
|
|
3482
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
|
3483
|
-
};
|
|
3484
|
-
}>[]>;
|
|
3485
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
|
3486
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
|
3487
|
-
}>;
|
|
3488
|
-
};
|
|
3489
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
|
3490
|
-
#private;
|
|
3491
|
-
private db;
|
|
3492
|
-
constructor(db: SchemaPluginResult<Schemas>);
|
|
3493
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
|
3494
|
-
}
|
|
3495
|
-
declare type SearchXataRecord = XataRecord & {
|
|
3496
|
-
xata: {
|
|
3497
|
-
table: string;
|
|
3498
|
-
};
|
|
3499
|
-
};
|
|
3500
|
-
|
|
3501
4714
|
declare type BranchStrategyValue = string | undefined | null;
|
|
3502
4715
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
|
3503
4716
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
|
@@ -3509,20 +4722,35 @@ declare type BaseClientOptions = {
|
|
|
3509
4722
|
databaseURL?: string;
|
|
3510
4723
|
branch?: BranchStrategyOption;
|
|
3511
4724
|
cache?: CacheImpl;
|
|
4725
|
+
trace?: TraceFunction;
|
|
3512
4726
|
};
|
|
3513
4727
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
|
3514
4728
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
|
3515
|
-
new <Schemas extends Record<string,
|
|
4729
|
+
new <Schemas extends Record<string, XataRecord> = {}>(options?: Partial<BaseClientOptions>, schemaTables?: readonly BaseSchema[]): Omit<{
|
|
3516
4730
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
|
3517
4731
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
|
3518
4732
|
}, keyof Plugins> & {
|
|
3519
4733
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
|
4734
|
+
} & {
|
|
4735
|
+
getConfig(): Promise<{
|
|
4736
|
+
databaseURL: string;
|
|
4737
|
+
branch: string;
|
|
4738
|
+
}>;
|
|
3520
4739
|
};
|
|
3521
4740
|
}
|
|
3522
4741
|
declare const BaseClient_base: ClientConstructor<{}>;
|
|
3523
4742
|
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
|
3524
4743
|
}
|
|
3525
4744
|
|
|
4745
|
+
declare class Serializer {
|
|
4746
|
+
classes: Record<string, any>;
|
|
4747
|
+
add(clazz: any): void;
|
|
4748
|
+
toJSON<T>(data: T): string;
|
|
4749
|
+
fromJSON<T>(json: string): T;
|
|
4750
|
+
}
|
|
4751
|
+
declare const serialize: <T>(data: T) => string;
|
|
4752
|
+
declare const deserialize: <T>(json: string) => T;
|
|
4753
|
+
|
|
3526
4754
|
declare type BranchResolutionOptions = {
|
|
3527
4755
|
databaseURL?: string;
|
|
3528
4756
|
apiKey?: string;
|
|
@@ -3534,9 +4762,89 @@ declare function getDatabaseURL(): string | undefined;
|
|
|
3534
4762
|
|
|
3535
4763
|
declare function getAPIKey(): string | undefined;
|
|
3536
4764
|
|
|
4765
|
+
interface Body {
|
|
4766
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
4767
|
+
blob(): Promise<Blob>;
|
|
4768
|
+
formData(): Promise<FormData>;
|
|
4769
|
+
json(): Promise<any>;
|
|
4770
|
+
text(): Promise<string>;
|
|
4771
|
+
}
|
|
4772
|
+
interface Blob {
|
|
4773
|
+
readonly size: number;
|
|
4774
|
+
readonly type: string;
|
|
4775
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
4776
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
4777
|
+
text(): Promise<string>;
|
|
4778
|
+
}
|
|
4779
|
+
/** Provides information about files and allows JavaScript in a web page to access their content. */
|
|
4780
|
+
interface File extends Blob {
|
|
4781
|
+
readonly lastModified: number;
|
|
4782
|
+
readonly name: string;
|
|
4783
|
+
readonly webkitRelativePath: string;
|
|
4784
|
+
}
|
|
4785
|
+
declare type FormDataEntryValue = File | string;
|
|
4786
|
+
/** 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". */
|
|
4787
|
+
interface FormData {
|
|
4788
|
+
append(name: string, value: string | Blob, fileName?: string): void;
|
|
4789
|
+
delete(name: string): void;
|
|
4790
|
+
get(name: string): FormDataEntryValue | null;
|
|
4791
|
+
getAll(name: string): FormDataEntryValue[];
|
|
4792
|
+
has(name: string): boolean;
|
|
4793
|
+
set(name: string, value: string | Blob, fileName?: string): void;
|
|
4794
|
+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
|
4795
|
+
}
|
|
4796
|
+
/** 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. */
|
|
4797
|
+
interface Headers {
|
|
4798
|
+
append(name: string, value: string): void;
|
|
4799
|
+
delete(name: string): void;
|
|
4800
|
+
get(name: string): string | null;
|
|
4801
|
+
has(name: string): boolean;
|
|
4802
|
+
set(name: string, value: string): void;
|
|
4803
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
|
4804
|
+
}
|
|
4805
|
+
interface Request extends Body {
|
|
4806
|
+
/** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */
|
|
4807
|
+
readonly cache: 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
|
4808
|
+
/** 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. */
|
|
4809
|
+
readonly credentials: 'include' | 'omit' | 'same-origin';
|
|
4810
|
+
/** Returns the kind of resource requested by request, e.g., "document" or "script". */
|
|
4811
|
+
readonly destination: '' | 'audio' | 'audioworklet' | 'document' | 'embed' | 'font' | 'frame' | 'iframe' | 'image' | 'manifest' | 'object' | 'paintworklet' | 'report' | 'script' | 'sharedworker' | 'style' | 'track' | 'video' | 'worker' | 'xslt';
|
|
4812
|
+
/** 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. */
|
|
4813
|
+
readonly headers: Headers;
|
|
4814
|
+
/** 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] */
|
|
4815
|
+
readonly integrity: string;
|
|
4816
|
+
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
|
4817
|
+
readonly keepalive: boolean;
|
|
4818
|
+
/** Returns request's HTTP method, which is "GET" by default. */
|
|
4819
|
+
readonly method: string;
|
|
4820
|
+
/** 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. */
|
|
4821
|
+
readonly mode: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
|
|
4822
|
+
/** 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. */
|
|
4823
|
+
readonly redirect: 'error' | 'follow' | 'manual';
|
|
4824
|
+
/** 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. */
|
|
4825
|
+
readonly referrer: string;
|
|
4826
|
+
/** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */
|
|
4827
|
+
readonly referrerPolicy: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
4828
|
+
/** Returns the URL of request as a string. */
|
|
4829
|
+
readonly url: string;
|
|
4830
|
+
clone(): Request;
|
|
4831
|
+
}
|
|
4832
|
+
|
|
4833
|
+
declare type XataWorkerContext<XataClient> = {
|
|
4834
|
+
xata: XataClient;
|
|
4835
|
+
request: Request;
|
|
4836
|
+
env: Record<string, string | undefined>;
|
|
4837
|
+
};
|
|
4838
|
+
declare type RemoveFirst<T> = T extends [any, ...infer U] ? U : never;
|
|
4839
|
+
declare type WorkerRunnerConfig = {
|
|
4840
|
+
workspace: string;
|
|
4841
|
+
worker: string;
|
|
4842
|
+
};
|
|
4843
|
+
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>>>;
|
|
4844
|
+
|
|
3537
4845
|
declare class XataError extends Error {
|
|
3538
4846
|
readonly status: number;
|
|
3539
4847
|
constructor(message: string, status: number);
|
|
3540
4848
|
}
|
|
3541
4849
|
|
|
3542
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, 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 };
|
|
4850
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, ApplyBranchSchemaEditError, ApplyBranchSchemaEditPathParams, ApplyBranchSchemaEditRequestBody, ApplyBranchSchemaEditResponse, ApplyBranchSchemaEditVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CompareBranchSchemasError, CompareBranchSchemasPathParams, CompareBranchSchemasVariables, CompareBranchWithUserSchemaError, CompareBranchWithUserSchemaPathParams, CompareBranchWithUserSchemaRequestBody, CompareBranchWithUserSchemaVariables, CompareMigrationRequestError, CompareMigrationRequestPathParams, CompareMigrationRequestVariables, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateMigrationRequestError, CreateMigrationRequestPathParams, CreateMigrationRequestRequestBody, CreateMigrationRequestResponse, CreateMigrationRequestVariables, CreateTableError, CreateTablePathParams, CreateTableResponse, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordQueryParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchSchemaHistoryError, GetBranchSchemaHistoryPathParams, GetBranchSchemaHistoryRequestBody, GetBranchSchemaHistoryResponse, GetBranchSchemaHistoryVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetDatabaseMetadataError, GetDatabaseMetadataPathParams, GetDatabaseMetadataVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetMigrationRequestError, GetMigrationRequestIsMergedError, GetMigrationRequestIsMergedPathParams, GetMigrationRequestIsMergedResponse, GetMigrationRequestIsMergedVariables, GetMigrationRequestPathParams, GetMigrationRequestVariables, GetRecordError, GetRecordPathParams, GetRecordQueryParams, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordQueryParams, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, ListMigrationRequestsCommitsError, ListMigrationRequestsCommitsPathParams, ListMigrationRequestsCommitsRequestBody, ListMigrationRequestsCommitsResponse, ListMigrationRequestsCommitsVariables, ListMigrationRequestsError, ListMigrationRequestsPathParams, ListMigrationRequestsRequestBody, ListMigrationRequestsResponse, ListMigrationRequestsVariables, MergeMigrationRequestError, MergeMigrationRequestPathParams, MergeMigrationRequestVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, PatchDatabaseMetadataError, PatchDatabaseMetadataPathParams, PatchDatabaseMetadataRequestBody, PatchDatabaseMetadataVariables, PreviewBranchSchemaEditError, PreviewBranchSchemaEditPathParams, PreviewBranchSchemaEditRequestBody, PreviewBranchSchemaEditResponse, PreviewBranchSchemaEditVariables, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, SelectableColumn, SelectedPick, Serializer, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateBranchSchemaError, UpdateBranchSchemaPathParams, UpdateBranchSchemaResponse, UpdateBranchSchemaVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateMigrationRequestError, UpdateMigrationRequestPathParams, UpdateMigrationRequestRequestBody, UpdateMigrationRequestVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, applyBranchSchemaEdit, buildClient, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequests, listMigrationRequestsCommits, lt, lte, mergeMigrationRequest, notExists, operationsByTag, patchDatabaseMetadata, pattern, previewBranchSchemaEdit, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, updateBranchMetadata, updateBranchSchema, updateColumn, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|