@doist/todoist-sdk 10.3.0 → 10.3.2

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.
@@ -68,6 +68,16 @@ async function createDefaultDispatcher() {
68
68
  // undici into their bundle. `getDefaultDispatcher` already short-circuits
69
69
  // outside Node, so this branch only runs when undici is safe to load.
70
70
  const { EnvHttpProxyAgent, interceptors } = await Promise.resolve().then(() => __importStar(require('undici')));
71
+ const agent = new EnvHttpProxyAgent(KEEP_ALIVE_OPTIONS);
72
+ // Some runtimes report `process.versions.node` (so `isNodeEnvironment()`
73
+ // passes) but ship only a partial undici: `interceptors.decompress` is
74
+ // absent and dispatchers have no `.compose`. Bun is the common case. There
75
+ // the proxy agent alone is enough — Bun's `fetch` decompresses
76
+ // gzip/deflate/br/zstd natively — so skip the interceptor instead of
77
+ // crashing on the missing API.
78
+ if (typeof interceptors.decompress !== 'function') {
79
+ return agent;
80
+ }
71
81
  // Compose the response-decompression interceptor so gzip/deflate/br/zstd
72
82
  // bodies are decoded before consumers parse them. Required on Node 24+:
73
83
  // attaching any custom dispatcher to the global `fetch` strips the
@@ -75,7 +85,7 @@ async function createDefaultDispatcher() {
75
85
  // so callers receive raw gzipped bytes and `JSON.parse` fails.
76
86
  // See https://github.com/Doist/todoist-cli/issues/318.
77
87
  const decompress = suppressExperimentalWarningsSync(() => interceptors.decompress());
78
- return new EnvHttpProxyAgent(KEEP_ALIVE_OPTIONS).compose(decompress);
88
+ return agent.compose(decompress);
79
89
  }
80
90
  // undici emits an `ExperimentalWarning` the first time `interceptors.decompress()`
81
91
  // runs. The interceptor is stable for our gzipped-JSON-over-HTTPS use case;
@@ -30,6 +30,16 @@ async function createDefaultDispatcher() {
30
30
  // undici into their bundle. `getDefaultDispatcher` already short-circuits
31
31
  // outside Node, so this branch only runs when undici is safe to load.
32
32
  const { EnvHttpProxyAgent, interceptors } = await import('undici');
33
+ const agent = new EnvHttpProxyAgent(KEEP_ALIVE_OPTIONS);
34
+ // Some runtimes report `process.versions.node` (so `isNodeEnvironment()`
35
+ // passes) but ship only a partial undici: `interceptors.decompress` is
36
+ // absent and dispatchers have no `.compose`. Bun is the common case. There
37
+ // the proxy agent alone is enough — Bun's `fetch` decompresses
38
+ // gzip/deflate/br/zstd natively — so skip the interceptor instead of
39
+ // crashing on the missing API.
40
+ if (typeof interceptors.decompress !== 'function') {
41
+ return agent;
42
+ }
33
43
  // Compose the response-decompression interceptor so gzip/deflate/br/zstd
34
44
  // bodies are decoded before consumers parse them. Required on Node 24+:
35
45
  // attaching any custom dispatcher to the global `fetch` strips the
@@ -37,7 +47,7 @@ async function createDefaultDispatcher() {
37
47
  // so callers receive raw gzipped bytes and `JSON.parse` fails.
38
48
  // See https://github.com/Doist/todoist-cli/issues/318.
39
49
  const decompress = suppressExperimentalWarningsSync(() => interceptors.decompress());
40
- return new EnvHttpProxyAgent(KEEP_ALIVE_OPTIONS).compose(decompress);
50
+ return agent.compose(decompress);
41
51
  }
42
52
  // undici emits an `ExperimentalWarning` the first time `interceptors.decompress()`
43
53
  // runs. The interceptor is stable for our gzipped-JSON-over-HTTPS use case;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "10.3.0",
3
+ "version": "10.3.2",
4
4
  "description": "The official TypeScript SDK for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "https://github.com/Doist/todoist-sdk-typescript",
@@ -54,7 +54,7 @@
54
54
  "emoji-regex": "10.6.0",
55
55
  "form-data": "4.0.5",
56
56
  "ts-custom-error": "^3.2.0",
57
- "undici": "^7.16.0",
57
+ "undici": "7.24.8",
58
58
  "uuid": "11.1.1",
59
59
  "zod": "4.3.6"
60
60
  },
@@ -76,7 +76,7 @@
76
76
  "ts-node": "10.9.2",
77
77
  "type-fest": "^5.0.0",
78
78
  "typescript": "5.9.3",
79
- "vitest": "4.0.14"
79
+ "vitest": "4.1.0"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "type-fest": "^4.12.0 || ^5.5.0"