@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/dist/index.cjs CHANGED
@@ -60,6 +60,9 @@ function isString(value) {
60
60
  function isStringArray(value) {
61
61
  return isDefined(value) && Array.isArray(value) && value.every(isString);
62
62
  }
63
+ function isNumber(value) {
64
+ return isDefined(value) && typeof value === "number";
65
+ }
63
66
  function toBase64(value) {
64
67
  try {
65
68
  return btoa(value);
@@ -68,6 +71,17 @@ function toBase64(value) {
68
71
  return buf.from(value).toString("base64");
69
72
  }
70
73
  }
74
+ function deepMerge(a, b) {
75
+ const result = { ...a };
76
+ for (const [key, value] of Object.entries(b)) {
77
+ if (isObject(value) && isObject(result[key])) {
78
+ result[key] = deepMerge(result[key], value);
79
+ } else {
80
+ result[key] = value;
81
+ }
82
+ }
83
+ return result;
84
+ }
71
85
 
72
86
  function getEnvironment() {
73
87
  try {
@@ -172,7 +186,7 @@ function getFetchImplementation(userFetch) {
172
186
  return fetchImpl;
173
187
  }
174
188
 
175
- const VERSION = "0.0.0-alpha.vf0e0021";
189
+ const VERSION = "0.0.0-alpha.vf14d496";
176
190
 
177
191
  class ErrorWithCause extends Error {
178
192
  constructor(message, options) {
@@ -229,15 +243,18 @@ const resolveUrl = (url, queryParams = {}, pathParams = {}) => {
229
243
  return url.replace(/\{\w*\}/g, (key) => cleanPathParams[key.slice(1, -1)]) + queryString;
230
244
  };
231
245
  function buildBaseUrl({
246
+ endpoint,
232
247
  path,
233
248
  workspacesApiUrl,
234
249
  apiUrl,
235
- pathParams
250
+ pathParams = {}
236
251
  }) {
237
- if (pathParams?.workspace === void 0)
238
- return `${apiUrl}${path}`;
239
- const url = typeof workspacesApiUrl === "string" ? `${workspacesApiUrl}${path}` : workspacesApiUrl(path, pathParams);
240
- return url.replace("{workspaceId}", String(pathParams.workspace));
252
+ if (endpoint === "dataPlane") {
253
+ const url = isString(workspacesApiUrl) ? `${workspacesApiUrl}${path}` : workspacesApiUrl(path, pathParams);
254
+ const urlWithWorkspace = isString(pathParams.workspace) ? url.replace("{workspaceId}", String(pathParams.workspace)) : url;
255
+ return isString(pathParams.region) ? urlWithWorkspace.replace("{region}", String(pathParams.region)) : urlWithWorkspace;
256
+ }
257
+ return `${apiUrl}${path}`;
241
258
  }
242
259
  function hostHeader(url) {
243
260
  const pattern = /.*:\/\/(?<host>[^/]+).*/;
@@ -253,14 +270,18 @@ async function fetch$1({
253
270
  queryParams,
254
271
  fetchImpl,
255
272
  apiKey,
273
+ endpoint,
256
274
  apiUrl,
257
275
  workspacesApiUrl,
258
- trace
276
+ trace,
277
+ signal,
278
+ clientID,
279
+ sessionID
259
280
  }) {
260
281
  return trace(
261
282
  `${method.toUpperCase()} ${path}`,
262
283
  async ({ setAttributes }) => {
263
- const baseUrl = buildBaseUrl({ path, workspacesApiUrl, pathParams, apiUrl });
284
+ const baseUrl = buildBaseUrl({ endpoint, path, workspacesApiUrl, pathParams, apiUrl });
264
285
  const fullUrl = resolveUrl(baseUrl, queryParams, pathParams);
265
286
  const url = fullUrl.includes("localhost") ? fullUrl.replace(/^[^.]+\./, "http://") : fullUrl;
266
287
  setAttributes({
@@ -273,10 +294,13 @@ async function fetch$1({
273
294
  headers: {
274
295
  "Content-Type": "application/json",
275
296
  "User-Agent": `Xata client-ts/${VERSION}`,
297
+ "X-Xata-Client-ID": clientID ?? "",
298
+ "X-Xata-Session-ID": sessionID ?? "",
276
299
  ...headers,
277
300
  ...hostHeader(fullUrl),
278
301
  Authorization: `Bearer ${apiKey}`
279
- }
302
+ },
303
+ signal
280
304
  });
281
305
  if (response.status === 204) {
282
306
  return {};
@@ -312,293 +336,163 @@ function parseUrl(url) {
312
336
  }
313
337
  }
314
338
 
315
- const getUser = (variables) => fetch$1({ url: "/user", method: "get", ...variables });
316
- const updateUser = (variables) => fetch$1({ url: "/user", method: "put", ...variables });
317
- const deleteUser = (variables) => fetch$1({ url: "/user", method: "delete", ...variables });
318
- const getUserAPIKeys = (variables) => fetch$1({
319
- url: "/user/keys",
320
- method: "get",
321
- ...variables
322
- });
323
- const createUserAPIKey = (variables) => fetch$1({
324
- url: "/user/keys/{keyName}",
325
- method: "post",
326
- ...variables
327
- });
328
- const deleteUserAPIKey = (variables) => fetch$1({
329
- url: "/user/keys/{keyName}",
330
- method: "delete",
331
- ...variables
332
- });
333
- const createWorkspace = (variables) => fetch$1({
334
- url: "/workspaces",
335
- method: "post",
336
- ...variables
337
- });
338
- const getWorkspacesList = (variables) => fetch$1({
339
- url: "/workspaces",
340
- method: "get",
341
- ...variables
342
- });
343
- const getWorkspace = (variables) => fetch$1({
344
- url: "/workspaces/{workspaceId}",
345
- method: "get",
346
- ...variables
347
- });
348
- const updateWorkspace = (variables) => fetch$1({
349
- url: "/workspaces/{workspaceId}",
350
- method: "put",
351
- ...variables
352
- });
353
- const deleteWorkspace = (variables) => fetch$1({
354
- url: "/workspaces/{workspaceId}",
355
- method: "delete",
356
- ...variables
357
- });
358
- const getWorkspaceMembersList = (variables) => fetch$1({
359
- url: "/workspaces/{workspaceId}/members",
360
- method: "get",
361
- ...variables
362
- });
363
- const updateWorkspaceMemberRole = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/members/{userId}", method: "put", ...variables });
364
- const removeWorkspaceMember = (variables) => fetch$1({
365
- url: "/workspaces/{workspaceId}/members/{userId}",
366
- method: "delete",
367
- ...variables
368
- });
369
- const inviteWorkspaceMember = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/invites", method: "post", ...variables });
370
- const updateWorkspaceMemberInvite = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "patch", ...variables });
371
- const cancelWorkspaceMemberInvite = (variables) => fetch$1({
372
- url: "/workspaces/{workspaceId}/invites/{inviteId}",
373
- method: "delete",
374
- ...variables
375
- });
376
- const resendWorkspaceMemberInvite = (variables) => fetch$1({
377
- url: "/workspaces/{workspaceId}/invites/{inviteId}/resend",
378
- method: "post",
379
- ...variables
380
- });
381
- const acceptWorkspaceMemberInvite = (variables) => fetch$1({
382
- url: "/workspaces/{workspaceId}/invites/{inviteKey}/accept",
383
- method: "post",
384
- ...variables
385
- });
386
- const getDatabaseList = (variables) => fetch$1({
387
- url: "/dbs",
388
- method: "get",
389
- ...variables
390
- });
391
- const getBranchList = (variables) => fetch$1({
339
+ const dataPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "dataPlane" });
340
+
341
+ const dEPRECATEDgetDatabaseList = (variables, signal) => dataPlaneFetch({ url: "/dbs", method: "get", ...variables, signal });
342
+ const getBranchList = (variables, signal) => dataPlaneFetch({
392
343
  url: "/dbs/{dbName}",
393
344
  method: "get",
394
- ...variables
345
+ ...variables,
346
+ signal
395
347
  });
396
- const createDatabase = (variables) => fetch$1({
397
- url: "/dbs/{dbName}",
398
- method: "put",
399
- ...variables
400
- });
401
- const deleteDatabase = (variables) => fetch$1({
402
- url: "/dbs/{dbName}",
403
- method: "delete",
404
- ...variables
405
- });
406
- const getDatabaseMetadata = (variables) => fetch$1({
407
- url: "/dbs/{dbName}/metadata",
408
- method: "get",
409
- ...variables
410
- });
411
- const updateDatabaseMetadata = (variables) => fetch$1({ url: "/dbs/{dbName}/metadata", method: "patch", ...variables });
412
- const getGitBranchesMapping = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "get", ...variables });
413
- const addGitBranchesEntry = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "post", ...variables });
414
- const removeGitBranchesEntry = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "delete", ...variables });
415
- const resolveBranch = (variables) => fetch$1({
416
- url: "/dbs/{dbName}/resolveBranch",
417
- method: "get",
418
- ...variables
419
- });
420
- const listMigrationRequests = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/list", method: "post", ...variables });
421
- const createMigrationRequest = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations", method: "post", ...variables });
422
- const getMigrationRequest = (variables) => fetch$1({
423
- url: "/dbs/{dbName}/migrations/{mrNumber}",
424
- method: "get",
425
- ...variables
426
- });
427
- const updateMigrationRequest = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}", method: "patch", ...variables });
428
- const listMigrationRequestsCommits = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}/commits", method: "post", ...variables });
429
- const compareMigrationRequest = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}/compare", method: "post", ...variables });
430
- const getMigrationRequestIsMerged = (variables) => fetch$1({ url: "/dbs/{dbName}/migrations/{mrNumber}/merge", method: "get", ...variables });
431
- const mergeMigrationRequest = (variables) => fetch$1({
432
- url: "/dbs/{dbName}/migrations/{mrNumber}/merge",
433
- method: "post",
434
- ...variables
435
- });
436
- const getBranchDetails = (variables) => fetch$1({
348
+ const dEPRECATEDcreateDatabase = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}", method: "put", ...variables, signal });
349
+ const dEPRECATEDdeleteDatabase = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}", method: "delete", ...variables, signal });
350
+ const dEPRECATEDgetDatabaseMetadata = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/metadata", method: "get", ...variables, signal });
351
+ const dEPRECATEDupdateDatabaseMetadata = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/metadata", method: "patch", ...variables, signal });
352
+ const getBranchDetails = (variables, signal) => dataPlaneFetch({
437
353
  url: "/db/{dbBranchName}",
438
354
  method: "get",
439
- ...variables
355
+ ...variables,
356
+ signal
440
357
  });
