@xata.io/client 0.27.0 → 0.28.1

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @xata.io/client@0.27.0 add-version /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.28.1 add-version /home/runner/work/client-ts/client-ts/packages/client
3
3
  > node ../../scripts/add-version-file.mjs
4
4
 
@@ -1,13 +1,13 @@
1
1
 
2
- > @xata.io/client@0.27.0 build /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.28.1 build /home/runner/work/client-ts/client-ts/packages/client
3
3
  > rimraf dist && rollup -c
4
4
 
5
5
  
6
6
  src/index.ts → dist/index.cjs...
7
- created dist/index.cjs in 1.1s
7
+ created dist/index.cjs in 733ms
8
8
  
9
9
  src/index.ts → dist/index.mjs...
10
- created dist/index.mjs in 743ms
10
+ created dist/index.mjs in 474ms
11
11
  
12
12
  src/index.ts → dist/index.d.ts...
13
- created dist/index.d.ts in 7.1s
13
+ created dist/index.d.ts in 5.1s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.28.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1281](https://github.com/xataio/client-ts/pull/1281) [`9a7e3f5`](https://github.com/xataio/client-ts/commit/9a7e3f5029e53efc6750e9c86bab936427788209) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix issue with default public access
8
+
9
+ ## 0.28.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#1251](https://github.com/xataio/client-ts/pull/1251) [`e97d1999`](https://github.com/xataio/client-ts/commit/e97d1999f3c25f149213ceca81958e1674624e05) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove Xata Workers support
14
+
3
15
  ## 0.27.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -528,7 +528,7 @@ function defaultOnOpen(response) {
528
528
  }
529
529
  }
530
530
 
531
- const VERSION = "0.27.0";
531
+ const VERSION = "0.28.1";
532
532
 
533
533
  class ErrorWithCause extends Error {
534
534
  constructor(message, options) {
@@ -768,6 +768,13 @@ function parseUrl(url) {
768
768
 
769
769
  const dataPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "dataPlane" });
770
770
 
771
+ const applyMigration = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/pgroll/apply", method: "post", ...variables, signal });
772
+ const pgRollStatus = (variables, signal) => dataPlaneFetch({
773
+ url: "/db/{dbBranchName}/pgroll/status",
774
+ method: "get",
775
+ ...variables,
776
+ signal
777
+ });
771
778
  const getBranchList = (variables, signal) => dataPlaneFetch({
772
779
  url: "/dbs/{dbName}",
773
780
  method: "get",
@@ -982,6 +989,8 @@ const sqlQuery = (variables, signal) => dataPlaneFetch({
982
989
  });
983
990
  const operationsByTag$2 = {
984
991
  branch: {
992
+ applyMigration,
993
+ pgRollStatus,
985
994
  getBranchList,
986
995
  getBranchDetails,
987
996
  createBranch,
@@ -2657,16 +2666,16 @@ function transformImage(url, ...transformations) {
2657
2666
  class XataFile {
2658
2667
  constructor(file) {
2659
2668
  this.id = file.id;
2660
- this.name = file.name || "";
2661
- this.mediaType = file.mediaType || "application/octet-stream";
2669
+ this.name = file.name;
2670
+ this.mediaType = file.mediaType;
2662
2671
  this.base64Content = file.base64Content;
2663
- this.enablePublicUrl = file.enablePublicUrl ?? false;
2664
- this.signedUrlTimeout = file.signedUrlTimeout ?? 300;
2665
- this.size = file.size ?? 0;
2666
- this.version = file.version ?? 1;
2667
- this.url = file.url || "";
2672
+ this.enablePublicUrl = file.enablePublicUrl;
2673
+ this.signedUrlTimeout = file.signedUrlTimeout;
2674
+ this.size = file.size;
2675
+ this.version = file.version;
2676
+ this.url = file.url;
2668
2677
  this.signedUrl = file.signedUrl;
2669
- this.attributes = file.attributes || {};
2678
+ this.attributes = file.attributes;
2670
2679
  }
2671
2680
  static fromBuffer(buffer, options = {}) {
2672
2681
  const base64Content = buffer.toString("base64");
@@ -4363,7 +4372,7 @@ function getContentType(file) {
4363
4372
  if (typeof file === "string") {
4364
4373
  return "text/plain";
4365
4374
  }
4366
- if ("mediaType" in file) {
4375
+ if ("mediaType" in file && file.mediaType !== void 0) {
4367
4376
  return file.mediaType;
4368
4377
  }
4369
4378
  if (isBlob(file)) {
@@ -4755,21 +4764,6 @@ const deserialize = (json) => {
4755
4764
  return defaultSerializer.fromJSON(json);
4756
4765
  };
4757
4766
 
4758
- function buildWorkerRunner(config) {
4759
- return function xataWorker(name, worker) {
4760
- return async (...args) => {
4761
- const url = process.env.NODE_ENV === "development" ? `http://localhost:64749/${name}` : `https://dispatcher.xata.workers.dev/${config.workspace}/${config.worker}/${name}`;
4762
- const result = await fetch(url, {
4763
- method: "POST",
4764
- headers: { "Content-Type": "application/json" },
4765
- body: serialize({ args })
4766
- });
4767
- const text = await result.text();
4768
- return deserialize(text);
4769
- };
4770
- };
4771
- }
4772
-
4773
4767
  class XataError extends Error {
4774
4768
  constructor(message, status) {
4775
4769
  super(message);
@@ -4807,13 +4801,13 @@ exports.addGitBranchesEntry = addGitBranchesEntry;
4807
4801
  exports.addTableColumn = addTableColumn;
4808
4802
  exports.aggregateTable = aggregateTable;
4809
4803
  exports.applyBranchSchemaEdit = applyBranchSchemaEdit;
4804
+ exports.applyMigration = applyMigration;
4810
4805
  exports.askTable = askTable;
4811
4806
  exports.askTableSession = askTableSession;
4812
4807
  exports.branchTransaction = branchTransaction;
4813
4808
  exports.buildClient = buildClient;
4814
4809
  exports.buildPreviewBranchName = buildPreviewBranchName;
4815
4810
  exports.buildProviderString = buildProviderString;
4816
- exports.buildWorkerRunner = buildWorkerRunner;
4817
4811
  exports.bulkInsertTableRecords = bulkInsertTableRecords;
4818
4812
  exports.cancelWorkspaceMemberInvite = cancelWorkspaceMemberInvite;
4819
4813
  exports.compareBranchSchemas = compareBranchSchemas;
@@ -4921,6 +4915,7 @@ exports.operationsByTag = operationsByTag;
4921
4915
  exports.parseProviderString = parseProviderString;
4922
4916
  exports.parseWorkspacesUrlParts = parseWorkspacesUrlParts;
4923
4917
  exports.pattern = pattern;
4918
+ exports.pgRollStatus = pgRollStatus;
4924
4919
  exports.previewBranchSchemaEdit = previewBranchSchemaEdit;
4925
4920
  exports.pushBranchMigrations = pushBranchMigrations;
4926
4921
  exports.putFile = putFile;