thor-io.vnext 2.0.6 → 3.1.0-beta.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/.gitattributes +17 -17
- package/{index.d.ts → build/index.d.ts} +11 -8
- package/build/index.js +47 -0
- package/build/src/Connection/ClientInfo.d.ts +27 -0
- package/{src → build/src}/Connection/ClientInfo.js +7 -0
- package/build/src/Connection/Connection.d.ts +117 -0
- package/build/src/Connection/Connection.js +202 -0
- package/build/src/Connection/IClientInfo.d.ts +20 -0
- package/build/src/Controller/ControllerBase.d.ts +134 -0
- package/build/src/Controller/ControllerBase.js +543 -0
- package/build/src/Controller/Subscription.d.ts +27 -0
- package/build/src/Controller/Subscription.js +22 -0
- package/build/src/Controllers/BrokerController/Broker.js +145 -0
- package/build/src/Controllers/BrokerController/BrokerController.d.ts +61 -0
- package/build/src/Controllers/BrokerController/BrokerController.js +115 -0
- package/{src/Controllers/BrokerController/Broker.js → build/src/Controllers/BrokerController/BrokerrController.js} +74 -85
- package/build/src/Controllers/BrokerController/Models/PeerConnection.d.ts +7 -0
- package/build/src/Controllers/BrokerController/Models/PeerConnection.js +14 -0
- package/build/src/Controllers/BrokerController/Models/Signal.js +11 -0
- package/build/src/Decorators/CanInvoke.d.ts +10 -0
- package/build/src/Decorators/CanInvoke.js +22 -0
- package/build/src/Decorators/CanSet.d.ts +10 -0
- package/build/src/Decorators/CanSet.js +20 -0
- package/build/src/Decorators/ControllerProperties.d.ts +10 -0
- package/build/src/Decorators/ControllerProperties.js +20 -0
- package/build/src/Interfaces/IInterceptor.js +2 -0
- package/build/src/Interfaces/ITransport.d.ts +94 -0
- package/build/src/Interfaces/ITransportMessage.d.ts +41 -0
- package/build/src/Messages/BufferMessage.d.ts +38 -0
- package/{src → build/src}/Messages/BufferMessage.js +32 -2
- package/build/src/Messages/ErrorMessage.d.ts +29 -0
- package/build/src/Messages/ErrorMessage.js +22 -0
- package/build/src/Messages/PipeMessage.d.ts +46 -0
- package/build/src/Messages/PipeMessage.js +41 -0
- package/build/src/Messages/TextMessage.d.ts +88 -0
- package/build/src/Messages/TextMessage.js +94 -0
- package/build/src/Messages/WebSocketMessage.d.ts +34 -0
- package/build/src/Messages/WebSocketMessage.js +41 -0
- package/build/src/Plugin.js +32 -0
- package/build/src/Server/Plugin.d.ts +37 -0
- package/build/src/Server/Plugin.js +32 -0
- package/build/src/Server/ThorIOServer.d.ts +68 -0
- package/build/src/Server/ThorIOServer.js +131 -0
- package/build/src/Subscription.js +22 -0
- package/build/src/ThorIO.js +142 -0
- package/build/src/ThorIOServer.d.ts +64 -0
- package/build/src/ThorIOServer.js +131 -0
- package/build/src/Transports/BufferMessageTransport.d.ts +78 -0
- package/build/src/Transports/BufferMessageTransport.js +85 -0
- package/build/src/Transports/PipeMessageTransport.d.ts +79 -0
- package/build/src/Transports/PipeMessageTransport.js +90 -0
- package/build/src/Transports/WebSocketMessageTransport.d.ts +87 -0
- package/build/src/Transports/WebSocketMessageTransport.js +93 -0
- package/build/src/Utils/BufferUtils.d.ts +32 -0
- package/build/src/Utils/BufferUtils.js +57 -0
- package/build/src/Utils/StringUtils.d.ts +15 -0
- package/build/src/Utils/StringUtils.js +31 -0
- package/build/src/test.js +5 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +43 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1610 -0
- package/docs/classes/BrokerController.html +164 -0
- package/docs/classes/BufferMessage.html +11 -0
- package/docs/classes/BufferMessageTransport.html +31 -0
- package/docs/classes/BufferUtils.html +16 -0
- package/docs/classes/ClientInfo.html +11 -0
- package/docs/classes/Connection.html +42 -0
- package/docs/classes/ControllerBase.html +144 -0
- package/docs/classes/ErrorMessage.html +13 -0
- package/docs/classes/PeerConnection.html +4 -0
- package/docs/classes/PipeMessage.html +17 -0
- package/docs/classes/PipeMessageTransport.html +33 -0
- package/docs/classes/Plugin.html +13 -0
- package/docs/classes/Signal.html +5 -0
- package/docs/classes/StringUtils.html +9 -0
- package/docs/classes/Subscription.html +11 -0
- package/docs/classes/TextMessage.html +37 -0
- package/docs/classes/ThorIOServer.html +25 -0
- package/docs/classes/WebSocketMessage.html +18 -0
- package/docs/classes/WebSocketMessageTransport.html +35 -0
- package/docs/functions/CanInvoke.html +5 -0
- package/docs/functions/CanSet.html +5 -0
- package/docs/functions/ControllerProperties.html +5 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +24 -0
- package/docs/interfaces/ITransport.html +46 -0
- package/docs/interfaces/ITransportMessage.html +21 -0
- package/docs/modules.html +1 -0
- package/index.ts +32 -35
- package/licence +21 -21
- package/package.json +48 -49
- package/readme.md +32 -71
- package/src/Connection/ClientInfo.ts +34 -37
- package/src/Connection/Connection.ts +229 -278
- package/src/Connection/IClientInfo.ts +22 -0
- package/src/Controller/ControllerBase.ts +561 -458
- package/src/{Subscription.ts → Controller/Subscription.ts} +32 -34
- package/src/Controllers/BrokerController/BrokerController.ts +121 -0
- package/src/Controllers/BrokerController/Models/PeerConnection.ts +12 -34
- package/src/Controllers/BrokerController/Models/Signal.ts +11 -43
- package/src/Decorators/CanInvoke.ts +21 -13
- package/src/Decorators/CanSet.ts +19 -12
- package/src/Decorators/ControllerProperties.ts +19 -16
- package/src/Interfaces/ITransport.ts +107 -23
- package/src/Interfaces/ITransportMessage.ts +45 -41
- package/src/Messages/BufferMessage.ts +70 -69
- package/src/Messages/ErrorMessage.ts +34 -6
- package/src/Messages/PipeMessage.ts +56 -62
- package/src/Messages/TextMessage.ts +139 -93
- package/src/Messages/WebSocketMessage.ts +39 -41
- package/src/Server/Plugin.ts +56 -0
- package/src/Server/ThorIOServer.ts +121 -0
- package/src/ThorIOServer.ts +117 -0
- package/src/Transports/BufferMessageTransport.ts +109 -100
- package/src/Transports/PipeMessageTransport.ts +112 -104
- package/src/Transports/WebSocketMessageTransport.ts +122 -110
- package/src/Utils/BufferUtils.ts +55 -61
- package/src/Utils/StringUtils.ts +28 -17
- package/tsconfig.json +109 -18
- package/typedoc.json +6 -0
- package/index.js +0 -40
- package/src/Connection/ClientInfo.d.ts +0 -6
- package/src/Connection/Connection.d.ts +0 -24
- package/src/Connection/Connection.js +0 -129
- package/src/Controller/ControllerBase.d.ts +0 -43
- package/src/Controller/ControllerBase.js +0 -331
- package/src/Controllers/BrokerController/Broker.d.ts +0 -21
- package/src/Controllers/BrokerController/Broker.ts +0 -153
- package/src/Controllers/BrokerController/Models/PeerConnection.d.ts +0 -5
- package/src/Controllers/BrokerController/Models/PeerConnection.js +0 -9
- package/src/Controllers/BrokerController/Models/Signal.js +0 -10
- package/src/Decorators/CanInvoke.d.ts +0 -2
- package/src/Decorators/CanInvoke.js +0 -9
- package/src/Decorators/CanSet.d.ts +0 -1
- package/src/Decorators/CanSet.js +0 -8
- package/src/Decorators/ControllerProperties.d.ts +0 -1
- package/src/Decorators/ControllerProperties.js +0 -10
- package/src/Interfaces/IInterceptor.d.ts +0 -2
- package/src/Interfaces/IInterceptor.ts +0 -2
- package/src/Interfaces/ITransport.d.ts +0 -18
- package/src/Interfaces/ITransportMessage.d.ts +0 -8
- package/src/Messages/BufferMessage.d.ts +0 -10
- package/src/Messages/ErrorMessage.d.ts +0 -4
- package/src/Messages/ErrorMessage.js +0 -8
- package/src/Messages/PipeMessage.d.ts +0 -12
- package/src/Messages/PipeMessage.js +0 -20
- package/src/Messages/TextMessage.d.ts +0 -15
- package/src/Messages/TextMessage.js +0 -50
- package/src/Messages/WebSocketMessage.d.ts +0 -10
- package/src/Messages/WebSocketMessage.js +0 -15
- package/src/Plugin.d.ts +0 -6
- package/src/Plugin.js +0 -11
- package/src/Plugin.ts +0 -37
- package/src/Subscription.d.ts +0 -5
- package/src/Subscription.js +0 -9
- package/src/ThorIO.d.ts +0 -19
- package/src/ThorIO.js +0 -67
- package/src/ThorIO.ts +0 -153
- package/src/Transports/BufferMessageTransport.d.ts +0 -21
- package/src/Transports/BufferMessageTransport.js +0 -31
- package/src/Transports/PipeMessageTransport.d.ts +0 -20
- package/src/Transports/PipeMessageTransport.js +0 -33
- package/src/Transports/WebSocketMessageTransport.d.ts +0 -20
- package/src/Transports/WebSocketMessageTransport.js +0 -31
- package/src/Utils/BufferUtils.d.ts +0 -5
- package/src/Utils/BufferUtils.js +0 -29
- package/src/Utils/StringUtils.d.ts +0 -4
- package/src/Utils/StringUtils.js +0 -13
- /package/{src/Interfaces/IInterceptor.js → build/src/Connection/IClientInfo.js} +0 -0
- /package/{src → build/src}/Controllers/BrokerController/Models/Signal.d.ts +0 -0
- /package/{src → build/src}/Interfaces/ITransport.js +0 -0
- /package/{src → build/src}/Interfaces/ITransportMessage.js +0 -0
package/package.json
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "thor-io.vnext",
|
|
3
|
-
"author": {
|
|
4
|
-
"name": "Magnus Thor",
|
|
5
|
-
"email": "magnus.thor74@gmail.com"
|
|
6
|
-
},
|
|
7
|
-
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": "Ricky Davies",
|
|
10
|
-
"email": "rdavies@zen.co.uk"
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
"description": "thor-io.vnext represents the next generation of thor-io.Thor-IO is a fundament for stateful real-time communication.TCP/IP,WebSockets & WebRTC or whatever you need and desire.",
|
|
14
|
-
"version": "
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"main": "index.js",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/MagnusThor/thor-io.vnext.git"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"unity",
|
|
23
|
-
".net",
|
|
24
|
-
"realtime",
|
|
25
|
-
"websockets",
|
|
26
|
-
"WebRTC",
|
|
27
|
-
"PubSub",
|
|
28
|
-
"RPC",
|
|
29
|
-
"Smart-RPC",
|
|
30
|
-
"IoT",
|
|
31
|
-
"NodeJS",
|
|
32
|
-
"RTC",
|
|
33
|
-
"Typescript"
|
|
34
|
-
],
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@types/node": "^10.17.26",
|
|
37
|
-
"@types/reflect-metadata": "^0.1.0",
|
|
38
|
-
"ws": "^7.3.0"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@types/ws": "^7.2.5",
|
|
42
|
-
"express": "^4.17.1",
|
|
43
|
-
"express-ws": "^4.0.0",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "thor-io.vnext",
|
|
3
|
+
"author": {
|
|
4
|
+
"name": "Magnus Thor",
|
|
5
|
+
"email": "magnus.thor74@gmail.com"
|
|
6
|
+
},
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Ricky Davies",
|
|
10
|
+
"email": "rdavies@zen.co.uk"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"description": "thor-io.vnext represents the next generation of thor-io.Thor-IO is a fundament for stateful real-time communication.TCP/IP,WebSockets & WebRTC or whatever you need and desire.",
|
|
14
|
+
"version": "3.1.0-beta.1",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"main": "build/index.js",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/MagnusThor/thor-io.vnext.git"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"unity",
|
|
23
|
+
".net",
|
|
24
|
+
"realtime",
|
|
25
|
+
"websockets",
|
|
26
|
+
"WebRTC",
|
|
27
|
+
"PubSub",
|
|
28
|
+
"RPC",
|
|
29
|
+
"Smart-RPC",
|
|
30
|
+
"IoT",
|
|
31
|
+
"NodeJS",
|
|
32
|
+
"RTC",
|
|
33
|
+
"Typescript"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@types/node": "^10.17.26",
|
|
37
|
+
"@types/reflect-metadata": "^0.1.0",
|
|
38
|
+
"ws": "^7.3.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/ws": "^7.2.5",
|
|
42
|
+
"express": "^4.17.1",
|
|
43
|
+
"express-ws": "^4.0.0",
|
|
44
|
+
"typedoc": "^0.27.6",
|
|
45
|
+
"typings": "^0.6.10",
|
|
46
|
+
"webpack": "^5.97.1"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,71 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
thor-io.vnext
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
https://gist.github.com/MagnusThor/9564824dcc6385d736565973798cbef9
|
|
35
|
-
|
|
36
|
-
### Example controller
|
|
37
|
-
|
|
38
|
-
https://gist.github.com/MagnusThor/714d5e6e59d2e042111e3aefc94fe435
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## More info (dox)
|
|
42
|
-
|
|
43
|
-
See https://github.com/MagnusThor/thor-io.vnext/wiki for a brief documnentation.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## client library / package
|
|
47
|
-
|
|
48
|
-
`npm install thor-io.client-vnext`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## More info
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
See https://github.com/MagnusThor/thor-io.vnext/wiki for a brief documnentation.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
## client library / package$$
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`npm install thor-io.client-vnext`
|
|
63
|
-
|
|
64
|
-
### client example
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
https://gist.github.com/MagnusThor/0cf03ec8ad30118d4e8ff127d1a1348e
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
**The Foundation for Next-Gen, Stateful Real-Time Communication**
|
|
2
|
+
|
|
3
|
+
thor-io.vnext empowers you to build cutting-edge, real-time applications with unparalleled flexibility and performance.
|
|
4
|
+
|
|
5
|
+
**Key Features:**
|
|
6
|
+
|
|
7
|
+
* **Rock-Solid Foundation:** Built for demanding applications, thor-io.vnext provides a robust framework for stateful real-time communication.
|
|
8
|
+
* **Unleash Your Creativity:** Seamlessly integrate with your preferred transport layer: TCP/IP, WebSockets, WebRTC, or any custom solution you envision.
|
|
9
|
+
* **Effortless Integration:** Easily plug into your existing Node.js ecosystem – works flawlessly with Express and other popular middleware.
|
|
10
|
+
* **WebRTC Signaling Made Easy:** Leverage built-in WebRTC signaling capabilities to simplify the development of peer-to-peer applications.
|
|
11
|
+
|
|
12
|
+
**What can you build with thor-io.vnext?**
|
|
13
|
+
|
|
14
|
+
* **Real-time Collaboration:** Power collaborative tools like shared editors, whiteboards, and online design platforms.
|
|
15
|
+
* **Immersive Experiences:** Create captivating online games, interactive simulations, and virtual/augmented reality applications.
|
|
16
|
+
* **High-Performance Applications:** Build robust applications that demand real-time data synchronization, such as financial trading platforms and IoT solutions.
|
|
17
|
+
* **And Much More!** The possibilities are limited only by your imagination.
|
|
18
|
+
|
|
19
|
+
**Getting Started:**
|
|
20
|
+
|
|
21
|
+
**Install**
|
|
22
|
+
```bash
|
|
23
|
+
npm install thor-io.vnext
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Documentation**
|
|
27
|
+
|
|
28
|
+
https://../doc
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/Magnus Thor
|
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @param {string}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.TS = new Date();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
export class ClientInfo {
|
|
2
|
+
/**
|
|
3
|
+
* The client identifier.
|
|
4
|
+
*
|
|
5
|
+
* @type {string}
|
|
6
|
+
*/
|
|
7
|
+
public CI: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The controller identifier.
|
|
11
|
+
*
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
public C: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The timestamp when the instance was created.
|
|
18
|
+
*
|
|
19
|
+
* @type {Date}
|
|
20
|
+
*/
|
|
21
|
+
public TS: Date;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of ClientInfo.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} ci - The client identifier.
|
|
27
|
+
* @param {string} controller - The controller identifier.
|
|
28
|
+
*/
|
|
29
|
+
constructor(ci: string, controller: string) {
|
|
30
|
+
this.CI = ci;
|
|
31
|
+
this.C = controller;
|
|
32
|
+
this.TS = new Date();
|
|
33
|
+
}
|
|
34
|
+
}
|