441
- const createBranch = (variables) => fetch$1({ url: "/db/{dbBranchName}", method: "put", ...variables });
442
- const deleteBranch = (variables) => fetch$1({
358
+ const createBranch = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}", method: "put", ...variables, signal });
359
+ const deleteBranch = (variables, signal) => dataPlaneFetch({
443
360
  url: "/db/{dbBranchName}",
444
361
  method: "delete",
445
- ...variables
362
+ ...variables,
363
+ signal
446
364
  });
447
- const updateBranchMetadata = (variables) => fetch$1({
365
+ const updateBranchMetadata = (variables, signal) => dataPlaneFetch({
448
366
  url: "/db/{dbBranchName}/metadata",
449
367
  method: "put",
450
- ...variables
368
+ ...variables,
369
+ signal
451
370
  });
452
- const getBranchMetadata = (variables) => fetch$1({
371
+ const getBranchMetadata = (variables, signal) => dataPlaneFetch({
453
372
  url: "/db/{dbBranchName}/metadata",
454
373
  method: "get",
455
- ...variables
456
- });
457
- const getBranchMigrationHistory = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations", method: "get", ...variables });
458
- const executeBranchMigrationPlan = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations/execute", method: "post", ...variables });
459
- const getBranchMigrationPlan = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations/plan", method: "post", ...variables });
460
- const compareBranchWithUserSchema = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/compare", method: "post", ...variables });
461
- const compareBranchSchemas = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/compare/{branchName}", method: "post", ...variables });
462
- const updateBranchSchema = (variables) => fetch$1({
463
- url: "/db/{dbBranchName}/schema/update",
464
- method: "post",
465
- ...variables
374
+ ...variables,
375
+ signal
466
376
  });
467
- const previewBranchSchemaEdit = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/preview", method: "post", ...variables });
468
- const applyBranchSchemaEdit = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/apply", method: "post", ...variables });
469
- const getBranchSchemaHistory = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/history", method: "post", ...variables });
470
- const getBranchStats = (variables) => fetch$1({
377
+ const getBranchStats = (variables, signal) => dataPlaneFetch({
471
378
  url: "/db/{dbBranchName}/stats",
472
379
  method: "get",
473
- ...variables
380
+ ...variables,
381
+ signal
382
+ });
383
+ const getGitBranchesMapping = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/gitBranches", method: "get", ...variables, signal });
384
+ const addGitBranchesEntry = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/gitBranches", method: "post", ...variables, signal });
385
+ const removeGitBranchesEntry = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/gitBranches", method: "delete", ...variables, signal });
386
+ const resolveBranch = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/resolveBranch", method: "get", ...variables, signal });
387
+ const getBranchMigrationHistory = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations", method: "get", ...variables, signal });
388
+ const getBranchMigrationPlan = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/plan", method: "post", ...variables, signal });
389
+ const executeBranchMigrationPlan = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/execute", method: "post", ...variables, signal });
390
+ const branchTransaction = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/transaction", method: "post", ...variables, signal });
391
+ const queryMigrationRequests = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/query", method: "post", ...variables, signal });
392
+ const createMigrationRequest = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations", method: "post", ...variables, signal });
393
+ const getMigrationRequest = (variables, signal) => dataPlaneFetch({
394
+ url: "/dbs/{dbName}/migrations/{mrNumber}",
395
+ method: "get",
396
+ ...variables,
397
+ signal
474
398
  });
475
- const createTable = (variables) => fetch$1({
399
+ const updateMigrationRequest = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}", method: "patch", ...variables, signal });
400
+ const listMigrationRequestsCommits = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}/commits", method: "post", ...variables, signal });
401
+ const compareMigrationRequest = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}/compare", method: "post", ...variables, signal });
402
+ const getMigrationRequestIsMerged = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/migrations/{mrNumber}/merge", method: "get", ...variables, signal });
403
+ const mergeMigrationRequest = (variables, signal) => dataPlaneFetch({
404
+ url: "/dbs/{dbName}/migrations/{mrNumber}/merge",
405
+ method: "post",
406
+ ...variables,
407
+ signal
408
+ });
409
+ const getBranchSchemaHistory = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/history", method: "post", ...variables, signal });
410
+ const compareBranchWithUserSchema = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/compare", method: "post", ...variables, signal });
411
+ const compareBranchSchemas = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/compare/{branchName}", method: "post", ...variables, signal });
412
+ const updateBranchSchema = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/update", method: "post", ...variables, signal });
413
+ const previewBranchSchemaEdit = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/preview", method: "post", ...variables, signal });
414
+ const applyBranchSchemaEdit = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/schema/apply", method: "post", ...variables, signal });
415
+ const createTable = (variables, signal) => dataPlaneFetch({
476
416
  url: "/db/{dbBranchName}/tables/{tableName}",
477
417
  method: "put",
478
- ...variables
418
+ ...variables,
419
+ signal
479
420
  });
480
- const deleteTable = (variables) => fetch$1({
421
+ const deleteTable = (variables, signal) => dataPlaneFetch({
481
422
  url: "/db/{dbBranchName}/tables/{tableName}",
482
423
  method: "delete",
483
- ...variables
424
+ ...variables,
425
+ signal
484
426
  });
485
- const updateTable = (variables) => fetch$1({
486
- url: "/db/{dbBranchName}/tables/{tableName}",
487
- method: "patch",
488
- ...variables
489
- });
490
- const getTableSchema = (variables) => fetch$1({
427
+ const updateTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}", method: "patch", ...variables, signal });
428
+ const getTableSchema = (variables, signal) => dataPlaneFetch({
491
429
  url: "/db/{dbBranchName}/tables/{tableName}/schema",
492
430
  method: "get",
493
- ...variables
431
+ ...variables,
432
+ signal
494
433
  });
495
- const setTableSchema = (variables) => fetch$1({
496
- url: "/db/{dbBranchName}/tables/{tableName}/schema",
497
- method: "put",
498
- ...variables
499
- });
500
- const getTableColumns = (variables) => fetch$1({
434
+ const setTableSchema = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/schema", method: "put", ...variables, signal });
435
+ const getTableColumns = (variables, signal) => dataPlaneFetch({
501
436
  url: "/db/{dbBranchName}/tables/{tableName}/columns",
502
437
  method: "get",
503
- ...variables
504
- });
505
- const addTableColumn = (variables) => fetch$1({
506
- url: "/db/{dbBranchName}/tables/{tableName}/columns",
507
- method: "post",
508
- ...variables
438
+ ...variables,
439
+ signal
509
440
  });
510
- const getColumn = (variables) => fetch$1({
441
+ const addTableColumn = (variables, signal) => dataPlaneFetch(
442
+ { url: "/db/{dbBranchName}/tables/{tableName}/columns", method: "post", ...variables, signal }
443
+ );
444
+ const getColumn = (variables, signal) => dataPlaneFetch({
511
445
  url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",
512
446
  method: "get",
513
- ...variables
447
+ ...variables,
448
+ signal
514
449
  });
515
- const deleteColumn = (variables) => fetch$1({
450
+ const updateColumn = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}", method: "patch", ...variables, signal });
451
+ const deleteColumn = (variables, signal) => dataPlaneFetch({
516
452
  url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",
517
453
  method: "delete",
518
- ...variables
454
+ ...variables,
455
+ signal
519
456
  });
520
- const updateColumn = (variables) => fetch$1({
521
- url: "/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",
522
- method: "patch",
523
- ...variables
524
- });
525
- const insertRecord = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data", method: "post", ...variables });
526
- const insertRecordWithID = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "put", ...variables });
527
- const updateRecordWithID = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "patch", ...variables });
528
- const upsertRecordWithID = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "post", ...variables });
529
- const deleteRecord = (variables) => fetch$1({
530
- url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}",
531
- method: "delete",
532
- ...variables
533
- });
534
- const getRecord = (variables) => fetch$1({
457
+ const insertRecord = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data", method: "post", ...variables, signal });
458
+ const getRecord = (variables, signal) => dataPlaneFetch({
535
459
  url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}",
536
460
  method: "get",
537
- ...variables
461
+ ...variables,
462
+ signal
538
463
  });
539
- const bulkInsertTableRecords = (variables) => fetch$1({ url: "/db/{dbBranchName}/tables/{tableName}/bulk", method: "post", ...variables });
540
- const queryTable = (variables) => fetch$1({
464
+ const insertRecordWithID = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "put", ...variables, signal });
465
+ const updateRecordWithID = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "patch", ...variables, signal });
466
+ const upsertRecordWithID = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "post", ...variables, signal });
467
+ const deleteRecord = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}", method: "delete", ...variables, signal });
468
+ const bulkInsertTableRecords = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/bulk", method: "post", ...variables, signal });
469
+ const queryTable = (variables, signal) => dataPlaneFetch({
541
470
  url: "/db/{dbBranchName}/tables/{tableName}/query",
542
471
  method: "post",
543
- ...variables
544
- });
545
- const searchTable = (variables) => fetch$1({
546
- url: "/db/{dbBranchName}/tables/{tableName}/search",
547
- method: "post",
548
- ...variables
472
+ ...variables,
473
+ signal
549
474
  });
550
- const searchBranch = (variables) => fetch$1({
475
+ const searchBranch = (variables, signal) => dataPlaneFetch({
551
476
  url: "/db/{dbBranchName}/search",
552
477
  method: "post",
553
- ...variables
478
+ ...variables,
479
+ signal
554
480
  });
555
- const summarizeTable = (variables) => fetch$1({
556
- url: "/db/{dbBranchName}/tables/{tableName}/summarize",
481
+ const searchTable = (variables, signal) => dataPlaneFetch({
482
+ url: "/db/{dbBranchName}/tables/{tableName}/search",
557
483
  method: "post",
558
- ...variables
559
- });
560
- const cPgetDatabaseList = (variables) => fetch$1({
561
- url: "/workspaces/{workspaceId}/dbs",
562
- method: "get",
563
- ...variables
564
- });
565
- const cPcreateDatabase = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "put", ...variables });
566
- const cPdeleteDatabase = (variables) => fetch$1({
567
- url: "/workspaces/{workspaceId}/dbs/{dbName}",
568
- method: "delete",
569
- ...variables
484
+ ...variables,
485
+ signal
570
486
  });
571
- const cPgetCPDatabaseMetadata = (variables) => fetch$1(
572
- { url: "/workspaces/{workspaceId}/dbs/{dbName}/metadata", method: "get", ...variables }
573
- );
574
- const cPupdateCPDatabaseMetadata = (variables) => fetch$1({ url: "/workspaces/{workspaceId}/dbs/{dbName}/metadata", method: "patch", ...variables });
575
- const operationsByTag = {
576
- users: { getUser, updateUser, deleteUser, getUserAPIKeys, createUserAPIKey, deleteUserAPIKey },
577
- workspaces: {
578
- createWorkspace,
579
- getWorkspacesList,
580
- getWorkspace,
581
- updateWorkspace,
582
- deleteWorkspace,
583
- getWorkspaceMembersList,
584
- updateWorkspaceMemberRole,
585
- removeWorkspaceMember,
586
- inviteWorkspaceMember,
587
- updateWorkspaceMemberInvite,
588
- cancelWorkspaceMemberInvite,
589
- resendWorkspaceMemberInvite,
590
- acceptWorkspaceMemberInvite
591
- },
487
+ const summarizeTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/summarize", method: "post", ...variables, signal });
488
+ const aggregateTable = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/aggregate", method: "post", ...variables, signal });
489
+ const operationsByTag$2 = {
592
490
  database: {
593
- getDatabaseList,
594
- createDatabase,
595
- deleteDatabase,
596
- getDatabaseMetadata,
597
- updateDatabaseMetadata,
598
- getGitBranchesMapping,
599
- addGitBranchesEntry,
600
- removeGitBranchesEntry,
601
- resolveBranch
491
+ dEPRECATEDgetDatabaseList,
492
+ dEPRECATEDcreateDatabase,
493
+ dEPRECATEDdeleteDatabase,
494
+ dEPRECATEDgetDatabaseMetadata,
495
+ dEPRECATEDupdateDatabaseMetadata
602
496
  },
603
497
  branch: {
604
498
  getBranchList,
@@ -607,10 +501,35 @@ const operationsByTag = {
607
501
  deleteBranch,
608
502
  updateBranchMetadata,
609
503
  getBranchMetadata,
610
- getBranchStats
504
+ getBranchStats,
505
+ getGitBranchesMapping,
506
+ addGitBranchesEntry,
507
+ removeGitBranchesEntry,
508
+ resolveBranch
509
+ },
510
+ migrations: {
511
+ getBranchMigrationHistory,
512
+ getBranchMigrationPlan,
513
+ executeBranchMigrationPlan,
514
+ getBranchSchemaHistory,
515
+ compareBranchWithUserSchema,
516
+ compareBranchSchemas,
517
+ updateBranchSchema,
518
+ previewBranchSchemaEdit,
519
+ applyBranchSchemaEdit
520
+ },
521
+ records: {
522
+ branchTransaction,
523
+ insertRecord,
524
+ getRecord,
525
+ insertRecordWithID,
526
+ updateRecordWithID,
527
+ upsertRecordWithID,
528
+ deleteRecord,
529
+ bulkInsertTableRecords
611
530
  },
612
531
  migrationRequests: {
613
- listMigrationRequests,
532
+ queryMigrationRequests,
614
533
  createMigrationRequest,
615
534
  getMigrationRequest,
616
535
  updateMigrationRequest,
@@ -619,17 +538,6 @@ const operationsByTag = {
619
538
  getMigrationRequestIsMerged,
620
539
  mergeMigrationRequest
621
540
  },
622
- branchSchema: {
623
- getBranchMigrationHistory,
624
- executeBranchMigrationPlan,
625
- getBranchMigrationPlan,
626
- compareBranchWithUserSchema,
627
- compareBranchSchemas,
628
- updateBranchSchema,
629
- previewBranchSchemaEdit,
630
- applyBranchSchemaEdit,
631
- getBranchSchemaHistory
632
- },
633
541
  table: {
634
542
  createTable,
635
543
  deleteTable,
@@ -639,31 +547,146 @@ const operationsByTag = {
639
547
  getTableColumns,
640
548
  addTableColumn,
641
549
  getColumn,
642
- deleteColumn,
643
- updateColumn
550
+ updateColumn,
551
+ deleteColumn
644
552
  },
645
- records: {
646
- insertRecord,
647
- insertRecordWithID,
648
- updateRecordWithID,
649
- upsertRecordWithID,
650
- deleteRecord,
651
- getRecord,
652
- bulkInsertTableRecords,
653
- queryTable,
654
- searchTable,
655
- searchBranch,
656
- summarizeTable
553
+ searchAndFilter: { queryTable, searchBranch, searchTable, summarizeTable, aggregateTable }
554
+ };
555
+
556
+ const controlPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "controlPlane" });
557
+
558
+ const getUser = (variables, signal) => controlPlaneFetch({
559
+ url: "/user",
560
+ method: "get",
561
+ ...variables,
562
+ signal
563
+ });
564
+ const updateUser = (variables, signal) => controlPlaneFetch({
565
+ url: "/user",
566
+ method: "put",
567
+ ...variables,
568
+ signal
569
+ });
570
+ const deleteUser = (variables, signal) => controlPlaneFetch({
571
+ url: "/user",
572
+ method: "delete",
573
+ ...variables,
574
+ signal
575
+ });
576
+ const getUserAPIKeys = (variables, signal) => controlPlaneFetch({
577
+ url: "/user/keys",
578
+ method: "get",
579
+ ...variables,
580
+ signal
581
+ });
582
+ const createUserAPIKey = (variables, signal) => controlPlaneFetch({
583
+ url: "/user/keys/{keyName}",
584
+ method: "post",
585
+ ...variables,
586
+ signal
587
+ });
588
+ const deleteUserAPIKey = (variables, signal) => controlPlaneFetch({
589
+ url: "/user/keys/{keyName}",
590
+ method: "delete",
591
+ ...variables,
592
+ signal
593
+ });
594
+ const getWorkspacesList = (variables, signal) => controlPlaneFetch({
595
+ url: "/workspaces",
596
+ method: "get",
597
+ ...variables,
598
+ signal
599
+ });
600
+ const createWorkspace = (variables, signal) => controlPlaneFetch({
601
+ url: "/workspaces",
602
+ method: "post",
603
+ ...variables,
604
+ signal
605
+ });
606
+ const getWorkspace = (variables, signal) => controlPlaneFetch({
607
+ url: "/workspaces/{workspaceId}",
608
+ method: "get",
609
+ ...variables,
610
+ signal
611
+ });
612
+ const updateWorkspace = (variables, signal) => controlPlaneFetch({
613
+ url: "/workspaces/{workspaceId}",
614
+ method: "put",
615
+ ...variables,
616
+ signal
617
+ });
618
+ const deleteWorkspace = (variables, signal) => controlPlaneFetch({
619
+ url: "/workspaces/{workspaceId}",
620
+ method: "delete",
621
+ ...variables,
622
+ signal
623
+ });
624
+ const getWorkspaceMembersList = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/members", method: "get", ...variables, signal });
625
+ const updateWorkspaceMemberRole = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/members/{userId}", method: "put", ...variables, signal });
626
+ const removeWorkspaceMember = (variables, signal) => controlPlaneFetch({
627
+ url: "/workspaces/{workspaceId}/members/{userId}",
628
+ method: "delete",
629
+ ...variables,
630
+ signal
631
+ });
632
+ const inviteWorkspaceMember = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites", method: "post", ...variables, signal });
633
+ const updateWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "patch", ...variables, signal });
634
+ const cancelWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "delete", ...variables, signal });
635
+ const acceptWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteKey}/accept", method: "post", ...variables, signal });
636
+ const resendWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}/resend", method: "post", ...variables, signal });
637
+ const getDatabaseList = (variables, signal) => controlPlaneFetch({
638
+ url: "/workspaces/{workspaceId}/dbs",
639
+ method: "get",
640
+ ...variables,
641
+ signal
642
+ });
643
+ const createDatabase = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "put", ...variables, signal });
644
+ const deleteDatabase = (variables, signal) => controlPlaneFetch({
645
+ url: "/workspaces/{workspaceId}/dbs/{dbName}",
646
+ method: "delete",
647
+ ...variables,
648
+ signal
649
+ });
650
+ const getDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "get", ...variables, signal });
651
+ const updateDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "patch", ...variables, signal });
652
+ const listRegions = (variables, signal) => controlPlaneFetch({
653
+ url: "/workspaces/{workspaceId}/regions",
654
+ method: "get",
655
+ ...variables,
656
+ signal
657
+ });
658
+ const operationsByTag$1 = {
659
+ users: { getUser, updateUser, deleteUser },
660
+ authentication: { getUserAPIKeys, createUserAPIKey, deleteUserAPIKey },
661
+ workspaces: {
662
+ getWorkspacesList,
663
+ createWorkspace,
664
+ getWorkspace,
665
+ updateWorkspace,
666
+ deleteWorkspace,
667
+ getWorkspaceMembersList,
668
+ updateWorkspaceMemberRole,
669
+ removeWorkspaceMember
670
+ },
671
+ invites: {
672
+ inviteWorkspaceMember,
673
+ updateWorkspaceMemberInvite,
674
+ cancelWorkspaceMemberInvite,
675
+ acceptWorkspaceMemberInvite,
676
+ resendWorkspaceMemberInvite
657
677
  },
658
678
  databases: {
659
- cPgetDatabaseList,
660
- cPcreateDatabase,
661
- cPdeleteDatabase,
662
- cPgetCPDatabaseMetadata,
663
- cPupdateCPDatabaseMetadata
679
+ getDatabaseList,
680
+ createDatabase,
681
+ deleteDatabase,
682
+ getDatabaseMetadata,
683
+ updateDatabaseMetadata,
684
+ listRegions
664
685
  }
665
686
  };
