@xata.io/client 0.0.0-alpha.vf0e0021 → 0.0.0-alpha.vf14d496
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +7 -7
- package/Usage.md +5 -5
- package/dist/index.cjs +1233 -616
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3663 -2143
- package/dist/index.mjs +1220 -611
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- /package/{rollup.config.js → rollup.config.mjs} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -38,6 +38,9 @@ function isString(value) {
|
|
|
38
38
|
function isStringArray(value) {
|
|
39
39
|
return isDefined(value) && Array.isArray(value) && value.every(isString);
|
|
40
40
|
}
|
|
41
|
+
function isNumber(value) {
|
|
42
|
+
return isDefined(value) && typeof value === "number";
|
|
43
|
+
}
|
|
41
44
|
function toBase64(value) {
|
|
42
45
|
try {
|
|
43
46
|
return btoa(value);
|
|
@@ -46,6 +49,17 @@ function toBase64(value) {
|
|
|
46
49
|
return buf.from(value).toString("base64");
|
|
47
50
|
}
|
|
48
51
|
}
|
|
52
|
+
function deepMerge(a, b) {
|
|
53
|
+
const result = { ...a };
|
|
54
|
+
for (const [key, value] of Object.entries(b)) {
|
|
55
|
+
if (isObject(value) && isObject(result[key])) {
|
|
56
|
+
result[key] = deepMerge(result[key], value);
|
|
57
|
+
} else {
|
|
58
|
+
result[key] = value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
49
63
|
|
|
50
64
|
function getEnvironment() {
|
|
51
65
|
try {
|
|
@@ -150,7 +164,7 @@ function getFetchImplementation(userFetch) {
|
|
|
150
164
|
return fetchImpl;
|
|
151
165
|
}
|
|
152
166
|
|
|
153
|
-
const VERSION = "0.0.0-alpha.
|
|
167
|
+
const VERSION = "0.0.0-alpha.vf14d496";
|
|
154
168
|
|
|
155
169
|
class ErrorWithCause extends Error {
|
|
156
170
|
constructor(message, options) {
|
|
@@ -207,15 +221,18 @@ const resolveUrl = (url, queryParams = {}, pathParams = {}) => {
|
|
|
207
221
|
return url.replace(/\{\w*\}/g, (key) => cleanPathParams[key.slice(1, -1)]) + queryString;
|
|
208
222
|
};
|
|
209
223
|
function buildBaseUrl({
|
|
224
|
+
endpoint,
|
|
210
225
|
path,
|
|
211
226
|
workspacesApiUrl,
|
|
212
227
|
apiUrl,
|
|
213
|
-
pathParams
|
|
228
|
+
pathParams = {}
|
|
214
229
|
}) {
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
230
|
+
if (endpoint === "dataPlane") {
|
|
231
|
+
const url = isString(workspacesApiUrl) ? `${workspacesApiUrl}${path}` : workspacesApiUrl(path, pathParams);
|
|
232
|
+
const urlWithWorkspace = isString(pathParams.workspace) ? url.replace("{workspaceId}", String(pathParams.workspace)) : url;
|
|
233
|
+
return isString(pathParams.region) ? urlWithWorkspace.replace("{region}", String(pathParams.region)) : urlWithWorkspace;
|
|
234
|
+
}
|
|
235
|
+
return `${apiUrl}${path}`;
|
|
219
236
|
}
|
|
220
237
|
function hostHeader(url) {
|
|
221
238
|
const pattern = /.*:\/\/(?<host>[^/]+).*/;
|
|
@@ -231,14 +248,18 @@ async function fetch$1({
|
|
|
231
248
|
queryParams,
|
|
232
249
|
fetchImpl,
|
|
233
250
|
apiKey,
|
|
251
|
+
endpoint,
|
|
234
252
|
apiUrl,
|
|
235
253
|
workspacesApiUrl,
|
|
236
|
-
trace
|
|
254
|
+
trace,
|
|
255
|
+
signal,
|
|
256
|
+
clientID,
|
|
257
|
+
sessionID
|
|
237
258
|
}) {
|
|
238
259
|
return trace(
|
|
239
260
|
`${method.toUpperCase()} ${path}`,
|
|
240
261
|
async ({ setAttributes }) => {
|
|
241
|
-
const baseUrl = buildBaseUrl({ path, workspacesApiUrl, pathParams, apiUrl });
|
|
262
|
+
const baseUrl = buildBaseUrl({ endpoint, path, workspacesApiUrl, pathParams, apiUrl });
|
|
242
263
|
const fullUrl = resolveUrl(baseUrl, queryParams, pathParams);
|
|
243
264
|
const url = fullUrl.includes("localhost") ? fullUrl.replace(/^[^.]+\./, "http://") : fullUrl;
|
|
244
265
|
setAttributes({
|
|
@@ -251,10 +272,13 @@ async function fetch$1({
|
|
|
251
272
|
headers: {
|
|
252
273
|
"Content-Type": "application/json",
|
|
253
274
|
"User-Agent": `Xata client-ts/${VERSION}`,
|
|
275
|
+
"X-Xata-Client-ID": clientID ?? "",
|
|
276
|
+
"X-Xata-Session-ID": sessionID ?? "",
|
|
254
277
|
...headers,
|
|
255
278
|
...hostHeader(fullUrl),
|
|
256
279
|
Authorization: `Bearer ${apiKey}`
|
|
257
|
-
}
|
|
280
|
+
},
|
|
281
|
+
signal
|
|
258
282
|
});
|
|
259
283
|
if (response.status === 204) {
|
|
260
284
|
return {};
|
|
@@ -290,293 +314,163 @@ function parseUrl(url) {
|
|
|
290
314
|
}
|
|
291
315
|
}
|
|
292
316
|
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
url: "/user/keys",
|
|
298
|
-
method: "get",
|
|
299
|
-
...variables
|
|
300
|
-
});
|
|
301
|
-
const createUserAPIKey = (variables) => fetch$1({
|
|
302
|
-
url: "/user/keys/{keyName}",
|
|
303
|
-
method: "post",
|
|
304
|
-
...variables
|
|
305
|
-
});
|
|
306
|
-
const deleteUserAPIKey = (variables) => fetch$1({
|
|
307
|
-
url: "/user/keys/{keyName}",
|
|
308
|
-
method: "delete",
|
|
309
|
-
...variables
|
|
310
|
-
});
|
|
311
|
-
const createWorkspace = (variables) => fetch$1({
|
|
312
|
-
url: "/workspaces",
|
|
313
|
-
method: "post",
|
|
314
|
-
...variables
|
|
315
|
-
});
|
|
316
|
-
const getWorkspacesList = (variables) => fetch$1({
|
|
317
|
-
url: "/workspaces",
|
|
318
|
-
method: "get",
|
|
319
|
-
...variables
|
|
320
|
-
});
|
|
321
|
-
const getWorkspace = (variables) => fetch$1({
|
|
322
|
-
url: "/workspaces/{workspaceId}",
|
|
323
|
-
method: "get",
|
|
324
|
-
...variables
|
|
325
|
-
});
|
|
326
|
-
const updateWorkspace = (variables) => fetch$1({
|
|
327
|
-
url: "/workspaces/{workspaceId}",
|
|
328
|
-
method: "put",
|
|
329
|
-
...variables
|
|
330
|
-
});
|
|
331
|
-
const deleteWorkspace = (variables) => fetch$1({
|
|
332
|
-
url: "/workspaces/{workspaceId}",
|
|
333
|
-
method: "delete",
|
|
334
|
-
...variables
|
|
335
|
-
});
|
|
336
|
-
const getWorkspaceMembersList = (variables) => fetch$1({
|
|
337
|
-
url: "/workspaces/{workspaceId}/members",
|
|
338
|
-
method: "get",
|
|
339
|
-
...variables
|
|
340
|
-
});
|
|
341
|
-
const updateWorkspaceMemberRole = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/members/{userId}", method: "put", ...variables });
|
|
342
|
-
const removeWorkspaceMember = (variables) => fetch$1({
|
|
343
|
-
url: "/workspaces/{workspaceId}/members/{userId}",
|
|
344
|
-
method: "delete",
|
|
345
|
-
...variables
|
|
346
|
-
});
|
|
347
|
-
const inviteWorkspaceMember = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/invites", method: "post", ...variables });
|
|
348
|
-
const updateWorkspaceMemberInvite = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "patch", ...variables });
|
|
349
|
-
const cancelWorkspaceMemberInvite = (variables) => fetch$1({
|
|
350
|
-
url: "/workspaces/{workspaceId}/invites/{inviteId}",
|
|
351
|
-
method: "delete",
|
|
352
|
-
...variables
|
|
353
|
-
});
|
|
354
|
-
const resendWorkspaceMemberInvite = (variables) => fetch$1({
|
|
355
|
-
url: "/workspaces/{workspaceId}/invites/{inviteId}/resend",
|
|
356
|
-
method: "post",
|
|
357
|
-
...variables
|
|
358
|
-
});
|
|
359
|
-
const acceptWorkspaceMemberInvite = (variables) => fetch$1({
|
|
360
|
-
url: "/workspaces/{workspaceId}/invites/{inviteKey}/accept",
|
|
361
|
-
method: "post",
|
|
362
|
-
...variables
|
|
363
|
-
});
|
|
364
|
-
const getDatabaseList = (variables) => fetch$1({
|
|
365
|
-
url: "/dbs",
|
|
366
|
-
method: "get",
|
|
367
|
-
...variables
|
|
368
|
-
});
|
|
369
|
-
const getBranchList = (variables) => fetch$1({
|
|
317
|
+
const dataPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "dataPlane" });
|
|
318
|
+
|
|
319
|
+
const dEPRECATEDgetDatabaseList = (variables, signal) => dataPlaneFetch({ url: "/dbs", method: "get", ...variables, signal });
|
|
320
|
+
const getBranchList = (variables, signal) => dataPlaneFetch({
|
|
370
321
|
url: "/dbs/{dbName}",
|
|
371
322
|
method: "get",
|
|
372
|
-
...variables
|
|
323
|
+
...variables,
|
|
324
|
+
signal
|
|
373
325
|
});
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
const deleteDatabase = (variables) => fetch$1({
|
|
380
|
-
url: "/dbs/{dbName}",
|
|
381
|
-
method: "delete",
|
|
382
|
-
...variables
|
|
383
|
-
});
|
|
384
|
-
const getDatabaseMetadata = (variables) => fetch$1({
|
|
385
|
-
url: "/dbs/{dbName}/metadata",
|
|
386
|
-
method: "get",
|
|
387
|
-
...variables
|
|
388
|
-
});
|
|
389
|
-
const updateDatabaseMetadata = (variables) => fetch$1({ url: "/dbs/{dbName}/metadata", method: "patch", ...variables });
|
|
390
|
-
const getGitBranchesMapping = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "get", ...variables });
|
|
391
|
-
const addGitBranchesEntry = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "post", ...variables });
|
|
392
|
-
const removeGitBranchesEntry = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "delete", ...variables });
|
|
393
|
-
const resolveBranch = (variables) => fetch$1({
|
|
394
|
-
url: "/dbs/{dbName}/resolveBranch",
|
|
395
|
-
method: "get",
|
|
396
|
-
...variables
|
|
397
|
-
});
|
|
398
|
-
const listMigrationRequests = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/list", method: "post", ...variables });
|
|
399
|
-
const createMigrationRequest = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations", method: "post", ...variables });
|
|
400
|
-
const getMigrationRequest = (variables) => fetch$1({
|
|
401
|
-
url: "/dbs/{dbName}/migrations/{mrNumber}",
|
|
402
|
-
method: "get",
|
|
403
|
-
...variables
|
|
404
|
-
});
|
|
405
|
-
const updateMigrationRequest = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}", method: "patch", ...variables });
|
|
406
|
-
const listMigrationRequestsCommits = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}/commits", method: "post", ...variables });
|
|
407
|
-
const compareMigrationRequest = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}/compare", method: "post", ...variables });
|
|
408
|
-
const getMigrationRequestIsMerged = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}/merge", method: "get", ...variables });
|
|
409
|
-
const mergeMigrationRequest = (variables) => fetch$1({
|
|
410
|
-
url: "/dbs/{dbName}/migrations/{mrNumber}/merge",
|
|
411
|
-
method: "post",
|
|
412
|
-
...variables
|
|
413
|
-
});
|
|
414
|
-
const getBranchDetails = (variables) => fetch$1({
|
|
326
|
+
const dEPRECATEDcreateDatabase = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}", method: "put", ...variables, signal });
|
|
327
|
+
const dEPRECATEDdeleteDatabase = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}", method: "delete", ...variables, signal });
|
|
328
|
+
const dEPRECATEDgetDatabaseMetadata = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/metadata", method: "get", ...variables, signal });
|
|
329
|
+
const dEPRECATEDupdateDatabaseMetadata = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/metadata", method: "patch", ...variables, signal });
|
|
330
|
+
const getBranchDetails = (variables, signal) => dataPlaneFetch({
|
|
415
331
|
url: "/db/{dbBranchName}",
|
|
416
332
|
method: "get",
|
|
417
|
-
...variables
|
|
333
|
+
...variables,
|
|
334
|
+
signal
|
|
418
335
|
});
|
|
419
|
-
const createBranch = (variables) =>
|
|
420
|
-
const deleteBranch = (variables) =>
|
|
336
|
+
const createBranch = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}", method: "put", ...variables, signal });
|
|
337
|
+
const deleteBranch = (variables, signal) => dataPlaneFetch({
|
|
421
338
|
url: "/db/{dbBranchName}",
|
|
422
339
|
method: "delete",
|
|
423
|
-
...variables
|
|
340
|
+
...variables,
|
|
341
|
+
signal
|
|
424
342
|
});
|
|
425
|
-
const updateBranchMetadata = (variables) =>
|
|
343
|
+
const updateBranchMetadata = (variables, signal) => dataPlaneFetch({
|
|
426
344
|
url: "/db/{dbBranchName}/metadata",
|
|
427
345
|
method: "put",
|
|
428
|
-
...variables
|
|
346
|
+
...variables,
|
|
347
|
+
signal
|
|
429
348
|
});
|
|
430
|
-
const getBranchMetadata = (variables) =>
|
|
349
|
+
const getBranchMetadata = (variables, signal) => dataPlaneFetch({
|
|
431
350
|
url: "/db/{dbBranchName}/metadata",
|
|
432
351
|
method: "get",
|
|
433
|
-
...variables
|
|
434
|
-
|
|
435
|
-
const getBranchMigrationHistory = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations", method: "get", ...variables });
|
|
436
|
-
const executeBranchMigrationPlan = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations/execute", method: "post", ...variables });
|
|
437
|
-
const getBranchMigrationPlan = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations/plan", method: "post", ...variables });
|
|
438
|
-
const compareBranchWithUserSchema = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/compare", method: "post", ...variables });
|
|
439
|
-
const compareBranchSchemas = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/compare/{branchName}", method: "post", ...variables });
|
|
440
|
-
const updateBranchSchema = (variables) => fetch$1({
|
|
441
|
-
url: "/db/{dbBranchName}/schema/update",
|
|
442
|
-
method: "post",
|
|
443
|
-
...variables
|
|
352
|
+
...variables,
|
|
353
|
+
signal
|
|
444
354
|
});
|
|
445
|
-
const
|
|
446
|
-
const applyBranchSchemaEdit = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/apply", method: "post", ...variables });
|
|
447
|
-
const getBranchSchemaHistory = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/history", method: "post", ...variables });
|
|
448
|
-
const getBranchStats = (variables) => fetch$1({
|
|
355
|
+
const getBranchStats = (variables, signal) => dataPlaneFetch({
|
|
449
356
|
url: "/db/{dbBranchName}/stats",
|
|
450
357
|
method: "get",
|
|
451
|
-
...variables
|
|
358
|
+
...variables,
|
|
359
|
+
signal
|
|
360
|
+
});
|
|
361
|
+
const getGitBranchesMapping = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/gitBranches", method: "get", ...variables, signal });
|
|
362
|
+
const addGitBranchesEntry = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/gitBranches", method: "post", ...variables, signal });
|
|
363
|
+
const removeGitBranchesEntry = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/gitBranches", method: "delete", ...variables, signal });
|
|
364
|
+
const resolveBranch = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/resolveBranch", method: "get", ...variables, signal });
|
|
365
|
+
const getBranchMigrationHistory = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations", method: "get", ...variables, signal });
|
|
366
|
+
const getBranchMigrationPlan = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/plan", method: "post", ...variables, signal });
|
|
367
|
+
const executeBranchMigrationPlan = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/execute", method: "post", ...variables, signal });
|
|
368
|
+
const branchTransaction = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/transaction", method: "post", ...variables, signal });
|
|
369
|
+
const queryMigrationRequests = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/query", method: "post", ...variables, signal });
|
|
370
|
+
const createMigrationRequest = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations", method: "post", ...variables, signal });
|
|
371
|
+
const getMigrationRequest = (variables, signal) => dataPlaneFetch({
|
|
372
|
+
url: "/dbs/{dbName}/migrations/{mrNumber}",
|
|
373
|
+
method: "get",
|
|
374
|
+
...variables,
|
|
375
|
+
signal
|
|
452
376
|
});
|
|
453
|
-
const
|
|
377
|
+
const updateMigrationRequest = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}", method: "patch", ...variables, signal });
|
|
378
|
+
const listMigrationRequestsCommits = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}/commits", method: "post", ...variables, signal });
|
|
379
|
+
const compareMigrationRequest = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}/compare", method: "post", ...variables, signal });
|
|
380
|
+
const getMigrationRequestIsMerged = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}/merge", method: "get", ...variables, signal });
|
|
381
|
+
const mergeMigrationRequest = (variables, signal) => dataPlaneFetch({
|
|
382
|
+
url: "/dbs/{dbName}/migrations/{mrNumber}/merge",
|
|
383
|
+
method: "post",
|
|
384
|
+
...variables,
|
|
385
|
+
signal
|
|
386
|
+
});
|
|
387
|
+
const getBranchSchemaHistory = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/history", method: "post", ...variables, signal });
|
|
388
|
+
const compareBranchWithUserSchema = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/compare", method: "post", ...variables, signal });
|
|
389
|
+
const compareBranchSchemas = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/compare/{branchName}", method: "post", ...variables, signal });
|
|
390
|
+
const updateBranchSchema = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/update", method: "post", ...variables, signal });
|
|
391
|
+
const previewBranchSchemaEdit = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/preview", method: "post", ...variables, signal });
|
|
392
|
+
const applyBranchSchemaEdit = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/apply", method: "post", ...variables, signal });
|
|
393
|
+
const createTable = (variables, signal) => dataPlaneFetch({
|
|
454
394
|
url: "/db/{dbBranchName}/tables/{tableName}",
|
|
455
395
|
method: "put",
|
|
456
|
-
...variables
|
|
396
|
+
...variables,
|
|
397
|
+
signal
|
|
457
398
|
});
|
|
458
|
-
const deleteTable = (variables) =>
|
|
399
|
+
const deleteTable = (variables, signal) => dataPlaneFetch({
|
|
459
400
|
url: "/db/{dbBranchName}/tables/{tableName}",
|
|
460
401
|
method: "delete",
|
|
461
|
-
...variables
|
|
402
|
+
...variables,
|
|
403
|
+
signal
|
|
462
404
|
});
|
|
463
|
-
const updateTable = (variables) =>
|
|
464
|
-
|
|
465
|
-
method: "patch",
|
|
466
|
-
...variables
|
|
467
|
-
});
|
|
468
|
-
const getTableSchema = (variables) => fetch$1({
|
|
405
|
+
const updateTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}", method: "patch", ...variables, signal });
|
|
406
|
+
const getTableSchema = (variables, signal) => dataPlaneFetch({
|
|
469
407
|
url: "/db/{dbBranchName}/tables/{tableName}/schema",
|
|
470
408
|
method: "get",
|
|
471
|
-
...variables
|
|
409
|
+
...variables,
|
|
410
|
+
signal
|
|
472
411
|
});
|
|
473
|
-
const setTableSchema = (variables) =>
|
|
474
|
-
|
|
475
|
-
method: "put",
|
|
476
|
-
...variables
|
|
477
|
-
});
|
|
478
|
-
const getTableColumns = (variables) => fetch$1({
|
|
412
|
+
const setTableSchema = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/schema", method: "put", ...variables, signal });
|
|
413
|
+
const getTableColumns = (variables, signal) => dataPlaneFetch({
|
|
479
414
|
url: "/db/{dbBranchName}/tables/{tableName}/columns",
|
|
480
415
|
method: "get",
|
|
481
|
-
...variables
|
|
482
|
-
|
|
483
|
-
const addTableColumn = (variables) => fetch$1({
|
|
484
|
-
url: "/db/{dbBranchName}/tables/{tableName}/columns",
|
|
485
|
-
method: "post",
|
|
486
|
-
...variables
|
|
416
|
+
...variables,
|
|
417
|
+
signal
|
|
487
418
|
});
|
|
488
|
-
const
|
|
419
|
+
const addTableColumn = (variables, signal) => dataPlaneFetch(
|
|
420
|
+
{ url: "/db/{dbBranchName}/tables/{tableName}/columns", method: "post", ...variables, signal }
|
|
421
|
+
);
|
|
422
|
+
const getColumn = (variables, signal) => dataPlaneFetch({
|
|
489
423
|
url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",
|
|
490
424
|
method: "get",
|
|
491
|
-
...variables
|
|
425
|
+
...variables,
|
|
426
|
+
signal
|
|
492
427
|
});
|
|
493
|
-
const
|
|
428
|
+
const updateColumn = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}", method: "patch", ...variables, signal });
|
|
429
|
+
const deleteColumn = (variables, signal) => dataPlaneFetch({
|
|
494
430
|
url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",
|
|
495
431
|
method: "delete",
|
|
496
|
-
...variables
|
|
432
|
+
...variables,
|
|
433
|
+
signal
|
|
497
434
|
});
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
method: "patch",
|
|
501
|
-
...variables
|
|
502
|
-
});
|
|
503
|
-
const insertRecord = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data", method: "post", ...variables });
|
|
504
|
-
const insertRecordWithID = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "put", ...variables });
|
|
505
|
-
const updateRecordWithID = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "patch", ...variables });
|
|
506
|
-
const upsertRecordWithID = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "post", ...variables });
|
|
507
|
-
const deleteRecord = (variables) => fetch$1({
|
|
508
|
-
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}",
|
|
509
|
-
method: "delete",
|
|
510
|
-
...variables
|
|
511
|
-
});
|
|
512
|
-
const getRecord = (variables) => fetch$1({
|
|
435
|
+
const insertRecord = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data", method: "post", ...variables, signal });
|
|
436
|
+
const getRecord = (variables, signal) => dataPlaneFetch({
|
|
513
437
|
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}",
|
|
514
438
|
method: "get",
|
|
515
|
-
...variables
|
|
439
|
+
...variables,
|
|
440
|
+
signal
|
|
516
441
|
});
|
|
517
|
-
const
|
|
518
|
-
const
|
|
442
|
+
const insertRecordWithID = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "put", ...variables, signal });
|
|
443
|
+
const updateRecordWithID = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "patch", ...variables, signal });
|
|
444
|
+
const upsertRecordWithID = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "post", ...variables, signal });
|
|
445
|
+
const deleteRecord = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "delete", ...variables, signal });
|
|
446
|
+
const bulkInsertTableRecords = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/bulk", method: "post", ...variables, signal });
|
|
447
|
+
const queryTable = (variables, signal) => dataPlaneFetch({
|
|
519
448
|
url: "/db/{dbBranchName}/tables/{tableName}/query",
|
|
520
449
|
method: "post",
|
|
521
|
-
...variables
|
|
522
|
-
|
|
523
|
-
const searchTable = (variables) => fetch$1({
|
|
524
|
-
url: "/db/{dbBranchName}/tables/{tableName}/search",
|
|
525
|
-
method: "post",
|
|
526
|
-
...variables
|
|
450
|
+
...variables,
|
|
451
|
+
signal
|
|
527
452
|
});
|
|
528
|
-
const searchBranch = (variables) =>
|
|
453
|
+
const searchBranch = (variables, signal) => dataPlaneFetch({
|
|
529
454
|
url: "/db/{dbBranchName}/search",
|
|
530
455
|
method: "post",
|
|
531
|
-
...variables
|
|
456
|
+
...variables,
|
|
457
|
+
signal
|
|
532
458
|
});
|
|
533
|
-
const
|
|
534
|
-
url: "/db/{dbBranchName}/tables/{tableName}/
|
|
459
|
+
const searchTable = (variables, signal) => dataPlaneFetch({
|
|
460
|
+
url: "/db/{dbBranchName}/tables/{tableName}/search",
|
|
535
461
|
method: "post",
|
|
536
|
-
...variables
|
|
537
|
-
|
|
538
|
-
const cPgetDatabaseList = (variables) => fetch$1({
|
|
539
|
-
url: "/workspaces/{workspaceId}/dbs",
|
|
540
|
-
method: "get",
|
|
541
|
-
...variables
|
|
542
|
-
});
|
|
543
|
-
const cPcreateDatabase = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "put", ...variables });
|
|
544
|
-
const cPdeleteDatabase = (variables) => fetch$1({
|
|
545
|
-
url: "/workspaces/{workspaceId}/dbs/{dbName}",
|
|
546
|
-
method: "delete",
|
|
547
|
-
...variables
|
|
462
|
+
...variables,
|
|
463
|
+
signal
|
|
548
464
|
});
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
const cPupdateCPDatabaseMetadata = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/dbs/{dbName}/metadata", method: "patch", ...variables });
|
|
553
|
-
const operationsByTag = {
|
|
554
|
-
users: { getUser, updateUser, deleteUser, getUserAPIKeys, createUserAPIKey, deleteUserAPIKey },
|
|
555
|
-
workspaces: {
|
|
556
|
-
createWorkspace,
|
|
557
|
-
getWorkspacesList,
|
|
558
|
-
getWorkspace,
|
|
559
|
-
updateWorkspace,
|
|
560
|
-
deleteWorkspace,
|
|
561
|
-
getWorkspaceMembersList,
|
|
562
|
-
updateWorkspaceMemberRole,
|
|
563
|
-
removeWorkspaceMember,
|
|
564
|
-
inviteWorkspaceMember,
|
|
565
|
-
updateWorkspaceMemberInvite,
|
|
566
|
-
cancelWorkspaceMemberInvite,
|
|
567
|
-
resendWorkspaceMemberInvite,
|
|
568
|
-
acceptWorkspaceMemberInvite
|
|
569
|
-
},
|
|
465
|
+
const summarizeTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/summarize", method: "post", ...variables, signal });
|
|
466
|
+
const aggregateTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/aggregate", method: "post", ...variables, signal });
|
|
467
|
+
const operationsByTag$2 = {
|
|
570
468
|
database: {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
getGitBranchesMapping,
|
|
577
|
-
addGitBranchesEntry,
|
|
578
|
-
removeGitBranchesEntry,
|
|
579
|
-
resolveBranch
|
|
469
|
+
dEPRECATEDgetDatabaseList,
|
|
470
|
+
dEPRECATEDcreateDatabase,
|
|
471
|
+
dEPRECATEDdeleteDatabase,
|
|
472
|
+
dEPRECATEDgetDatabaseMetadata,
|
|
473
|
+
dEPRECATEDupdateDatabaseMetadata
|
|
580
474
|
},
|
|
581
475
|
branch: {
|
|
582
476
|
getBranchList,
|
|
@@ -585,10 +479,35 @@ const operationsByTag = {
|
|
|
585
479
|
deleteBranch,
|
|
586
480
|
updateBranchMetadata,
|
|
587
481
|
getBranchMetadata,
|
|
588
|
-
getBranchStats
|
|
482
|
+
getBranchStats,
|
|
483
|
+
getGitBranchesMapping,
|
|
484
|
+
addGitBranchesEntry,
|
|
485
|
+
removeGitBranchesEntry,
|
|
486
|
+
resolveBranch
|
|
487
|
+
},
|
|
488
|
+
migrations: {
|
|
489
|
+
getBranchMigrationHistory,
|
|
490
|
+
getBranchMigrationPlan,
|
|
491
|
+
executeBranchMigrationPlan,
|
|
492
|
+
getBranchSchemaHistory,
|
|
493
|
+
compareBranchWithUserSchema,
|
|
494
|
+
compareBranchSchemas,
|
|
495
|
+
updateBranchSchema,
|
|
496
|
+
previewBranchSchemaEdit,
|
|
497
|
+
applyBranchSchemaEdit
|
|
498
|
+
},
|
|
499
|
+
records: {
|
|
500
|
+
branchTransaction,
|
|
501
|
+
insertRecord,
|
|
502
|
+
getRecord,
|
|
503
|
+
insertRecordWithID,
|
|
504
|
+
updateRecordWithID,
|
|
505
|
+
upsertRecordWithID,
|
|
506
|
+
deleteRecord,
|
|
507
|
+
bulkInsertTableRecords
|
|
589
508
|
},
|
|
590
509
|
migrationRequests: {
|
|
591
|
-
|
|
510
|
+
queryMigrationRequests,
|
|
592
511
|
createMigrationRequest,
|
|
593
512
|
getMigrationRequest,
|
|
594
513
|
updateMigrationRequest,
|
|
@@ -597,17 +516,6 @@ const operationsByTag = {
|
|
|
597
516
|
getMigrationRequestIsMerged,
|
|
598
517
|
mergeMigrationRequest
|
|
599
518
|
},
|
|
600
|
-
branchSchema: {
|
|
601
|
-
getBranchMigrationHistory,
|
|
602
|
-
executeBranchMigrationPlan,
|
|
603
|
-
getBranchMigrationPlan,
|
|
604
|
-
compareBranchWithUserSchema,
|
|
605
|
-
compareBranchSchemas,
|
|
606
|
-
updateBranchSchema,
|
|
607
|
-
previewBranchSchemaEdit,
|
|
608
|
-
applyBranchSchemaEdit,
|
|
609
|
-
getBranchSchemaHistory
|
|
610
|
-
},
|
|
611
519
|
table: {
|
|
612
520
|
createTable,
|
|
613
521
|
deleteTable,
|
|
@@ -617,31 +525,146 @@ const operationsByTag = {
|
|
|
617
525
|
getTableColumns,
|
|
618
526
|
addTableColumn,
|
|
619
527
|
getColumn,
|
|
620
|
-
|
|
621
|
-
|
|
528
|
+
updateColumn,
|
|
529
|
+
deleteColumn
|
|
622
530
|
},
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
531
|
+
searchAndFilter: { queryTable, searchBranch, searchTable, summarizeTable, aggregateTable }
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
const controlPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "controlPlane" });
|
|
535
|
+
|
|
536
|
+
const getUser = (variables, signal) => controlPlaneFetch({
|
|
537
|
+
url: "/user",
|
|
538
|
+
method: "get",
|
|
539
|
+
...variables,
|
|
540
|
+
signal
|
|
541
|
+
});
|
|
542
|
+
const updateUser = (variables, signal) => controlPlaneFetch({
|
|
543
|
+
url: "/user",
|
|
544
|
+
method: "put",
|
|
545
|
+
...variables,
|
|
546
|
+
signal
|
|
547
|
+
});
|
|
548
|
+
const deleteUser = (variables, signal) => controlPlaneFetch({
|
|
549
|
+
url: "/user",
|
|
550
|
+
method: "delete",
|
|
551
|
+
...variables,
|
|
552
|
+
signal
|
|
553
|
+
});
|
|
554
|
+
const getUserAPIKeys = (variables, signal) => controlPlaneFetch({
|
|
555
|
+
url: "/user/keys",
|
|
556
|
+
method: "get",
|
|
557
|
+
...variables,
|
|
558
|
+
signal
|
|
559
|
+
});
|
|
560
|
+
const createUserAPIKey = (variables, signal) => controlPlaneFetch({
|
|
561
|
+
url: "/user/keys/{keyName}",
|
|
562
|
+
method: "post",
|
|
563
|
+
...variables,
|
|
564
|
+
signal
|
|
565
|
+
});
|
|
566
|
+
const deleteUserAPIKey = (variables, signal) => controlPlaneFetch({
|
|
567
|
+
url: "/user/keys/{keyName}",
|
|
568
|
+
method: "delete",
|
|
569
|
+
...variables,
|
|
570
|
+
signal
|
|
571
|
+
});
|
|
572
|
+
const getWorkspacesList = (variables, signal) => controlPlaneFetch({
|
|
573
|
+
url: "/workspaces",
|
|
574
|
+
method: "get",
|
|
575
|
+
...variables,
|
|
576
|
+
signal
|
|
577
|
+
});
|
|
578
|
+
const createWorkspace = (variables, signal) => controlPlaneFetch({
|
|
579
|
+
url: "/workspaces",
|
|
580
|
+
method: "post",
|
|
581
|
+
...variables,
|
|
582
|
+
signal
|
|
583
|
+
});
|
|
584
|
+
const getWorkspace = (variables, signal) => controlPlaneFetch({
|
|
585
|
+
url: "/workspaces/{workspaceId}",
|
|
586
|
+
method: "get",
|
|
587
|
+
...variables,
|
|
588
|
+
signal
|
|
589
|
+
});
|
|
590
|
+
const updateWorkspace = (variables, signal) => controlPlaneFetch({
|
|
591
|
+
url: "/workspaces/{workspaceId}",
|
|
592
|
+
method: "put",
|
|
593
|
+
...variables,
|
|
594
|
+
signal
|
|
595
|
+
});
|
|
596
|
+
const deleteWorkspace = (variables, signal) => controlPlaneFetch({
|
|
597
|
+
url: "/workspaces/{workspaceId}",
|
|
598
|
+
method: "delete",
|
|
599
|
+
...variables,
|
|
600
|
+
signal
|
|
601
|
+
});
|
|
602
|
+
const getWorkspaceMembersList = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/members", method: "get", ...variables, signal });
|
|
603
|
+
const updateWorkspaceMemberRole = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/members/{userId}", method: "put", ...variables, signal });
|
|
604
|
+
const removeWorkspaceMember = (variables, signal) => controlPlaneFetch({
|
|
605
|
+
url: "/workspaces/{workspaceId}/members/{userId}",
|
|
606
|
+
method: "delete",
|
|
607
|
+
...variables,
|
|
608
|
+
signal
|
|
609
|
+
});
|
|
610
|
+
const inviteWorkspaceMember = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites", method: "post", ...variables, signal });
|
|
611
|
+
const updateWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "patch", ...variables, signal });
|
|
612
|
+
const cancelWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "delete", ...variables, signal });
|
|
613
|
+
const acceptWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteKey}/accept", method: "post", ...variables, signal });
|
|
614
|
+
const resendWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}/resend", method: "post", ...variables, signal });
|
|
615
|
+
const getDatabaseList = (variables, signal) => controlPlaneFetch({
|
|
616
|
+
url: "/workspaces/{workspaceId}/dbs",
|
|
617
|
+
method: "get",
|
|
618
|
+
...variables,
|
|
619
|
+
signal
|
|
620
|
+
});
|
|
621
|
+
const createDatabase = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "put", ...variables, signal });
|
|
622
|
+
const deleteDatabase = (variables, signal) => controlPlaneFetch({
|
|
623
|
+
url: "/workspaces/{workspaceId}/dbs/{dbName}",
|
|
624
|
+
method: "delete",
|
|
625
|
+
...variables,
|
|
626
|
+
signal
|
|
627
|
+
});
|
|
628
|
+
const getDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "get", ...variables, signal });
|
|
629
|
+
const updateDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "patch", ...variables, signal });
|
|
630
|
+
const listRegions = (variables, signal) => controlPlaneFetch({
|
|
631
|
+
url: "/workspaces/{workspaceId}/regions",
|
|
632
|
+
method: "get",
|
|
633
|
+
...variables,
|
|
634
|
+
signal
|
|
635
|
+
});
|
|
636
|
+
const operationsByTag$1 = {
|
|
637
|
+
users: { getUser, updateUser, deleteUser },
|
|
638
|
+
authentication: { getUserAPIKeys, createUserAPIKey, deleteUserAPIKey },
|
|
639
|
+
workspaces: {
|
|
640
|
+
getWorkspacesList,
|
|
641
|
+
createWorkspace,
|
|
642
|
+
getWorkspace,
|
|
643
|
+
updateWorkspace,
|
|
644
|
+
deleteWorkspace,
|
|
645
|
+
getWorkspaceMembersList,
|
|
646
|
+
updateWorkspaceMemberRole,
|
|
647
|
+
removeWorkspaceMember
|
|
648
|
+
},
|
|
649
|
+
invites: {
|
|
650
|
+
inviteWorkspaceMember,
|
|
651
|
+
updateWorkspaceMemberInvite,
|
|
652
|
+
cancelWorkspaceMemberInvite,
|
|
653
|
+
acceptWorkspaceMemberInvite,
|
|
654
|
+
resendWorkspaceMemberInvite
|
|
635
655
|
},
|
|
636
656
|
databases: {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
657
|
+
getDatabaseList,
|
|
658
|
+
createDatabase,
|
|
659
|
+
deleteDatabase,
|
|
660
|
+
getDatabaseMetadata,
|
|
661
|
+
updateDatabaseMetadata,
|
|
662
|
+
listRegions
|
|
642
663
|
}
|
|
643
664
|
};
|
|
644
665
|
|
|
666
|
+
const operationsByTag = deepMerge(operationsByTag$2, operationsByTag$1);
|
|
667
|
+
|
|
645
668
|
function getHostUrl(provider, type) {
|
|
646
669
|
if (isHostProviderAlias(provider)) {
|
|
647
670
|
return providers[provider][type];
|
|
@@ -653,11 +676,11 @@ function getHostUrl(provider, type) {
|
|
|
653
676
|
const providers = {
|
|
654
677
|
production: {
|
|
655
678
|
main: "https://api.xata.io",
|
|
656
|
-
workspaces: "https://{workspaceId}.xata.sh"
|
|
679
|
+
workspaces: "https://{workspaceId}.{region}.xata.sh"
|
|
657
680
|
},
|
|
658
681
|
staging: {
|
|
659
682
|
main: "https://staging.xatabase.co",
|
|
660
|
-
workspaces: "https://{workspaceId}.staging.xatabase.co"
|
|
683
|
+
workspaces: "https://{workspaceId}.staging.{region}.xatabase.co"
|
|
661
684
|
}
|
|
662
685
|
};
|
|
663
686
|
function isHostProviderAlias(alias) {
|
|
@@ -666,6 +689,25 @@ function isHostProviderAlias(alias) {
|
|
|
666
689
|
function isHostProviderBuilder(builder) {
|
|
667
690
|
return isObject(builder) && isString(builder.main) && isString(builder.workspaces);
|
|
668
691
|
}
|
|
692
|
+
function parseProviderString(provider = "production") {
|
|
693
|
+
if (isHostProviderAlias(provider)) {
|
|
694
|
+
return provider;
|
|
695
|
+
}
|
|
696
|
+
const [main, workspaces] = provider.split(",");
|
|
697
|
+
if (!main || !workspaces)
|
|
698
|
+
return null;
|
|
699
|
+
return { main, workspaces };
|
|
700
|
+
}
|
|
701
|
+
function parseWorkspacesUrlParts(url) {
|
|
702
|
+
if (!isString(url))
|
|
703
|
+
return null;
|
|
704
|
+
const regex = /(?:https:\/\/)?([^.]+)(?:\.([^.]+))?\.xata\.sh.*/;
|
|
705
|
+
const regexStaging = /(?:https:\/\/)?([^.]+)\.staging(?:\.([^.]+))?\.xatabase\.co.*/;
|
|
706
|
+
const match = url.match(regex) || url.match(regexStaging);
|
|
707
|
+
if (!match)
|
|
708
|
+
return null;
|
|
709
|
+
return { workspace: match[1], region: match[2] ?? "eu-west-1" };
|
|
710
|
+
}
|
|
669
711
|
|
|
670
712
|
var __accessCheck$7 = (obj, member, msg) => {
|
|
671
713
|
if (!member.has(obj))
|
|
@@ -709,21 +751,41 @@ class XataApiClient {
|
|
|
709
751
|
__privateGet$7(this, _namespaces).user = new UserApi(__privateGet$7(this, _extraProps));
|
|
710
752
|
return __privateGet$7(this, _namespaces).user;
|
|
711
753
|
}
|
|
754
|
+
get authentication() {
|
|
755
|
+
if (!__privateGet$7(this, _namespaces).authentication)
|
|
756
|
+
__privateGet$7(this, _namespaces).authentication = new AuthenticationApi(__privateGet$7(this, _extraProps));
|
|
757
|
+
return __privateGet$7(this, _namespaces).authentication;
|
|
758
|
+
}
|
|
712
759
|
get workspaces() {
|
|
713
760
|
if (!__privateGet$7(this, _namespaces).workspaces)
|
|
714
761
|
__privateGet$7(this, _namespaces).workspaces = new WorkspaceApi(__privateGet$7(this, _extraProps));
|
|
715
762
|
return __privateGet$7(this, _namespaces).workspaces;
|
|
716
763
|
}
|
|
717
|
-
get
|
|
718
|
-
if (!__privateGet$7(this, _namespaces).
|
|
719
|
-
__privateGet$7(this, _namespaces).
|
|
720
|
-
return __privateGet$7(this, _namespaces).
|
|
764
|
+
get invites() {
|
|
765
|
+
if (!__privateGet$7(this, _namespaces).invites)
|
|
766
|
+
__privateGet$7(this, _namespaces).invites = new InvitesApi(__privateGet$7(this, _extraProps));
|
|
767
|
+
return __privateGet$7(this, _namespaces).invites;
|
|
768
|
+
}
|
|
769
|
+
get database() {
|
|
770
|
+
if (!__privateGet$7(this, _namespaces).database)
|
|
771
|
+
__privateGet$7(this, _namespaces).database = new DatabaseApi(__privateGet$7(this, _extraProps));
|
|
772
|
+
return __privateGet$7(this, _namespaces).database;
|
|
721
773
|
}
|
|
722
774
|
get branches() {
|
|
723
775
|
if (!__privateGet$7(this, _namespaces).branches)
|
|
724
776
|
__privateGet$7(this, _namespaces).branches = new BranchApi(__privateGet$7(this, _extraProps));
|
|
725
777
|
return __privateGet$7(this, _namespaces).branches;
|
|
726
778
|
}
|
|
779
|
+
get migrations() {
|
|
780
|
+
if (!__privateGet$7(this, _namespaces).migrations)
|
|
781
|
+
__privateGet$7(this, _namespaces).migrations = new MigrationsApi(__privateGet$7(this, _extraProps));
|
|
782
|
+
return __privateGet$7(this, _namespaces).migrations;
|
|
783
|
+
}
|
|
784
|
+
get migrationRequests() {
|
|
785
|
+
if (!__privateGet$7(this, _namespaces).migrationRequests)
|
|
786
|
+
__privateGet$7(this, _namespaces).migrationRequests = new MigrationRequestsApi(__privateGet$7(this, _extraProps));
|
|
787
|
+
return __privateGet$7(this, _namespaces).migrationRequests;
|
|
788
|
+
}
|
|
727
789
|
get tables() {
|
|
728
790
|
if (!__privateGet$7(this, _namespaces).tables)
|
|
729
791
|
__privateGet$7(this, _namespaces).tables = new TableApi(__privateGet$7(this, _extraProps));
|
|
@@ -734,15 +796,10 @@ class XataApiClient {
|
|
|
734
796
|
__privateGet$7(this, _namespaces).records = new RecordsApi(__privateGet$7(this, _extraProps));
|
|
735
797
|
return __privateGet$7(this, _namespaces).records;
|
|
736
798
|
}
|
|
737
|
-
get
|
|
738
|
-
if (!__privateGet$7(this, _namespaces).
|
|
739
|
-
__privateGet$7(this, _namespaces).
|
|
740
|
-
return __privateGet$7(this, _namespaces).
|
|
741
|
-
}
|
|
742
|
-
get branchSchema() {
|
|
743
|
-
if (!__privateGet$7(this, _namespaces).branchSchema)
|
|
744
|
-
__privateGet$7(this, _namespaces).branchSchema = new BranchSchemaApi(__privateGet$7(this, _extraProps));
|
|
745
|
-
return __privateGet$7(this, _namespaces).branchSchema;
|
|
799
|
+
get searchAndFilter() {
|
|
800
|
+
if (!__privateGet$7(this, _namespaces).searchAndFilter)
|
|
801
|
+
__privateGet$7(this, _namespaces).searchAndFilter = new SearchAndFilterApi(__privateGet$7(this, _extraProps));
|
|
802
|
+
return __privateGet$7(this, _namespaces).searchAndFilter;
|
|
746
803
|
}
|
|
747
804
|
}
|
|
748
805
|
_extraProps = new WeakMap();
|
|
@@ -754,24 +811,29 @@ class UserApi {
|
|
|
754
811
|
getUser() {
|
|
755
812
|
return operationsByTag.users.getUser({ ...this.extraProps });
|
|
756
813
|
}
|
|
757
|
-
updateUser(user) {
|
|
814
|
+
updateUser({ user }) {
|
|
758
815
|
return operationsByTag.users.updateUser({ body: user, ...this.extraProps });
|
|
759
816
|
}
|
|
760
817
|
deleteUser() {
|
|
761
818
|
return operationsByTag.users.deleteUser({ ...this.extraProps });
|
|
762
819
|
}
|
|
820
|
+
}
|
|
821
|
+
class AuthenticationApi {
|
|
822
|
+
constructor(extraProps) {
|
|
823
|
+
this.extraProps = extraProps;
|
|
824
|
+
}
|
|
763
825
|
getUserAPIKeys() {
|
|
764
|
-
return operationsByTag.
|
|
826
|
+
return operationsByTag.authentication.getUserAPIKeys({ ...this.extraProps });
|
|
765
827
|
}
|
|
766
|
-
createUserAPIKey(
|
|
767
|
-
return operationsByTag.
|
|
768
|
-
pathParams: { keyName },
|
|
828
|
+
createUserAPIKey({ name }) {
|
|
829
|
+
return operationsByTag.authentication.createUserAPIKey({
|
|
830
|
+
pathParams: { keyName: name },
|
|
769
831
|
...this.extraProps
|
|
770
832
|
});
|
|
771
833
|
}
|
|
772
|
-
deleteUserAPIKey(
|
|
773
|
-
return operationsByTag.
|
|
774
|
-
pathParams: { keyName },
|
|
834
|
+
deleteUserAPIKey({ name }) {
|
|
835
|
+
return operationsByTag.authentication.deleteUserAPIKey({
|
|
836
|
+
pathParams: { keyName: name },
|
|
775
837
|
...this.extraProps
|
|
776
838
|
});
|
|
777
839
|
}
|
|
@@ -780,196 +842,248 @@ class WorkspaceApi {
|
|
|
780
842
|
constructor(extraProps) {
|
|
781
843
|
this.extraProps = extraProps;
|
|
782
844
|
}
|
|
783
|
-
|
|
845
|
+
getWorkspacesList() {
|
|
846
|
+
return operationsByTag.workspaces.getWorkspacesList({ ...this.extraProps });
|
|
847
|
+
}
|
|
848
|
+
createWorkspace({ data }) {
|
|
784
849
|
return operationsByTag.workspaces.createWorkspace({
|
|
785
|
-
body:
|
|
850
|
+
body: data,
|
|
786
851
|
...this.extraProps
|
|
787
852
|
});
|
|
788
853
|
}
|
|
789
|
-
|
|
790
|
-
return operationsByTag.workspaces.getWorkspacesList({ ...this.extraProps });
|
|
791
|
-
}
|
|
792
|
-
getWorkspace(workspaceId) {
|
|
854
|
+
getWorkspace({ workspace }) {
|
|
793
855
|
return operationsByTag.workspaces.getWorkspace({
|
|
794
|
-
pathParams: { workspaceId },
|
|
856
|
+
pathParams: { workspaceId: workspace },
|
|
795
857
|
...this.extraProps
|
|
796
858
|
});
|
|
797
859
|
}
|
|
798
|
-
updateWorkspace(
|
|
860
|
+
updateWorkspace({
|
|
861
|
+
workspace,
|
|
862
|
+
update
|
|
863
|
+
}) {
|
|
799
864
|
return operationsByTag.workspaces.updateWorkspace({
|
|
800
|
-
pathParams: { workspaceId },
|
|
801
|
-
body:
|
|
865
|
+
pathParams: { workspaceId: workspace },
|
|
866
|
+
body: update,
|
|
802
867
|
...this.extraProps
|
|
803
868
|
});
|
|
804
869
|
}
|
|
805
|
-
deleteWorkspace(
|
|
870
|
+
deleteWorkspace({ workspace }) {
|
|
806
871
|
return operationsByTag.workspaces.deleteWorkspace({
|
|
807
|
-
pathParams: { workspaceId },
|
|
872
|
+
pathParams: { workspaceId: workspace },
|
|
808
873
|
...this.extraProps
|
|
809
874
|
});
|
|
810
875
|
}
|
|
811
|
-
getWorkspaceMembersList(
|
|
876
|
+
getWorkspaceMembersList({ workspace }) {
|
|
812
877
|
return operationsByTag.workspaces.getWorkspaceMembersList({
|
|
813
|
-
pathParams: { workspaceId },
|
|
878
|
+
pathParams: { workspaceId: workspace },
|
|
814
879
|
...this.extraProps
|
|
815
880
|
});
|
|
816
881
|
}
|
|
817
|
-
updateWorkspaceMemberRole(
|
|
882
|
+
updateWorkspaceMemberRole({
|
|
883
|
+
workspace,
|
|
884
|
+
user,
|
|
885
|
+
role
|
|
886
|
+
}) {
|
|
818
887
|
return operationsByTag.workspaces.updateWorkspaceMemberRole({
|
|
819
|
-
pathParams: { workspaceId, userId },
|
|
888
|
+
pathParams: { workspaceId: workspace, userId: user },
|
|
820
889
|
body: { role },
|
|
821
890
|
...this.extraProps
|
|
822
891
|
});
|
|
823
892
|
}
|
|
824
|
-
removeWorkspaceMember(
|
|
893
|
+
removeWorkspaceMember({
|
|
894
|
+
workspace,
|
|
895
|
+
user
|
|
896
|
+
}) {
|
|
825
897
|
return operationsByTag.workspaces.removeWorkspaceMember({
|
|
826
|
-
pathParams: { workspaceId, userId },
|
|
898
|
+
pathParams: { workspaceId: workspace, userId: user },
|
|
827
899
|
...this.extraProps
|
|
828
900
|
});
|
|
829
901
|
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
902
|
+
}
|
|
903
|
+
class InvitesApi {
|
|
904
|
+
constructor(extraProps) {
|
|
905
|
+
this.extraProps = extraProps;
|
|
906
|
+
}
|
|
907
|
+
inviteWorkspaceMember({
|
|
908
|
+
workspace,
|
|
909
|
+
email,
|
|
910
|
+
role
|
|
911
|
+
}) {
|
|
912
|
+
return operationsByTag.invites.inviteWorkspaceMember({
|
|
913
|
+
pathParams: { workspaceId: workspace },
|
|
833
914
|
body: { email, role },
|
|
834
915
|
...this.extraProps
|
|
835
916
|
});
|
|
836
917
|
}
|
|
837
|
-
updateWorkspaceMemberInvite(
|
|
838
|
-
|
|
839
|
-
|
|
918
|
+
updateWorkspaceMemberInvite({
|
|
919
|
+
workspace,
|
|
920
|
+
invite,
|
|
921
|
+
role
|
|
922
|
+
}) {
|
|
923
|
+
return operationsByTag.invites.updateWorkspaceMemberInvite({
|
|
924
|
+
pathParams: { workspaceId: workspace, inviteId: invite },
|
|
840
925
|
body: { role },
|
|
841
926
|
...this.extraProps
|
|
842
927
|
});
|
|
843
928
|
}
|
|
844
|
-
cancelWorkspaceMemberInvite(
|
|
845
|
-
|
|
846
|
-
|
|
929
|
+
cancelWorkspaceMemberInvite({
|
|
930
|
+
workspace,
|
|
931
|
+
invite
|
|
932
|
+
}) {
|
|
933
|
+
return operationsByTag.invites.cancelWorkspaceMemberInvite({
|
|
934
|
+
pathParams: { workspaceId: workspace, inviteId: invite },
|
|
847
935
|
...this.extraProps
|
|
848
936
|
});
|
|
849
937
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
938
|
+
acceptWorkspaceMemberInvite({
|
|
939
|
+
workspace,
|
|
940
|
+
key
|
|
941
|
+
}) {
|
|
942
|
+
return operationsByTag.invites.acceptWorkspaceMemberInvite({
|
|
943
|
+
pathParams: { workspaceId: workspace, inviteKey: key },
|
|
853
944
|
...this.extraProps
|
|
854
945
|
});
|
|
855
946
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
947
|
+
resendWorkspaceMemberInvite({
|
|
948
|
+
workspace,
|
|
949
|
+
invite
|
|
950
|
+
}) {
|
|
951
|
+
return operationsByTag.invites.resendWorkspaceMemberInvite({
|
|
952
|
+
pathParams: { workspaceId: workspace, inviteId: invite },
|
|
859
953
|
...this.extraProps
|
|
860
954
|
});
|
|
861
955
|
}
|
|
862
956
|
}
|
|
863
|
-
class
|
|
957
|
+
class BranchApi {
|
|
864
958
|
constructor(extraProps) {
|
|
865
959
|
this.extraProps = extraProps;
|
|
866
960
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
return operationsByTag.database.createDatabase({
|
|
875
|
-
pathParams: { workspace, dbName },
|
|
876
|
-
body: options,
|
|
877
|
-
...this.extraProps
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
deleteDatabase(workspace, dbName) {
|
|
881
|
-
return operationsByTag.database.deleteDatabase({
|
|
882
|
-
pathParams: { workspace, dbName },
|
|
883
|
-
...this.extraProps
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
getDatabaseMetadata(workspace, dbName) {
|
|
887
|
-
return operationsByTag.database.getDatabaseMetadata({
|
|
888
|
-
pathParams: { workspace, dbName },
|
|
889
|
-
...this.extraProps
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
updateDatabaseMetadata(workspace, dbName, options = {}) {
|
|
893
|
-
return operationsByTag.database.updateDatabaseMetadata({
|
|
894
|
-
pathParams: { workspace, dbName },
|
|
895
|
-
body: options,
|
|
896
|
-
...this.extraProps
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
getGitBranchesMapping(workspace, dbName) {
|
|
900
|
-
return operationsByTag.database.getGitBranchesMapping({
|
|
901
|
-
pathParams: { workspace, dbName },
|
|
961
|
+
getBranchList({
|
|
962
|
+
workspace,
|
|
963
|
+
region,
|
|
964
|
+
database
|
|
965
|
+
}) {
|
|
966
|
+
return operationsByTag.branch.getBranchList({
|
|
967
|
+
pathParams: { workspace, region, dbName: database },
|
|
902
968
|
...this.extraProps
|
|
903
969
|
});
|
|
904
970
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
971
|
+
getBranchDetails({
|
|
972
|
+
workspace,
|
|
973
|
+
region,
|
|
974
|
+
database,
|
|
975
|
+
branch
|
|
976
|
+
}) {
|
|
977
|
+
return operationsByTag.branch.getBranchDetails({
|
|
978
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
909
979
|
...this.extraProps
|
|
910
980
|
});
|
|
911
981
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
982
|
+
createBranch({
|
|
983
|
+
workspace,
|
|
984
|
+
region,
|
|
985
|
+
database,
|
|
986
|
+
branch,
|
|
987
|
+
from,
|
|
988
|
+
metadata
|
|
989
|
+
}) {
|
|
990
|
+
return operationsByTag.branch.createBranch({
|
|
991
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
992
|
+
body: { from, metadata },
|
|
916
993
|
...this.extraProps
|
|
917
994
|
});
|
|
918
995
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
996
|
+
deleteBranch({
|
|
997
|
+
workspace,
|
|
998
|
+
region,
|
|
999
|
+
database,
|
|
1000
|
+
branch
|
|
1001
|
+
}) {
|
|
1002
|
+
return operationsByTag.branch.deleteBranch({
|
|
1003
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
923
1004
|
...this.extraProps
|
|
924
1005
|
});
|
|
925
1006
|
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1007
|
+
updateBranchMetadata({
|
|
1008
|
+
workspace,
|
|
1009
|
+
region,
|
|
1010
|
+
database,
|
|
1011
|
+
branch,
|
|
1012
|
+
metadata
|
|
1013
|
+
}) {
|
|
1014
|
+
return operationsByTag.branch.updateBranchMetadata({
|
|
1015
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1016
|
+
body: metadata,
|
|
934
1017
|
...this.extraProps
|
|
935
1018
|
});
|
|
936
1019
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1020
|
+
getBranchMetadata({
|
|
1021
|
+
workspace,
|
|
1022
|
+
region,
|
|
1023
|
+
database,
|
|
1024
|
+
branch
|
|
1025
|
+
}) {
|
|
1026
|
+
return operationsByTag.branch.getBranchMetadata({
|
|
1027
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
940
1028
|
...this.extraProps
|
|
941
1029
|
});
|
|
942
1030
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1031
|
+
getBranchStats({
|
|
1032
|
+
workspace,
|
|
1033
|
+
region,
|
|
1034
|
+
database,
|
|
1035
|
+
branch
|
|
1036
|
+
}) {
|
|
1037
|
+
return operationsByTag.branch.getBranchStats({
|
|
1038
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
948
1039
|
...this.extraProps
|
|
949
1040
|
});
|
|
950
1041
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1042
|
+
getGitBranchesMapping({
|
|
1043
|
+
workspace,
|
|
1044
|
+
region,
|
|
1045
|
+
database
|
|
1046
|
+
}) {
|
|
1047
|
+
return operationsByTag.branch.getGitBranchesMapping({
|
|
1048
|
+
pathParams: { workspace, region, dbName: database },
|
|
954
1049
|
...this.extraProps
|
|
955
1050
|
});
|
|
956
1051
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1052
|
+
addGitBranchesEntry({
|
|
1053
|
+
workspace,
|
|
1054
|
+
region,
|
|
1055
|
+
database,
|
|
1056
|
+
gitBranch,
|
|
1057
|
+
xataBranch
|
|
1058
|
+
}) {
|
|
1059
|
+
return operationsByTag.branch.addGitBranchesEntry({
|
|
1060
|
+
pathParams: { workspace, region, dbName: database },
|
|
1061
|
+
body: { gitBranch, xataBranch },
|
|
961
1062
|
...this.extraProps
|
|
962
1063
|
});
|
|
963
1064
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1065
|
+
removeGitBranchesEntry({
|
|
1066
|
+
workspace,
|
|
1067
|
+
region,
|
|
1068
|
+
database,
|
|
1069
|
+
gitBranch
|
|
1070
|
+
}) {
|
|
1071
|
+
return operationsByTag.branch.removeGitBranchesEntry({
|
|
1072
|
+
pathParams: { workspace, region, dbName: database },
|
|
1073
|
+
queryParams: { gitBranch },
|
|
967
1074
|
...this.extraProps
|
|
968
1075
|
});
|
|
969
1076
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1077
|
+
resolveBranch({
|
|
1078
|
+
workspace,
|
|
1079
|
+
region,
|
|
1080
|
+
database,
|
|
1081
|
+
gitBranch,
|
|
1082
|
+
fallbackBranch
|
|
1083
|
+
}) {
|
|
1084
|
+
return operationsByTag.branch.resolveBranch({
|
|
1085
|
+
pathParams: { workspace, region, dbName: database },
|
|
1086
|
+
queryParams: { gitBranch, fallbackBranch },
|
|
973
1087
|
...this.extraProps
|
|
974
1088
|
});
|
|
975
1089
|
}
|
|
@@ -978,67 +1092,134 @@ class TableApi {
|
|
|
978
1092
|
constructor(extraProps) {
|
|
979
1093
|
this.extraProps = extraProps;
|
|
980
1094
|
}
|
|
981
|
-
createTable(
|
|
1095
|
+
createTable({
|
|
1096
|
+
workspace,
|
|
1097
|
+
region,
|
|
1098
|
+
database,
|
|
1099
|
+
branch,
|
|
1100
|
+
table
|
|
1101
|
+
}) {
|
|
982
1102
|
return operationsByTag.table.createTable({
|
|
983
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1103
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
984
1104
|
...this.extraProps
|
|
985
1105
|
});
|
|
986
1106
|
}
|
|
987
|
-
deleteTable(
|
|
1107
|
+
deleteTable({
|
|
1108
|
+
workspace,
|
|
1109
|
+
region,
|
|
1110
|
+
database,
|
|
1111
|
+
branch,
|
|
1112
|
+
table
|
|
1113
|
+
}) {
|
|
988
1114
|
return operationsByTag.table.deleteTable({
|
|
989
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1115
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
990
1116
|
...this.extraProps
|
|
991
1117
|
});
|
|
992
1118
|
}
|
|
993
|
-
updateTable(
|
|
1119
|
+
updateTable({
|
|
1120
|
+
workspace,
|
|
1121
|
+
region,
|
|
1122
|
+
database,
|
|
1123
|
+
branch,
|
|
1124
|
+
table,
|
|
1125
|
+
update
|
|
1126
|
+
}) {
|
|
994
1127
|
return operationsByTag.table.updateTable({
|
|
995
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
996
|
-
body:
|
|
1128
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1129
|
+
body: update,
|
|
997
1130
|
...this.extraProps
|
|
998
1131
|
});
|
|
999
1132
|
}
|
|
1000
|
-
getTableSchema(
|
|
1133
|
+
getTableSchema({
|
|
1134
|
+
workspace,
|
|
1135
|
+
region,
|
|
1136
|
+
database,
|
|
1137
|
+
branch,
|
|
1138
|
+
table
|
|
1139
|
+
}) {
|
|
1001
1140
|
return operationsByTag.table.getTableSchema({
|
|
1002
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1141
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1003
1142
|
...this.extraProps
|
|
1004
1143
|
});
|
|
1005
1144
|
}
|
|
1006
|
-
setTableSchema(
|
|
1145
|
+
setTableSchema({
|
|
1146
|
+
workspace,
|
|
1147
|
+
region,
|
|
1148
|
+
database,
|
|
1149
|
+
branch,
|
|
1150
|
+
table,
|
|
1151
|
+
schema
|
|
1152
|
+
}) {
|
|
1007
1153
|
return operationsByTag.table.setTableSchema({
|
|
1008
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1009
|
-
body:
|
|
1154
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1155
|
+
body: schema,
|
|
1010
1156
|
...this.extraProps
|
|
1011
1157
|
});
|
|
1012
1158
|
}
|
|
1013
|
-
getTableColumns(
|
|
1159
|
+
getTableColumns({
|
|
1160
|
+
workspace,
|
|
1161
|
+
region,
|
|
1162
|
+
database,
|
|
1163
|
+
branch,
|
|
1164
|
+
table
|
|
1165
|
+
}) {
|
|
1014
1166
|
return operationsByTag.table.getTableColumns({
|
|
1015
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1167
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1016
1168
|
...this.extraProps
|
|
1017
1169
|
});
|
|
1018
1170
|
}
|
|
1019
|
-
addTableColumn(
|
|
1171
|
+
addTableColumn({
|
|
1172
|
+
workspace,
|
|
1173
|
+
region,
|
|
1174
|
+
database,
|
|
1175
|
+
branch,
|
|
1176
|
+
table,
|
|
1177
|
+
column
|
|
1178
|
+
}) {
|
|
1020
1179
|
return operationsByTag.table.addTableColumn({
|
|
1021
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1180
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1022
1181
|
body: column,
|
|
1023
1182
|
...this.extraProps
|
|
1024
1183
|
});
|
|
1025
1184
|
}
|
|
1026
|
-
getColumn(
|
|
1185
|
+
getColumn({
|
|
1186
|
+
workspace,
|
|
1187
|
+
region,
|
|
1188
|
+
database,
|
|
1189
|
+
branch,
|
|
1190
|
+
table,
|
|
1191
|
+
column
|
|
1192
|
+
}) {
|
|
1027
1193
|
return operationsByTag.table.getColumn({
|
|
1028
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName },
|
|
1194
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
|
|
1029
1195
|
...this.extraProps
|
|
1030
1196
|
});
|
|
1031
1197
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1198
|
+
updateColumn({
|
|
1199
|
+
workspace,
|
|
1200
|
+
region,
|
|
1201
|
+
database,
|
|
1202
|
+
branch,
|
|
1203
|
+
table,
|
|
1204
|
+
column,
|
|
1205
|
+
update
|
|
1206
|
+
}) {
|
|
1207
|
+
return operationsByTag.table.updateColumn({
|
|
1208
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
|
|
1209
|
+
body: update,
|
|
1035
1210
|
...this.extraProps
|
|
1036
1211
|
});
|
|
1037
1212
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1213
|
+
deleteColumn({
|
|
1214
|
+
workspace,
|
|
1215
|
+
region,
|
|
1216
|
+
database,
|
|
1217
|
+
branch,
|
|
1218
|
+
table,
|
|
1219
|
+
column
|
|
1220
|
+
}) {
|
|
1221
|
+
return operationsByTag.table.deleteColumn({
|
|
1222
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
|
|
1042
1223
|
...this.extraProps
|
|
1043
1224
|
});
|
|
1044
1225
|
}
|
|
@@ -1047,85 +1228,215 @@ class RecordsApi {
|
|
|
1047
1228
|
constructor(extraProps) {
|
|
1048
1229
|
this.extraProps = extraProps;
|
|
1049
1230
|
}
|
|
1050
|
-
insertRecord(
|
|
1231
|
+
insertRecord({
|
|
1232
|
+
workspace,
|
|
1233
|
+
region,
|
|
1234
|
+
database,
|
|
1235
|
+
branch,
|
|
1236
|
+
table,
|
|
1237
|
+
record,
|
|
1238
|
+
columns
|
|
1239
|
+
}) {
|
|
1051
1240
|
return operationsByTag.records.insertRecord({
|
|
1052
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1053
|
-
queryParams:
|
|
1241
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1242
|
+
queryParams: { columns },
|
|
1054
1243
|
body: record,
|
|
1055
1244
|
...this.extraProps
|
|
1056
1245
|
});
|
|
1057
1246
|
}
|
|
1058
|
-
|
|
1247
|
+
getRecord({
|
|
1248
|
+
workspace,
|
|
1249
|
+
region,
|
|
1250
|
+
database,
|
|
1251
|
+
branch,
|
|
1252
|
+
table,
|
|
1253
|
+
id,
|
|
1254
|
+
columns
|
|
1255
|
+
}) {
|
|
1256
|
+
return operationsByTag.records.getRecord({
|
|
1257
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
|
1258
|
+
queryParams: { columns },
|
|
1259
|
+
...this.extraProps
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
insertRecordWithID({
|
|
1263
|
+
workspace,
|
|
1264
|
+
region,
|
|
1265
|
+
database,
|
|
1266
|
+
branch,
|
|
1267
|
+
table,
|
|
1268
|
+
id,
|
|
1269
|
+
record,
|
|
1270
|
+
columns,
|
|
1271
|
+
createOnly,
|
|
1272
|
+
ifVersion
|
|
1273
|
+
}) {
|
|
1059
1274
|
return operationsByTag.records.insertRecordWithID({
|
|
1060
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
|
|
1061
|
-
queryParams:
|
|
1275
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
|
1276
|
+
queryParams: { columns, createOnly, ifVersion },
|
|
1062
1277
|
body: record,
|
|
1063
1278
|
...this.extraProps
|
|
1064
1279
|
});
|
|
1065
1280
|
}
|
|
1066
|
-
updateRecordWithID(
|
|
1281
|
+
updateRecordWithID({
|
|
1282
|
+
workspace,
|
|
1283
|
+
region,
|
|
1284
|
+
database,
|
|
1285
|
+
branch,
|
|
1286
|
+
table,
|
|
1287
|
+
id,
|
|
1288
|
+
record,
|
|
1289
|
+
columns,
|
|
1290
|
+
ifVersion
|
|
1291
|
+
}) {
|
|
1067
1292
|
return operationsByTag.records.updateRecordWithID({
|
|
1068
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
|
|
1069
|
-
queryParams:
|
|
1293
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
|
1294
|
+
queryParams: { columns, ifVersion },
|
|
1070
1295
|
body: record,
|
|
1071
1296
|
...this.extraProps
|
|
1072
1297
|
});
|
|
1073
1298
|
}
|
|
1074
|
-
upsertRecordWithID(
|
|
1299
|
+
upsertRecordWithID({
|
|
1300
|
+
workspace,
|
|
1301
|
+
region,
|
|
1302
|
+
database,
|
|
1303
|
+
branch,
|
|
1304
|
+
table,
|
|
1305
|
+
id,
|
|
1306
|
+
record,
|
|
1307
|
+
columns,
|
|
1308
|
+
ifVersion
|
|
1309
|
+
}) {
|
|
1075
1310
|
return operationsByTag.records.upsertRecordWithID({
|
|
1076
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
|
|
1077
|
-
queryParams:
|
|
1311
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
|
1312
|
+
queryParams: { columns, ifVersion },
|
|
1078
1313
|
body: record,
|
|
1079
1314
|
...this.extraProps
|
|
1080
1315
|
});
|
|
1081
1316
|
}
|
|
1082
|
-
deleteRecord(
|
|
1317
|
+
deleteRecord({
|
|
1318
|
+
workspace,
|
|
1319
|
+
region,
|
|
1320
|
+
database,
|
|
1321
|
+
branch,
|
|
1322
|
+
table,
|
|
1323
|
+
id,
|
|
1324
|
+
columns
|
|
1325
|
+
}) {
|
|
1083
1326
|
return operationsByTag.records.deleteRecord({
|
|
1084
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
|
|
1085
|
-
queryParams:
|
|
1086
|
-
...this.extraProps
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
getRecord(workspace, database, branch, tableName, recordId, options = {}) {
|
|
1090
|
-
return operationsByTag.records.getRecord({
|
|
1091
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
|
|
1092
|
-
queryParams: options,
|
|
1327
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
|
|
1328
|
+
queryParams: { columns },
|
|
1093
1329
|
...this.extraProps
|
|
1094
1330
|
});
|
|
1095
1331
|
}
|
|
1096
|
-
bulkInsertTableRecords(
|
|
1332
|
+
bulkInsertTableRecords({
|
|
1333
|
+
workspace,
|
|
1334
|
+
region,
|
|
1335
|
+
database,
|
|
1336
|
+
branch,
|
|
1337
|
+
table,
|
|
1338
|
+
records,
|
|
1339
|
+
columns
|
|
1340
|
+
}) {
|
|
1097
1341
|
return operationsByTag.records.bulkInsertTableRecords({
|
|
1098
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1099
|
-
queryParams:
|
|
1342
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1343
|
+
queryParams: { columns },
|
|
1100
1344
|
body: { records },
|
|
1101
1345
|
...this.extraProps
|
|
1102
1346
|
});
|
|
1103
1347
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
...this.extraProps
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
searchTable(workspace, database, branch, tableName, query) {
|
|
1112
|
-
return operationsByTag.records.searchTable({
|
|
1113
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
|
|
1114
|
-
body: query,
|
|
1115
|
-
...this.extraProps
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
searchBranch(workspace, database, branch, query) {
|
|
1119
|
-
return operationsByTag.records.searchBranch({
|
|
1120
|
-
pathParams: { workspace, dbBranchName: `${database}:${branch}` },
|
|
1121
|
-
body: query,
|
|
1122
|
-
...this.extraProps
|
|
1123
|
-
});
|
|
1348
|
+
}
|
|
1349
|
+
class SearchAndFilterApi {
|
|
1350
|
+
constructor(extraProps) {
|
|
1351
|
+
this.extraProps = extraProps;
|
|
1124
1352
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1353
|
+
queryTable({
|
|
1354
|
+
workspace,
|
|
1355
|
+
region,
|
|
1356
|
+
database,
|
|
1357
|
+
branch,
|
|
1358
|
+
table,
|
|
1359
|
+
filter,
|
|
1360
|
+
sort,
|
|
1361
|
+
page,
|
|
1362
|
+
columns,
|
|
1363
|
+
consistency
|
|
1364
|
+
}) {
|
|
1365
|
+
return operationsByTag.searchAndFilter.queryTable({
|
|
1366
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1367
|
+
body: { filter, sort, page, columns, consistency },
|
|
1368
|
+
...this.extraProps
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
searchTable({
|
|
1372
|
+
workspace,
|
|
1373
|
+
region,
|
|
1374
|
+
database,
|
|
1375
|
+
branch,
|
|
1376
|
+
table,
|
|
1377
|
+
query,
|
|
1378
|
+
fuzziness,
|
|
1379
|
+
target,
|
|
1380
|
+
prefix,
|
|
1381
|
+
filter,
|
|
1382
|
+
highlight,
|
|
1383
|
+
boosters
|
|
1384
|
+
}) {
|
|
1385
|
+
return operationsByTag.searchAndFilter.searchTable({
|
|
1386
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1387
|
+
body: { query, fuzziness, target, prefix, filter, highlight, boosters },
|
|
1388
|
+
...this.extraProps
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
searchBranch({
|
|
1392
|
+
workspace,
|
|
1393
|
+
region,
|
|
1394
|
+
database,
|
|
1395
|
+
branch,
|
|
1396
|
+
tables,
|
|
1397
|
+
query,
|
|
1398
|
+
fuzziness,
|
|
1399
|
+
prefix,
|
|
1400
|
+
highlight
|
|
1401
|
+
}) {
|
|
1402
|
+
return operationsByTag.searchAndFilter.searchBranch({
|
|
1403
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1404
|
+
body: { tables, query, fuzziness, prefix, highlight },
|
|
1405
|
+
...this.extraProps
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
summarizeTable({
|
|
1409
|
+
workspace,
|
|
1410
|
+
region,
|
|
1411
|
+
database,
|
|
1412
|
+
branch,
|
|
1413
|
+
table,
|
|
1414
|
+
filter,
|
|
1415
|
+
columns,
|
|
1416
|
+
summaries,
|
|
1417
|
+
sort,
|
|
1418
|
+
summariesFilter,
|
|
1419
|
+
page,
|
|
1420
|
+
consistency
|
|
1421
|
+
}) {
|
|
1422
|
+
return operationsByTag.searchAndFilter.summarizeTable({
|
|
1423
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1424
|
+
body: { filter, columns, summaries, sort, summariesFilter, page, consistency },
|
|
1425
|
+
...this.extraProps
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
aggregateTable({
|
|
1429
|
+
workspace,
|
|
1430
|
+
region,
|
|
1431
|
+
database,
|
|
1432
|
+
branch,
|
|
1433
|
+
table,
|
|
1434
|
+
filter,
|
|
1435
|
+
aggs
|
|
1436
|
+
}) {
|
|
1437
|
+
return operationsByTag.searchAndFilter.aggregateTable({
|
|
1438
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
|
|
1439
|
+
body: { filter, aggs },
|
|
1129
1440
|
...this.extraProps
|
|
1130
1441
|
});
|
|
1131
1442
|
}
|
|
@@ -1134,123 +1445,281 @@ class MigrationRequestsApi {
|
|
|
1134
1445
|
constructor(extraProps) {
|
|
1135
1446
|
this.extraProps = extraProps;
|
|
1136
1447
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1448
|
+
queryMigrationRequests({
|
|
1449
|
+
workspace,
|
|
1450
|
+
region,
|
|
1451
|
+
database,
|
|
1452
|
+
filter,
|
|
1453
|
+
sort,
|
|
1454
|
+
page,
|
|
1455
|
+
columns
|
|
1456
|
+
}) {
|
|
1457
|
+
return operationsByTag.migrationRequests.queryMigrationRequests({
|
|
1458
|
+
pathParams: { workspace, region, dbName: database },
|
|
1459
|
+
body: { filter, sort, page, columns },
|
|
1460
|
+
...this.extraProps
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
createMigrationRequest({
|
|
1464
|
+
workspace,
|
|
1465
|
+
region,
|
|
1466
|
+
database,
|
|
1467
|
+
migration
|
|
1468
|
+
}) {
|
|
1145
1469
|
return operationsByTag.migrationRequests.createMigrationRequest({
|
|
1146
|
-
pathParams: { workspace, dbName: database },
|
|
1147
|
-
body:
|
|
1470
|
+
pathParams: { workspace, region, dbName: database },
|
|
1471
|
+
body: migration,
|
|
1148
1472
|
...this.extraProps
|
|
1149
1473
|
});
|
|
1150
1474
|
}
|
|
1151
|
-
getMigrationRequest(
|
|
1475
|
+
getMigrationRequest({
|
|
1476
|
+
workspace,
|
|
1477
|
+
region,
|
|
1478
|
+
database,
|
|
1479
|
+
migrationRequest
|
|
1480
|
+
}) {
|
|
1152
1481
|
return operationsByTag.migrationRequests.getMigrationRequest({
|
|
1153
|
-
pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
|
|
1482
|
+
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
|
1154
1483
|
...this.extraProps
|
|
1155
1484
|
});
|
|
1156
1485
|
}
|
|
1157
|
-
updateMigrationRequest(
|
|
1486
|
+
updateMigrationRequest({
|
|
1487
|
+
workspace,
|
|
1488
|
+
region,
|
|
1489
|
+
database,
|
|
1490
|
+
migrationRequest,
|
|
1491
|
+
update
|
|
1492
|
+
}) {
|
|
1158
1493
|
return operationsByTag.migrationRequests.updateMigrationRequest({
|
|
1159
|
-
pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
|
|
1160
|
-
body:
|
|
1494
|
+
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
|
1495
|
+
body: update,
|
|
1161
1496
|
...this.extraProps
|
|
1162
1497
|
});
|
|
1163
1498
|
}
|
|
1164
|
-
listMigrationRequestsCommits(
|
|
1499
|
+
listMigrationRequestsCommits({
|
|
1500
|
+
workspace,
|
|
1501
|
+
region,
|
|
1502
|
+
database,
|
|
1503
|
+
migrationRequest,
|
|
1504
|
+
page
|
|
1505
|
+
}) {
|
|
1165
1506
|
return operationsByTag.migrationRequests.listMigrationRequestsCommits({
|
|
1166
|
-
pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
|
|
1167
|
-
body:
|
|
1507
|
+
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
|
1508
|
+
body: { page },
|
|
1168
1509
|
...this.extraProps
|
|
1169
1510
|
});
|
|
1170
1511
|
}
|
|
1171
|
-
compareMigrationRequest(
|
|
1512
|
+
compareMigrationRequest({
|
|
1513
|
+
workspace,
|
|
1514
|
+
region,
|
|
1515
|
+
database,
|
|
1516
|
+
migrationRequest
|
|
1517
|
+
}) {
|
|
1172
1518
|
return operationsByTag.migrationRequests.compareMigrationRequest({
|
|
1173
|
-
pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
|
|
1519
|
+
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
|
1174
1520
|
...this.extraProps
|
|
1175
1521
|
});
|
|
1176
1522
|
}
|
|
1177
|
-
getMigrationRequestIsMerged(
|
|
1523
|
+
getMigrationRequestIsMerged({
|
|
1524
|
+
workspace,
|
|
1525
|
+
region,
|
|
1526
|
+
database,
|
|
1527
|
+
migrationRequest
|
|
1528
|
+
}) {
|
|
1178
1529
|
return operationsByTag.migrationRequests.getMigrationRequestIsMerged({
|
|
1179
|
-
pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
|
|
1530
|
+
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
|
1180
1531
|
...this.extraProps
|
|
1181
1532
|
});
|
|
1182
1533
|
}
|
|
1183
|
-
mergeMigrationRequest(
|
|
1534
|
+
mergeMigrationRequest({
|
|
1535
|
+
workspace,
|
|
1536
|
+
region,
|
|
1537
|
+
database,
|
|
1538
|
+
migrationRequest
|
|
1539
|
+
}) {
|
|
1184
1540
|
return operationsByTag.migrationRequests.mergeMigrationRequest({
|
|
1185
|
-
pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
|
|
1541
|
+
pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
|
|
1186
1542
|
...this.extraProps
|
|
1187
1543
|
});
|
|
1188
1544
|
}
|
|
1189
1545
|
}
|
|
1190
|
-
class
|
|
1546
|
+
class MigrationsApi {
|
|
1191
1547
|
constructor(extraProps) {
|
|
1192
1548
|
this.extraProps = extraProps;
|
|
1193
1549
|
}
|
|
1194
|
-
getBranchMigrationHistory(
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1550
|
+
getBranchMigrationHistory({
|
|
1551
|
+
workspace,
|
|
1552
|
+
region,
|
|
1553
|
+
database,
|
|
1554
|
+
branch,
|
|
1555
|
+
limit,
|
|
1556
|
+
startFrom
|
|
1557
|
+
}) {
|
|
1558
|
+
return operationsByTag.migrations.getBranchMigrationHistory({
|
|
1559
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1560
|
+
body: { limit, startFrom },
|
|
1561
|
+
...this.extraProps
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
getBranchMigrationPlan({
|
|
1565
|
+
workspace,
|
|
1566
|
+
region,
|
|
1567
|
+
database,
|
|
1568
|
+
branch,
|
|
1569
|
+
schema
|
|
1570
|
+
}) {
|
|
1571
|
+
return operationsByTag.migrations.getBranchMigrationPlan({
|
|
1572
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1573
|
+
body: schema,
|
|
1198
1574
|
...this.extraProps
|
|
1199
1575
|
});
|
|
1200
1576
|
}
|
|
1201
|
-
executeBranchMigrationPlan(
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1577
|
+
executeBranchMigrationPlan({
|
|
1578
|
+
workspace,
|
|
1579
|
+
region,
|
|
1580
|
+
database,
|
|
1581
|
+
branch,
|
|
1582
|
+
plan
|
|
1583
|
+
}) {
|
|
1584
|
+
return operationsByTag.migrations.executeBranchMigrationPlan({
|
|
1585
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1586
|
+
body: plan,
|
|
1205
1587
|
...this.extraProps
|
|
1206
1588
|
});
|
|
1207
1589
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1590
|
+
getBranchSchemaHistory({
|
|
1591
|
+
workspace,
|
|
1592
|
+
region,
|
|
1593
|
+
database,
|
|
1594
|
+
branch,
|
|
1595
|
+
page
|
|
1596
|
+
}) {
|
|
1597
|
+
return operationsByTag.migrations.getBranchSchemaHistory({
|
|
1598
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1599
|
+
body: { page },
|
|
1212
1600
|
...this.extraProps
|
|
1213
1601
|
});
|
|
1214
1602
|
}
|
|
1215
|
-
compareBranchWithUserSchema(
|
|
1216
|
-
|
|
1217
|
-
|
|
1603
|
+
compareBranchWithUserSchema({
|
|
1604
|
+
workspace,
|
|
1605
|
+
region,
|
|
1606
|
+
database,
|
|
1607
|
+
branch,
|
|
1608
|
+
schema
|
|
1609
|
+
}) {
|
|
1610
|
+
return operationsByTag.migrations.compareBranchWithUserSchema({
|
|
1611
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1218
1612
|
body: { schema },
|
|
1219
1613
|
...this.extraProps
|
|
1220
1614
|
});
|
|
1221
1615
|
}
|
|
1222
|
-
compareBranchSchemas(
|
|
1223
|
-
|
|
1224
|
-
|
|
1616
|
+
compareBranchSchemas({
|
|
1617
|
+
workspace,
|
|
1618
|
+
region,
|
|
1619
|
+
database,
|
|
1620
|
+
branch,
|
|
1621
|
+
compare,
|
|
1622
|
+
schema
|
|
1623
|
+
}) {
|
|
1624
|
+
return operationsByTag.migrations.compareBranchSchemas({
|
|
1625
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, branchName: compare },
|
|
1225
1626
|
body: { schema },
|
|
1226
1627
|
...this.extraProps
|
|
1227
1628
|
});
|
|
1228
1629
|
}
|
|
1229
|
-
updateBranchSchema(
|
|
1230
|
-
|
|
1231
|
-
|
|
1630
|
+
updateBranchSchema({
|
|
1631
|
+
workspace,
|
|
1632
|
+
region,
|
|
1633
|
+
database,
|
|
1634
|
+
branch,
|
|
1635
|
+
migration
|
|
1636
|
+
}) {
|
|
1637
|
+
return operationsByTag.migrations.updateBranchSchema({
|
|
1638
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1232
1639
|
body: migration,
|
|
1233
1640
|
...this.extraProps
|
|
1234
1641
|
});
|
|
1235
1642
|
}
|
|
1236
|
-
previewBranchSchemaEdit(
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1643
|
+
previewBranchSchemaEdit({
|
|
1644
|
+
workspace,
|
|
1645
|
+
region,
|
|
1646
|
+
database,
|
|
1647
|
+
branch,
|
|
1648
|
+
data
|
|
1649
|
+
}) {
|
|
1650
|
+
return operationsByTag.migrations.previewBranchSchemaEdit({
|
|
1651
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1652
|
+
body: data,
|
|
1240
1653
|
...this.extraProps
|
|
1241
1654
|
});
|
|
1242
1655
|
}
|
|
1243
|
-
applyBranchSchemaEdit(
|
|
1244
|
-
|
|
1245
|
-
|
|
1656
|
+
applyBranchSchemaEdit({
|
|
1657
|
+
workspace,
|
|
1658
|
+
region,
|
|
1659
|
+
database,
|
|
1660
|
+
branch,
|
|
1661
|
+
edits
|
|
1662
|
+
}) {
|
|
1663
|
+
return operationsByTag.migrations.applyBranchSchemaEdit({
|
|
1664
|
+
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
|
1246
1665
|
body: { edits },
|
|
1247
1666
|
...this.extraProps
|
|
1248
1667
|
});
|
|
1249
1668
|
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1669
|
+
}
|
|
1670
|
+
class DatabaseApi {
|
|
1671
|
+
constructor(extraProps) {
|
|
1672
|
+
this.extraProps = extraProps;
|
|
1673
|
+
}
|
|
1674
|
+
getDatabaseList({ workspace }) {
|
|
1675
|
+
return operationsByTag.databases.getDatabaseList({
|
|
1676
|
+
pathParams: { workspaceId: workspace },
|
|
1677
|
+
...this.extraProps
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
createDatabase({
|
|
1681
|
+
workspace,
|
|
1682
|
+
database,
|
|
1683
|
+
data
|
|
1684
|
+
}) {
|
|
1685
|
+
return operationsByTag.databases.createDatabase({
|
|
1686
|
+
pathParams: { workspaceId: workspace, dbName: database },
|
|
1687
|
+
body: data,
|
|
1688
|
+
...this.extraProps
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
deleteDatabase({
|
|
1692
|
+
workspace,
|
|
1693
|
+
database
|
|
1694
|
+
}) {
|
|
1695
|
+
return operationsByTag.databases.deleteDatabase({
|
|
1696
|
+
pathParams: { workspaceId: workspace, dbName: database },
|
|
1697
|
+
...this.extraProps
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
getDatabaseMetadata({
|
|
1701
|
+
workspace,
|
|
1702
|
+
database
|
|
1703
|
+
}) {
|
|
1704
|
+
return operationsByTag.databases.getDatabaseMetadata({
|
|
1705
|
+
pathParams: { workspaceId: workspace, dbName: database },
|
|
1706
|
+
...this.extraProps
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
updateDatabaseMetadata({
|
|
1710
|
+
workspace,
|
|
1711
|
+
database,
|
|
1712
|
+
metadata
|
|
1713
|
+
}) {
|
|
1714
|
+
return operationsByTag.databases.updateDatabaseMetadata({
|
|
1715
|
+
pathParams: { workspaceId: workspace, dbName: database },
|
|
1716
|
+
body: metadata,
|
|
1717
|
+
...this.extraProps
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
listRegions({ workspace }) {
|
|
1721
|
+
return operationsByTag.databases.listRegions({
|
|
1722
|
+
pathParams: { workspaceId: workspace },
|
|
1254
1723
|
...this.extraProps
|
|
1255
1724
|
});
|
|
1256
1725
|
}
|
|
@@ -1266,6 +1735,20 @@ class XataApiPlugin {
|
|
|
1266
1735
|
class XataPlugin {
|
|
1267
1736
|
}
|
|
1268
1737
|
|
|
1738
|
+
function generateUUID() {
|
|
1739
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
1740
|
+
const r = Math.random() * 16 | 0, v = c == "x" ? r : r & 3 | 8;
|
|
1741
|
+
return v.toString(16);
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
function cleanFilter(filter) {
|
|
1746
|
+
if (!filter)
|
|
1747
|
+
return void 0;
|
|
1748
|
+
const values = Object.values(filter).filter(Boolean).filter((value) => Array.isArray(value) ? value.length > 0 : true);
|
|
1749
|
+
return values.length > 0 ? filter : void 0;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1269
1752
|
var __accessCheck$6 = (obj, member, msg) => {
|
|
1270
1753
|
if (!member.has(obj))
|
|
1271
1754
|
throw TypeError("Cannot " + msg);
|
|
@@ -1298,11 +1781,11 @@ class Page {
|
|
|
1298
1781
|
async previousPage(size, offset) {
|
|
1299
1782
|
return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, before: this.meta.page.cursor } });
|
|
1300
1783
|
}
|
|
1301
|
-
async
|
|
1302
|
-
return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset,
|
|
1784
|
+
async startPage(size, offset) {
|
|
1785
|
+
return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, start: this.meta.page.cursor } });
|
|
1303
1786
|
}
|
|
1304
|
-
async
|
|
1305
|
-
return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset,
|
|
1787
|
+
async endPage(size, offset) {
|
|
1788
|
+
return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, end: this.meta.page.cursor } });
|
|
1306
1789
|
}
|
|
1307
1790
|
hasNextPage() {
|
|
1308
1791
|
return this.meta.page.more;
|
|
@@ -1314,7 +1797,7 @@ const PAGINATION_DEFAULT_SIZE = 20;
|
|
|
1314
1797
|
const PAGINATION_MAX_OFFSET = 800;
|
|
1315
1798
|
const PAGINATION_DEFAULT_OFFSET = 0;
|
|
1316
1799
|
function isCursorPaginationOptions(options) {
|
|
1317
|
-
return isDefined(options) && (isDefined(options.
|
|
1800
|
+
return isDefined(options) && (isDefined(options.start) || isDefined(options.end) || isDefined(options.after) || isDefined(options.before));
|
|
1318
1801
|
}
|
|
1319
1802
|
const _RecordArray = class extends Array {
|
|
1320
1803
|
constructor(...args) {
|
|
@@ -1346,12 +1829,12 @@ const _RecordArray = class extends Array {
|
|
|
1346
1829
|
const newPage = await __privateGet$6(this, _page).previousPage(size, offset);
|
|
1347
1830
|
return new _RecordArray(newPage);
|
|
1348
1831
|
}
|
|
1349
|
-
async
|
|
1350
|
-
const newPage = await __privateGet$6(this, _page).
|
|
1832
|
+
async startPage(size, offset) {
|
|
1833
|
+
const newPage = await __privateGet$6(this, _page).startPage(size, offset);
|
|
1351
1834
|
return new _RecordArray(newPage);
|
|
1352
1835
|
}
|
|
1353
|
-
async
|
|
1354
|
-
const newPage = await __privateGet$6(this, _page).
|
|
1836
|
+
async endPage(size, offset) {
|
|
1837
|
+
const newPage = await __privateGet$6(this, _page).endPage(size, offset);
|
|
1355
1838
|
return new _RecordArray(newPage);
|
|
1356
1839
|
}
|
|
1357
1840
|
hasNextPage() {
|
|
@@ -1405,7 +1888,7 @@ const _Query = class {
|
|
|
1405
1888
|
__privateGet$5(this, _data).filter.$not = data.filter?.$not ?? parent?.filter?.$not;
|
|
1406
1889
|
__privateGet$5(this, _data).filter.$none = data.filter?.$none ?? parent?.filter?.$none;
|
|
1407
1890
|
__privateGet$5(this, _data).sort = data.sort ?? parent?.sort;
|
|
1408
|
-
__privateGet$5(this, _data).columns = data.columns ?? parent?.columns
|
|
1891
|
+
__privateGet$5(this, _data).columns = data.columns ?? parent?.columns;
|
|
1409
1892
|
__privateGet$5(this, _data).pagination = data.pagination ?? parent?.pagination;
|
|
1410
1893
|
__privateGet$5(this, _data).cache = data.cache ?? parent?.cache;
|
|
1411
1894
|
this.any = this.any.bind(this);
|
|
@@ -1521,19 +2004,29 @@ const _Query = class {
|
|
|
1521
2004
|
throw new Error("No results found.");
|
|
1522
2005
|
return records[0];
|
|
1523
2006
|
}
|
|
2007
|
+
async summarize(params = {}) {
|
|
2008
|
+
const { summaries, summariesFilter, ...options } = params;
|
|
2009
|
+
const query = new _Query(
|
|
2010
|
+
__privateGet$5(this, _repository),
|
|
2011
|
+
__privateGet$5(this, _table$1),
|
|
2012
|
+
options,
|
|
2013
|
+
__privateGet$5(this, _data)
|
|
2014
|
+
);
|
|
2015
|
+
return __privateGet$5(this, _repository).summarizeTable(query, summaries, summariesFilter);
|
|
2016
|
+
}
|
|
1524
2017
|
cache(ttl) {
|
|
1525
2018
|
return new _Query(__privateGet$5(this, _repository), __privateGet$5(this, _table$1), { cache: ttl }, __privateGet$5(this, _data));
|
|
1526
2019
|
}
|
|
1527
2020
|
nextPage(size, offset) {
|
|
1528
|
-
return this.
|
|
2021
|
+
return this.startPage(size, offset);
|
|
1529
2022
|
}
|
|
1530
2023
|
previousPage(size, offset) {
|
|
1531
|
-
return this.
|
|
2024
|
+
return this.startPage(size, offset);
|
|
1532
2025
|
}
|
|
1533
|
-
|
|
2026
|
+
startPage(size, offset) {
|
|
1534
2027
|
return this.getPaginated({ pagination: { size, offset } });
|
|
1535
2028
|
}
|
|
1536
|
-
|
|
2029
|
+
endPage(size, offset) {
|
|
1537
2030
|
return this.getPaginated({ pagination: { size, offset, before: "end" } });
|
|
1538
2031
|
}
|
|
1539
2032
|
hasNextPage() {
|
|
@@ -1557,7 +2050,7 @@ cleanFilterConstraint_fn = function(column, value) {
|
|
|
1557
2050
|
};
|
|
1558
2051
|
function cleanParent(data, parent) {
|
|
1559
2052
|
if (isCursorPaginationOptions(data.pagination)) {
|
|
1560
|
-
return { ...parent,
|
|
2053
|
+
return { ...parent, sort: void 0, filter: void 0 };
|
|
1561
2054
|
}
|
|
1562
2055
|
return parent;
|
|
1563
2056
|
}
|
|
@@ -1642,10 +2135,13 @@ class RestRepository extends Query {
|
|
|
1642
2135
|
__privateAdd$4(this, _schemaTables$2, void 0);
|
|
1643
2136
|
__privateAdd$4(this, _trace, void 0);
|
|
1644
2137
|
__privateSet$4(this, _table, options.table);
|
|
1645
|
-
__privateSet$4(this, _getFetchProps, options.pluginOptions.getFetchProps);
|
|
1646
2138
|
__privateSet$4(this, _db, options.db);
|
|
1647
2139
|
__privateSet$4(this, _cache, options.pluginOptions.cache);
|
|
1648
2140
|
__privateSet$4(this, _schemaTables$2, options.schemaTables);
|
|
2141
|
+
__privateSet$4(this, _getFetchProps, async () => {
|
|
2142
|
+
const props = await options.pluginOptions.getFetchProps();
|
|
2143
|
+
return { ...props, sessionID: generateUUID() };
|
|
2144
|
+
});
|
|
1649
2145
|
const trace = options.pluginOptions.trace ?? defaultTrace;
|
|
1650
2146
|
__privateSet$4(this, _trace, async (name, fn, options2 = {}) => {
|
|
1651
2147
|
return trace(name, fn, {
|
|
@@ -1656,8 +2152,9 @@ class RestRepository extends Query {
|
|
|
1656
2152
|
});
|
|
1657
2153
|
});
|
|
1658
2154
|
}
|
|
1659
|
-
async create(a, b, c) {
|
|
2155
|
+
async create(a, b, c, d) {
|
|
1660
2156
|
return __privateGet$4(this, _trace).call(this, "create", async () => {
|
|
2157
|
+
const ifVersion = parseIfVersion(b, c, d);
|
|
1661
2158
|
if (Array.isArray(a)) {
|
|
1662
2159
|
if (a.length === 0)
|
|
1663
2160
|
return [];
|
|
@@ -1668,13 +2165,13 @@ class RestRepository extends Query {
|
|
|
1668
2165
|
if (a === "")
|
|
1669
2166
|
throw new Error("The id can't be empty");
|
|
1670
2167
|
const columns = isStringArray(c) ? c : void 0;
|
|
1671
|
-
return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns);
|
|
2168
|
+
return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns, { createOnly: true, ifVersion });
|
|
1672
2169
|
}
|
|
1673
2170
|
if (isObject(a) && isString(a.id)) {
|
|
1674
2171
|
if (a.id === "")
|
|
1675
2172
|
throw new Error("The id can't be empty");
|
|
1676
2173
|
const columns = isStringArray(b) ? b : void 0;
|
|
1677
|
-
return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns);
|
|
2174
|
+
return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns, { createOnly: true, ifVersion });
|
|
1678
2175
|
}
|
|
1679
2176
|
if (isObject(a)) {
|
|
1680
2177
|
const columns = isStringArray(b) ? b : void 0;
|
|
@@ -1705,6 +2202,7 @@ class RestRepository extends Query {
|
|
|
1705
2202
|
pathParams: {
|
|
1706
2203
|
workspace: "{workspaceId}",
|
|
1707
2204
|
dbBranchName: "{dbBranch}",
|
|
2205
|
+
region: "{region}",
|
|
1708
2206
|
tableName: __privateGet$4(this, _table),
|
|
1709
2207
|
recordId: id
|
|
1710
2208
|
},
|
|
@@ -1742,8 +2240,9 @@ class RestRepository extends Query {
|
|
|
1742
2240
|
return result;
|
|
1743
2241
|
});
|
|
1744
2242
|
}
|
|
1745
|
-
async update(a, b, c) {
|
|
2243
|
+
async update(a, b, c, d) {
|
|
1746
2244
|
return __privateGet$4(this, _trace).call(this, "update", async () => {
|
|
2245
|
+
const ifVersion = parseIfVersion(b, c, d);
|
|
1747
2246
|
if (Array.isArray(a)) {
|
|
1748
2247
|
if (a.length === 0)
|
|
1749
2248
|
return [];
|
|
@@ -1755,18 +2254,18 @@ class RestRepository extends Query {
|
|
|
1755
2254
|
}
|
|
1756
2255
|
if (isString(a) && isObject(b)) {
|
|
1757
2256
|
const columns = isStringArray(c) ? c : void 0;
|
|
1758
|
-
return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns);
|
|
2257
|
+
return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns, { ifVersion });
|
|
1759
2258
|
}
|
|
1760
2259
|
if (isObject(a) && isString(a.id)) {
|
|
1761
2260
|
const columns = isStringArray(b) ? b : void 0;
|
|
1762
|
-
return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns);
|
|
2261
|
+
return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
|
|
1763
2262
|
}
|
|
1764
2263
|
throw new Error("Invalid arguments for update method");
|
|
1765
2264
|
});
|
|
1766
2265
|
}
|
|
1767
|
-
async updateOrThrow(a, b, c) {
|
|
2266
|
+
async updateOrThrow(a, b, c, d) {
|
|
1768
2267
|
return __privateGet$4(this, _trace).call(this, "updateOrThrow", async () => {
|
|
1769
|
-
const result = await this.update(a, b, c);
|
|
2268
|
+
const result = await this.update(a, b, c, d);
|
|
1770
2269
|
if (Array.isArray(result)) {
|
|
1771
2270
|
const missingIds = compact(
|
|
1772
2271
|
a.filter((_item, index) => result[index] === null).map((item) => extractId(item))
|
|
@@ -1783,8 +2282,9 @@ class RestRepository extends Query {
|
|
|
1783
2282
|
return result;
|
|
1784
2283
|
});
|
|
1785
2284
|
}
|
|
1786
|
-
async createOrUpdate(a, b, c) {
|
|
2285
|
+
async createOrUpdate(a, b, c, d) {
|
|
1787
2286
|
return __privateGet$4(this, _trace).call(this, "createOrUpdate", async () => {
|
|
2287
|
+
const ifVersion = parseIfVersion(b, c, d);
|
|
1788
2288
|
if (Array.isArray(a)) {
|
|
1789
2289
|
if (a.length === 0)
|
|
1790
2290
|
return [];
|
|
@@ -1796,15 +2296,35 @@ class RestRepository extends Query {
|
|
|
1796
2296
|
}
|
|
1797
2297
|
if (isString(a) && isObject(b)) {
|
|
1798
2298
|
const columns = isStringArray(c) ? c : void 0;
|
|
1799
|
-
return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a, b, columns);
|
|
2299
|
+
return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a, b, columns, { ifVersion });
|
|
1800
2300
|
}
|
|
1801
2301
|
if (isObject(a) && isString(a.id)) {
|
|
1802
2302
|
const columns = isStringArray(c) ? c : void 0;
|
|
1803
|
-
return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns);
|
|
2303
|
+
return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
|
|
1804
2304
|
}
|
|
1805
2305
|
throw new Error("Invalid arguments for createOrUpdate method");
|
|
1806
2306
|
});
|
|
1807
2307
|
}
|
|
2308
|
+
async createOrReplace(a, b, c, d) {
|
|
2309
|
+
return __privateGet$4(this, _trace).call(this, "createOrReplace", async () => {
|
|
2310
|
+
const ifVersion = parseIfVersion(b, c, d);
|
|
2311
|
+
if (Array.isArray(a)) {
|
|
2312
|
+
if (a.length === 0)
|
|
2313
|
+
return [];
|
|
2314
|
+
const columns = isStringArray(b) ? b : ["*"];
|
|
2315
|
+
return __privateMethod$2(this, _bulkInsertTableRecords, bulkInsertTableRecords_fn).call(this, a, columns);
|
|
2316
|
+
}
|
|
2317
|
+
if (isString(a) && isObject(b)) {
|
|
2318
|
+
const columns = isStringArray(c) ? c : void 0;
|
|
2319
|
+
return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns, { createOnly: false, ifVersion });
|
|
2320
|
+
}
|
|
2321
|
+
if (isObject(a) && isString(a.id)) {
|
|
2322
|
+
const columns = isStringArray(c) ? c : void 0;
|
|
2323
|
+
return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns, { createOnly: false, ifVersion });
|
|
2324
|
+
}
|
|
2325
|
+
throw new Error("Invalid arguments for createOrReplace method");
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
1808
2328
|
async delete(a, b) {
|
|
1809
2329
|
return __privateGet$4(this, _trace).call(this, "delete", async () => {
|
|
1810
2330
|
if (Array.isArray(a)) {
|
|
@@ -1846,7 +2366,12 @@ class RestRepository extends Query {
|
|
|
1846
2366
|
return __privateGet$4(this, _trace).call(this, "search", async () => {
|
|
1847
2367
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1848
2368
|
const { records } = await searchTable({
|
|
1849
|
-
pathParams: {
|
|
2369
|
+
pathParams: {
|
|
2370
|
+
workspace: "{workspaceId}",
|
|
2371
|
+
dbBranchName: "{dbBranch}",
|
|
2372
|
+
region: "{region}",
|
|
2373
|
+
tableName: __privateGet$4(this, _table)
|
|
2374
|
+
},
|
|
1850
2375
|
body: {
|
|
1851
2376
|
query,
|
|
1852
2377
|
fuzziness: options.fuzziness,
|
|
@@ -1861,22 +2386,42 @@ class RestRepository extends Query {
|
|
|
1861
2386
|
return records.map((item) => initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), item, ["*"]));
|
|
1862
2387
|
});
|
|
1863
2388
|
}
|
|
2389
|
+
async aggregate(aggs, filter) {
|
|
2390
|
+
return __privateGet$4(this, _trace).call(this, "aggregate", async () => {
|
|
2391
|
+
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
2392
|
+
const result = await aggregateTable({
|
|
2393
|
+
pathParams: {
|
|
2394
|
+
workspace: "{workspaceId}",
|
|
2395
|
+
dbBranchName: "{dbBranch}",
|
|
2396
|
+
region: "{region}",
|
|
2397
|
+
tableName: __privateGet$4(this, _table)
|
|
2398
|
+
},
|
|
2399
|
+
body: { aggs, filter },
|
|
2400
|
+
...fetchProps
|
|
2401
|
+
});
|
|
2402
|
+
return result;
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
1864
2405
|
async query(query) {
|
|
1865
2406
|
return __privateGet$4(this, _trace).call(this, "query", async () => {
|
|
1866
2407
|
const cacheQuery = await __privateMethod$2(this, _getCacheQuery, getCacheQuery_fn).call(this, query);
|
|
1867
2408
|
if (cacheQuery)
|
|
1868
2409
|
return new Page(query, cacheQuery.meta, cacheQuery.records);
|
|
1869
2410
|
const data = query.getQueryOptions();
|
|
1870
|
-
const body = {
|
|
1871
|
-
filter: cleanFilter(data.filter),
|
|
1872
|
-
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
|
1873
|
-
page: data.pagination,
|
|
1874
|
-
columns: data.columns
|
|
1875
|
-
};
|
|
1876
2411
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1877
2412
|
const { meta, records: objects } = await queryTable({
|
|
1878
|
-
pathParams: {
|
|
1879
|
-
|
|
2413
|
+
pathParams: {
|
|
2414
|
+
workspace: "{workspaceId}",
|
|
2415
|
+
dbBranchName: "{dbBranch}",
|
|
2416
|
+
region: "{region}",
|
|
2417
|
+
tableName: __privateGet$4(this, _table)
|
|
2418
|
+
},
|
|
2419
|
+
body: {
|
|
2420
|
+
filter: cleanFilter(data.filter),
|
|
2421
|
+
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
|
2422
|
+
page: data.pagination,
|
|
2423
|
+
columns: data.columns ?? ["*"]
|
|
2424
|
+
},
|
|
1880
2425
|
...fetchProps
|
|
1881
2426
|
});
|
|
1882
2427
|
const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
|
|
@@ -1887,6 +2432,30 @@ class RestRepository extends Query {
|
|
|
1887
2432
|
return new Page(query, meta, records);
|
|
1888
2433
|
});
|
|
1889
2434
|
}
|
|
2435
|
+
async summarizeTable(query, summaries, summariesFilter) {
|
|
2436
|
+
return __privateGet$4(this, _trace).call(this, "summarize", async () => {
|
|
2437
|
+
const data = query.getQueryOptions();
|
|
2438
|
+
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
2439
|
+
const result = await summarizeTable({
|
|
2440
|
+
pathParams: {
|
|
2441
|
+
workspace: "{workspaceId}",
|
|
2442
|
+
dbBranchName: "{dbBranch}",
|
|
2443
|
+
region: "{region}",
|
|
2444
|
+
tableName: __privateGet$4(this, _table)
|
|
2445
|
+
},
|
|
2446
|
+
body: {
|
|
2447
|
+
filter: cleanFilter(data.filter),
|
|
2448
|
+
sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
|
|
2449
|
+
columns: data.columns,
|
|
2450
|
+
page: data.pagination?.size !== void 0 ? { size: data.pagination?.size } : void 0,
|
|
2451
|
+
summaries,
|
|
2452
|
+
summariesFilter
|
|
2453
|
+
},
|
|
2454
|
+
...fetchProps
|
|
2455
|
+
});
|
|
2456
|
+
return result;
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
1890
2459
|
}
|
|
1891
2460
|
_table = new WeakMap();
|
|
1892
2461
|
_getFetchProps = new WeakMap();
|
|
@@ -1902,6 +2471,7 @@ insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
|
|
|
1902
2471
|
pathParams: {
|
|
1903
2472
|
workspace: "{workspaceId}",
|
|
1904
2473
|
dbBranchName: "{dbBranch}",
|
|
2474
|
+
region: "{region}",
|
|
1905
2475
|
tableName: __privateGet$4(this, _table)
|
|
1906
2476
|
},
|
|
1907
2477
|
queryParams: { columns },
|
|
@@ -1912,18 +2482,19 @@ insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
|
|
|
1912
2482
|
return initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), response, columns);
|
|
1913
2483
|
};
|
|
1914
2484
|
_insertRecordWithId = new WeakSet();
|
|
1915
|
-
insertRecordWithId_fn = async function(recordId, object, columns = ["*"]) {
|
|
2485
|
+
insertRecordWithId_fn = async function(recordId, object, columns = ["*"], { createOnly, ifVersion }) {
|
|
1916
2486
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1917
2487
|
const record = transformObjectLinks(object);
|
|
1918
2488
|
const response = await insertRecordWithID({
|
|
1919
2489
|
pathParams: {
|
|
1920
2490
|
workspace: "{workspaceId}",
|
|
1921
2491
|
dbBranchName: "{dbBranch}",
|
|
2492
|
+
region: "{region}",
|
|
1922
2493
|
tableName: __privateGet$4(this, _table),
|
|
1923
2494
|
recordId
|
|
1924
2495
|
},
|
|
1925
2496
|
body: record,
|
|
1926
|
-
queryParams: { createOnly
|
|
2497
|
+
queryParams: { createOnly, columns, ifVersion },
|
|
1927
2498
|
...fetchProps
|
|
1928
2499
|
});
|
|
1929
2500
|
const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
|
|
@@ -1934,7 +2505,12 @@ bulkInsertTableRecords_fn = async function(objects, columns = ["*"]) {
|
|
|
1934
2505
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1935
2506
|
const records = objects.map((object) => transformObjectLinks(object));
|
|
1936
2507
|
const response = await bulkInsertTableRecords({
|
|
1937
|
-
pathParams: {
|
|
2508
|
+
pathParams: {
|
|
2509
|
+
workspace: "{workspaceId}",
|
|
2510
|
+
dbBranchName: "{dbBranch}",
|
|
2511
|
+
region: "{region}",
|
|
2512
|
+
tableName: __privateGet$4(this, _table)
|
|
2513
|
+
},
|
|
1938
2514
|
queryParams: { columns },
|
|
1939
2515
|
body: { records },
|
|
1940
2516
|
...fetchProps
|
|
@@ -1946,13 +2522,19 @@ bulkInsertTableRecords_fn = async function(objects, columns = ["*"]) {
|
|
|
1946
2522
|
return response.records?.map((item) => initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), item, columns));
|
|
1947
2523
|
};
|
|
1948
2524
|
_updateRecordWithID = new WeakSet();
|
|
1949
|
-
updateRecordWithID_fn = async function(recordId, object, columns = ["*"]) {
|
|
2525
|
+
updateRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVersion }) {
|
|
1950
2526
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1951
2527
|
const record = transformObjectLinks(object);
|
|
1952
2528
|
try {
|
|
1953
2529
|
const response = await updateRecordWithID({
|
|
1954
|
-
pathParams: {
|
|
1955
|
-
|
|
2530
|
+
pathParams: {
|
|
2531
|
+
workspace: "{workspaceId}",
|
|
2532
|
+
dbBranchName: "{dbBranch}",
|
|
2533
|
+
region: "{region}",
|
|
2534
|
+
tableName: __privateGet$4(this, _table),
|
|
2535
|
+
recordId
|
|
2536
|
+
},
|
|
2537
|
+
queryParams: { columns, ifVersion },
|
|
1956
2538
|
body: record,
|
|
1957
2539
|
...fetchProps
|
|
1958
2540
|
});
|
|
@@ -1966,11 +2548,17 @@ updateRecordWithID_fn = async function(recordId, object, columns = ["*"]) {
|
|
|
1966
2548
|
}
|
|
1967
2549
|
};
|
|
1968
2550
|
_upsertRecordWithID = new WeakSet();
|
|
1969
|
-
upsertRecordWithID_fn = async function(recordId, object, columns = ["*"]) {
|
|
2551
|
+
upsertRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVersion }) {
|
|
1970
2552
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1971
2553
|
const response = await upsertRecordWithID({
|
|
1972
|
-
pathParams: {
|
|
1973
|
-
|
|
2554
|
+
pathParams: {
|
|
2555
|
+
workspace: "{workspaceId}",
|
|
2556
|
+
dbBranchName: "{dbBranch}",
|
|
2557
|
+
region: "{region}",
|
|
2558
|
+
tableName: __privateGet$4(this, _table),
|
|
2559
|
+
recordId
|
|
2560
|
+
},
|
|
2561
|
+
queryParams: { columns, ifVersion },
|
|
1974
2562
|
body: object,
|
|
1975
2563
|
...fetchProps
|
|
1976
2564
|
});
|
|
@@ -1982,7 +2570,13 @@ deleteRecord_fn = async function(recordId, columns = ["*"]) {
|
|
|
1982
2570
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
1983
2571
|
try {
|
|
1984
2572
|
const response = await deleteRecord({
|
|
1985
|
-
pathParams: {
|
|
2573
|
+
pathParams: {
|
|
2574
|
+
workspace: "{workspaceId}",
|
|
2575
|
+
dbBranchName: "{dbBranch}",
|
|
2576
|
+
region: "{region}",
|
|
2577
|
+
tableName: __privateGet$4(this, _table),
|
|
2578
|
+
recordId
|
|
2579
|
+
},
|
|
1986
2580
|
queryParams: { columns },
|
|
1987
2581
|
...fetchProps
|
|
1988
2582
|
});
|
|
@@ -2017,7 +2611,7 @@ getSchemaTables_fn$1 = async function() {
|
|
|
2017
2611
|
return __privateGet$4(this, _schemaTables$2);
|
|
2018
2612
|
const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
|
|
2019
2613
|
const { schema } = await getBranchDetails({
|
|
2020
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
|
|
2614
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
|
2021
2615
|
...fetchProps
|
|
2022
2616
|
});
|
|
2023
2617
|
__privateSet$4(this, _schemaTables$2, schema.tables);
|
|
@@ -2083,8 +2677,15 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
|
2083
2677
|
result.read = function(columns2) {
|
|
2084
2678
|
return db[table].read(result["id"], columns2);
|
|
2085
2679
|
};
|
|
2086
|
-
result.update = function(data,
|
|
2087
|
-
|
|
2680
|
+
result.update = function(data, b, c) {
|
|
2681
|
+
const columns2 = isStringArray(b) ? b : ["*"];
|
|
2682
|
+
const ifVersion = parseIfVersion(b, c);
|
|
2683
|
+
return db[table].update(result["id"], data, columns2, { ifVersion });
|
|
2684
|
+
};
|
|
2685
|
+
result.replace = function(data, b, c) {
|
|
2686
|
+
const columns2 = isStringArray(b) ? b : ["*"];
|
|
2687
|
+
const ifVersion = parseIfVersion(b, c);
|
|
2688
|
+
return db[table].createOrReplace(result["id"], data, columns2, { ifVersion });
|
|
2088
2689
|
};
|
|
2089
2690
|
result.delete = function() {
|
|
2090
2691
|
return db[table].delete(result["id"]);
|
|
@@ -2092,7 +2693,7 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
|
2092
2693
|
result.getMetadata = function() {
|
|
2093
2694
|
return xata;
|
|
2094
2695
|
};
|
|
2095
|
-
for (const prop of ["read", "update", "delete", "getMetadata"]) {
|
|
2696
|
+
for (const prop of ["read", "update", "replace", "delete", "getMetadata"]) {
|
|
2096
2697
|
Object.defineProperty(result, prop, { enumerable: false });
|
|
2097
2698
|
}
|
|
2098
2699
|
Object.freeze(result);
|
|
@@ -2108,12 +2709,6 @@ function extractId(value) {
|
|
|
2108
2709
|
return value.id;
|
|
2109
2710
|
return void 0;
|
|
2110
2711
|
}
|
|
2111
|
-
function cleanFilter(filter) {
|
|
2112
|
-
if (!filter)
|
|
2113
|
-
return void 0;
|
|
2114
|
-
const values = Object.values(filter).filter(Boolean).filter((value) => Array.isArray(value) ? value.length > 0 : true);
|
|
2115
|
-
return values.length > 0 ? filter : void 0;
|
|
2116
|
-
}
|
|
2117
2712
|
function isValidColumn(columns, column) {
|
|
2118
2713
|
if (columns.includes("*"))
|
|
2119
2714
|
return true;
|
|
@@ -2123,6 +2718,14 @@ function isValidColumn(columns, column) {
|
|
|
2123
2718
|
}
|
|
2124
2719
|
return columns.includes(column.name);
|
|
2125
2720
|
}
|
|
2721
|
+
function parseIfVersion(...args) {
|
|
2722
|
+
for (const arg of args) {
|
|
2723
|
+
if (isObject(arg) && isNumber(arg.ifVersion)) {
|
|
2724
|
+
return arg.ifVersion;
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
return void 0;
|
|
2728
|
+
}
|
|
2126
2729
|
|
|
2127
2730
|
var __accessCheck$3 = (obj, member, msg) => {
|
|
2128
2731
|
if (!member.has(obj))
|
|
@@ -2310,7 +2913,7 @@ search_fn = async function(query, options, getFetchProps) {
|
|
|
2310
2913
|
const fetchProps = await getFetchProps();
|
|
2311
2914
|
const { tables, fuzziness, highlight, prefix } = options ?? {};
|
|
2312
2915
|
const { records } = await searchBranch({
|
|
2313
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
|
|
2916
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
|
2314
2917
|
body: { tables, query, fuzziness, prefix, highlight },
|
|
2315
2918
|
...fetchProps
|
|
2316
2919
|
});
|
|
@@ -2322,7 +2925,7 @@ getSchemaTables_fn = async function(getFetchProps) {
|
|
|
2322
2925
|
return __privateGet$1(this, _schemaTables);
|
|
2323
2926
|
const fetchProps = await getFetchProps();
|
|
2324
2927
|
const { schema } = await getBranchDetails({
|
|
2325
|
-
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
|
|
2928
|
+
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
|
2326
2929
|
...fetchProps
|
|
2327
2930
|
});
|
|
2328
2931
|
__privateSet$1(this, _schemaTables, schema.tables);
|
|
@@ -2360,14 +2963,17 @@ async function resolveXataBranch(gitBranch, options) {
|
|
|
2360
2963
|
"An API key was not defined. Either set the XATA_API_KEY env variable or pass the argument explicitely"
|
|
2361
2964
|
);
|
|
2362
2965
|
const [protocol, , host, , dbName] = databaseURL.split("/");
|
|
2363
|
-
const
|
|
2966
|
+
const urlParts = parseWorkspacesUrlParts(host);
|
|
2967
|
+
if (!urlParts)
|
|
2968
|
+
throw new Error(`Unable to parse workspace and region: ${databaseURL}`);
|
|
2969
|
+
const { workspace, region } = urlParts;
|
|
2364
2970
|
const { fallbackBranch } = getEnvironment();
|
|
2365
2971
|
const { branch } = await resolveBranch({
|
|
2366
2972
|
apiKey,
|
|
2367
2973
|
apiUrl: databaseURL,
|
|
2368
2974
|
fetchImpl: getFetchImplementation(options?.fetchImpl),
|
|
2369
2975
|
workspacesApiUrl: `${protocol}//${host}`,
|
|
2370
|
-
pathParams: { dbName, workspace },
|
|
2976
|
+
pathParams: { dbName, workspace, region },
|
|
2371
2977
|
queryParams: { gitBranch, fallbackBranch },
|
|
2372
2978
|
trace: defaultTrace
|
|
2373
2979
|
});
|
|
@@ -2385,15 +2991,17 @@ async function getDatabaseBranch(branch, options) {
|
|
|
2385
2991
|
"An API key was not defined. Either set the XATA_API_KEY env variable or pass the argument explicitely"
|
|
2386
2992
|
);
|
|
2387
2993
|
const [protocol, , host, , database] = databaseURL.split("/");
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2994
|
+
const urlParts = parseWorkspacesUrlParts(host);
|
|
2995
|
+
if (!urlParts)
|
|
2996
|
+
throw new Error(`Unable to parse workspace and region: ${databaseURL}`);
|
|
2997
|
+
const { workspace, region } = urlParts;
|
|
2390
2998
|
try {
|
|
2391
2999
|
return await getBranchDetails({
|
|
2392
3000
|
apiKey,
|
|
2393
3001
|
apiUrl: databaseURL,
|
|
2394
3002
|
fetchImpl: getFetchImplementation(options?.fetchImpl),
|
|
2395
3003
|
workspacesApiUrl: `${protocol}//${host}`,
|
|
2396
|
-
pathParams: { dbBranchName
|
|
3004
|
+
pathParams: { dbBranchName: `${database}:${branch}`, workspace, region },
|
|
2397
3005
|
trace: defaultTrace
|
|
2398
3006
|
});
|
|
2399
3007
|
} catch (err) {
|
|
@@ -2484,8 +3092,8 @@ const buildClient = (plugins) => {
|
|
|
2484
3092
|
if (!databaseURL) {
|
|
2485
3093
|
throw new Error("Option databaseURL is required");
|
|
2486
3094
|
}
|
|
2487
|
-
return { fetch, databaseURL, apiKey, branch, cache, trace };
|
|
2488
|
-
}, _getFetchProps = new WeakSet(), getFetchProps_fn = async function({ fetch, apiKey, databaseURL, branch, trace }) {
|
|
3095
|
+
return { fetch, databaseURL, apiKey, branch, cache, trace, clientID: generateUUID() };
|
|
3096
|
+
}, _getFetchProps = new WeakSet(), getFetchProps_fn = async function({ fetch, apiKey, databaseURL, branch, trace, clientID }) {
|
|
2489
3097
|
const branchValue = await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, branch);
|
|
2490
3098
|
if (!branchValue)
|
|
2491
3099
|
throw new Error("Unable to resolve branch value");
|
|
@@ -2498,7 +3106,8 @@ const buildClient = (plugins) => {
|
|
|
2498
3106
|
const newPath = path.replace(/^\/db\/[^/]+/, hasBranch !== void 0 ? `:${branchValue}` : "");
|
|
2499
3107
|
return databaseURL + newPath;
|
|
2500
3108
|
},
|
|
2501
|
-
trace
|
|
3109
|
+
trace,
|
|
3110
|
+
clientID
|
|
2502
3111
|
};
|
|
2503
3112
|
}, _evaluateBranch = new WeakSet(), evaluateBranch_fn = async function(param) {
|
|
2504
3113
|
if (__privateGet(this, _branch))
|
|
@@ -2610,5 +3219,5 @@ class XataError extends Error {
|
|
|
2610
3219
|
}
|
|
2611
3220
|
}
|
|
2612
3221
|
|
|
2613
|
-
export { BaseClient, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, Repository, RestRepository, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, applyBranchSchemaEdit, buildClient, buildWorkerRunner, bulkInsertTableRecords,
|
|
3222
|
+
export { BaseClient, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, Repository, RestRepository, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, branchTransaction, buildClient, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, dEPRECATEDcreateDatabase, dEPRECATEDdeleteDatabase, dEPRECATEDgetDatabaseList, dEPRECATEDgetDatabaseMetadata, dEPRECATEDupdateDatabaseMetadata, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID };
|
|
2614
3223
|
//# sourceMappingURL=index.mjs.map
|