@xata.io/client 0.25.0 → 0.25.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.25.0 add-version /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.25.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.25.0 build /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.25.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 1s
8
8
  
9
9
  src/index.ts → dist/index.mjs...
10
- created dist/index.mjs in 661ms
10
+ created dist/index.mjs in 590ms
11
11
  
12
12
  src/index.ts → dist/index.d.ts...
13
13
  (!) Circular dependencies
@@ -15,4 +15,4 @@ src/api/index.ts -> src/plugins.ts -> src/api/index.ts
15
15
  src/api/index.ts -> src/api/client.ts -> src/api/components.ts -> src/api/controlPlaneFetcher.ts -> src/api/errors.ts -> src/api/index.ts
16
16
  src/schema/record.ts -> src/schema/files.ts -> src/schema/record.ts
17
17
  ...and 7 more
18
- created dist/index.d.ts in 5.8s
18
+ created dist/index.d.ts in 4.9s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1101](https://github.com/xataio/client-ts/pull/1101) [`321c33ff`](https://github.com/xataio/client-ts/commit/321c33ff684c416a6cc813be2a970fd8f826b885) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix bug with cancellable timeouts
8
+
3
9
  ## 0.25.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -88,6 +88,18 @@ function chunk(array, chunkSize) {
88
88
  async function timeout(ms) {
89
89
  return new Promise((resolve) => setTimeout(resolve, ms));
90
90
  }
91
+ function timeoutWithCancel(ms) {
92
+ let timeoutId;
93
+ const promise = new Promise((resolve) => {
94
+ timeoutId = setTimeout(() => {
95
+ resolve();
96
+ }, ms);
97
+ });
98
+ return {
99
+ cancel: () => clearTimeout(timeoutId),
100
+ promise
101
+ };
102
+ }
91
103
  function promiseMap(inputValues, mapper) {
92
104
  const reducer = (acc$, inputValue) => acc$.then(
93
105
  (acc) => mapper(inputValue).then((result) => {
@@ -290,7 +302,8 @@ class ApiRequestPool {
290
302
  const start = /* @__PURE__ */ new Date();
291
303
  const fetchImpl = this.getFetch();
292
304
  const runRequest = async (stalled = false) => {
293
- const response = await Promise.race([fetchImpl(url, options), timeout(REQUEST_TIMEOUT).then(() => null)]);
305
+ const { promise, cancel } = timeoutWithCancel(REQUEST_TIMEOUT);
306
+ const response = await Promise.race([fetchImpl(url, options), promise.then(() => null)]).finally(cancel);
294
307
  if (!response) {
295
308
  throw new Error("Request timed out");
296
309
  }
@@ -516,7 +529,7 @@ function defaultOnOpen(response) {
516
529
  }
517
530
  }
518
531
 
519
- const VERSION = "0.25.0";
532
+ const VERSION = "0.25.1";
520
533
 
521
534
  var __defProp$7 = Object.defineProperty;
522
535
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;