http-air 1.1.0 → 1.2.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/lib/client/client.js +1 -1
- package/lib/client/events.js +1 -1
- package/package.json +4 -4
package/lib/client/client.js
CHANGED
|
@@ -11,7 +11,7 @@ const events_1 = require("./events");
|
|
|
11
11
|
function resolveConfig(config) {
|
|
12
12
|
return {
|
|
13
13
|
url: config.url ?? globalThis?.location?.href ?? 'http://localhost/',
|
|
14
|
-
fetchFn: config.fetch ?? globalThis.fetch,
|
|
14
|
+
fetchFn: (config.fetch ?? globalThis.fetch).bind(globalThis),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
/** Serialize items to \n\n-delimited JSON */
|
package/lib/client/events.js
CHANGED
|
@@ -115,7 +115,7 @@ class EventsClient {
|
|
|
115
115
|
this.abortController = abortController;
|
|
116
116
|
const response = await pResponse;
|
|
117
117
|
if (response.status !== 200)
|
|
118
|
-
throw new p_retry_1.AbortError(response.statusText);
|
|
118
|
+
throw new p_retry_1.AbortError(new Error(response.statusText));
|
|
119
119
|
this.response = response;
|
|
120
120
|
this.sessionId = response.headers.get(stream_constants_1.SESSION_ID_KEY) ?? '';
|
|
121
121
|
this.serverId = response.headers.get(stream_constants_1.SERVER_ID_KEY) ?? '';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "http-air",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description"
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "HTTP library for batched RPC calls and real-time server-push over a single endpoint.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "https://github.com/yosbelms/http-air",
|
|
7
7
|
"keywords": [
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"nanoid": "^5.1.7",
|
|
27
|
-
"p-defer": "^
|
|
28
|
-
"p-retry": "^
|
|
27
|
+
"p-defer": "^3.0.0",
|
|
28
|
+
"p-retry": "^4.6.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^25.0.10",
|