@xata.io/client 0.0.0-alpha.vfde9dcf → 0.0.0-alpha.vfef462e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +120 -0
- package/README.md +271 -1
- package/Usage.md +428 -0
- package/dist/index.cjs +423 -282
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +685 -150
- package/dist/index.mjs +404 -283
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
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>>;
|
@@ -279,6 +279,10 @@ declare type SortOrder = 'asc' | 'desc';
|
|
279
279
|
* @minimum 0
|
280
280
|
*/
|
281
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';
|
282
286
|
/**
|
283
287
|
* @minProperties 1
|
284
288
|
*/
|
@@ -292,6 +296,48 @@ declare type FilterExpression = {
|
|
292
296
|
} & {
|
293
297
|
[key: string]: FilterColumn;
|
294
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
|
+
};
|
295
341
|
declare type FilterList = FilterExpression | FilterExpression[];
|
296
342
|
declare type FilterColumn = FilterColumnIncludes | FilterPredicate | FilterList;
|
297
343
|
/**
|
@@ -348,7 +394,24 @@ declare type PageConfig = {
|
|
348
394
|
size?: number;
|
349
395
|
offset?: number;
|
350
396
|
};
|
351
|
-
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
|
+
};
|
352
415
|
/**
|
353
416
|
* @pattern [a-zA-Z0-9_-~:]+
|
354
417
|
*/
|
@@ -370,16 +433,9 @@ declare type RecordsMetadata = {
|
|
370
433
|
};
|
371
434
|
};
|
372
435
|
/**
|
373
|
-
* Xata Table Record
|
436
|
+
* Xata Table Record Metadata
|
374
437
|
*/
|
375
|
-
declare type XataRecord$1 = {
|
376
|
-
id: RecordID;
|
377
|
-
xata: {
|
378
|
-
version: number;
|
379
|
-
table?: string;
|
380
|
-
warnings?: string[];
|
381
|
-
};
|
382
|
-
} & {
|
438
|
+
declare type XataRecord$1 = RecordMeta & {
|
383
439
|
[key: string]: any;
|
384
440
|
};
|
385
441
|
|
@@ -421,7 +477,10 @@ type schemas_ColumnMigration = ColumnMigration;
|
|
421
477
|
type schemas_SortExpression = SortExpression;
|
422
478
|
type schemas_SortOrder = SortOrder;
|
423
479
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
480
|
+
type schemas_PrefixExpression = PrefixExpression;
|
424
481
|
type schemas_FilterExpression = FilterExpression;
|
482
|
+
type schemas_HighlightExpression = HighlightExpression;
|
483
|
+
type schemas_BoosterExpression = BoosterExpression;
|
425
484
|
type schemas_FilterList = FilterList;
|
426
485
|
type schemas_FilterColumn = FilterColumn;
|
427
486
|
type schemas_FilterColumnIncludes = FilterColumnIncludes;
|
@@ -431,7 +490,8 @@ type schemas_FilterPredicateRangeOp = FilterPredicateRangeOp;
|
|
431
490
|
type schemas_FilterRangeValue = FilterRangeValue;
|
432
491
|
type schemas_FilterValue = FilterValue;
|
433
492
|
type schemas_PageConfig = PageConfig;
|
434
|
-
type
|
493
|
+
type schemas_ColumnsProjection = ColumnsProjection;
|
494
|
+
type schemas_RecordMeta = RecordMeta;
|
435
495
|
type schemas_RecordID = RecordID;
|
436
496
|
type schemas_TableRename = TableRename;
|
437
497
|
type schemas_RecordsMetadata = RecordsMetadata;
|
@@ -475,7 +535,13 @@ declare namespace schemas {
|
|
475
535
|
schemas_SortExpression as SortExpression,
|
476
536
|
schemas_SortOrder as SortOrder,
|
477
537
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
538
|
+
schemas_PrefixExpression as PrefixExpression,
|
478
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,
|
479
545
|
schemas_FilterList as FilterList,
|
480
546
|
schemas_FilterColumn as FilterColumn,
|
481
547
|
schemas_FilterColumnIncludes as FilterColumnIncludes,
|
@@ -485,7 +551,8 @@ declare namespace schemas {
|
|
485
551
|
schemas_FilterRangeValue as FilterRangeValue,
|
486
552
|
schemas_FilterValue as FilterValue,
|
487
553
|
schemas_PageConfig as PageConfig,
|
488
|
-
|
554
|
+
schemas_ColumnsProjection as ColumnsProjection,
|
555
|
+
schemas_RecordMeta as RecordMeta,
|
489
556
|
schemas_RecordID as RecordID,
|
490
557
|
schemas_TableRename as TableRename,
|
491
558
|
schemas_RecordsMetadata as RecordsMetadata,
|
@@ -520,11 +587,17 @@ declare type BulkError = {
|
|
520
587
|
status?: number;
|
521
588
|
}[];
|
522
589
|
};
|
590
|
+
declare type BulkInsertResponse = {
|
591
|
+
recordIDs: string[];
|
592
|
+
} | {
|
593
|
+
records: XataRecord$1[];
|
594
|
+
};
|
523
595
|
declare type BranchMigrationPlan = {
|
524
596
|
version: number;
|
525
597
|
migration: BranchMigration;
|
526
598
|
};
|
527
|
-
declare type
|
599
|
+
declare type RecordResponse = XataRecord$1;
|
600
|
+
declare type RecordUpdateResponse = XataRecord$1 | {
|
528
601
|
id: string;
|
529
602
|
xata: {
|
530
603
|
version: number;
|
@@ -548,7 +621,9 @@ type responses_SimpleError = SimpleError;
|
|
548
621
|
type responses_BadRequestError = BadRequestError;
|
549
622
|
type responses_AuthError = AuthError;
|
550
623
|
type responses_BulkError = BulkError;
|
624
|
+
type responses_BulkInsertResponse = BulkInsertResponse;
|
551
625
|
type responses_BranchMigrationPlan = BranchMigrationPlan;
|
626
|
+
type responses_RecordResponse = RecordResponse;
|
552
627
|
type responses_RecordUpdateResponse = RecordUpdateResponse;
|
553
628
|
type responses_QueryResponse = QueryResponse;
|
554
629
|
type responses_SearchResponse = SearchResponse;
|
@@ -559,7 +634,9 @@ declare namespace responses {
|
|
559
634
|
responses_BadRequestError as BadRequestError,
|
560
635
|
responses_AuthError as AuthError,
|
561
636
|
responses_BulkError as BulkError,
|
637
|
+
responses_BulkInsertResponse as BulkInsertResponse,
|
562
638
|
responses_BranchMigrationPlan as BranchMigrationPlan,
|
639
|
+
responses_RecordResponse as RecordResponse,
|
563
640
|
responses_RecordUpdateResponse as RecordUpdateResponse,
|
564
641
|
responses_QueryResponse as QueryResponse,
|
565
642
|
responses_SearchResponse as SearchResponse,
|
@@ -865,6 +942,9 @@ declare type InviteWorkspaceMemberError = ErrorWrapper<{
|
|
865
942
|
} | {
|
866
943
|
status: 404;
|
867
944
|
payload: SimpleError;
|
945
|
+
} | {
|
946
|
+
status: 409;
|
947
|
+
payload: SimpleError;
|
868
948
|
}>;
|
869
949
|
declare type InviteWorkspaceMemberRequestBody = {
|
870
950
|
email: string;
|
@@ -878,6 +958,34 @@ declare type InviteWorkspaceMemberVariables = {
|
|
878
958
|
* Invite some user to join the workspace with the given role
|
879
959
|
*/
|
880
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>;
|
881
989
|
declare type CancelWorkspaceMemberInvitePathParams = {
|
882
990
|
workspaceId: WorkspaceID;
|
883
991
|
inviteId: InviteID;
|
@@ -1223,6 +1331,10 @@ declare type CreateBranchError = ErrorWrapper<{
|
|
1223
1331
|
status: 404;
|
1224
1332
|
payload: SimpleError;
|
1225
1333
|
}>;
|
1334
|
+
declare type CreateBranchResponse = {
|
1335
|
+
databaseName: string;
|
1336
|
+
branchName: string;
|
1337
|
+
};
|
1226
1338
|
declare type CreateBranchRequestBody = {
|
1227
1339
|
from?: string;
|
1228
1340
|
metadata?: BranchMetadata;
|
@@ -1232,7 +1344,7 @@ declare type CreateBranchVariables = {
|
|
1232
1344
|
pathParams: CreateBranchPathParams;
|
1233
1345
|
queryParams?: CreateBranchQueryParams;
|
1234
1346
|
} & FetcherExtraProps;
|
1235
|
-
declare const createBranch: (variables: CreateBranchVariables) => Promise<
|
1347
|
+
declare const createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
1236
1348
|
declare type DeleteBranchPathParams = {
|
1237
1349
|
dbBranchName: DBBranchName;
|
1238
1350
|
workspace: string;
|
@@ -1419,13 +1531,17 @@ declare type CreateTableError = ErrorWrapper<{
|
|
1419
1531
|
status: 422;
|
1420
1532
|
payload: SimpleError;
|
1421
1533
|
}>;
|
1534
|
+
declare type CreateTableResponse = {
|
1535
|
+
branchName: string;
|
1536
|
+
tableName: string;
|
1537
|
+
};
|
1422
1538
|
declare type CreateTableVariables = {
|
1423
1539
|
pathParams: CreateTablePathParams;
|
1424
1540
|
} & FetcherExtraProps;
|
1425
1541
|
/**
|
1426
1542
|
* Creates a new table with the given name. Returns 422 if a table with the same name already exists.
|
1427
1543
|
*/
|
1428
|
-
declare const createTable: (variables: CreateTableVariables) => Promise<
|
1544
|
+
declare const createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
1429
1545
|
declare type DeleteTablePathParams = {
|
1430
1546
|
dbBranchName: DBBranchName;
|
1431
1547
|
tableName: TableName;
|
@@ -1658,6 +1774,9 @@ declare type InsertRecordPathParams = {
|
|
1658
1774
|
tableName: TableName;
|
1659
1775
|
workspace: string;
|
1660
1776
|
};
|
1777
|
+
declare type InsertRecordQueryParams = {
|
1778
|
+
columns?: ColumnsProjection;
|
1779
|
+
};
|
1661
1780
|
declare type InsertRecordError = ErrorWrapper<{
|
1662
1781
|
status: 400;
|
1663
1782
|
payload: BadRequestError;
|
@@ -1668,20 +1787,15 @@ declare type InsertRecordError = ErrorWrapper<{
|
|
1668
1787
|
status: 404;
|
1669
1788
|
payload: SimpleError;
|
1670
1789
|
}>;
|
1671
|
-
declare type InsertRecordResponse = {
|
1672
|
-
id: string;
|
1673
|
-
xata: {
|
1674
|
-
version: number;
|
1675
|
-
};
|
1676
|
-
};
|
1677
1790
|
declare type InsertRecordVariables = {
|
1678
1791
|
body?: Record<string, any>;
|
1679
1792
|
pathParams: InsertRecordPathParams;
|
1793
|
+
queryParams?: InsertRecordQueryParams;
|
1680
1794
|
} & FetcherExtraProps;
|
1681
1795
|
/**
|
1682
1796
|
* Insert a new Record into the Table
|
1683
1797
|
*/
|
1684
|
-
declare const insertRecord: (variables: InsertRecordVariables) => Promise<
|
1798
|
+
declare const insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
1685
1799
|
declare type InsertRecordWithIDPathParams = {
|
1686
1800
|
dbBranchName: DBBranchName;
|
1687
1801
|
tableName: TableName;
|
@@ -1689,6 +1803,7 @@ declare type InsertRecordWithIDPathParams = {
|
|
1689
1803
|
workspace: string;
|
1690
1804
|
};
|
1691
1805
|
declare type InsertRecordWithIDQueryParams = {
|
1806
|
+
columns?: ColumnsProjection;
|
1692
1807
|
createOnly?: boolean;
|
1693
1808
|
ifVersion?: number;
|
1694
1809
|
};
|
@@ -1721,6 +1836,7 @@ declare type UpdateRecordWithIDPathParams = {
|
|
1721
1836
|
workspace: string;
|
1722
1837
|
};
|
1723
1838
|
declare type UpdateRecordWithIDQueryParams = {
|
1839
|
+
columns?: ColumnsProjection;
|
1724
1840
|
ifVersion?: number;
|
1725
1841
|
};
|
1726
1842
|
declare type UpdateRecordWithIDError = ErrorWrapper<{
|
@@ -1749,6 +1865,7 @@ declare type UpsertRecordWithIDPathParams = {
|
|
1749
1865
|
workspace: string;
|
1750
1866
|
};
|
1751
1867
|
declare type UpsertRecordWithIDQueryParams = {
|
1868
|
+
columns?: ColumnsProjection;
|
1752
1869
|
ifVersion?: number;
|
1753
1870
|
};
|
1754
1871
|
declare type UpsertRecordWithIDError = ErrorWrapper<{
|
@@ -1776,6 +1893,9 @@ declare type DeleteRecordPathParams = {
|
|
1776
1893
|
recordId: RecordID;
|
1777
1894
|
workspace: string;
|
1778
1895
|
};
|
1896
|
+
declare type DeleteRecordQueryParams = {
|
1897
|
+
columns?: ColumnsProjection;
|
1898
|
+
};
|
1779
1899
|
declare type DeleteRecordError = ErrorWrapper<{
|
1780
1900
|
status: 400;
|
1781
1901
|
payload: BadRequestError;
|
@@ -1788,14 +1908,18 @@ declare type DeleteRecordError = ErrorWrapper<{
|
|
1788
1908
|
}>;
|
1789
1909
|
declare type DeleteRecordVariables = {
|
1790
1910
|
pathParams: DeleteRecordPathParams;
|
1911
|
+
queryParams?: DeleteRecordQueryParams;
|
1791
1912
|
} & FetcherExtraProps;
|
1792
|
-
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
1913
|
+
declare const deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
1793
1914
|
declare type GetRecordPathParams = {
|
1794
1915
|
dbBranchName: DBBranchName;
|
1795
1916
|
tableName: TableName;
|
1796
1917
|
recordId: RecordID;
|
1797
1918
|
workspace: string;
|
1798
1919
|
};
|
1920
|
+
declare type GetRecordQueryParams = {
|
1921
|
+
columns?: ColumnsProjection;
|
1922
|
+
};
|
1799
1923
|
declare type GetRecordError = ErrorWrapper<{
|
1800
1924
|
status: 400;
|
1801
1925
|
payload: BadRequestError;
|
@@ -1806,12 +1930,9 @@ declare type GetRecordError = ErrorWrapper<{
|
|
1806
1930
|
status: 404;
|
1807
1931
|
payload: SimpleError;
|
1808
1932
|
}>;
|
1809
|
-
declare type GetRecordRequestBody = {
|
1810
|
-
columns?: ColumnsFilter;
|
1811
|
-
};
|
1812
1933
|
declare type GetRecordVariables = {
|
1813
|
-
body?: GetRecordRequestBody;
|
1814
1934
|
pathParams: GetRecordPathParams;
|
1935
|
+
queryParams?: GetRecordQueryParams;
|
1815
1936
|
} & FetcherExtraProps;
|
1816
1937
|
/**
|
1817
1938
|
* Retrieve record by ID
|
@@ -1822,6 +1943,9 @@ declare type BulkInsertTableRecordsPathParams = {
|
|
1822
1943
|
tableName: TableName;
|
1823
1944
|
workspace: string;
|
1824
1945
|
};
|
1946
|
+
declare type BulkInsertTableRecordsQueryParams = {
|
1947
|
+
columns?: ColumnsProjection;
|
1948
|
+
};
|
1825
1949
|
declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
1826
1950
|
status: 400;
|
1827
1951
|
payload: BulkError;
|
@@ -1831,21 +1955,22 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1831
1955
|
} | {
|
1832
1956
|
status: 404;
|
1833
1957
|
payload: SimpleError;
|
1958
|
+
} | {
|
1959
|
+
status: 422;
|
1960
|
+
payload: SimpleError;
|
1834
1961
|
}>;
|
1835
|
-
declare type BulkInsertTableRecordsResponse = {
|
1836
|
-
recordIDs: string[];
|
1837
|
-
};
|
1838
1962
|
declare type BulkInsertTableRecordsRequestBody = {
|
1839
1963
|
records: Record<string, any>[];
|
1840
1964
|
};
|
1841
1965
|
declare type BulkInsertTableRecordsVariables = {
|
1842
1966
|
body: BulkInsertTableRecordsRequestBody;
|
1843
1967
|
pathParams: BulkInsertTableRecordsPathParams;
|
1968
|
+
queryParams?: BulkInsertTableRecordsQueryParams;
|
1844
1969
|
} & FetcherExtraProps;
|
1845
1970
|
/**
|
1846
1971
|
* Bulk insert records
|
1847
1972
|
*/
|
1848
|
-
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
1973
|
+
declare const bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
1849
1974
|
declare type QueryTablePathParams = {
|
1850
1975
|
dbBranchName: DBBranchName;
|
1851
1976
|
tableName: TableName;
|
@@ -1865,7 +1990,7 @@ declare type QueryTableRequestBody = {
|
|
1865
1990
|
filter?: FilterExpression;
|
1866
1991
|
sort?: SortExpression;
|
1867
1992
|
page?: PageConfig;
|
1868
|
-
columns?:
|
1993
|
+
columns?: ColumnsProjection;
|
1869
1994
|
};
|
1870
1995
|
declare type QueryTableVariables = {
|
1871
1996
|
body?: QueryTableRequestBody;
|
@@ -2611,7 +2736,10 @@ declare type SearchTableError = ErrorWrapper<{
|
|
2611
2736
|
declare type SearchTableRequestBody = {
|
2612
2737
|
query: string;
|
2613
2738
|
fuzziness?: FuzzinessExpression;
|
2739
|
+
prefix?: PrefixExpression;
|
2614
2740
|
filter?: FilterExpression;
|
2741
|
+
highlight?: HighlightExpression;
|
2742
|
+
boosters?: BoosterExpression[];
|
2615
2743
|
};
|
2616
2744
|
declare type SearchTableVariables = {
|
2617
2745
|
body: SearchTableRequestBody;
|
@@ -2640,9 +2768,14 @@ declare type SearchBranchError = ErrorWrapper<{
|
|
2640
2768
|
payload: SimpleError;
|
2641
2769
|
}>;
|
2642
2770
|
declare type SearchBranchRequestBody = {
|
2643
|
-
tables?: string
|
2771
|
+
tables?: (string | {
|
2772
|
+
table: string;
|
2773
|
+
filter?: FilterExpression;
|
2774
|
+
boosters?: BoosterExpression[];
|
2775
|
+
})[];
|
2644
2776
|
query: string;
|
2645
2777
|
fuzziness?: FuzzinessExpression;
|
2778
|
+
highlight?: HighlightExpression;
|
2646
2779
|
};
|
2647
2780
|
declare type SearchBranchVariables = {
|
2648
2781
|
body: SearchBranchRequestBody;
|
@@ -2671,6 +2804,7 @@ declare const operationsByTag: {
|
|
2671
2804
|
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
|
2672
2805
|
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
|
2673
2806
|
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<WorkspaceInvite>;
|
2807
|
+
updateWorkspaceMemberInvite: (variables: UpdateWorkspaceMemberInviteVariables) => Promise<WorkspaceInvite>;
|
2674
2808
|
cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2675
2809
|
resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
|
2676
2810
|
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
|
@@ -2687,7 +2821,7 @@ declare const operationsByTag: {
|
|
2687
2821
|
branch: {
|
2688
2822
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
2689
2823
|
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<DBBranch>;
|
2690
|
-
createBranch: (variables: CreateBranchVariables) => Promise<
|
2824
|
+
createBranch: (variables: CreateBranchVariables) => Promise<CreateBranchResponse>;
|
2691
2825
|
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>;
|
2692
2826
|
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>;
|
2693
2827
|
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<BranchMetadata>;
|
@@ -2697,7 +2831,7 @@ declare const operationsByTag: {
|
|
2697
2831
|
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>;
|
2698
2832
|
};
|
2699
2833
|
table: {
|
2700
|
-
createTable: (variables: CreateTableVariables) => Promise<
|
2834
|
+
createTable: (variables: CreateTableVariables) => Promise<CreateTableResponse>;
|
2701
2835
|
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>;
|
2702
2836
|
updateTable: (variables: UpdateTableVariables) => Promise<undefined>;
|
2703
2837
|
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>;
|
@@ -2709,13 +2843,13 @@ declare const operationsByTag: {
|
|
2709
2843
|
updateColumn: (variables: UpdateColumnVariables) => Promise<MigrationIdResponse>;
|
2710
2844
|
};
|
2711
2845
|
records: {
|
2712
|
-
insertRecord: (variables: InsertRecordVariables) => Promise<
|
2846
|
+
insertRecord: (variables: InsertRecordVariables) => Promise<RecordUpdateResponse>;
|
2713
2847
|
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2714
2848
|
updateRecordWithID: (variables: UpdateRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2715
2849
|
upsertRecordWithID: (variables: UpsertRecordWithIDVariables) => Promise<RecordUpdateResponse>;
|
2716
|
-
deleteRecord: (variables: DeleteRecordVariables) => Promise<
|
2850
|
+
deleteRecord: (variables: DeleteRecordVariables) => Promise<XataRecord$1>;
|
2717
2851
|
getRecord: (variables: GetRecordVariables) => Promise<XataRecord$1>;
|
2718
|
-
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<
|
2852
|
+
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertResponse>;
|
2719
2853
|
queryTable: (variables: QueryTableVariables) => Promise<QueryResponse>;
|
2720
2854
|
searchTable: (variables: SearchTableVariables) => Promise<SearchResponse>;
|
2721
2855
|
searchBranch: (variables: SearchBranchVariables) => Promise<SearchResponse>;
|
@@ -2769,6 +2903,7 @@ declare class WorkspaceApi {
|
|
2769
2903
|
updateWorkspaceMemberRole(workspaceId: WorkspaceID, userId: UserID, role: Role): Promise<void>;
|
2770
2904
|
removeWorkspaceMember(workspaceId: WorkspaceID, userId: UserID): Promise<void>;
|
2771
2905
|
inviteWorkspaceMember(workspaceId: WorkspaceID, email: string, role: Role): Promise<WorkspaceInvite>;
|
2906
|
+
updateWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID, role: Role): Promise<WorkspaceInvite>;
|
2772
2907
|
cancelWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2773
2908
|
resendWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteId: InviteID): Promise<void>;
|
2774
2909
|
acceptWorkspaceMemberInvite(workspaceId: WorkspaceID, inviteKey: InviteKey): Promise<void>;
|
@@ -2782,14 +2917,14 @@ declare class DatabaseApi {
|
|
2782
2917
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2783
2918
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2784
2919
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
2785
|
-
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch
|
2920
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
2786
2921
|
}
|
2787
2922
|
declare class BranchApi {
|
2788
2923
|
private extraProps;
|
2789
2924
|
constructor(extraProps: FetcherExtraProps);
|
2790
2925
|
getBranchList(workspace: WorkspaceID, dbName: DBName): Promise<ListBranchesResponse>;
|
2791
2926
|
getBranchDetails(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<DBBranch>;
|
2792
|
-
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>;
|
2793
2928
|
deleteBranch(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<void>;
|
2794
2929
|
updateBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName, metadata?: BranchMetadata): Promise<void>;
|
2795
2930
|
getBranchMetadata(workspace: WorkspaceID, database: DBName, branch: BranchName): Promise<BranchMetadata>;
|
@@ -2801,7 +2936,7 @@ declare class BranchApi {
|
|
2801
2936
|
declare class TableApi {
|
2802
2937
|
private extraProps;
|
2803
2938
|
constructor(extraProps: FetcherExtraProps);
|
2804
|
-
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<
|
2939
|
+
createTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<CreateTableResponse>;
|
2805
2940
|
deleteTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<void>;
|
2806
2941
|
updateTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, options: UpdateTableRequestBody): Promise<void>;
|
2807
2942
|
getTableSchema(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName): Promise<GetTableSchemaResponse>;
|
@@ -2815,13 +2950,13 @@ declare class TableApi {
|
|
2815
2950
|
declare class RecordsApi {
|
2816
2951
|
private extraProps;
|
2817
2952
|
constructor(extraProps: FetcherExtraProps);
|
2818
|
-
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>;
|
2819
2954
|
insertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: InsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2820
2955
|
updateRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpdateRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2821
2956
|
upsertRecordWithID(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, record: Record<string, any>, options?: UpsertRecordWithIDQueryParams): Promise<RecordUpdateResponse>;
|
2822
|
-
deleteRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID): Promise<
|
2823
|
-
getRecord(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, recordId: RecordID, options?:
|
2824
|
-
bulkInsertTableRecords(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, records: Record<string, any>[]): Promise<
|
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>;
|
2825
2960
|
queryTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: QueryTableRequestBody): Promise<QueryResponse>;
|
2826
2961
|
searchTable(workspace: WorkspaceID, database: DBName, branch: BranchName, tableName: TableName, query: SearchTableRequestBody): Promise<SearchResponse>;
|
2827
2962
|
searchBranch(workspace: WorkspaceID, database: DBName, branch: BranchName, query: SearchBranchRequestBody): Promise<SearchResponse>;
|
@@ -2837,28 +2972,29 @@ declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) ex
|
|
2837
2972
|
declare type If<Condition, Then, Else> = Condition extends true ? Then : Else;
|
2838
2973
|
declare type IsObject<T> = T extends Record<string, any> ? true : false;
|
2839
2974
|
declare type IsArray<T> = T extends Array<any> ? true : false;
|
2840
|
-
declare type NonEmptyArray<T> = T[] & {
|
2841
|
-
0: T;
|
2842
|
-
};
|
2843
2975
|
declare type RequiredBy<T, K extends keyof T> = T & {
|
2844
2976
|
[P in K]-?: NonNullable<T[P]>;
|
2845
2977
|
};
|
2846
2978
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2847
2979
|
declare type SingleOrArray<T> = T | T[];
|
2848
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;
|
2849
2985
|
|
2850
2986
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2851
|
-
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2852
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord
|
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>;
|
2853
2989
|
}>>;
|
2854
|
-
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<O[K] extends
|
2855
|
-
V: ValueAtColumn<
|
2856
|
-
} : never
|
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;
|
2857
2993
|
declare type MAX_RECURSION = 5;
|
2858
2994
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
2859
|
-
[K in DataProps<O>]:
|
2860
|
-
If<IsObject<
|
2861
|
-
K
|
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;
|
2862
2998
|
}>, never>;
|
2863
2999
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
2864
3000
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
@@ -2885,27 +3021,37 @@ interface BaseData {
|
|
2885
3021
|
/**
|
2886
3022
|
* Represents a persisted record from the database.
|
2887
3023
|
*/
|
2888
|
-
interface XataRecord extends Identifiable {
|
3024
|
+
interface XataRecord<OriginalRecord extends XataRecord<any> = XataRecord<any>> extends Identifiable {
|
2889
3025
|
/**
|
2890
|
-
*
|
3026
|
+
* Get metadata of this record.
|
2891
3027
|
*/
|
2892
|
-
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2897
|
-
|
3028
|
+
getMetadata(): XataRecordMetadata;
|
3029
|
+
/**
|
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.
|
3033
|
+
*/
|
3034
|
+
read<K extends SelectableColumn<OriginalRecord>>(columns: K[]): Promise<Readonly<SelectedPick<OriginalRecord, typeof columns>> | null>;
|
2898
3035
|
/**
|
2899
3036
|
* Retrieves a refreshed copy of the current record from the database.
|
3037
|
+
* @returns The persisted record with all first level properties.
|
2900
3038
|
*/
|
2901
|
-
read(): Promise<Readonly<SelectedPick<
|
3039
|
+
read(): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>> | null>;
|
2902
3040
|
/**
|
2903
3041
|
* Performs a partial update of the current record. On success a new object is
|
2904
3042
|
* returned and the current object is not mutated.
|
2905
|
-
* @param
|
2906
|
-
* @
|
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.
|
2907
3053
|
*/
|
2908
|
-
update(partialUpdate: Partial<EditableData<Omit<
|
3054
|
+
update(partialUpdate: Partial<EditableData<Omit<OriginalRecord, keyof XataRecord>>>): Promise<Readonly<SelectedPick<OriginalRecord, ['*']>>>;
|
2909
3055
|
/**
|
2910
3056
|
* Performs a deletion of the current record in the database.
|
2911
3057
|
*
|
@@ -2917,23 +3063,36 @@ declare type Link<Record extends XataRecord> = Omit<XataRecord, 'read' | 'update
|
|
2917
3063
|
/**
|
2918
3064
|
* Retrieves a refreshed copy of the current record from the database.
|
2919
3065
|
*/
|
2920
|
-
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>;
|
2921
3067
|
/**
|
2922
3068
|
* Performs a partial update of the current record. On success a new object is
|
2923
3069
|
* returned and the current object is not mutated.
|
2924
|
-
* @param
|
3070
|
+
* @param partialUpdate The columns and their values that have to be updated.
|
2925
3071
|
* @returns A new record containing the latest values for all the columns of the current record.
|
2926
3072
|
*/
|
2927
|
-
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[];
|
2928
3087
|
};
|
2929
3088
|
declare function isIdentifiable(x: any): x is Identifiable & Record<string, unknown>;
|
2930
3089
|
declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>;
|
2931
3090
|
declare type EditableData<O extends BaseData> = {
|
2932
3091
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2933
3092
|
id: string;
|
2934
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
3093
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2935
3094
|
id: string;
|
2936
|
-
} | null | undefined : O[K];
|
3095
|
+
} | string | null | undefined : O[K];
|
2937
3096
|
};
|
2938
3097
|
|
2939
3098
|
/**
|
@@ -3009,8 +3168,8 @@ declare type ValueTypeFilters<T> = T | T extends string ? StringTypeFilter : T e
|
|
3009
3168
|
],
|
3010
3169
|
}
|
3011
3170
|
*/
|
3012
|
-
declare type AggregatorFilter<
|
3013
|
-
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<
|
3171
|
+
declare type AggregatorFilter<T> = {
|
3172
|
+
[key in '$all' | '$any' | '$not' | '$none']?: SingleOrArray<Filter<T>>;
|
3014
3173
|
};
|
3015
3174
|
/**
|
3016
3175
|
* Existance filter
|
@@ -3025,10 +3184,88 @@ declare type BaseApiFilter<Record> = PropertyAccessFilter<Record> | AggregatorFi
|
|
3025
3184
|
* Injects the Api filters on nested properties
|
3026
3185
|
* Example: { filter: { settings: { plan: { $any: ['free', 'trial'] } } } }
|
3027
3186
|
*/
|
3028
|
-
declare type NestedApiFilter<T> =
|
3187
|
+
declare type NestedApiFilter<T> = {
|
3029
3188
|
[key in keyof T]?: T[key] extends Record<string, any> ? SingleOrArray<Filter<T[key]>> : PropertyFilter<T[key]>;
|
3030
|
-
}
|
3031
|
-
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;
|
3032
3269
|
|
3033
3270
|
declare type SortDirection = 'asc' | 'desc';
|
3034
3271
|
declare type SortFilterExtended<T extends XataRecord> = {
|
@@ -3041,7 +3278,7 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
3041
3278
|
};
|
3042
3279
|
|
3043
3280
|
declare type BaseOptions<T extends XataRecord> = {
|
3044
|
-
columns?:
|
3281
|
+
columns?: SelectableColumn<T>[];
|
3045
3282
|
cache?: number;
|
3046
3283
|
};
|
3047
3284
|
declare type CursorQueryOptions = {
|
@@ -3064,8 +3301,8 @@ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryO
|
|
3064
3301
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
3065
3302
|
#private;
|
3066
3303
|
readonly meta: PaginationQueryMeta;
|
3067
|
-
readonly records: Result
|
3068
|
-
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>>);
|
3069
3306
|
getQueryOptions(): QueryOptions<Record>;
|
3070
3307
|
key(): string;
|
3071
3308
|
/**
|
@@ -3097,18 +3334,28 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3097
3334
|
*
|
3098
3335
|
* ```
|
3099
3336
|
* query.filter("columnName", columnValue)
|
3100
|
-
* query.filter(
|
3101
|
-
*
|
3102
|
-
*
|
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 })
|
3103
3350
|
* query.filter({
|
3104
3351
|
* "columnName": operator(columnValue) // Use gt, gte, lt, lte, startsWith,...
|
3105
3352
|
* })
|
3106
3353
|
* ```
|
3107
3354
|
*
|
3355
|
+
* @param filters A filter object
|
3108
3356
|
* @returns A new Query object.
|
3109
3357
|
*/
|
3110
3358
|
filter(filters: Filter<Record>): Query<Record, Result>;
|
3111
|
-
filter<F extends SelectableColumn<Record>>(column: F, value: Filter<ValueAtColumn<Record, F>>): Query<Record, Result>;
|
3112
3359
|
/**
|
3113
3360
|
* Builds a new query with a new sort option.
|
3114
3361
|
* @param column The column name.
|
@@ -3121,57 +3368,149 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3121
3368
|
* @param columns Array of column names to be returned by the query.
|
3122
3369
|
* @returns A new Query object.
|
3123
3370
|
*/
|
3124
|
-
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
|
+
*/
|
3125
3377
|
getPaginated(): Promise<Page<Record, Result>>;
|
3378
|
+
/**
|
3379
|
+
* Get paginated results
|
3380
|
+
*
|
3381
|
+
* @param options Pagination options
|
3382
|
+
* @returns A page of results
|
3383
|
+
*/
|
3126
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
|
+
*/
|
3127
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
|
+
*/
|
3128
3398
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
3399
|
+
/**
|
3400
|
+
* Build an iterator of results
|
3401
|
+
*
|
3402
|
+
* @returns Async generator of results array
|
3403
|
+
*/
|
3129
3404
|
getIterator(): AsyncGenerator<Result[]>;
|
3405
|
+
/**
|
3406
|
+
* Build an iterator of results
|
3407
|
+
*
|
3408
|
+
* @param options Pagination options with batchSize
|
3409
|
+
* @returns Async generator of results array
|
3410
|
+
*/
|
3130
3411
|
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3131
3412
|
batchSize?: number;
|
3132
3413
|
}): AsyncGenerator<Result[]>;
|
3414
|
+
/**
|
3415
|
+
* Build an iterator of results
|
3416
|
+
*
|
3417
|
+
* @param options Pagination options with batchSize
|
3418
|
+
* @returns Async generator of results array
|
3419
|
+
*/
|
3133
3420
|
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3134
3421
|
batchSize?: number;
|
3135
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>>;
|
3428
|
+
/**
|
3429
|
+
* Performs the query in the database and returns a set of results.
|
3430
|
+
* @param options Additional options to be used when performing the query.
|
3431
|
+
* @returns An array of records from the database.
|
3432
|
+
*/
|
3433
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
3136
3434
|
/**
|
3137
3435
|
* Performs the query in the database and returns a set of results.
|
3138
3436
|
* @param options Additional options to be used when performing the query.
|
3139
3437
|
* @returns An array of records from the database.
|
3140
3438
|
*/
|
3141
|
-
getMany(): Promise<Result
|
3142
|
-
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
|
3143
|
-
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
3439
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
3144
3440
|
/**
|
3145
3441
|
* Performs the query in the database and returns all the results.
|
3146
3442
|
* Warning: If there are a large number of results, this method can have performance implications.
|
3147
|
-
* @param options Additional options to be used when performing the query.
|
3148
3443
|
* @returns An array of records from the database.
|
3149
3444
|
*/
|
3150
3445
|
getAll(): Promise<Result[]>;
|
3151
|
-
|
3152
|
-
|
3153
|
-
|
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
|
+
*/
|
3154
3452
|
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3155
3453
|
batchSize?: number;
|
3156
3454
|
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
3157
3455
|
/**
|
3158
|
-
* 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.
|
3159
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.
|
3160
3466
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3161
3467
|
*/
|
3162
3468
|
getFirst(): Promise<Result | null>;
|
3163
|
-
|
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
|
+
*/
|
3164
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>;
|
3165
3481
|
/**
|
3166
3482
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3167
3483
|
* @param ttl The cache TTL in milliseconds.
|
3168
3484
|
* @returns A new Query object.
|
3169
3485
|
*/
|
3170
3486
|
cache(ttl: number): Query<Record, Result>;
|
3487
|
+
/**
|
3488
|
+
* Retrieve next page of records
|
3489
|
+
*
|
3490
|
+
* @returns A new page object.
|
3491
|
+
*/
|
3171
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
|
+
*/
|
3172
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
|
+
*/
|
3173
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
|
+
*/
|
3174
3510
|
lastPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3511
|
+
/**
|
3512
|
+
* @returns Boolean indicating if there is a next page
|
3513
|
+
*/
|
3175
3514
|
hasNextPage(): boolean;
|
3176
3515
|
}
|
3177
3516
|
|
@@ -3183,7 +3522,7 @@ declare type PaginationQueryMeta = {
|
|
3183
3522
|
};
|
3184
3523
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
3185
3524
|
meta: PaginationQueryMeta;
|
3186
|
-
records: Result
|
3525
|
+
records: RecordArray<Result>;
|
3187
3526
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3188
3527
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3189
3528
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
@@ -3203,7 +3542,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
3203
3542
|
/**
|
3204
3543
|
* The set of results for this page.
|
3205
3544
|
*/
|
3206
|
-
readonly records: Result
|
3545
|
+
readonly records: RecordArray<Result>;
|
3207
3546
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
3208
3547
|
/**
|
3209
3548
|
* Retrieves the next page of results.
|
@@ -3252,41 +3591,153 @@ declare type OffsetNavigationOptions = {
|
|
3252
3591
|
offset?: number;
|
3253
3592
|
};
|
3254
3593
|
declare const PAGINATION_MAX_SIZE = 200;
|
3255
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
3594
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
3256
3595
|
declare const PAGINATION_MAX_OFFSET = 800;
|
3257
3596
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
3258
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
|
+
}
|
3259
3633
|
|
3260
3634
|
/**
|
3261
3635
|
* Common interface for performing operations on a table.
|
3262
3636
|
*/
|
3263
3637
|
declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, Readonly<SelectedPick<Record, ['*']>>> {
|
3264
|
-
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, ['*']>>>;
|
3265
3640
|
/**
|
3266
3641
|
* Creates a single record in the table with a unique id.
|
3267
3642
|
* @param id The unique id.
|
3268
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.
|
3269
3645
|
* @returns The full persisted record.
|
3270
3646
|
*/
|
3271
|
-
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, ['*']>>>;
|
3272
3655
|
/**
|
3273
3656
|
* Creates multiple records in the table.
|
3274
3657
|
* @param objects Array of objects with the column names and the values to be stored in the table.
|
3275
|
-
* @
|
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.
|
3660
|
+
*/
|
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.
|
3276
3673
|
*/
|
3277
|
-
abstract
|
3674
|
+
abstract read<K extends SelectableColumn<Record>>(id: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns> | null>>;
|
3278
3675
|
/**
|
3279
3676
|
* Queries a single record from the table given its unique id.
|
3280
3677
|
* @param id The unique id.
|
3281
3678
|
* @returns The persisted record for the given id or null if the record could not be found.
|
3282
3679
|
*/
|
3283
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>>>;
|
3284
3727
|
/**
|
3285
3728
|
* Partially update a single record.
|
3286
3729
|
* @param object An object with its id and the columns to be updated.
|
3287
3730
|
* @returns The full persisted record.
|
3288
3731
|
*/
|
3289
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>>>;
|
3290
3741
|
/**
|
3291
3742
|
* Partially update a single record given its unique id.
|
3292
3743
|
* @param id The unique id.
|
@@ -3297,9 +3748,24 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3297
3748
|
/**
|
3298
3749
|
* Partially updates multiple records.
|
3299
3750
|
* @param objects An array of objects with their ids and columns to be updated.
|
3300
|
-
* @
|
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.
|
3301
3759
|
*/
|
3302
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>>>;
|
3303
3769
|
/**
|
3304
3770
|
* Creates or updates a single record. If a record exists with the given id,
|
3305
3771
|
* it will be update, otherwise a new record will be created.
|
@@ -3307,6 +3773,15 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3307
3773
|
* @returns The full persisted record.
|
3308
3774
|
*/
|
3309
3775
|
abstract createOrUpdate(object: EditableData<Data> & Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3776
|
+
/**
|
3777
|
+
* Creates or updates a single record. If a record exists with the given id,
|
3778
|
+
* it will be update, otherwise a new record will be created.
|
3779
|
+
* @param id A unique id.
|
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.
|
3782
|
+
* @returns The full persisted record.
|
3783
|
+
*/
|
3784
|
+
abstract createOrUpdate<K extends SelectableColumn<Record>>(id: string, object: Omit<EditableData<Data>, 'id'>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3310
3785
|
/**
|
3311
3786
|
* Creates or updates a single record. If a record exists with the given id,
|
3312
3787
|
* it will be update, otherwise a new record will be created.
|
@@ -3314,7 +3789,15 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3314
3789
|
* @param object The column names and the values to be persisted.
|
3315
3790
|
* @returns The full persisted record.
|
3316
3791
|
*/
|
3317
|
-
abstract createOrUpdate(id: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
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>>[]>;
|
3318
3801
|
/**
|
3319
3802
|
* Creates or updates a single record. If a record exists with the given id,
|
3320
3803
|
* it will be update, otherwise a new record will be created.
|
@@ -3353,37 +3836,112 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3353
3836
|
* @returns The found records.
|
3354
3837
|
*/
|
3355
3838
|
abstract search(query: string, options?: {
|
3356
|
-
fuzziness?:
|
3839
|
+
fuzziness?: FuzzinessExpression;
|
3840
|
+
prefix?: PrefixExpression;
|
3841
|
+
highlight?: HighlightExpression;
|
3357
3842
|
filter?: Filter<Record>;
|
3358
|
-
|
3843
|
+
boosters?: Boosters<Record>[];
|
3844
|
+
}): Promise<SearchXataRecord<SelectedPick<Record, ['*']>>[]>;
|
3359
3845
|
abstract query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3360
3846
|
}
|
3361
3847
|
declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
|
3362
3848
|
#private;
|
3363
|
-
db: SchemaPluginResult<any>;
|
3364
3849
|
constructor(options: {
|
3365
3850
|
table: string;
|
3366
3851
|
db: SchemaPluginResult<any>;
|
3367
3852
|
pluginOptions: XataPluginOptions;
|
3853
|
+
schemaTables?: Table[];
|
3368
3854
|
});
|
3369
|
-
create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
3370
|
-
create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
3371
|
-
create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']
|
3372
|
-
|
3855
|
+
create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3856
|
+
create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3857
|
+
create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3858
|
+
create<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3859
|
+
create<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>>;
|
3860
|
+
create<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>>[]>;
|
3861
|
+
read(recordId: string): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3862
|
+
read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3863
|
+
read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']>> | null>;
|
3864
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3865
|
+
read<K extends SelectableColumn<Record>>(recordId: string, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3866
|
+
read<K extends SelectableColumn<Record>>(recordIds: string[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3867
|
+
read<K extends SelectableColumn<Record>>(object: Identifiable, columns: K[]): Promise<Readonly<SelectedPick<Record, typeof columns>> | null>;
|
3868
|
+
read<K extends SelectableColumn<Record>>(objects: Identifiable[], columns: K[]): Promise<Array<Readonly<SelectedPick<Record, typeof columns>>>>;
|
3373
3869
|
update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
|
3374
3870
|
update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
|
3375
3871
|
update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
|
3872
|
+
update<K extends SelectableColumn<Record>>(object: Partial<EditableData<Data>> & Identifiable, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3873
|
+
update<K extends SelectableColumn<Record>>(recordId: string, object: Partial<EditableData<Data>>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3874
|
+
update<K extends SelectableColumn<Record>>(objects: Array<Partial<EditableData<Data>> & Identifiable>, columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
|
3376
3875
|
createOrUpdate(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
3377
3876
|
createOrUpdate(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']>>;
|
3378
3877
|
createOrUpdate(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']>[]>;
|
3878
|
+
createOrUpdate<K extends SelectableColumn<Record>>(object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3879
|
+
createOrUpdate<K extends SelectableColumn<Record>>(recordId: string, object: EditableData<Data>, columns: K[]): Promise<SelectedPick<Record, typeof columns>>;
|
3880
|
+
createOrUpdate<K extends SelectableColumn<Record>>(objects: EditableData<Data>[], columns: K[]): Promise<SelectedPick<Record, typeof columns>[]>;
|
3379
3881
|
delete(a: string | Identifiable | Array<string | Identifiable>): Promise<void>;
|
3380
3882
|
search(query: string, options?: {
|
3381
|
-
fuzziness?:
|
3883
|
+
fuzziness?: FuzzinessExpression;
|
3884
|
+
prefix?: PrefixExpression;
|
3885
|
+
highlight?: HighlightExpression;
|
3382
3886
|
filter?: Filter<Record>;
|
3383
|
-
|
3887
|
+
boosters?: Boosters<Record>[];
|
3888
|
+
}): Promise<any>;
|
3384
3889
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3385
3890
|
}
|
3386
3891
|
|
3892
|
+
declare type BaseSchema = {
|
3893
|
+
name: string;
|
3894
|
+
columns: readonly ({
|
3895
|
+
name: string;
|
3896
|
+
type: Column['type'];
|
3897
|
+
} | {
|
3898
|
+
name: string;
|
3899
|
+
type: 'link';
|
3900
|
+
link: {
|
3901
|
+
table: string;
|
3902
|
+
};
|
3903
|
+
} | {
|
3904
|
+
name: string;
|
3905
|
+
type: 'object';
|
3906
|
+
columns: {
|
3907
|
+
name: string;
|
3908
|
+
type: string;
|
3909
|
+
}[];
|
3910
|
+
})[];
|
3911
|
+
};
|
3912
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
3913
|
+
name: string;
|
3914
|
+
columns: readonly unknown[];
|
3915
|
+
} ? {
|
3916
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
3917
|
+
} : never : never;
|
3918
|
+
declare type TableType<Tables, TableName> = Tables & {
|
3919
|
+
name: TableName;
|
3920
|
+
} extends infer Table ? Table extends {
|
3921
|
+
name: string;
|
3922
|
+
columns: infer Columns;
|
3923
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3924
|
+
name: string;
|
3925
|
+
type: string;
|
3926
|
+
} ? Identifiable & {
|
3927
|
+
[K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
|
3928
|
+
} : never : never : never : never;
|
3929
|
+
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
3930
|
+
name: PropertyName;
|
3931
|
+
} extends infer Property ? Property extends {
|
3932
|
+
name: string;
|
3933
|
+
type: infer Type;
|
3934
|
+
link?: {
|
3935
|
+
table: infer LinkedTable;
|
3936
|
+
};
|
3937
|
+
columns?: infer ObjectColumns;
|
3938
|
+
} ? (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 {
|
3939
|
+
name: string;
|
3940
|
+
type: string;
|
3941
|
+
} ? {
|
3942
|
+
[K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
|
3943
|
+
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
|
3944
|
+
|
3387
3945
|
/**
|
3388
3946
|
* Operator to restrict results to only values that are greater than the given value.
|
3389
3947
|
*/
|
@@ -3467,38 +4025,10 @@ declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3467
4025
|
};
|
3468
4026
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3469
4027
|
#private;
|
3470
|
-
|
3471
|
-
constructor(tableNames?: string[] | undefined);
|
4028
|
+
constructor(schemaTables?: Schemas.Table[]);
|
3472
4029
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3473
4030
|
}
|
3474
4031
|
|
3475
|
-
declare type SearchOptions<Schemas extends Record<string, BaseData>, Tables extends StringKeys<Schemas>> = {
|
3476
|
-
fuzziness?: number;
|
3477
|
-
tables?: Tables[];
|
3478
|
-
};
|
3479
|
-
declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
3480
|
-
all: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<Values<{
|
3481
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]: {
|
3482
|
-
table: Model;
|
3483
|
-
record: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>>;
|
3484
|
-
};
|
3485
|
-
}>[]>;
|
3486
|
-
byTable: <Tables extends StringKeys<Schemas>>(query: string, options?: SearchOptions<Schemas, Tables>) => Promise<{
|
3487
|
-
[Model in GetArrayInnerType<NonNullable<NonNullable<typeof options>['tables']>>]?: Awaited<SelectedPick<Schemas[Model] & SearchXataRecord, ['*']>[]>;
|
3488
|
-
}>;
|
3489
|
-
};
|
3490
|
-
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3491
|
-
#private;
|
3492
|
-
private db;
|
3493
|
-
constructor(db: SchemaPluginResult<Schemas>);
|
3494
|
-
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3495
|
-
}
|
3496
|
-
declare type SearchXataRecord = XataRecord & {
|
3497
|
-
xata: {
|
3498
|
-
table: string;
|
3499
|
-
};
|
3500
|
-
};
|
3501
|
-
|
3502
4032
|
declare type BranchStrategyValue = string | undefined | null;
|
3503
4033
|
declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
|
3504
4034
|
declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
|
@@ -3513,15 +4043,20 @@ declare type BaseClientOptions = {
|
|
3513
4043
|
};
|
3514
4044
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3515
4045
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3516
|
-
new <
|
3517
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
3518
|
-
search: Awaited<ReturnType<SearchPlugin<
|
4046
|
+
new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
|
4047
|
+
db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
4048
|
+
search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
3519
4049
|
}, keyof Plugins> & {
|
3520
4050
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
4051
|
+
} & {
|
4052
|
+
getConfig(): Promise<{
|
4053
|
+
databaseURL: string;
|
4054
|
+
branch: string;
|
4055
|
+
}>;
|
3521
4056
|
};
|
3522
4057
|
}
|
3523
4058
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3524
|
-
declare class BaseClient extends BaseClient_base<
|
4059
|
+
declare class BaseClient extends BaseClient_base<[]> {
|
3525
4060
|
}
|
3526
4061
|
|
3527
4062
|
declare type BranchResolutionOptions = {
|
@@ -3540,4 +4075,4 @@ declare class XataError extends Error {
|
|
3540
4075
|
constructor(message: string, status: number);
|
3541
4076
|
}
|
3542
4077
|
|
3543
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams,
|
4078
|
+
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 };
|