@xata.io/client 0.21.0 → 0.21.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.21.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#781](https://github.com/xataio/client-ts/pull/781) [`fdfa47de`](https://github.com/xataio/client-ts/commit/fdfa47de93ec772170ff00a4341fc14434347df5) Thanks [@SferaDev](https://github.com/SferaDev)! - Send header to disable encoding
8
+
3
9
  ## 0.21.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -297,7 +297,7 @@ enqueue_fn = function(task) {
297
297
  return promise;
298
298
  };
299
299
 
300
- const VERSION = "0.21.0";
300
+ const VERSION = "0.21.1";
301
301
 
302
302
  class ErrorWithCause extends Error {
303
303
  constructor(message, options) {
@@ -413,6 +413,7 @@ async function fetch$1({
413
413
  method: method.toUpperCase(),
414
414
  body: body ? JSON.stringify(body) : void 0,
415
415
  headers: {
416
+ "Accept-Encoding": "identity",
416
417
  "Content-Type": "application/json",
417
418
  "X-Xata-Client-ID": clientID ?? "",
418
419
  "X-Xata-Session-ID": sessionID ?? "",
@@ -2422,13 +2423,19 @@ class RestRepository extends Query {
2422
2423
  const result = await this.read(a, columns);
2423
2424
  return result;
2424
2425
  }
2425
- if (isString(a) && isObject(b)) {
2426
- const columns = isStringArray(c) ? c : void 0;
2427
- return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns, { ifVersion });
2428
- }
2429
- if (isObject(a) && isString(a.id)) {
2430
- const columns = isStringArray(b) ? b : void 0;
2431
- return __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
2426
+ try {
2427
+ if (isString(a) && isObject(b)) {
2428
+ const columns = isStringArray(c) ? c : void 0;
2429
+ return await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns, { ifVersion });
2430
+ }
2431
+ if (isObject(a) && isString(a.id)) {
2432
+ const columns = isStringArray(b) ? b : void 0;
2433
+ return await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
2434
+ }
2435
+ } catch (error) {
2436
+ if (error.status === 422)
2437
+ return null;
2438
+ throw error;
2432
2439
  }
2433
2440
  throw new Error("Invalid arguments for update method");
2434
2441
  });