@xata.io/client 0.0.0-alpha.vf6d8daa → 0.0.0-alpha.vf7b5320
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 +24 -0
- package/dist/index.cjs +260 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +223 -22
- package/dist/index.mjs +257 -138
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -20,15 +20,25 @@ declare type ErrorWrapper<TError> = TError | {
|
|
20
20
|
};
|
21
21
|
|
22
22
|
interface CacheImpl {
|
23
|
+
cacheRecords: boolean;
|
24
|
+
defaultQueryTTL: number;
|
23
25
|
getAll(): Promise<Record<string, unknown>>;
|
24
26
|
get: <T>(key: string) => Promise<T | null>;
|
25
27
|
set: <T>(key: string, value: T) => Promise<void>;
|
26
28
|
delete: (key: string) => Promise<void>;
|
27
29
|
clear: () => Promise<void>;
|
28
30
|
}
|
31
|
+
interface SimpleCacheOptions {
|
32
|
+
max?: number;
|
33
|
+
cacheRecords?: boolean;
|
34
|
+
defaultQueryTTL?: number;
|
35
|
+
}
|
29
36
|
declare class SimpleCache implements CacheImpl {
|
30
37
|
#private;
|
31
|
-
|
38
|
+
capacity: number;
|
39
|
+
cacheRecords: boolean;
|
40
|
+
defaultQueryTTL: number;
|
41
|
+
constructor(options?: SimpleCacheOptions);
|
32
42
|
getAll(): Promise<Record<string, unknown>>;
|
33
43
|
get<T>(key: string): Promise<T | null>;
|
34
44
|
set<T>(key: string, value: T): Promise<void>;
|
@@ -128,6 +138,12 @@ declare type ListBranchesResponse = {
|
|
128
138
|
displayName: string;
|
129
139
|
branches: Branch[];
|
130
140
|
};
|
141
|
+
declare type ListGitBranchesResponse = {
|
142
|
+
mapping: {
|
143
|
+
gitBranch: string;
|
144
|
+
xataBranch: string;
|
145
|
+
}[];
|
146
|
+
};
|
131
147
|
declare type Branch = {
|
132
148
|
name: string;
|
133
149
|
createdAt: DateTime;
|
@@ -176,7 +192,7 @@ declare type Table = {
|
|
176
192
|
*/
|
177
193
|
declare type Column = {
|
178
194
|
name: string;
|
179
|
-
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
|
195
|
+
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
|
180
196
|
link?: {
|
181
197
|
table: string;
|
182
198
|
};
|
@@ -372,6 +388,7 @@ type schemas_WorkspaceMembers = WorkspaceMembers;
|
|
372
388
|
type schemas_InviteKey = InviteKey;
|
373
389
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
374
390
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
391
|
+
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
375
392
|
type schemas_Branch = Branch;
|
376
393
|
type schemas_BranchMetadata = BranchMetadata;
|
377
394
|
type schemas_DBBranch = DBBranch;
|
@@ -424,6 +441,7 @@ declare namespace schemas {
|
|
424
441
|
schemas_InviteKey as InviteKey,
|
425
442
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
426
443
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
444
|
+
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
427
445
|
schemas_Branch as Branch,
|
428
446
|
schemas_BranchMetadata as BranchMetadata,
|
429
447
|
schemas_DBBranch as DBBranch,
|
@@ -1000,6 +1018,162 @@ declare type DeleteDatabaseVariables = {
|
|
1000
1018
|
* Delete a database and all of its branches and tables permanently.
|
1001
1019
|
*/
|
1002
1020
|
declare const deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
1021
|
+
declare type GetGitBranchesMappingPathParams = {
|
1022
|
+
dbName: DBName;
|
1023
|
+
workspace: string;
|
1024
|
+
};
|
1025
|
+
declare type GetGitBranchesMappingError = ErrorWrapper<{
|
1026
|
+
status: 400;
|
1027
|
+
payload: BadRequestError;
|
1028
|
+
} | {
|
1029
|
+
status: 401;
|
1030
|
+
payload: AuthError;
|
1031
|
+
}>;
|
1032
|
+
declare type GetGitBranchesMappingVariables = {
|
1033
|
+
pathParams: GetGitBranchesMappingPathParams;
|
1034
|
+
} & FetcherExtraProps;
|
1035
|
+
/**
|
1036
|
+
* Lists all the git branches in the mapping, and their associated Xata branches.
|
1037
|
+
*
|
1038
|
+
* Example response:
|
1039
|
+
*
|
1040
|
+
* ```json
|
1041
|
+
* {
|
1042
|
+
* "mappings": [
|
1043
|
+
* {
|
1044
|
+
* "gitBranch": "main",
|
1045
|
+
* "xataBranch": "main"
|
1046
|
+
* },
|
1047
|
+
* {
|
1048
|
+
* "gitBranch": "gitBranch1",
|
1049
|
+
* "xataBranch": "xataBranch1"
|
1050
|
+
* }
|
1051
|
+
* {
|
1052
|
+
* "gitBranch": "xataBranch2",
|
1053
|
+
* "xataBranch": "xataBranch2"
|
1054
|
+
* }
|
1055
|
+
* ]
|
1056
|
+
* }
|
1057
|
+
* ```
|
1058
|
+
*/
|
1059
|
+
declare const getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
1060
|
+
declare type AddGitBranchesEntryPathParams = {
|
1061
|
+
dbName: DBName;
|
1062
|
+
workspace: string;
|
1063
|
+
};
|
1064
|
+
declare type AddGitBranchesEntryError = ErrorWrapper<{
|
1065
|
+
status: 400;
|
1066
|
+
payload: BadRequestError;
|
1067
|
+
} | {
|
1068
|
+
status: 401;
|
1069
|
+
payload: AuthError;
|
1070
|
+
}>;
|
1071
|
+
declare type AddGitBranchesEntryResponse = {
|
1072
|
+
warning?: string;
|
1073
|
+
};
|
1074
|
+
declare type AddGitBranchesEntryRequestBody = {
|
1075
|
+
gitBranch: string;
|
1076
|
+
xataBranch: BranchName;
|
1077
|
+
};
|
1078
|
+
declare type AddGitBranchesEntryVariables = {
|
1079
|
+
body: AddGitBranchesEntryRequestBody;
|
1080
|
+
pathParams: AddGitBranchesEntryPathParams;
|
1081
|
+
} & FetcherExtraProps;
|
1082
|
+
/**
|
1083
|
+
* Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.
|
1084
|
+
*
|
1085
|
+
* If the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.
|
1086
|
+
*
|
1087
|
+
* Example request:
|
1088
|
+
*
|
1089
|
+
* ```json
|
1090
|
+
* // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
|
1091
|
+
* {
|
1092
|
+
* "gitBranch": "fix/bug123",
|
1093
|
+
* "xataBranch": "fix_bug"
|
1094
|
+
* }
|
1095
|
+
* ```
|
1096
|
+
*/
|
1097
|
+
declare const addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
1098
|
+
declare type RemoveGitBranchesEntryPathParams = {
|
1099
|
+
dbName: DBName;
|
1100
|
+
workspace: string;
|
1101
|
+
};
|
1102
|
+
declare type RemoveGitBranchesEntryQueryParams = {
|
1103
|
+
gitBranch: string;
|
1104
|
+
};
|
1105
|
+
declare type RemoveGitBranchesEntryError = ErrorWrapper<{
|
1106
|
+
status: 400;
|
1107
|
+
payload: BadRequestError;
|
1108
|
+
} | {
|
1109
|
+
status: 401;
|
1110
|
+
payload: AuthError;
|
1111
|
+
}>;
|
1112
|
+
declare type RemoveGitBranchesEntryVariables = {
|
1113
|
+
pathParams: RemoveGitBranchesEntryPathParams;
|
1114
|
+
queryParams: RemoveGitBranchesEntryQueryParams;
|
1115
|
+
} & FetcherExtraProps;
|
1116
|
+
/**
|
1117
|
+
* Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
|
1118
|
+
*
|
1119
|
+
* Example request:
|
1120
|
+
*
|
1121
|
+
* ```json
|
1122
|
+
* // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
|
1123
|
+
* ```
|
1124
|
+
*/
|
1125
|
+
declare const removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
1126
|
+
declare type ResolveBranchPathParams = {
|
1127
|
+
dbName: DBName;
|
1128
|
+
workspace: string;
|
1129
|
+
};
|
1130
|
+
declare type ResolveBranchQueryParams = {
|
1131
|
+
gitBranch?: string;
|
1132
|
+
fallbackBranch?: string;
|
1133
|
+
};
|
1134
|
+
declare type ResolveBranchError = ErrorWrapper<{
|
1135
|
+
status: 400;
|
1136
|
+
payload: BadRequestError;
|
1137
|
+
} | {
|
1138
|
+
status: 401;
|
1139
|
+
payload: AuthError;
|
1140
|
+
}>;
|
1141
|
+
declare type ResolveBranchResponse = {
|
1142
|
+
branch: string;
|
1143
|
+
reason: {
|
1144
|
+
code: 'FOUND_IN_MAPPING' | 'BRANCH_EXISTS' | 'FALLBACK_BRANCH' | 'DEFAULT_BRANCH';
|
1145
|
+
message: string;
|
1146
|
+
};
|
1147
|
+
};
|
1148
|
+
declare type ResolveBranchVariables = {
|
1149
|
+
pathParams: ResolveBranchPathParams;
|
1150
|
+
queryParams?: ResolveBranchQueryParams;
|
1151
|
+
} & FetcherExtraProps;
|
1152
|
+
/**
|
1153
|
+
* 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
|
1155
|
+
* * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
|
1156
|
+
* * else, return the default branch of the DB (currently `main` or the first branch)
|
1157
|
+
*
|
1158
|
+
* Example call:
|
1159
|
+
*
|
1160
|
+
* ```json
|
1161
|
+
* // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test?fallbackBranch=tsg
|
1162
|
+
* ```
|
1163
|
+
*
|
1164
|
+
* Example response:
|
1165
|
+
*
|
1166
|
+
* ```json
|
1167
|
+
* {
|
1168
|
+
* "branch": "main",
|
1169
|
+
* "reason": {
|
1170
|
+
* "code": "DEFAULT_BRANCH",
|
1171
|
+
* "message": "Default branch for this database (main)"
|
1172
|
+
* }
|
1173
|
+
* }
|
1174
|
+
* ```
|
1175
|
+
*/
|
1176
|
+
declare const resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
1003
1177
|
declare type GetBranchDetailsPathParams = {
|
1004
1178
|
dbBranchName: DBBranchName;
|
1005
1179
|
workspace: string;
|
@@ -1739,7 +1913,11 @@ declare type QueryTableVariables = {
|
|
1739
1913
|
* "link": {
|
1740
1914
|
* "table": "users"
|
1741
1915
|
* }
|
1742
|
-
* }
|
1916
|
+
* },
|
1917
|
+
* {
|
1918
|
+
* "name": "foundedDate",
|
1919
|
+
* "type": "datetime"
|
1920
|
+
* },
|
1743
1921
|
* ]
|
1744
1922
|
* },
|
1745
1923
|
* {
|
@@ -1892,7 +2070,8 @@ declare type QueryTableVariables = {
|
|
1892
2070
|
* "version": 0,
|
1893
2071
|
* },
|
1894
2072
|
* "name": "first team",
|
1895
|
-
* "code": "A1"
|
2073
|
+
* "code": "A1",
|
2074
|
+
* "foundedDate": "2020-03-04T10:43:54.32Z"
|
1896
2075
|
* }
|
1897
2076
|
* }
|
1898
2077
|
* ```
|
@@ -1907,7 +2086,7 @@ declare type QueryTableVariables = {
|
|
1907
2086
|
* `$none`, etc.
|
1908
2087
|
*
|
1909
2088
|
* All operators start with an `$` to differentiate them from column names
|
1910
|
-
* (which are not allowed to start with
|
2089
|
+
* (which are not allowed to start with a dollar sign).
|
1911
2090
|
*
|
1912
2091
|
* #### Exact matching and control operators
|
1913
2092
|
*
|
@@ -2108,7 +2287,7 @@ declare type QueryTableVariables = {
|
|
2108
2287
|
* }
|
2109
2288
|
* ```
|
2110
2289
|
*
|
2111
|
-
* #### Numeric ranges
|
2290
|
+
* #### Numeric or datetime ranges
|
2112
2291
|
*
|
2113
2292
|
* ```json
|
2114
2293
|
* {
|
@@ -2120,7 +2299,18 @@ declare type QueryTableVariables = {
|
|
2120
2299
|
* }
|
2121
2300
|
* }
|
2122
2301
|
* ```
|
2123
|
-
*
|
2302
|
+
* Date ranges support the same operators, with the date using the format defined in
|
2303
|
+
* [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
|
2304
|
+
* ```json
|
2305
|
+
* {
|
2306
|
+
* "filter": {
|
2307
|
+
* "<column_name>": {
|
2308
|
+
* "$gt": "2019-10-12T07:20:50.52Z",
|
2309
|
+
* "$lt": "2021-10-12T07:20:50.52Z"
|
2310
|
+
* }
|
2311
|
+
* }
|
2312
|
+
* }
|
2313
|
+
* ```
|
2124
2314
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
2125
2315
|
*
|
2126
2316
|
*
|
@@ -2440,6 +2630,10 @@ declare const operationsByTag: {
|
|
2440
2630
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2441
2631
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2442
2632
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
2633
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
2634
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
2635
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
2636
|
+
resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
2443
2637
|
};
|
2444
2638
|
branch: {
|
2445
2639
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
@@ -2490,6 +2684,9 @@ interface XataApiClientOptions {
|
|
2490
2684
|
apiKey?: string;
|
2491
2685
|
host?: HostProvider;
|
2492
2686
|
}
|
2687
|
+
/**
|
2688
|
+
* @deprecated Use XataApiPlugin instead
|
2689
|
+
*/
|
2493
2690
|
declare class XataApiClient {
|
2494
2691
|
#private;
|
2495
2692
|
constructor(options?: XataApiClientOptions);
|
@@ -2532,6 +2729,10 @@ declare class DatabaseApi {
|
|
2532
2729
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2533
2730
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2534
2731
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
2732
|
+
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2733
|
+
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2734
|
+
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
2735
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<ResolveBranchResponse>;
|
2535
2736
|
}
|
2536
2737
|
declare class BranchApi {
|
2537
2738
|
private extraProps;
|
@@ -2593,7 +2794,6 @@ declare type RequiredBy<T, K extends keyof T> = T & {
|
|
2593
2794
|
};
|
2594
2795
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2595
2796
|
declare type SingleOrArray<T> = T | T[];
|
2596
|
-
declare type Dictionary<T> = Record<string, T>;
|
2597
2797
|
|
2598
2798
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2599
2799
|
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
@@ -2789,11 +2989,11 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
2789
2989
|
};
|
2790
2990
|
|
2791
2991
|
declare type QueryOptions<T extends XataRecord> = {
|
2792
|
-
|
2992
|
+
pagination?: PaginationOptions;
|
2793
2993
|
columns?: NonEmptyArray<SelectableColumn<T>>;
|
2794
2994
|
filter?: FilterExpression;
|
2795
2995
|
sort?: SortFilter<T> | SortFilter<T>[];
|
2796
|
-
|
2996
|
+
cache?: number;
|
2797
2997
|
};
|
2798
2998
|
/**
|
2799
2999
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
@@ -2894,6 +3094,12 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
2894
3094
|
getFirst(): Promise<Result | null>;
|
2895
3095
|
getFirst(options: Omit<QueryOptions<Record>, 'columns' | 'page'>): Promise<Result | null>;
|
2896
3096
|
getFirst<Options extends RequiredBy<Omit<QueryOptions<Record>, 'page'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
3097
|
+
/**
|
3098
|
+
* Builds a new query object adding a cache TTL in milliseconds.
|
3099
|
+
* @param ttl The cache TTL in milliseconds.
|
3100
|
+
* @returns A new Query object.
|
3101
|
+
*/
|
3102
|
+
cache(ttl: number): Query<Record, Result>;
|
2897
3103
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
2898
3104
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
2899
3105
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
@@ -2983,8 +3189,6 @@ declare const PAGINATION_DEFAULT_SIZE = 200;
|
|
2983
3189
|
declare const PAGINATION_MAX_OFFSET = 800;
|
2984
3190
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
2985
3191
|
|
2986
|
-
declare type TableLink = string[];
|
2987
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
2988
3192
|
/**
|
2989
3193
|
* Common interface for performing operations on a table.
|
2990
3194
|
*/
|
@@ -3088,10 +3292,8 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3088
3292
|
declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record, SelectedPick<Record, ['*']>> implements Repository<Data, Record> {
|
3089
3293
|
#private;
|
3090
3294
|
db: SchemaPluginResult<any>;
|
3091
|
-
cache: CacheImpl;
|
3092
3295
|
constructor(options: {
|
3093
3296
|
table: string;
|
3094
|
-
links?: LinkDictionary;
|
3095
3297
|
db: SchemaPluginResult<any>;
|
3096
3298
|
pluginOptions: XataPluginOptions;
|
3097
3299
|
});
|
@@ -3187,16 +3389,16 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3187
3389
|
|
3188
3390
|
declare type SchemaDefinition = {
|
3189
3391
|
table: string;
|
3190
|
-
links?: LinkDictionary;
|
3191
3392
|
};
|
3192
3393
|
declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
3193
3394
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3395
|
+
} & {
|
3396
|
+
[key: string]: Repository<XataRecord$1>;
|
3194
3397
|
};
|
3195
3398
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3196
3399
|
#private;
|
3197
|
-
private links?;
|
3198
3400
|
private tableNames?;
|
3199
|
-
constructor(
|
3401
|
+
constructor(tableNames?: string[] | undefined);
|
3200
3402
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3201
3403
|
}
|
3202
3404
|
|
@@ -3218,8 +3420,7 @@ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3218
3420
|
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3219
3421
|
#private;
|
3220
3422
|
private db;
|
3221
|
-
|
3222
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
3423
|
+
constructor(db: SchemaPluginResult<Schemas>);
|
3223
3424
|
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3224
3425
|
}
|
3225
3426
|
declare type SearchXataRecord = XataRecord & {
|
@@ -3242,7 +3443,7 @@ declare type BaseClientOptions = {
|
|
3242
3443
|
};
|
3243
3444
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3244
3445
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3245
|
-
new <Schemas extends Record<string, BaseData
|
3446
|
+
new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, tables?: string[]): Omit<{
|
3246
3447
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
3247
3448
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3248
3449
|
}, keyof Plugins> & {
|
@@ -3258,7 +3459,7 @@ declare type BranchResolutionOptions = {
|
|
3258
3459
|
apiKey?: string;
|
3259
3460
|
fetchImpl?: FetchImpl;
|
3260
3461
|
};
|
3261
|
-
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string
|
3462
|
+
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
|
3262
3463
|
declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
|
3263
3464
|
declare function getDatabaseURL(): string | undefined;
|
3264
3465
|
|
@@ -3269,4 +3470,4 @@ declare class XataError extends Error {
|
|
3269
3470
|
constructor(message: string, status: number);
|
3270
3471
|
}
|
3271
3472
|
|
3272
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables,
|
3473
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationOptions, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|