@xata.io/client 0.0.0-alpha.vfb4a018 → 0.0.0-alpha.vfc692f9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -2
- package/CHANGELOG.md +146 -0
- package/README.md +271 -1
- package/Usage.md +428 -0
- package/dist/index.cjs +569 -357
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +814 -228
- package/dist/index.mjs +548 -358
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
- package/tsconfig.json +1 -0
package/dist/index.d.ts
CHANGED
@@ -6,6 +6,9 @@ declare type FetchImpl = (url: string, init?: {
|
|
6
6
|
ok: boolean;
|
7
7
|
status: number;
|
8
8
|
json(): Promise<any>;
|
9
|
+
headers?: {
|
10
|
+
get(name: string): string | null;
|
11
|
+
};
|
9
12
|
}>;
|
10
13
|
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
|
11
14
|
declare type FetcherExtraProps = {
|
@@ -20,7 +23,6 @@ declare type ErrorWrapper<TError> = TError | {
|
|
20
23
|
};
|
21
24
|
|
22
25
|
interface CacheImpl {
|
23
|
-
cacheRecords: boolean;
|
24
26
|
defaultQueryTTL: number;
|
25
27
|
getAll(): Promise<Record<string, unknown>>;
|
26
28
|
get: <T>(key: string) => Promise<T | null>;
|
@@ -30,13 +32,11 @@ interface CacheImpl {
|
|
30
32
|
}
|
31
33
|
interface SimpleCacheOptions {
|
32
34
|
max?: number;
|
33
|
-
cacheRecords?: boolean;
|
34
35
|
defaultQueryTTL?: number;
|
35
36
|
}
|
36
37
|
declare class SimpleCache implements CacheImpl {
|
37
38
|
#private;
|
38
39
|
capacity: number;
|
39
|
-
cacheRecords: boolean;
|
40
40
|
defaultQueryTTL: number;
|
41
41
|
constructor(options?: SimpleCacheOptions);
|
42
42
|
getAll(): Promise<Record<string, unknown>>;
|
@@ -268,6 +268,21 @@ declare type SortExpression = string[] | {
|
|
268
268
|
[key: string]: SortOrder;
|
269
269
|
}[];
|
270
270
|
declare type SortOrder = 'asc' | 'desc';
|
271
|
+
/**
|
272
|
+
* Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
|
273
|
+
* distance is the number of one charcter changes needed to make two strings equal. The default is 1, meaning that single
|
274
|
+
* 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
|
+
* to allow two typos in a word.
|
276
|
+
*
|
277
|
+
* @default 1
|
278
|
+
* @maximum 2
|
279
|
+
* @minimum 0
|
280
|
+
*/
|
281
|
+
declare type FuzzinessExpression = number;
|
282
|
+
/**
|
283
|
+
* 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.
|
284
|
+
*/
|
285
|
+
declare type PrefixExpression = 'phrase' | 'disabled';
|
271
286
|
/**
|
272
287
|
* @minProperties 1
|
273
288
|
*/
|
@@ -281,6 +296,48 @@ declare type FilterExpression = {
|
|
281
296
|
} & {
|
282
297
|
[key: string]: FilterColumn;
|
283
298
|
};
|
299
|
+
declare type HighlightExpression = {
|
300
|
+
enabled?: boolean;
|
301
|
+
encodeHTML?: boolean;
|
302
|
+
};
|
303
|
+
/**
|
304
|
+
* Booster Expression
|
305
|
+
*
|
306
|
+
* @x-go-type xata.BoosterExpression
|
307
|
+
*/
|
308
|
+
declare type BoosterExpression = {
|
309
|
+
valueBooster?: ValueBooster$1;
|
310
|
+
} | {
|
311
|
+
numericBooster?: NumericBooster$1;
|
312
|
+
} | {
|
313
|
+
dateBooster?: DateBooster$1;
|
314
|
+
};
|
315
|
+
/**
|
316
|
+
* Boost records with a particular value for a column.
|
317
|
+
*/
|
318
|
+
declare type ValueBooster$1 = {
|
319
|
+
column: string;
|
320
|
+
value: string | number | boolean;
|
321
|
+
factor: number;
|
322
|
+
};
|
323
|
+
/**
|
324
|
+
* Boost records based on the value of a numeric column.
|
325
|
+
*/
|
326
|
+
declare type NumericBooster$1 = {
|
327
|
+
column: string;
|
328
|
+
factor: number;
|
329
|
+
};
|
330
|
+
/**
|
331
|
+
* Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
|
332
|
+
* 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
|
333
|
+
* 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.
|
334
|
+
*/
|
335
|
+
declare type DateBooster$1 = {
|
336
|
+
column: string;
|
337
|
+
origin?: string;
|
338
|
+
scale: string;
|
339
|
+
decay: number;
|
340
|
+
};
|
284
341
|
declare type FilterList = FilterExpression | FilterExpression[];
|
285
342
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
286
343
|
/**
|
@@ -337,7 +394,24 @@ declare type PageConfig = {
|
|
337
394
|
size?: number;
|
338
395
|
offset?: number;
|
339
396
|
};
|
340
|
-
declare type
|
397
|
+
declare type ColumnsProjection = string[];
|
398
|
+
/**
|
399
|
+
* Xata Table Record Metadata
|
400
|
+
*/
|
401
|
+
declare type RecordMeta = {
|
402
|
+
id: RecordID;
|
403
|
+
xata: {
|
404
|
+
version: number;
|
405
|
+
table?: string;
|
406
|
+
highlight?: {
|
407
|
+
[key: string]: string[] | {
|
408
|
+
[key: string]: any;
|
409
|
+
};
|
410
|
+
};
|
411
|
+
score?: number;
|
412
|
+
warnings?: string[];
|
413
|
+
};
|
414
|
+
};
|
341
415
|
/**
|
342
416
|
* @pattern [a-zA-Z0-9_-~:]+
|
343
417
|
*/
|
@@ -359,16 +433,9 @@ declare type RecordsMetadata = {
|
|
359
433
|
};
|
360
434
|
};
|
361
435
|
/**
|
362
|
-
* Xata Table Record
|
436
|
+
* Xata Table Record Metadata
|
363
437
|
*/
|
364
|
-
declare type XataRecord$1 = {
|
365
|
-
id: RecordID;
|
366
|
-
xata: {
|
367
|
-
version: number;
|
368
|
-
table?: string;
|
369
|
-
warnings?: string[];
|
370
|
-
};
|
371
|
-
} & {
|
438
|
+
declare type XataRecord$1 = RecordMeta & {
|
372
439
|
[key: string]: any;
|
373
440
|
};
|
374
441
|
|
@@ -409,7 +476,11 @@ type schemas_TableMigration = TableMigration;
|
|
409
476
|
type schemas_ColumnMigration = ColumnMigration;
|
410
477
|
type schemas_SortExpression = SortExpression;
|
411
478
|
type schemas_SortOrder = SortOrder;
|
479
|
+
type schemas_FuzzinessExpression = FuzzinessExpression;
|
480
|
+
type schemas_PrefixExpression = PrefixExpression;
|
412
481
|
type schemas_FilterExpression = FilterExpression;
|
482
|
+
type schemas_HighlightExpression = HighlightExpression;
|
483
|
+
type schemas_BoosterExpression = BoosterExpression;
|
413
484
|
type schemas_FilterList = FilterList;
|
414
485
|
type schemas_FilterColumn = FilterColumn;
|
415
486
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -419,7 +490,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
419
490
|
type schemas_FilterRangeValue = FilterRangeValue;
|
420
491
|
type schemas_FilterValue = FilterValue;
|
421
492
|
type schemas_PageConfig = PageConfig;
|
422
|
-
type
|
493
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
494
|
+
type schemas_RecordMeta = RecordMeta;
|
423
495
|
type schemas_RecordID = RecordID;
|
424
496
|
type schemas_TableRename = TableRename;
|
425
497
|
type schemas_RecordsMetadata = RecordsMetadata;
|
@@ -462,7 +534,14 @@ declare namespace schemas {
|
|
462
534
|
schemas_ColumnMigration as ColumnMigration,
|
463
535
|
schemas_SortExpression as SortExpression,
|
464
536
|
schemas_SortOrder as SortOrder,
|
537
|
+
schemas_FuzzinessExpression as FuzzinessExpression,
|
538
|
+
schemas_PrefixExpression as PrefixExpression,
|
465
539
|
schemas_FilterExpression as FilterExpression,
|
540
|
+
schemas_HighlightExpression as HighlightExpression,
|
541
|
+
schemas_BoosterExpression as BoosterExpression,
|
542
|
+
ValueBooster$1 as ValueBooster,
|
543
|
+
NumericBooster$1 as NumericBooster,
|
544
|
+
DateBooster$1 as DateBooster,
|
466
545
|
schemas_FilterList as FilterList,
|
467
546
|
schemas_FilterColumn as FilterColumn,
|
468
547
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -472,7 +551,8 @@ declare namespace schemas {
|
|
472
551
|
schemas_FilterRangeValue as FilterRangeValue,
|
473
552
|
schemas_FilterValue as FilterValue,
|
474
553
|
schemas_PageConfig as PageConfig,
|
475
|
-
|
554
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
555
|
+
schemas_RecordMeta as RecordMeta,
|
476
556
|
schemas_RecordID as RecordID,
|
477
557
|
schemas_TableRename as TableRename,
|
478
558
|
schemas_RecordsMetadata as RecordsMetadata,
|
@@ -507,11 +587,17 @@ declare type BulkError = {
|
|
507
587
|
status?: number;
|
508
588
|
}[];
|
509
589
|
};
|
590
|
+
declare type BulkInsertResponse = {
|
591
|
+
recordIDs: string[];
|
592
|
+
} | {
|
593
|
+
records: XataRecord$1[];
|
594
|
+
};
|
510
595
|
declare type BranchMigrationPlan = {
|
511
596
|
version: number;
|
512
597
|
migration: BranchMigration;
|
513
598
|
};
|
514
|
-
declare type
|
599
|
+
declare type RecordResponse = XataRecord$1;
|
600
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
515
601
|
id: string;
|
516
602
|
xata: {
|
517
603
|
version: number;
|
@@ -535,7 +621,9 @@ type responses_SimpleError = SimpleError;
|
|
535
621
|
type responses_BadRequestError = BadRequestError;
|
536
622
|
type responses_AuthError = AuthError;
|
537
623
|
type responses_BulkError = BulkError;
|
624
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
538
625
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
626
|
+
type responses_RecordResponse = RecordResponse;
|
539
627
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
540
628
|
type responses_QueryResponse = QueryResponse;
|
541
629
|
type responses_SearchResponse = SearchResponse;
|
@@ -546,7 +634,9 @@ declare namespace responses {
|
|
546
634
|
responses_BadRequestError as BadRequestError,
|
547
635
|
responses_AuthError as AuthError,
|
548
636
|
responses_BulkError as BulkError,
|
637
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
549
638
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
639
|
+
responses_RecordResponse as RecordResponse,
|
550
640
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
551
641
|
responses_QueryResponse as QueryResponse,
|
552
642
|
responses_SearchResponse as SearchResponse,
|
@@ -852,6 +942,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
852
942
|
} | {
|
853
943
|
status: 404;
|
854
944
|
payload: SimpleError;
|
945
|
+
} | {
|
946
|
+
status: 409;
|
947
|
+
payload: SimpleError;
|
855
948
|
}>;
|
856
949
|
declare type InviteWorkspaceMemberRequestBody = {
|
857
950
|
email: string;
|
@@ -865,6 +958,34 @@ declare type InviteWorkspaceMemberVariables = {
|
|
865
958
|
* Invite some user to join the workspace with the given role
|
866
959
|
*/
|
867
960
|
declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
961
|
+
declare type UpdateWorkspaceMemberInvitePathParams = {
|
962
|
+
workspaceId: WorkspaceID;
|
963
|
+
inviteId: InviteID;
|
964
|
+
};
|
965
|
+
declare type UpdateWorkspaceMemberInviteError = ErrorWrapper<{
|
966
|
+
status: 400;
|
967
|
+
payload: BadRequestError;
|
968
|
+
} | {
|
969
|
+
status: 401;
|
970
|
+
payload: AuthError;
|
971
|
+
} | {
|
972
|
+
status: 404;
|
973
|
+
payload: SimpleError;
|
974
|
+
} | {
|
975
|
+
status: 422;
|
976
|
+
payload: SimpleError;
|
977
|
+
}>;
|
978
|
+
declare type UpdateWorkspaceMemberInviteRequestBody = {
|
979
|
+
role: Role;
|
980
|
+
};
|
981
|
+
declare type UpdateWorkspaceMemberInviteVariables = {
|
982
|
+
body: UpdateWorkspaceMemberInviteRequestBody;
|
983
|
+
pathParams: UpdateWorkspaceMemberInvitePathParams;
|
984
|
+
} & FetcherExtraProps;
|
985
|
+
/**
|
986
|
+
* 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.
|
987
|
+
*/
|
988
|
+
declare const updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
868
989
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
869
990
|
workspaceId: WorkspaceID;
|
870
991
|
inviteId: InviteID;
|
@@ -1151,14 +1272,15 @@ declare type ResolveBranchVariables = {
|
|
1151
1272
|
} & FetcherExtraProps;
|
1152
1273
|
/**
|
1153
1274
|
* In order to resolve the database branch, the following algorithm is used:
|
1154
|
-
* * if the `gitBranch` is found in the [git branches mapping](), the associated Xata branch is returned
|
1275
|
+
* * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
|
1155
1276
|
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
1156
|
-
* * else,
|
1277
|
+
* * else, if `fallbackBranch` is provided and a branch with that name exists, return it
|
1278
|
+
* * else, return the default branch of the DB (`main` or the first branch)
|
1157
1279
|
*
|
1158
1280
|
* Example call:
|
1159
1281
|
*
|
1160
1282
|
* ```json
|
1161
|
-
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test
|
1283
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
|
1162
1284
|
* ```
|
1163
1285
|
*
|
1164
1286
|
* Example response:
|
@@ -1209,6 +1331,10 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1209
1331
|
status: 404;
|
1210
1332
|
payload: SimpleError;
|
1211
1333
|
}>;
|
1334
|
+
declare type CreateBranchResponse = {
|
1335
|
+
databaseName: string;
|
1336
|
+
branchName: string;
|
1337
|
+
};
|
1212
1338
|
declare type CreateBranchRequestBody = {
|
1213
1339
|
from?: string;
|
1214
1340
|
metadata?: BranchMetadata;
|
@@ -1218,7 +1344,7 @@ declare type CreateBranchVariables = {
|
|
1218
1344
|
pathParams: CreateBranchPathParams;
|
1219
1345
|
queryParams?: CreateBranchQueryParams;
|
1220
1346
|
} & FetcherExtraProps;
|
1221
|
-
declare const createBranch: (variables: CreateBranchVariables) => Promise<
|
1347
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
1222
1348
|
declare type DeleteBranchPathParams = {
|
1223
1349
|
dbBranchName: DBBranchName;
|
1224
1350
|
workspace: string;
|
@@ -1405,13 +1531,17 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1405
1531
|
status: 422;
|
1406
1532
|
payload: SimpleError;
|
1407
1533
|
}>;
|
1534
|
+
declare type CreateTableResponse = {
|
1535
|
+
branchName: string;
|
1536
|
+
tableName: string;
|
1537
|
+
};
|
1408
1538
|
declare type CreateTableVariables = {
|
1409
1539
|
pathParams: CreateTablePathParams;
|
1410
1540
|
} & FetcherExtraProps;
|
1411
1541
|
/**
|
1412
1542
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1413
1543
|
*/
|
1414
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
1544
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1415
1545
|
declare type DeleteTablePathParams = {
|
1416
1546
|
dbBranchName: DBBranchName;
|
1417
1547
|
tableName: TableName;
|
@@ -1458,8 +1588,9 @@ declare type UpdateTableVariables = {
|
|
1458
1588
|
*
|
1459
1589
|
* In the example below, we rename a table from “users” to “people”:
|
1460
1590
|
*
|
1461
|
-
* ```
|
1462
|
-
* PATCH /db/test:main/tables/users
|
1591
|
+
* ```json
|
1592
|
+
* // PATCH /db/test:main/tables/users
|
1593
|
+
*
|
1463
1594
|
* {
|
1464
1595
|
* "name": "people"
|
1465
1596
|
* }
|
@@ -1643,6 +1774,9 @@ declare type InsertRecordPathParams = {
|
|
1643
1774
|
tableName: TableName;
|
1644
1775
|
workspace: string;
|
1645
1776
|
};
|
1777
|
+
declare type InsertRecordQueryParams = {
|
1778
|
+
columns?: ColumnsProjection;
|
1779
|
+
};
|
1646
1780
|
declare type InsertRecordError = ErrorWrapper<{
|
1647
1781
|
status: 400;
|
1648
1782
|
payload: BadRequestError;
|
@@ -1653,20 +1787,15 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1653
1787
|
status: 404;
|
1654
1788
|
payload: SimpleError;
|
1655
1789
|
}>;
|
1656
|
-
declare type InsertRecordResponse = {
|
1657
|
-
id: string;
|
1658
|
-
xata: {
|
1659
|
-
version: number;
|
1660
|
-
};
|
1661
|
-
};
|
1662
1790
|
declare type InsertRecordVariables = {
|
1663
1791
|
body?: Record<string, any>;
|
1664
1792
|
pathParams: InsertRecordPathParams;
|
1793
|
+
queryParams?: InsertRecordQueryParams;
|
1665
1794
|
} & FetcherExtraProps;
|
1666
1795
|
/**
|
1667
1796
|
* Insert a new Record into the Table
|
1668
1797
|
*/
|
1669
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
1798
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1670
1799
|
declare type InsertRecordWithIDPathParams = {
|
1671
1800
|
dbBranchName: DBBranchName;
|
1672
1801
|
tableName: TableName;
|
@@ -1674,6 +1803,7 @@ declare type InsertRecordWithIDPathParams = {
|
|
1674
1803
|
workspace: string;
|
1675
1804
|
};
|
1676
1805
|
declare type InsertRecordWithIDQueryParams = {
|
1806
|
+
columns?: ColumnsProjection;
|
1677
1807
|
createOnly?: boolean;
|
1678
1808
|
ifVersion?: number;
|
1679
1809
|
};
|
@@ -1706,6 +1836,7 @@ declare type UpdateRecordWithIDPathParams = {
|
|
1706
1836
|
workspace: string;
|
1707
1837
|
};
|
1708
1838
|
declare type UpdateRecordWithIDQueryParams = {
|
1839
|
+
columns?: ColumnsProjection;
|
1709
1840
|
ifVersion?: number;
|
1710
1841
|
};
|
1711
1842
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1734,6 +1865,7 @@ declare type UpsertRecordWithIDPathParams = {
|
|
1734
1865
|
workspace: string;
|
1735
1866
|
};
|
1736
1867
|
declare type UpsertRecordWithIDQueryParams = {
|
1868
|
+
columns?: ColumnsProjection;
|
1737
1869
|
ifVersion?: number;
|
1738
1870
|
};
|
1739
1871
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1761,6 +1893,9 @@ declare type DeleteRecordPathParams = {
|
|
1761
1893
|
recordId: RecordID;
|
1762
1894
|
workspace: string;
|
1763
1895
|
};
|
1896
|
+
declare type DeleteRecordQueryParams = {
|
1897
|
+
columns?: ColumnsProjection;
|
1898
|
+
};
|
1764
1899
|
declare type DeleteRecordError = ErrorWrapper<{
|
1765
1900
|
status: 400;
|
1766
1901
|
payload: BadRequestError;
|
@@ -1773,14 +1908,18 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1773
1908
|
}>;
|
1774
1909
|
declare type DeleteRecordVariables = {
|
1775
1910
|
pathParams: DeleteRecordPathParams;
|
1911
|
+
queryParams?: DeleteRecordQueryParams;
|
1776
1912
|
} & FetcherExtraProps;
|
1777
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
1913
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1778
1914
|
declare type GetRecordPathParams = {
|
1779
1915
|
dbBranchName: DBBranchName;
|
1780
1916
|
tableName: TableName;
|
1781
1917
|
recordId: RecordID;
|
1782
1918
|
workspace: string;
|
1783
1919
|
};
|
1920
|
+
declare type GetRecordQueryParams = {
|
1921
|
+
columns?: ColumnsProjection;
|
1922
|
+
};
|
1784
1923
|
declare type GetRecordError = ErrorWrapper<{
|
1785
1924
|
status: 400;
|
1786
1925
|
payload: BadRequestError;
|
@@ -1791,12 +1930,9 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1791
1930
|
status: 404;
|
1792
1931
|
payload: SimpleError;
|
1793
1932
|
}>;
|
1794
|
-
declare type GetRecordRequestBody = {
|
1795
|
-
columns?: ColumnsFilter;
|
1796
|
-
};
|
1797
1933
|
declare type GetRecordVariables = {
|
1798
|
-
body?: GetRecordRequestBody;
|
1799
1934
|
pathParams: GetRecordPathParams;
|
1935
|
+
queryParams?: GetRecordQueryParams;
|
1800
1936
|
} & FetcherExtraProps;
|
1801
1937
|
/**
|
1802
1938
|
* Retrieve record by ID
|
@@ -1807,6 +1943,9 @@ declare type BulkInsertTableRecordsPathParams = {
|
|
1807
1943
|
tableName: TableName;
|
1808
1944
|
workspace: string;
|
1809
1945
|
};
|
1946
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
1947
|
+
columns?: ColumnsProjection;
|
1948
|
+
};
|
1810
1949
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1811
1950
|
status: 400;
|
1812
1951
|
payload: BulkError;
|
@@ -1816,21 +1955,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1816
1955
|
} | {
|
1817
1956
|
status: 404;
|
1818
1957
|
payload: SimpleError;
|
1958
|
+
} | {
|
1959
|
+
status: 422;
|
1960
|
+
payload: SimpleError;
|
1819
1961
|
}>;
|
1820
|
-
declare type BulkInsertTableRecordsResponse = {
|
1821
|
-
recordIDs: string[];
|
1822
|
-
};
|
1823
1962
|
declare type BulkInsertTableRecordsRequestBody = {
|
1824
1963
|
records: Record<string, any>[];
|
1825
1964
|
};
|
1826
1965
|
declare type BulkInsertTableRecordsVariables = {
|
1827
1966
|
body: BulkInsertTableRecordsRequestBody;
|
1828
1967
|
pathParams: BulkInsertTableRecordsPathParams;
|
1968
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1829
1969
|
} & FetcherExtraProps;
|
1830
1970
|
/**
|
1831
1971
|
* Bulk insert records
|
1832
1972
|
*/
|
1833
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
1973
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1834
1974
|
declare type QueryTablePathParams = {
|
1835
1975
|
dbBranchName: DBBranchName;
|
1836
1976
|
tableName: TableName;
|
@@ -1850,7 +1990,7 @@ declare type QueryTableRequestBody = {
|
|
1850
1990
|
filter?: FilterExpression;
|
1851
1991
|
sort?: SortExpression;
|
1852
1992
|
page?: PageConfig;
|
1853
|
-
columns?:
|
1993
|
+
columns?: ColumnsProjection;
|
1854
1994
|
};
|
1855
1995
|
declare type QueryTableVariables = {
|
1856
1996
|
body?: QueryTableRequestBody;
|
@@ -1867,7 +2007,7 @@ declare type QueryTableVariables = {
|
|
1867
2007
|
* {
|
1868
2008
|
* "columns": [...],
|
1869
2009
|
* "filter": {
|
1870
|
-
* "$all": [...]
|
2010
|
+
* "$all": [...],
|
1871
2011
|
* "$any": [...]
|
1872
2012
|
* ...
|
1873
2013
|
* },
|
@@ -2005,7 +2145,7 @@ declare type QueryTableVariables = {
|
|
2005
2145
|
* {
|
2006
2146
|
* "name": "Kilian",
|
2007
2147
|
* "address": {
|
2008
|
-
* "street": "New street"
|
2148
|
+
* "street": "New street"
|
2009
2149
|
* }
|
2010
2150
|
* }
|
2011
2151
|
* ```
|
@@ -2014,10 +2154,7 @@ declare type QueryTableVariables = {
|
|
2014
2154
|
*
|
2015
2155
|
* ```json
|
2016
2156
|
* {
|
2017
|
-
* "columns": [
|
2018
|
-
* "*",
|
2019
|
-
* "team.name"
|
2020
|
-
* ]
|
2157
|
+
* "columns": ["*", "team.name"]
|
2021
2158
|
* }
|
2022
2159
|
* ```
|
2023
2160
|
*
|
@@ -2035,7 +2172,7 @@ declare type QueryTableVariables = {
|
|
2035
2172
|
* "team": {
|
2036
2173
|
* "id": "XX",
|
2037
2174
|
* "xata": {
|
2038
|
-
* "version": 0
|
2175
|
+
* "version": 0
|
2039
2176
|
* },
|
2040
2177
|
* "name": "first team"
|
2041
2178
|
* }
|
@@ -2046,10 +2183,7 @@ declare type QueryTableVariables = {
|
|
2046
2183
|
*
|
2047
2184
|
* ```json
|
2048
2185
|
* {
|
2049
|
-
* "columns": [
|
2050
|
-
* "*",
|
2051
|
-
* "team.*"
|
2052
|
-
* ]
|
2186
|
+
* "columns": ["*", "team.*"]
|
2053
2187
|
* }
|
2054
2188
|
* ```
|
2055
2189
|
*
|
@@ -2067,7 +2201,7 @@ declare type QueryTableVariables = {
|
|
2067
2201
|
* "team": {
|
2068
2202
|
* "id": "XX",
|
2069
2203
|
* "xata": {
|
2070
|
-
* "version": 0
|
2204
|
+
* "version": 0
|
2071
2205
|
* },
|
2072
2206
|
* "name": "first team",
|
2073
2207
|
* "code": "A1",
|
@@ -2117,7 +2251,7 @@ declare type QueryTableVariables = {
|
|
2117
2251
|
* ```json
|
2118
2252
|
* {
|
2119
2253
|
* "filter": {
|
2120
|
-
*
|
2254
|
+
* "name": "r2"
|
2121
2255
|
* }
|
2122
2256
|
* }
|
2123
2257
|
* ```
|
@@ -2139,7 +2273,7 @@ declare type QueryTableVariables = {
|
|
2139
2273
|
* ```json
|
2140
2274
|
* {
|
2141
2275
|
* "filter": {
|
2142
|
-
*
|
2276
|
+
* "settings.plan": "free"
|
2143
2277
|
* }
|
2144
2278
|
* }
|
2145
2279
|
* ```
|
@@ -2149,8 +2283,8 @@ declare type QueryTableVariables = {
|
|
2149
2283
|
* "filter": {
|
2150
2284
|
* "settings": {
|
2151
2285
|
* "plan": "free"
|
2152
|
-
* }
|
2153
|
-
* }
|
2286
|
+
* }
|
2287
|
+
* }
|
2154
2288
|
* }
|
2155
2289
|
* ```
|
2156
2290
|
*
|
@@ -2159,8 +2293,8 @@ declare type QueryTableVariables = {
|
|
2159
2293
|
* ```json
|
2160
2294
|
* {
|
2161
2295
|
* "filter": {
|
2162
|
-
* "settings.plan": {"$any": ["free", "paid"]}
|
2163
|
-
* }
|
2296
|
+
* "settings.plan": { "$any": ["free", "paid"] }
|
2297
|
+
* }
|
2164
2298
|
* }
|
2165
2299
|
* ```
|
2166
2300
|
*
|
@@ -2169,9 +2303,9 @@ declare type QueryTableVariables = {
|
|
2169
2303
|
* ```json
|
2170
2304
|
* {
|
2171
2305
|
* "filter": {
|
2172
|
-
*
|
2173
|
-
*
|
2174
|
-
* }
|
2306
|
+
* "settings.dark": true,
|
2307
|
+
* "settings.plan": "free"
|
2308
|
+
* }
|
2175
2309
|
* }
|
2176
2310
|
* ```
|
2177
2311
|
*
|
@@ -2182,11 +2316,11 @@ declare type QueryTableVariables = {
|
|
2182
2316
|
* ```json
|
2183
2317
|
* {
|
2184
2318
|
* "filter": {
|
2185
|
-
*
|
2186
|
-
*
|
2187
|
-
*
|
2188
|
-
*
|
2189
|
-
* }
|
2319
|
+
* "$any": {
|
2320
|
+
* "settings.dark": true,
|
2321
|
+
* "settings.plan": "free"
|
2322
|
+
* }
|
2323
|
+
* }
|
2190
2324
|
* }
|
2191
2325
|
* ```
|
2192
2326
|
*
|
@@ -2197,10 +2331,10 @@ declare type QueryTableVariables = {
|
|
2197
2331
|
* "filter": {
|
2198
2332
|
* "$any": [
|
2199
2333
|
* {
|
2200
|
-
* "name": "r1"
|
2334
|
+
* "name": "r1"
|
2201
2335
|
* },
|
2202
2336
|
* {
|
2203
|
-
* "name": "r2"
|
2337
|
+
* "name": "r2"
|
2204
2338
|
* }
|
2205
2339
|
* ]
|
2206
2340
|
* }
|
@@ -2212,7 +2346,7 @@ declare type QueryTableVariables = {
|
|
2212
2346
|
* ```json
|
2213
2347
|
* {
|
2214
2348
|
* "filter": {
|
2215
|
-
* "$exists": "settings"
|
2349
|
+
* "$exists": "settings"
|
2216
2350
|
* }
|
2217
2351
|
* }
|
2218
2352
|
* ```
|
@@ -2224,10 +2358,10 @@ declare type QueryTableVariables = {
|
|
2224
2358
|
* "filter": {
|
2225
2359
|
* "$all": [
|
2226
2360
|
* {
|
2227
|
-
* "$exists": "settings"
|
2361
|
+
* "$exists": "settings"
|
2228
2362
|
* },
|
2229
2363
|
* {
|
2230
|
-
* "$exists": "name"
|
2364
|
+
* "$exists": "name"
|
2231
2365
|
* }
|
2232
2366
|
* ]
|
2233
2367
|
* }
|
@@ -2239,7 +2373,7 @@ declare type QueryTableVariables = {
|
|
2239
2373
|
* ```json
|
2240
2374
|
* {
|
2241
2375
|
* "filter": {
|
2242
|
-
* "$notExists": "settings"
|
2376
|
+
* "$notExists": "settings"
|
2243
2377
|
* }
|
2244
2378
|
* }
|
2245
2379
|
* ```
|
@@ -2266,22 +2400,28 @@ declare type QueryTableVariables = {
|
|
2266
2400
|
* {
|
2267
2401
|
* "filter": {
|
2268
2402
|
* "<column_name>": {
|
2269
|
-
*
|
2403
|
+
* "$pattern": "v*alu?"
|
2270
2404
|
* }
|
2271
2405
|
* }
|
2272
2406
|
* }
|
2273
2407
|
* ```
|
2274
2408
|
*
|
2409
|
+
* The `$pattern` operator accepts two wildcard characters:
|
2410
|
+
* * `*` matches zero or more characters
|
2411
|
+
* * `?` matches exactly one character
|
2412
|
+
*
|
2413
|
+
* If you want to match a string that contains a wildcard character, you can escape them using a backslash (`\`). You can escape a backslash by usign another backslash.
|
2414
|
+
*
|
2275
2415
|
* We could also have `$endsWith` and `$startsWith` operators:
|
2276
2416
|
*
|
2277
2417
|
* ```json
|
2278
2418
|
* {
|
2279
2419
|
* "filter": {
|
2280
2420
|
* "<column_name>": {
|
2281
|
-
*
|
2421
|
+
* "$endsWith": ".gz"
|
2282
2422
|
* },
|
2283
2423
|
* "<column_name>": {
|
2284
|
-
*
|
2424
|
+
* "$startsWith": "tmp-"
|
2285
2425
|
* }
|
2286
2426
|
* }
|
2287
2427
|
* }
|
@@ -2292,10 +2432,10 @@ declare type QueryTableVariables = {
|
|
2292
2432
|
* ```json
|
2293
2433
|
* {
|
2294
2434
|
* "filter": {
|
2295
|
-
*
|
2296
|
-
*
|
2297
|
-
*
|
2298
|
-
*
|
2435
|
+
* "<column_name>": {
|
2436
|
+
* "$ge": 0,
|
2437
|
+
* "$lt": 100
|
2438
|
+
* }
|
2299
2439
|
* }
|
2300
2440
|
* }
|
2301
2441
|
* ```
|
@@ -2313,7 +2453,6 @@ declare type QueryTableVariables = {
|
|
2313
2453
|
* ```
|
2314
2454
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
2315
2455
|
*
|
2316
|
-
*
|
2317
2456
|
* #### Negations
|
2318
2457
|
*
|
2319
2458
|
* A general `$not` operator can inverse any operation.
|
@@ -2338,15 +2477,21 @@ declare type QueryTableVariables = {
|
|
2338
2477
|
* {
|
2339
2478
|
* "filter": {
|
2340
2479
|
* "$not": {
|
2341
|
-
* "$any": [
|
2342
|
-
*
|
2343
|
-
*
|
2344
|
-
*
|
2345
|
-
*
|
2346
|
-
*
|
2347
|
-
*
|
2348
|
-
*
|
2349
|
-
*
|
2480
|
+
* "$any": [
|
2481
|
+
* {
|
2482
|
+
* "<column_name1>": "value1"
|
2483
|
+
* },
|
2484
|
+
* {
|
2485
|
+
* "$all": [
|
2486
|
+
* {
|
2487
|
+
* "<column_name2>": "value2"
|
2488
|
+
* },
|
2489
|
+
* {
|
2490
|
+
* "<column_name3>": "value3"
|
2491
|
+
* }
|
2492
|
+
* ]
|
2493
|
+
* }
|
2494
|
+
* ]
|
2350
2495
|
* }
|
2351
2496
|
* }
|
2352
2497
|
* }
|
@@ -2401,8 +2546,8 @@ declare type QueryTableVariables = {
|
|
2401
2546
|
* "<array name>": {
|
2402
2547
|
* "$includes": {
|
2403
2548
|
* "$all": [
|
2404
|
-
* {"$contains": "label"},
|
2405
|
-
* {"$not": {"$endsWith": "-debug"}}
|
2549
|
+
* { "$contains": "label" },
|
2550
|
+
* { "$not": { "$endsWith": "-debug" } }
|
2406
2551
|
* ]
|
2407
2552
|
* }
|
2408
2553
|
* }
|
@@ -2422,9 +2567,7 @@ declare type QueryTableVariables = {
|
|
2422
2567
|
* {
|
2423
2568
|
* "filter": {
|
2424
2569
|
* "settings.labels": {
|
2425
|
-
* "$includesAll": [
|
2426
|
-
* {"$contains": "label"},
|
2427
|
-
* ]
|
2570
|
+
* "$includesAll": [{ "$contains": "label" }]
|
2428
2571
|
* }
|
2429
2572
|
* }
|
2430
2573
|
* }
|
@@ -2472,7 +2615,6 @@ declare type QueryTableVariables = {
|
|
2472
2615
|
* }
|
2473
2616
|
* ```
|
2474
2617
|
*
|
2475
|
-
*
|
2476
2618
|
* ### Pagination
|
2477
2619
|
*
|
2478
2620
|
* We offer cursor pagination and offset pagination. The offset pagination is limited
|
@@ -2538,8 +2680,8 @@ declare type QueryTableVariables = {
|
|
2538
2680
|
* can be queried by update `page.after` to the returned cursor while keeping the
|
2539
2681
|
* `page.before` cursor from the first range query.
|
2540
2682
|
*
|
2541
|
-
* The `filter` , `columns`,
|
2542
|
-
* encoded with the cursor.
|
2683
|
+
* The `filter` , `columns`, `sort` , and `page.size` configuration will be
|
2684
|
+
* encoded with the cursor. The pagination request will be invalid if
|
2543
2685
|
* `filter` or `sort` is set. The columns returned and page size can be changed
|
2544
2686
|
* anytime by passing the `columns` or `page.size` settings to the next query.
|
2545
2687
|
*
|
@@ -2576,6 +2718,41 @@ declare type QueryTableVariables = {
|
|
2576
2718
|
* ```
|
2577
2719
|
*/
|
2578
2720
|
declare const queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2721
|
+
declare type SearchTablePathParams = {
|
2722
|
+
dbBranchName: DBBranchName;
|
2723
|
+
tableName: TableName;
|
2724
|
+
workspace: string;
|
2725
|
+
};
|
2726
|
+
declare type SearchTableError = ErrorWrapper<{
|
2727
|
+
status: 400;
|
2728
|
+
payload: BadRequestError;
|
2729
|
+
} | {
|
2730
|
+
status: 401;
|
2731
|
+
payload: AuthError;
|
2732
|
+
} | {
|
2733
|
+
status: 404;
|
2734
|
+
payload: SimpleError;
|
2735
|
+
}>;
|
2736
|
+
declare type SearchTableRequestBody = {
|
2737
|
+
query: string;
|
2738
|
+
fuzziness?: FuzzinessExpression;
|
2739
|
+
prefix?: PrefixExpression;
|
2740
|
+
filter?: FilterExpression;
|
2741
|
+
highlight?: HighlightExpression;
|
2742
|
+
boosters?: BoosterExpression[];
|
2743
|
+
};
|
2744
|
+
declare type SearchTableVariables = {
|
2745
|
+
body: SearchTableRequestBody;
|
2746
|
+
pathParams: SearchTablePathParams;
|
2747
|
+
} & FetcherExtraProps;
|
2748
|
+
/**
|
2749
|
+
* Run a free text search operation in a particular table.
|
2750
|
+
*
|
2751
|
+
* The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
|
2752
|
+
* * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
|
2753
|
+
* * filtering on columns of type `multiple` is currently unsupported
|
2754
|
+
*/
|
2755
|
+
declare const searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2579
2756
|
declare type SearchBranchPathParams = {
|
2580
2757
|
dbBranchName: DBBranchName;
|
2581
2758
|
workspace: string;
|
@@ -2591,9 +2768,14 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
2591
2768
|
payload: SimpleError;
|
2592
2769
|
}>;
|
2593
2770
|
declare type SearchBranchRequestBody = {
|
2594
|
-
tables?: string
|
2771
|
+
tables?: (string | {
|
2772
|
+
table: string;
|
2773
|
+
filter?: FilterExpression;
|
2774
|
+
boosters?: BoosterExpression[];
|
2775
|
+
})[];
|
2595
2776
|
query: string;
|
2596
|
-
fuzziness?:
|
2777
|
+
fuzziness?: FuzzinessExpression;
|
2778
|
+
highlight?: HighlightExpression;
|
2597
2779
|
};
|
2598
2780
|
declare type SearchBranchVariables = {
|
2599
2781
|
body: SearchBranchRequestBody;
|
@@ -2622,6 +2804,7 @@ declare const operationsByTag: {
|
|
2622
2804
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
2623
2805
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
2624
2806
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
2807
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
2625
2808
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2626
2809
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2627
2810
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
@@ -2638,7 +2821,7 @@ declare const operationsByTag: {
|
|
2638
2821
|
branch: {
|
2639
2822
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2640
2823
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2641
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
2824
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2642
2825
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2643
2826
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2644
2827
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
@@ -2648,7 +2831,7 @@ declare const operationsByTag: {
|
|
2648
2831
|
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
2649
2832
|
};
|
2650
2833
|
table: {
|
2651
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
2834
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2652
2835
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2653
2836
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2654
2837
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2660,14 +2843,15 @@ declare const operationsByTag: {
|
|
2660
2843
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2661
2844
|
};
|
2662
2845
|
records: {
|
2663
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
2846
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2664
2847
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2665
2848
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2666
2849
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2667
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
2850
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2668
2851
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2669
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
2852
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2670
2853
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2854
|
+
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2671
2855
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
2672
2856
|
};
|
2673
2857
|
};
|
@@ -2719,6 +2903,7 @@ declare class WorkspaceApi {
|
|
2719
2903
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
2720
2904
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
2721
2905
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
2906
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
2722
2907
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2723
2908
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2724
2909
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
@@ -2732,14 +2917,14 @@ declare class DatabaseApi {
|
|
2732
2917
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2733
2918
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2734
2919
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
2735
|
-
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch
|
2920
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
2736
2921
|
}
|
2737
2922
|
declare class BranchApi {
|
2738
2923
|
private extraProps;
|
2739
2924
|
constructor(extraProps: FetcherExtraProps);
|
2740
2925
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2741
2926
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2742
|
-
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<
|
2927
|
+
createBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, from?: string, options?: CreateBranchRequestBody): Promise<CreateBranchResponse>;
|
2743
2928
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2744
2929
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2745
2930
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
@@ -2751,7 +2936,7 @@ declare class BranchApi {
|
|
2751
2936
|
declare class TableApi {
|
2752
2937
|
private extraProps;
|
2753
2938
|
constructor(extraProps: FetcherExtraProps);
|
2754
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
2939
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2755
2940
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2756
2941
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2757
2942
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2765,14 +2950,15 @@ declare class TableApi {
|
|
2765
2950
|
declare class RecordsApi {
|
2766
2951
|
private extraProps;
|
2767
2952
|
constructor(extraProps: FetcherExtraProps);
|
2768
|
-
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any
|
2953
|
+
insertRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, record: Record<string, any>, options?: InsertRecordQueryParams): Promise<RecordUpdateResponse>;
|
2769
2954
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2770
2955
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2771
2956
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2772
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2773
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2774
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
2957
|
+
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: DeleteRecordQueryParams): Promise<RecordUpdateResponse>;
|
2958
|
+
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?: GetRecordQueryParams): Promise<XataRecord$1>;
|
2959
|
+
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[], options?: BulkInsertTableRecordsQueryParams): Promise<BulkInsertResponse>;
|
2775
2960
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2961
|
+
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2776
2962
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
2777
2963
|
}
|
2778
2964
|
|
@@ -2786,28 +2972,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2786
2972
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2787
2973
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2788
2974
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2789
|
-
declare type NonEmptyArray<T> = T[] & {
|
2790
|
-
0: T;
|
2791
|
-
};
|
2792
2975
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2793
2976
|
[P in K]-?: NonNullable<T[P]>;
|
2794
2977
|
};
|
2795
2978
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2796
2979
|
declare type SingleOrArray<T> = T | T[];
|
2797
|
-
declare type
|
2980
|
+
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
2981
|
+
declare type Without<T, U> = {
|
2982
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
2983
|
+
};
|
2984
|
+
declare type ExclusiveOr<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
2798
2985
|
|
2799
2986
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2800
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2801
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
2987
|
+
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
2988
|
+
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
2802
2989
|
}>>;
|
2803
|
-
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends
|
2804
|
-
V: ValueAtColumn<
|
2805
|
-
} : never
|
2990
|
+
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> ? {
|
2991
|
+
V: ValueAtColumn<Item, V>;
|
2992
|
+
} : never : O[K] : never> : never : never;
|
2806
2993
|
declare type MAX_RECURSION = 5;
|
2807
2994
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
2808
|
-
[K in DataProps<O>]:
|
2809
|
-
If<IsObject<
|
2810
|
-
K
|
2995
|
+
[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
|
2996
|
+
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
|
2997
|
+
K>> : never;
|
2811
2998
|
}>, never>;
|
2812
2999
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
2813
3000
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
@@ -2834,27 +3021,37 @@ interface BaseData {
|
|
2834
3021
|
/**
|
2835
3022
|
* Represents a persisted record from the database.
|
2836
3023
|
*/
|
2837
|
-
interface XataRecord extends Identifiable {
|
3024
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2838
3025
|
/**
|
2839
|
-
*
|
3026
|
+
* Get metadata of this record.
|
2840
3027
|
*/
|
2841
|
-
|
2842
|
-
/**
|
2843
|
-
* Number that is increased every time the record is updated.
|
2844
|
-
*/
|
2845
|
-
version: number;
|
2846
|
-
};
|
3028
|
+
getMetadata(): XataRecordMetadata;
|
2847
3029
|
/**
|
2848
3030
|
* Retrieves a refreshed copy of the current record from the database.
|
3031
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3032
|
+
* @returns The persisted record with the selected columns.
|
2849
3033
|
*/
|
2850
|
-
read(): Promise<Readonly<SelectedPick<
|
3034
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
3035
|
+
/**
|
3036
|
+
* Retrieves a refreshed copy of the current record from the database.
|
3037
|
+
* @returns The persisted record with all first level properties.
|
3038
|
+
*/
|
3039
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2851
3040
|
/**
|
2852
3041
|
* Performs a partial update of the current record. On success a new object is
|
2853
3042
|
* returned and the current object is not mutated.
|
2854
|
-
* @param
|
2855
|
-
* @
|
3043
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
3044
|
+
* @param columns The columns to retrieve. If not specified, all first level properties are retrieved.
|
3045
|
+
* @returns The persisted record with the selected columns.
|
3046
|
+
*/
|
3047
|
+
update<K extends SelectableColumn<OriginalRecord>>(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>, columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>>>;
|
3048
|
+
/**
|
3049
|
+
* Performs a partial update of the current record. On success a new object is
|
3050
|
+
* returned and the current object is not mutated.
|
3051
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
3052
|
+
* @returns The persisted record with all first level properties.
|
2856
3053
|
*/
|
2857
|
-
update(partialUpdate: Partial<EditableData<Omit<
|
3054
|
+
update(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>>>;
|
2858
3055
|
/**
|
2859
3056
|
* Performs a deletion of the current record in the database.
|
2860
3057
|
*
|
@@ -2866,23 +3063,36 @@ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update
|
|
2866
3063
|
/**
|
2867
3064
|
* Retrieves a refreshed copy of the current record from the database.
|
2868
3065
|
*/
|
2869
|
-
read(): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3066
|
+
read<K extends SelectableColumn<Record>>(columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>> | null>;
|
2870
3067
|
/**
|
2871
3068
|
* Performs a partial update of the current record. On success a new object is
|
2872
3069
|
* returned and the current object is not mutated.
|
2873
|
-
* @param
|
3070
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
2874
3071
|
* @returns A new record containing the latest values for all the columns of the current record.
|
2875
3072
|
*/
|
2876
|
-
update(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord
|
3073
|
+
update<K extends SelectableColumn<Record>>(partialUpdate: Partial<EditableData<Omit<Record, keyof XataRecord>>>, columns?: K[]): Promise<Readonly<SelectedPick<Record, typeof columns extends SelectableColumn<Record>[] ? typeof columns : ['*']>>>;
|
3074
|
+
/**
|
3075
|
+
* Performs a deletion of the current record in the database.
|
3076
|
+
*
|
3077
|
+
* @throws If the record was already deleted or if an error happened while performing the deletion.
|
3078
|
+
*/
|
3079
|
+
delete(): Promise<void>;
|
3080
|
+
};
|
3081
|
+
declare type XataRecordMetadata = {
|
3082
|
+
/**
|
3083
|
+
* Number that is increased every time the record is updated.
|
3084
|
+
*/
|
3085
|
+
version: number;
|
3086
|
+
warnings?: string[];
|
2877
3087
|
};
|
2878
3088
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2879
3089
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2880
3090
|
declare type EditableData<O extends BaseData> = {
|
2881
3091
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2882
3092
|
id: string;
|
2883
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
3093
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2884
3094
|
id: string;
|
2885
|
-
} | null | undefined : O[K];
|
3095
|
+
} | string | null | undefined : O[K];
|
2886
3096
|
};
|
2887
3097
|
|
2888
3098
|
/**
|
@@ -2958,8 +3168,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
2958
3168
|
],
|
2959
3169
|
}
|
2960
3170
|
*/
|
2961
|
-
declare type AggregatorFilter<
|
2962
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
3171
|
+
declare type AggregatorFilter<T> = {
|
3172
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
2963
3173
|
};
|
2964
3174
|
/**
|
2965
3175
|
* Existance filter
|
@@ -2974,10 +3184,88 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
2974
3184
|
* Injects the Api filters on nested properties
|
2975
3185
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
2976
3186
|
*/
|
2977
|
-
declare type NestedApiFilter<T> =
|
3187
|
+
declare type NestedApiFilter<T> = {
|
2978
3188
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
2979
|
-
}
|
2980
|
-
declare type Filter<
|
3189
|
+
};
|
3190
|
+
declare type Filter<T> = T extends Record<string, any> ? BaseApiFilter<T> | NestedApiFilter<T> : PropertyFilter<T>;
|
3191
|
+
|
3192
|
+
declare type DateBooster = {
|
3193
|
+
origin?: string;
|
3194
|
+
scale: string;
|
3195
|
+
decay: number;
|
3196
|
+
};
|
3197
|
+
declare type NumericBooster = {
|
3198
|
+
factor: number;
|
3199
|
+
};
|
3200
|
+
declare type ValueBooster<T extends string | number | boolean> = {
|
3201
|
+
value: T;
|
3202
|
+
factor: number;
|
3203
|
+
};
|
3204
|
+
declare type Boosters<O extends XataRecord> = Values<{
|
3205
|
+
[K in SelectableColumn<O>]: NonNullable<ValueAtColumn<O, K>> extends Date ? {
|
3206
|
+
dateBooster: {
|
3207
|
+
column: K;
|
3208
|
+
} & DateBooster;
|
3209
|
+
} : NonNullable<ValueAtColumn<O, K>> extends number ? ExclusiveOr<{
|
3210
|
+
numericBooster?: {
|
3211
|
+
column: K;
|
3212
|
+
} & NumericBooster;
|
3213
|
+
}, {
|
3214
|
+
valueBooster?: {
|
3215
|
+
column: K;
|
3216
|
+
} & ValueBooster<number>;
|
3217
|
+
}> : NonNullable<ValueAtColumn<O, K>> extends string | boolean ? {
|
3218
|
+
valueBooster: {
|
3219
|
+
column: K;
|
3220
|
+
} & ValueBooster<NonNullable<ValueAtColumn<O, K>>>;
|
3221
|
+
} : never;
|
3222
|
+
}>;
|
3223
|
+
|
3224
|
+
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3225
|
+
fuzziness?: FuzzinessExpression;
|
3226
|
+
prefix?: PrefixExpression;
|
3227
|
+
highlight?: HighlightExpression;
|
3228
|
+
tables?: Array<Tables | Values<{
|
3229
|
+
[Model in GetArrayInnerType<NonNullable<Tables[]>>]: {
|
3230
|
+
table: Model;
|
3231
|
+
filter?: Filter<SelectedPick<Schemas[Model] & XataRecord, ['*']>>;
|
3232
|
+
boosters?: Boosters<Schemas[Model] & XataRecord>[];
|
3233
|
+
};
|
3234
|
+
}>>;
|
3235
|
+
};
|
3236
|
+
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3237
|
+
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3238
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]: {
|
3239
|
+
table: Model;
|
3240
|
+
record: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>>;
|
3241
|
+
};
|
3242
|
+
}>[]>;
|
3243
|
+
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3244
|
+
[Model in ExtractTables<Schemas, Tables, GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>>]?: Awaited<SearchXataRecord<SelectedPick<Schemas[Model] & XataRecord, ['*']>>[]>;
|
3245
|
+
}>;
|
3246
|
+
};
|
3247
|
+
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3248
|
+
#private;
|
3249
|
+
private db;
|
3250
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3251
|
+
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3252
|
+
}
|
3253
|
+
declare type SearchXataRecord<Record extends XataRecord> = Omit<Record, 'getMetadata'> & {
|
3254
|
+
getMetadata: () => XataRecordMetadata & SearchExtraProperties;
|
3255
|
+
};
|
3256
|
+
declare type SearchExtraProperties = {
|
3257
|
+
table: string;
|
3258
|
+
highlight?: {
|
3259
|
+
[key: string]: string[] | {
|
3260
|
+
[key: string]: any;
|
3261
|
+
};
|
3262
|
+
};
|
3263
|
+
score?: number;
|
3264
|
+
};
|
3265
|
+
declare type ReturnTable<Table, Tables> = Table extends Tables ? Table : never;
|
3266
|
+
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 {
|
3267
|
+
table: infer Table;
|
3268
|
+
} ? ReturnTable<Table, Tables> : never;
|
2981
3269
|
|
2982
3270
|
declare type SortDirection = 'asc' | 'desc';
|
2983
3271
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -2989,13 +3277,21 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
2989
3277
|
[Key in StringKeys<T>]: SortDirection;
|
2990
3278
|
};
|
2991
3279
|
|
2992
|
-
declare type
|
2993
|
-
|
2994
|
-
|
3280
|
+
declare type BaseOptions<T extends XataRecord> = {
|
3281
|
+
columns?: SelectableColumn<T>[];
|
3282
|
+
cache?: number;
|
3283
|
+
};
|
3284
|
+
declare type CursorQueryOptions = {
|
3285
|
+
pagination?: CursorNavigationOptions & OffsetNavigationOptions;
|
3286
|
+
filter?: never;
|
3287
|
+
sort?: never;
|
3288
|
+
};
|
3289
|
+
declare type OffsetQueryOptions<T extends XataRecord> = {
|
3290
|
+
pagination?: OffsetNavigationOptions;
|
2995
3291
|
filter?: FilterExpression;
|
2996
3292
|
sort?: SortFilter<T> | SortFilter<T>[];
|
2997
|
-
cache?: number;
|
2998
3293
|
};
|
3294
|
+
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
2999
3295
|
/**
|
3000
3296
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
3001
3297
|
*
|
@@ -3005,8 +3301,8 @@ declare type QueryOptions<T extends XataRecord> = {
|
|
3005
3301
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
3006
3302
|
#private;
|
3007
3303
|
readonly meta: PaginationQueryMeta;
|
3008
|
-
readonly records: Result
|
3009
|
-
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>,
|
3304
|
+
readonly records: RecordArray<Result>;
|
3305
|
+
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3010
3306
|
getQueryOptions(): QueryOptions<Record>;
|
3011
3307
|
key(): string;
|
3012
3308
|
/**
|
@@ -3038,18 +3334,28 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3038
3334
|
*
|
3039
3335
|
* ```
|
3040
3336
|
* query.filter("columnName", columnValue)
|
3041
|
-
* query.filter(
|
3042
|
-
*
|
3043
|
-
*
|
3337
|
+
* query.filter("columnName", operator(columnValue)) // Use gt, gte, lt, lte, startsWith,...
|
3338
|
+
* ```
|
3339
|
+
*
|
3340
|
+
* @param column The name of the column to filter.
|
3341
|
+
* @param value The value to filter.
|
3342
|
+
* @returns A new Query object.
|
3343
|
+
*/
|
3344
|
+
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
3345
|
+
/**
|
3346
|
+
* Builds a new query object adding one or more constraints. Examples:
|
3347
|
+
*
|
3348
|
+
* ```
|
3349
|
+
* query.filter({ "columnName": columnValue })
|
3044
3350
|
* query.filter({
|
3045
3351
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
3046
3352
|
* })
|
3047
3353
|
* ```
|
3048
3354
|
*
|
3355
|
+
* @param filters A filter object
|
3049
3356
|
* @returns A new Query object.
|
3050
3357
|
*/
|
3051
3358
|
filter(filters: Filter<Record>): Query<Record, Result>;
|
3052
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
3053
3359
|
/**
|
3054
3360
|
* Builds a new query with a new sort option.
|
3055
3361
|
* @param column The column name.
|
@@ -3062,57 +3368,149 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3062
3368
|
* @param columns Array of column names to be returned by the query.
|
3063
3369
|
* @returns A new Query object.
|
3064
3370
|
*/
|
3065
|
-
select<K extends SelectableColumn<Record>>(columns:
|
3371
|
+
select<K extends SelectableColumn<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
3372
|
+
/**
|
3373
|
+
* Get paginated results
|
3374
|
+
*
|
3375
|
+
* @returns A page of results
|
3376
|
+
*/
|
3066
3377
|
getPaginated(): Promise<Page<Record, Result>>;
|
3067
|
-
|
3378
|
+
/**
|
3379
|
+
* Get paginated results
|
3380
|
+
*
|
3381
|
+
* @param options Pagination options
|
3382
|
+
* @returns A page of results
|
3383
|
+
*/
|
3384
|
+
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
3385
|
+
/**
|
3386
|
+
* Get paginated results
|
3387
|
+
*
|
3388
|
+
* @param options Pagination options
|
3389
|
+
* @returns A page of results
|
3390
|
+
*/
|
3068
3391
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
3392
|
+
/**
|
3393
|
+
* Get results in an iterator
|
3394
|
+
*
|
3395
|
+
* @async
|
3396
|
+
* @returns Async interable of results
|
3397
|
+
*/
|
3069
3398
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
3399
|
+
/**
|
3400
|
+
* Build an iterator of results
|
3401
|
+
*
|
3402
|
+
* @returns Async generator of results array
|
3403
|
+
*/
|
3070
3404
|
getIterator(): AsyncGenerator<Result[]>;
|
3071
|
-
|
3405
|
+
/**
|
3406
|
+
* Build an iterator of results
|
3407
|
+
*
|
3408
|
+
* @param options Pagination options with batchSize
|
3409
|
+
* @returns Async generator of results array
|
3410
|
+
*/
|
3411
|
+
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3072
3412
|
batchSize?: number;
|
3073
3413
|
}): AsyncGenerator<Result[]>;
|
3074
|
-
|
3414
|
+
/**
|
3415
|
+
* Build an iterator of results
|
3416
|
+
*
|
3417
|
+
* @param options Pagination options with batchSize
|
3418
|
+
* @returns Async generator of results array
|
3419
|
+
*/
|
3420
|
+
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3075
3421
|
batchSize?: number;
|
3076
3422
|
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
3423
|
+
/**
|
3424
|
+
* Performs the query in the database and returns a set of results.
|
3425
|
+
* @returns An array of records from the database.
|
3426
|
+
*/
|
3427
|
+
getMany(): Promise<RecordArray<Result>>;
|
3077
3428
|
/**
|
3078
3429
|
* Performs the query in the database and returns a set of results.
|
3079
3430
|
* @param options Additional options to be used when performing the query.
|
3080
3431
|
* @returns An array of records from the database.
|
3081
3432
|
*/
|
3082
|
-
getMany(): Promise<
|
3083
|
-
|
3084
|
-
|
3433
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
3434
|
+
/**
|
3435
|
+
* Performs the query in the database and returns a set of results.
|
3436
|
+
* @param options Additional options to be used when performing the query.
|
3437
|
+
* @returns An array of records from the database.
|
3438
|
+
*/
|
3439
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
3085
3440
|
/**
|
3086
3441
|
* Performs the query in the database and returns all the results.
|
3087
3442
|
* Warning: If there are a large number of results, this method can have performance implications.
|
3088
|
-
* @param options Additional options to be used when performing the query.
|
3089
3443
|
* @returns An array of records from the database.
|
3090
3444
|
*/
|
3091
3445
|
getAll(): Promise<Result[]>;
|
3092
|
-
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
3446
|
+
/**
|
3447
|
+
* Performs the query in the database and returns all the results.
|
3448
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
3449
|
+
* @param options Additional options to be used when performing the query.
|
3450
|
+
* @returns An array of records from the database.
|
3451
|
+
*/
|
3452
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3096
3453
|
batchSize?: number;
|
3097
3454
|
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
3098
3455
|
/**
|
3099
|
-
* Performs the query in the database and returns the
|
3456
|
+
* Performs the query in the database and returns all the results.
|
3457
|
+
* Warning: If there are a large number of results, this method can have performance implications.
|
3100
3458
|
* @param options Additional options to be used when performing the query.
|
3459
|
+
* @returns An array of records from the database.
|
3460
|
+
*/
|
3461
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3462
|
+
batchSize?: number;
|
3463
|
+
}): Promise<Result[]>;
|
3464
|
+
/**
|
3465
|
+
* Performs the query in the database and returns the first result.
|
3101
3466
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3102
3467
|
*/
|
3103
3468
|
getFirst(): Promise<Result | null>;
|
3104
|
-
|
3105
|
-
|
3469
|
+
/**
|
3470
|
+
* Performs the query in the database and returns the first result.
|
3471
|
+
* @param options Additional options to be used when performing the query.
|
3472
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
3473
|
+
*/
|
3474
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
3475
|
+
/**
|
3476
|
+
* Performs the query in the database and returns the first result.
|
3477
|
+
* @param options Additional options to be used when performing the query.
|
3478
|
+
* @returns The first record that matches the query, or null if no record matched the query.
|
3479
|
+
*/
|
3480
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
3106
3481
|
/**
|
3107
3482
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3108
3483
|
* @param ttl The cache TTL in milliseconds.
|
3109
3484
|
* @returns A new Query object.
|
3110
3485
|
*/
|
3111
3486
|
cache(ttl: number): Query<Record, Result>;
|
3487
|
+
/**
|
3488
|
+
* Retrieve next page of records
|
3489
|
+
*
|
3490
|
+
* @returns A new page object.
|
3491
|
+
*/
|
3112
3492
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3493
|
+
/**
|
3494
|
+
* Retrieve previous page of records
|
3495
|
+
*
|
3496
|
+
* @returns A new page object
|
3497
|
+
*/
|
3113
3498
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3499
|
+
/**
|
3500
|
+
* Retrieve first page of records
|
3501
|
+
*
|
3502
|
+
* @returns A new page object
|
3503
|
+
*/
|
3114
3504
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3505
|
+
/**
|
3506
|
+
* Retrieve last page of records
|
3507
|
+
*
|
3508
|
+
* @returns A new page object
|
3509
|
+
*/
|
3115
3510
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3511
|
+
/**
|
3512
|
+
* @returns Boolean indicating if there is a next page
|
3513
|
+
*/
|
3116
3514
|
hasNextPage(): boolean;
|
3117
3515
|
}
|
3118
3516
|
|
@@ -3124,7 +3522,7 @@ declare type PaginationQueryMeta = {
|
|
3124
3522
|
};
|
3125
3523
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
3126
3524
|
meta: PaginationQueryMeta;
|
3127
|
-
records: Result
|
3525
|
+
records: RecordArray<Result>;
|
3128
3526
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3129
3527
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3130
3528
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
@@ -3144,7 +3542,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
3144
3542
|
/**
|
3145
3543
|
* The set of results for this page.
|
3146
3544
|
*/
|
3147
|
-
readonly records: Result
|
3545
|
+
readonly records: RecordArray<Result>;
|
3148
3546
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
3149
3547
|
/**
|
3150
3548
|
* Retrieves the next page of results.
|
@@ -3192,44 +3590,154 @@ declare type OffsetNavigationOptions = {
|
|
3192
3590
|
size?: number;
|
3193
3591
|
offset?: number;
|
3194
3592
|
};
|
3195
|
-
declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
|
3196
3593
|
declare const PAGINATION_MAX_SIZE = 200;
|
3197
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
3594
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
3198
3595
|
declare const PAGINATION_MAX_OFFSET = 800;
|
3199
3596
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
3597
|
+
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
3598
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
3599
|
+
#private;
|
3600
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
3601
|
+
static parseConstructorParams(...args: any[]): any[];
|
3602
|
+
toArray(): Result[];
|
3603
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
3604
|
+
/**
|
3605
|
+
* Retrieve next page of records
|
3606
|
+
*
|
3607
|
+
* @returns A new array of objects
|
3608
|
+
*/
|
3609
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3610
|
+
/**
|
3611
|
+
* Retrieve previous page of records
|
3612
|
+
*
|
3613
|
+
* @returns A new array of objects
|
3614
|
+
*/
|
3615
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3616
|
+
/**
|
3617
|
+
* Retrieve first page of records
|
3618
|
+
*
|
3619
|
+
* @returns A new array of objects
|
3620
|
+
*/
|
3621
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3622
|
+
/**
|
3623
|
+
* Retrieve last page of records
|
3624
|
+
*
|
3625
|
+
* @returns A new array of objects
|
3626
|
+
*/
|
3627
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3628
|
+
/**
|
3629
|
+
* @returns Boolean indicating if there is a next page
|
3630
|
+
*/
|
3631
|
+
hasNextPage(): boolean;
|
3632
|
+
}
|
3200
3633
|
|
3201
|
-
declare type TableLink = string[];
|
3202
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
3203
3634
|
/**
|
3204
3635
|
* Common interface for performing operations on a table.
|
3205
3636
|
*/
|
3206
3637
|
declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
3207
|
-
abstract create(object: EditableData<Data> & Partial<Identifiable
|
3638
|
+
abstract create<K extends SelectableColumn<Record>>(object: Omit<EditableData<Data>, 'id'> & Partial<Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3639
|
+
abstract create(object: Omit<EditableData<Data>, 'id'> & Partial<Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3208
3640
|
/**
|
3209
3641
|
* Creates a single record in the table with a unique id.
|
3210
3642
|
* @param id The unique id.
|
3211
3643
|
* @param object Object containing the column names with their values to be stored in the table.
|
3644
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3212
3645
|
* @returns The full persisted record.
|
3213
3646
|
*/
|
3214
|
-
abstract create(id: string, object: EditableData<Data
|
3647
|
+
abstract create<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3648
|
+
/**
|
3649
|
+
* Creates a single record in the table with a unique id.
|
3650
|
+
* @param id The unique id.
|
3651
|
+
* @param object Object containing the column names with their values to be stored in the table.
|
3652
|
+
* @returns The full persisted record.
|
3653
|
+
*/
|
3654
|
+
abstract create(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3215
3655
|
/**
|
3216
3656
|
* Creates multiple records in the table.
|
3217
3657
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3218
|
-
* @
|
3658
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3659
|
+
* @returns Array of the persisted records in order.
|
3219
3660
|
*/
|
3220
|
-
abstract create(objects: Array<EditableData<Data> & Partial<Identifiable
|
3661
|
+
abstract create<K extends SelectableColumn<Record>>(objects: Array<Omit<EditableData<Data>, 'id'> & Partial<Identifiable>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3662
|
+
/**
|
3663
|
+
* Creates multiple records in the table.
|
3664
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3665
|
+
* @returns Array of the persisted records in order.
|
3666
|
+
*/
|
3667
|
+
abstract create(objects: Array<Omit<EditableData<Data>, 'id'> & Partial<Identifiable>>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3668
|
+
/**
|
3669
|
+
* Queries a single record from the table given its unique id.
|
3670
|
+
* @param id The unique id.
|
3671
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3672
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3673
|
+
*/
|
3674
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3221
3675
|
/**
|
3222
3676
|
* Queries a single record from the table given its unique id.
|
3223
3677
|
* @param id The unique id.
|
3224
3678
|
* @returns The persisted record for the given id or null if the record could not be found.
|
3225
3679
|
*/
|
3226
3680
|
abstract read(id: string): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
3681
|
+
/**
|
3682
|
+
* Queries multiple records from the table given their unique id.
|
3683
|
+
* @param ids The unique ids array.
|
3684
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3685
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3686
|
+
*/
|
3687
|
+
abstract read<K extends SelectableColumn<Record>>(ids: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
3688
|
+
/**
|
3689
|
+
* Queries multiple records from the table given their unique id.
|
3690
|
+
* @param ids The unique ids array.
|
3691
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3692
|
+
*/
|
3693
|
+
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3694
|
+
/**
|
3695
|
+
* Queries a single record from the table by the id in the object.
|
3696
|
+
* @param object Object containing the id of the record.
|
3697
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3698
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3699
|
+
*/
|
3700
|
+
abstract read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3701
|
+
/**
|
3702
|
+
* Queries a single record from the table by the id in the object.
|
3703
|
+
* @param object Object containing the id of the record.
|
3704
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3705
|
+
*/
|
3706
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
3707
|
+
/**
|
3708
|
+
* Queries multiple records from the table by the ids in the objects.
|
3709
|
+
* @param objects Array of objects containing the ids of the records.
|
3710
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3711
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3712
|
+
*/
|
3713
|
+
abstract read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>> | null>>;
|
3714
|
+
/**
|
3715
|
+
* Queries multiple records from the table by the ids in the objects.
|
3716
|
+
* @param objects Array of objects containing the ids of the records.
|
3717
|
+
* @returns The persisted records for the given ids in order (if a record could not be found null is returned).
|
3718
|
+
*/
|
3719
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>> | null>>;
|
3720
|
+
/**
|
3721
|
+
* Partially update a single record.
|
3722
|
+
* @param object An object with its id and the columns to be updated.
|
3723
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3724
|
+
* @returns The full persisted record.
|
3725
|
+
*/
|
3726
|
+
abstract update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3227
3727
|
/**
|
3228
3728
|
* Partially update a single record.
|
3229
3729
|
* @param object An object with its id and the columns to be updated.
|
3230
3730
|
* @returns The full persisted record.
|
3231
3731
|
*/
|
3232
3732
|
abstract update(object: Partial<EditableData<Data>> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3733
|
+
/**
|
3734
|
+
* Partially update a single record given its unique id.
|
3735
|
+
* @param id The unique id.
|
3736
|
+
* @param object The column names and their values that have to be updated.
|
3737
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3738
|
+
* @returns The full persisted record.
|
3739
|
+
*/
|
3740
|
+
abstract update<K extends SelectableColumn<Record>>(id: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3233
3741
|
/**
|
3234
3742
|
* Partially update a single record given its unique id.
|
3235
3743
|
* @param id The unique id.
|
@@ -3240,9 +3748,24 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3240
3748
|
/**
|
3241
3749
|
* Partially updates multiple records.
|
3242
3750
|
* @param objects An array of objects with their ids and columns to be updated.
|
3243
|
-
* @
|
3751
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3752
|
+
* @returns Array of the persisted records in order.
|
3753
|
+
*/
|
3754
|
+
abstract update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3755
|
+
/**
|
3756
|
+
* Partially updates multiple records.
|
3757
|
+
* @param objects An array of objects with their ids and columns to be updated.
|
3758
|
+
* @returns Array of the persisted records in order.
|
3244
3759
|
*/
|
3245
3760
|
abstract update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3761
|
+
/**
|
3762
|
+
* Creates or updates a single record. If a record exists with the given id,
|
3763
|
+
* it will be update, otherwise a new record will be created.
|
3764
|
+
* @param object Object containing the column names with their values to be persisted in the table.
|
3765
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3766
|
+
* @returns The full persisted record.
|
3767
|
+
*/
|
3768
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data> & Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3246
3769
|
/**
|
3247
3770
|
* Creates or updates a single record. If a record exists with the given id,
|
3248
3771
|
* it will be update, otherwise a new record will be created.
|
@@ -3255,9 +3778,26 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3255
3778
|
* it will be update, otherwise a new record will be created.
|
3256
3779
|
* @param id A unique id.
|
3257
3780
|
* @param object The column names and the values to be persisted.
|
3781
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3258
3782
|
* @returns The full persisted record.
|
3259
3783
|
*/
|
3260
|
-
abstract createOrUpdate(id: string, object: EditableData<Data
|
3784
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3785
|
+
/**
|
3786
|
+
* Creates or updates a single record. If a record exists with the given id,
|
3787
|
+
* it will be update, otherwise a new record will be created.
|
3788
|
+
* @param id A unique id.
|
3789
|
+
* @param object The column names and the values to be persisted.
|
3790
|
+
* @returns The full persisted record.
|
3791
|
+
*/
|
3792
|
+
abstract createOrUpdate(id: string, object: Omit<EditableData<Data>, 'id'>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3793
|
+
/**
|
3794
|
+
* Creates or updates a single record. If a record exists with the given id,
|
3795
|
+
* it will be update, otherwise a new record will be created.
|
3796
|
+
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3797
|
+
* @param columns Array of columns to be returned. If not specified, first level columns will be returned.
|
3798
|
+
* @returns Array of the persisted records.
|
3799
|
+
*/
|
3800
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(objects: Array<EditableData<Data> & Identifiable>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3261
3801
|
/**
|
3262
3802
|
* Creates or updates a single record. If a record exists with the given id,
|
3263
3803
|
* it will be update, otherwise a new record will be created.
|
@@ -3296,8 +3836,12 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3296
3836
|
* @returns The found records.
|
3297
3837
|
*/
|
3298
3838
|
abstract search(query: string, options?: {
|
3299
|
-
fuzziness?:
|
3300
|
-
|
3839
|
+
fuzziness?: FuzzinessExpression;
|
3840
|
+
prefix?: PrefixExpression;
|
3841
|
+
highlight?: HighlightExpression;
|
3842
|
+
filter?: Filter<Record>;
|
3843
|
+
boosters?: Boosters<Record>[];
|
3844
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3301
3845
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3302
3846
|
}
|
3303
3847
|
declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
|
@@ -3305,27 +3849,100 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
3305
3849
|
db: SchemaPluginResult<any>;
|
3306
3850
|
constructor(options: {
|
3307
3851
|
table: string;
|
3308
|
-
links?: LinkDictionary;
|
3309
3852
|
db: SchemaPluginResult<any>;
|
3310
3853
|
pluginOptions: XataPluginOptions;
|
3854
|
+
schemaTables?: Table[];
|
3311
3855
|
});
|
3312
|
-
create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
3313
|
-
create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
3314
|
-
create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']
|
3315
|
-
|
3856
|
+
create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3857
|
+
create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3858
|
+
create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3859
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3860
|
+
create<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3861
|
+
create<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3862
|
+
read(recordId: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3863
|
+
read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3864
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3865
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3866
|
+
read<K extends SelectableColumn<Record>>(recordId: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3867
|
+
read<K extends SelectableColumn<Record>>(recordIds: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3868
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3869
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3316
3870
|
update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
|
3317
3871
|
update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
|
3318
3872
|
update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
|
3873
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3874
|
+
update<K extends SelectableColumn<Record>>(recordId: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3875
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
|
3319
3876
|
createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
3320
3877
|
createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
3321
3878
|
createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
|
3879
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3880
|
+
createOrUpdate<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3881
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
|
3322
3882
|
delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
|
3323
3883
|
search(query: string, options?: {
|
3324
|
-
fuzziness?:
|
3325
|
-
|
3884
|
+
fuzziness?: FuzzinessExpression;
|
3885
|
+
prefix?: PrefixExpression;
|
3886
|
+
highlight?: HighlightExpression;
|
3887
|
+
filter?: Filter<Record>;
|
3888
|
+
boosters?: Boosters<Record>[];
|
3889
|
+
}): Promise<any>;
|
3326
3890
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3327
3891
|
}
|
3328
3892
|
|
3893
|
+
declare type BaseSchema = {
|
3894
|
+
name: string;
|
3895
|
+
columns: readonly ({
|
3896
|
+
name: string;
|
3897
|
+
type: Column['type'];
|
3898
|
+
} | {
|
3899
|
+
name: string;
|
3900
|
+
type: 'link';
|
3901
|
+
link: {
|
3902
|
+
table: string;
|
3903
|
+
};
|
3904
|
+
} | {
|
3905
|
+
name: string;
|
3906
|
+
type: 'object';
|
3907
|
+
columns: {
|
3908
|
+
name: string;
|
3909
|
+
type: string;
|
3910
|
+
}[];
|
3911
|
+
})[];
|
3912
|
+
};
|
3913
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
3914
|
+
name: string;
|
3915
|
+
columns: readonly unknown[];
|
3916
|
+
} ? {
|
3917
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
3918
|
+
} : never : never;
|
3919
|
+
declare type TableType<Tables, TableName> = Tables & {
|
3920
|
+
name: TableName;
|
3921
|
+
} extends infer Table ? Table extends {
|
3922
|
+
name: string;
|
3923
|
+
columns: infer Columns;
|
3924
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3925
|
+
name: string;
|
3926
|
+
type: string;
|
3927
|
+
} ? Identifiable & {
|
3928
|
+
[K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
|
3929
|
+
} : never : never : never : never;
|
3930
|
+
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
3931
|
+
name: PropertyName;
|
3932
|
+
} extends infer Property ? Property extends {
|
3933
|
+
name: string;
|
3934
|
+
type: infer Type;
|
3935
|
+
link?: {
|
3936
|
+
table: infer LinkedTable;
|
3937
|
+
};
|
3938
|
+
columns?: infer ObjectColumns;
|
3939
|
+
} ? (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 {
|
3940
|
+
name: string;
|
3941
|
+
type: string;
|
3942
|
+
} ? {
|
3943
|
+
[K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
|
3944
|
+
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
|
3945
|
+
|
3329
3946
|
/**
|
3330
3947
|
* Operator to restrict results to only values that are greater than the given value.
|
3331
3948
|
*/
|
@@ -3401,7 +4018,6 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3401
4018
|
|
3402
4019
|
declare type SchemaDefinition = {
|
3403
4020
|
table: string;
|
3404
|
-
links?: LinkDictionary;
|
3405
4021
|
};
|
3406
4022
|
declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
3407
4023
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
@@ -3410,40 +4026,10 @@ declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3410
4026
|
};
|
3411
4027
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3412
4028
|
#private;
|
3413
|
-
|
3414
|
-
private tableNames?;
|
3415
|
-
constructor(links?: LinkDictionary | undefined, tableNames?: string[] | undefined);
|
4029
|
+
constructor(schemaTables?: Schemas.Table[]);
|
3416
4030
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3417
4031
|
}
|
3418
4032
|
|
3419
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3420
|
-
fuzziness?: number;
|
3421
|
-
tables?: Tables[];
|
3422
|
-
};
|
3423
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3424
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3425
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
|
3426
|
-
table: Model;
|
3427
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3428
|
-
};
|
3429
|
-
}>[]>;
|
3430
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3431
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3432
|
-
}>;
|
3433
|
-
};
|
3434
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3435
|
-
#private;
|
3436
|
-
private db;
|
3437
|
-
private links;
|
3438
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
3439
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3440
|
-
}
|
3441
|
-
declare type SearchXataRecord = XataRecord & {
|
3442
|
-
xata: {
|
3443
|
-
table: string;
|
3444
|
-
};
|
3445
|
-
};
|
3446
|
-
|
3447
4033
|
declare type BranchStrategyValue = string | undefined | null;
|
3448
4034
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3449
4035
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3458,15 +4044,15 @@ declare type BaseClientOptions = {
|
|
3458
4044
|
};
|
3459
4045
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3460
4046
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3461
|
-
new <
|
3462
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
3463
|
-
search: Awaited<ReturnType<SearchPlugin<
|
4047
|
+
new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
|
4048
|
+
db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
4049
|
+
search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
3464
4050
|
}, keyof Plugins> & {
|
3465
4051
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
3466
4052
|
};
|
3467
4053
|
}
|
3468
4054
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3469
|
-
declare class BaseClient extends BaseClient_base<
|
4055
|
+
declare class BaseClient extends BaseClient_base<[]> {
|
3470
4056
|
}
|
3471
4057
|
|
3472
4058
|
declare type BranchResolutionOptions = {
|
@@ -3485,4 +4071,4 @@ declare class XataError extends Error {
|
|
3485
4071
|
constructor(message: string, status: number);
|
3486
4072
|
}
|
3487
4073
|
|
3488
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams,
|
4074
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsQueryParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchResponse, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, 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, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, 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, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SearchXataRecord, 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, UpdateWorkspaceMemberInviteError, UpdateWorkspaceMemberInvitePathParams, UpdateWorkspaceMemberInviteRequestBody, UpdateWorkspaceMemberInviteVariables, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|