@xata.io/client 0.2.2 → 0.5.0

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/api/client.d.ts +95 -0
  3. package/dist/api/client.js +235 -0
  4. package/dist/api/components.d.ts +1440 -0
  5. package/dist/api/components.js +1001 -0
  6. package/dist/api/fetcher.d.ts +25 -0
  7. package/dist/api/fetcher.js +78 -0
  8. package/dist/api/index.d.ts +7 -0
  9. package/dist/api/index.js +21 -0
  10. package/dist/api/parameters.d.ts +16 -0
  11. package/dist/api/parameters.js +2 -0
  12. package/dist/api/providers.d.ts +8 -0
  13. package/dist/api/providers.js +29 -0
  14. package/dist/api/responses.d.ts +44 -0
  15. package/dist/api/responses.js +2 -0
  16. package/dist/api/schemas.d.ts +311 -0
  17. package/dist/api/schemas.js +2 -0
  18. package/dist/index.d.ts +2 -133
  19. package/dist/index.js +16 -368
  20. package/dist/schema/filters.d.ts +20 -0
  21. package/dist/schema/filters.js +24 -0
  22. package/dist/schema/index.d.ts +6 -0
  23. package/dist/schema/index.js +26 -0
  24. package/dist/schema/operators.d.ts +72 -0
  25. package/dist/schema/operators.js +91 -0
  26. package/dist/schema/pagination.d.ts +83 -0
  27. package/dist/schema/pagination.js +94 -0
  28. package/dist/schema/query.d.ts +129 -0
  29. package/dist/schema/query.js +254 -0
  30. package/dist/schema/record.d.ts +44 -0
  31. package/dist/schema/record.js +2 -0
  32. package/dist/schema/repository.d.ts +104 -0
  33. package/dist/schema/repository.js +280 -0
  34. package/dist/schema/selection.d.ts +12 -0
  35. package/dist/schema/selection.js +2 -0
  36. package/dist/util/lang.d.ts +2 -0
  37. package/dist/util/lang.js +10 -0
  38. package/dist/util/types.d.ts +3 -0
  39. package/dist/util/types.js +2 -0
  40. package/package.json +3 -3
  41. package/dist/index.test.d.ts +0 -1
  42. package/dist/index.test.js +0 -304
  43. package/src/index.test.ts +0 -392
  44. package/src/index.ts +0 -506