666
687
 
688
+ const operationsByTag = deepMerge(operationsByTag$2, operationsByTag$1);
689
+
667
690
  function getHostUrl(provider, type) {
668
691
  if (isHostProviderAlias(provider)) {
669
692
  return providers[provider][type];
@@ -675,11 +698,11 @@ function getHostUrl(provider, type) {
675
698
  const providers = {
676
699
  production: {
677
700
  main: "https://api.xata.io",
678
- workspaces: "https://{workspaceId}.xata.sh"
701
+ workspaces: "https://{workspaceId}.{region}.xata.sh"
679
702
  },
680
703
  staging: {
681
704
  main: "https://staging.xatabase.co",
682
- workspaces: "https://{workspaceId}.staging.xatabase.co"
705
+ workspaces: "https://{workspaceId}.staging.{region}.xatabase.co"
683
706
  }
684
707
  };
685
708
  function isHostProviderAlias(alias) {
@@ -688,6 +711,25 @@ function isHostProviderAlias(alias) {
688
711
  function isHostProviderBuilder(builder) {
689
712
  return isObject(builder) && isString(builder.main) && isString(builder.workspaces);
690
713
  }
714
+ function parseProviderString(provider = "production") {
715
+ if (isHostProviderAlias(provider)) {
716
+ return provider;
717
+ }
718
+ const [main, workspaces] = provider.split(",");
719
+ if (!main || !workspaces)
720
+ return null;
721
+ return { main, workspaces };
722
+ }
723
+ function parseWorkspacesUrlParts(url) {
724
+ if (!isString(url))
725
+ return null;
726
+ const regex = /(?:https:\/\/)?([^.]+)(?:\.([^.]+))?\.xata\.sh.*/;
727
+ const regexStaging = /(?:https:\/\/)?([^.]+)\.staging(?:\.([^.]+))?\.xatabase\.co.*/;
728
+ const match = url.match(regex) || url.match(regexStaging);
729
+ if (!match)
730
+ return null;
731
+ return { workspace: match[1], region: match[2] ?? "eu-west-1" };
732
+ }
691
733
 
692
734
  var __accessCheck$7 = (obj, member, msg) => {
693
735
  if (!member.has(obj))
@@ -731,21 +773,41 @@ class XataApiClient {
731
773
  __privateGet$7(this, _namespaces).user = new UserApi(__privateGet$7(this, _extraProps));
732
774
  return __privateGet$7(this, _namespaces).user;
733
775
  }
776
+ get authentication() {
777
+ if (!__privateGet$7(this, _namespaces).authentication)
778
+ __privateGet$7(this, _namespaces).authentication = new AuthenticationApi(__privateGet$7(this, _extraProps));
779
+ return __privateGet$7(this, _namespaces).authentication;
780
+ }
734
781
  get workspaces() {
735
782
  if (!__privateGet$7(this, _namespaces).workspaces)
736
783
  __privateGet$7(this, _namespaces).workspaces = new WorkspaceApi(__privateGet$7(this, _extraProps));
737
784
  return __privateGet$7(this, _namespaces).workspaces;
738
785
  }
739
- get databases() {
740
- if (!__privateGet$7(this, _namespaces).databases)
741
- __privateGet$7(this, _namespaces).databases = new DatabaseApi(__privateGet$7(this, _extraProps));
742
- return __privateGet$7(this, _namespaces).databases;
786
+ get invites() {
787
+ if (!__privateGet$7(this, _namespaces).invites)
788
+ __privateGet$7(this, _namespaces).invites = new InvitesApi(__privateGet$7(this, _extraProps));
789
+ return __privateGet$7(this, _namespaces).invites;
790
+ }
791
+ get database() {
792
+ if (!__privateGet$7(this, _namespaces).database)
793
+ __privateGet$7(this, _namespaces).database = new DatabaseApi(__privateGet$7(this, _extraProps));
794
+ return __privateGet$7(this, _namespaces).database;
743
795
  }
744
796
  get branches() {
745
797
  if (!__privateGet$7(this, _namespaces).branches)
746
798
  __privateGet$7(this, _namespaces).branches = new BranchApi(__privateGet$7(this, _extraProps));
747
799
  return __privateGet$7(this, _namespaces).branches;
748
800
  }
801
+ get migrations() {
802
+ if (!__privateGet$7(this, _namespaces).migrations)
803
+ __privateGet$7(this, _namespaces).migrations = new MigrationsApi(__privateGet$7(this, _extraProps));
804
+ return __privateGet$7(this, _namespaces).migrations;
805
+ }
806
+ get migrationRequests() {
807
+ if (!__privateGet$7(this, _namespaces).migrationRequests)
808
+ __privateGet$7(this, _namespaces).migrationRequests = new MigrationRequestsApi(__privateGet$7(this, _extraProps));
809
+ return __privateGet$7(this, _namespaces).migrationRequests;
810
+ }
749
811
  get tables() {
750
812
  if (!__privateGet$7(this, _namespaces).tables)
751
813
  __privateGet$7(this, _namespaces).tables = new TableApi(__privateGet$7(this, _extraProps));
@@ -756,15 +818,10 @@ class XataApiClient {
756
818
  __privateGet$7(this, _namespaces).records = new RecordsApi(__privateGet$7(this, _extraProps));
757
819
  return __privateGet$7(this, _namespaces).records;
758
820
  }
759
- get migrationRequests() {
760
- if (!__privateGet$7(this, _namespaces).migrationRequests)
761
- __privateGet$7(this, _namespaces).migrationRequests = new MigrationRequestsApi(__privateGet$7(this, _extraProps));
762
- return __privateGet$7(this, _namespaces).migrationRequests;
763
- }
764
- get branchSchema() {
765
- if (!__privateGet$7(this, _namespaces).branchSchema)
766
- __privateGet$7(this, _namespaces).branchSchema = new BranchSchemaApi(__privateGet$7(this, _extraProps));
767
- return __privateGet$7(this, _namespaces).branchSchema;
821
+ get searchAndFilter() {
822
+ if (!__privateGet$7(this, _namespaces).searchAndFilter)
823
+ __privateGet$7(this, _namespaces).searchAndFilter = new SearchAndFilterApi(__privateGet$7(this, _extraProps));
824
+ return __privateGet$7(this, _namespaces).searchAndFilter;
768
825
  }
769
826
  }
770
827
  _extraProps = new WeakMap();
@@ -776,24 +833,29 @@ class UserApi {
776
833
  getUser() {
777
834
  return operationsByTag.users.getUser({ ...this.extraProps });
778
835
  }
779
- updateUser(user) {
836
+ updateUser({ user }) {
780
837
  return operationsByTag.users.updateUser({ body: user, ...this.extraProps });
781
838
  }
782
839
  deleteUser() {
783
840
  return operationsByTag.users.deleteUser({ ...this.extraProps });
784
841
  }
842
+ }
843
+ class AuthenticationApi {
844
+ constructor(extraProps) {
845
+ this.extraProps = extraProps;
846
+ }
785
847
  getUserAPIKeys() {
786
- return operationsByTag.users.getUserAPIKeys({ ...this.extraProps });
848
+ return operationsByTag.authentication.getUserAPIKeys({ ...this.extraProps });
787
849
  }
788
- createUserAPIKey(keyName) {
789
- return operationsByTag.users.createUserAPIKey({
790
- pathParams: { keyName },
850
+ createUserAPIKey({ name }) {
851
+ return operationsByTag.authentication.createUserAPIKey({
852
+ pathParams: { keyName: name },
791
853
  ...this.extraProps
792
854
  });
793
855
  }
794
- deleteUserAPIKey(keyName) {
795
- return operationsByTag.users.deleteUserAPIKey({
796
- pathParams: { keyName },
856
+ deleteUserAPIKey({ name }) {
857
+ return operationsByTag.authentication.deleteUserAPIKey({
858
+ pathParams: { keyName: name },
797
859
  ...this.extraProps
798
860
  });
799
861
  }
@@ -802,196 +864,248 @@ class WorkspaceApi {
802
864
  constructor(extraProps) {
803
865
  this.extraProps = extraProps;
804
866
  }
805
- createWorkspace(workspaceMeta) {
867
+ getWorkspacesList() {
868
+ return operationsByTag.workspaces.getWorkspacesList({ ...this.extraProps });
869
+ }
870
+ createWorkspace({ data }) {
806
871
  return operationsByTag.workspaces.createWorkspace({
807
- body: workspaceMeta,
872
+ body: data,
808
873
  ...this.extraProps
809
874
  });
810
875
  }
811
- getWorkspacesList() {
812
- return operationsByTag.workspaces.getWorkspacesList({ ...this.extraProps });
813
- }
814
- getWorkspace(workspaceId) {
876
+ getWorkspace({ workspace }) {
815
877
  return operationsByTag.workspaces.getWorkspace({
816
- pathParams: { workspaceId },
878
+ pathParams: { workspaceId: workspace },
817
879
  ...this.extraProps
818
880
  });
819
881
  }
820
- updateWorkspace(workspaceId, workspaceMeta) {
882
+ updateWorkspace({
883
+ workspace,
884
+ update
885
+ }) {
821
886
  return operationsByTag.workspaces.updateWorkspace({
822
- pathParams: { workspaceId },
823
- body: workspaceMeta,
887
+ pathParams: { workspaceId: workspace },
888
+ body: update,
824
889
  ...this.extraProps
825
890
  });
826
891
  }
827
- deleteWorkspace(workspaceId) {
892
+ deleteWorkspace({ workspace }) {
828
893
  return operationsByTag.workspaces.deleteWorkspace({
829
- pathParams: { workspaceId },
894
+ pathParams: { workspaceId: workspace },
830
895
  ...this.extraProps
831
896
  });
832
897
  }
833
- getWorkspaceMembersList(workspaceId) {
898
+ getWorkspaceMembersList({ workspace }) {
834
899
  return operationsByTag.workspaces.getWorkspaceMembersList({
835
- pathParams: { workspaceId },
900
+ pathParams: { workspaceId: workspace },
836
901
  ...this.extraProps
837
902
  });
838
903
  }
839
- updateWorkspaceMemberRole(workspaceId, userId, role) {
904
+ updateWorkspaceMemberRole({
905
+ workspace,
906
+ user,
907
+ role
908
+ }) {
840
909
  return operationsByTag.workspaces.updateWorkspaceMemberRole({
841
- pathParams: { workspaceId, userId },
910
+ pathParams: { workspaceId: workspace, userId: user },
842
911
  body: { role },
843
912
  ...this.extraProps
844
913
  });
845
914
  }
846
- removeWorkspaceMember(workspaceId, userId) {
915
+ removeWorkspaceMember({
916
+ workspace,
917
+ user
918
+ }) {
847
919
  return operationsByTag.workspaces.removeWorkspaceMember({
848
- pathParams: { workspaceId, userId },
920
+ pathParams: { workspaceId: workspace, userId: user },
849
921
  ...this.extraProps
850
922
  });
851
923
  }
852
- inviteWorkspaceMember(workspaceId, email, role) {
853
- return operationsByTag.workspaces.inviteWorkspaceMember({
854
- pathParams: { workspaceId },
924
+ }
925
+ class InvitesApi {
926
+ constructor(extraProps) {
927
+ this.extraProps = extraProps;
928
+ }
929
+ inviteWorkspaceMember({
930
+ workspace,
931
+ email,
932
+ role
933
+ }) {
934
+ return operationsByTag.invites.inviteWorkspaceMember({
935
+ pathParams: { workspaceId: workspace },
855
936
  body: { email, role },
856
937
  ...this.extraProps
857
938
  });
858
939
  }
859
- updateWorkspaceMemberInvite(workspaceId, inviteId, role) {
860
- return operationsByTag.workspaces.updateWorkspaceMemberInvite({
861
- pathParams: { workspaceId, inviteId },
940
+ updateWorkspaceMemberInvite({
941
+ workspace,
942
+ invite,
943
+ role
944
+ }) {
945
+ return operationsByTag.invites.updateWorkspaceMemberInvite({
946
+ pathParams: { workspaceId: workspace, inviteId: invite },
862
947
  body: { role },
863
948
  ...this.extraProps
864
949
  });
865
950
  }
866
- cancelWorkspaceMemberInvite(workspaceId, inviteId) {
867
- return operationsByTag.workspaces.cancelWorkspaceMemberInvite({
868
- pathParams: { workspaceId, inviteId },
951
+ cancelWorkspaceMemberInvite({
952
+ workspace,
953
+ invite
954
+ }) {
955
+ return operationsByTag.invites.cancelWorkspaceMemberInvite({
956
+ pathParams: { workspaceId: workspace, inviteId: invite },
869
957
  ...this.extraProps
870
958
  });
871
959
  }
872
- resendWorkspaceMemberInvite(workspaceId, inviteId) {
873
- return operationsByTag.workspaces.resendWorkspaceMemberInvite({
874
- pathParams: { workspaceId, inviteId },
960
+ acceptWorkspaceMemberInvite({
961
+ workspace,
962
+ key
963
+ }) {
964
+ return operationsByTag.invites.acceptWorkspaceMemberInvite({
965
+ pathParams: { workspaceId: workspace, inviteKey: key },
875
966
  ...this.extraProps
876
967
  });
877
968
  }
878
- acceptWorkspaceMemberInvite(workspaceId, inviteKey) {
879
- return operationsByTag.workspaces.acceptWorkspaceMemberInvite({
880
- pathParams: { workspaceId, inviteKey },
969
+ resendWorkspaceMemberInvite({
970
+ workspace,
971
+ invite
972
+ }) {
973
+ return operationsByTag.invites.resendWorkspaceMemberInvite({
974
+ pathParams: { workspaceId: workspace, inviteId: invite },
881
975
  ...this.extraProps
882
976
  });
883
977
  }
884
978
  }
885
- class DatabaseApi {
979
+ class BranchApi {
886
980
  constructor(extraProps) {
887
981
  this.extraProps = extraProps;
888
982
  }
889
- getDatabaseList(workspace) {
890
- return operationsByTag.database.getDatabaseList({
891
- pathParams: { workspace },
892
- ...this.extraProps
893
- });
894
- }
895
- createDatabase(workspace, dbName, options = {}) {
896
- return operationsByTag.database.createDatabase({
897
- pathParams: { workspace, dbName },
898
- body: options,
899
- ...this.extraProps
900
- });
901
- }
902
- deleteDatabase(workspace, dbName) {
903
- return operationsByTag.database.deleteDatabase({
904
- pathParams: { workspace, dbName },
905
- ...this.extraProps
906
- });
907
- }
908
- getDatabaseMetadata(workspace, dbName) {
909
- return operationsByTag.database.getDatabaseMetadata({
910
- pathParams: { workspace, dbName },
911
- ...this.extraProps
912
- });
913
- }
914
- updateDatabaseMetadata(workspace, dbName, options = {}) {
915
- return operationsByTag.database.updateDatabaseMetadata({
916
- pathParams: { workspace, dbName },
917
- body: options,
918
- ...this.extraProps
919
- });
920
- }
921
- getGitBranchesMapping(workspace, dbName) {
922
- return operationsByTag.database.getGitBranchesMapping({
923
- pathParams: { workspace, dbName },
983
+ getBranchList({
984
+ workspace,
985
+ region,
986
+ database
987
+ }) {
988
+ return operationsByTag.branch.getBranchList({
989
+ pathParams: { workspace, region, dbName: database },
924
990
  ...this.extraProps
925
991
  });
926
992
  }
927
- addGitBranchesEntry(workspace, dbName, body) {
928
- return operationsByTag.database.addGitBranchesEntry({
929
- pathParams: { workspace, dbName },
930
- body,
993
+ getBranchDetails({
994
+ workspace,
995
+ region,
996
+ database,
997
+ branch
998
+ }) {
999
+ return operationsByTag.branch.getBranchDetails({
1000
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
931
1001
  ...this.extraProps
932
1002
  });
933
1003
  }
934
- removeGitBranchesEntry(workspace, dbName, gitBranch) {
935
- return operationsByTag.database.removeGitBranchesEntry({
936
- pathParams: { workspace, dbName },
937
- queryParams: { gitBranch },
1004
+ createBranch({
1005
+ workspace,
1006
+ region,
1007
+ database,
1008
+ branch,
1009
+ from,
1010
+ metadata
1011
+ }) {
1012
+ return operationsByTag.branch.createBranch({
1013
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1014
+ body: { from, metadata },
938
1015
  ...this.extraProps
939
1016
  });
940
1017
  }
941
- resolveBranch(workspace, dbName, gitBranch, fallbackBranch) {
942
- return operationsByTag.database.resolveBranch({
943
- pathParams: { workspace, dbName },
944
- queryParams: { gitBranch, fallbackBranch },
1018
+ deleteBranch({
1019
+ workspace,
1020
+ region,
1021
+ database,
1022
+ branch
1023
+ }) {
1024
+ return operationsByTag.branch.deleteBranch({
1025
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
945
1026
  ...this.extraProps
946
1027
  });
947
1028
  }
948
- }
949
- class BranchApi {
950
- constructor(extraProps) {
951
- this.extraProps = extraProps;
952
- }
953
- getBranchList(workspace, dbName) {
954
- return operationsByTag.branch.getBranchList({
955
- pathParams: { workspace, dbName },
1029
+ updateBranchMetadata({
1030
+ workspace,
1031
+ region,
1032
+ database,
1033
+ branch,
1034
+ metadata
1035
+ }) {
1036
+ return operationsByTag.branch.updateBranchMetadata({
1037
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1038
+ body: metadata,
956
1039
  ...this.extraProps
957
1040
  });
958
1041
  }
959
- getBranchDetails(workspace, database, branch) {
960
- return operationsByTag.branch.getBranchDetails({
961
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1042
+ getBranchMetadata({
1043
+ workspace,
1044
+ region,
1045
+ database,
1046
+ branch
1047
+ }) {
1048
+ return operationsByTag.branch.getBranchMetadata({
1049
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
962
1050
  ...this.extraProps
963
1051
  });
964
1052
  }
965
- createBranch(workspace, database, branch, from, options = {}) {
966
- return operationsByTag.branch.createBranch({
967
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
968
- queryParams: isString(from) ? { from } : void 0,
969
- body: options,
1053
+ getBranchStats({
1054
+ workspace,
1055
+ region,
1056
+ database,
1057
+ branch
1058
+ }) {
1059
+ return operationsByTag.branch.getBranchStats({
1060
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
970
1061
  ...this.extraProps
971
1062
  });
972
1063
  }
973
- deleteBranch(workspace, database, branch) {
974
- return operationsByTag.branch.deleteBranch({
975
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1064
+ getGitBranchesMapping({
1065
+ workspace,
1066
+ region,
1067
+ database
1068
+ }) {
1069
+ return operationsByTag.branch.getGitBranchesMapping({
1070
+ pathParams: { workspace, region, dbName: database },
976
1071
  ...this.extraProps
977
1072
  });
978
1073
  }
979
- updateBranchMetadata(workspace, database, branch, metadata = {}) {
980
- return operationsByTag.branch.updateBranchMetadata({
981
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
982
- body: metadata,
1074
+ addGitBranchesEntry({
1075
+ workspace,
1076
+ region,
1077
+ database,
1078
+ gitBranch,
1079
+ xataBranch
1080
+ }) {
1081
+ return operationsByTag.branch.addGitBranchesEntry({
1082
+ pathParams: { workspace, region, dbName: database },
1083
+ body: { gitBranch, xataBranch },
983
1084
  ...this.extraProps
984
1085
  });
985
1086
  }
986
- getBranchMetadata(workspace, database, branch) {
987
- return operationsByTag.branch.getBranchMetadata({
988
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1087
+ removeGitBranchesEntry({
1088
+ workspace,
1089
+ region,
1090
+ database,
1091
+ gitBranch
1092
+ }) {
1093
+ return operationsByTag.branch.removeGitBranchesEntry({
1094
+ pathParams: { workspace, region, dbName: database },
1095
+ queryParams: { gitBranch },
989
1096
  ...this.extraProps
990
1097
  });
991
1098
  }
992
- getBranchStats(workspace, database, branch) {
993
- return operationsByTag.branch.getBranchStats({
994
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1099
+ resolveBranch({
1100
+ workspace,
1101
+ region,
1102
+ database,
1103
+ gitBranch,
1104
+ fallbackBranch
1105
+ }) {
1106
+ return operationsByTag.branch.resolveBranch({
1107
+ pathParams: { workspace, region, dbName: database },
1108
+ queryParams: { gitBranch, fallbackBranch },
995
1109
  ...this.extraProps
996
1110
  });
997
1111
  }
@@ -1000,67 +1114,134 @@ class TableApi {
1000
1114
  constructor(extraProps) {
1001
1115
  this.extraProps = extraProps;
1002
1116
  }
1003
- createTable(workspace, database, branch, tableName) {
1117
+ createTable({
1118
+ workspace,
1119
+ region,
1120
+ database,
1121
+ branch,
1122
+ table
1123
+ }) {
1004
1124
  return operationsByTag.table.createTable({
1005
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1125
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1006
1126
  ...this.extraProps
1007
1127
  });
1008
1128
  }
1009
- deleteTable(workspace, database, branch, tableName) {
1129
+ deleteTable({
1130
+ workspace,
1131
+ region,
1132
+ database,
1133
+ branch,
1134
+ table
1135
+ }) {
1010
1136
  return operationsByTag.table.deleteTable({
1011
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1137
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1012
1138
  ...this.extraProps
1013
1139
  });
1014
1140
  }
1015
- updateTable(workspace, database, branch, tableName, options) {
1141
+ updateTable({
1142
+ workspace,
1143
+ region,
1144
+ database,
1145
+ branch,
1146
+ table,
1147
+ update
1148
+ }) {
1016
1149
  return operationsByTag.table.updateTable({
1017
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1018
- body: options,
1150
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1151
+ body: update,
1019
1152
  ...this.extraProps
1020
1153
  });
1021
1154
  }
1022
- getTableSchema(workspace, database, branch, tableName) {
1155
+ getTableSchema({
1156
+ workspace,
1157
+ region,
1158
+ database,
1159
+ branch,
1160
+ table
1161
+ }) {
1023
1162
  return operationsByTag.table.getTableSchema({
1024
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1163
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1025
1164
  ...this.extraProps
1026
1165
  });
1027
1166
  }
1028
- setTableSchema(workspace, database, branch, tableName, options) {
1167
+ setTableSchema({
1168
+ workspace,
1169
+ region,
1170
+ database,
1171
+ branch,
1172
+ table,
1173
+ schema
1174
+ }) {
1029
1175
  return operationsByTag.table.setTableSchema({
1030
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1031
- body: options,
1176
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1177
+ body: schema,
1032
1178
  ...this.extraProps
1033
1179
  });
1034
1180
  }
1035
- getTableColumns(workspace, database, branch, tableName) {
1181
+ getTableColumns({
1182
+ workspace,
1183
+ region,
1184
+ database,
1185
+ branch,
1186
+ table
1187
+ }) {
1036
1188
  return operationsByTag.table.getTableColumns({
1037
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1189
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1038
1190
  ...this.extraProps
1039
1191
  });
1040
1192
  }
1041
- addTableColumn(workspace, database, branch, tableName, column) {
1193
+ addTableColumn({
1194
+ workspace,
1195
+ region,
1196
+ database,
1197
+ branch,
1198
+ table,
1199
+ column
1200
+ }) {
1042
1201
  return operationsByTag.table.addTableColumn({
1043
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1202
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1044
1203
  body: column,
1045
1204
  ...this.extraProps
1046
1205
  });
1047
1206
  }
1048
- getColumn(workspace, database, branch, tableName, columnName) {
1207
+ getColumn({
1208
+ workspace,
1209
+ region,
1210
+ database,
1211
+ branch,
1212
+ table,
1213
+ column
1214
+ }) {
1049
1215
  return operationsByTag.table.getColumn({
1050
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName },
1216
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
1051
1217
  ...this.extraProps
1052
1218
  });
1053
1219
  }
1054
- deleteColumn(workspace, database, branch, tableName, columnName) {
1055
- return operationsByTag.table.deleteColumn({
1056
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName },
1220
+ updateColumn({
1221
+ workspace,
1222
+ region,
1223
+ database,
1224
+ branch,
1225
+ table,
1226
+ column,
1227
+ update
1228
+ }) {
1229
+ return operationsByTag.table.updateColumn({
1230
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
1231
+ body: update,
1057
1232
  ...this.extraProps
1058
1233
  });
1059
1234
  }
1060
- updateColumn(workspace, database, branch, tableName, columnName, options) {
1061
- return operationsByTag.table.updateColumn({
1062
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName },
1063
- body: options,
1235
+ deleteColumn({
1236
+ workspace,
1237
+ region,
1238
+ database,
1239
+ branch,
1240
+ table,
1241
+ column
1242
+ }) {
1243
+ return operationsByTag.table.deleteColumn({
1244
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, columnName: column },
1064
1245
  ...this.extraProps
1065
1246
  });
1066
1247
  }
@@ -1069,85 +1250,215 @@ class RecordsApi {
1069
1250
  constructor(extraProps) {
1070
1251
  this.extraProps = extraProps;
1071
1252
  }
1072
- insertRecord(workspace, database, branch, tableName, record, options = {}) {
1253
+ insertRecord({
1254
+ workspace,
1255
+ region,
1256
+ database,
1257
+ branch,
1258
+ table,
1259
+ record,
1260
+ columns
1261
+ }) {
1073
1262
  return operationsByTag.records.insertRecord({
1074
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1075
- queryParams: options,
1263
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1264
+ queryParams: { columns },
1076
1265
  body: record,
1077
1266
  ...this.extraProps
1078
1267
  });
1079
1268
  }
1080
- insertRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
1269
+ getRecord({
1270
+ workspace,
1271
+ region,
1272
+ database,
1273
+ branch,
1274
+ table,
1275
+ id,
1276
+ columns
1277
+ }) {
1278
+ return operationsByTag.records.getRecord({
1279
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
1280
+ queryParams: { columns },
1281
+ ...this.extraProps
1282
+ });
1283
+ }
1284
+ insertRecordWithID({
1285
+ workspace,
1286
+ region,
1287
+ database,
1288
+ branch,
1289
+ table,
1290
+ id,
1291
+ record,
1292
+ columns,
1293
+ createOnly,
1294
+ ifVersion
1295
+ }) {
1081
1296
  return operationsByTag.records.insertRecordWithID({
1082
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
1083
- queryParams: options,
1297
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
1298
+ queryParams: { columns, createOnly, ifVersion },
1084
1299
  body: record,
1085
1300
  ...this.extraProps
1086
1301
  });
1087
1302
  }
1088
- updateRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
1303
+ updateRecordWithID({
1304
+ workspace,
1305
+ region,
1306
+ database,
1307
+ branch,
1308
+ table,
1309
+ id,
1310
+ record,
1311
+ columns,
1312
+ ifVersion
1313
+ }) {
1089
1314
  return operationsByTag.records.updateRecordWithID({
1090
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
1091
- queryParams: options,
1315
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
1316
+ queryParams: { columns, ifVersion },
1092
1317
  body: record,
1093
1318
  ...this.extraProps
1094
1319
  });
1095
1320
  }
1096
- upsertRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
1321
+ upsertRecordWithID({
1322
+ workspace,
1323
+ region,
1324
+ database,
1325
+ branch,
1326
+ table,
1327
+ id,
1328
+ record,
1329
+ columns,
1330
+ ifVersion
1331
+ }) {
1097
1332
  return operationsByTag.records.upsertRecordWithID({
1098
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
1099
- queryParams: options,
1333
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
1334
+ queryParams: { columns, ifVersion },
1100
1335
  body: record,
1101
1336
  ...this.extraProps
1102
1337
  });
1103
1338
  }
1104
- deleteRecord(workspace, database, branch, tableName, recordId, options = {}) {
1339
+ deleteRecord({
1340
+ workspace,
1341
+ region,
1342
+ database,
1343
+ branch,
1344
+ table,
1345
+ id,
1346
+ columns
1347
+ }) {
1105
1348
  return operationsByTag.records.deleteRecord({
1106
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
1107
- queryParams: options,
1108
- ...this.extraProps
1109
- });
1110
- }
1111
- getRecord(workspace, database, branch, tableName, recordId, options = {}) {
1112
- return operationsByTag.records.getRecord({
1113
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId },
1114
- queryParams: options,
1349
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table, recordId: id },
1350
+ queryParams: { columns },
1115
1351
  ...this.extraProps
1116
1352
  });
1117
1353
  }
1118
- bulkInsertTableRecords(workspace, database, branch, tableName, records, options = {}) {
1354
+ bulkInsertTableRecords({
1355
+ workspace,
1356
+ region,
1357
+ database,
1358
+ branch,
1359
+ table,
1360
+ records,
1361
+ columns
1362
+ }) {
1119
1363
  return operationsByTag.records.bulkInsertTableRecords({
1120
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1121
- queryParams: options,
1364
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1365
+ queryParams: { columns },
1122
1366
  body: { records },
1123
1367
  ...this.extraProps
1124
1368
  });
1125
1369
  }
1126
- queryTable(workspace, database, branch, tableName, query) {
1127
- return operationsByTag.records.queryTable({
1128
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1129
- body: query,
1130
- ...this.extraProps
1131
- });
1132
- }
1133
- searchTable(workspace, database, branch, tableName, query) {
1134
- return operationsByTag.records.searchTable({
1135
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1136
- body: query,
1137
- ...this.extraProps
1138
- });
1139
- }
1140
- searchBranch(workspace, database, branch, query) {
1141
- return operationsByTag.records.searchBranch({
1142
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1143
- body: query,
1144
- ...this.extraProps
1145
- });
1370
+ }
1371
+ class SearchAndFilterApi {
1372
+ constructor(extraProps) {
1373
+ this.extraProps = extraProps;
1146
1374
  }
1147
- summarizeTable(workspace, database, branch, tableName, query) {
1148
- return operationsByTag.records.summarizeTable({
1149
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName },
1150
- body: query,
1375
+ queryTable({
1376
+ workspace,
1377
+ region,
1378
+ database,
1379
+ branch,
1380
+ table,
1381
+ filter,
1382
+ sort,
1383
+ page,
1384
+ columns,
1385
+ consistency
1386
+ }) {
1387
+ return operationsByTag.searchAndFilter.queryTable({
1388
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1389
+ body: { filter, sort, page, columns, consistency },
1390
+ ...this.extraProps
1391
+ });
1392
+ }
1393
+ searchTable({
1394
+ workspace,
1395
+ region,
1396
+ database,
1397
+ branch,
1398
+ table,
1399
+ query,
1400
+ fuzziness,
1401
+ target,
1402
+ prefix,
1403
+ filter,
1404
+ highlight,
1405
+ boosters
1406
+ }) {
1407
+ return operationsByTag.searchAndFilter.searchTable({
1408
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1409
+ body: { query, fuzziness, target, prefix, filter, highlight, boosters },
1410
+ ...this.extraProps
1411
+ });
1412
+ }
1413
+ searchBranch({
1414
+ workspace,
1415
+ region,
1416
+ database,
1417
+ branch,
1418
+ tables,
1419
+ query,
1420
+ fuzziness,
1421
+ prefix,
1422
+ highlight
1423
+ }) {
1424
+ return operationsByTag.searchAndFilter.searchBranch({
1425
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1426
+ body: { tables, query, fuzziness, prefix, highlight },
1427
+ ...this.extraProps
1428
+ });
1429
+ }
1430
+ summarizeTable({
1431
+ workspace,
1432
+ region,
1433
+ database,
1434
+ branch,
1435
+ table,
1436
+ filter,
1437
+ columns,
1438
+ summaries,
1439
+ sort,
1440
+ summariesFilter,
1441
+ page,
1442
+ consistency
1443
+ }) {
1444
+ return operationsByTag.searchAndFilter.summarizeTable({
1445
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1446
+ body: { filter, columns, summaries, sort, summariesFilter, page, consistency },
1447
+ ...this.extraProps
1448
+ });
1449
+ }
1450
+ aggregateTable({
1451
+ workspace,
1452
+ region,
1453
+ database,
1454
+ branch,
1455
+ table,
1456
+ filter,
1457
+ aggs
1458
+ }) {
1459
+ return operationsByTag.searchAndFilter.aggregateTable({
1460
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, tableName: table },
1461
+ body: { filter, aggs },
1151
1462
  ...this.extraProps
1152
1463
  });
1153
1464
  }
@@ -1156,123 +1467,281 @@ class MigrationRequestsApi {
1156
1467
  constructor(extraProps) {
1157
1468
  this.extraProps = extraProps;
1158
1469
  }
1159
- listMigrationRequests(workspace, database, options = {}) {
1160
- return operationsByTag.migrationRequests.listMigrationRequests({
1161
- pathParams: { workspace, dbName: database },
1162
- body: options,
1163
- ...this.extraProps
1164
- });
1165
- }
1166
- createMigrationRequest(workspace, database, options) {
1470
+ queryMigrationRequests({
1471
+ workspace,
1472
+ region,
1473
+ database,
1474
+ filter,
1475
+ sort,
1476
+ page,
1477
+ columns
1478
+ }) {
1479
+ return operationsByTag.migrationRequests.queryMigrationRequests({
1480
+ pathParams: { workspace, region, dbName: database },
1481
+ body: { filter, sort, page, columns },
1482
+ ...this.extraProps
1483
+ });
1484
+ }
1485
+ createMigrationRequest({
1486
+ workspace,
1487
+ region,
1488
+ database,
1489
+ migration
1490
+ }) {
1167
1491
  return operationsByTag.migrationRequests.createMigrationRequest({
1168
- pathParams: { workspace, dbName: database },
1169
- body: options,
1492
+ pathParams: { workspace, region, dbName: database },
1493
+ body: migration,
1170
1494
  ...this.extraProps
1171
1495
  });
1172
1496
  }
1173
- getMigrationRequest(workspace, database, migrationRequest) {
1497
+ getMigrationRequest({
1498
+ workspace,
1499
+ region,
1500
+ database,
1501
+ migrationRequest
1502
+ }) {
1174
1503
  return operationsByTag.migrationRequests.getMigrationRequest({
1175
- pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
1504
+ pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
1176
1505
  ...this.extraProps
1177
1506
  });
1178
1507
  }
1179
- updateMigrationRequest(workspace, database, migrationRequest, options) {
1508
+ updateMigrationRequest({
1509
+ workspace,
1510
+ region,
1511
+ database,
1512
+ migrationRequest,
1513
+ update
1514
+ }) {
1180
1515
  return operationsByTag.migrationRequests.updateMigrationRequest({
1181
- pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
1182
- body: options,
1516
+ pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
1517
+ body: update,
1183
1518
  ...this.extraProps
1184
1519
  });
1185
1520
  }
1186
- listMigrationRequestsCommits(workspace, database, migrationRequest, options = {}) {
1521
+ listMigrationRequestsCommits({
1522
+ workspace,
1523
+ region,
1524
+ database,
1525
+ migrationRequest,
1526
+ page
1527
+ }) {
1187
1528
  return operationsByTag.migrationRequests.listMigrationRequestsCommits({
1188
- pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
1189
- body: options,
1529
+ pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
1530
+ body: { page },
1190
1531
  ...this.extraProps
1191
1532
  });
1192
1533
  }
1193
- compareMigrationRequest(workspace, database, migrationRequest) {
1534
+ compareMigrationRequest({
1535
+ workspace,
1536
+ region,
1537
+ database,
1538
+ migrationRequest
1539
+ }) {
1194
1540
  return operationsByTag.migrationRequests.compareMigrationRequest({
1195
- pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
1541
+ pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
1196
1542
  ...this.extraProps
1197
1543
  });
1198
1544
  }
1199
- getMigrationRequestIsMerged(workspace, database, migrationRequest) {
1545
+ getMigrationRequestIsMerged({
1546
+ workspace,
1547
+ region,
1548
+ database,
1549
+ migrationRequest
1550
+ }) {
1200
1551
  return operationsByTag.migrationRequests.getMigrationRequestIsMerged({
1201
- pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
1552
+ pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
1202
1553
  ...this.extraProps
1203
1554
  });
1204
1555
  }
1205
- mergeMigrationRequest(workspace, database, migrationRequest) {
1556
+ mergeMigrationRequest({
1557
+ workspace,
1558
+ region,
1559
+ database,
1560
+ migrationRequest
1561
+ }) {
1206
1562
  return operationsByTag.migrationRequests.mergeMigrationRequest({
1207
- pathParams: { workspace, dbName: database, mrNumber: migrationRequest },
1563
+ pathParams: { workspace, region, dbName: database, mrNumber: migrationRequest },
1208
1564
  ...this.extraProps
1209
1565
  });
1210
1566
  }
1211
1567
  }
1212
- class BranchSchemaApi {
1568
+ class MigrationsApi {
1213
1569
  constructor(extraProps) {
1214
1570
  this.extraProps = extraProps;
1215
1571
  }
1216
- getBranchMigrationHistory(workspace, database, branch, options = {}) {
1217
- return operationsByTag.branchSchema.getBranchMigrationHistory({
1218
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1219
- body: options,
1572
+ getBranchMigrationHistory({
1573
+ workspace,
1574
+ region,
1575
+ database,
1576
+ branch,
1577
+ limit,
1578
+ startFrom
1579
+ }) {
1580
+ return operationsByTag.migrations.getBranchMigrationHistory({
1581
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1582
+ body: { limit, startFrom },
1583
+ ...this.extraProps
1584
+ });
1585
+ }
1586
+ getBranchMigrationPlan({
1587
+ workspace,
1588
+ region,
1589
+ database,
1590
+ branch,
1591
+ schema
1592
+ }) {
1593
+ return operationsByTag.migrations.getBranchMigrationPlan({
1594
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1595
+ body: schema,
1220
1596
  ...this.extraProps
1221
1597
  });
1222
1598
  }
1223
- executeBranchMigrationPlan(workspace, database, branch, migrationPlan) {
1224
- return operationsByTag.branchSchema.executeBranchMigrationPlan({
1225
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1226
- body: migrationPlan,
1599
+ executeBranchMigrationPlan({
1600
+ workspace,
1601
+ region,
1602
+ database,
1603
+ branch,
1604
+ plan
1605
+ }) {
1606
+ return operationsByTag.migrations.executeBranchMigrationPlan({
1607
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1608
+ body: plan,
1227
1609
  ...this.extraProps
1228
1610
  });
1229
1611
  }
1230
- getBranchMigrationPlan(workspace, database, branch, schema) {
1231
- return operationsByTag.branchSchema.getBranchMigrationPlan({
1232
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1233
- body: schema,
1612
+ getBranchSchemaHistory({
1613
+ workspace,
1614
+ region,
1615
+ database,
1616
+ branch,
1617
+ page
1618
+ }) {
1619
+ return operationsByTag.migrations.getBranchSchemaHistory({
1620
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1621
+ body: { page },
1234
1622
  ...this.extraProps
1235
1623
  });
1236
1624
  }
1237
- compareBranchWithUserSchema(workspace, database, branch, schema) {
1238
- return operationsByTag.branchSchema.compareBranchWithUserSchema({
1239
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1625
+ compareBranchWithUserSchema({
1626
+ workspace,
1627
+ region,
1628
+ database,
1629
+ branch,
1630
+ schema
1631
+ }) {
1632
+ return operationsByTag.migrations.compareBranchWithUserSchema({
1633
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1240
1634
  body: { schema },
1241
1635
  ...this.extraProps
1242
1636
  });
1243
1637
  }
1244
- compareBranchSchemas(workspace, database, branch, branchName, schema) {
1245
- return operationsByTag.branchSchema.compareBranchSchemas({
1246
- pathParams: { workspace, dbBranchName: `${database}:${branch}`, branchName },
1638
+ compareBranchSchemas({
1639
+ workspace,
1640
+ region,
1641
+ database,
1642
+ branch,
1643
+ compare,
1644
+ schema
1645
+ }) {
1646
+ return operationsByTag.migrations.compareBranchSchemas({
1647
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}`, branchName: compare },
1247
1648
  body: { schema },
1248
1649
  ...this.extraProps
1249
1650
  });
1250
1651
  }
1251
- updateBranchSchema(workspace, database, branch, migration) {
1252
- return operationsByTag.branchSchema.updateBranchSchema({
1253
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1652
+ updateBranchSchema({
1653
+ workspace,
1654
+ region,
1655
+ database,
1656
+ branch,
1657
+ migration
1658
+ }) {
1659
+ return operationsByTag.migrations.updateBranchSchema({
1660
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1254
1661
  body: migration,
1255
1662
  ...this.extraProps
1256
1663
  });
1257
1664
  }
1258
- previewBranchSchemaEdit(workspace, database, branch, migration) {
1259
- return operationsByTag.branchSchema.previewBranchSchemaEdit({
1260
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1261
- body: migration,
1665
+ previewBranchSchemaEdit({
1666
+ workspace,
1667
+ region,
1668
+ database,
1669
+ branch,
1670
+ data
1671
+ }) {
1672
+ return operationsByTag.migrations.previewBranchSchemaEdit({
1673
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1674
+ body: data,
1262
1675
  ...this.extraProps
1263
1676
  });
1264
1677
  }
1265
- applyBranchSchemaEdit(workspace, database, branch, edits) {
1266
- return operationsByTag.branchSchema.applyBranchSchemaEdit({
1267
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1678
+ applyBranchSchemaEdit({
1679
+ workspace,
1680
+ region,
1681
+ database,
1682
+ branch,
1683
+ edits
1684
+ }) {
1685
+ return operationsByTag.migrations.applyBranchSchemaEdit({
1686
+ pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
1268
1687
  body: { edits },
1269
1688
  ...this.extraProps
1270
1689
  });
1271
1690
  }
1272
- getBranchSchemaHistory(workspace, database, branch, options = {}) {
1273
- return operationsByTag.branchSchema.getBranchSchemaHistory({
1274
- pathParams: { workspace, dbBranchName: `${database}:${branch}` },
1275
- body: options,
1691
+ }
1692
+ class DatabaseApi {
1693
+ constructor(extraProps) {
1694
+ this.extraProps = extraProps;
1695
+ }
1696
+ getDatabaseList({ workspace }) {
1697
+ return operationsByTag.databases.getDatabaseList({
1698
+ pathParams: { workspaceId: workspace },
1699
+ ...this.extraProps
1700
+ });
1701
+ }
1702
+ createDatabase({
1703
+ workspace,
1704
+ database,
1705
+ data
1706
+ }) {
1707
+ return operationsByTag.databases.createDatabase({
1708
+ pathParams: { workspaceId: workspace, dbName: database },
1709
+ body: data,
1710
+ ...this.extraProps
1711
+ });
1712
+ }
1713
+ deleteDatabase({
1714
+ workspace,
1715
+ database
1716
+ }) {
1717
+ return operationsByTag.databases.deleteDatabase({
1718
+ pathParams: { workspaceId: workspace, dbName: database },
1719
+ ...this.extraProps
1720
+ });
1721
+ }
1722
+ getDatabaseMetadata({
1723
+ workspace,
1724
+ database
1725
+ }) {
1726
+ return operationsByTag.databases.getDatabaseMetadata({
1727
+ pathParams: { workspaceId: workspace, dbName: database },
1728
+ ...this.extraProps
1729
+ });
1730
+ }
1731
+ updateDatabaseMetadata({
1732
+ workspace,
1733
+ database,
1734
+ metadata
1735
+ }) {
1736
+ return operationsByTag.databases.updateDatabaseMetadata({
1737
+ pathParams: { workspaceId: workspace, dbName: database },
1738
+ body: metadata,
1739
+ ...this.extraProps
1740
+ });
1741
+ }
1742
+ listRegions({ workspace }) {
1743
+ return operationsByTag.databases.listRegions({
1744
+ pathParams: { workspaceId: workspace },
1276
1745
  ...this.extraProps
1277
1746
  });
1278
1747
  }
@@ -1288,6 +1757,20 @@ class XataApiPlugin {
1288
1757
  class XataPlugin {
1289
1758
  }
1290
1759
 
1760
+ function generateUUID() {
1761
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
1762
+ const r = Math.random() * 16 | 0, v = c == "x" ? r : r & 3 | 8;
1763
+ return v.toString(16);
1764
+ });
1765
+ }
1766
+
1767
+ function cleanFilter(filter) {
1768
+ if (!filter)
1769
+ return void 0;
1770
+ const values = Object.values(filter).filter(Boolean).filter((value) => Array.isArray(value) ? value.length > 0 : true);
1771
+ return values.length > 0 ? filter : void 0;
1772
+ }
1773
+
1291
1774
  var __accessCheck$6 = (obj, member, msg) => {
1292
1775
  if (!member.has(obj))
1293
1776
  throw TypeError("Cannot " + msg);
@@ -1320,11 +1803,11 @@ class Page {
1320
1803
  async previousPage(size, offset) {
1321
1804
  return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, before: this.meta.page.cursor } });
1322
1805
  }
1323
- async firstPage(size, offset) {
1324
- return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, first: this.meta.page.cursor } });
1806
+ async startPage(size, offset) {
1807
+ return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, start: this.meta.page.cursor } });
1325
1808
  }
1326
- async lastPage(size, offset) {
1327
- return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, last: this.meta.page.cursor } });
1809
+ async endPage(size, offset) {
1810
+ return __privateGet$6(this, _query).getPaginated({ pagination: { size, offset, end: this.meta.page.cursor } });
1328
1811
  }
1329
1812
  hasNextPage() {
1330
1813
  return this.meta.page.more;
@@ -1336,7 +1819,7 @@ const PAGINATION_DEFAULT_SIZE = 20;
1336
1819
  const PAGINATION_MAX_OFFSET = 800;
1337
1820
  const PAGINATION_DEFAULT_OFFSET = 0;
1338
1821
  function isCursorPaginationOptions(options) {
1339
- return isDefined(options) && (isDefined(options.first) || isDefined(options.last) || isDefined(options.after) || isDefined(options.before));
1822
+ return isDefined(options) && (isDefined(options.start) || isDefined(options.end) || isDefined(options.after) || isDefined(options.before));
1340
1823
  }
1341
1824
  const _RecordArray = class extends Array {
1342
1825
  constructor(...args) {
@@ -1368,12 +1851,12 @@ const _RecordArray = class extends Array {
1368
1851
  const newPage = await __privateGet$6(this, _page).previousPage(size, offset);
1369
1852
  return new _RecordArray(newPage);
1370
1853
  }
1371
- async firstPage(size, offset) {
1372
- const newPage = await __privateGet$6(this, _page).firstPage(size, offset);
1854
+ async startPage(size, offset) {
1855
+ const newPage = await __privateGet$6(this, _page).startPage(size, offset);
1373
1856
  return new _RecordArray(newPage);
1374
1857
  }
1375
- async lastPage(size, offset) {
1376
- const newPage = await __privateGet$6(this, _page).lastPage(size, offset);
1858
+ async endPage(size, offset) {
1859
+ const newPage = await __privateGet$6(this, _page).endPage(size, offset);
1377
1860
  return new _RecordArray(newPage);
1378
1861
  }
1379
1862
  hasNextPage() {
@@ -1427,7 +1910,7 @@ const _Query = class {
1427
1910
  __privateGet$5(this, _data).filter.$not = data.filter?.$not ?? parent?.filter?.$not;
1428
1911
  __privateGet$5(this, _data).filter.$none = data.filter?.$none ?? parent?.filter?.$none;
1429
1912
  __privateGet$5(this, _data).sort = data.sort ?? parent?.sort;
1430
- __privateGet$5(this, _data).columns = data.columns ?? parent?.columns ?? ["*"];
1913
+ __privateGet$5(this, _data).columns = data.columns ?? parent?.columns;
1431
1914
  __privateGet$5(this, _data).pagination = data.pagination ?? parent?.pagination;
1432
1915
  __privateGet$5(this, _data).cache = data.cache ?? parent?.cache;
1433
1916
  this.any = this.any.bind(this);
@@ -1543,19 +2026,29 @@ const _Query = class {
1543
2026
  throw new Error("No results found.");
1544
2027
  return records[0];
1545
2028
  }
2029
+ async summarize(params = {}) {
2030
+ const { summaries, summariesFilter, ...options } = params;
2031
+ const query = new _Query(
2032
+ __privateGet$5(this, _repository),
2033
+ __privateGet$5(this, _table$1),
2034
+ options,
2035
+ __privateGet$5(this, _data)
2036
+ );
2037
+ return __privateGet$5(this, _repository).summarizeTable(query, summaries, summariesFilter);
2038
+ }
1546
2039
  cache(ttl) {
1547
2040
  return new _Query(__privateGet$5(this, _repository), __privateGet$5(this, _table$1), { cache: ttl }, __privateGet$5(this, _data));
1548
2041
  }
1549
2042
  nextPage(size, offset) {
1550
- return this.firstPage(size, offset);
2043
+ return this.startPage(size, offset);
1551
2044
  }
1552
2045
  previousPage(size, offset) {
1553
- return this.firstPage(size, offset);
2046
+ return this.startPage(size, offset);
1554
2047
  }
1555
- firstPage(size, offset) {
2048
+ startPage(size, offset) {
1556
2049
  return this.getPaginated({ pagination: { size, offset } });
1557
2050
  }
1558
- lastPage(size, offset) {
2051
+ endPage(size, offset) {
1559
2052
  return this.getPaginated({ pagination: { size, offset, before: "end" } });
1560
2053
  }
1561
2054
  hasNextPage() {
@@ -1579,7 +2072,7 @@ cleanFilterConstraint_fn = function(column, value) {
1579
2072
  };
1580
2073
  function cleanParent(data, parent) {
1581
2074
  if (isCursorPaginationOptions(data.pagination)) {
1582
- return { ...parent, sorting: void 0, filter: void 0 };
2075
+ return { ...parent, sort: void 0, filter: void 0 };
1583
2076
  }
1584
2077
  return parent;
1585
2078
  }
@@ -1664,10 +2157,13 @@ class RestRepository extends Query {
1664
2157
  __privateAdd$4(this, _schemaTables$2, void 0);
1665
2158
  __privateAdd$4(this, _trace, void 0);
1666
2159
  __privateSet$4(this, _table, options.table);
1667
- __privateSet$4(this, _getFetchProps, options.pluginOptions.getFetchProps);
1668
2160
  __privateSet$4(this, _db, options.db);
1669
2161
  __privateSet$4(this, _cache, options.pluginOptions.cache);
1670
2162
  __privateSet$4(this, _schemaTables$2, options.schemaTables);
2163
+ __privateSet$4(this, _getFetchProps, async () => {
2164
+ const props = await options.pluginOptions.getFetchProps();
2165
+ return { ...props, sessionID: generateUUID() };
2166
+ });
1671
2167
  const trace = options.pluginOptions.trace ?? defaultTrace;
1672
2168
  __privateSet$4(this, _trace, async (name, fn, options2 = {}) => {
1673
2169
  return trace(name, fn, {
@@ -1678,8 +2174,9 @@ class RestRepository extends Query {
1678
2174
  });
1679
2175
  });
1680
2176
  }
1681
- async create(a, b, c) {
2177
+ async create(a, b, c, d) {
1682
2178
  return __privateGet$4(this, _trace).call(this, "create", async () => {
2179
+ const ifVersion = parseIfVersion(b, c, d);
1683
2180
  if (Array.isArray(a)) {
1684
2181
  if (a.length === 0)
1685
2182
  return [];
@@ -1690,13 +2187,13 @@ class RestRepository extends Query {
1690
2187
  if (a === "")
1691
2188
  throw new Error("The id can't be empty");
1692
2189
  const columns = isStringArray(c) ? c : void 0;
1693
- return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns);
2190
+ return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns, { createOnly: true, ifVersion });
1694
2191
  }
1695
2192
  if (isObject(a) && isString(a.id)) {
1696
2193
  if (a.id === "")
1697
2194
  throw new Error("The id can't be empty");
1698
2195
  const columns = isStringArray(b) ? b : void 0;
1699
- return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns);
2196
+ return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns, { createOnly: true, ifVersion });
1700
2197
  }
1701
2198
  if (isObject(a)) {
1702
2199
  const columns = isStringArray(b) ? b : void 0;
@@ -1727,6 +2224,7 @@ class RestRepository extends Query {
1727
2224
  pathParams: {
1728
2225
  workspace: "{workspaceId}",
1729
2226
  dbBranchName: "{dbBranch}",
2227
+ region: "{region}",
1730
2228
  tableName: __privateGet$4(this, _table),
1731
2229
  recordId: id
1732
2230
  },
@@ -1764,8 +2262,9 @@ class RestRepository extends Query {
1764
2262
  return result;
1765
2263
  });
1766
2264
  }
1767
- async update(a, b, c) {
2265
+ async update(a, b, c, d) {
1768
2266
  return __privateGet$4(this, _trace).call(this, "update", async () => {
2267
+ const ifVersion = parseIfVersion(b, c, d);
1769
2268
  if (Array.isArray(a)) {
1770
2269
  if (a.length === 0)
1771
2270
  return [];
@@ -1777,18 +2276,18 @@ class RestRepository extends Query {
1777
2276
  }
1778
2277
  if (isString(a) && isObject(b)) {
1779
2278
  const columns = isStringArray(c) ? c : void 0;
1780
- return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns);
2279
+ return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns, { ifVersion });
1781
2280
  }
1782
2281
  if (isObject(a) && isString(a.id)) {
1783
2282
  const columns = isStringArray(b) ? b : void 0;
1784
- return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns);
2283
+ return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
1785
2284
  }
1786
2285
  throw new Error("Invalid arguments for update method");
1787
2286
  });
1788
2287
  }
1789
- async updateOrThrow(a, b, c) {
2288
+ async updateOrThrow(a, b, c, d) {
1790
2289
  return __privateGet$4(this, _trace).call(this, "updateOrThrow", async () => {
1791
- const result = await this.update(a, b, c);
2290
+ const result = await this.update(a, b, c, d);
1792
2291
  if (Array.isArray(result)) {
1793
2292
  const missingIds = compact(
1794
2293
  a.filter((_item, index) => result[index] === null).map((item) => extractId(item))
@@ -1805,8 +2304,9 @@ class RestRepository extends Query {
1805
2304
  return result;
1806
2305
  });
1807
2306
  }
1808
- async createOrUpdate(a, b, c) {
2307
+ async createOrUpdate(a, b, c, d) {
1809
2308
  return __privateGet$4(this, _trace).call(this, "createOrUpdate", async () => {
2309
+ const ifVersion = parseIfVersion(b, c, d);
1810
2310
  if (Array.isArray(a)) {
1811
2311
  if (a.length === 0)
1812
2312
  return [];
@@ -1818,15 +2318,35 @@ class RestRepository extends Query {
1818
2318
  }
1819
2319
  if (isString(a) && isObject(b)) {
1820
2320
  const columns = isStringArray(c) ? c : void 0;
1821
- return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a, b, columns);
2321
+ return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a, b, columns, { ifVersion });
1822
2322
  }
1823
2323
  if (isObject(a) && isString(a.id)) {
1824
2324
  const columns = isStringArray(c) ? c : void 0;
1825
- return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns);
2325
+ return __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
1826
2326
  }
1827
2327
  throw new Error("Invalid arguments for createOrUpdate method");
1828
2328
  });
1829
2329
  }
2330
+ async createOrReplace(a, b, c, d) {
2331
+ return __privateGet$4(this, _trace).call(this, "createOrReplace", async () => {
2332
+ const ifVersion = parseIfVersion(b, c, d);
2333
+ if (Array.isArray(a)) {
2334
+ if (a.length === 0)
2335
+ return [];
2336
+ const columns = isStringArray(b) ? b : ["*"];
2337
+ return __privateMethod$2(this, _bulkInsertTableRecords, bulkInsertTableRecords_fn).call(this, a, columns);
2338
+ }
2339
+ if (isString(a) && isObject(b)) {
2340
+ const columns = isStringArray(c) ? c : void 0;
2341
+ return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns, { createOnly: false, ifVersion });
2342
+ }
2343
+ if (isObject(a) && isString(a.id)) {
2344
+ const columns = isStringArray(c) ? c : void 0;
2345
+ return __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns, { createOnly: false, ifVersion });
2346
+ }
2347
+ throw new Error("Invalid arguments for createOrReplace method");
2348
+ });
2349
+ }
1830
2350
  async delete(a, b) {
1831
2351
  return __privateGet$4(this, _trace).call(this, "delete", async () => {
1832
2352
  if (Array.isArray(a)) {
@@ -1868,7 +2388,12 @@ class RestRepository extends Query {
1868
2388
  return __privateGet$4(this, _trace).call(this, "search", async () => {
1869
2389
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1870
2390
  const { records } = await searchTable({
1871
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table) },
2391
+ pathParams: {
2392
+ workspace: "{workspaceId}",
2393
+ dbBranchName: "{dbBranch}",
2394
+ region: "{region}",
2395
+ tableName: __privateGet$4(this, _table)
2396
+ },
1872
2397
  body: {
1873
2398
  query,
1874
2399
  fuzziness: options.fuzziness,
@@ -1883,22 +2408,42 @@ class RestRepository extends Query {
1883
2408
  return records.map((item) => initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), item, ["*"]));
1884
2409
  });
1885
2410
  }
2411
+ async aggregate(aggs, filter) {
2412
+ return __privateGet$4(this, _trace).call(this, "aggregate", async () => {
2413
+ const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
2414
+ const result = await aggregateTable({
2415
+ pathParams: {
2416
+ workspace: "{workspaceId}",
2417
+ dbBranchName: "{dbBranch}",
2418
+ region: "{region}",
2419
+ tableName: __privateGet$4(this, _table)
2420
+ },
2421
+ body: { aggs, filter },
2422
+ ...fetchProps
2423
+ });
2424
+ return result;
2425
+ });
2426
+ }
1886
2427
  async query(query) {
1887
2428
  return __privateGet$4(this, _trace).call(this, "query", async () => {
1888
2429
  const cacheQuery = await __privateMethod$2(this, _getCacheQuery, getCacheQuery_fn).call(this, query);
1889
2430
  if (cacheQuery)
1890
2431
  return new Page(query, cacheQuery.meta, cacheQuery.records);
1891
2432
  const data = query.getQueryOptions();
1892
- const body = {
1893
- filter: cleanFilter(data.filter),
1894
- sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
1895
- page: data.pagination,
1896
- columns: data.columns
1897
- };
1898
2433
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1899
2434
  const { meta, records: objects } = await queryTable({
1900
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table) },
1901
- body,
2435
+ pathParams: {
2436
+ workspace: "{workspaceId}",
2437
+ dbBranchName: "{dbBranch}",
2438
+ region: "{region}",
2439
+ tableName: __privateGet$4(this, _table)
2440
+ },
2441
+ body: {
2442
+ filter: cleanFilter(data.filter),
2443
+ sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
2444
+ page: data.pagination,
2445
+ columns: data.columns ?? ["*"]
2446
+ },
1902
2447
  ...fetchProps
1903
2448
  });
1904
2449
  const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
@@ -1909,6 +2454,30 @@ class RestRepository extends Query {
1909
2454
  return new Page(query, meta, records);
1910
2455
  });
1911
2456
  }
2457
+ async summarizeTable(query, summaries, summariesFilter) {
2458
+ return __privateGet$4(this, _trace).call(this, "summarize", async () => {
2459
+ const data = query.getQueryOptions();
2460
+ const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
2461
+ const result = await summarizeTable({
2462
+ pathParams: {
2463
+ workspace: "{workspaceId}",
2464
+ dbBranchName: "{dbBranch}",
2465
+ region: "{region}",
2466
+ tableName: __privateGet$4(this, _table)
2467
+ },
2468
+ body: {
2469
+ filter: cleanFilter(data.filter),
2470
+ sort: data.sort !== void 0 ? buildSortFilter(data.sort) : void 0,
2471
+ columns: data.columns,
2472
+ page: data.pagination?.size !== void 0 ? { size: data.pagination?.size } : void 0,
2473
+ summaries,
2474
+ summariesFilter
2475
+ },
2476
+ ...fetchProps
2477
+ });
2478
+ return result;
2479
+ });
2480
+ }
1912
2481
  }
1913
2482
  _table = new WeakMap();
1914
2483
  _getFetchProps = new WeakMap();
@@ -1924,6 +2493,7 @@ insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
1924
2493
  pathParams: {
1925
2494
  workspace: "{workspaceId}",
1926
2495
  dbBranchName: "{dbBranch}",
2496
+ region: "{region}",
1927
2497
  tableName: __privateGet$4(this, _table)
1928
2498
  },
1929
2499
  queryParams: { columns },
@@ -1934,18 +2504,19 @@ insertRecordWithoutId_fn = async function(object, columns = ["*"]) {
1934
2504
  return initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), response, columns);
1935
2505
  };
1936
2506
  _insertRecordWithId = new WeakSet();
1937
- insertRecordWithId_fn = async function(recordId, object, columns = ["*"]) {
2507
+ insertRecordWithId_fn = async function(recordId, object, columns = ["*"], { createOnly, ifVersion }) {
1938
2508
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1939
2509
  const record = transformObjectLinks(object);
1940
2510
  const response = await insertRecordWithID({
1941
2511
  pathParams: {
1942
2512
  workspace: "{workspaceId}",
1943
2513
  dbBranchName: "{dbBranch}",
2514
+ region: "{region}",
1944
2515
  tableName: __privateGet$4(this, _table),
1945
2516
  recordId
1946
2517
  },
1947
2518
  body: record,
1948
- queryParams: { createOnly: true, columns },
2519
+ queryParams: { createOnly, columns, ifVersion },
1949
2520
  ...fetchProps
1950
2521
  });
1951
2522
  const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
@@ -1956,7 +2527,12 @@ bulkInsertTableRecords_fn = async function(objects, columns = ["*"]) {
1956
2527
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1957
2528
  const records = objects.map((object) => transformObjectLinks(object));
1958
2529
  const response = await bulkInsertTableRecords({
1959
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table) },
2530
+ pathParams: {
2531
+ workspace: "{workspaceId}",
2532
+ dbBranchName: "{dbBranch}",
2533
+ region: "{region}",
2534
+ tableName: __privateGet$4(this, _table)
2535
+ },
1960
2536
  queryParams: { columns },
1961
2537
  body: { records },
1962
2538
  ...fetchProps
@@ -1968,13 +2544,19 @@ bulkInsertTableRecords_fn = async function(objects, columns = ["*"]) {
1968
2544
  return response.records?.map((item) => initObject(__privateGet$4(this, _db), schemaTables, __privateGet$4(this, _table), item, columns));
1969
2545
  };
1970
2546
  _updateRecordWithID = new WeakSet();
1971
- updateRecordWithID_fn = async function(recordId, object, columns = ["*"]) {
2547
+ updateRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVersion }) {
1972
2548
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1973
2549
  const record = transformObjectLinks(object);
1974
2550
  try {
1975
2551
  const response = await updateRecordWithID({
1976
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table), recordId },
1977
- queryParams: { columns },
2552
+ pathParams: {
2553
+ workspace: "{workspaceId}",
2554
+ dbBranchName: "{dbBranch}",
2555
+ region: "{region}",
2556
+ tableName: __privateGet$4(this, _table),
2557
+ recordId
2558
+ },
2559
+ queryParams: { columns, ifVersion },
1978
2560
  body: record,
1979
2561
  ...fetchProps
1980
2562
  });
@@ -1988,11 +2570,17 @@ updateRecordWithID_fn = async function(recordId, object, columns = ["*"]) {
1988
2570
  }
1989
2571
  };
1990
2572
  _upsertRecordWithID = new WeakSet();
1991
- upsertRecordWithID_fn = async function(recordId, object, columns = ["*"]) {
2573
+ upsertRecordWithID_fn = async function(recordId, object, columns = ["*"], { ifVersion }) {
1992
2574
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
1993
2575
  const response = await upsertRecordWithID({
1994
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table), recordId },
1995
- queryParams: { columns },
2576
+ pathParams: {
2577
+ workspace: "{workspaceId}",
2578
+ dbBranchName: "{dbBranch}",
2579
+ region: "{region}",
2580
+ tableName: __privateGet$4(this, _table),
2581
+ recordId
2582
+ },
2583
+ queryParams: { columns, ifVersion },
1996
2584
  body: object,
1997
2585
  ...fetchProps
1998
2586
  });
@@ -2004,7 +2592,13 @@ deleteRecord_fn = async function(recordId, columns = ["*"]) {
2004
2592
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
2005
2593
  try {
2006
2594
  const response = await deleteRecord({
2007
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", tableName: __privateGet$4(this, _table), recordId },
2595
+ pathParams: {
2596
+ workspace: "{workspaceId}",
2597
+ dbBranchName: "{dbBranch}",
2598
+ region: "{region}",
2599
+ tableName: __privateGet$4(this, _table),
2600
+ recordId
2601
+ },
2008
2602
  queryParams: { columns },
2009
2603
  ...fetchProps
2010
2604
  });
@@ -2039,7 +2633,7 @@ getSchemaTables_fn$1 = async function() {
2039
2633
  return __privateGet$4(this, _schemaTables$2);
2040
2634
  const fetchProps = await __privateGet$4(this, _getFetchProps).call(this);
2041
2635
  const { schema } = await getBranchDetails({
2042
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
2636
+ pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
2043
2637
  ...fetchProps
2044
2638
  });
2045
2639
  __privateSet$4(this, _schemaTables$2, schema.tables);
@@ -2105,8 +2699,15 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
2105
2699
  result.read = function(columns2) {
2106
2700
  return db[table].read(result["id"], columns2);
2107
2701
  };
2108
- result.update = function(data, columns2) {
2109
- return db[table].update(result["id"], data, columns2);
2702
+ result.update = function(data, b, c) {
2703
+ const columns2 = isStringArray(b) ? b : ["*"];
2704
+ const ifVersion = parseIfVersion(b, c);
2705
+ return db[table].update(result["id"], data, columns2, { ifVersion });
2706
+ };
2707
+ result.replace = function(data, b, c) {
2708
+ const columns2 = isStringArray(b) ? b : ["*"];
2709
+ const ifVersion = parseIfVersion(b, c);
2710
+ return db[table].createOrReplace(result["id"], data, columns2, { ifVersion });
2110
2711
  };
2111
2712
  result.delete = function() {
2112
2713
  return db[table].delete(result["id"]);
@@ -2114,7 +2715,7 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
2114
2715
  result.getMetadata = function() {
2115
2716
  return xata;
2116
2717
  };
2117
- for (const prop of ["read", "update", "delete", "getMetadata"]) {
2718
+ for (const prop of ["read", "update", "replace", "delete", "getMetadata"]) {
2118
2719
  Object.defineProperty(result, prop, { enumerable: false });
2119
2720
  }
2120
2721
  Object.freeze(result);
@@ -2130,12 +2731,6 @@ function extractId(value) {
2130
2731
  return value.id;
2131
2732
  return void 0;
2132
2733
  }
2133
- function cleanFilter(filter) {
2134
- if (!filter)
2135
- return void 0;
2136
- const values = Object.values(filter).filter(Boolean).filter((value) => Array.isArray(value) ? value.length > 0 : true);
2137
- return values.length > 0 ? filter : void 0;
2138
- }
2139
2734
  function isValidColumn(columns, column) {
2140
2735
  if (columns.includes("*"))
2141
2736
  return true;
@@ -2145,6 +2740,14 @@ function isValidColumn(columns, column) {
2145
2740
  }
2146
2741
  return columns.includes(column.name);
2147
2742
  }
2743
+ function parseIfVersion(...args) {
2744
+ for (const arg of args) {
2745
+ if (isObject(arg) && isNumber(arg.ifVersion)) {
2746
+ return arg.ifVersion;
2747
+ }
2748
+ }
2749
+ return void 0;
2750
+ }
2148
2751
 
2149
2752
  var __accessCheck$3 = (obj, member, msg) => {
2150
2753
  if (!member.has(obj))
@@ -2332,7 +2935,7 @@ search_fn = async function(query, options, getFetchProps) {
2332
2935
  const fetchProps = await getFetchProps();
2333
2936
  const { tables, fuzziness, highlight, prefix } = options ?? {};
2334
2937
  const { records } = await searchBranch({
2335
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
2938
+ pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
2336
2939
  body: { tables, query, fuzziness, prefix, highlight },
2337
2940
  ...fetchProps
2338
2941
  });
@@ -2344,7 +2947,7 @@ getSchemaTables_fn = async function(getFetchProps) {
2344
2947
  return __privateGet$1(this, _schemaTables);
2345
2948
  const fetchProps = await getFetchProps();
2346
2949
  const { schema } = await getBranchDetails({
2347
- pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}" },
2950
+ pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
2348
2951
  ...fetchProps
2349
2952
  });
2350
2953
  __privateSet$1(this, _schemaTables, schema.tables);
@@ -2382,14 +2985,17 @@ async function resolveXataBranch(gitBranch, options) {
2382
2985
  "An API key was not defined. Either set the XATA_API_KEY env variable or pass the argument explicitely"
2383
2986
  );
2384
2987
  const [protocol, , host, , dbName] = databaseURL.split("/");
2385
- const [workspace] = host.split(".");
2988
+ const urlParts = parseWorkspacesUrlParts(host);
2989
+ if (!urlParts)
2990
+ throw new Error(`Unable to parse workspace and region: ${databaseURL}`);
2991
+ const { workspace, region } = urlParts;
2386
2992
  const { fallbackBranch } = getEnvironment();
2387
2993
  const { branch } = await resolveBranch({
2388
2994
  apiKey,
2389
2995
  apiUrl: databaseURL,
2390
2996
  fetchImpl: getFetchImplementation(options?.fetchImpl),
2391
2997
  workspacesApiUrl: `${protocol}//${host}`,
2392
- pathParams: { dbName, workspace },
2998
+ pathParams: { dbName, workspace, region },
2393
2999
  queryParams: { gitBranch, fallbackBranch },
2394
3000
  trace: defaultTrace
2395
3001
  });
@@ -2407,15 +3013,17 @@ async function getDatabaseBranch(branch, options) {
2407
3013
  "An API key was not defined. Either set the XATA_API_KEY env variable or pass the argument explicitely"
2408
3014
  );
2409
3015
  const [protocol, , host, , database] = databaseURL.split("/");
2410
- const [workspace] = host.split(".");
2411
- const dbBranchName = `${database}:${branch}`;
3016
+ const urlParts = parseWorkspacesUrlParts(host);
3017
+ if (!urlParts)
3018
+ throw new Error(`Unable to parse workspace and region: ${databaseURL}`);
3019
+ const { workspace, region } = urlParts;
2412
3020
  try {
2413
3021
  return await getBranchDetails({
2414
3022
  apiKey,
2415
3023
  apiUrl: databaseURL,
2416
3024
  fetchImpl: getFetchImplementation(options?.fetchImpl),
2417
3025
  workspacesApiUrl: `${protocol}//${host}`,
2418
- pathParams: { dbBranchName, workspace },
3026
+ pathParams: { dbBranchName: `${database}:${branch}`, workspace, region },
2419
3027
  trace: defaultTrace
2420
3028
  });
2421
3029
  } catch (err) {
@@ -2506,8 +3114,8 @@ const buildClient = (plugins) => {
2506
3114
  if (!databaseURL) {
2507
3115
  throw new Error("Option databaseURL is required");
2508
3116
  }
2509
- return { fetch, databaseURL, apiKey, branch, cache, trace };
2510
- }, _getFetchProps = new WeakSet(), getFetchProps_fn = async function({ fetch, apiKey, databaseURL, branch, trace }) {
3117
+ return { fetch, databaseURL, apiKey, branch, cache, trace, clientID: generateUUID() };
3118
+ }, _getFetchProps = new WeakSet(), getFetchProps_fn = async function({ fetch, apiKey, databaseURL, branch, trace, clientID }) {
2511
3119
  const branchValue = await __privateMethod(this, _evaluateBranch, evaluateBranch_fn).call(this, branch);
2512
3120
  if (!branchValue)
2513
3121
  throw new Error("Unable to resolve branch value");
@@ -2520,7 +3128,8 @@ const buildClient = (plugins) => {
2520
3128
  const newPath = path.replace(/^\/db\/[^/]+/, hasBranch !== void 0 ? `:${branchValue}` : "");
2521
3129
  return databaseURL + newPath;
2522
3130
  },
2523
- trace
3131
+ trace,
3132
+ clientID
2524
3133
  };
2525
3134
  }, _evaluateBranch = new WeakSet(), evaluateBranch_fn = async function(param) {
2526
3135
  if (__privateGet(this, _branch))
@@ -2654,15 +3263,12 @@ exports.XataPlugin = XataPlugin;
2654
3263
  exports.acceptWorkspaceMemberInvite = acceptWorkspaceMemberInvite;
2655
3264
  exports.addGitBranchesEntry = addGitBranchesEntry;
2656
3265
  exports.addTableColumn = addTableColumn;
3266
+ exports.aggregateTable = aggregateTable;
2657
3267
  exports.applyBranchSchemaEdit = applyBranchSchemaEdit;
3268
+ exports.branchTransaction = branchTransaction;
2658
3269
  exports.buildClient = buildClient;
2659
3270
  exports.buildWorkerRunner = buildWorkerRunner;
2660
3271
  exports.bulkInsertTableRecords = bulkInsertTableRecords;
2661
- exports.cPcreateDatabase = cPcreateDatabase;
2662
- exports.cPdeleteDatabase = cPdeleteDatabase;
2663
- exports.cPgetCPDatabaseMetadata = cPgetCPDatabaseMetadata;
2664
- exports.cPgetDatabaseList = cPgetDatabaseList;
2665
- exports.cPupdateCPDatabaseMetadata = cPupdateCPDatabaseMetadata;
2666
3272
  exports.cancelWorkspaceMemberInvite = cancelWorkspaceMemberInvite;
2667
3273
  exports.compareBranchSchemas = compareBranchSchemas;
2668
3274
  exports.compareBranchWithUserSchema = compareBranchWithUserSchema;
@@ -2674,6 +3280,11 @@ exports.createMigrationRequest = createMigrationRequest;
2674
3280
  exports.createTable = createTable;
2675
3281
  exports.createUserAPIKey = createUserAPIKey;
2676
3282
  exports.createWorkspace = createWorkspace;
3283
+ exports.dEPRECATEDcreateDatabase = dEPRECATEDcreateDatabase;
3284
+ exports.dEPRECATEDdeleteDatabase = dEPRECATEDdeleteDatabase;
3285
+ exports.dEPRECATEDgetDatabaseList = dEPRECATEDgetDatabaseList;
3286
+ exports.dEPRECATEDgetDatabaseMetadata = dEPRECATEDgetDatabaseMetadata;
3287
+ exports.dEPRECATEDupdateDatabaseMetadata = dEPRECATEDupdateDatabaseMetadata;
2677
3288
  exports.deleteBranch = deleteBranch;
2678
3289
  exports.deleteColumn = deleteColumn;
2679
3290
  exports.deleteDatabase = deleteDatabase;
@@ -2703,6 +3314,7 @@ exports.getDatabaseList = getDatabaseList;
2703
3314
  exports.getDatabaseMetadata = getDatabaseMetadata;
2704
3315
  exports.getDatabaseURL = getDatabaseURL;
2705
3316
  exports.getGitBranchesMapping = getGitBranchesMapping;
3317
+ exports.getHostUrl = getHostUrl;
2706
3318
  exports.getMigrationRequest = getMigrationRequest;
2707
3319
  exports.getMigrationRequestIsMerged = getMigrationRequestIsMerged;
2708
3320
  exports.getRecord = getRecord;
@@ -2727,6 +3339,8 @@ exports.insertRecordWithID = insertRecordWithID;
2727
3339
  exports.inviteWorkspaceMember = inviteWorkspaceMember;
2728
3340
  exports.is = is;
2729
3341
  exports.isCursorPaginationOptions = isCursorPaginationOptions;
3342
+ exports.isHostProviderAlias = isHostProviderAlias;
3343
+ exports.isHostProviderBuilder = isHostProviderBuilder;
2730
3344
  exports.isIdentifiable = isIdentifiable;
2731
3345
  exports.isNot = isNot;
2732
3346
  exports.isXataRecord = isXataRecord;
@@ -2734,15 +3348,18 @@ exports.le = le;
2734
3348
  exports.lessEquals = lessEquals;
2735
3349
  exports.lessThan = lessThan;
2736
3350
  exports.lessThanEquals = lessThanEquals;
2737
- exports.listMigrationRequests = listMigrationRequests;
2738
3351
  exports.listMigrationRequestsCommits = listMigrationRequestsCommits;
3352
+ exports.listRegions = listRegions;
2739
3353
  exports.lt = lt;
2740
3354
  exports.lte = lte;
2741
3355
  exports.mergeMigrationRequest = mergeMigrationRequest;
2742
3356
  exports.notExists = notExists;
2743
3357
  exports.operationsByTag = operationsByTag;
3358
+ exports.parseProviderString = parseProviderString;
3359
+ exports.parseWorkspacesUrlParts = parseWorkspacesUrlParts;
2744
3360
  exports.pattern = pattern;
2745
3361
  exports.previewBranchSchemaEdit = previewBranchSchemaEdit;
3362
+ exports.queryMigrationRequests = queryMigrationRequests;
2746
3363
  exports.queryTable = queryTable;
2747
3364
  exports.removeGitBranchesEntry = removeGitBranchesEntry;
2748
3365
  exports.removeWorkspaceMember = removeWorkspaceMember;