@xata.io/client 0.0.0-alpha.vf2696e7 → 0.0.0-alpha.vf27674a
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 +42 -0
- package/dist/index.cjs +263 -154
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +235 -32
- package/dist/index.mjs +259 -155
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -138,6 +138,12 @@ declare type ListBranchesResponse = {
|
|
138
138
|
displayName: string;
|
139
139
|
branches: Branch[];
|
140
140
|
};
|
141
|
+
declare type ListGitBranchesResponse = {
|
142
|
+
mapping: {
|
143
|
+
gitBranch: string;
|
144
|
+
xataBranch: string;
|
145
|
+
}[];
|
146
|
+
};
|
141
147
|
declare type Branch = {
|
142
148
|
name: string;
|
143
149
|
createdAt: DateTime;
|
@@ -186,7 +192,7 @@ declare type Table = {
|
|
186
192
|
*/
|
187
193
|
declare type Column = {
|
188
194
|
name: string;
|
189
|
-
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object';
|
195
|
+
type: 'bool' | 'int' | 'float' | 'string' | 'text' | 'email' | 'multiple' | 'link' | 'object' | 'datetime';
|
190
196
|
link?: {
|
191
197
|
table: string;
|
192
198
|
};
|
@@ -382,6 +388,7 @@ type schemas_WorkspaceMembers = WorkspaceMembers;
|
|
382
388
|
type schemas_InviteKey = InviteKey;
|
383
389
|
type schemas_ListDatabasesResponse = ListDatabasesResponse;
|
384
390
|
type schemas_ListBranchesResponse = ListBranchesResponse;
|
391
|
+
type schemas_ListGitBranchesResponse = ListGitBranchesResponse;
|
385
392
|
type schemas_Branch = Branch;
|
386
393
|
type schemas_BranchMetadata = BranchMetadata;
|
387
394
|
type schemas_DBBranch = DBBranch;
|
@@ -434,6 +441,7 @@ declare namespace schemas {
|
|
434
441
|
schemas_InviteKey as InviteKey,
|
435
442
|
schemas_ListDatabasesResponse as ListDatabasesResponse,
|
436
443
|
schemas_ListBranchesResponse as ListBranchesResponse,
|
444
|
+
schemas_ListGitBranchesResponse as ListGitBranchesResponse,
|
437
445
|
schemas_Branch as Branch,
|
438
446
|
schemas_BranchMetadata as BranchMetadata,
|
439
447
|
schemas_DBBranch as DBBranch,
|
@@ -1010,6 +1018,162 @@ declare type DeleteDatabaseVariables = {
|
|
1010
1018
|
* Delete a database and all of its branches and tables permanently.
|
1011
1019
|
*/
|
1012
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>;
|
1013
1177
|
declare type GetBranchDetailsPathParams = {
|
1014
1178
|
dbBranchName: DBBranchName;
|
1015
1179
|
workspace: string;
|
@@ -1750,7 +1914,11 @@ declare type QueryTableVariables = {
|
|
1750
1914
|
* "link": {
|
1751
1915
|
* "table": "users"
|
1752
1916
|
* }
|
1753
|
-
* }
|
1917
|
+
* },
|
1918
|
+
* {
|
1919
|
+
* "name": "foundedDate",
|
1920
|
+
* "type": "datetime"
|
1921
|
+
* },
|
1754
1922
|
* ]
|
1755
1923
|
* },
|
1756
1924
|
* {
|
@@ -1897,7 +2065,8 @@ declare type QueryTableVariables = {
|
|
1897
2065
|
* "version": 0
|
1898
2066
|
* },
|
1899
2067
|
* "name": "first team",
|
1900
|
-
* "code": "A1"
|
2068
|
+
* "code": "A1",
|
2069
|
+
* "foundedDate": "2020-03-04T10:43:54.32Z"
|
1901
2070
|
* }
|
1902
2071
|
* }
|
1903
2072
|
* ```
|
@@ -1912,7 +2081,7 @@ declare type QueryTableVariables = {
|
|
1912
2081
|
* `$none`, etc.
|
1913
2082
|
*
|
1914
2083
|
* All operators start with an `$` to differentiate them from column names
|
1915
|
-
* (which are not allowed to start with
|
2084
|
+
* (which are not allowed to start with a dollar sign).
|
1916
2085
|
*
|
1917
2086
|
* #### Exact matching and control operators
|
1918
2087
|
*
|
@@ -2113,7 +2282,7 @@ declare type QueryTableVariables = {
|
|
2113
2282
|
* }
|
2114
2283
|
* ```
|
2115
2284
|
*
|
2116
|
-
* #### Numeric ranges
|
2285
|
+
* #### Numeric or datetime ranges
|
2117
2286
|
*
|
2118
2287
|
* ```json
|
2119
2288
|
* {
|
@@ -2125,7 +2294,18 @@ declare type QueryTableVariables = {
|
|
2125
2294
|
* }
|
2126
2295
|
* }
|
2127
2296
|
* ```
|
2128
|
-
*
|
2297
|
+
* Date ranges support the same operators, with the date using the format defined in
|
2298
|
+
* [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
|
2299
|
+
* ```json
|
2300
|
+
* {
|
2301
|
+
* "filter": {
|
2302
|
+
* "<column_name>": {
|
2303
|
+
* "$gt": "2019-10-12T07:20:50.52Z",
|
2304
|
+
* "$lt": "2021-10-12T07:20:50.52Z"
|
2305
|
+
* }
|
2306
|
+
* }
|
2307
|
+
* }
|
2308
|
+
* ```
|
2129
2309
|
* The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
|
2130
2310
|
*
|
2131
2311
|
* #### Negations
|
@@ -2447,6 +2627,10 @@ declare const operationsByTag: {
|
|
2447
2627
|
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<ListDatabasesResponse>;
|
2448
2628
|
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>;
|
2449
2629
|
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>;
|
2630
|
+
getGitBranchesMapping: (variables: GetGitBranchesMappingVariables) => Promise<ListGitBranchesResponse>;
|
2631
|
+
addGitBranchesEntry: (variables: AddGitBranchesEntryVariables) => Promise<AddGitBranchesEntryResponse>;
|
2632
|
+
removeGitBranchesEntry: (variables: RemoveGitBranchesEntryVariables) => Promise<undefined>;
|
2633
|
+
resolveBranch: (variables: ResolveBranchVariables) => Promise<ResolveBranchResponse>;
|
2450
2634
|
};
|
2451
2635
|
branch: {
|
2452
2636
|
getBranchList: (variables: GetBranchListVariables) => Promise<ListBranchesResponse>;
|
@@ -2497,6 +2681,9 @@ interface XataApiClientOptions {
|
|
2497
2681
|
apiKey?: string;
|
2498
2682
|
host?: HostProvider;
|
2499
2683
|
}
|
2684
|
+
/**
|
2685
|
+
* @deprecated Use XataApiPlugin instead
|
2686
|
+
*/
|
2500
2687
|
declare class XataApiClient {
|
2501
2688
|
#private;
|
2502
2689
|
constructor(options?: XataApiClientOptions);
|
@@ -2539,6 +2726,10 @@ declare class DatabaseApi {
|
|
2539
2726
|
getDatabaseList(workspace: WorkspaceID): Promise<ListDatabasesResponse>;
|
2540
2727
|
createDatabase(workspace: WorkspaceID, dbName: DBName, options?: CreateDatabaseRequestBody): Promise<CreateDatabaseResponse>;
|
2541
2728
|
deleteDatabase(workspace: WorkspaceID, dbName: DBName): Promise<void>;
|
2729
|
+
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2730
|
+
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2731
|
+
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
2732
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<ResolveBranchResponse>;
|
2542
2733
|
}
|
2543
2734
|
declare class BranchApi {
|
2544
2735
|
private extraProps;
|
@@ -2600,7 +2791,7 @@ declare type RequiredBy<T, K extends keyof T> = T & {
|
|
2600
2791
|
};
|
2601
2792
|
declare type GetArrayInnerType<T extends readonly any[]> = T[number];
|
2602
2793
|
declare type SingleOrArray<T> = T | T[];
|
2603
|
-
declare type
|
2794
|
+
declare type OmitBy<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
|
2604
2795
|
|
2605
2796
|
declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | DataProps<O> | NestedColumns<O, RecursivePath>;
|
2606
2797
|
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
@@ -2795,13 +2986,21 @@ declare type SortFilterBase<T extends XataRecord> = {
|
|
2795
2986
|
[Key in StringKeys<T>]: SortDirection;
|
2796
2987
|
};
|
2797
2988
|
|
2798
|
-
declare type
|
2799
|
-
page?: PaginationOptions;
|
2989
|
+
declare type BaseOptions<T extends XataRecord> = {
|
2800
2990
|
columns?: NonEmptyArray<SelectableColumn<T>>;
|
2991
|
+
cache?: number;
|
2992
|
+
};
|
2993
|
+
declare type CursorQueryOptions = {
|
2994
|
+
pagination?: CursorNavigationOptions & OffsetNavigationOptions;
|
2995
|
+
filter?: never;
|
2996
|
+
sort?: never;
|
2997
|
+
};
|
2998
|
+
declare type OffsetQueryOptions<T extends XataRecord> = {
|
2999
|
+
pagination?: OffsetNavigationOptions;
|
2801
3000
|
filter?: FilterExpression;
|
2802
3001
|
sort?: SortFilter<T> | SortFilter<T>[];
|
2803
|
-
cache?: number;
|
2804
3002
|
};
|
3003
|
+
declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryOptions | OffsetQueryOptions<T>);
|
2805
3004
|
/**
|
2806
3005
|
* Query objects contain the information of all filters, sorting, etc. to be included in the database query.
|
2807
3006
|
*
|
@@ -2870,19 +3069,23 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
2870
3069
|
*/
|
2871
3070
|
select<K extends SelectableColumn<Record>>(columns: NonEmptyArray<K>): Query<Record, SelectedPick<Record, NonEmptyArray<K>>>;
|
2872
3071
|
getPaginated(): Promise<Page<Record, Result>>;
|
2873
|
-
getPaginated(options:
|
3072
|
+
getPaginated(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Page<Record, Result>>;
|
2874
3073
|
getPaginated<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<Page<Record, SelectedPick<Record, typeof options['columns']>>>;
|
2875
3074
|
[Symbol.asyncIterator](): AsyncIterableIterator<Result>;
|
2876
|
-
getIterator(
|
2877
|
-
getIterator(
|
2878
|
-
|
3075
|
+
getIterator(): AsyncGenerator<Result[]>;
|
3076
|
+
getIterator(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3077
|
+
batchSize?: number;
|
3078
|
+
}): AsyncGenerator<Result[]>;
|
3079
|
+
getIterator<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3080
|
+
batchSize?: number;
|
3081
|
+
}>(options: Options): AsyncGenerator<SelectedPick<Record, typeof options['columns']>[]>;
|
2879
3082
|
/**
|
2880
3083
|
* Performs the query in the database and returns a set of results.
|
2881
3084
|
* @param options Additional options to be used when performing the query.
|
2882
3085
|
* @returns An array of records from the database.
|
2883
3086
|
*/
|
2884
3087
|
getMany(): Promise<Result[]>;
|
2885
|
-
getMany(options:
|
3088
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<Result[]>;
|
2886
3089
|
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
2887
3090
|
/**
|
2888
3091
|
* Performs the query in the database and returns all the results.
|
@@ -2890,17 +3093,21 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
2890
3093
|
* @param options Additional options to be used when performing the query.
|
2891
3094
|
* @returns An array of records from the database.
|
2892
3095
|
*/
|
2893
|
-
getAll(
|
2894
|
-
getAll(
|
2895
|
-
|
3096
|
+
getAll(): Promise<Result[]>;
|
3097
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3098
|
+
batchSize?: number;
|
3099
|
+
}): Promise<Result[]>;
|
3100
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3101
|
+
batchSize?: number;
|
3102
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
2896
3103
|
/**
|
2897
3104
|
* Performs the query in the database and returns the first result.
|
2898
3105
|
* @param options Additional options to be used when performing the query.
|
2899
3106
|
* @returns The first record that matches the query, or null if no record matched the query.
|
2900
3107
|
*/
|
2901
3108
|
getFirst(): Promise<Result | null>;
|
2902
|
-
getFirst(options:
|
2903
|
-
getFirst<Options extends RequiredBy<
|
3109
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
3110
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
2904
3111
|
/**
|
2905
3112
|
* Builds a new query object adding a cache TTL in milliseconds.
|
2906
3113
|
* @param ttl The cache TTL in milliseconds.
|
@@ -2990,14 +3197,11 @@ declare type OffsetNavigationOptions = {
|
|
2990
3197
|
size?: number;
|
2991
3198
|
offset?: number;
|
2992
3199
|
};
|
2993
|
-
declare type PaginationOptions = CursorNavigationOptions & OffsetNavigationOptions;
|
2994
3200
|
declare const PAGINATION_MAX_SIZE = 200;
|
2995
3201
|
declare const PAGINATION_DEFAULT_SIZE = 200;
|
2996
3202
|
declare const PAGINATION_MAX_OFFSET = 800;
|
2997
3203
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
2998
3204
|
|
2999
|
-
declare type TableLink = string[];
|
3000
|
-
declare type LinkDictionary = Dictionary<TableLink[]>;
|
3001
3205
|
/**
|
3002
3206
|
* Common interface for performing operations on a table.
|
3003
3207
|
*/
|
@@ -3103,7 +3307,6 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
3103
3307
|
db: SchemaPluginResult<any>;
|
3104
3308
|
constructor(options: {
|
3105
3309
|
table: string;
|
3106
|
-
links?: LinkDictionary;
|
3107
3310
|
db: SchemaPluginResult<any>;
|
3108
3311
|
pluginOptions: XataPluginOptions;
|
3109
3312
|
});
|
@@ -3199,16 +3402,16 @@ declare const includesAny: <T>(value: T) => ArrayFilter<T>;
|
|
3199
3402
|
|
3200
3403
|
declare type SchemaDefinition = {
|
3201
3404
|
table: string;
|
3202
|
-
links?: LinkDictionary;
|
3203
3405
|
};
|
3204
3406
|
declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
3205
3407
|
[Key in keyof Schemas]: Repository<Schemas[Key]>;
|
3408
|
+
} & {
|
3409
|
+
[key: string]: Repository<XataRecord$1>;
|
3206
3410
|
};
|
3207
3411
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3208
3412
|
#private;
|
3209
|
-
private links?;
|
3210
3413
|
private tableNames?;
|
3211
|
-
constructor(
|
3414
|
+
constructor(tableNames?: string[] | undefined);
|
3212
3415
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3213
3416
|
}
|
3214
3417
|
|
@@ -3230,8 +3433,7 @@ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3230
3433
|
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3231
3434
|
#private;
|
3232
3435
|
private db;
|
3233
|
-
|
3234
|
-
constructor(db: SchemaPluginResult<Schemas>, links: LinkDictionary);
|
3436
|
+
constructor(db: SchemaPluginResult<Schemas>);
|
3235
3437
|
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3236
3438
|
}
|
3237
3439
|
declare type SearchXataRecord = XataRecord & {
|
@@ -3254,7 +3456,7 @@ declare type BaseClientOptions = {
|
|
3254
3456
|
};
|
3255
3457
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3256
3458
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3257
|
-
new <Schemas extends Record<string, BaseData
|
3459
|
+
new <Schemas extends Record<string, BaseData> = {}>(options?: Partial<BaseClientOptions>, tables?: string[]): Omit<{
|
3258
3460
|
db: Awaited<ReturnType<SchemaPlugin<Schemas>['build']>>;
|
3259
3461
|
search: Awaited<ReturnType<SearchPlugin<Schemas>['build']>>;
|
3260
3462
|
}, keyof Plugins> & {
|
@@ -3265,12 +3467,13 @@ declare const BaseClient_base: ClientConstructor<{}>;
|
|
3265
3467
|
declare class BaseClient extends BaseClient_base<Record<string, any>> {
|
3266
3468
|
}
|
3267
3469
|
|
3470
|
+
declare const defaultBranch = "main";
|
3268
3471
|
declare type BranchResolutionOptions = {
|
3269
3472
|
databaseURL?: string;
|
3270
3473
|
apiKey?: string;
|
3271
3474
|
fetchImpl?: FetchImpl;
|
3272
3475
|
};
|
3273
|
-
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string>;
|
3476
|
+
declare function getCurrentBranchName(options?: BranchResolutionOptions): Promise<string | undefined>;
|
3274
3477
|
declare function getCurrentBranchDetails(options?: BranchResolutionOptions): Promise<DBBranch | null>;
|
3275
3478
|
declare function getDatabaseURL(): string | undefined;
|
3276
3479
|
|
@@ -3281,4 +3484,4 @@ declare class XataError extends Error {
|
|
3281
3484
|
constructor(message: string, status: number);
|
3282
3485
|
}
|
3283
3486
|
|
3284
|
-
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,
|
3487
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, 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, defaultBranch, 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 };
|