@xata.io/client 0.0.0-alpha.vf90263d → 0.0.0-alpha.vf9117073fa2d41de1cd4690157c24c67ca3a6650
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 +15 -1
- package/dist/index.cjs +69 -1344
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +191 -842
- package/dist/index.mjs +68 -1344
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -244,26 +244,26 @@ function getPreviewBranch() {
|
|
244
244
|
}
|
245
245
|
}
|
246
246
|
|
247
|
-
var __accessCheck$
|
247
|
+
var __accessCheck$7 = (obj, member, msg) => {
|
248
248
|
if (!member.has(obj))
|
249
249
|
throw TypeError("Cannot " + msg);
|
250
250
|
};
|
251
|
-
var __privateGet$
|
252
|
-
__accessCheck$
|
251
|
+
var __privateGet$7 = (obj, member, getter) => {
|
252
|
+
__accessCheck$7(obj, member, "read from private field");
|
253
253
|
return getter ? getter.call(obj) : member.get(obj);
|
254
254
|
};
|
255
|
-
var __privateAdd$
|
255
|
+
var __privateAdd$7 = (obj, member, value) => {
|
256
256
|
if (member.has(obj))
|
257
257
|
throw TypeError("Cannot add the same private member more than once");
|
258
258
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
259
259
|
};
|
260
|
-
var __privateSet$
|
261
|
-
__accessCheck$
|
260
|
+
var __privateSet$7 = (obj, member, value, setter) => {
|
261
|
+
__accessCheck$7(obj, member, "write to private field");
|
262
262
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
263
263
|
return value;
|
264
264
|
};
|
265
265
|
var __privateMethod$4 = (obj, member, method) => {
|
266
|
-
__accessCheck$
|
266
|
+
__accessCheck$7(obj, member, "access private method");
|
267
267
|
return method;
|
268
268
|
};
|
269
269
|
var _fetch, _queue, _concurrency, _enqueue, enqueue_fn;
|
@@ -279,23 +279,23 @@ function getFetchImplementation(userFetch) {
|
|
279
279
|
}
|
280
280
|
class ApiRequestPool {
|
281
281
|
constructor(concurrency = 10) {
|
282
|
-
__privateAdd$
|
283
|
-
__privateAdd$
|
284
|
-
__privateAdd$
|
285
|
-
__privateAdd$
|
286
|
-
__privateSet$
|
287
|
-
__privateSet$
|
282
|
+
__privateAdd$7(this, _enqueue);
|
283
|
+
__privateAdd$7(this, _fetch, void 0);
|
284
|
+
__privateAdd$7(this, _queue, void 0);
|
285
|
+
__privateAdd$7(this, _concurrency, void 0);
|
286
|
+
__privateSet$7(this, _queue, []);
|
287
|
+
__privateSet$7(this, _concurrency, concurrency);
|
288
288
|
this.running = 0;
|
289
289
|
this.started = 0;
|
290
290
|
}
|
291
291
|
setFetch(fetch2) {
|
292
|
-
__privateSet$
|
292
|
+
__privateSet$7(this, _fetch, fetch2);
|
293
293
|
}
|
294
294
|
getFetch() {
|
295
|
-
if (!__privateGet$
|
295
|
+
if (!__privateGet$7(this, _fetch)) {
|
296
296
|
throw new Error("Fetch not set");
|
297
297
|
}
|
298
|
-
return __privateGet$
|
298
|
+
return __privateGet$7(this, _fetch);
|
299
299
|
}
|
300
300
|
request(url, options) {
|
301
301
|
const start = /* @__PURE__ */ new Date();
|
@@ -327,19 +327,19 @@ _queue = new WeakMap();
|
|
327
327
|
_concurrency = new WeakMap();
|
328
328
|
_enqueue = new WeakSet();
|
329
329
|
enqueue_fn = function(task) {
|
330
|
-
const promise = new Promise((resolve) => __privateGet$
|
330
|
+
const promise = new Promise((resolve) => __privateGet$7(this, _queue).push(resolve)).finally(() => {
|
331
331
|
this.started--;
|
332
332
|
this.running++;
|
333
333
|
}).then(() => task()).finally(() => {
|
334
334
|
this.running--;
|
335
|
-
const next = __privateGet$
|
335
|
+
const next = __privateGet$7(this, _queue).shift();
|
336
336
|
if (next !== void 0) {
|
337
337
|
this.started++;
|
338
338
|
next();
|
339
339
|
}
|
340
340
|
});
|
341
|
-
if (this.running + this.started < __privateGet$
|
342
|
-
const next = __privateGet$
|
341
|
+
if (this.running + this.started < __privateGet$7(this, _concurrency)) {
|
342
|
+
const next = __privateGet$7(this, _queue).shift();
|
343
343
|
if (next !== void 0) {
|
344
344
|
this.started++;
|
345
345
|
next();
|
@@ -528,7 +528,7 @@ function defaultOnOpen(response) {
|
|
528
528
|
}
|
529
529
|
}
|
530
530
|
|
531
|
-
const VERSION = "0.
|
531
|
+
const VERSION = "0.28.1";
|
532
532
|
|
533
533
|
class ErrorWithCause extends Error {
|
534
534
|
constructor(message, options) {
|
@@ -768,9 +768,16 @@ function parseUrl(url) {
|
|
768
768
|
|
769
769
|
const dataPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "dataPlane" });
|
770
770
|
|
771
|
-
const applyMigration = (variables, signal) => dataPlaneFetch({
|
772
|
-
|
773
|
-
|
771
|
+
const applyMigration = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/pgroll/apply", method: "post", ...variables, signal });
|
772
|
+
const pgRollStatus = (variables, signal) => dataPlaneFetch({
|
773
|
+
url: "/db/{dbBranchName}/pgroll/status",
|
774
|
+
method: "get",
|
775
|
+
...variables,
|
776
|
+
signal
|
777
|
+
});
|
778
|
+
const pgRollJobStatus = (variables, signal) => dataPlaneFetch({
|
779
|
+
url: "/db/{dbBranchName}/pgroll/jobs/{jobId}",
|
780
|
+
method: "get",
|
774
781
|
...variables,
|
775
782
|
signal
|
776
783
|
});
|
@@ -989,6 +996,8 @@ const sqlQuery = (variables, signal) => dataPlaneFetch({
|
|
989
996
|
const operationsByTag$2 = {
|
990
997
|
branch: {
|
991
998
|
applyMigration,
|
999
|
+
pgRollStatus,
|
1000
|
+
pgRollJobStatus,
|
992
1001
|
getBranchList,
|
993
1002
|
getBranchDetails,
|
994
1003
|
createBranch,
|
@@ -1309,29 +1318,8 @@ function parseWorkspacesUrlParts(url) {
|
|
1309
1318
|
return { workspace: match[1], region: match[2] };
|
1310
1319
|
}
|
1311
1320
|
|
1312
|
-
|
1313
|
-
if (!member.has(obj))
|
1314
|
-
throw TypeError("Cannot " + msg);
|
1315
|
-
};
|
1316
|
-
var __privateGet$7 = (obj, member, getter) => {
|
1317
|
-
__accessCheck$7(obj, member, "read from private field");
|
1318
|
-
return getter ? getter.call(obj) : member.get(obj);
|
1319
|
-
};
|
1320
|
-
var __privateAdd$7 = (obj, member, value) => {
|
1321
|
-
if (member.has(obj))
|
1322
|
-
throw TypeError("Cannot add the same private member more than once");
|
1323
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
1324
|
-
};
|
1325
|
-
var __privateSet$7 = (obj, member, value, setter) => {
|
1326
|
-
__accessCheck$7(obj, member, "write to private field");
|
1327
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
1328
|
-
return value;
|
1329
|
-
};
|
1330
|
-
var _extraProps, _namespaces;
|
1331
|
-
class XataApiClient {
|
1321
|
+
const buildApiClient = () => class {
|
1332
1322
|
constructor(options = {}) {
|
1333
|
-
__privateAdd$7(this, _extraProps, void 0);
|
1334
|
-
__privateAdd$7(this, _namespaces, {});
|
1335
1323
|
const provider = options.host ?? "production";
|
1336
1324
|
const apiKey = options.apiKey ?? getAPIKey();
|
1337
1325
|
const trace = options.trace ?? defaultTrace;
|
@@ -1339,7 +1327,7 @@ class XataApiClient {
|
|
1339
1327
|
if (!apiKey) {
|
1340
1328
|
throw new Error("Could not resolve a valid apiKey");
|
1341
1329
|
}
|
1342
|
-
|
1330
|
+
const extraProps = {
|
1343
1331
|
apiUrl: getHostUrl(provider, "main"),
|
1344
1332
|
workspacesApiUrl: getHostUrl(provider, "workspaces"),
|
1345
1333
|
fetch: getFetchImplementation(options.fetch),
|
@@ -1348,1280 +1336,31 @@ class XataApiClient {
|
|
1348
1336
|
clientName: options.clientName,
|
1349
1337
|
xataAgentExtra: options.xataAgentExtra,
|
1350
1338
|
clientID
|
1339
|
+
};
|
1340
|
+
return new Proxy(this, {
|
1341
|
+
get: (_target, namespace) => {
|
1342
|
+
if (operationsByTag[namespace] === void 0) {
|
1343
|
+
return void 0;
|
1344
|
+
}
|
1345
|
+
return new Proxy(
|
1346
|
+
{},
|
1347
|
+
{
|
1348
|
+
get: (_target2, operation) => {
|
1349
|
+
if (operationsByTag[namespace][operation] === void 0) {
|
1350
|
+
return void 0;
|
1351
|
+
}
|
1352
|
+
const method = operationsByTag[namespace][operation];
|
1353
|
+
return async (params) => {
|
1354
|
+
return await method({ ...params, ...extraProps });
|
1355
|
+
};
|
1356
|
+
}
|
1357
|
+
}
|
1358
|
+
);
|
1359
|
+
}
|
1351
1360
|
});
|
1352
1361
|
}
|
1353
|
-
|
1354
|
-
|
1355
|
-
__privateGet$7(this, _namespaces).user = new UserApi(__privateGet$7(this, _extraProps));
|
1356
|
-
return __privateGet$7(this, _namespaces).user;
|
1357
|
-
}
|
1358
|
-
get authentication() {
|
1359
|
-
if (!__privateGet$7(this, _namespaces).authentication)
|
1360
|
-
__privateGet$7(this, _namespaces).authentication = new AuthenticationApi(__privateGet$7(this, _extraProps));
|
1361
|
-
return __privateGet$7(this, _namespaces).authentication;
|
1362
|
-
}
|
1363
|
-
get workspaces() {
|
1364
|
-
if (!__privateGet$7(this, _namespaces).workspaces)
|
1365
|
-
__privateGet$7(this, _namespaces).workspaces = new WorkspaceApi(__privateGet$7(this, _extraProps));
|
1366
|
-
return __privateGet$7(this, _namespaces).workspaces;
|
1367
|
-
}
|
1368
|
-
get invites() {
|
1369
|
-
if (!__privateGet$7(this, _namespaces).invites)
|
1370
|
-
__privateGet$7(this, _namespaces).invites = new InvitesApi(__privateGet$7(this, _extraProps));
|
1371
|
-
return __privateGet$7(this, _namespaces).invites;
|
1372
|
-
}
|
1373
|
-
get database() {
|
1374
|
-
if (!__privateGet$7(this, _namespaces).database)
|
1375
|
-
__privateGet$7(this, _namespaces).database = new DatabaseApi(__privateGet$7(this, _extraProps));
|
1376
|
-
return __privateGet$7(this, _namespaces).database;
|
1377
|
-
}
|
1378
|
-
get branches() {
|
1379
|
-
if (!__privateGet$7(this, _namespaces).branches)
|
1380
|
-
__privateGet$7(this, _namespaces).branches = new BranchApi(__privateGet$7(this, _extraProps));
|
1381
|
-
return __privateGet$7(this, _namespaces).branches;
|
1382
|
-
}
|
1383
|
-
get migrations() {
|
1384
|
-
if (!__privateGet$7(this, _namespaces).migrations)
|
1385
|
-
__privateGet$7(this, _namespaces).migrations = new MigrationsApi(__privateGet$7(this, _extraProps));
|
1386
|
-
return __privateGet$7(this, _namespaces).migrations;
|
1387
|
-
}
|
1388
|
-
get migrationRequests() {
|
1389
|
-
if (!__privateGet$7(this, _namespaces).migrationRequests)
|
1390
|
-
__privateGet$7(this, _namespaces).migrationRequests = new MigrationRequestsApi(__privateGet$7(this, _extraProps));
|
1391
|
-
return __privateGet$7(this, _namespaces).migrationRequests;
|
1392
|
-
}
|
1393
|
-
get tables() {
|
1394
|
-
if (!__privateGet$7(this, _namespaces).tables)
|
1395
|
-
__privateGet$7(this, _namespaces).tables = new TableApi(__privateGet$7(this, _extraProps));
|
1396
|
-
return __privateGet$7(this, _namespaces).tables;
|
1397
|
-
}
|
1398
|
-
get records() {
|
1399
|
-
if (!__privateGet$7(this, _namespaces).records)
|
1400
|
-
__privateGet$7(this, _namespaces).records = new RecordsApi(__privateGet$7(this, _extraProps));
|
1401
|
-
return __privateGet$7(this, _namespaces).records;
|
1402
|
-
}
|
1403
|
-
get files() {
|
1404
|
-
if (!__privateGet$7(this, _namespaces).files)
|
1405
|
-
__privateGet$7(this, _namespaces).files = new FilesApi(__privateGet$7(this, _extraProps));
|
1406
|
-
return __privateGet$7(this, _namespaces).files;
|
1407
|
-
}
|
1408
|
-
get searchAndFilter() {
|
1409
|
-
if (!__privateGet$7(this, _namespaces).searchAndFilter)
|
1410
|
-
__privateGet$7(this, _namespaces).searchAndFilter = new SearchAndFilterApi(__privateGet$7(this, _extraProps));
|
1411
|
-
return __privateGet$7(this, _namespaces).searchAndFilter;
|
1412
|
-
}
|
1413
|
-
}
|
1414
|
-
_extraProps = new WeakMap();
|
1415
|
-
_namespaces = new WeakMap();
|
1416
|
-
class UserApi {
|
1417
|
-
constructor(extraProps) {
|
1418
|
-
this.extraProps = extraProps;
|
1419
|
-
}
|
1420
|
-
getUser() {
|
1421
|
-
return operationsByTag.users.getUser({ ...this.extraProps });
|
1422
|
-
}
|
1423
|
-
updateUser({ user }) {
|
1424
|
-
return operationsByTag.users.updateUser({ body: user, ...this.extraProps });
|
1425
|
-
}
|
1426
|
-
deleteUser() {
|
1427
|
-
return operationsByTag.users.deleteUser({ ...this.extraProps });
|
1428
|
-
}
|
1429
|
-
}
|
1430
|
-
class AuthenticationApi {
|
1431
|
-
constructor(extraProps) {
|
1432
|
-
this.extraProps = extraProps;
|
1433
|
-
}
|
1434
|
-
getUserAPIKeys() {
|
1435
|
-
return operationsByTag.authentication.getUserAPIKeys({ ...this.extraProps });
|
1436
|
-
}
|
1437
|
-
createUserAPIKey({ name }) {
|
1438
|
-
return operationsByTag.authentication.createUserAPIKey({
|
1439
|
-
pathParams: { keyName: name },
|
1440
|
-
...this.extraProps
|
1441
|
-
});
|
1442
|
-
}
|
1443
|
-
deleteUserAPIKey({ name }) {
|
1444
|
-
return operationsByTag.authentication.deleteUserAPIKey({
|
1445
|
-
pathParams: { keyName: name },
|
1446
|
-
...this.extraProps
|
1447
|
-
});
|
1448
|
-
}
|
1449
|
-
}
|
1450
|
-
class WorkspaceApi {
|
1451
|
-
constructor(extraProps) {
|
1452
|
-
this.extraProps = extraProps;
|
1453
|
-
}
|
1454
|
-
getWorkspacesList() {
|
1455
|
-
return operationsByTag.workspaces.getWorkspacesList({ ...this.extraProps });
|
1456
|
-
}
|
1457
|
-
createWorkspace({ data }) {
|
1458
|
-
return operationsByTag.workspaces.createWorkspace({
|
1459
|
-
body: data,
|
1460
|
-
...this.extraProps
|
1461
|
-
});
|
1462
|
-
}
|
1463
|
-
getWorkspace({ workspace }) {
|
1464
|
-
return operationsByTag.workspaces.getWorkspace({
|
1465
|
-
pathParams: { workspaceId: workspace },
|
1466
|
-
...this.extraProps
|
1467
|
-
});
|
1468
|
-
}
|
1469
|
-
updateWorkspace({
|
1470
|
-
workspace,
|
1471
|
-
update
|
1472
|
-
}) {
|
1473
|
-
return operationsByTag.workspaces.updateWorkspace({
|
1474
|
-
pathParams: { workspaceId: workspace },
|
1475
|
-
body: update,
|
1476
|
-
...this.extraProps
|
1477
|
-
});
|
1478
|
-
}
|
1479
|
-
deleteWorkspace({ workspace }) {
|
1480
|
-
return operationsByTag.workspaces.deleteWorkspace({
|
1481
|
-
pathParams: { workspaceId: workspace },
|
1482
|
-
...this.extraProps
|
1483
|
-
});
|
1484
|
-
}
|
1485
|
-
getWorkspaceMembersList({ workspace }) {
|
1486
|
-
return operationsByTag.workspaces.getWorkspaceMembersList({
|
1487
|
-
pathParams: { workspaceId: workspace },
|
1488
|
-
...this.extraProps
|
1489
|
-
});
|
1490
|
-
}
|
1491
|
-
updateWorkspaceMemberRole({
|
1492
|
-
workspace,
|
1493
|
-
user,
|
1494
|
-
role
|
1495
|
-
}) {
|
1496
|
-
return operationsByTag.workspaces.updateWorkspaceMemberRole({
|
1497
|
-
pathParams: { workspaceId: workspace, userId: user },
|
1498
|
-
body: { role },
|
1499
|
-
...this.extraProps
|
1500
|
-
});
|
1501
|
-
}
|
1502
|
-
removeWorkspaceMember({
|
1503
|
-
workspace,
|
1504
|
-
user
|
1505
|
-
}) {
|
1506
|
-
return operationsByTag.workspaces.removeWorkspaceMember({
|
1507
|
-
pathParams: { workspaceId: workspace, userId: user },
|
1508
|
-
...this.extraProps
|
1509
|
-
});
|
1510
|
-
}
|
1511
|
-
}
|
1512
|
-
class InvitesApi {
|
1513
|
-
constructor(extraProps) {
|
1514
|
-
this.extraProps = extraProps;
|
1515
|
-
}
|
1516
|
-
inviteWorkspaceMember({
|
1517
|
-
workspace,
|
1518
|
-
email,
|
1519
|
-
role
|
1520
|
-
}) {
|
1521
|
-
return operationsByTag.invites.inviteWorkspaceMember({
|
1522
|
-
pathParams: { workspaceId: workspace },
|
1523
|
-
body: { email, role },
|
1524
|
-
...this.extraProps
|
1525
|
-
});
|
1526
|
-
}
|
1527
|
-
updateWorkspaceMemberInvite({
|
1528
|
-
workspace,
|
1529
|
-
invite,
|
1530
|
-
role
|
1531
|
-
}) {
|
1532
|
-
return operationsByTag.invites.updateWorkspaceMemberInvite({
|
1533
|
-
pathParams: { workspaceId: workspace, inviteId: invite },
|
1534
|
-
body: { role },
|
1535
|
-
...this.extraProps
|
1536
|
-
});
|
1537
|
-
}
|
1538
|
-
cancelWorkspaceMemberInvite({
|
1539
|
-
workspace,
|
1540
|
-
invite
|
1541
|
-
}) {
|
1542
|
-
return operationsByTag.invites.cancelWorkspaceMemberInvite({
|
1543
|
-
pathParams: { workspaceId: workspace, inviteId: invite },
|
1544
|
-
...this.extraProps
|
1545
|
-
});
|
1546
|
-
}
|
1547
|
-
acceptWorkspaceMemberInvite({
|
1548
|
-
workspace,
|
1549
|
-
key
|
1550
|
-
}) {
|
1551
|
-
return operationsByTag.invites.acceptWorkspaceMemberInvite({
|
1552
|
-
pathParams: { workspaceId: workspace, inviteKey: key },
|
1553
|
-
...this.extraProps
|
1554
|
-
});
|
1555
|
-
}
|
1556
|
-
resendWorkspaceMemberInvite({
|
1557
|
-
workspace,
|
1558
|
-
invite
|
1559
|
-
}) {
|
1560
|
-
return operationsByTag.invites.resendWorkspaceMemberInvite({
|
1561
|
-
pathParams: { workspaceId: workspace, inviteId: invite },
|
1562
|
-
...this.extraProps
|
1563
|
-
});
|
1564
|
-
}
|
1565
|
-
}
|
1566
|
-
class BranchApi {
|
1567
|
-
constructor(extraProps) {
|
1568
|
-
this.extraProps = extraProps;
|
1569
|
-
}
|
1570
|
-
getBranchList({
|
1571
|
-
workspace,
|
1572
|
-
region,
|
1573
|
-
database
|
1574
|
-
}) {
|
1575
|
-
return operationsByTag.branch.getBranchList({
|
1576
|
-
pathParams: { workspace, region, dbName: database },
|
1577
|
-
...this.extraProps
|
1578
|
-
});
|
1579
|
-
}
|
1580
|
-
getBranchDetails({
|
1581
|
-
workspace,
|
1582
|
-
region,
|
1583
|
-
database,
|
1584
|
-
branch
|
1585
|
-
}) {
|
1586
|
-
return operationsByTag.branch.getBranchDetails({
|
1587
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1588
|
-
...this.extraProps
|
1589
|
-
});
|
1590
|
-
}
|
1591
|
-
createBranch({
|
1592
|
-
workspace,
|
1593
|
-
region,
|
1594
|
-
database,
|
1595
|
-
branch,
|
1596
|
-
from,
|
1597
|
-
metadata
|
1598
|
-
}) {
|
1599
|
-
return operationsByTag.branch.createBranch({
|
1600
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1601
|
-
body: { from, metadata },
|
1602
|
-
...this.extraProps
|
1603
|
-
});
|
1604
|
-
}
|
1605
|
-
deleteBranch({
|
1606
|
-
workspace,
|
1607
|
-
region,
|
1608
|
-
database,
|
1609
|
-
branch
|
1610
|
-
}) {
|
1611
|
-
return operationsByTag.branch.deleteBranch({
|
1612
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1613
|
-
...this.extraProps
|
1614
|
-
});
|
1615
|
-
}
|
1616
|
-
copyBranch({
|
1617
|
-
workspace,
|
1618
|
-
region,
|
1619
|
-
database,
|
1620
|
-
branch,
|
1621
|
-
destinationBranch,
|
1622
|
-
limit
|
1623
|
-
}) {
|
1624
|
-
return operationsByTag.branch.copyBranch({
|
1625
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1626
|
-
body: { destinationBranch, limit },
|
1627
|
-
...this.extraProps
|
1628
|
-
});
|
1629
|
-
}
|
1630
|
-
updateBranchMetadata({
|
1631
|
-
workspace,
|
1632
|
-
region,
|
1633
|
-
database,
|
1634
|
-
branch,
|
1635
|
-
metadata
|
1636
|
-
}) {
|
1637
|
-
return operationsByTag.branch.updateBranchMetadata({
|
1638
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1639
|
-
body: metadata,
|
1640
|
-
...this.extraProps
|
1641
|
-
});
|
1642
|
-
}
|
1643
|
-
getBranchMetadata({
|
1644
|
-
workspace,
|
1645
|
-
region,
|
1646
|
-
database,
|
1647
|
-
branch
|
1648
|
-
}) {
|
1649
|
-
return operationsByTag.branch.getBranchMetadata({
|
1650
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1651
|
-
...this.extraProps
|
1652
|
-
});
|
1653
|
-
}
|
1654
|
-
getBranchStats({
|
1655
|
-
workspace,
|
1656
|
-
region,
|
1657
|
-
database,
|
1658
|
-
branch
|
1659
|
-
}) {
|
1660
|
-
return operationsByTag.branch.getBranchStats({
|
1661
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1662
|
-
...this.extraProps
|
1663
|
-
});
|
1664
|
-
}
|
1665
|
-
getGitBranchesMapping({
|
1666
|
-
workspace,
|
1667
|
-
region,
|
1668
|
-
database
|
1669
|
-
}) {
|
1670
|
-
return operationsByTag.branch.getGitBranchesMapping({
|
1671
|
-
pathParams: { workspace, region, dbName: database },
|
1672
|
-
...this.extraProps
|
1673
|
-
});
|
1674
|
-
}
|
1675
|
-
addGitBranchesEntry({
|
1676
|
-
workspace,
|
1677
|
-
region,
|
1678
|
-
database,
|
1679
|
-
gitBranch,
|
1680
|
-
xataBranch
|
1681
|
-
}) {
|
1682
|
-
return operationsByTag.branch.addGitBranchesEntry({
|
1683
|
-
pathParams: { workspace, region, dbName: database },
|
1684
|
-
body: { gitBranch, xataBranch },
|
1685
|
-
...this.extraProps
|
1686
|
-
});
|
1687
|
-
}
|
1688
|
-
removeGitBranchesEntry({
|
1689
|
-
workspace,
|
1690
|
-
region,
|
1691
|
-
database,
|
1692
|
-
gitBranch
|
1693
|
-
}) {
|
1694
|
-
return operationsByTag.branch.removeGitBranchesEntry({
|
1695
|
-
pathParams: { workspace, region, dbName: database },
|
1696
|
-
queryParams: { gitBranch },
|
1697
|
-
...this.extraProps
|
1698
|
-
});
|
1699
|
-
}
|
1700
|
-
resolveBranch({
|
1701
|
-
workspace,
|
1702
|
-
region,
|
1703
|
-
database,
|
1704
|
-
gitBranch,
|
1705
|
-
fallbackBranch
|
1706
|
-
}) {
|
1707
|
-
return operationsByTag.branch.resolveBranch({
|
1708
|
-
pathParams: { workspace, region, dbName: database },
|
1709
|
-
queryParams: { gitBranch, fallbackBranch },
|
1710
|
-
...this.extraProps
|
1711
|
-
});
|
1712
|
-
}
|
1713
|
-
}
|
1714
|
-
class TableApi {
|
1715
|
-
constructor(extraProps) {
|
1716
|
-
this.extraProps = extraProps;
|
1717
|
-
}
|
1718
|
-
createTable({
|
1719
|
-
workspace,
|
1720
|
-
region,
|
1721
|
-
database,
|
1722
|
-
branch,
|
1723
|
-
table
|
1724
|
-
}) {
|
1725
|
-
return operationsByTag.table.createTable({
|
1726
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1727
|
-
...this.extraProps
|
1728
|
-
});
|
1729
|
-
}
|
1730
|
-
deleteTable({
|
1731
|
-
workspace,
|
1732
|
-
region,
|
1733
|
-
database,
|
1734
|
-
branch,
|
1735
|
-
table
|
1736
|
-
}) {
|
1737
|
-
return operationsByTag.table.deleteTable({
|
1738
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1739
|
-
...this.extraProps
|
1740
|
-
});
|
1741
|
-
}
|
1742
|
-
updateTable({
|
1743
|
-
workspace,
|
1744
|
-
region,
|
1745
|
-
database,
|
1746
|
-
branch,
|
1747
|
-
table,
|
1748
|
-
update
|
1749
|
-
}) {
|
1750
|
-
return operationsByTag.table.updateTable({
|
1751
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1752
|
-
body: update,
|
1753
|
-
...this.extraProps
|
1754
|
-
});
|
1755
|
-
}
|
1756
|
-
getTableSchema({
|
1757
|
-
workspace,
|
1758
|
-
region,
|
1759
|
-
database,
|
1760
|
-
branch,
|
1761
|
-
table
|
1762
|
-
}) {
|
1763
|
-
return operationsByTag.table.getTableSchema({
|
1764
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1765
|
-
...this.extraProps
|
1766
|
-
});
|
1767
|
-
}
|
1768
|
-
setTableSchema({
|
1769
|
-
workspace,
|
1770
|
-
region,
|
1771
|
-
database,
|
1772
|
-
branch,
|
1773
|
-
table,
|
1774
|
-
schema
|
1775
|
-
}) {
|
1776
|
-
return operationsByTag.table.setTableSchema({
|
1777
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1778
|
-
body: schema,
|
1779
|
-
...this.extraProps
|
1780
|
-
});
|
1781
|
-
}
|
1782
|
-
getTableColumns({
|
1783
|
-
workspace,
|
1784
|
-
region,
|
1785
|
-
database,
|
1786
|
-
branch,
|
1787
|
-
table
|
1788
|
-
}) {
|
1789
|
-
return operationsByTag.table.getTableColumns({
|
1790
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1791
|
-
...this.extraProps
|
1792
|
-
});
|
1793
|
-
}
|
1794
|
-
addTableColumn({
|
1795
|
-
workspace,
|
1796
|
-
region,
|
1797
|
-
database,
|
1798
|
-
branch,
|
1799
|
-
table,
|
1800
|
-
column
|
1801
|
-
}) {
|
1802
|
-
return operationsByTag.table.addTableColumn({
|
1803
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1804
|
-
body: column,
|
1805
|
-
...this.extraProps
|
1806
|
-
});
|
1807
|
-
}
|
1808
|
-
getColumn({
|
1809
|
-
workspace,
|
1810
|
-
region,
|
1811
|
-
database,
|
1812
|
-
branch,
|
1813
|
-
table,
|
1814
|
-
column
|
1815
|
-
}) {
|
1816
|
-
return operationsByTag.table.getColumn({
|
1817
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
|
1818
|
-
...this.extraProps
|
1819
|
-
});
|
1820
|
-
}
|
1821
|
-
updateColumn({
|
1822
|
-
workspace,
|
1823
|
-
region,
|
1824
|
-
database,
|
1825
|
-
branch,
|
1826
|
-
table,
|
1827
|
-
column,
|
1828
|
-
update
|
1829
|
-
}) {
|
1830
|
-
return operationsByTag.table.updateColumn({
|
1831
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
|
1832
|
-
body: update,
|
1833
|
-
...this.extraProps
|
1834
|
-
});
|
1835
|
-
}
|
1836
|
-
deleteColumn({
|
1837
|
-
workspace,
|
1838
|
-
region,
|
1839
|
-
database,
|
1840
|
-
branch,
|
1841
|
-
table,
|
1842
|
-
column
|
1843
|
-
}) {
|
1844
|
-
return operationsByTag.table.deleteColumn({
|
1845
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
|
1846
|
-
...this.extraProps
|
1847
|
-
});
|
1848
|
-
}
|
1849
|
-
}
|
1850
|
-
class RecordsApi {
|
1851
|
-
constructor(extraProps) {
|
1852
|
-
this.extraProps = extraProps;
|
1853
|
-
}
|
1854
|
-
insertRecord({
|
1855
|
-
workspace,
|
1856
|
-
region,
|
1857
|
-
database,
|
1858
|
-
branch,
|
1859
|
-
table,
|
1860
|
-
record,
|
1861
|
-
columns
|
1862
|
-
}) {
|
1863
|
-
return operationsByTag.records.insertRecord({
|
1864
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1865
|
-
queryParams: { columns },
|
1866
|
-
body: record,
|
1867
|
-
...this.extraProps
|
1868
|
-
});
|
1869
|
-
}
|
1870
|
-
getRecord({
|
1871
|
-
workspace,
|
1872
|
-
region,
|
1873
|
-
database,
|
1874
|
-
branch,
|
1875
|
-
table,
|
1876
|
-
id,
|
1877
|
-
columns
|
1878
|
-
}) {
|
1879
|
-
return operationsByTag.records.getRecord({
|
1880
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
1881
|
-
queryParams: { columns },
|
1882
|
-
...this.extraProps
|
1883
|
-
});
|
1884
|
-
}
|
1885
|
-
insertRecordWithID({
|
1886
|
-
workspace,
|
1887
|
-
region,
|
1888
|
-
database,
|
1889
|
-
branch,
|
1890
|
-
table,
|
1891
|
-
id,
|
1892
|
-
record,
|
1893
|
-
columns,
|
1894
|
-
createOnly,
|
1895
|
-
ifVersion
|
1896
|
-
}) {
|
1897
|
-
return operationsByTag.records.insertRecordWithID({
|
1898
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
1899
|
-
queryParams: { columns, createOnly, ifVersion },
|
1900
|
-
body: record,
|
1901
|
-
...this.extraProps
|
1902
|
-
});
|
1903
|
-
}
|
1904
|
-
updateRecordWithID({
|
1905
|
-
workspace,
|
1906
|
-
region,
|
1907
|
-
database,
|
1908
|
-
branch,
|
1909
|
-
table,
|
1910
|
-
id,
|
1911
|
-
record,
|
1912
|
-
columns,
|
1913
|
-
ifVersion
|
1914
|
-
}) {
|
1915
|
-
return operationsByTag.records.updateRecordWithID({
|
1916
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
1917
|
-
queryParams: { columns, ifVersion },
|
1918
|
-
body: record,
|
1919
|
-
...this.extraProps
|
1920
|
-
});
|
1921
|
-
}
|
1922
|
-
upsertRecordWithID({
|
1923
|
-
workspace,
|
1924
|
-
region,
|
1925
|
-
database,
|
1926
|
-
branch,
|
1927
|
-
table,
|
1928
|
-
id,
|
1929
|
-
record,
|
1930
|
-
columns,
|
1931
|
-
ifVersion
|
1932
|
-
}) {
|
1933
|
-
return operationsByTag.records.upsertRecordWithID({
|
1934
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
1935
|
-
queryParams: { columns, ifVersion },
|
1936
|
-
body: record,
|
1937
|
-
...this.extraProps
|
1938
|
-
});
|
1939
|
-
}
|
1940
|
-
deleteRecord({
|
1941
|
-
workspace,
|
1942
|
-
region,
|
1943
|
-
database,
|
1944
|
-
branch,
|
1945
|
-
table,
|
1946
|
-
id,
|
1947
|
-
columns
|
1948
|
-
}) {
|
1949
|
-
return operationsByTag.records.deleteRecord({
|
1950
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
1951
|
-
queryParams: { columns },
|
1952
|
-
...this.extraProps
|
1953
|
-
});
|
1954
|
-
}
|
1955
|
-
bulkInsertTableRecords({
|
1956
|
-
workspace,
|
1957
|
-
region,
|
1958
|
-
database,
|
1959
|
-
branch,
|
1960
|
-
table,
|
1961
|
-
records,
|
1962
|
-
columns
|
1963
|
-
}) {
|
1964
|
-
return operationsByTag.records.bulkInsertTableRecords({
|
1965
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
1966
|
-
queryParams: { columns },
|
1967
|
-
body: { records },
|
1968
|
-
...this.extraProps
|
1969
|
-
});
|
1970
|
-
}
|
1971
|
-
branchTransaction({
|
1972
|
-
workspace,
|
1973
|
-
region,
|
1974
|
-
database,
|
1975
|
-
branch,
|
1976
|
-
operations
|
1977
|
-
}) {
|
1978
|
-
return operationsByTag.records.branchTransaction({
|
1979
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1980
|
-
body: { operations },
|
1981
|
-
...this.extraProps
|
1982
|
-
});
|
1983
|
-
}
|
1984
|
-
}
|
1985
|
-
class FilesApi {
|
1986
|
-
constructor(extraProps) {
|
1987
|
-
this.extraProps = extraProps;
|
1988
|
-
}
|
1989
|
-
getFileItem({
|
1990
|
-
workspace,
|
1991
|
-
region,
|
1992
|
-
database,
|
1993
|
-
branch,
|
1994
|
-
table,
|
1995
|
-
record,
|
1996
|
-
column,
|
1997
|
-
fileId
|
1998
|
-
}) {
|
1999
|
-
return operationsByTag.files.getFileItem({
|
2000
|
-
pathParams: {
|
2001
|
-
workspace,
|
2002
|
-
region,
|
2003
|
-
dbBranchName: `${database}:${branch}`,
|
2004
|
-
tableName: table,
|
2005
|
-
recordId: record,
|
2006
|
-
columnName: column,
|
2007
|
-
fileId
|
2008
|
-
},
|
2009
|
-
...this.extraProps
|
2010
|
-
});
|
2011
|
-
}
|
2012
|
-
putFileItem({
|
2013
|
-
workspace,
|
2014
|
-
region,
|
2015
|
-
database,
|
2016
|
-
branch,
|
2017
|
-
table,
|
2018
|
-
record,
|
2019
|
-
column,
|
2020
|
-
fileId,
|
2021
|
-
file
|
2022
|
-
}) {
|
2023
|
-
return operationsByTag.files.putFileItem({
|
2024
|
-
pathParams: {
|
2025
|
-
workspace,
|
2026
|
-
region,
|
2027
|
-
dbBranchName: `${database}:${branch}`,
|
2028
|
-
tableName: table,
|
2029
|
-
recordId: record,
|
2030
|
-
columnName: column,
|
2031
|
-
fileId
|
2032
|
-
},
|
2033
|
-
// @ts-ignore
|
2034
|
-
body: file,
|
2035
|
-
...this.extraProps
|
2036
|
-
});
|
2037
|
-
}
|
2038
|
-
deleteFileItem({
|
2039
|
-
workspace,
|
2040
|
-
region,
|
2041
|
-
database,
|
2042
|
-
branch,
|
2043
|
-
table,
|
2044
|
-
record,
|
2045
|
-
column,
|
2046
|
-
fileId
|
2047
|
-
}) {
|
2048
|
-
return operationsByTag.files.deleteFileItem({
|
2049
|
-
pathParams: {
|
2050
|
-
workspace,
|
2051
|
-
region,
|
2052
|
-
dbBranchName: `${database}:${branch}`,
|
2053
|
-
tableName: table,
|
2054
|
-
recordId: record,
|
2055
|
-
columnName: column,
|
2056
|
-
fileId
|
2057
|
-
},
|
2058
|
-
...this.extraProps
|
2059
|
-
});
|
2060
|
-
}
|
2061
|
-
getFile({
|
2062
|
-
workspace,
|
2063
|
-
region,
|
2064
|
-
database,
|
2065
|
-
branch,
|
2066
|
-
table,
|
2067
|
-
record,
|
2068
|
-
column
|
2069
|
-
}) {
|
2070
|
-
return operationsByTag.files.getFile({
|
2071
|
-
pathParams: {
|
2072
|
-
workspace,
|
2073
|
-
region,
|
2074
|
-
dbBranchName: `${database}:${branch}`,
|
2075
|
-
tableName: table,
|
2076
|
-
recordId: record,
|
2077
|
-
columnName: column
|
2078
|
-
},
|
2079
|
-
...this.extraProps
|
2080
|
-
});
|
2081
|
-
}
|
2082
|
-
putFile({
|
2083
|
-
workspace,
|
2084
|
-
region,
|
2085
|
-
database,
|
2086
|
-
branch,
|
2087
|
-
table,
|
2088
|
-
record,
|
2089
|
-
column,
|
2090
|
-
file
|
2091
|
-
}) {
|
2092
|
-
return operationsByTag.files.putFile({
|
2093
|
-
pathParams: {
|
2094
|
-
workspace,
|
2095
|
-
region,
|
2096
|
-
dbBranchName: `${database}:${branch}`,
|
2097
|
-
tableName: table,
|
2098
|
-
recordId: record,
|
2099
|
-
columnName: column
|
2100
|
-
},
|
2101
|
-
body: file,
|
2102
|
-
...this.extraProps
|
2103
|
-
});
|
2104
|
-
}
|
2105
|
-
deleteFile({
|
2106
|
-
workspace,
|
2107
|
-
region,
|
2108
|
-
database,
|
2109
|
-
branch,
|
2110
|
-
table,
|
2111
|
-
record,
|
2112
|
-
column
|
2113
|
-
}) {
|
2114
|
-
return operationsByTag.files.deleteFile({
|
2115
|
-
pathParams: {
|
2116
|
-
workspace,
|
2117
|
-
region,
|
2118
|
-
dbBranchName: `${database}:${branch}`,
|
2119
|
-
tableName: table,
|
2120
|
-
recordId: record,
|
2121
|
-
columnName: column
|
2122
|
-
},
|
2123
|
-
...this.extraProps
|
2124
|
-
});
|
2125
|
-
}
|
2126
|
-
fileAccess({
|
2127
|
-
workspace,
|
2128
|
-
region,
|
2129
|
-
fileId,
|
2130
|
-
verify
|
2131
|
-
}) {
|
2132
|
-
return operationsByTag.files.fileAccess({
|
2133
|
-
pathParams: {
|
2134
|
-
workspace,
|
2135
|
-
region,
|
2136
|
-
fileId
|
2137
|
-
},
|
2138
|
-
queryParams: { verify },
|
2139
|
-
...this.extraProps
|
2140
|
-
});
|
2141
|
-
}
|
2142
|
-
}
|
2143
|
-
class SearchAndFilterApi {
|
2144
|
-
constructor(extraProps) {
|
2145
|
-
this.extraProps = extraProps;
|
2146
|
-
}
|
2147
|
-
queryTable({
|
2148
|
-
workspace,
|
2149
|
-
region,
|
2150
|
-
database,
|
2151
|
-
branch,
|
2152
|
-
table,
|
2153
|
-
filter,
|
2154
|
-
sort,
|
2155
|
-
page,
|
2156
|
-
columns,
|
2157
|
-
consistency
|
2158
|
-
}) {
|
2159
|
-
return operationsByTag.searchAndFilter.queryTable({
|
2160
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
2161
|
-
body: { filter, sort, page, columns, consistency },
|
2162
|
-
...this.extraProps
|
2163
|
-
});
|
2164
|
-
}
|
2165
|
-
searchTable({
|
2166
|
-
workspace,
|
2167
|
-
region,
|
2168
|
-
database,
|
2169
|
-
branch,
|
2170
|
-
table,
|
2171
|
-
query,
|
2172
|
-
fuzziness,
|
2173
|
-
target,
|
2174
|
-
prefix,
|
2175
|
-
filter,
|
2176
|
-
highlight,
|
2177
|
-
boosters
|
2178
|
-
}) {
|
2179
|
-
return operationsByTag.searchAndFilter.searchTable({
|
2180
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
2181
|
-
body: { query, fuzziness, target, prefix, filter, highlight, boosters },
|
2182
|
-
...this.extraProps
|
2183
|
-
});
|
2184
|
-
}
|
2185
|
-
searchBranch({
|
2186
|
-
workspace,
|
2187
|
-
region,
|
2188
|
-
database,
|
2189
|
-
branch,
|
2190
|
-
tables,
|
2191
|
-
query,
|
2192
|
-
fuzziness,
|
2193
|
-
prefix,
|
2194
|
-
highlight
|
2195
|
-
}) {
|
2196
|
-
return operationsByTag.searchAndFilter.searchBranch({
|
2197
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2198
|
-
body: { tables, query, fuzziness, prefix, highlight },
|
2199
|
-
...this.extraProps
|
2200
|
-
});
|
2201
|
-
}
|
2202
|
-
vectorSearchTable({
|
2203
|
-
workspace,
|
2204
|
-
region,
|
2205
|
-
database,
|
2206
|
-
branch,
|
2207
|
-
table,
|
2208
|
-
queryVector,
|
2209
|
-
column,
|
2210
|
-
similarityFunction,
|
2211
|
-
size,
|
2212
|
-
filter
|
2213
|
-
}) {
|
2214
|
-
return operationsByTag.searchAndFilter.vectorSearchTable({
|
2215
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
2216
|
-
body: { queryVector, column, similarityFunction, size, filter },
|
2217
|
-
...this.extraProps
|
2218
|
-
});
|
2219
|
-
}
|
2220
|
-
askTable({
|
2221
|
-
workspace,
|
2222
|
-
region,
|
2223
|
-
database,
|
2224
|
-
branch,
|
2225
|
-
table,
|
2226
|
-
options
|
2227
|
-
}) {
|
2228
|
-
return operationsByTag.searchAndFilter.askTable({
|
2229
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
2230
|
-
body: { ...options },
|
2231
|
-
...this.extraProps
|
2232
|
-
});
|
2233
|
-
}
|
2234
|
-
askTableSession({
|
2235
|
-
workspace,
|
2236
|
-
region,
|
2237
|
-
database,
|
2238
|
-
branch,
|
2239
|
-
table,
|
2240
|
-
sessionId,
|
2241
|
-
message
|
2242
|
-
}) {
|
2243
|
-
return operationsByTag.searchAndFilter.askTableSession({
|
2244
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, sessionId },
|
2245
|
-
body: { message },
|
2246
|
-
...this.extraProps
|
2247
|
-
});
|
2248
|
-
}
|
2249
|
-
summarizeTable({
|
2250
|
-
workspace,
|
2251
|
-
region,
|
2252
|
-
database,
|
2253
|
-
branch,
|
2254
|
-
table,
|
2255
|
-
filter,
|
2256
|
-
columns,
|
2257
|
-
summaries,
|
2258
|
-
sort,
|
2259
|
-
summariesFilter,
|
2260
|
-
page,
|
2261
|
-
consistency
|
2262
|
-
}) {
|
2263
|
-
return operationsByTag.searchAndFilter.summarizeTable({
|
2264
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
2265
|
-
body: { filter, columns, summaries, sort, summariesFilter, page, consistency },
|
2266
|
-
...this.extraProps
|
2267
|
-
});
|
2268
|
-
}
|
2269
|
-
aggregateTable({
|
2270
|
-
workspace,
|
2271
|
-
region,
|
2272
|
-
database,
|
2273
|
-
branch,
|
2274
|
-
table,
|
2275
|
-
filter,
|
2276
|
-
aggs
|
2277
|
-
}) {
|
2278
|
-
return operationsByTag.searchAndFilter.aggregateTable({
|
2279
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
2280
|
-
body: { filter, aggs },
|
2281
|
-
...this.extraProps
|
2282
|
-
});
|
2283
|
-
}
|
2284
|
-
}
|
2285
|
-
class MigrationRequestsApi {
|
2286
|
-
constructor(extraProps) {
|
2287
|
-
this.extraProps = extraProps;
|
2288
|
-
}
|
2289
|
-
queryMigrationRequests({
|
2290
|
-
workspace,
|
2291
|
-
region,
|
2292
|
-
database,
|
2293
|
-
filter,
|
2294
|
-
sort,
|
2295
|
-
page,
|
2296
|
-
columns
|
2297
|
-
}) {
|
2298
|
-
return operationsByTag.migrationRequests.queryMigrationRequests({
|
2299
|
-
pathParams: { workspace, region, dbName: database },
|
2300
|
-
body: { filter, sort, page, columns },
|
2301
|
-
...this.extraProps
|
2302
|
-
});
|
2303
|
-
}
|
2304
|
-
createMigrationRequest({
|
2305
|
-
workspace,
|
2306
|
-
region,
|
2307
|
-
database,
|
2308
|
-
migration
|
2309
|
-
}) {
|
2310
|
-
return operationsByTag.migrationRequests.createMigrationRequest({
|
2311
|
-
pathParams: { workspace, region, dbName: database },
|
2312
|
-
body: migration,
|
2313
|
-
...this.extraProps
|
2314
|
-
});
|
2315
|
-
}
|
2316
|
-
getMigrationRequest({
|
2317
|
-
workspace,
|
2318
|
-
region,
|
2319
|
-
database,
|
2320
|
-
migrationRequest
|
2321
|
-
}) {
|
2322
|
-
return operationsByTag.migrationRequests.getMigrationRequest({
|
2323
|
-
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
2324
|
-
...this.extraProps
|
2325
|
-
});
|
2326
|
-
}
|
2327
|
-
updateMigrationRequest({
|
2328
|
-
workspace,
|
2329
|
-
region,
|
2330
|
-
database,
|
2331
|
-
migrationRequest,
|
2332
|
-
update
|
2333
|
-
}) {
|
2334
|
-
return operationsByTag.migrationRequests.updateMigrationRequest({
|
2335
|
-
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
2336
|
-
body: update,
|
2337
|
-
...this.extraProps
|
2338
|
-
});
|
2339
|
-
}
|
2340
|
-
listMigrationRequestsCommits({
|
2341
|
-
workspace,
|
2342
|
-
region,
|
2343
|
-
database,
|
2344
|
-
migrationRequest,
|
2345
|
-
page
|
2346
|
-
}) {
|
2347
|
-
return operationsByTag.migrationRequests.listMigrationRequestsCommits({
|
2348
|
-
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
2349
|
-
body: { page },
|
2350
|
-
...this.extraProps
|
2351
|
-
});
|
2352
|
-
}
|
2353
|
-
compareMigrationRequest({
|
2354
|
-
workspace,
|
2355
|
-
region,
|
2356
|
-
database,
|
2357
|
-
migrationRequest
|
2358
|
-
}) {
|
2359
|
-
return operationsByTag.migrationRequests.compareMigrationRequest({
|
2360
|
-
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
2361
|
-
...this.extraProps
|
2362
|
-
});
|
2363
|
-
}
|
2364
|
-
getMigrationRequestIsMerged({
|
2365
|
-
workspace,
|
2366
|
-
region,
|
2367
|
-
database,
|
2368
|
-
migrationRequest
|
2369
|
-
}) {
|
2370
|
-
return operationsByTag.migrationRequests.getMigrationRequestIsMerged({
|
2371
|
-
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
2372
|
-
...this.extraProps
|
2373
|
-
});
|
2374
|
-
}
|
2375
|
-
mergeMigrationRequest({
|
2376
|
-
workspace,
|
2377
|
-
region,
|
2378
|
-
database,
|
2379
|
-
migrationRequest
|
2380
|
-
}) {
|
2381
|
-
return operationsByTag.migrationRequests.mergeMigrationRequest({
|
2382
|
-
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
2383
|
-
...this.extraProps
|
2384
|
-
});
|
2385
|
-
}
|
2386
|
-
}
|
2387
|
-
class MigrationsApi {
|
2388
|
-
constructor(extraProps) {
|
2389
|
-
this.extraProps = extraProps;
|
2390
|
-
}
|
2391
|
-
getBranchMigrationHistory({
|
2392
|
-
workspace,
|
2393
|
-
region,
|
2394
|
-
database,
|
2395
|
-
branch,
|
2396
|
-
limit,
|
2397
|
-
startFrom
|
2398
|
-
}) {
|
2399
|
-
return operationsByTag.migrations.getBranchMigrationHistory({
|
2400
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2401
|
-
body: { limit, startFrom },
|
2402
|
-
...this.extraProps
|
2403
|
-
});
|
2404
|
-
}
|
2405
|
-
getBranchMigrationPlan({
|
2406
|
-
workspace,
|
2407
|
-
region,
|
2408
|
-
database,
|
2409
|
-
branch,
|
2410
|
-
schema
|
2411
|
-
}) {
|
2412
|
-
return operationsByTag.migrations.getBranchMigrationPlan({
|
2413
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2414
|
-
body: schema,
|
2415
|
-
...this.extraProps
|
2416
|
-
});
|
2417
|
-
}
|
2418
|
-
executeBranchMigrationPlan({
|
2419
|
-
workspace,
|
2420
|
-
region,
|
2421
|
-
database,
|
2422
|
-
branch,
|
2423
|
-
plan
|
2424
|
-
}) {
|
2425
|
-
return operationsByTag.migrations.executeBranchMigrationPlan({
|
2426
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2427
|
-
body: plan,
|
2428
|
-
...this.extraProps
|
2429
|
-
});
|
2430
|
-
}
|
2431
|
-
getBranchSchemaHistory({
|
2432
|
-
workspace,
|
2433
|
-
region,
|
2434
|
-
database,
|
2435
|
-
branch,
|
2436
|
-
page
|
2437
|
-
}) {
|
2438
|
-
return operationsByTag.migrations.getBranchSchemaHistory({
|
2439
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2440
|
-
body: { page },
|
2441
|
-
...this.extraProps
|
2442
|
-
});
|
2443
|
-
}
|
2444
|
-
compareBranchWithUserSchema({
|
2445
|
-
workspace,
|
2446
|
-
region,
|
2447
|
-
database,
|
2448
|
-
branch,
|
2449
|
-
schema,
|
2450
|
-
schemaOperations,
|
2451
|
-
branchOperations
|
2452
|
-
}) {
|
2453
|
-
return operationsByTag.migrations.compareBranchWithUserSchema({
|
2454
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2455
|
-
body: { schema, schemaOperations, branchOperations },
|
2456
|
-
...this.extraProps
|
2457
|
-
});
|
2458
|
-
}
|
2459
|
-
compareBranchSchemas({
|
2460
|
-
workspace,
|
2461
|
-
region,
|
2462
|
-
database,
|
2463
|
-
branch,
|
2464
|
-
compare,
|
2465
|
-
sourceBranchOperations,
|
2466
|
-
targetBranchOperations
|
2467
|
-
}) {
|
2468
|
-
return operationsByTag.migrations.compareBranchSchemas({
|
2469
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, branchName: compare },
|
2470
|
-
body: { sourceBranchOperations, targetBranchOperations },
|
2471
|
-
...this.extraProps
|
2472
|
-
});
|
2473
|
-
}
|
2474
|
-
updateBranchSchema({
|
2475
|
-
workspace,
|
2476
|
-
region,
|
2477
|
-
database,
|
2478
|
-
branch,
|
2479
|
-
migration
|
2480
|
-
}) {
|
2481
|
-
return operationsByTag.migrations.updateBranchSchema({
|
2482
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2483
|
-
body: migration,
|
2484
|
-
...this.extraProps
|
2485
|
-
});
|
2486
|
-
}
|
2487
|
-
previewBranchSchemaEdit({
|
2488
|
-
workspace,
|
2489
|
-
region,
|
2490
|
-
database,
|
2491
|
-
branch,
|
2492
|
-
data
|
2493
|
-
}) {
|
2494
|
-
return operationsByTag.migrations.previewBranchSchemaEdit({
|
2495
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2496
|
-
body: data,
|
2497
|
-
...this.extraProps
|
2498
|
-
});
|
2499
|
-
}
|
2500
|
-
applyBranchSchemaEdit({
|
2501
|
-
workspace,
|
2502
|
-
region,
|
2503
|
-
database,
|
2504
|
-
branch,
|
2505
|
-
edits
|
2506
|
-
}) {
|
2507
|
-
return operationsByTag.migrations.applyBranchSchemaEdit({
|
2508
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2509
|
-
body: { edits },
|
2510
|
-
...this.extraProps
|
2511
|
-
});
|
2512
|
-
}
|
2513
|
-
pushBranchMigrations({
|
2514
|
-
workspace,
|
2515
|
-
region,
|
2516
|
-
database,
|
2517
|
-
branch,
|
2518
|
-
migrations
|
2519
|
-
}) {
|
2520
|
-
return operationsByTag.migrations.pushBranchMigrations({
|
2521
|
-
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
2522
|
-
body: { migrations },
|
2523
|
-
...this.extraProps
|
2524
|
-
});
|
2525
|
-
}
|
2526
|
-
}
|
2527
|
-
class DatabaseApi {
|
2528
|
-
constructor(extraProps) {
|
2529
|
-
this.extraProps = extraProps;
|
2530
|
-
}
|
2531
|
-
getDatabaseList({ workspace }) {
|
2532
|
-
return operationsByTag.databases.getDatabaseList({
|
2533
|
-
pathParams: { workspaceId: workspace },
|
2534
|
-
...this.extraProps
|
2535
|
-
});
|
2536
|
-
}
|
2537
|
-
createDatabase({
|
2538
|
-
workspace,
|
2539
|
-
database,
|
2540
|
-
data,
|
2541
|
-
headers
|
2542
|
-
}) {
|
2543
|
-
return operationsByTag.databases.createDatabase({
|
2544
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2545
|
-
body: data,
|
2546
|
-
headers,
|
2547
|
-
...this.extraProps
|
2548
|
-
});
|
2549
|
-
}
|
2550
|
-
deleteDatabase({
|
2551
|
-
workspace,
|
2552
|
-
database
|
2553
|
-
}) {
|
2554
|
-
return operationsByTag.databases.deleteDatabase({
|
2555
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2556
|
-
...this.extraProps
|
2557
|
-
});
|
2558
|
-
}
|
2559
|
-
getDatabaseMetadata({
|
2560
|
-
workspace,
|
2561
|
-
database
|
2562
|
-
}) {
|
2563
|
-
return operationsByTag.databases.getDatabaseMetadata({
|
2564
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2565
|
-
...this.extraProps
|
2566
|
-
});
|
2567
|
-
}
|
2568
|
-
updateDatabaseMetadata({
|
2569
|
-
workspace,
|
2570
|
-
database,
|
2571
|
-
metadata
|
2572
|
-
}) {
|
2573
|
-
return operationsByTag.databases.updateDatabaseMetadata({
|
2574
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2575
|
-
body: metadata,
|
2576
|
-
...this.extraProps
|
2577
|
-
});
|
2578
|
-
}
|
2579
|
-
renameDatabase({
|
2580
|
-
workspace,
|
2581
|
-
database,
|
2582
|
-
newName
|
2583
|
-
}) {
|
2584
|
-
return operationsByTag.databases.renameDatabase({
|
2585
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2586
|
-
body: { newName },
|
2587
|
-
...this.extraProps
|
2588
|
-
});
|
2589
|
-
}
|
2590
|
-
getDatabaseGithubSettings({
|
2591
|
-
workspace,
|
2592
|
-
database
|
2593
|
-
}) {
|
2594
|
-
return operationsByTag.databases.getDatabaseGithubSettings({
|
2595
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2596
|
-
...this.extraProps
|
2597
|
-
});
|
2598
|
-
}
|
2599
|
-
updateDatabaseGithubSettings({
|
2600
|
-
workspace,
|
2601
|
-
database,
|
2602
|
-
settings
|
2603
|
-
}) {
|
2604
|
-
return operationsByTag.databases.updateDatabaseGithubSettings({
|
2605
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2606
|
-
body: settings,
|
2607
|
-
...this.extraProps
|
2608
|
-
});
|
2609
|
-
}
|
2610
|
-
deleteDatabaseGithubSettings({
|
2611
|
-
workspace,
|
2612
|
-
database
|
2613
|
-
}) {
|
2614
|
-
return operationsByTag.databases.deleteDatabaseGithubSettings({
|
2615
|
-
pathParams: { workspaceId: workspace, dbName: database },
|
2616
|
-
...this.extraProps
|
2617
|
-
});
|
2618
|
-
}
|
2619
|
-
listRegions({ workspace }) {
|
2620
|
-
return operationsByTag.databases.listRegions({
|
2621
|
-
pathParams: { workspaceId: workspace },
|
2622
|
-
...this.extraProps
|
2623
|
-
});
|
2624
|
-
}
|
1362
|
+
};
|
1363
|
+
class XataApiClient extends buildApiClient() {
|
2625
1364
|
}
|
2626
1365
|
|
2627
1366
|
class XataApiPlugin {
|
@@ -2664,16 +1403,16 @@ function transformImage(url, ...transformations) {
|
|
2664
1403
|
class XataFile {
|
2665
1404
|
constructor(file) {
|
2666
1405
|
this.id = file.id;
|
2667
|
-
this.name = file.name
|
2668
|
-
this.mediaType = file.mediaType
|
1406
|
+
this.name = file.name;
|
1407
|
+
this.mediaType = file.mediaType;
|
2669
1408
|
this.base64Content = file.base64Content;
|
2670
|
-
this.enablePublicUrl = file.enablePublicUrl
|
2671
|
-
this.signedUrlTimeout = file.signedUrlTimeout
|
2672
|
-
this.size = file.size
|
2673
|
-
this.version = file.version
|
2674
|
-
this.url = file.url
|
1409
|
+
this.enablePublicUrl = file.enablePublicUrl;
|
1410
|
+
this.signedUrlTimeout = file.signedUrlTimeout;
|
1411
|
+
this.size = file.size;
|
1412
|
+
this.version = file.version;
|
1413
|
+
this.url = file.url;
|
2675
1414
|
this.signedUrl = file.signedUrl;
|
2676
|
-
this.attributes = file.attributes
|
1415
|
+
this.attributes = file.attributes;
|
2677
1416
|
}
|
2678
1417
|
static fromBuffer(buffer, options = {}) {
|
2679
1418
|
const base64Content = buffer.toString("base64");
|
@@ -4370,7 +3109,7 @@ function getContentType(file) {
|
|
4370
3109
|
if (typeof file === "string") {
|
4371
3110
|
return "text/plain";
|
4372
3111
|
}
|
4373
|
-
if ("mediaType" in file) {
|
3112
|
+
if ("mediaType" in file && file.mediaType !== void 0) {
|
4374
3113
|
return file.mediaType;
|
4375
3114
|
}
|
4376
3115
|
if (isBlob(file)) {
|
@@ -4762,21 +3501,6 @@ const deserialize = (json) => {
|
|
4762
3501
|
return defaultSerializer.fromJSON(json);
|
4763
3502
|
};
|
4764
3503
|
|
4765
|
-
function buildWorkerRunner(config) {
|
4766
|
-
return function xataWorker(name, worker) {
|
4767
|
-
return async (...args) => {
|
4768
|
-
const url = process.env.NODE_ENV === "development" ? `http://localhost:64749/${name}` : `https://dispatcher.xata.workers.dev/${config.workspace}/${config.worker}/${name}`;
|
4769
|
-
const result = await fetch(url, {
|
4770
|
-
method: "POST",
|
4771
|
-
headers: { "Content-Type": "application/json" },
|
4772
|
-
body: serialize({ args })
|
4773
|
-
});
|
4774
|
-
const text = await result.text();
|
4775
|
-
return deserialize(text);
|
4776
|
-
};
|
4777
|
-
};
|
4778
|
-
}
|
4779
|
-
|
4780
3504
|
class XataError extends Error {
|
4781
3505
|
constructor(message, status) {
|
4782
3506
|
super(message);
|
@@ -4821,7 +3545,6 @@ exports.branchTransaction = branchTransaction;
|
|
4821
3545
|
exports.buildClient = buildClient;
|
4822
3546
|
exports.buildPreviewBranchName = buildPreviewBranchName;
|
4823
3547
|
exports.buildProviderString = buildProviderString;
|
4824
|
-
exports.buildWorkerRunner = buildWorkerRunner;
|
4825
3548
|
exports.bulkInsertTableRecords = bulkInsertTableRecords;
|
4826
3549
|
exports.cancelWorkspaceMemberInvite = cancelWorkspaceMemberInvite;
|
4827
3550
|
exports.compareBranchSchemas = compareBranchSchemas;
|
@@ -4929,6 +3652,8 @@ exports.operationsByTag = operationsByTag;
|
|
4929
3652
|
exports.parseProviderString = parseProviderString;
|
4930
3653
|
exports.parseWorkspacesUrlParts = parseWorkspacesUrlParts;
|
4931
3654
|
exports.pattern = pattern;
|
3655
|
+
exports.pgRollJobStatus = pgRollJobStatus;
|
3656
|
+
exports.pgRollStatus = pgRollStatus;
|
4932
3657
|
exports.previewBranchSchemaEdit = previewBranchSchemaEdit;
|
4933
3658
|
exports.pushBranchMigrations = pushBranchMigrations;
|
4934
3659
|
exports.putFile = putFile;
|