@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 +6 -0
- package/dist/index.cjs +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +601 -564
- package/dist/index.mjs +15 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -295,7 +295,7 @@ enqueue_fn = function(task) {
|
|
295
295
|
return promise;
|
296
296
|
};
|
297
297
|
|
298
|
-
const VERSION = "0.21.
|
298
|
+
const VERSION = "0.21.1";
|
299
299
|
|
300
300
|
class ErrorWithCause extends Error {
|
301
301
|
constructor(message, options) {
|
@@ -411,6 +411,7 @@ async function fetch$1({
|
|
411
411
|
method: method.toUpperCase(),
|
412
412
|
body: body ? JSON.stringify(body) : void 0,
|
413
413
|
headers: {
|
414
|
+
"Accept-Encoding": "identity",
|
414
415
|
"Content-Type": "application/json",
|
415
416
|
"X-Xata-Client-ID": clientID ?? "",
|
416
417
|
"X-Xata-Session-ID": sessionID ?? "",
|
@@ -2420,13 +2421,19 @@ class RestRepository extends Query {
|
|
2420
2421
|
const result = await this.read(a, columns);
|
2421
2422
|
return result;
|
2422
2423
|
}
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2424
|
+
try {
|
2425
|
+
if (isString(a) && isObject(b)) {
|
2426
|
+
const columns = isStringArray(c) ? c : void 0;
|
2427
|
+
return await __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 await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
|
2432
|
+
}
|
2433
|
+
} catch (error) {
|
2434
|
+
if (error.status === 422)
|
2435
|
+
return null;
|
2436
|
+
throw error;
|
2430
2437
|
}
|
2431
2438
|
throw new Error("Invalid arguments for update method");
|
2432
2439
|
});
|