@xata.io/client 0.26.4 → 0.26.5

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.26.4 add-version /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.26.5 add-version /home/runner/work/client-ts/client-ts/packages/client
3
3
  > node ../../scripts/add-version-file.mjs
4
4
 
@@ -1,5 +1,5 @@
1
1
 
2
- > @xata.io/client@0.26.4 build /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.26.5 build /home/runner/work/client-ts/client-ts/packages/client
3
3
  > rimraf dist && rollup -c
4
4
 
5
5
  
@@ -7,7 +7,7 @@
7
7
  created dist/index.cjs in 1s
8
8
  
9
9
  src/index.ts → dist/index.mjs...
10
- created dist/index.mjs in 768ms
10
+ created dist/index.mjs in 797ms
11
11
  
12
12
  src/index.ts → dist/index.d.ts...
13
- created dist/index.d.ts in 8.1s
13
+ created dist/index.d.ts in 8s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.26.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1166](https://github.com/xataio/client-ts/pull/1166) [`b9b9058f`](https://github.com/xataio/client-ts/commit/b9b9058f0bc81b660da45318c27191a62f041f21) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix error with Node 16
8
+
3
9
  ## 0.26.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -20,7 +20,8 @@ const TraceAttributes = {
20
20
  HTTP_METHOD: "http.method",
21
21
  HTTP_URL: "http.url",
22
22
  HTTP_ROUTE: "http.route",
23
- HTTP_TARGET: "http.target"
23
+ HTTP_TARGET: "http.target",
24
+ CLOUDFLARE_RAY_ID: "cf.ray"
24
25
  };
25
26
 
26
27
  function notEmpty(value) {
@@ -32,8 +33,15 @@ function compact(arr) {
32
33
  function compactObject(obj) {
33
34
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
34
35
  }
36
+ function isBlob(value) {
37
+ try {
38
+ return value instanceof Blob;
39
+ } catch (error) {
40
+ return false;
41
+ }
42
+ }
35
43
  function isObject(value) {
36
- return Boolean(value) && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date) && !(value instanceof Blob);
44
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date) && !isBlob(value);
37
45
  }
38
46
  function isDefined(value) {
39
47
  return value !== null && value !== void 0;
@@ -265,14 +273,13 @@ var __privateMethod$4 = (obj, member, method) => {
265
273
  return method;
266
274
  };
267
275
  var _fetch, _queue, _concurrency, _enqueue, enqueue_fn;
268
- const REQUEST_TIMEOUT = 3e4;
276
+ const REQUEST_TIMEOUT = 5 * 60 * 1e3;
269
277
  function getFetchImplementation(userFetch) {
270
278
  const globalFetch = typeof fetch !== "undefined" ? fetch : void 0;
271
- const fetchImpl = userFetch ?? globalFetch;
279
+ const globalThisFetch = typeof globalThis !== "undefined" ? globalThis.fetch : void 0;
280
+ const fetchImpl = userFetch ?? globalFetch ?? globalThisFetch;
272
281
  if (!fetchImpl) {
273
- throw new Error(
274
- `Couldn't find \`fetch\`. Install a fetch implementation such as \`node-fetch\` and pass it explicitly.`
275
- );
282
+ throw new Error(`Couldn't find a global \`fetch\`. Pass a fetch implementation explicitly.`);
276
283
  }
277
284
  return fetchImpl;
278
285
  }
@@ -529,7 +536,7 @@ function defaultOnOpen(response) {
529
536
  }
530
537
  }
531
538
 
532
- const VERSION = "0.26.4";
539
+ const VERSION = "0.26.5";
533
540
 
534
541
  var __defProp$7 = Object.defineProperty;
535
542
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -618,7 +625,7 @@ function hostHeader(url) {
618
625
  async function parseBody(body, headers) {
619
626
  if (!isDefined(body))
620
627
  return void 0;
621
- if (body instanceof Blob || typeof body.text === "function") {
628
+ if (isBlob(body) || typeof body.text === "function") {
622
629
  return body;
623
630
  }
624
631
  const { "Content-Type": contentType } = headers ?? {};
@@ -690,7 +697,8 @@ async function fetch$1({
690
697
  [TraceAttributes.HTTP_REQUEST_ID]: requestId,
691
698
  [TraceAttributes.HTTP_STATUS_CODE]: response.status,
692
699
  [TraceAttributes.HTTP_HOST]: host,
693
- [TraceAttributes.HTTP_SCHEME]: protocol?.replace(":", "")
700
+ [TraceAttributes.HTTP_SCHEME]: protocol?.replace(":", ""),
701
+ [TraceAttributes.CLOUDFLARE_RAY_ID]: response.headers?.get("cf-ray") ?? void 0
694
702
  });
695
703
  const message = response.headers?.get("x-xata-message");
696
704
  if (message)
@@ -2673,7 +2681,7 @@ function getContentType(file) {
2673
2681
  if (typeof file === "string") {
2674
2682
  return "text/plain";
2675
2683
  }
2676
- if (file instanceof Blob) {
2684
+ if (isBlob(file)) {
2677
2685
  return file.type;
2678
2686
  }
2679
2687
  try {
@@ -2864,7 +2872,15 @@ const parseInputFileEntry = async (entry) => {
2864
2872
  if (!isDefined(entry))
2865
2873
  return null;
2866
2874
  const { id, name, mediaType, base64Content, enablePublicUrl, signedUrlTimeout } = await entry;
2867
- return compactObject({ id, name, mediaType, base64Content, enablePublicUrl, signedUrlTimeout });
2875
+ return compactObject({
2876
+ id,
2877
+ // Name cannot be an empty string in our API
2878
+ name: name ? name : void 0,
2879
+ mediaType,
2880
+ base64Content,
2881
+ enablePublicUrl,
2882
+ signedUrlTimeout
2883
+ });
2868
2884
  };
2869
2885
 
2870
2886
  function cleanFilter(filter) {