@xata.io/client 0.0.0-alpha.vf3ed7b8 → 0.0.0-alpha.vf6d8daa
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/dist/index.cjs +280 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +29 -7
- package/dist/index.mjs +280 -143
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -10,6 +10,13 @@ function isObject(value) {
|
|
10
10
|
function isString(value) {
|
11
11
|
return value !== void 0 && value !== null && typeof value === "string";
|
12
12
|
}
|
13
|
+
function toBase64(value) {
|
14
|
+
try {
|
15
|
+
return btoa(value);
|
16
|
+
} catch (err) {
|
17
|
+
return Buffer.from(value).toString("base64");
|
18
|
+
}
|
19
|
+
}
|
13
20
|
|
14
21
|
function getEnvVariable(name) {
|
15
22
|
try {
|
@@ -432,35 +439,35 @@ function isValidBuilder(builder) {
|
|
432
439
|
return isObject(builder) && isString(builder.main) && isString(builder.workspaces);
|
433
440
|
}
|
434
441
|
|
435
|
-
var __accessCheck$
|
442
|
+
var __accessCheck$7 = (obj, member, msg) => {
|
436
443
|
if (!member.has(obj))
|
437
444
|
throw TypeError("Cannot " + msg);
|
438
445
|
};
|
439
|
-
var __privateGet$
|
440
|
-
__accessCheck$
|
446
|
+
var __privateGet$6 = (obj, member, getter) => {
|
447
|
+
__accessCheck$7(obj, member, "read from private field");
|
441
448
|
return getter ? getter.call(obj) : member.get(obj);
|
442
449
|
};
|
443
|
-
var __privateAdd$
|
450
|
+
var __privateAdd$7 = (obj, member, value) => {
|
444
451
|
if (member.has(obj))
|
445
452
|
throw TypeError("Cannot add the same private member more than once");
|
446
453
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
447
454
|
};
|
448
|
-
var __privateSet$
|
449
|
-
__accessCheck$
|
455
|
+
var __privateSet$5 = (obj, member, value, setter) => {
|
456
|
+
__accessCheck$7(obj, member, "write to private field");
|
450
457
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
451
458
|
return value;
|
452
459
|
};
|
453
460
|
var _extraProps, _namespaces;
|
454
461
|
class XataApiClient {
|
455
462
|
constructor(options = {}) {
|
456
|
-
__privateAdd$
|
457
|
-
__privateAdd$
|
463
|
+
__privateAdd$7(this, _extraProps, void 0);
|
464
|
+
__privateAdd$7(this, _namespaces, {});
|
458
465
|
const provider = options.host ?? "production";
|
459
466
|
const apiKey = options?.apiKey ?? getAPIKey();
|
460
467
|
if (!apiKey) {
|
461
468
|
throw new Error("Could not resolve a valid apiKey");
|
462
469
|
}
|
463
|
-
__privateSet$
|
470
|
+
__privateSet$5(this, _extraProps, {
|
464
471
|
apiUrl: getHostUrl(provider, "main"),
|
465
472
|
workspacesApiUrl: getHostUrl(provider, "workspaces"),
|
466
473
|
fetchImpl: getFetchImplementation(options.fetch),
|
@@ -468,34 +475,34 @@ class XataApiClient {
|
|
468
475
|
});
|
469
476
|
}
|
470
477
|
get user() {
|
471
|
-
if (!__privateGet$
|
472
|
-
__privateGet$
|
473
|
-
return __privateGet$
|
478
|
+
if (!__privateGet$6(this, _namespaces).user)
|
479
|
+
__privateGet$6(this, _namespaces).user = new UserApi(__privateGet$6(this, _extraProps));
|
480
|
+
return __privateGet$6(this, _namespaces).user;
|
474
481
|
}
|
475
482
|
get workspaces() {
|
476
|
-
if (!__privateGet$
|
477
|
-
__privateGet$
|
478
|
-
return __privateGet$
|
483
|
+
if (!__privateGet$6(this, _namespaces).workspaces)
|
484
|
+
__privateGet$6(this, _namespaces).workspaces = new WorkspaceApi(__privateGet$6(this, _extraProps));
|
485
|
+
return __privateGet$6(this, _namespaces).workspaces;
|
479
486
|
}
|
480
487
|
get databases() {
|
481
|
-
if (!__privateGet$
|
482
|
-
__privateGet$
|
483
|
-
return __privateGet$
|
488
|
+
if (!__privateGet$6(this, _namespaces).databases)
|
489
|
+
__privateGet$6(this, _namespaces).databases = new DatabaseApi(__privateGet$6(this, _extraProps));
|
490
|
+
return __privateGet$6(this, _namespaces).databases;
|
484
491
|
}
|
485
492
|
get branches() {
|
486
|
-
if (!__privateGet$
|
487
|
-
__privateGet$
|
488
|
-
return __privateGet$
|
493
|
+
if (!__privateGet$6(this, _namespaces).branches)
|
494
|
+
__privateGet$6(this, _namespaces).branches = new BranchApi(__privateGet$6(this, _extraProps));
|
495
|
+
return __privateGet$6(this, _namespaces).branches;
|
489
496
|
}
|
490
497
|
get tables() {
|
491
|
-
if (!__privateGet$
|
492
|
-
__privateGet$
|
493
|
-
return __privateGet$
|
498
|
+
if (!__privateGet$6(this, _namespaces).tables)
|
499
|
+
__privateGet$6(this, _namespaces).tables = new TableApi(__privateGet$6(this, _extraProps));
|
500
|
+
return __privateGet$6(this, _namespaces).tables;
|
494
501
|
}
|
495
502
|
get records() {
|
496
|
-
if (!__privateGet$
|
497
|
-
__privateGet$
|
498
|
-
return __privateGet$
|
503
|
+
if (!__privateGet$6(this, _namespaces).records)
|
504
|
+
__privateGet$6(this, _namespaces).records = new RecordsApi(__privateGet$6(this, _extraProps));
|
505
|
+
return __privateGet$6(this, _namespaces).records;
|
499
506
|
}
|
500
507
|
}
|
501
508
|
_extraProps = new WeakMap();
|
@@ -850,43 +857,43 @@ class XataApiPlugin {
|
|
850
857
|
class XataPlugin {
|
851
858
|
}
|
852
859
|
|
853
|
-
var __accessCheck$
|
860
|
+
var __accessCheck$6 = (obj, member, msg) => {
|
854
861
|
if (!member.has(obj))
|
855
862
|
throw TypeError("Cannot " + msg);
|
856
863
|
};
|
857
|
-
var __privateGet$
|
858
|
-
__accessCheck$
|
864
|
+
var __privateGet$5 = (obj, member, getter) => {
|
865
|
+
__accessCheck$6(obj, member, "read from private field");
|
859
866
|
return getter ? getter.call(obj) : member.get(obj);
|
860
867
|
};
|
861
|
-
var __privateAdd$
|
868
|
+
var __privateAdd$6 = (obj, member, value) => {
|
862
869
|
if (member.has(obj))
|
863
870
|
throw TypeError("Cannot add the same private member more than once");
|
864
871
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
865
872
|
};
|
866
|
-
var __privateSet$
|
867
|
-
__accessCheck$
|
873
|
+
var __privateSet$4 = (obj, member, value, setter) => {
|
874
|
+
__accessCheck$6(obj, member, "write to private field");
|
868
875
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
869
876
|
return value;
|
870
877
|
};
|
871
878
|
var _query;
|
872
879
|
class Page {
|
873
880
|
constructor(query, meta, records = []) {
|
874
|
-
__privateAdd$
|
875
|
-
__privateSet$
|
881
|
+
__privateAdd$6(this, _query, void 0);
|
882
|
+
__privateSet$4(this, _query, query);
|
876
883
|
this.meta = meta;
|
877
884
|
this.records = records;
|
878
885
|
}
|
879
886
|
async nextPage(size, offset) {
|
880
|
-
return __privateGet$
|
887
|
+
return __privateGet$5(this, _query).getPaginated({ page: { size, offset, after: this.meta.page.cursor } });
|
881
888
|
}
|
882
889
|
async previousPage(size, offset) {
|
883
|
-
return __privateGet$
|
890
|
+
return __privateGet$5(this, _query).getPaginated({ page: { size, offset, before: this.meta.page.cursor } });
|
884
891
|
}
|
885
892
|
async firstPage(size, offset) {
|
886
|
-
return __privateGet$
|
893
|
+
return __privateGet$5(this, _query).getPaginated({ page: { size, offset, first: this.meta.page.cursor } });
|
887
894
|
}
|
888
895
|
async lastPage(size, offset) {
|
889
|
-
return __privateGet$
|
896
|
+
return __privateGet$5(this, _query).getPaginated({ page: { size, offset, last: this.meta.page.cursor } });
|
890
897
|
}
|
891
898
|
hasNextPage() {
|
892
899
|
return this.meta.page.more;
|
@@ -898,46 +905,47 @@ const PAGINATION_DEFAULT_SIZE = 200;
|
|
898
905
|
const PAGINATION_MAX_OFFSET = 800;
|
899
906
|
const PAGINATION_DEFAULT_OFFSET = 0;
|
900
907
|
|
901
|
-
var __accessCheck$
|
908
|
+
var __accessCheck$5 = (obj, member, msg) => {
|
902
909
|
if (!member.has(obj))
|
903
910
|
throw TypeError("Cannot " + msg);
|
904
911
|
};
|
905
|
-
var __privateGet$
|
906
|
-
__accessCheck$
|
912
|
+
var __privateGet$4 = (obj, member, getter) => {
|
913
|
+
__accessCheck$5(obj, member, "read from private field");
|
907
914
|
return getter ? getter.call(obj) : member.get(obj);
|
908
915
|
};
|
909
|
-
var __privateAdd$
|
916
|
+
var __privateAdd$5 = (obj, member, value) => {
|
910
917
|
if (member.has(obj))
|
911
918
|
throw TypeError("Cannot add the same private member more than once");
|
912
919
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
913
920
|
};
|
914
|
-
var __privateSet$
|
915
|
-
__accessCheck$
|
921
|
+
var __privateSet$3 = (obj, member, value, setter) => {
|
922
|
+
__accessCheck$5(obj, member, "write to private field");
|
916
923
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
917
924
|
return value;
|
918
925
|
};
|
919
926
|
var _table$1, _repository, _data;
|
920
927
|
const _Query = class {
|
921
928
|
constructor(repository, table, data, parent) {
|
922
|
-
__privateAdd$
|
923
|
-
__privateAdd$
|
924
|
-
__privateAdd$
|
929
|
+
__privateAdd$5(this, _table$1, void 0);
|
930
|
+
__privateAdd$5(this, _repository, void 0);
|
931
|
+
__privateAdd$5(this, _data, { filter: {} });
|
925
932
|
this.meta = { page: { cursor: "start", more: true } };
|
926
933
|
this.records = [];
|
927
|
-
__privateSet$
|
934
|
+
__privateSet$3(this, _table$1, table);
|
928
935
|
if (repository) {
|
929
|
-
__privateSet$
|
936
|
+
__privateSet$3(this, _repository, repository);
|
930
937
|
} else {
|
931
|
-
__privateSet$
|
938
|
+
__privateSet$3(this, _repository, this);
|
932
939
|
}
|
933
|
-
__privateGet$
|
934
|
-
__privateGet$
|
935
|
-
__privateGet$
|
936
|
-
__privateGet$
|
937
|
-
__privateGet$
|
938
|
-
__privateGet$
|
939
|
-
__privateGet$
|
940
|
-
__privateGet$
|
940
|
+
__privateGet$4(this, _data).filter = data.filter ?? parent?.filter ?? {};
|
941
|
+
__privateGet$4(this, _data).filter.$any = data.filter?.$any ?? parent?.filter?.$any;
|
942
|
+
__privateGet$4(this, _data).filter.$all = data.filter?.$all ?? parent?.filter?.$all;
|
943
|
+
__privateGet$4(this, _data).filter.$not = data.filter?.$not ?? parent?.filter?.$not;
|
944
|
+
__privateGet$4(this, _data).filter.$none = data.filter?.$none ?? parent?.filter?.$none;
|
945
|
+
__privateGet$4(this, _data).sort = data.sort ?? parent?.sort;
|
946
|
+
__privateGet$4(this, _data).columns = data.columns ?? parent?.columns ?? ["*"];
|
947
|
+
__privateGet$4(this, _data).page = data.page ?? parent?.page;
|
948
|
+
__privateGet$4(this, _data).ttl = data.ttl ?? parent?.ttl;
|
941
949
|
this.any = this.any.bind(this);
|
942
950
|
this.all = this.all.bind(this);
|
943
951
|
this.not = this.not.bind(this);
|
@@ -948,45 +956,50 @@ const _Query = class {
|
|
948
956
|
Object.defineProperty(this, "repository", { enumerable: false });
|
949
957
|
}
|
950
958
|
getQueryOptions() {
|
951
|
-
return __privateGet$
|
959
|
+
return __privateGet$4(this, _data);
|
960
|
+
}
|
961
|
+
key() {
|
962
|
+
const { columns = [], filter = {}, sort = [], page = {} } = __privateGet$4(this, _data);
|
963
|
+
const key = JSON.stringify({ columns, filter, sort, page });
|
964
|
+
return toBase64(key);
|
952
965
|
}
|
953
966
|
any(...queries) {
|
954
967
|
const $any = queries.map((query) => query.getQueryOptions().filter ?? {});
|
955
|
-
return new _Query(__privateGet$
|
968
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $any } }, __privateGet$4(this, _data));
|
956
969
|
}
|
957
970
|
all(...queries) {
|
958
971
|
const $all = queries.map((query) => query.getQueryOptions().filter ?? {});
|
959
|
-
return new _Query(__privateGet$
|
972
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $all } }, __privateGet$4(this, _data));
|
960
973
|
}
|
961
974
|
not(...queries) {
|
962
975
|
const $not = queries.map((query) => query.getQueryOptions().filter ?? {});
|
963
|
-
return new _Query(__privateGet$
|
976
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $not } }, __privateGet$4(this, _data));
|
964
977
|
}
|
965
978
|
none(...queries) {
|
966
979
|
const $none = queries.map((query) => query.getQueryOptions().filter ?? {});
|
967
|
-
return new _Query(__privateGet$
|
980
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $none } }, __privateGet$4(this, _data));
|
968
981
|
}
|
969
982
|
filter(a, b) {
|
970
983
|
if (arguments.length === 1) {
|
971
984
|
const constraints = Object.entries(a).map(([column, constraint]) => ({ [column]: constraint }));
|
972
|
-
const $all = compact([__privateGet$
|
973
|
-
return new _Query(__privateGet$
|
985
|
+
const $all = compact([__privateGet$4(this, _data).filter?.$all].flat().concat(constraints));
|
986
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $all } }, __privateGet$4(this, _data));
|
974
987
|
} else {
|
975
|
-
const $all = compact([__privateGet$
|
976
|
-
return new _Query(__privateGet$
|
988
|
+
const $all = compact([__privateGet$4(this, _data).filter?.$all].flat().concat([{ [a]: b }]));
|
989
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $all } }, __privateGet$4(this, _data));
|
977
990
|
}
|
978
991
|
}
|
979
992
|
sort(column, direction) {
|
980
|
-
const originalSort = [__privateGet$
|
993
|
+
const originalSort = [__privateGet$4(this, _data).sort ?? []].flat();
|
981
994
|
const sort = [...originalSort, { column, direction }];
|
982
|
-
return new _Query(__privateGet$
|
995
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { sort }, __privateGet$4(this, _data));
|
983
996
|
}
|
984
997
|
select(columns) {
|
985
|
-
return new _Query(__privateGet$
|
998
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { columns }, __privateGet$4(this, _data));
|
986
999
|
}
|
987
1000
|
getPaginated(options = {}) {
|
988
|
-
const query = new _Query(__privateGet$
|
989
|
-
return __privateGet$
|
1001
|
+
const query = new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), options, __privateGet$4(this, _data));
|
1002
|
+
return __privateGet$4(this, _repository).query(query);
|
990
1003
|
}
|
991
1004
|
async *[Symbol.asyncIterator]() {
|
992
1005
|
for await (const [record] of this.getIterator(1)) {
|
@@ -1014,7 +1027,7 @@ const _Query = class {
|
|
1014
1027
|
}
|
1015
1028
|
return results;
|
1016
1029
|
}
|
1017
|
-
async
|
1030
|
+
async getFirst(options = {}) {
|
1018
1031
|
const records = await this.getMany({ ...options, page: { size: 1 } });
|
1019
1032
|
return records[0] || null;
|
1020
1033
|
}
|
@@ -1069,75 +1082,92 @@ function buildSortFilter(filter) {
|
|
1069
1082
|
}
|
1070
1083
|
}
|
1071
1084
|
|
1072
|
-
var __accessCheck$
|
1085
|
+
var __accessCheck$4 = (obj, member, msg) => {
|
1073
1086
|
if (!member.has(obj))
|
1074
1087
|
throw TypeError("Cannot " + msg);
|
1075
1088
|
};
|
1076
|
-
var __privateGet$
|
1077
|
-
__accessCheck$
|
1089
|
+
var __privateGet$3 = (obj, member, getter) => {
|
1090
|
+
__accessCheck$4(obj, member, "read from private field");
|
1078
1091
|
return getter ? getter.call(obj) : member.get(obj);
|
1079
1092
|
};
|
1080
|
-
var __privateAdd$
|
1093
|
+
var __privateAdd$4 = (obj, member, value) => {
|
1081
1094
|
if (member.has(obj))
|
1082
1095
|
throw TypeError("Cannot add the same private member more than once");
|
1083
1096
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
1084
1097
|
};
|
1085
|
-
var __privateSet$
|
1086
|
-
__accessCheck$
|
1098
|
+
var __privateSet$2 = (obj, member, value, setter) => {
|
1099
|
+
__accessCheck$4(obj, member, "write to private field");
|
1087
1100
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
1088
1101
|
return value;
|
1089
1102
|
};
|
1090
1103
|
var __privateMethod$2 = (obj, member, method) => {
|
1091
|
-
__accessCheck$
|
1104
|
+
__accessCheck$4(obj, member, "access private method");
|
1092
1105
|
return method;
|
1093
1106
|
};
|
1094
|
-
var _table, _links, _getFetchProps, _insertRecordWithoutId, insertRecordWithoutId_fn, _insertRecordWithId, insertRecordWithId_fn, _bulkInsertTableRecords, bulkInsertTableRecords_fn, _updateRecordWithID, updateRecordWithID_fn, _upsertRecordWithID, upsertRecordWithID_fn, _deleteRecord, deleteRecord_fn;
|
1107
|
+
var _table, _links, _getFetchProps, _insertRecordWithoutId, insertRecordWithoutId_fn, _insertRecordWithId, insertRecordWithId_fn, _bulkInsertTableRecords, bulkInsertTableRecords_fn, _updateRecordWithID, updateRecordWithID_fn, _upsertRecordWithID, upsertRecordWithID_fn, _deleteRecord, deleteRecord_fn, _invalidateCache, invalidateCache_fn, _setCacheRecord, setCacheRecord_fn, _getCacheRecord, getCacheRecord_fn, _setCacheQuery, setCacheQuery_fn, _getCacheQuery, getCacheQuery_fn;
|
1095
1108
|
class Repository extends Query {
|
1096
1109
|
}
|
1097
1110
|
class RestRepository extends Query {
|
1098
1111
|
constructor(options) {
|
1099
1112
|
super(null, options.table, {});
|
1100
|
-
__privateAdd$
|
1101
|
-
__privateAdd$
|
1102
|
-
__privateAdd$
|
1103
|
-
__privateAdd$
|
1104
|
-
__privateAdd$
|
1105
|
-
__privateAdd$
|
1106
|
-
__privateAdd$
|
1107
|
-
__privateAdd$
|
1108
|
-
__privateAdd$
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1113
|
+
__privateAdd$4(this, _insertRecordWithoutId);
|
1114
|
+
__privateAdd$4(this, _insertRecordWithId);
|
1115
|
+
__privateAdd$4(this, _bulkInsertTableRecords);
|
1116
|
+
__privateAdd$4(this, _updateRecordWithID);
|
1117
|
+
__privateAdd$4(this, _upsertRecordWithID);
|
1118
|
+
__privateAdd$4(this, _deleteRecord);
|
1119
|
+
__privateAdd$4(this, _invalidateCache);
|
1120
|
+
__privateAdd$4(this, _setCacheRecord);
|
1121
|
+
__privateAdd$4(this, _getCacheRecord);
|
1122
|
+
__privateAdd$4(this, _setCacheQuery);
|
1123
|
+
__privateAdd$4(this, _getCacheQuery);
|
1124
|
+
__privateAdd$4(this, _table, void 0);
|
1125
|
+
__privateAdd$4(this, _links, void 0);
|
1126
|
+
__privateAdd$4(this, _getFetchProps, void 0);
|
1127
|
+
__privateSet$2(this, _table, options.table);
|
1128
|
+
__privateSet$2(this, _links, options.links ?? {});
|
1129
|
+
__privateSet$2(this, _getFetchProps, options.pluginOptions.getFetchProps);
|
1112
1130
|
this.db = options.db;
|
1131
|
+
this.cache = options.pluginOptions.cache;
|
1113
1132
|
}
|
1114
1133
|
async create(a, b) {
|
1115
1134
|
if (Array.isArray(a)) {
|
1116
|
-
|
1135
|
+
const records = await __privateMethod$2(this, _bulkInsertTableRecords, bulkInsertTableRecords_fn).call(this, a);
|
1136
|
+
await Promise.all(records.map((record) => __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record)));
|
1137
|
+
return records;
|
1117
1138
|
}
|
1118
1139
|
if (isString(a) && isObject(b)) {
|
1119
1140
|
if (a === "")
|
1120
1141
|
throw new Error("The id can't be empty");
|
1121
|
-
|
1142
|
+
const record = await __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b);
|
1143
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1144
|
+
return record;
|
1122
1145
|
}
|
1123
1146
|
if (isObject(a) && isString(a.id)) {
|
1124
1147
|
if (a.id === "")
|
1125
1148
|
throw new Error("The id can't be empty");
|
1126
|
-
|
1149
|
+
const record = await __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 });
|
1150
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1151
|
+
return record;
|
1127
1152
|
}
|
1128
1153
|
if (isObject(a)) {
|
1129
|
-
|
1154
|
+
const record = await __privateMethod$2(this, _insertRecordWithoutId, insertRecordWithoutId_fn).call(this, a);
|
1155
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1156
|
+
return record;
|
1130
1157
|
}
|
1131
1158
|
throw new Error("Invalid arguments for create method");
|
1132
1159
|
}
|
1133
1160
|
async read(recordId) {
|
1134
|
-
const
|
1161
|
+
const cacheRecord = await __privateMethod$2(this, _getCacheRecord, getCacheRecord_fn).call(this, recordId);
|
1162
|
+
if (cacheRecord)
|
1163
|
+
return cacheRecord;
|
1164
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1135
1165
|
try {
|
1136
1166
|
const response = await getRecord({
|
1137
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$
|
1167
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$3(this, _table), recordId },
|
1138
1168
|
...fetchProps
|
1139
1169
|
});
|
1140
|
-
return initObject(this.db, __privateGet$
|
1170
|
+
return initObject(this.db, __privateGet$3(this, _links), __privateGet$3(this, _table), response);
|
1141
1171
|
} catch (e) {
|
1142
1172
|
if (isObject(e) && e.status === 404) {
|
1143
1173
|
return null;
|
@@ -1153,10 +1183,16 @@ class RestRepository extends Query {
|
|
1153
1183
|
return Promise.all(a.map((object) => this.update(object)));
|
1154
1184
|
}
|
1155
1185
|
if (isString(a) && isObject(b)) {
|
1156
|
-
|
1186
|
+
await __privateMethod$2(this, _invalidateCache, invalidateCache_fn).call(this, a);
|
1187
|
+
const record = await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b);
|
1188
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1189
|
+
return record;
|
1157
1190
|
}
|
1158
1191
|
if (isObject(a) && isString(a.id)) {
|
1159
|
-
|
1192
|
+
await __privateMethod$2(this, _invalidateCache, invalidateCache_fn).call(this, a.id);
|
1193
|
+
const record = await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 });
|
1194
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1195
|
+
return record;
|
1160
1196
|
}
|
1161
1197
|
throw new Error("Invalid arguments for update method");
|
1162
1198
|
}
|
@@ -1168,41 +1204,52 @@ class RestRepository extends Query {
|
|
1168
1204
|
return Promise.all(a.map((object) => this.createOrUpdate(object)));
|
1169
1205
|
}
|
1170
1206
|
if (isString(a) && isObject(b)) {
|
1171
|
-
|
1207
|
+
await __privateMethod$2(this, _invalidateCache, invalidateCache_fn).call(this, a);
|
1208
|
+
const record = await __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a, b);
|
1209
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1210
|
+
return record;
|
1172
1211
|
}
|
1173
1212
|
if (isObject(a) && isString(a.id)) {
|
1174
|
-
|
1213
|
+
await __privateMethod$2(this, _invalidateCache, invalidateCache_fn).call(this, a.id);
|
1214
|
+
const record = await __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a.id, { ...a, id: void 0 });
|
1215
|
+
await __privateMethod$2(this, _setCacheRecord, setCacheRecord_fn).call(this, record);
|
1216
|
+
return record;
|
1175
1217
|
}
|
1176
1218
|
throw new Error("Invalid arguments for createOrUpdate method");
|
1177
1219
|
}
|
1178
|
-
async delete(
|
1179
|
-
if (Array.isArray(
|
1180
|
-
if (
|
1220
|
+
async delete(a) {
|
1221
|
+
if (Array.isArray(a)) {
|
1222
|
+
if (a.length > 100) {
|
1181
1223
|
console.warn("Bulk delete operation is not optimized in the Xata API yet, this request might be slow");
|
1182
1224
|
}
|
1183
|
-
await Promise.all(
|
1225
|
+
await Promise.all(a.map((id) => this.delete(id)));
|
1184
1226
|
return;
|
1185
1227
|
}
|
1186
|
-
if (isString(
|
1187
|
-
await __privateMethod$2(this, _deleteRecord, deleteRecord_fn).call(this,
|
1228
|
+
if (isString(a)) {
|
1229
|
+
await __privateMethod$2(this, _deleteRecord, deleteRecord_fn).call(this, a);
|
1230
|
+
await __privateMethod$2(this, _invalidateCache, invalidateCache_fn).call(this, a);
|
1188
1231
|
return;
|
1189
1232
|
}
|
1190
|
-
if (isObject(
|
1191
|
-
await __privateMethod$2(this, _deleteRecord, deleteRecord_fn).call(this,
|
1233
|
+
if (isObject(a) && isString(a.id)) {
|
1234
|
+
await __privateMethod$2(this, _deleteRecord, deleteRecord_fn).call(this, a.id);
|
1235
|
+
await __privateMethod$2(this, _invalidateCache, invalidateCache_fn).call(this, a.id);
|
1192
1236
|
return;
|
1193
1237
|
}
|
1194
1238
|
throw new Error("Invalid arguments for delete method");
|
1195
1239
|
}
|
1196
1240
|
async search(query, options = {}) {
|
1197
|
-
const fetchProps = await __privateGet$
|
1241
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1198
1242
|
const { records } = await searchBranch({
|
1199
1243
|
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
|
1200
|
-
body: { tables: [__privateGet$
|
1244
|
+
body: { tables: [__privateGet$3(this, _table)], query, fuzziness: options.fuzziness },
|
1201
1245
|
...fetchProps
|
1202
1246
|
});
|
1203
|
-
return records.map((item) => initObject(this.db, __privateGet$
|
1247
|
+
return records.map((item) => initObject(this.db, __privateGet$3(this, _links), __privateGet$3(this, _table), item));
|
1204
1248
|
}
|
1205
1249
|
async query(query) {
|
1250
|
+
const cacheQuery = await __privateMethod$2(this, _getCacheQuery, getCacheQuery_fn).call(this, query);
|
1251
|
+
if (cacheQuery)
|
1252
|
+
return new Page(query, cacheQuery.meta, cacheQuery.records);
|
1206
1253
|
const data = query.getQueryOptions();
|
1207
1254
|
const body = {
|
1208
1255
|
filter: Object.values(data.filter ?? {}).some(Boolean) ? data.filter : void 0,
|
@@ -1210,13 +1257,14 @@ class RestRepository extends Query {
|
|
1210
1257
|
page: data.page,
|
1211
1258
|
columns: data.columns
|
1212
1259
|
};
|
1213
|
-
const fetchProps = await __privateGet$
|
1260
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1214
1261
|
const { meta, records: objects } = await queryTable({
|
1215
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$
|
1262
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$3(this, _table) },
|
1216
1263
|
body,
|
1217
1264
|
...fetchProps
|
1218
1265
|
});
|
1219
|
-
const records = objects.map((record) => initObject(this.db, __privateGet$
|
1266
|
+
const records = objects.map((record) => initObject(this.db, __privateGet$3(this, _links), __privateGet$3(this, _table), record));
|
1267
|
+
await __privateMethod$2(this, _setCacheQuery, setCacheQuery_fn).call(this, query, meta, records);
|
1220
1268
|
return new Page(query, meta, records);
|
1221
1269
|
}
|
1222
1270
|
}
|
@@ -1225,13 +1273,13 @@ _links = new WeakMap();
|
|
1225
1273
|
_getFetchProps = new WeakMap();
|
1226
1274
|
_insertRecordWithoutId = new WeakSet();
|
1227
1275
|
insertRecordWithoutId_fn = async function(object) {
|
1228
|
-
const fetchProps = await __privateGet$
|
1276
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1229
1277
|
const record = transformObjectLinks(object);
|
1230
1278
|
const response = await insertRecord({
|
1231
1279
|
pathParams: {
|
1232
1280
|
workspace: "{workspaceId}",
|
1233
1281
|
dbBranchName: "{dbBranch}",
|
1234
|
-
tableName: __privateGet$
|
1282
|
+
tableName: __privateGet$3(this, _table)
|
1235
1283
|
},
|
1236
1284
|
body: record,
|
1237
1285
|
...fetchProps
|
@@ -1244,13 +1292,13 @@ insertRecordWithoutId_fn = async function(object) {
|
|
1244
1292
|
};
|
1245
1293
|
_insertRecordWithId = new WeakSet();
|
1246
1294
|
insertRecordWithId_fn = async function(recordId, object) {
|
1247
|
-
const fetchProps = await __privateGet$
|
1295
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1248
1296
|
const record = transformObjectLinks(object);
|
1249
1297
|
const response = await insertRecordWithID({
|
1250
1298
|
pathParams: {
|
1251
1299
|
workspace: "{workspaceId}",
|
1252
1300
|
dbBranchName: "{dbBranch}",
|
1253
|
-
tableName: __privateGet$
|
1301
|
+
tableName: __privateGet$3(this, _table),
|
1254
1302
|
recordId
|
1255
1303
|
},
|
1256
1304
|
body: record,
|
@@ -1265,10 +1313,10 @@ insertRecordWithId_fn = async function(recordId, object) {
|
|
1265
1313
|
};
|
1266
1314
|
_bulkInsertTableRecords = new WeakSet();
|
1267
1315
|
bulkInsertTableRecords_fn = async function(objects) {
|
1268
|
-
const fetchProps = await __privateGet$
|
1316
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1269
1317
|
const records = objects.map((object) => transformObjectLinks(object));
|
1270
1318
|
const response = await bulkInsertTableRecords({
|
1271
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$
|
1319
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$3(this, _table) },
|
1272
1320
|
body: { records },
|
1273
1321
|
...fetchProps
|
1274
1322
|
});
|
@@ -1280,10 +1328,10 @@ bulkInsertTableRecords_fn = async function(objects) {
|
|
1280
1328
|
};
|
1281
1329
|
_updateRecordWithID = new WeakSet();
|
1282
1330
|
updateRecordWithID_fn = async function(recordId, object) {
|
1283
|
-
const fetchProps = await __privateGet$
|
1331
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1284
1332
|
const record = transformObjectLinks(object);
|
1285
1333
|
const response = await updateRecordWithID({
|
1286
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$
|
1334
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$3(this, _table), recordId },
|
1287
1335
|
body: record,
|
1288
1336
|
...fetchProps
|
1289
1337
|
});
|
@@ -1294,9 +1342,9 @@ updateRecordWithID_fn = async function(recordId, object) {
|
|
1294
1342
|
};
|
1295
1343
|
_upsertRecordWithID = new WeakSet();
|
1296
1344
|
upsertRecordWithID_fn = async function(recordId, object) {
|
1297
|
-
const fetchProps = await __privateGet$
|
1345
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1298
1346
|
const response = await upsertRecordWithID({
|
1299
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$
|
1347
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$3(this, _table), recordId },
|
1300
1348
|
body: object,
|
1301
1349
|
...fetchProps
|
1302
1350
|
});
|
@@ -1307,12 +1355,47 @@ upsertRecordWithID_fn = async function(recordId, object) {
|
|
1307
1355
|
};
|
1308
1356
|
_deleteRecord = new WeakSet();
|
1309
1357
|
deleteRecord_fn = async function(recordId) {
|
1310
|
-
const fetchProps = await __privateGet$
|
1358
|
+
const fetchProps = await __privateGet$3(this, _getFetchProps).call(this);
|
1311
1359
|
await deleteRecord({
|
1312
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$
|
1360
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$3(this, _table), recordId },
|
1313
1361
|
...fetchProps
|
1314
1362
|
});
|
1315
1363
|
};
|
1364
|
+
_invalidateCache = new WeakSet();
|
1365
|
+
invalidateCache_fn = async function(recordId) {
|
1366
|
+
await this.cache.delete(`rec_${__privateGet$3(this, _table)}:${recordId}`);
|
1367
|
+
const cacheItems = await this.cache.getAll();
|
1368
|
+
const queries = Object.entries(cacheItems).filter(([key]) => key.startsWith("query_"));
|
1369
|
+
for (const [key, value] of queries) {
|
1370
|
+
const ids = getIds(value);
|
1371
|
+
if (ids.includes(recordId))
|
1372
|
+
await this.cache.delete(key);
|
1373
|
+
}
|
1374
|
+
};
|
1375
|
+
_setCacheRecord = new WeakSet();
|
1376
|
+
setCacheRecord_fn = async function(record) {
|
1377
|
+
await this.cache.set(`rec_${__privateGet$3(this, _table)}:${record.id}`, record);
|
1378
|
+
};
|
1379
|
+
_getCacheRecord = new WeakSet();
|
1380
|
+
getCacheRecord_fn = async function(recordId) {
|
1381
|
+
return this.cache.get(`rec_${__privateGet$3(this, _table)}:${recordId}`);
|
1382
|
+
};
|
1383
|
+
_setCacheQuery = new WeakSet();
|
1384
|
+
setCacheQuery_fn = async function(query, meta, records) {
|
1385
|
+
await this.cache.set(`query_${__privateGet$3(this, _table)}:${query.key()}`, { date: new Date(), meta, records });
|
1386
|
+
};
|
1387
|
+
_getCacheQuery = new WeakSet();
|
1388
|
+
getCacheQuery_fn = async function(query) {
|
1389
|
+
const key = `query_${__privateGet$3(this, _table)}:${query.key()}`;
|
1390
|
+
const result = await this.cache.get(key);
|
1391
|
+
if (!result)
|
1392
|
+
return null;
|
1393
|
+
const { ttl = 0 } = query.getQueryOptions();
|
1394
|
+
if (!ttl || ttl < 0)
|
1395
|
+
return result;
|
1396
|
+
const hasExpired = result.date.getTime() + ttl < Date.now();
|
1397
|
+
return hasExpired ? null : result;
|
1398
|
+
};
|
1316
1399
|
const transformObjectLinks = (object) => {
|
1317
1400
|
return Object.entries(object).reduce((acc, [key, value]) => {
|
1318
1401
|
if (key === "xata")
|
@@ -1346,6 +1429,57 @@ const initObject = (db, links, table, object) => {
|
|
1346
1429
|
Object.freeze(result);
|
1347
1430
|
return result;
|
1348
1431
|
};
|
1432
|
+
function getIds(value) {
|
1433
|
+
if (Array.isArray(value)) {
|
1434
|
+
return value.map((item) => getIds(item)).flat();
|
1435
|
+
}
|
1436
|
+
if (!isObject(value))
|
1437
|
+
return [];
|
1438
|
+
const nestedIds = Object.values(value).map((item) => getIds(item)).flat();
|
1439
|
+
return isString(value.id) ? [value.id, ...nestedIds] : nestedIds;
|
1440
|
+
}
|
1441
|
+
|
1442
|
+
var __accessCheck$3 = (obj, member, msg) => {
|
1443
|
+
if (!member.has(obj))
|
1444
|
+
throw TypeError("Cannot " + msg);
|
1445
|
+
};
|
1446
|
+
var __privateGet$2 = (obj, member, getter) => {
|
1447
|
+
__accessCheck$3(obj, member, "read from private field");
|
1448
|
+
return getter ? getter.call(obj) : member.get(obj);
|
1449
|
+
};
|
1450
|
+
var __privateAdd$3 = (obj, member, value) => {
|
1451
|
+
if (member.has(obj))
|
1452
|
+
throw TypeError("Cannot add the same private member more than once");
|
1453
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
1454
|
+
};
|
1455
|
+
var __privateSet$1 = (obj, member, value, setter) => {
|
1456
|
+
__accessCheck$3(obj, member, "write to private field");
|
1457
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
1458
|
+
return value;
|
1459
|
+
};
|
1460
|
+
var _map;
|
1461
|
+
class SimpleCache {
|
1462
|
+
constructor() {
|
1463
|
+
__privateAdd$3(this, _map, void 0);
|
1464
|
+
__privateSet$1(this, _map, /* @__PURE__ */ new Map());
|
1465
|
+
}
|
1466
|
+
async getAll() {
|
1467
|
+
return Object.fromEntries(__privateGet$2(this, _map));
|
1468
|
+
}
|
1469
|
+
async get(key) {
|
1470
|
+
return __privateGet$2(this, _map).get(key) ?? null;
|
1471
|
+
}
|
1472
|
+
async set(key, value) {
|
1473
|
+
__privateGet$2(this, _map).set(key, value);
|
1474
|
+
}
|
1475
|
+
async delete(key) {
|
1476
|
+
__privateGet$2(this, _map).delete(key);
|
1477
|
+
}
|
1478
|
+
async clear() {
|
1479
|
+
return __privateGet$2(this, _map).clear();
|
1480
|
+
}
|
1481
|
+
}
|
1482
|
+
_map = new WeakMap();
|
1349
1483
|
|
1350
1484
|
const gt = (value) => ({ $gt: value });
|
1351
1485
|
const ge = (value) => ({ $ge: value });
|
@@ -1387,20 +1521,20 @@ class SchemaPlugin extends XataPlugin {
|
|
1387
1521
|
this.tableNames = tableNames;
|
1388
1522
|
__privateAdd$2(this, _tables, {});
|
1389
1523
|
}
|
1390
|
-
build(
|
1391
|
-
const { getFetchProps } = options;
|
1524
|
+
build(pluginOptions) {
|
1392
1525
|
const links = this.links;
|
1393
1526
|
const db = new Proxy({}, {
|
1394
1527
|
get: (_target, table) => {
|
1395
1528
|
if (!isString(table))
|
1396
1529
|
throw new Error("Invalid table name");
|
1397
|
-
if (!__privateGet$1(this, _tables)[table])
|
1398
|
-
__privateGet$1(this, _tables)[table] = new RestRepository({ db,
|
1530
|
+
if (!__privateGet$1(this, _tables)[table]) {
|
1531
|
+
__privateGet$1(this, _tables)[table] = new RestRepository({ db, pluginOptions, table, links });
|
1532
|
+
}
|
1399
1533
|
return __privateGet$1(this, _tables)[table];
|
1400
1534
|
}
|
1401
1535
|
});
|
1402
1536
|
for (const table of this.tableNames ?? []) {
|
1403
|
-
db[table] = new RestRepository({ db,
|
1537
|
+
db[table] = new RestRepository({ db, pluginOptions, table, links });
|
1404
1538
|
}
|
1405
1539
|
return db;
|
1406
1540
|
}
|
@@ -1574,16 +1708,18 @@ const buildClient = (plugins) => {
|
|
1574
1708
|
__privateAdd(this, _evaluateBranch);
|
1575
1709
|
__privateAdd(this, _branch, void 0);
|
1576
1710
|
const safeOptions = __privateMethod(this, _parseOptions, parseOptions_fn).call(this, options);
|
1577
|
-
const
|
1578
|
-
|
1579
|
-
|
1580
|
-
}
|
1711
|
+
const pluginOptions = {
|
1712
|
+
getFetchProps: () => __privateMethod(this, _getFetchProps, getFetchProps_fn).call(this, safeOptions),
|
1713
|
+
cache: safeOptions.cache
|
1714
|
+
};
|
1715
|
+
const db = new SchemaPlugin(links, tables).build(pluginOptions);
|
1716
|
+
const search = new SearchPlugin(db, links ?? {}).build(pluginOptions);
|
1581
1717
|
this.db = db;
|
1582
1718
|
this.search = search;
|
1583
1719
|
for (const [key, namespace] of Object.entries(plugins ?? {})) {
|
1584
1720
|
if (!namespace)
|
1585
1721
|
continue;
|
1586
|
-
const result = namespace.build(
|
1722
|
+
const result = namespace.build(pluginOptions);
|
1587
1723
|
if (result instanceof Promise) {
|
1588
1724
|
void result.then((namespace2) => {
|
1589
1725
|
this[key] = namespace2;
|
@@ -1597,11 +1733,12 @@ const buildClient = (plugins) => {
|
|
1597
1733
|
const fetch = getFetchImplementation(options?.fetch);
|
1598
1734
|
const databaseURL = options?.databaseURL || getDatabaseURL();
|
1599
1735
|
const apiKey = options?.apiKey || getAPIKey();
|
1736
|
+
const cache = options?.cache ?? new SimpleCache();
|
1600
1737
|
const branch = async () => options?.branch ? await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, options.branch) : await getCurrentBranchName({ apiKey, databaseURL, fetchImpl: options?.fetch });
|
1601
1738
|
if (!databaseURL || !apiKey) {
|
1602
1739
|
throw new Error("Options databaseURL and apiKey are required");
|
1603
1740
|
}
|
1604
|
-
return { fetch, databaseURL, apiKey, branch };
|
1741
|
+
return { fetch, databaseURL, apiKey, branch, cache };
|
1605
1742
|
}, _getFetchProps = new WeakSet(), getFetchProps_fn = async function({
|
1606
1743
|
fetch,
|
1607
1744
|
apiKey,
|
@@ -1649,5 +1786,5 @@ class XataError extends Error {
|
|
1649
1786
|
}
|
1650
1787
|
}
|
1651
1788
|
|
1652
|
-
export { BaseClient, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, Repository, RestRepository, SchemaPlugin, SearchPlugin, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, 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, 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, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
1789
|
+
export { BaseClient, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, Repository, RestRepository, SchemaPlugin, SearchPlugin, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, 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, 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, removeWorkspaceMember, resendWorkspaceMemberInvite, searchBranch, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
1653
1790
|
//# sourceMappingURL=index.mjs.map
|