@@ -0,0 +1,254 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12
+ if (kind === "m") throw new TypeError("Private method is not writable");
13
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
18
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
19
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
20
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
21
+ };
22
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
23
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
24
+ var m = o[Symbol.asyncIterator], i;
25
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
26
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
27
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
28
+ };
29
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
30
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
31
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
32
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
33
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
34
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
35
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
36
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
37
+ function fulfill(value) { resume("next", value); }
38
+ function reject(value) { resume("throw", value); }
39
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
40
+ };
41
+ var _Query_table, _Query_repository, _Query_data;
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.Query = void 0;
44
+ const lang_1 = require("../util/lang");
45
+ const pagination_1 = require("./pagination");
46
+ /**
47
+ * Query objects contain the information of all filters, sorting, etc. to be included in the database query.
48
+ *
49
+ * Query objects are immutable. Any method that adds more constraints or options to the query will return
50
+ * a new Query object containing the both the previous and the new constraints and options.
51
+ */
52
+ class Query {
53
+ constructor(repository, table, data, parent) {
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
55
+ _Query_table.set(this, void 0);
56
+ _Query_repository.set(this, void 0);
57
+ _Query_data.set(this, { filter: {} });
58
+ // Implements pagination
59
+ this.meta = { page: { cursor: 'start', more: true } };
60
+ this.records = [];
61
+ __classPrivateFieldSet(this, _Query_table, table, "f");
62
+ if (repository) {
63
+ __classPrivateFieldSet(this, _Query_repository, repository, "f");
64
+ }
65
+ else {
66
+ __classPrivateFieldSet(this, _Query_repository, this, "f");
67
+ }
68
+ __classPrivateFieldGet(this, _Query_data, "f").filter.$any = (_b = (_a = data.filter) === null || _a === void 0 ? void 0 : _a.$any) !== null && _b !== void 0 ? _b : (_c = parent === null || parent === void 0 ? void 0 : parent.filter) === null || _c === void 0 ? void 0 : _c.$any;
69
+ __classPrivateFieldGet(this, _Query_data, "f").filter.$all = (_e = (_d = data.filter) === null || _d === void 0 ? void 0 : _d.$all) !== null && _e !== void 0 ? _e : (_f = parent === null || parent === void 0 ? void 0 : parent.filter) === null || _f === void 0 ? void 0 : _f.$all;
70
+ __classPrivateFieldGet(this, _Query_data, "f").filter.$not = (_h = (_g = data.filter) === null || _g === void 0 ? void 0 : _g.$not) !== null && _h !== void 0 ? _h : (_j = parent === null || parent === void 0 ? void 0 : parent.filter) === null || _j === void 0 ? void 0 : _j.$not;
71
+ __classPrivateFieldGet(this, _Query_data, "f").filter.$none = (_l = (_k = data.filter) === null || _k === void 0 ? void 0 : _k.$none) !== null && _l !== void 0 ? _l : (_m = parent === null || parent === void 0 ? void 0 : parent.filter) === null || _m === void 0 ? void 0 : _m.$none;
72
+ __classPrivateFieldGet(this, _Query_data, "f").sort = (_o = data.sort) !== null && _o !== void 0 ? _o : parent === null || parent === void 0 ? void 0 : parent.sort;
73
+ __classPrivateFieldGet(this, _Query_data, "f").columns = (_q = (_p = data.columns) !== null && _p !== void 0 ? _p : parent === null || parent === void 0 ? void 0 : parent.columns) !== null && _q !== void 0 ? _q : ['*'];
74
+ this.any = this.any.bind(this);
75
+ this.all = this.all.bind(this);
76
+ this.not = this.not.bind(this);
77
+ this.filter = this.filter.bind(this);
78
+ this.sort = this.sort.bind(this);
79
+ this.none = this.none.bind(this);
80
+ Object.defineProperty(this, 'table', { enumerable: false });
81
+ Object.defineProperty(this, 'repository', { enumerable: false });
82
+ }
83
+ getQueryOptions() {
84
+ return __classPrivateFieldGet(this, _Query_data, "f");
85
+ }
86
+ /**
87
+ * Builds a new query object representing a logical OR between the given subqueries.
88
+ * @param queries An array of subqueries.
89
+ * @returns A new Query object.
90
+ */
91
+ any(...queries) {
92
+ const $any = queries.map((query) => query.getQueryOptions().filter);
93
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { filter: { $any } }, __classPrivateFieldGet(this, _Query_data, "f"));
94
+ }
95
+ /**
96
+ * Builds a new query object representing a logical AND between the given subqueries.
97
+ * @param queries An array of subqueries.
98
+ * @returns A new Query object.
99
+ */
100
+ all(...queries) {
101
+ const $all = queries.map((query) => query.getQueryOptions().filter);
102
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { filter: { $all } }, __classPrivateFieldGet(this, _Query_data, "f"));
103
+ }
104
+ /**
105
+ * Builds a new query object representing a logical OR negating each subquery. In pseudo-code: !q1 OR !q2
106
+ * @param queries An array of subqueries.
107
+ * @returns A new Query object.
108
+ */
109
+ not(...queries) {
110
+ const $not = queries.map((query) => query.getQueryOptions().filter);
111
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { filter: { $not } }, __classPrivateFieldGet(this, _Query_data, "f"));
112
+ }
113
+ /**
114
+ * Builds a new query object representing a logical AND negating each subquery. In pseudo-code: !q1 AND !q2
115
+ * @param queries An array of subqueries.
116
+ * @returns A new Query object.
117
+ */
118
+ none(...queries) {
119
+ const $none = queries.map((query) => query.getQueryOptions().filter);
120
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { filter: { $none } }, __classPrivateFieldGet(this, _Query_data, "f"));
121
+ }
122
+ filter(a, b) {
123
+ if (arguments.length === 1) {
124
+ const constraints = Object.entries(a).map(([column, constraint]) => ({ [column]: constraint }));
125
+ const $all = (0, lang_1.compact)([__classPrivateFieldGet(this, _Query_data, "f").filter.$all].flat().concat(constraints));
126
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { filter: { $all } }, __classPrivateFieldGet(this, _Query_data, "f"));
127
+ }
128
+ else {
129
+ const column = a;
130
+ const value = b;
131
+ const $all = (0, lang_1.compact)([__classPrivateFieldGet(this, _Query_data, "f").filter.$all].flat().concat({ [column]: value }));
132
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { filter: { $all } }, __classPrivateFieldGet(this, _Query_data, "f"));
133
+ }
134
+ }
135
+ /**
136
+ * Builds a new query with a new sort option.
137
+ * @param column The column name.
138
+ * @param direction The direction. Either ascending or descending.
139
+ * @returns A new Query object.
140
+ */
141
+ sort(column, direction) {
142
+ const sort = Object.assign(Object.assign({}, __classPrivateFieldGet(this, _Query_data, "f").sort), { [column]: direction });
143
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { sort }, __classPrivateFieldGet(this, _Query_data, "f"));
144
+ }
145
+ /**
146
+ * Builds a new query specifying the set of columns to be returned in the query response.
147
+ * @param columns Array of column names to be returned by the query.
148
+ * @returns A new Query object.
149
+ */
150
+ select(columns) {
151
+ return new Query(__classPrivateFieldGet(this, _Query_repository, "f"), __classPrivateFieldGet(this, _Query_table, "f"), { columns }, __classPrivateFieldGet(this, _Query_data, "f"));
152
+ }
153
+ getPaginated(options = {}) {
154
+ return __classPrivateFieldGet(this, _Query_repository, "f").query(this, options);
155
+ }
156
+ [(_Query_table = new WeakMap(), _Query_repository = new WeakMap(), _Query_data = new WeakMap(), Symbol.asyncIterator)]() {
157
+ return __asyncGenerator(this, arguments, function* _a() {
158
+ var e_1, _b;
159
+ try {
160
+ for (var _c = __asyncValues(this.getIterator(1)), _d; _d = yield __await(_c.next()), !_d.done;) {
161
+ const [record] = _d.value;
162
+ yield yield __await(record);
163
+ }
164
+ }
165
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
166
+ finally {
167
+ try {
168
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
169
+ }
170
+ finally { if (e_1) throw e_1.error; }
171
+ }
172
+ });
173
+ }
174
+ getIterator(chunk, options = {}) {
175
+ return __asyncGenerator(this, arguments, function* getIterator_1() {
176
+ let offset = 0;
177
+ let end = false;
178
+ while (!end) {
179
+ const { records, meta } = yield __await(this.getPaginated(Object.assign(Object.assign({}, options), { page: { size: chunk, offset } })));
180
+ yield yield __await(records);
181
+ offset += chunk;
182
+ end = !meta.page.more;
183
+ }
184
+ });
185
+ }
186
+ /**
187
+ * Performs the query in the database and returns a set of results.
188
+ * @param options Additional options to be used when performing the query.
189
+ * @returns An array of records from the database.
190
+ */
191
+ getMany(options = {}) {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ const { records } = yield this.getPaginated(options);
194
+ return records;
195
+ });
196
+ }
197
+ /**
198
+ * Performs the query in the database and returns all the results.
199
+ * Warning: If there are a large number of results, this method can have performance implications.
200
+ * @param options Additional options to be used when performing the query.
201
+ * @returns An array of records from the database.
202
+ */
203
+ getAll(chunk = pagination_1.PAGINATION_MAX_SIZE, options = {}) {
204
+ var e_2, _a;
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ const results = [];
207
+ try {
208
+ for (var _b = __asyncValues(this.getIterator(chunk, options)), _c; _c = yield _b.next(), !_c.done;) {
209
+ const page = _c.value;
210
+ results.push(...page);
211
+ }
212
+ }
213
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
214
+ finally {
215
+ try {
216
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
217
+ }
218
+ finally { if (e_2) throw e_2.error; }
219
+ }
220
+ return results;
221
+ });
222
+ }
223
+ /**
224
+ * Performs the query in the database and returns the first result.
225
+ * @param options Additional options to be used when performing the query.
226
+ * @returns The first record that matches the query, or null if no record matched the query.
227
+ */
228
+ getOne(options = {}) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ const records = yield this.getMany(Object.assign(Object.assign({}, options), { page: { size: 1 } }));
231
+ return records[0] || null;
232
+ });
233
+ }
234
+ /**async deleteAll(): Promise<number> {
235
+ // TODO: Return number of affected rows
236
+ return 0;
237
+ }**/
238
+ nextPage(size, offset) {
239
+ return this.firstPage(size, offset);
240
+ }
241
+ previousPage(size, offset) {
242
+ return this.firstPage(size, offset);
243
+ }
244
+ firstPage(size, offset) {
245
+ return this.getPaginated({ page: { size, offset } });
246
+ }
247
+ lastPage(size, offset) {
248
+ return this.getPaginated({ page: { size, offset, before: 'end' } });
249
+ }
250
+ hasNextPage() {
251
+ return this.meta.page.more;
252
+ }
253
+ }
254
+ exports.Query = Query;
@@ -0,0 +1,44 @@
1
+ import { Selectable } from './selection';
2
+ /**
3
+ * Represents an identifiable record from the database.
4
+ */
5
+ export interface Identifiable {
6
+ /**
7
+ * Unique id of this record.
8
+ */
9
+ id: string;
10
+ }
11
+ export interface BaseData {
12
+ [key: string]: any;
13
+ }
14
+ /**
15
+ * Represents a persisted record from the database.
16
+ */
17
+ export interface XataRecord extends Identifiable {
18
+ /**
19
+ * Metadata of this record.
20
+ */
21
+ xata: {
22
+ /**
23
+ * Number that is increased every time the record is updated.
24
+ */
25
+ version: number;
26
+ };
27
+ /**
28
+ * Retrieves a refreshed copy of the current record from the database.
29
+ */
30
+ read(): Promise<this>;
31
+ /**
32
+ * Performs a partial update of the current record. On success a new object is
33
+ * returned and the current object is not mutated.
34
+ * @param data The columns and their values that have to be updated.
35
+ * @returns A new record containing the latest values for all the columns of the current record.
36
+ */
37
+ update(data: Partial<Selectable<this>>): Promise<this>;
38
+ /**
39
+ * Performs a deletion of the current record in the database.
40
+ *
41
+ * @throws If the record was already deleted or if an error happened while performing the deletion.
42
+ */
43
+ delete(): Promise<void>;
44
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,104 @@
1
+ import { FetchImpl } from '../api/fetcher';
2
+ import { Page } from './pagination';
3
+ import { Query, QueryOptions } from './query';
4
+ import { BaseData, XataRecord } from './record';
5
+ import { Select, SelectableColumn } from './selection';
6
+ export declare type Links = Record<string, Array<string[]>>;
7
+ /**
8
+ * Common interface for performing operations on a table.
9
+ */
10
+ export declare abstract class Repository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Query<Record> {
11
+ abstract create(object: Data): Promise<Record>;
12
+ /**
13
+ * Creates multiple records in the table.
14
+ * @param objects Array of objects with the column names and the values to be stored in the table.
15
+ * @returns Array of the persisted records.
16
+ */
17
+ abstract createMany(objects: Data[]): Promise<Record[]>;
18
+ /**
19
+ * Queries a single record from the table given its unique id.
20
+ * @param id The unique id.
21
+ * @returns The persisted record for the given id or null if the record could not be found.
22
+ */
23
+ abstract read(id: string): Promise<Record | null>;
24
+ /**
25
+ * Insert a single record with a unique id.
26
+ * @param id The unique id.
27
+ * @param object Object containing the column names with their values to be stored in the table.
28
+ * @returns The full persisted record.
29
+ */
30
+ abstract insert(id: string, object: Data): Promise<Record>;
31
+ /**
32
+ * Partially update a single record given its unique id.
33
+ * @param id The unique id.
34
+ * @param object The column names and their values that have to be updatd.
35
+ * @returns The full persisted record.
36
+ */
37
+ abstract update(id: string, object: Partial<Data>): Promise<Record>;
38
+ /**
39
+ * Updates or inserts a single record. If a record exists with the given id,
40
+ * it will be update, otherwise a new record will be created.
41
+ * @param id A unique id.
42
+ * @param object The column names and the values to be persisted.
43
+ * @returns The full persisted record.
44
+ */
45
+ abstract updateOrInsert(id: string, object: Data): Promise<Record>;
46
+ /**
47
+ * Deletes a record given its unique id.
48
+ * @param id The unique id.
49
+ * @throws If the record could not be found or there was an error while performing the deletion.
50
+ */
51
+ abstract delete(id: string): void;
52
+ abstract query<Result extends XataRecord, Options extends QueryOptions<Record>>(query: Query<Record, Result>, options: Options): Promise<Page<Record, typeof options extends {
53
+ columns: SelectableColumn<Data>[];
54
+ } ? Select<Data, typeof options['columns'][number]> : Result>>;
55
+ }
56
+ export declare class RestRepository<Data extends BaseData, Record extends XataRecord = Data & XataRecord> extends Repository<Data, Record> {
57
+ #private;
58
+ constructor(client: BaseClient<any>, table: string);
59
+ create(object: Data): Promise<Record>;
60
+ createMany(objects: Data[]): Promise<Record[]>;
61
+ read(recordId: string): Promise<Record | null>;
62
+ update(recordId: string, object: Partial<Data>): Promise<Record>;
63
+ insert(recordId: string, object: Data): Promise<Record>;
64
+ updateOrInsert(recordId: string, object: Data): Promise<Record>;
65
+ delete(recordId: string): Promise<void>;
66
+ query<Result extends XataRecord, Options extends QueryOptions<Record>>(query: Query<Record, Result>, options?: Options): Promise<Page<Record, typeof options extends {
67
+ columns: SelectableColumn<Data>[];
68
+ } ? Select<Data, typeof options['columns'][number]> : Result>>;
69
+ }
70
+ interface RepositoryFactory {
71
+ createRepository<Data extends BaseData>(client: BaseClient<any>, table: string): Repository<Data>;
72
+ }
73
+ export declare class RestRespositoryFactory implements RepositoryFactory {
74
+ createRepository<Data extends BaseData>(client: BaseClient<any>, table: string): Repository<Data>;
75
+ }
76
+ declare type BranchStrategyValue = string | undefined | null;
77
+ declare type BranchStrategyBuilder = () => BranchStrategyValue | Promise<BranchStrategyValue>;
78
+ declare type BranchStrategy = BranchStrategyValue | BranchStrategyBuilder;
79
+ declare type BranchStrategyOption = NonNullable<BranchStrategy | BranchStrategy[]>;
80
+ export declare type XataClientOptions = {
81
+ /**
82
+ * Fetch implementation. This option is only required if the runtime does not include a fetch implementation
83
+ * available in the global scope. If you are running your code on Deno or Cloudflare workers for example,
84
+ * you won't need to provide a specific fetch implementation. But for most versions of Node.js you'll need
85
+ * to provide one. Such as cross-fetch, node-fetch or isomorphic-fetch.
86
+ */
87
+ fetch?: FetchImpl;
88
+ databaseURL?: string;
89
+ branch: BranchStrategyOption;
90
+ /**
91
+ * API key to be used. You can create one in your account settings at https://app.xata.io/settings.
92
+ */
93
+ apiKey: string;
94
+ repositoryFactory?: RepositoryFactory;
95
+ };
96
+ export declare class BaseClient<D extends Record<string, Repository<any>> = Record<string, Repository<any>>> {
97
+ #private;
98
+ options: XataClientOptions;
99
+ db: D;
100
+ constructor(options: XataClientOptions, links?: Links);
101
+ initObject<T>(table: string, object: object): T;
102
+ getBranch(): Promise<string>;
103
+ }
104
+ export {};