@hyper-fetch/sockets 6.0.1 → 7.0.0
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/.eslintrc.json +8 -3
- package/README.md +6 -6
- package/dist/index.d.ts +523 -296
- package/dist/index.js +1246 -0
- package/dist/index.js.map +7 -0
- package/package.json +8 -9
- package/src/adapter/adapter.bindings.ts +128 -101
- package/src/adapter/adapter.ts +231 -0
- package/src/adapter/adapter.types.ts +10 -101
- package/src/adapter/index.ts +4 -4
- package/src/adapter-sse/index.ts +3 -0
- package/src/adapter-sse/sse-adapter.ts +192 -0
- package/src/adapter-sse/sse-adapter.types.ts +6 -0
- package/src/adapter-sse/sse-adapter.utils.ts +77 -0
- package/src/adapter-websockets/index.ts +3 -0
- package/src/adapter-websockets/websocket-adapter.ts +259 -0
- package/src/adapter-websockets/websocket-adapter.types.ts +8 -0
- package/src/adapter-websockets/websocket-adapter.utils.ts +53 -0
- package/src/emitter/emitter.ts +60 -102
- package/src/emitter/emitter.types.ts +82 -49
- package/src/index.ts +3 -0
- package/src/listener/listener.ts +34 -49
- package/src/listener/listener.types.ts +69 -17
- package/src/socket/socket.events.ts +147 -112
- package/src/socket/socket.ts +78 -100
- package/src/socket/socket.types.ts +13 -18
- package/src/socket/socket.utils.ts +12 -14
- package/src/types/connect.types.ts +2 -2
- package/src/types/extract.types.ts +43 -10
- package/src/utils/index.ts +3 -0
- package/src/utils/message-event.utils.ts +6 -0
- package/src/utils/socket.errors.ts +48 -0
- package/src/utils/socket.utils.ts +4 -0
- package/tsconfig.json +7 -3
- package/dist/index.cjs.js +0 -853
- package/dist/index.cjs.js.map +0 -7
- package/dist/index.esm.js +0 -833
- package/dist/index.esm.js.map +0 -7
- package/src/adapter/adapter.sse.ts +0 -127
- package/src/adapter/adapter.utils.ts +0 -20
- package/src/adapter/adapter.websocket.ts +0 -187
package/.eslintrc.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": ["../../.eslintrc.
|
|
2
|
+
"extends": ["plugin:@nx/react", "../../.eslintrc.js"],
|
|
3
3
|
"parserOptions": {
|
|
4
|
-
"project": ["./tsconfig.json"
|
|
5
|
-
}
|
|
4
|
+
"project": ["./tsconfig.json"]
|
|
5
|
+
},
|
|
6
|
+
"rules": {
|
|
7
|
+
"react/jsx-props-no-spreading": 0,
|
|
8
|
+
"react/require-default-props": 0
|
|
9
|
+
},
|
|
10
|
+
"ignorePatterns": ["dist/", "coverage/", "jest.config.ts", "/*.js"]
|
|
6
11
|
}
|
package/README.md
CHANGED
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
|
|
34
34
|
🔮 **Simple setup** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/sockets/setup)
|
|
35
35
|
|
|
36
|
-
🎯 **Web Sockets** - [Read more](https://hyperfetch.bettertyped.com/docs/
|
|
36
|
+
🎯 **Web Sockets** - [Read more](https://hyperfetch.bettertyped.com/docs/sockets/overview#Websockets)
|
|
37
37
|
|
|
38
|
-
✨ **Server sent events** - [Read more](https://hyperfetch.bettertyped.com/docs/
|
|
38
|
+
✨ **Server sent events** - [Read more](https://hyperfetch.bettertyped.com/docs/sockets/overview#Sockets)
|
|
39
39
|
|
|
40
40
|
🚀 **Type safe** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/sockets/typescript)
|
|
41
41
|
|
|
42
|
-
🎊 **SSR Support** - [Read more](https://hyperfetch.bettertyped.com/docs/
|
|
42
|
+
🎊 **SSR Support** - [Read more](https://hyperfetch.bettertyped.com/docs/getting-started/environment)
|
|
43
43
|
|
|
44
44
|
🔋 **Offline First** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/sockets/offline)
|
|
45
45
|
|
|
46
|
-
📡 **Built-in adapter** - [Read more](https://hyperfetch.bettertyped.com/docs/
|
|
46
|
+
📡 **Built-in adapter** - [Read more](https://hyperfetch.bettertyped.com/docs/sockets/adapter)
|
|
47
47
|
|
|
48
48
|
🎟 **Authentication** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/sockets/authentication)
|
|
49
49
|
|
|
@@ -59,8 +59,8 @@ We have specially created hooks to support sockets.
|
|
|
59
59
|
|
|
60
60
|
## Sources
|
|
61
61
|
|
|
62
|
-
- #### [Installation](https://hyperfetch.bettertyped.com/docs/
|
|
63
|
-
- #### [Docs](https://hyperfetch.bettertyped.com/docs/
|
|
62
|
+
- #### [Installation](https://hyperfetch.bettertyped.com/docs/getting-started/installation)
|
|
63
|
+
- #### [Docs](https://hyperfetch.bettertyped.com/docs/sockets/overview)
|
|
64
64
|
- #### [API](https://hyperfetch.bettertyped.com/api/)
|
|
65
65
|
- #### [NPM](https://www.npmjs.com/package/@hyper-fetch/sockets)
|
|
66
66
|
- #### [Guides](https://hyperfetch.bettertyped.com/docs/guides/sockets/setup)
|