@xata.io/client 0.0.0-alpha.vf2950db06c33bba882032c181cc784c0501526f1 → 0.0.0-alpha.vf2d4ede35f0fb2771332d1b20637a8546868103b
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/.turbo/turbo-add-version.log +1 -1
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +40 -2
- package/dist/index.cjs +364 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +592 -124
- package/dist/index.mjs +356 -309
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -246,7 +246,7 @@ var __accessCheck$8 = (obj, member, msg) => {
|
|
246
246
|
if (!member.has(obj))
|
247
247
|
throw TypeError("Cannot " + msg);
|
248
248
|
};
|
249
|
-
var __privateGet$
|
249
|
+
var __privateGet$7 = (obj, member, getter) => {
|
250
250
|
__accessCheck$8(obj, member, "read from private field");
|
251
251
|
return getter ? getter.call(obj) : member.get(obj);
|
252
252
|
};
|
@@ -255,7 +255,7 @@ var __privateAdd$8 = (obj, member, value) => {
|
|
255
255
|
throw TypeError("Cannot add the same private member more than once");
|
256
256
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
257
257
|
};
|
258
|
-
var __privateSet$
|
258
|
+
var __privateSet$6 = (obj, member, value, setter) => {
|
259
259
|
__accessCheck$8(obj, member, "write to private field");
|
260
260
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
261
261
|
return value;
|
@@ -281,19 +281,19 @@ class ApiRequestPool {
|
|
281
281
|
__privateAdd$8(this, _fetch, void 0);
|
282
282
|
__privateAdd$8(this, _queue, void 0);
|
283
283
|
__privateAdd$8(this, _concurrency, void 0);
|
284
|
-
__privateSet$
|
285
|
-
__privateSet$
|
284
|
+
__privateSet$6(this, _queue, []);
|
285
|
+
__privateSet$6(this, _concurrency, concurrency);
|
286
286
|
this.running = 0;
|
287
287
|
this.started = 0;
|
288
288
|
}
|
289
289
|
setFetch(fetch2) {
|
290
|
-
__privateSet$
|
290
|
+
__privateSet$6(this, _fetch, fetch2);
|
291
291
|
}
|
292
292
|
getFetch() {
|
293
|
-
if (!__privateGet$
|
293
|
+
if (!__privateGet$7(this, _fetch)) {
|
294
294
|
throw new Error("Fetch not set");
|
295
295
|
}
|
296
|
-
return __privateGet$
|
296
|
+
return __privateGet$7(this, _fetch);
|
297
297
|
}
|
298
298
|
request(url, options) {
|
299
299
|
const start = /* @__PURE__ */ new Date();
|
@@ -325,19 +325,19 @@ _queue = new WeakMap();
|
|
325
325
|
_concurrency = new WeakMap();
|
326
326
|
_enqueue = new WeakSet();
|
327
327
|
enqueue_fn = function(task) {
|
328
|
-
const promise = new Promise((resolve) => __privateGet$
|
328
|
+
const promise = new Promise((resolve) => __privateGet$7(this, _queue).push(resolve)).finally(() => {
|
329
329
|
this.started--;
|
330
330
|
this.running++;
|
331
331
|
}).then(() => task()).finally(() => {
|
332
332
|
this.running--;
|
333
|
-
const next = __privateGet$
|
333
|
+
const next = __privateGet$7(this, _queue).shift();
|
334
334
|
if (next !== void 0) {
|
335
335
|
this.started++;
|
336
336
|
next();
|
337
337
|
}
|
338
338
|
});
|
339
|
-
if (this.running + this.started < __privateGet$
|
340
|
-
const next = __privateGet$
|
339
|
+
if (this.running + this.started < __privateGet$7(this, _concurrency)) {
|
340
|
+
const next = __privateGet$7(this, _queue).shift();
|
341
341
|
if (next !== void 0) {
|
342
342
|
this.started++;
|
343
343
|
next();
|
@@ -526,7 +526,7 @@ function defaultOnOpen(response) {
|
|
526
526
|
}
|
527
527
|
}
|
528
528
|
|
529
|
-
const VERSION = "0.
|
529
|
+
const VERSION = "0.29.2";
|
530
530
|
|
531
531
|
class ErrorWithCause extends Error {
|
532
532
|
constructor(message, options) {
|
@@ -845,26 +845,29 @@ function parseUrl(url) {
|
|
845
845
|
|
846
846
|
const dataPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "dataPlane" });
|
847
847
|
|
848
|
-
const applyMigration = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/
|
849
|
-
const
|
850
|
-
url: "/db/{dbBranchName}/
|
851
|
-
method: "
|
848
|
+
const applyMigration = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/apply", method: "post", ...variables, signal });
|
849
|
+
const adaptTable = (variables, signal) => dataPlaneFetch({
|
850
|
+
url: "/db/{dbBranchName}/migrations/adapt/{tableName}",
|
851
|
+
method: "post",
|
852
852
|
...variables,
|
853
853
|
signal
|
854
854
|
});
|
855
|
-
const
|
856
|
-
|
855
|
+
const getBranchMigrationJobStatus = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/status", method: "get", ...variables, signal });
|
856
|
+
const getMigrationJobStatus = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/jobs/{jobId}", method: "get", ...variables, signal });
|
857
|
+
const getMigrationHistory = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/history", method: "get", ...variables, signal });
|
858
|
+
const getBranchList = (variables, signal) => dataPlaneFetch({
|
859
|
+
url: "/dbs/{dbName}",
|
857
860
|
method: "get",
|
858
861
|
...variables,
|
859
862
|
signal
|
860
863
|
});
|
861
|
-
const
|
862
|
-
|
863
|
-
url: "/dbs/{dbName}",
|
864
|
+
const getDatabaseSettings = (variables, signal) => dataPlaneFetch({
|
865
|
+
url: "/dbs/{dbName}/settings",
|
864
866
|
method: "get",
|
865
867
|
...variables,
|
866
868
|
signal
|
867
869
|
});
|
870
|
+
const updateDatabaseSettings = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/settings", method: "patch", ...variables, signal });
|
868
871
|
const getBranchDetails = (variables, signal) => dataPlaneFetch({
|
869
872
|
url: "/db/{dbBranchName}",
|
870
873
|
method: "get",
|
@@ -1078,11 +1081,25 @@ const sqlQuery = (variables, signal) => dataPlaneFetch({
|
|
1078
1081
|
signal
|
1079
1082
|
});
|
1080
1083
|
const operationsByTag$2 = {
|
1081
|
-
|
1084
|
+
migrations: {
|
1082
1085
|
applyMigration,
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
+
adaptTable,
|
1087
|
+
getBranchMigrationJobStatus,
|
1088
|
+
getMigrationJobStatus,
|
1089
|
+
getMigrationHistory,
|
1090
|
+
getSchema,
|
1091
|
+
getBranchMigrationHistory,
|
1092
|
+
getBranchMigrationPlan,
|
1093
|
+
executeBranchMigrationPlan,
|
1094
|
+
getBranchSchemaHistory,
|
1095
|
+
compareBranchWithUserSchema,
|
1096
|
+
compareBranchSchemas,
|
1097
|
+
updateBranchSchema,
|
1098
|
+
previewBranchSchemaEdit,
|
1099
|
+
applyBranchSchemaEdit,
|
1100
|
+
pushBranchMigrations
|
1101
|
+
},
|
1102
|
+
branch: {
|
1086
1103
|
getBranchList,
|
1087
1104
|
getBranchDetails,
|
1088
1105
|
createBranch,
|
@@ -1096,19 +1113,7 @@ const operationsByTag$2 = {
|
|
1096
1113
|
removeGitBranchesEntry,
|
1097
1114
|
resolveBranch
|
1098
1115
|
},
|
1099
|
-
|
1100
|
-
getSchema,
|
1101
|
-
getBranchMigrationHistory,
|
1102
|
-
getBranchMigrationPlan,
|
1103
|
-
executeBranchMigrationPlan,
|
1104
|
-
getBranchSchemaHistory,
|
1105
|
-
compareBranchWithUserSchema,
|
1106
|
-
compareBranchSchemas,
|
1107
|
-
updateBranchSchema,
|
1108
|
-
previewBranchSchemaEdit,
|
1109
|
-
applyBranchSchemaEdit,
|
1110
|
-
pushBranchMigrations
|
1111
|
-
},
|
1116
|
+
database: { getDatabaseSettings, updateDatabaseSettings },
|
1112
1117
|
migrationRequests: {
|
1113
1118
|
queryMigrationRequests,
|
1114
1119
|
createMigrationRequest,
|
@@ -1250,6 +1255,8 @@ const deleteWorkspace = (variables, signal) => controlPlaneFetch({
|
|
1250
1255
|
...variables,
|
1251
1256
|
signal
|
1252
1257
|
});
|
1258
|
+
const getWorkspaceSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/settings", method: "get", ...variables, signal });
|
1259
|
+
const updateWorkspaceSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/settings", method: "patch", ...variables, signal });
|
1253
1260
|
const getWorkspaceMembersList = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/members", method: "get", ...variables, signal });
|
1254
1261
|
const updateWorkspaceMemberRole = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/members/{userId}", method: "put", ...variables, signal });
|
1255
1262
|
const removeWorkspaceMember = (variables, signal) => controlPlaneFetch({
|
@@ -1263,12 +1270,7 @@ const updateWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ u
|
|
1263
1270
|
const cancelWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "delete", ...variables, signal });
|
1264
1271
|
const acceptWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteKey}/accept", method: "post", ...variables, signal });
|
1265
1272
|
const resendWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}/resend", method: "post", ...variables, signal });
|
1266
|
-
const listClusters = (variables, signal) => controlPlaneFetch({
|
1267
|
-
url: "/workspaces/{workspaceId}/clusters",
|
1268
|
-
method: "get",
|
1269
|
-
...variables,
|
1270
|
-
signal
|
1271
|
-
});
|
1273
|
+
const listClusters = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/clusters", method: "get", ...variables, signal });
|
1272
1274
|
const createCluster = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/clusters", method: "post", ...variables, signal });
|
1273
1275
|
const getCluster = (variables, signal) => controlPlaneFetch({
|
1274
1276
|
url: "/workspaces/{workspaceId}/clusters/{clusterId}",
|
@@ -1320,6 +1322,8 @@ const operationsByTag$1 = {
|
|
1320
1322
|
getWorkspace,
|
1321
1323
|
updateWorkspace,
|
1322
1324
|
deleteWorkspace,
|
1325
|
+
getWorkspaceSettings,
|
1326
|
+
updateWorkspaceSettings,
|
1323
1327
|
getWorkspaceMembersList,
|
1324
1328
|
updateWorkspaceMemberRole,
|
1325
1329
|
removeWorkspaceMember
|
@@ -1352,7 +1356,7 @@ var __accessCheck$7 = (obj, member, msg) => {
|
|
1352
1356
|
if (!member.has(obj))
|
1353
1357
|
throw TypeError("Cannot " + msg);
|
1354
1358
|
};
|
1355
|
-
var __privateGet$
|
1359
|
+
var __privateGet$6 = (obj, member, getter) => {
|
1356
1360
|
__accessCheck$7(obj, member, "read from private field");
|
1357
1361
|
return getter ? getter.call(obj) : member.get(obj);
|
1358
1362
|
};
|
@@ -1361,7 +1365,7 @@ var __privateAdd$7 = (obj, member, value) => {
|
|
1361
1365
|
throw TypeError("Cannot add the same private member more than once");
|
1362
1366
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
1363
1367
|
};
|
1364
|
-
var __privateSet$
|
1368
|
+
var __privateSet$5 = (obj, member, value, setter) => {
|
1365
1369
|
__accessCheck$7(obj, member, "write to private field");
|
1366
1370
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
1367
1371
|
return value;
|
@@ -1378,7 +1382,7 @@ class XataApiClient {
|
|
1378
1382
|
if (!apiKey) {
|
1379
1383
|
throw new Error("Could not resolve a valid apiKey");
|
1380
1384
|
}
|
1381
|
-
__privateSet$
|
1385
|
+
__privateSet$5(this, _extraProps, {
|
1382
1386
|
apiUrl: getHostUrl(provider, "main"),
|
1383
1387
|
workspacesApiUrl: getHostUrl(provider, "workspaces"),
|
1384
1388
|
fetch: getFetchImplementation(options.fetch),
|
@@ -1390,64 +1394,64 @@ class XataApiClient {
|
|
1390
1394
|
});
|
1391
1395
|
}
|
1392
1396
|
get user() {
|
1393
|
-
if (!__privateGet$
|
1394
|
-
__privateGet$
|
1395
|
-
return __privateGet$
|
1397
|
+
if (!__privateGet$6(this, _namespaces).user)
|
1398
|
+
__privateGet$6(this, _namespaces).user = new UserApi(__privateGet$6(this, _extraProps));
|
1399
|
+
return __privateGet$6(this, _namespaces).user;
|
1396
1400
|
}
|
1397
1401
|
get authentication() {
|
1398
|
-
if (!__privateGet$
|
1399
|
-
__privateGet$
|
1400
|
-
return __privateGet$
|
1402
|
+
if (!__privateGet$6(this, _namespaces).authentication)
|
1403
|
+
__privateGet$6(this, _namespaces).authentication = new AuthenticationApi(__privateGet$6(this, _extraProps));
|
1404
|
+
return __privateGet$6(this, _namespaces).authentication;
|
1401
1405
|
}
|
1402
1406
|
get workspaces() {
|
1403
|
-
if (!__privateGet$
|
1404
|
-
__privateGet$
|
1405
|
-
return __privateGet$
|
1407
|
+
if (!__privateGet$6(this, _namespaces).workspaces)
|
1408
|
+
__privateGet$6(this, _namespaces).workspaces = new WorkspaceApi(__privateGet$6(this, _extraProps));
|
1409
|
+
return __privateGet$6(this, _namespaces).workspaces;
|
1406
1410
|
}
|
1407
1411
|
get invites() {
|
1408
|
-
if (!__privateGet$
|
1409
|
-
__privateGet$
|
1410
|
-
return __privateGet$
|
1412
|
+
if (!__privateGet$6(this, _namespaces).invites)
|
1413
|
+
__privateGet$6(this, _namespaces).invites = new InvitesApi(__privateGet$6(this, _extraProps));
|
1414
|
+
return __privateGet$6(this, _namespaces).invites;
|
1411
1415
|
}
|
1412
1416
|
get database() {
|
1413
|
-
if (!__privateGet$
|
1414
|
-
__privateGet$
|
1415
|
-
return __privateGet$
|
1417
|
+
if (!__privateGet$6(this, _namespaces).database)
|
1418
|
+
__privateGet$6(this, _namespaces).database = new DatabaseApi(__privateGet$6(this, _extraProps));
|
1419
|
+
return __privateGet$6(this, _namespaces).database;
|
1416
1420
|
}
|
1417
1421
|
get branches() {
|
1418
|
-
if (!__privateGet$
|
1419
|
-
__privateGet$
|
1420
|
-
return __privateGet$
|
1422
|
+
if (!__privateGet$6(this, _namespaces).branches)
|
1423
|
+
__privateGet$6(this, _namespaces).branches = new BranchApi(__privateGet$6(this, _extraProps));
|
1424
|
+
return __privateGet$6(this, _namespaces).branches;
|
1421
1425
|
}
|
1422
1426
|
get migrations() {
|
1423
|
-
if (!__privateGet$
|
1424
|
-
__privateGet$
|
1425
|
-
return __privateGet$
|
1427
|
+
if (!__privateGet$6(this, _namespaces).migrations)
|
1428
|
+
__privateGet$6(this, _namespaces).migrations = new MigrationsApi(__privateGet$6(this, _extraProps));
|
1429
|
+
return __privateGet$6(this, _namespaces).migrations;
|
1426
1430
|
}
|
1427
1431
|
get migrationRequests() {
|
1428
|
-
if (!__privateGet$
|
1429
|
-
__privateGet$
|
1430
|
-
return __privateGet$
|
1432
|
+
if (!__privateGet$6(this, _namespaces).migrationRequests)
|
1433
|
+
__privateGet$6(this, _namespaces).migrationRequests = new MigrationRequestsApi(__privateGet$6(this, _extraProps));
|
1434
|
+
return __privateGet$6(this, _namespaces).migrationRequests;
|
1431
1435
|
}
|
1432
1436
|
get tables() {
|
1433
|
-
if (!__privateGet$
|
1434
|
-
__privateGet$
|
1435
|
-
return __privateGet$
|
1437
|
+
if (!__privateGet$6(this, _namespaces).tables)
|
1438
|
+
__privateGet$6(this, _namespaces).tables = new TableApi(__privateGet$6(this, _extraProps));
|
1439
|
+
return __privateGet$6(this, _namespaces).tables;
|
1436
1440
|
}
|
1437
1441
|
get records() {
|
1438
|
-
if (!__privateGet$
|
1439
|
-
__privateGet$
|
1440
|
-
return __privateGet$
|
1442
|
+
if (!__privateGet$6(this, _namespaces).records)
|
1443
|
+
__privateGet$6(this, _namespaces).records = new RecordsApi(__privateGet$6(this, _extraProps));
|
1444
|
+
return __privateGet$6(this, _namespaces).records;
|
1441
1445
|
}
|
1442
1446
|
get files() {
|
1443
|
-
if (!__privateGet$
|
1444
|
-
__privateGet$
|
1445
|
-
return __privateGet$
|
1447
|
+
if (!__privateGet$6(this, _namespaces).files)
|
1448
|
+
__privateGet$6(this, _namespaces).files = new FilesApi(__privateGet$6(this, _extraProps));
|
1449
|
+
return __privateGet$6(this, _namespaces).files;
|
1446
1450
|
}
|
1447
1451
|
get searchAndFilter() {
|
1448
|
-
if (!__privateGet$
|
1449
|
-
__privateGet$
|
1450
|
-
return __privateGet$
|
1452
|
+
if (!__privateGet$6(this, _namespaces).searchAndFilter)
|
1453
|
+
__privateGet$6(this, _namespaces).searchAndFilter = new SearchAndFilterApi(__privateGet$6(this, _extraProps));
|
1454
|
+
return __privateGet$6(this, _namespaces).searchAndFilter;
|
1451
1455
|
}
|
1452
1456
|
}
|
1453
1457
|
_extraProps = new WeakMap();
|
@@ -1749,6 +1753,30 @@ class BranchApi {
|
|
1749
1753
|
...this.extraProps
|
1750
1754
|
});
|
1751
1755
|
}
|
1756
|
+
pgRollMigrationHistory({
|
1757
|
+
workspace,
|
1758
|
+
region,
|
1759
|
+
database,
|
1760
|
+
branch
|
1761
|
+
}) {
|
1762
|
+
return operationsByTag.migrations.getMigrationHistory({
|
1763
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1764
|
+
...this.extraProps
|
1765
|
+
});
|
1766
|
+
}
|
1767
|
+
applyMigration({
|
1768
|
+
workspace,
|
1769
|
+
region,
|
1770
|
+
database,
|
1771
|
+
branch,
|
1772
|
+
migration
|
1773
|
+
}) {
|
1774
|
+
return operationsByTag.migrations.applyMigration({
|
1775
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1776
|
+
body: migration,
|
1777
|
+
...this.extraProps
|
1778
|
+
});
|
1779
|
+
}
|
1752
1780
|
}
|
1753
1781
|
class TableApi {
|
1754
1782
|
constructor(extraProps) {
|
@@ -2562,6 +2590,17 @@ class MigrationsApi {
|
|
2562
2590
|
...this.extraProps
|
2563
2591
|
});
|
2564
2592
|
}
|
2593
|
+
getSchema({
|
2594
|
+
workspace,
|
2595
|
+
region,
|
2596
|
+
database,
|
2597
|
+
branch
|
2598
|
+
}) {
|
2599
|
+
return operationsByTag.migrations.getSchema({
|
2600
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2601
|
+
...this.extraProps
|
2602
|
+
});
|
2603
|
+
}
|
2565
2604
|
}
|
2566
2605
|
class DatabaseApi {
|
2567
2606
|
constructor(extraProps) {
|
@@ -2867,7 +2906,7 @@ var __accessCheck$6 = (obj, member, msg) => {
|
|
2867
2906
|
if (!member.has(obj))
|
2868
2907
|
throw TypeError("Cannot " + msg);
|
2869
2908
|
};
|
2870
|
-
var __privateGet$
|
2909
|
+
var __privateGet$5 = (obj, member, getter) => {
|
2871
2910
|
__accessCheck$6(obj, member, "read from private field");
|
2872
2911
|
return getter ? getter.call(obj) : member.get(obj);
|
2873
2912
|
};
|
@@ -2876,7 +2915,7 @@ var __privateAdd$6 = (obj, member, value) => {
|
|
2876
2915
|
throw TypeError("Cannot add the same private member more than once");
|
2877
2916
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
2878
2917
|
};
|
2879
|
-
var __privateSet$
|
2918
|
+
var __privateSet$4 = (obj, member, value, setter) => {
|
2880
2919
|
__accessCheck$6(obj, member, "write to private field");
|
2881
2920
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
2882
2921
|
return value;
|
@@ -2885,9 +2924,9 @@ var _query, _page;
|
|
2885
2924
|
class Page {
|
2886
2925
|
constructor(query, meta, records = []) {
|
2887
2926
|
__privateAdd$6(this, _query, void 0);
|
2888
|
-
__privateSet$
|
2927
|
+
__privateSet$4(this, _query, query);
|
2889
2928
|
this.meta = meta;
|
2890
|
-
this.records = new
|
2929
|
+
this.records = new PageRecordArray(this, records);
|
2891
2930
|
}
|
2892
2931
|
/**
|
2893
2932
|
* Retrieves the next page of results.
|
@@ -2896,7 +2935,7 @@ class Page {
|
|
2896
2935
|
* @returns The next page or results.
|
2897
2936
|
*/
|
2898
2937
|
async nextPage(size, offset) {
|
2899
|
-
return __privateGet$
|
2938
|
+
return __privateGet$5(this, _query).getPaginated({ pagination: { size, offset, after: this.meta.page.cursor } });
|
2900
2939
|
}
|
2901
2940
|
/**
|
2902
2941
|
* Retrieves the previous page of results.
|
@@ -2905,7 +2944,7 @@ class Page {
|
|
2905
2944
|
* @returns The previous page or results.
|
2906
2945
|
*/
|
2907
2946
|
async previousPage(size, offset) {
|
2908
|
-
return __privateGet$
|
2947
|
+
return __privateGet$5(this, _query).getPaginated({ pagination: { size, offset, before: this.meta.page.cursor } });
|
2909
2948
|
}
|
2910
2949
|
/**
|
2911
2950
|
* Retrieves the start page of results.
|
@@ -2914,7 +2953,7 @@ class Page {
|
|
2914
2953
|
* @returns The start page or results.
|
2915
2954
|
*/
|
2916
2955
|
async startPage(size, offset) {
|
2917
|
-
return __privateGet$
|
2956
|
+
return __privateGet$5(this, _query).getPaginated({ pagination: { size, offset, start: this.meta.page.cursor } });
|
2918
2957
|
}
|
2919
2958
|
/**
|
2920
2959
|
* Retrieves the end page of results.
|
@@ -2923,7 +2962,7 @@ class Page {
|
|
2923
2962
|
* @returns The end page or results.
|
2924
2963
|
*/
|
2925
2964
|
async endPage(size, offset) {
|
2926
|
-
return __privateGet$
|
2965
|
+
return __privateGet$5(this, _query).getPaginated({ pagination: { size, offset, end: this.meta.page.cursor } });
|
2927
2966
|
}
|
2928
2967
|
/**
|
2929
2968
|
* Shortcut method to check if there will be additional results if the next page of results is retrieved.
|
@@ -2941,11 +2980,38 @@ const PAGINATION_DEFAULT_OFFSET = 0;
|
|
2941
2980
|
function isCursorPaginationOptions(options) {
|
2942
2981
|
return isDefined(options) && (isDefined(options.start) || isDefined(options.end) || isDefined(options.after) || isDefined(options.before));
|
2943
2982
|
}
|
2944
|
-
|
2983
|
+
class RecordArray extends Array {
|
2945
2984
|
constructor(...args) {
|
2946
|
-
super(...
|
2985
|
+
super(...RecordArray.parseConstructorParams(...args));
|
2986
|
+
}
|
2987
|
+
static parseConstructorParams(...args) {
|
2988
|
+
if (args.length === 1 && typeof args[0] === "number") {
|
2989
|
+
return new Array(args[0]);
|
2990
|
+
}
|
2991
|
+
if (args.length <= 1 && Array.isArray(args[0] ?? [])) {
|
2992
|
+
const result = args[0] ?? [];
|
2993
|
+
return new Array(...result);
|
2994
|
+
}
|
2995
|
+
return new Array(...args);
|
2996
|
+
}
|
2997
|
+
toArray() {
|
2998
|
+
return new Array(...this);
|
2999
|
+
}
|
3000
|
+
toSerializable() {
|
3001
|
+
return JSON.parse(this.toString());
|
3002
|
+
}
|
3003
|
+
toString() {
|
3004
|
+
return JSON.stringify(this.toArray());
|
3005
|
+
}
|
3006
|
+
map(callbackfn, thisArg) {
|
3007
|
+
return this.toArray().map(callbackfn, thisArg);
|
3008
|
+
}
|
3009
|
+
}
|
3010
|
+
const _PageRecordArray = class _PageRecordArray extends Array {
|
3011
|
+
constructor(...args) {
|
3012
|
+
super(..._PageRecordArray.parseConstructorParams(...args));
|
2947
3013
|
__privateAdd$6(this, _page, void 0);
|
2948
|
-
__privateSet$
|
3014
|
+
__privateSet$4(this, _page, isObject(args[0]?.meta) ? args[0] : { meta: { page: { cursor: "", more: false } }, records: [] });
|
2949
3015
|
}
|
2950
3016
|
static parseConstructorParams(...args) {
|
2951
3017
|
if (args.length === 1 && typeof args[0] === "number") {
|
@@ -2975,8 +3041,8 @@ const _RecordArray = class _RecordArray extends Array {
|
|
2975
3041
|
* @returns A new array of objects
|
2976
3042
|
*/
|
2977
3043
|
async nextPage(size, offset) {
|
2978
|
-
const newPage = await __privateGet$
|
2979
|
-
return new
|
3044
|
+
const newPage = await __privateGet$5(this, _page).nextPage(size, offset);
|
3045
|
+
return new _PageRecordArray(newPage);
|
2980
3046
|
}
|
2981
3047
|
/**
|
2982
3048
|
* Retrieve previous page of records
|
@@ -2984,8 +3050,8 @@ const _RecordArray = class _RecordArray extends Array {
|
|
2984
3050
|
* @returns A new array of objects
|
2985
3051
|
*/
|
2986
3052
|
async previousPage(size, offset) {
|
2987
|
-
const newPage = await __privateGet$
|
2988
|
-
return new
|
3053
|
+
const newPage = await __privateGet$5(this, _page).previousPage(size, offset);
|
3054
|
+
return new _PageRecordArray(newPage);
|
2989
3055
|
}
|
2990
3056
|
/**
|
2991
3057
|
* Retrieve start page of records
|
@@ -2993,8 +3059,8 @@ const _RecordArray = class _RecordArray extends Array {
|
|
2993
3059
|
* @returns A new array of objects
|
2994
3060
|
*/
|
2995
3061
|
async startPage(size, offset) {
|
2996
|
-
const newPage = await __privateGet$
|
2997
|
-
return new
|
3062
|
+
const newPage = await __privateGet$5(this, _page).startPage(size, offset);
|
3063
|
+
return new _PageRecordArray(newPage);
|
2998
3064
|
}
|
2999
3065
|
/**
|
3000
3066
|
* Retrieve end page of records
|
@@ -3002,24 +3068,24 @@ const _RecordArray = class _RecordArray extends Array {
|
|
3002
3068
|
* @returns A new array of objects
|
3003
3069
|
*/
|
3004
3070
|
async endPage(size, offset) {
|
3005
|
-
const newPage = await __privateGet$
|
3006
|
-
return new
|
3071
|
+
const newPage = await __privateGet$5(this, _page).endPage(size, offset);
|
3072
|
+
return new _PageRecordArray(newPage);
|
3007
3073
|
}
|
3008
3074
|
/**
|
3009
3075
|
* @returns Boolean indicating if there is a next page
|
3010
3076
|
*/
|
3011
3077
|
hasNextPage() {
|
3012
|
-
return __privateGet$
|
3078
|
+
return __privateGet$5(this, _page).meta.page.more;
|
3013
3079
|
}
|
3014
3080
|
};
|
3015
3081
|
_page = new WeakMap();
|
3016
|
-
let
|
3082
|
+
let PageRecordArray = _PageRecordArray;
|
3017
3083
|
|
3018
3084
|
var __accessCheck$5 = (obj, member, msg) => {
|
3019
3085
|
if (!member.has(obj))
|
3020
3086
|
throw TypeError("Cannot " + msg);
|
3021
3087
|
};
|
3022
|
-
var __privateGet$
|
3088
|
+
var __privateGet$4 = (obj, member, getter) => {
|
3023
3089
|
__accessCheck$5(obj, member, "read from private field");
|
3024
3090
|
return getter ? getter.call(obj) : member.get(obj);
|
3025
3091
|
};
|
@@ -3028,7 +3094,7 @@ var __privateAdd$5 = (obj, member, value) => {
|
|
3028
3094
|
throw TypeError("Cannot add the same private member more than once");
|
3029
3095
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
3030
3096
|
};
|
3031
|
-
var __privateSet$
|
3097
|
+
var __privateSet$3 = (obj, member, value, setter) => {
|
3032
3098
|
__accessCheck$5(obj, member, "write to private field");
|
3033
3099
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
3034
3100
|
return value;
|
@@ -3046,25 +3112,25 @@ const _Query = class _Query {
|
|
3046
3112
|
__privateAdd$5(this, _data, { filter: {} });
|
3047
3113
|
// Implements pagination
|
3048
3114
|
this.meta = { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } };
|
3049
|
-
this.records = new
|
3050
|
-
__privateSet$
|
3115
|
+
this.records = new PageRecordArray(this, []);
|
3116
|
+
__privateSet$3(this, _table$1, table);
|
3051
3117
|
if (repository) {
|
3052
|
-
__privateSet$
|
3118
|
+
__privateSet$3(this, _repository, repository);
|
3053
3119
|
} else {
|
3054
|
-
__privateSet$
|
3120
|
+
__privateSet$3(this, _repository, this);
|
3055
3121
|
}
|
3056
3122
|
const parent = cleanParent(data, rawParent);
|
3057
|
-
__privateGet$
|
3058
|
-
__privateGet$
|
3059
|
-
__privateGet$
|
3060
|
-
__privateGet$
|
3061
|
-
__privateGet$
|
3062
|
-
__privateGet$
|
3063
|
-
__privateGet$
|
3064
|
-
__privateGet$
|
3065
|
-
__privateGet$
|
3066
|
-
__privateGet$
|
3067
|
-
__privateGet$
|
3123
|
+
__privateGet$4(this, _data).filter = data.filter ?? parent?.filter ?? {};
|
3124
|
+
__privateGet$4(this, _data).filter.$any = data.filter?.$any ?? parent?.filter?.$any;
|
3125
|
+
__privateGet$4(this, _data).filter.$all = data.filter?.$all ?? parent?.filter?.$all;
|
3126
|
+
__privateGet$4(this, _data).filter.$not = data.filter?.$not ?? parent?.filter?.$not;
|
3127
|
+
__privateGet$4(this, _data).filter.$none = data.filter?.$none ?? parent?.filter?.$none;
|
3128
|
+
__privateGet$4(this, _data).sort = data.sort ?? parent?.sort;
|
3129
|
+
__privateGet$4(this, _data).columns = data.columns ?? parent?.columns;
|
3130
|
+
__privateGet$4(this, _data).consistency = data.consistency ?? parent?.consistency;
|
3131
|
+
__privateGet$4(this, _data).pagination = data.pagination ?? parent?.pagination;
|
3132
|
+
__privateGet$4(this, _data).cache = data.cache ?? parent?.cache;
|
3133
|
+
__privateGet$4(this, _data).fetchOptions = data.fetchOptions ?? parent?.fetchOptions;
|
3068
3134
|
this.any = this.any.bind(this);
|
3069
3135
|
this.all = this.all.bind(this);
|
3070
3136
|
this.not = this.not.bind(this);
|
@@ -3075,10 +3141,10 @@ const _Query = class _Query {
|
|
3075
3141
|
Object.defineProperty(this, "repository", { enumerable: false });
|
3076
3142
|
}
|
3077
3143
|
getQueryOptions() {
|
3078
|
-
return __privateGet$
|
3144
|
+
return __privateGet$4(this, _data);
|
3079
3145
|
}
|
3080
3146
|
key() {
|
3081
|
-
const { columns = [], filter = {}, sort = [], pagination = {} } = __privateGet$
|
3147
|
+
const { columns = [], filter = {}, sort = [], pagination = {} } = __privateGet$4(this, _data);
|
3082
3148
|
const key = JSON.stringify({ columns, filter, sort, pagination });
|
3083
3149
|
return toBase64(key);
|
3084
3150
|
}
|
@@ -3089,7 +3155,7 @@ const _Query = class _Query {
|
|
3089
3155
|
*/
|
3090
3156
|
any(...queries) {
|
3091
3157
|
const $any = queries.map((query) => query.getQueryOptions().filter ?? {});
|
3092
|
-
return new _Query(__privateGet$
|
3158
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $any } }, __privateGet$4(this, _data));
|
3093
3159
|
}
|
3094
3160
|
/**
|
3095
3161
|
* Builds a new query object representing a logical AND between the given subqueries.
|
@@ -3098,7 +3164,7 @@ const _Query = class _Query {
|
|
3098
3164
|
*/
|
3099
3165
|
all(...queries) {
|
3100
3166
|
const $all = queries.map((query) => query.getQueryOptions().filter ?? {});
|
3101
|
-
return new _Query(__privateGet$
|
3167
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $all } }, __privateGet$4(this, _data));
|
3102
3168
|
}
|
3103
3169
|
/**
|
3104
3170
|
* Builds a new query object representing a logical OR negating each subquery. In pseudo-code: !q1 OR !q2
|
@@ -3107,7 +3173,7 @@ const _Query = class _Query {
|
|
3107
3173
|
*/
|
3108
3174
|
not(...queries) {
|
3109
3175
|
const $not = queries.map((query) => query.getQueryOptions().filter ?? {});
|
3110
|
-
return new _Query(__privateGet$
|
3176
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $not } }, __privateGet$4(this, _data));
|
3111
3177
|
}
|
3112
3178
|
/**
|
3113
3179
|
* Builds a new query object representing a logical AND negating each subquery. In pseudo-code: !q1 AND !q2
|
@@ -3116,25 +3182,25 @@ const _Query = class _Query {
|
|
3116
3182
|
*/
|
3117
3183
|
none(...queries) {
|
3118
3184
|
const $none = queries.map((query) => query.getQueryOptions().filter ?? {});
|
3119
|
-
return new _Query(__privateGet$
|
3185
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $none } }, __privateGet$4(this, _data));
|
3120
3186
|
}
|
3121
3187
|
filter(a, b) {
|
3122
3188
|
if (arguments.length === 1) {
|
3123
3189
|
const constraints = Object.entries(a ?? {}).map(([column, constraint]) => ({
|
3124
3190
|
[column]: __privateMethod$3(this, _cleanFilterConstraint, cleanFilterConstraint_fn).call(this, column, constraint)
|
3125
3191
|
}));
|
3126
|
-
const $all = compact([__privateGet$
|
3127
|
-
return new _Query(__privateGet$
|
3192
|
+
const $all = compact([__privateGet$4(this, _data).filter?.$all].flat().concat(constraints));
|
3193
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $all } }, __privateGet$4(this, _data));
|
3128
3194
|
} else {
|
3129
3195
|
const constraints = isDefined(a) && isDefined(b) ? [{ [a]: __privateMethod$3(this, _cleanFilterConstraint, cleanFilterConstraint_fn).call(this, a, b) }] : void 0;
|
3130
|
-
const $all = compact([__privateGet$
|
3131
|
-
return new _Query(__privateGet$
|
3196
|
+
const $all = compact([__privateGet$4(this, _data).filter?.$all].flat().concat(constraints));
|
3197
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { filter: { $all } }, __privateGet$4(this, _data));
|
3132
3198
|
}
|
3133
3199
|
}
|
3134
3200
|
sort(column, direction = "asc") {
|
3135
|
-
const originalSort = [__privateGet$
|
3201
|
+
const originalSort = [__privateGet$4(this, _data).sort ?? []].flat();
|
3136
3202
|
const sort = [...originalSort, { column, direction }];
|
3137
|
-
return new _Query(__privateGet$
|
3203
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { sort }, __privateGet$4(this, _data));
|
3138
3204
|
}
|
3139
3205
|
/**
|
3140
3206
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
@@ -3143,15 +3209,15 @@ const _Query = class _Query {
|
|
3143
3209
|
*/
|
3144
3210
|
select(columns) {
|
3145
3211
|
return new _Query(
|
3146
|
-
__privateGet$
|
3147
|
-
__privateGet$
|
3212
|
+
__privateGet$4(this, _repository),
|
3213
|
+
__privateGet$4(this, _table$1),
|
3148
3214
|
{ columns },
|
3149
|
-
__privateGet$
|
3215
|
+
__privateGet$4(this, _data)
|
3150
3216
|
);
|
3151
3217
|
}
|
3152
3218
|
getPaginated(options = {}) {
|
3153
|
-
const query = new _Query(__privateGet$
|
3154
|
-
return __privateGet$
|
3219
|
+
const query = new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), options, __privateGet$4(this, _data));
|
3220
|
+
return __privateGet$4(this, _repository).query(query);
|
3155
3221
|
}
|
3156
3222
|
/**
|
3157
3223
|
* Get results in an iterator
|
@@ -3188,7 +3254,7 @@ const _Query = class _Query {
|
|
3188
3254
|
if (page.hasNextPage() && options.pagination?.size === void 0) {
|
3189
3255
|
console.trace("Calling getMany does not return all results. Paginate to get all results or call getAll.");
|
3190
3256
|
}
|
3191
|
-
const array = new
|
3257
|
+
const array = new PageRecordArray(page, results.slice(0, size));
|
3192
3258
|
return array;
|
3193
3259
|
}
|
3194
3260
|
async getAll(options = {}) {
|
@@ -3197,7 +3263,7 @@ const _Query = class _Query {
|
|
3197
3263
|
for await (const page of this.getIterator({ ...rest, batchSize })) {
|
3198
3264
|
results.push(...page);
|
3199
3265
|
}
|
3200
|
-
return results;
|
3266
|
+
return new RecordArray(results);
|
3201
3267
|
}
|
3202
3268
|
async getFirst(options = {}) {
|
3203
3269
|
const records = await this.getMany({ ...options, pagination: { size: 1 } });
|
@@ -3212,12 +3278,12 @@ const _Query = class _Query {
|
|
3212
3278
|
async summarize(params = {}) {
|
3213
3279
|
const { summaries, summariesFilter, ...options } = params;
|
3214
3280
|
const query = new _Query(
|
3215
|
-
__privateGet$
|
3216
|
-
__privateGet$
|
3281
|
+
__privateGet$4(this, _repository),
|
3282
|
+
__privateGet$4(this, _table$1),
|
3217
3283
|
options,
|
3218
|
-
__privateGet$
|
3284
|
+
__privateGet$4(this, _data)
|
3219
3285
|
);
|
3220
|
-
return __privateGet$
|
3286
|
+
return __privateGet$4(this, _repository).summarizeTable(query, summaries, summariesFilter);
|
3221
3287
|
}
|
3222
3288
|
/**
|
3223
3289
|
* Builds a new query object adding a cache TTL in milliseconds.
|
@@ -3225,7 +3291,7 @@ const _Query = class _Query {
|
|
3225
3291
|
* @returns A new Query object.
|
3226
3292
|
*/
|
3227
3293
|
cache(ttl) {
|
3228
|
-
return new _Query(__privateGet$
|
3294
|
+
return new _Query(__privateGet$4(this, _repository), __privateGet$4(this, _table$1), { cache: ttl }, __privateGet$4(this, _data));
|
3229
3295
|
}
|
3230
3296
|
/**
|
3231
3297
|
* Retrieve next page of records
|
@@ -3271,7 +3337,7 @@ _repository = new WeakMap();
|
|
3271
3337
|
_data = new WeakMap();
|
3272
3338
|
_cleanFilterConstraint = new WeakSet();
|
3273
3339
|
cleanFilterConstraint_fn = function(column, value) {
|
3274
|
-
const columnType = __privateGet$
|
3340
|
+
const columnType = __privateGet$4(this, _table$1).schema?.columns.find(({ name }) => name === column)?.type;
|
3275
3341
|
if (columnType === "multiple" && (isString(value) || isStringArray(value))) {
|
3276
3342
|
return { $includes: value };
|
3277
3343
|
}
|
@@ -3297,7 +3363,6 @@ const RecordColumnTypes = [
|
|
3297
3363
|
"email",
|
3298
3364
|
"multiple",
|
3299
3365
|
"link",
|
3300
|
-
"object",
|
3301
3366
|
"datetime",
|
3302
3367
|
"vector",
|
3303
3368
|
"file[]",
|
@@ -3362,7 +3427,7 @@ var __accessCheck$4 = (obj, member, msg) => {
|
|
3362
3427
|
if (!member.has(obj))
|
3363
3428
|
throw TypeError("Cannot " + msg);
|
3364
3429
|
};
|
3365
|
-
var __privateGet$
|
3430
|
+
var __privateGet$3 = (obj, member, getter) => {
|
3366
3431
|
__accessCheck$4(obj, member, "read from private field");
|
3367
3432
|
return getter ? getter.call(obj) : member.get(obj);
|
3368
3433
|
};
|
@@ -3371,7 +3436,7 @@ var __privateAdd$4 = (obj, member, value) => {
|
|
3371
3436
|
throw TypeError("Cannot add the same private member more than once");
|
3372
3437
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
3373
3438
|
};
|
3374
|
-
var __privateSet$
|
3439
|
+
var __privateSet$2 = (obj, member, value, setter) => {
|
3375
3440
|
__accessCheck$4(obj, member, "write to private field");
|
3376
3441
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
3377
3442
|
return value;
|
@@ -3380,7 +3445,7 @@ var __privateMethod$2 = (obj, member, method) => {
|
|
3380
3445
|
__accessCheck$4(obj, member, "access private method");
|
3381
3446
|
return method;
|
3382
3447
|
};
|
3383
|
-
var _table, _getFetchProps, _db, _cache, _schemaTables
|
3448
|
+
var _table, _getFetchProps, _db, _cache, _schemaTables, _trace, _insertRecordWithoutId, insertRecordWithoutId_fn, _insertRecordWithId, insertRecordWithId_fn, _insertRecords, insertRecords_fn, _updateRecordWithID, updateRecordWithID_fn, _updateRecords, updateRecords_fn, _upsertRecordWithID, upsertRecordWithID_fn, _deleteRecord, deleteRecord_fn, _deleteRecords, deleteRecords_fn, _setCacheQuery, setCacheQuery_fn, _getCacheQuery, getCacheQuery_fn, _getSchemaTables, getSchemaTables_fn, _transformObjectToApi, transformObjectToApi_fn;
|
3384
3449
|
const BULK_OPERATION_MAX_SIZE = 1e3;
|
3385
3450
|
class Repository extends Query {
|
3386
3451
|
}
|
@@ -3401,31 +3466,31 @@ class RestRepository extends Query {
|
|
3401
3466
|
__privateAdd$4(this, _deleteRecords);
|
3402
3467
|
__privateAdd$4(this, _setCacheQuery);
|
3403
3468
|
__privateAdd$4(this, _getCacheQuery);
|
3404
|
-
__privateAdd$4(this, _getSchemaTables
|
3469
|
+
__privateAdd$4(this, _getSchemaTables);
|
3405
3470
|
__privateAdd$4(this, _transformObjectToApi);
|
3406
3471
|
__privateAdd$4(this, _table, void 0);
|
3407
3472
|
__privateAdd$4(this, _getFetchProps, void 0);
|
3408
3473
|
__privateAdd$4(this, _db, void 0);
|
3409
3474
|
__privateAdd$4(this, _cache, void 0);
|
3410
|
-
__privateAdd$4(this, _schemaTables
|
3475
|
+
__privateAdd$4(this, _schemaTables, void 0);
|
3411
3476
|
__privateAdd$4(this, _trace, void 0);
|
3412
|
-
__privateSet$
|
3413
|
-
__privateSet$
|
3414
|
-
__privateSet$
|
3415
|
-
__privateSet$
|
3416
|
-
__privateSet$
|
3477
|
+
__privateSet$2(this, _table, options.table);
|
3478
|
+
__privateSet$2(this, _db, options.db);
|
3479
|
+
__privateSet$2(this, _cache, options.pluginOptions.cache);
|
3480
|
+
__privateSet$2(this, _schemaTables, options.schemaTables);
|
3481
|
+
__privateSet$2(this, _getFetchProps, () => ({ ...options.pluginOptions, sessionID: generateUUID() }));
|
3417
3482
|
const trace = options.pluginOptions.trace ?? defaultTrace;
|
3418
|
-
__privateSet$
|
3483
|
+
__privateSet$2(this, _trace, async (name, fn, options2 = {}) => {
|
3419
3484
|
return trace(name, fn, {
|
3420
3485
|
...options2,
|
3421
|
-
[TraceAttributes.TABLE]: __privateGet$
|
3486
|
+
[TraceAttributes.TABLE]: __privateGet$3(this, _table),
|
3422
3487
|
[TraceAttributes.KIND]: "sdk-operation",
|
3423
3488
|
[TraceAttributes.VERSION]: VERSION
|
3424
3489
|
});
|
3425
3490
|
});
|
3426
3491
|
}
|
3427
3492
|
async create(a, b, c, d) {
|
3428
|
-
return __privateGet$
|
3493
|
+
return __privateGet$3(this, _trace).call(this, "create", async () => {
|
3429
3494
|
const ifVersion = parseIfVersion(b, c, d);
|
3430
3495
|
if (Array.isArray(a)) {
|
3431
3496
|
if (a.length === 0)
|
@@ -3455,7 +3520,7 @@ class RestRepository extends Query {
|
|
3455
3520
|
});
|
3456
3521
|
}
|
3457
3522
|
async read(a, b) {
|
3458
|
-
return __privateGet$
|
3523
|
+
return __privateGet$3(this, _trace).call(this, "read", async () => {
|
3459
3524
|
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3460
3525
|
if (Array.isArray(a)) {
|
3461
3526
|
if (a.length === 0)
|
@@ -3476,17 +3541,17 @@ class RestRepository extends Query {
|
|
3476
3541
|
workspace: "{workspaceId}",
|
3477
3542
|
dbBranchName: "{dbBranch}",
|
3478
3543
|
region: "{region}",
|
3479
|
-
tableName: __privateGet$
|
3544
|
+
tableName: __privateGet$3(this, _table),
|
3480
3545
|
recordId: id
|
3481
3546
|
},
|
3482
3547
|
queryParams: { columns },
|
3483
|
-
...__privateGet$
|
3548
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3484
3549
|
});
|
3485
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3550
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3486
3551
|
return initObject(
|
3487
|
-
__privateGet$
|
3552
|
+
__privateGet$3(this, _db),
|
3488
3553
|
schemaTables,
|
3489
|
-
__privateGet$
|
3554
|
+
__privateGet$3(this, _table),
|
3490
3555
|
response,
|
3491
3556
|
columns
|
3492
3557
|
);
|
@@ -3501,7 +3566,7 @@ class RestRepository extends Query {
|
|
3501
3566
|
});
|
3502
3567
|
}
|
3503
3568
|
async readOrThrow(a, b) {
|
3504
|
-
return __privateGet$
|
3569
|
+
return __privateGet$3(this, _trace).call(this, "readOrThrow", async () => {
|
3505
3570
|
const result = await this.read(a, b);
|
3506
3571
|
if (Array.isArray(result)) {
|
3507
3572
|
const missingIds = compact(
|
@@ -3520,7 +3585,7 @@ class RestRepository extends Query {
|
|
3520
3585
|
});
|
3521
3586
|
}
|
3522
3587
|
async update(a, b, c, d) {
|
3523
|
-
return __privateGet$
|
3588
|
+
return __privateGet$3(this, _trace).call(this, "update", async () => {
|
3524
3589
|
const ifVersion = parseIfVersion(b, c, d);
|
3525
3590
|
if (Array.isArray(a)) {
|
3526
3591
|
if (a.length === 0)
|
@@ -3553,7 +3618,7 @@ class RestRepository extends Query {
|
|
3553
3618
|
});
|
3554
3619
|
}
|
3555
3620
|
async updateOrThrow(a, b, c, d) {
|
3556
|
-
return __privateGet$
|
3621
|
+
return __privateGet$3(this, _trace).call(this, "updateOrThrow", async () => {
|
3557
3622
|
const result = await this.update(a, b, c, d);
|
3558
3623
|
if (Array.isArray(result)) {
|
3559
3624
|
const missingIds = compact(
|
@@ -3572,7 +3637,7 @@ class RestRepository extends Query {
|
|
3572
3637
|
});
|
3573
3638
|
}
|
3574
3639
|
async createOrUpdate(a, b, c, d) {
|
3575
|
-
return __privateGet$
|
3640
|
+
return __privateGet$3(this, _trace).call(this, "createOrUpdate", async () => {
|
3576
3641
|
const ifVersion = parseIfVersion(b, c, d);
|
3577
3642
|
if (Array.isArray(a)) {
|
3578
3643
|
if (a.length === 0)
|
@@ -3607,7 +3672,7 @@ class RestRepository extends Query {
|
|
3607
3672
|
});
|
3608
3673
|
}
|
3609
3674
|
async createOrReplace(a, b, c, d) {
|
3610
|
-
return __privateGet$
|
3675
|
+
return __privateGet$3(this, _trace).call(this, "createOrReplace", async () => {
|
3611
3676
|
const ifVersion = parseIfVersion(b, c, d);
|
3612
3677
|
if (Array.isArray(a)) {
|
3613
3678
|
if (a.length === 0)
|
@@ -3639,7 +3704,7 @@ class RestRepository extends Query {
|
|
3639
3704
|
});
|
3640
3705
|
}
|
3641
3706
|
async delete(a, b) {
|
3642
|
-
return __privateGet$
|
3707
|
+
return __privateGet$3(this, _trace).call(this, "delete", async () => {
|
3643
3708
|
if (Array.isArray(a)) {
|
3644
3709
|
if (a.length === 0)
|
3645
3710
|
return [];
|
@@ -3665,7 +3730,7 @@ class RestRepository extends Query {
|
|
3665
3730
|
});
|
3666
3731
|
}
|
3667
3732
|
async deleteOrThrow(a, b) {
|
3668
|
-
return __privateGet$
|
3733
|
+
return __privateGet$3(this, _trace).call(this, "deleteOrThrow", async () => {
|
3669
3734
|
const result = await this.delete(a, b);
|
3670
3735
|
if (Array.isArray(result)) {
|
3671
3736
|
const missingIds = compact(
|
@@ -3683,13 +3748,13 @@ class RestRepository extends Query {
|
|
3683
3748
|
});
|
3684
3749
|
}
|
3685
3750
|
async search(query, options = {}) {
|
3686
|
-
return __privateGet$
|
3751
|
+
return __privateGet$3(this, _trace).call(this, "search", async () => {
|
3687
3752
|
const { records, totalCount } = await searchTable({
|
3688
3753
|
pathParams: {
|
3689
3754
|
workspace: "{workspaceId}",
|
3690
3755
|
dbBranchName: "{dbBranch}",
|
3691
3756
|
region: "{region}",
|
3692
|
-
tableName: __privateGet$
|
3757
|
+
tableName: __privateGet$3(this, _table)
|
3693
3758
|
},
|
3694
3759
|
body: {
|
3695
3760
|
query,
|
@@ -3701,23 +3766,23 @@ class RestRepository extends Query {
|
|
3701
3766
|
page: options.page,
|
3702
3767
|
target: options.target
|
3703
3768
|
},
|
3704
|
-
...__privateGet$
|
3769
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3705
3770
|
});
|
3706
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3771
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3707
3772
|
return {
|
3708
|
-
records: records.map((item) => initObject(__privateGet$
|
3773
|
+
records: records.map((item) => initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), item, ["*"])),
|
3709
3774
|
totalCount
|
3710
3775
|
};
|
3711
3776
|
});
|
3712
3777
|
}
|
3713
3778
|
async vectorSearch(column, query, options) {
|
3714
|
-
return __privateGet$
|
3779
|
+
return __privateGet$3(this, _trace).call(this, "vectorSearch", async () => {
|
3715
3780
|
const { records, totalCount } = await vectorSearchTable({
|
3716
3781
|
pathParams: {
|
3717
3782
|
workspace: "{workspaceId}",
|
3718
3783
|
dbBranchName: "{dbBranch}",
|
3719
3784
|
region: "{region}",
|
3720
|
-
tableName: __privateGet$
|
3785
|
+
tableName: __privateGet$3(this, _table)
|
3721
3786
|
},
|
3722
3787
|
body: {
|
3723
3788
|
column,
|
@@ -3726,32 +3791,32 @@ class RestRepository extends Query {
|
|
3726
3791
|
size: options?.size,
|
3727
3792
|
filter: options?.filter
|
3728
3793
|
},
|
3729
|
-
...__privateGet$
|
3794
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3730
3795
|
});
|
3731
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3796
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3732
3797
|
return {
|
3733
|
-
records: records.map((item) => initObject(__privateGet$
|
3798
|
+
records: records.map((item) => initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), item, ["*"])),
|
3734
3799
|
totalCount
|
3735
3800
|
};
|
3736
3801
|
});
|
3737
3802
|
}
|
3738
3803
|
async aggregate(aggs, filter) {
|
3739
|
-
return __privateGet$
|
3804
|
+
return __privateGet$3(this, _trace).call(this, "aggregate", async () => {
|
3740
3805
|
const result = await aggregateTable({
|
3741
3806
|
pathParams: {
|
3742
3807
|
workspace: "{workspaceId}",
|
3743
3808
|
dbBranchName: "{dbBranch}",
|
3744
3809
|
region: "{region}",
|
3745
|
-
tableName: __privateGet$
|
3810
|
+
tableName: __privateGet$3(this, _table)
|
3746
3811
|
},
|
3747
3812
|
body: { aggs, filter },
|
3748
|
-
...__privateGet$
|
3813
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3749
3814
|
});
|
3750
3815
|
return result;
|
3751
3816
|
});
|
3752
3817
|
}
|
3753
3818
|
async query(query) {
|
3754
|
-
return __privateGet$
|
3819
|
+
return __privateGet$3(this, _trace).call(this, "query", async () => {
|
3755
3820
|
const cacheQuery = await __privateMethod$2(this, _getCacheQuery, getCacheQuery_fn).call(this, query);
|
3756
3821
|
if (cacheQuery)
|
3757
3822
|
return new Page(query, cacheQuery.meta, cacheQuery.records);
|
@@ -3761,7 +3826,7 @@ class RestRepository extends Query {
|
|
3761
3826
|
workspace: "{workspaceId}",
|
3762
3827
|
dbBranchName: "{dbBranch}",
|
3763
3828
|
region: "{region}",
|
3764
|
-
tableName: __privateGet$
|
3829
|
+
tableName: __privateGet$3(this, _table)
|
3765
3830
|
},
|
3766
3831
|
body: {
|
3767
3832
|
filter: cleanFilter(data.filter),
|
@@ -3771,14 +3836,14 @@ class RestRepository extends Query {
|
|
3771
3836
|
consistency: data.consistency
|
3772
3837
|
},
|
3773
3838
|
fetchOptions: data.fetchOptions,
|
3774
|
-
...__privateGet$
|
3839
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3775
3840
|
});
|
3776
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3841
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3777
3842
|
const records = objects.map(
|
3778
3843
|
(record) => initObject(
|
3779
|
-
__privateGet$
|
3844
|
+
__privateGet$3(this, _db),
|
3780
3845
|
schemaTables,
|
3781
|
-
__privateGet$
|
3846
|
+
__privateGet$3(this, _table),
|
3782
3847
|
record,
|
3783
3848
|
data.columns ?? ["*"]
|
3784
3849
|
)
|
@@ -3788,14 +3853,14 @@ class RestRepository extends Query {
|
|
3788
3853
|
});
|
3789
3854
|
}
|
3790
3855
|
async summarizeTable(query, summaries, summariesFilter) {
|
3791
|
-
return __privateGet$
|
3856
|
+
return __privateGet$3(this, _trace).call(this, "summarize", async () => {
|
3792
3857
|
const data = query.getQueryOptions();
|
3793
3858
|
const result = await summarizeTable({
|
3794
3859
|
pathParams: {
|
3795
3860
|
workspace: "{workspaceId}",
|
3796
3861
|
dbBranchName: "{dbBranch}",
|
3797
3862
|
region: "{region}",
|
3798
|
-
tableName: __privateGet$
|
3863
|
+
tableName: __privateGet$3(this, _table)
|
3799
3864
|
},
|
3800
3865
|
body: {
|
3801
3866
|
filter: cleanFilter(data.filter),
|
@@ -3806,13 +3871,13 @@ class RestRepository extends Query {
|
|
3806
3871
|
summaries,
|
3807
3872
|
summariesFilter
|
3808
3873
|
},
|
3809
|
-
...__privateGet$
|
3874
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3810
3875
|
});
|
3811
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3876
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3812
3877
|
return {
|
3813
3878
|
...result,
|
3814
3879
|
summaries: result.summaries.map(
|
3815
|
-
(summary) => initObject(__privateGet$
|
3880
|
+
(summary) => initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), summary, data.columns ?? [])
|
3816
3881
|
)
|
3817
3882
|
};
|
3818
3883
|
});
|
@@ -3824,7 +3889,7 @@ class RestRepository extends Query {
|
|
3824
3889
|
workspace: "{workspaceId}",
|
3825
3890
|
dbBranchName: "{dbBranch}",
|
3826
3891
|
region: "{region}",
|
3827
|
-
tableName: __privateGet$
|
3892
|
+
tableName: __privateGet$3(this, _table),
|
3828
3893
|
sessionId: options?.sessionId
|
3829
3894
|
},
|
3830
3895
|
body: {
|
@@ -3834,7 +3899,7 @@ class RestRepository extends Query {
|
|
3834
3899
|
search: options?.searchType === "keyword" ? options?.search : void 0,
|
3835
3900
|
vectorSearch: options?.searchType === "vector" ? options?.vectorSearch : void 0
|
3836
3901
|
},
|
3837
|
-
...__privateGet$
|
3902
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3838
3903
|
};
|
3839
3904
|
if (options?.onMessage) {
|
3840
3905
|
fetchSSERequest({
|
@@ -3855,7 +3920,7 @@ _table = new WeakMap();
|
|
3855
3920
|
_getFetchProps = new WeakMap();
|
3856
3921
|
_db = new WeakMap();
|
3857
3922
|
_cache = new WeakMap();
|
3858
|
-
_schemaTables
|
3923
|
+
_schemaTables = new WeakMap();
|
3859
3924
|
_trace = new WeakMap();
|
3860
3925
|
_insertRecordWithoutId = new WeakSet();
|
3861
3926
|
insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
|
@@ -3865,14 +3930,14 @@ insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
|
|
3865
3930
|
workspace: "{workspaceId}",
|
3866
3931
|
dbBranchName: "{dbBranch}",
|
3867
3932
|
region: "{region}",
|
3868
|
-
tableName: __privateGet$
|
3933
|
+
tableName: __privateGet$3(this, _table)
|
3869
3934
|
},
|
3870
3935
|
queryParams: { columns },
|
3871
3936
|
body: record,
|
3872
|
-
...__privateGet$
|
3937
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3873
3938
|
});
|
3874
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3875
|
-
return initObject(__privateGet$
|
3939
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3940
|
+
return initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), response, columns);
|
3876
3941
|
};
|
3877
3942
|
_insertRecordWithId = new WeakSet();
|
3878
3943
|
insertRecordWithId_fn = async function(recordId, object, columns = ["*"], { createOnly, ifVersion }) {
|
@@ -3884,21 +3949,21 @@ insertRecordWithId_fn = async function(recordId, object, columns = ["*"], { crea
|
|
3884
3949
|
workspace: "{workspaceId}",
|
3885
3950
|
dbBranchName: "{dbBranch}",
|
3886
3951
|
region: "{region}",
|
3887
|
-
tableName: __privateGet$
|
3952
|
+
tableName: __privateGet$3(this, _table),
|
3888
3953
|
recordId
|
3889
3954
|
},
|
3890
3955
|
body: record,
|
3891
3956
|
queryParams: { createOnly, columns, ifVersion },
|
3892
|
-
...__privateGet$
|
3957
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3893
3958
|
});
|
3894
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3895
|
-
return initObject(__privateGet$
|
3959
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
3960
|
+
return initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), response, columns);
|
3896
3961
|
};
|
3897
3962
|
_insertRecords = new WeakSet();
|
3898
3963
|
insertRecords_fn = async function(objects, { createOnly, ifVersion }) {
|
3899
3964
|
const operations = await promiseMap(objects, async (object) => {
|
3900
3965
|
const record = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
|
3901
|
-
return { insert: { table: __privateGet$
|
3966
|
+
return { insert: { table: __privateGet$3(this, _table), record, createOnly, ifVersion } };
|
3902
3967
|
});
|
3903
3968
|
const chunkedOperations = chunk(operations, BULK_OPERATION_MAX_SIZE);
|
3904
3969
|
const ids = [];
|
@@ -3910,7 +3975,7 @@ insertRecords_fn = async function(objects, { createOnly, ifVersion }) {
|
|
3910
3975
|
region: "{region}"
|
3911
3976
|
},
|
3912
3977
|
body: { operations: operations2 },
|
3913
|
-
...__privateGet$
|
3978
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3914
3979
|
});
|
3915
3980
|
for (const result of results) {
|
3916
3981
|
if (result.operation === "insert") {
|
@@ -3933,15 +3998,15 @@ updateRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVe
|
|
3933
3998
|
workspace: "{workspaceId}",
|
3934
3999
|
dbBranchName: "{dbBranch}",
|
3935
4000
|
region: "{region}",
|
3936
|
-
tableName: __privateGet$
|
4001
|
+
tableName: __privateGet$3(this, _table),
|
3937
4002
|
recordId
|
3938
4003
|
},
|
3939
4004
|
queryParams: { columns, ifVersion },
|
3940
4005
|
body: record,
|
3941
|
-
...__privateGet$
|
4006
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3942
4007
|
});
|
3943
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3944
|
-
return initObject(__privateGet$
|
4008
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
4009
|
+
return initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), response, columns);
|
3945
4010
|
} catch (e) {
|
3946
4011
|
if (isObject(e) && e.status === 404) {
|
3947
4012
|
return null;
|
@@ -3953,7 +4018,7 @@ _updateRecords = new WeakSet();
|
|
3953
4018
|
updateRecords_fn = async function(objects, { ifVersion, upsert }) {
|
3954
4019
|
const operations = await promiseMap(objects, async ({ id, ...object }) => {
|
3955
4020
|
const fields = await __privateMethod$2(this, _transformObjectToApi, transformObjectToApi_fn).call(this, object);
|
3956
|
-
return { update: { table: __privateGet$
|
4021
|
+
return { update: { table: __privateGet$3(this, _table), id, ifVersion, upsert, fields } };
|
3957
4022
|
});
|
3958
4023
|
const chunkedOperations = chunk(operations, BULK_OPERATION_MAX_SIZE);
|
3959
4024
|
const ids = [];
|
@@ -3965,7 +4030,7 @@ updateRecords_fn = async function(objects, { ifVersion, upsert }) {
|
|
3965
4030
|
region: "{region}"
|
3966
4031
|
},
|
3967
4032
|
body: { operations: operations2 },
|
3968
|
-
...__privateGet$
|
4033
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3969
4034
|
});
|
3970
4035
|
for (const result of results) {
|
3971
4036
|
if (result.operation === "update") {
|
@@ -3986,15 +4051,15 @@ upsertRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVe
|
|
3986
4051
|
workspace: "{workspaceId}",
|
3987
4052
|
dbBranchName: "{dbBranch}",
|
3988
4053
|
region: "{region}",
|
3989
|
-
tableName: __privateGet$
|
4054
|
+
tableName: __privateGet$3(this, _table),
|
3990
4055
|
recordId
|
3991
4056
|
},
|
3992
4057
|
queryParams: { columns, ifVersion },
|
3993
4058
|
body: object,
|
3994
|
-
...__privateGet$
|
4059
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
3995
4060
|
});
|
3996
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
3997
|
-
return initObject(__privateGet$
|
4061
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
4062
|
+
return initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), response, columns);
|
3998
4063
|
};
|
3999
4064
|
_deleteRecord = new WeakSet();
|
4000
4065
|
deleteRecord_fn = async function(recordId, columns = ["*"]) {
|
@@ -4006,14 +4071,14 @@ deleteRecord_fn = async function(recordId, columns = ["*"]) {
|
|
4006
4071
|
workspace: "{workspaceId}",
|
4007
4072
|
dbBranchName: "{dbBranch}",
|
4008
4073
|
region: "{region}",
|
4009
|
-
tableName: __privateGet$
|
4074
|
+
tableName: __privateGet$3(this, _table),
|
4010
4075
|
recordId
|
4011
4076
|
},
|
4012
4077
|
queryParams: { columns },
|
4013
|
-
...__privateGet$
|
4078
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
4014
4079
|
});
|
4015
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
4016
|
-
return initObject(__privateGet$
|
4080
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
4081
|
+
return initObject(__privateGet$3(this, _db), schemaTables, __privateGet$3(this, _table), response, columns);
|
4017
4082
|
} catch (e) {
|
4018
4083
|
if (isObject(e) && e.status === 404) {
|
4019
4084
|
return null;
|
@@ -4024,7 +4089,7 @@ deleteRecord_fn = async function(recordId, columns = ["*"]) {
|
|
4024
4089
|
_deleteRecords = new WeakSet();
|
4025
4090
|
deleteRecords_fn = async function(recordIds) {
|
4026
4091
|
const chunkedOperations = chunk(
|
4027
|
-
compact(recordIds).map((id) => ({ delete: { table: __privateGet$
|
4092
|
+
compact(recordIds).map((id) => ({ delete: { table: __privateGet$3(this, _table), id } })),
|
4028
4093
|
BULK_OPERATION_MAX_SIZE
|
4029
4094
|
);
|
4030
4095
|
for (const operations of chunkedOperations) {
|
@@ -4035,44 +4100,44 @@ deleteRecords_fn = async function(recordIds) {
|
|
4035
4100
|
region: "{region}"
|
4036
4101
|
},
|
4037
4102
|
body: { operations },
|
4038
|
-
...__privateGet$
|
4103
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
4039
4104
|
});
|
4040
4105
|
}
|
4041
4106
|
};
|
4042
4107
|
_setCacheQuery = new WeakSet();
|
4043
4108
|
setCacheQuery_fn = async function(query, meta, records) {
|
4044
|
-
await __privateGet$
|
4109
|
+
await __privateGet$3(this, _cache)?.set(`query_${__privateGet$3(this, _table)}:${query.key()}`, { date: /* @__PURE__ */ new Date(), meta, records });
|
4045
4110
|
};
|
4046
4111
|
_getCacheQuery = new WeakSet();
|
4047
4112
|
getCacheQuery_fn = async function(query) {
|
4048
|
-
const key = `query_${__privateGet$
|
4049
|
-
const result = await __privateGet$
|
4113
|
+
const key = `query_${__privateGet$3(this, _table)}:${query.key()}`;
|
4114
|
+
const result = await __privateGet$3(this, _cache)?.get(key);
|
4050
4115
|
if (!result)
|
4051
4116
|
return null;
|
4052
|
-
const defaultTTL = __privateGet$
|
4117
|
+
const defaultTTL = __privateGet$3(this, _cache)?.defaultQueryTTL ?? -1;
|
4053
4118
|
const { cache: ttl = defaultTTL } = query.getQueryOptions();
|
4054
4119
|
if (ttl < 0)
|
4055
4120
|
return null;
|
4056
4121
|
const hasExpired = result.date.getTime() + ttl < Date.now();
|
4057
4122
|
return hasExpired ? null : result;
|
4058
4123
|
};
|
4059
|
-
_getSchemaTables
|
4060
|
-
getSchemaTables_fn
|
4061
|
-
if (__privateGet$
|
4062
|
-
return __privateGet$
|
4124
|
+
_getSchemaTables = new WeakSet();
|
4125
|
+
getSchemaTables_fn = async function() {
|
4126
|
+
if (__privateGet$3(this, _schemaTables))
|
4127
|
+
return __privateGet$3(this, _schemaTables);
|
4063
4128
|
const { schema } = await getBranchDetails({
|
4064
4129
|
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
4065
|
-
...__privateGet$
|
4130
|
+
...__privateGet$3(this, _getFetchProps).call(this)
|
4066
4131
|
});
|
4067
|
-
__privateSet$
|
4132
|
+
__privateSet$2(this, _schemaTables, schema.tables);
|
4068
4133
|
return schema.tables;
|
4069
4134
|
};
|
4070
4135
|
_transformObjectToApi = new WeakSet();
|
4071
4136
|
transformObjectToApi_fn = async function(object) {
|
4072
|
-
const schemaTables = await __privateMethod$2(this, _getSchemaTables
|
4073
|
-
const schema = schemaTables.find((table) => table.name === __privateGet$
|
4137
|
+
const schemaTables = await __privateMethod$2(this, _getSchemaTables, getSchemaTables_fn).call(this);
|
4138
|
+
const schema = schemaTables.find((table) => table.name === __privateGet$3(this, _table));
|
4074
4139
|
if (!schema)
|
4075
|
-
throw new Error(`Table ${__privateGet$
|
4140
|
+
throw new Error(`Table ${__privateGet$3(this, _table)} not found in schema`);
|
4076
4141
|
const result = {};
|
4077
4142
|
for (const [key, value] of Object.entries(object)) {
|
4078
4143
|
if (key === "xata")
|
@@ -4228,7 +4293,7 @@ var __accessCheck$3 = (obj, member, msg) => {
|
|
4228
4293
|
if (!member.has(obj))
|
4229
4294
|
throw TypeError("Cannot " + msg);
|
4230
4295
|
};
|
4231
|
-
var __privateGet$
|
4296
|
+
var __privateGet$2 = (obj, member, getter) => {
|
4232
4297
|
__accessCheck$3(obj, member, "read from private field");
|
4233
4298
|
return getter ? getter.call(obj) : member.get(obj);
|
4234
4299
|
};
|
@@ -4237,7 +4302,7 @@ var __privateAdd$3 = (obj, member, value) => {
|
|
4237
4302
|
throw TypeError("Cannot add the same private member more than once");
|
4238
4303
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
4239
4304
|
};
|
4240
|
-
var __privateSet$
|
4305
|
+
var __privateSet$1 = (obj, member, value, setter) => {
|
4241
4306
|
__accessCheck$3(obj, member, "write to private field");
|
4242
4307
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
4243
4308
|
return value;
|
@@ -4246,29 +4311,29 @@ var _map;
|
|
4246
4311
|
class SimpleCache {
|
4247
4312
|
constructor(options = {}) {
|
4248
4313
|
__privateAdd$3(this, _map, void 0);
|
4249
|
-
__privateSet$
|
4314
|
+
__privateSet$1(this, _map, /* @__PURE__ */ new Map());
|
4250
4315
|
this.capacity = options.max ?? 500;
|
4251
4316
|
this.defaultQueryTTL = options.defaultQueryTTL ?? 60 * 1e3;
|
4252
4317
|
}
|
4253
4318
|
async getAll() {
|
4254
|
-
return Object.fromEntries(__privateGet$
|
4319
|
+
return Object.fromEntries(__privateGet$2(this, _map));
|
4255
4320
|
}
|
4256
4321
|
async get(key) {
|
4257
|
-
return __privateGet$
|
4322
|
+
return __privateGet$2(this, _map).get(key) ?? null;
|
4258
4323
|
}
|
4259
4324
|
async set(key, value) {
|
4260
4325
|
await this.delete(key);
|
4261
|
-
__privateGet$
|
4262
|
-
if (__privateGet$
|
4263
|
-
const leastRecentlyUsed = __privateGet$
|
4326
|
+
__privateGet$2(this, _map).set(key, value);
|
4327
|
+
if (__privateGet$2(this, _map).size > this.capacity) {
|
4328
|
+
const leastRecentlyUsed = __privateGet$2(this, _map).keys().next().value;
|
4264
4329
|
await this.delete(leastRecentlyUsed);
|
4265
4330
|
}
|
4266
4331
|
}
|
4267
4332
|
async delete(key) {
|
4268
|
-
__privateGet$
|
4333
|
+
__privateGet$2(this, _map).delete(key);
|
4269
4334
|
}
|
4270
4335
|
async clear() {
|
4271
|
-
return __privateGet$
|
4336
|
+
return __privateGet$2(this, _map).clear();
|
4272
4337
|
}
|
4273
4338
|
}
|
4274
4339
|
_map = new WeakMap();
|
@@ -4305,7 +4370,7 @@ var __accessCheck$2 = (obj, member, msg) => {
|
|
4305
4370
|
if (!member.has(obj))
|
4306
4371
|
throw TypeError("Cannot " + msg);
|
4307
4372
|
};
|
4308
|
-
var __privateGet$
|
4373
|
+
var __privateGet$1 = (obj, member, getter) => {
|
4309
4374
|
__accessCheck$2(obj, member, "read from private field");
|
4310
4375
|
return getter ? getter.call(obj) : member.get(obj);
|
4311
4376
|
};
|
@@ -4314,18 +4379,11 @@ var __privateAdd$2 = (obj, member, value) => {
|
|
4314
4379
|
throw TypeError("Cannot add the same private member more than once");
|
4315
4380
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
4316
4381
|
};
|
4317
|
-
var
|
4318
|
-
__accessCheck$2(obj, member, "write to private field");
|
4319
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
4320
|
-
return value;
|
4321
|
-
};
|
4322
|
-
var _tables, _schemaTables$1;
|
4382
|
+
var _tables;
|
4323
4383
|
class SchemaPlugin extends XataPlugin {
|
4324
|
-
constructor(
|
4384
|
+
constructor() {
|
4325
4385
|
super();
|
4326
4386
|
__privateAdd$2(this, _tables, {});
|
4327
|
-
__privateAdd$2(this, _schemaTables$1, void 0);
|
4328
|
-
__privateSet$2(this, _schemaTables$1, schemaTables);
|
4329
4387
|
}
|
4330
4388
|
build(pluginOptions) {
|
4331
4389
|
const db = new Proxy(
|
@@ -4334,22 +4392,21 @@ class SchemaPlugin extends XataPlugin {
|
|
4334
4392
|
get: (_target, table) => {
|
4335
4393
|
if (!isString(table))
|
4336
4394
|
throw new Error("Invalid table name");
|
4337
|
-
if (__privateGet$
|
4338
|
-
__privateGet$
|
4395
|
+
if (__privateGet$1(this, _tables)[table] === void 0) {
|
4396
|
+
__privateGet$1(this, _tables)[table] = new RestRepository({ db, pluginOptions, table, schemaTables: pluginOptions.tables });
|
4339
4397
|
}
|
4340
|
-
return __privateGet$
|
4398
|
+
return __privateGet$1(this, _tables)[table];
|
4341
4399
|
}
|
4342
4400
|
}
|
4343
4401
|
);
|
4344
|
-
const tableNames =
|
4402
|
+
const tableNames = pluginOptions.tables?.map(({ name }) => name) ?? [];
|
4345
4403
|
for (const table of tableNames) {
|
4346
|
-
db[table] = new RestRepository({ db, pluginOptions, table, schemaTables:
|
4404
|
+
db[table] = new RestRepository({ db, pluginOptions, table, schemaTables: pluginOptions.tables });
|
4347
4405
|
}
|
4348
4406
|
return db;
|
4349
4407
|
}
|
4350
4408
|
}
|
4351
4409
|
_tables = new WeakMap();
|
4352
|
-
_schemaTables$1 = new WeakMap();
|
4353
4410
|
|
4354
4411
|
class FilesPlugin extends XataPlugin {
|
4355
4412
|
build(pluginOptions) {
|
@@ -4429,54 +4486,40 @@ var __accessCheck$1 = (obj, member, msg) => {
|
|
4429
4486
|
if (!member.has(obj))
|
4430
4487
|
throw TypeError("Cannot " + msg);
|
4431
4488
|
};
|
4432
|
-
var __privateGet$1 = (obj, member, getter) => {
|
4433
|
-
__accessCheck$1(obj, member, "read from private field");
|
4434
|
-
return getter ? getter.call(obj) : member.get(obj);
|
4435
|
-
};
|
4436
4489
|
var __privateAdd$1 = (obj, member, value) => {
|
4437
4490
|
if (member.has(obj))
|
4438
4491
|
throw TypeError("Cannot add the same private member more than once");
|
4439
4492
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
4440
4493
|
};
|
4441
|
-
var __privateSet$1 = (obj, member, value, setter) => {
|
4442
|
-
__accessCheck$1(obj, member, "write to private field");
|
4443
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
4444
|
-
return value;
|
4445
|
-
};
|
4446
4494
|
var __privateMethod$1 = (obj, member, method) => {
|
4447
4495
|
__accessCheck$1(obj, member, "access private method");
|
4448
4496
|
return method;
|
4449
4497
|
};
|
4450
|
-
var
|
4498
|
+
var _search, search_fn;
|
4451
4499
|
class SearchPlugin extends XataPlugin {
|
4452
|
-
constructor(db
|
4500
|
+
constructor(db) {
|
4453
4501
|
super();
|
4454
4502
|
this.db = db;
|
4455
4503
|
__privateAdd$1(this, _search);
|
4456
|
-
__privateAdd$1(this, _getSchemaTables);
|
4457
|
-
__privateAdd$1(this, _schemaTables, void 0);
|
4458
|
-
__privateSet$1(this, _schemaTables, schemaTables);
|
4459
4504
|
}
|
4460
4505
|
build(pluginOptions) {
|
4461
4506
|
return {
|
4462
4507
|
all: async (query, options = {}) => {
|
4463
4508
|
const { records, totalCount } = await __privateMethod$1(this, _search, search_fn).call(this, query, options, pluginOptions);
|
4464
|
-
const schemaTables = await __privateMethod$1(this, _getSchemaTables, getSchemaTables_fn).call(this, pluginOptions);
|
4465
4509
|
return {
|
4466
4510
|
totalCount,
|
4467
4511
|
records: records.map((record) => {
|
4468
4512
|
const { table = "orphan" } = record.xata;
|
4469
|
-
return { table, record: initObject(this.db,
|
4513
|
+
return { table, record: initObject(this.db, pluginOptions.tables, table, record, ["*"]) };
|
4470
4514
|
})
|
4471
4515
|
};
|
4472
4516
|
},
|
4473
4517
|
byTable: async (query, options = {}) => {
|
4474
4518
|
const { records: rawRecords, totalCount } = await __privateMethod$1(this, _search, search_fn).call(this, query, options, pluginOptions);
|
4475
|
-
const schemaTables = await __privateMethod$1(this, _getSchemaTables, getSchemaTables_fn).call(this, pluginOptions);
|
4476
4519
|
const records = rawRecords.reduce((acc, record) => {
|
4477
4520
|
const { table = "orphan" } = record.xata;
|
4478
4521
|
const items = acc[table] ?? [];
|
4479
|
-
const item = initObject(this.db,
|
4522
|
+
const item = initObject(this.db, pluginOptions.tables, table, record, ["*"]);
|
4480
4523
|
return { ...acc, [table]: [...items, item] };
|
4481
4524
|
}, {});
|
4482
4525
|
return { totalCount, records };
|
@@ -4484,29 +4527,17 @@ class SearchPlugin extends XataPlugin {
|
|
4484
4527
|
};
|
4485
4528
|
}
|
4486
4529
|
}
|
4487
|
-
_schemaTables = new WeakMap();
|
4488
4530
|
_search = new WeakSet();
|
4489
4531
|
search_fn = async function(query, options, pluginOptions) {
|
4490
4532
|
const { tables, fuzziness, highlight, prefix, page } = options ?? {};
|
4491
4533
|
const { records, totalCount } = await searchBranch({
|
4492
4534
|
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
4493
|
-
// @ts-
|
4535
|
+
// @ts-expect-error Filter properties do not match inferred type
|
4494
4536
|
body: { tables, query, fuzziness, prefix, highlight, page },
|
4495
4537
|
...pluginOptions
|
4496
4538
|
});
|
4497
4539
|
return { records, totalCount };
|
4498
4540
|
};
|
4499
|
-
_getSchemaTables = new WeakSet();
|
4500
|
-
getSchemaTables_fn = async function(pluginOptions) {
|
4501
|
-
if (__privateGet$1(this, _schemaTables))
|
4502
|
-
return __privateGet$1(this, _schemaTables);
|
4503
|
-
const { schema } = await getBranchDetails({
|
4504
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
4505
|
-
...pluginOptions
|
4506
|
-
});
|
4507
|
-
__privateSet$1(this, _schemaTables, schema.tables);
|
4508
|
-
return schema.tables;
|
4509
|
-
};
|
4510
4541
|
|
4511
4542
|
function escapeElement(elementRepresentation) {
|
4512
4543
|
const escaped = elementRepresentation.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
@@ -4560,25 +4591,39 @@ function prepareParams(param1, param2) {
|
|
4560
4591
|
return { statement, params: param2?.map((value) => prepareValue(value)) };
|
4561
4592
|
}
|
4562
4593
|
if (isObject(param1)) {
|
4563
|
-
const { statement, params, consistency } = param1;
|
4564
|
-
return { statement, params: params?.map((value) => prepareValue(value)), consistency };
|
4594
|
+
const { statement, params, consistency, responseType } = param1;
|
4595
|
+
return { statement, params: params?.map((value) => prepareValue(value)), consistency, responseType };
|
4565
4596
|
}
|
4566
4597
|
throw new Error("Invalid query");
|
4567
4598
|
}
|
4568
4599
|
|
4569
4600
|
class SQLPlugin extends XataPlugin {
|
4570
4601
|
build(pluginOptions) {
|
4571
|
-
return async (
|
4572
|
-
|
4573
|
-
|
4602
|
+
return async (query, ...parameters) => {
|
4603
|
+
if (!isParamsObject(query) && (!isTemplateStringsArray(query) || !Array.isArray(parameters))) {
|
4604
|
+
throw new Error("Invalid usage of `xata.sql`. Please use it as a tagged template or with an object.");
|
4605
|
+
}
|
4606
|
+
const { statement, params, consistency, responseType } = prepareParams(query, parameters);
|
4607
|
+
const {
|
4608
|
+
records,
|
4609
|
+
rows,
|
4610
|
+
warning,
|
4611
|
+
columns = []
|
4612
|
+
} = await sqlQuery({
|
4574
4613
|
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
4575
|
-
body: { statement, params, consistency },
|
4614
|
+
body: { statement, params, consistency, responseType },
|
4576
4615
|
...pluginOptions
|
4577
4616
|
});
|
4578
|
-
return { records, warning };
|
4617
|
+
return { records, rows, warning, columns };
|
4579
4618
|
};
|
4580
4619
|
}
|
4581
4620
|
}
|
4621
|
+
function isTemplateStringsArray(strings) {
|
4622
|
+
return Array.isArray(strings) && "raw" in strings && Array.isArray(strings.raw);
|
4623
|
+
}
|
4624
|
+
function isParamsObject(params) {
|
4625
|
+
return isObject(params) && "statement" in params;
|
4626
|
+
}
|
4582
4627
|
|
4583
4628
|
class TransactionPlugin extends XataPlugin {
|
4584
4629
|
build(pluginOptions) {
|
@@ -4620,7 +4665,7 @@ var __privateMethod = (obj, member, method) => {
|
|
4620
4665
|
const buildClient = (plugins) => {
|
4621
4666
|
var _options, _parseOptions, parseOptions_fn, _getFetchProps, getFetchProps_fn, _a;
|
4622
4667
|
return _a = class {
|
4623
|
-
constructor(options = {},
|
4668
|
+
constructor(options = {}, tables) {
|
4624
4669
|
__privateAdd(this, _parseOptions);
|
4625
4670
|
__privateAdd(this, _getFetchProps);
|
4626
4671
|
__privateAdd(this, _options, void 0);
|
@@ -4629,13 +4674,15 @@ const buildClient = (plugins) => {
|
|
4629
4674
|
const pluginOptions = {
|
4630
4675
|
...__privateMethod(this, _getFetchProps, getFetchProps_fn).call(this, safeOptions),
|
4631
4676
|
cache: safeOptions.cache,
|
4632
|
-
host: safeOptions.host
|
4677
|
+
host: safeOptions.host,
|
4678
|
+
tables
|
4633
4679
|
};
|
4634
|
-
const db = new SchemaPlugin(
|
4635
|
-
const search = new SearchPlugin(db
|
4680
|
+
const db = new SchemaPlugin().build(pluginOptions);
|
4681
|
+
const search = new SearchPlugin(db).build(pluginOptions);
|
4636
4682
|
const transactions = new TransactionPlugin().build(pluginOptions);
|
4637
4683
|
const sql = new SQLPlugin().build(pluginOptions);
|
4638
4684
|
const files = new FilesPlugin().build(pluginOptions);
|
4685
|
+
this.schema = { tables };
|
4639
4686
|
this.db = db;
|
4640
4687
|
this.search = search;
|
4641
4688
|
this.transactions = transactions;
|
@@ -4657,7 +4704,7 @@ const buildClient = (plugins) => {
|
|
4657
4704
|
const isBrowser = typeof window !== "undefined" && typeof Deno === "undefined";
|
4658
4705
|
if (isBrowser && !enableBrowser) {
|
4659
4706
|
throw new Error(
|
4660
|
-
"You are trying to use Xata from the browser, which is potentially a non-secure environment.
|
4707
|
+
"You are trying to use Xata from the browser, which is potentially a non-secure environment. How to fix: https://xata.io/docs/messages/api-key-browser-error"
|
4661
4708
|
);
|
4662
4709
|
}
|
4663
4710
|
const fetch = getFetchImplementation(options?.fetch);
|
@@ -4811,5 +4858,5 @@ class XataError extends Error {
|
|
4811
4858
|
}
|
4812
4859
|
}
|
4813
4860
|
|
4814
|
-
export { BaseClient, FetcherError, FilesPlugin, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SQLPlugin, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, TransactionPlugin, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, applyMigration, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createCluster, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, fileUpload, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getCluster, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getSchema, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, iContains, iPattern, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isValidExpandedColumn, isValidSelectableColumns, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listClusters, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern,
|
4861
|
+
export { BaseClient, FetcherError, FilesPlugin, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, PageRecordArray, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SQLPlugin, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, TransactionPlugin, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, adaptTable, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, applyMigration, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createCluster, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, fileUpload, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationJobStatus, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getCluster, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseSettings, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationHistory, getMigrationJobStatus, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getSchema, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspaceSettings, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, iContains, iPattern, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isValidExpandedColumn, isValidSelectableColumns, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listClusters, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, transformImage, updateBranchMetadata, updateBranchSchema, updateCluster, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateDatabaseSettings, updateMigrationRequest, updateOAuthAccessToken, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, updateWorkspaceSettings, upsertRecordWithID, vectorSearchTable };
|
4815
4862
|
//# sourceMappingURL=index.mjs.map
|