@epicgames-ps/lib-pixelstreamingsignalling-ue5.8 0.1.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.
Files changed (112) hide show
  1. package/.lintstagedrc.mjs +7 -0
  2. package/.prettierignore +0 -0
  3. package/CHANGELOG.md +21 -0
  4. package/README.md +32 -0
  5. package/dist/cjs/Logger.js +148 -0
  6. package/dist/cjs/Logger.js.map +1 -0
  7. package/dist/cjs/LoggingUtils.js +64 -0
  8. package/dist/cjs/LoggingUtils.js.map +1 -0
  9. package/dist/cjs/PlayerConnection.js +220 -0
  10. package/dist/cjs/PlayerConnection.js.map +1 -0
  11. package/dist/cjs/PlayerRegistry.js +77 -0
  12. package/dist/cjs/PlayerRegistry.js.map +1 -0
  13. package/dist/cjs/SFUConnection.js +264 -0
  14. package/dist/cjs/SFUConnection.js.map +1 -0
  15. package/dist/cjs/SignallingServer.js +149 -0
  16. package/dist/cjs/SignallingServer.js.map +1 -0
  17. package/dist/cjs/StreamerConnection.js +172 -0
  18. package/dist/cjs/StreamerConnection.js.map +1 -0
  19. package/dist/cjs/StreamerRegistry.js +149 -0
  20. package/dist/cjs/StreamerRegistry.js.map +1 -0
  21. package/dist/cjs/Utils.js +19 -0
  22. package/dist/cjs/Utils.js.map +1 -0
  23. package/dist/cjs/WebServer.js +124 -0
  24. package/dist/cjs/WebServer.js.map +1 -0
  25. package/dist/cjs/pixelstreamingsignalling.js +28 -0
  26. package/dist/cjs/pixelstreamingsignalling.js.map +1 -0
  27. package/dist/esm/Logger.js +141 -0
  28. package/dist/esm/Logger.js.map +1 -0
  29. package/dist/esm/LoggingUtils.js +58 -0
  30. package/dist/esm/LoggingUtils.js.map +1 -0
  31. package/dist/esm/PlayerConnection.js +183 -0
  32. package/dist/esm/PlayerConnection.js.map +1 -0
  33. package/dist/esm/PlayerRegistry.js +73 -0
  34. package/dist/esm/PlayerRegistry.js.map +1 -0
  35. package/dist/esm/SFUConnection.js +227 -0
  36. package/dist/esm/SFUConnection.js.map +1 -0
  37. package/dist/esm/SignallingServer.js +112 -0
  38. package/dist/esm/SignallingServer.js.map +1 -0
  39. package/dist/esm/StreamerConnection.js +135 -0
  40. package/dist/esm/StreamerConnection.js.map +1 -0
  41. package/dist/esm/StreamerRegistry.js +145 -0
  42. package/dist/esm/StreamerRegistry.js.map +1 -0
  43. package/dist/esm/Utils.js +15 -0
  44. package/dist/esm/Utils.js.map +1 -0
  45. package/dist/esm/WebServer.js +117 -0
  46. package/dist/esm/WebServer.js.map +1 -0
  47. package/dist/esm/pixelstreamingsignalling.js +12 -0
  48. package/dist/esm/pixelstreamingsignalling.js.map +1 -0
  49. package/dist/types/Logger.d.ts +20 -0
  50. package/dist/types/LoggingUtils.d.ts +44 -0
  51. package/dist/types/PlayerConnection.d.ts +66 -0
  52. package/dist/types/PlayerRegistry.d.ts +66 -0
  53. package/dist/types/SFUConnection.d.ts +85 -0
  54. package/dist/types/SignallingServer.d.ts +48 -0
  55. package/dist/types/StreamerConnection.d.ts +61 -0
  56. package/dist/types/StreamerRegistry.d.ts +96 -0
  57. package/dist/types/Utils.d.ts +8 -0
  58. package/dist/types/WebServer.d.ts +42 -0
  59. package/dist/types/pixelstreamingsignalling.d.ts +9 -0
  60. package/docs/Logger/README.md +19 -0
  61. package/docs/Logger/functions/InitLogging.md +26 -0
  62. package/docs/Logger/interfaces/IConfig.md +41 -0
  63. package/docs/Logger/variables/Logger.md +15 -0
  64. package/docs/LoggingUtils/README.md +19 -0
  65. package/docs/LoggingUtils/functions/createHandlerListener.md +42 -0
  66. package/docs/LoggingUtils/functions/logForward.md +36 -0
  67. package/docs/LoggingUtils/functions/logIncoming.md +30 -0
  68. package/docs/LoggingUtils/functions/logOutgoing.md +30 -0
  69. package/docs/LoggingUtils/interfaces/IMessageLogger.md +29 -0
  70. package/docs/LoggingUtils/interfaces/IProtoLogObj.md +57 -0
  71. package/docs/PlayerConnection/README.md +11 -0
  72. package/docs/PlayerConnection/classes/PlayerConnection.md +177 -0
  73. package/docs/PlayerRegistry/README.md +16 -0
  74. package/docs/PlayerRegistry/classes/PlayerRegistry.md +423 -0
  75. package/docs/PlayerRegistry/interfaces/IPlayer.md +86 -0
  76. package/docs/PlayerRegistry/interfaces/IPlayerInfo.md +43 -0
  77. package/docs/README.md +19 -0
  78. package/docs/SFUConnection/README.md +11 -0
  79. package/docs/SFUConnection/classes/SFUConnection.md +554 -0
  80. package/docs/SignallingServer/README.md +19 -0
  81. package/docs/SignallingServer/classes/SignallingServer.md +76 -0
  82. package/docs/SignallingServer/interfaces/IServerConfig.md +92 -0
  83. package/docs/SignallingServer/type-aliases/ProtocolConfig.md +15 -0
  84. package/docs/StreamerConnection/README.md +11 -0
  85. package/docs/StreamerConnection/classes/StreamerConnection.md +507 -0
  86. package/docs/StreamerRegistry/README.md +16 -0
  87. package/docs/StreamerRegistry/classes/StreamerRegistry.md +431 -0
  88. package/docs/StreamerRegistry/interfaces/IStreamer.md +375 -0
  89. package/docs/StreamerRegistry/interfaces/IStreamerInfo.md +51 -0
  90. package/docs/Utils/README.md +12 -0
  91. package/docs/Utils/functions/beautify.md +23 -0
  92. package/docs/Utils/functions/stringify.md +23 -0
  93. package/docs/WebServer/README.md +15 -0
  94. package/docs/WebServer/classes/WebServer.md +50 -0
  95. package/docs/WebServer/interfaces/IWebServerConfig.md +76 -0
  96. package/docs/pixelstreamingsignalling/README.md +145 -0
  97. package/eslint.config.mjs +39 -0
  98. package/package.json +58 -0
  99. package/src/Logger.ts +189 -0
  100. package/src/LoggingUtils.ts +80 -0
  101. package/src/PlayerConnection.ts +257 -0
  102. package/src/PlayerRegistry.ts +116 -0
  103. package/src/SFUConnection.ts +329 -0
  104. package/src/SignallingServer.ts +214 -0
  105. package/src/StreamerConnection.ts +194 -0
  106. package/src/StreamerRegistry.ts +252 -0
  107. package/src/Utils.ts +16 -0
  108. package/src/WebServer.ts +213 -0
  109. package/src/pixelstreamingsignalling.ts +11 -0
  110. package/tsconfig.cjs.json +8 -0
  111. package/tsconfig.esm.json +8 -0
  112. package/tsconfig.json +29 -0
@@ -0,0 +1,30 @@
1
+ [**@epicgames-ps/lib-pixelstreamingsignalling-ue5.5**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@epicgames-ps/lib-pixelstreamingsignalling-ue5.5](../../README.md) / [LoggingUtils](../README.md) / logOutgoing
6
+
7
+ # Function: logOutgoing()
8
+
9
+ > **logOutgoing**(`sender`, `message`): `void`
10
+
11
+ Defined in: [Signalling/src/LoggingUtils.ts:41](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L41)
12
+
13
+ Call to log messages created here at the server and being sent to the connection.
14
+ Do not call this for messages being forwarded to this connection.
15
+
16
+ ## Parameters
17
+
18
+ ### sender
19
+
20
+ [`IMessageLogger`](../interfaces/IMessageLogger.md)
21
+
22
+ IMessageLogger The connection the message is being sent to.
23
+
24
+ ### message
25
+
26
+ `BaseMessage`
27
+
28
+ ## Returns
29
+
30
+ `void`
@@ -0,0 +1,29 @@
1
+ [**@epicgames-ps/lib-pixelstreamingsignalling-ue5.5**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@epicgames-ps/lib-pixelstreamingsignalling-ue5.5](../../README.md) / [LoggingUtils](../README.md) / IMessageLogger
6
+
7
+ # Interface: IMessageLogger
8
+
9
+ Defined in: [Signalling/src/LoggingUtils.ts:17](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L17)
10
+
11
+ Most methods in here rely on connections implementing this interface so we can identify
12
+ who is sending or receiving etc.
13
+
14
+ ## Extended by
15
+
16
+ - [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md)
17
+ - [`IStreamer`](../../StreamerRegistry/interfaces/IStreamer.md)
18
+
19
+ ## Methods
20
+
21
+ ### getReadableIdentifier()
22
+
23
+ > **getReadableIdentifier**(): `string`
24
+
25
+ Defined in: [Signalling/src/LoggingUtils.ts:18](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L18)
26
+
27
+ #### Returns
28
+
29
+ `string`
@@ -0,0 +1,57 @@
1
+ [**@epicgames-ps/lib-pixelstreamingsignalling-ue5.5**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@epicgames-ps/lib-pixelstreamingsignalling-ue5.5](../../README.md) / [LoggingUtils](../README.md) / IProtoLogObj
6
+
7
+ # Interface: IProtoLogObj
8
+
9
+ Defined in: [Signalling/src/LoggingUtils.ts:4](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L4)
10
+
11
+ ## Properties
12
+
13
+ ### direction
14
+
15
+ > **direction**: `string`
16
+
17
+ Defined in: [Signalling/src/LoggingUtils.ts:6](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L6)
18
+
19
+ ***
20
+
21
+ ### event
22
+
23
+ > **event**: `string`
24
+
25
+ Defined in: [Signalling/src/LoggingUtils.ts:5](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L5)
26
+
27
+ ***
28
+
29
+ ### protoMessage
30
+
31
+ > **protoMessage**: `BaseMessage`
32
+
33
+ Defined in: [Signalling/src/LoggingUtils.ts:10](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L10)
34
+
35
+ ***
36
+
37
+ ### receiver?
38
+
39
+ > `optional` **receiver**: `string`
40
+
41
+ Defined in: [Signalling/src/LoggingUtils.ts:8](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L8)
42
+
43
+ ***
44
+
45
+ ### sender?
46
+
47
+ > `optional` **sender**: `string`
48
+
49
+ Defined in: [Signalling/src/LoggingUtils.ts:7](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L7)
50
+
51
+ ***
52
+
53
+ ### target?
54
+
55
+ > `optional` **target**: `string`
56
+
57
+ Defined in: [Signalling/src/LoggingUtils.ts:9](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/LoggingUtils.ts#L9)
@@ -0,0 +1,11 @@
1
+ [**@epicgames-ps/lib-pixelstreamingsignalling-ue5.5**](../README.md)
2
+
3
+ ***
4
+
5
+ [@epicgames-ps/lib-pixelstreamingsignalling-ue5.5](../README.md) / PlayerConnection
6
+
7
+ # PlayerConnection
8
+
9
+ ## Classes
10
+
11
+ - [PlayerConnection](classes/PlayerConnection.md)
@@ -0,0 +1,177 @@
1
+ [**@epicgames-ps/lib-pixelstreamingsignalling-ue5.5**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@epicgames-ps/lib-pixelstreamingsignalling-ue5.5](../../README.md) / [PlayerConnection](../README.md) / PlayerConnection
6
+
7
+ # Class: PlayerConnection
8
+
9
+ Defined in: [Signalling/src/PlayerConnection.ts:27](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L27)
10
+
11
+ A connection between the signalling server and a player connection.
12
+ This is where messages expected to be handled by the player come in
13
+ and where messages are sent to the player.
14
+
15
+ Interesting internals:
16
+ playerId: The unique id string of this player.
17
+ transport: The ITransport where transport events can be subscribed to
18
+ protocol: The SignallingProtocol where signalling messages can be
19
+ subscribed to.
20
+
21
+ ## Implements
22
+
23
+ - [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md)
24
+ - [`IMessageLogger`](../../LoggingUtils/interfaces/IMessageLogger.md)
25
+
26
+ ## Constructors
27
+
28
+ ### new PlayerConnection()
29
+
30
+ > **new PlayerConnection**(`server`, `ws`, `remoteAddress`?): [`PlayerConnection`](PlayerConnection.md)
31
+
32
+ Defined in: [Signalling/src/PlayerConnection.ts:50](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L50)
33
+
34
+ Initializes a new connection with given and sane values. Adds listeners for the
35
+ websocket close and error so it can react by unsubscribing and resetting itself.
36
+
37
+ #### Parameters
38
+
39
+ ##### server
40
+
41
+ [`SignallingServer`](../../SignallingServer/classes/SignallingServer.md)
42
+
43
+ The signalling server object that spawned this player.
44
+
45
+ ##### ws
46
+
47
+ `WebSocket`
48
+
49
+ The websocket coupled to this player connection.
50
+
51
+ ##### remoteAddress?
52
+
53
+ `string`
54
+
55
+ The remote address of this connection. Only used as display.
56
+
57
+ #### Returns
58
+
59
+ [`PlayerConnection`](PlayerConnection.md)
60
+
61
+ ## Properties
62
+
63
+ ### playerId
64
+
65
+ > **playerId**: `string`
66
+
67
+ Defined in: [Signalling/src/PlayerConnection.ts:29](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L29)
68
+
69
+ #### Implementation of
70
+
71
+ [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md).[`playerId`](../../PlayerRegistry/interfaces/IPlayer.md#playerid)
72
+
73
+ ***
74
+
75
+ ### protocol
76
+
77
+ > **protocol**: `SignallingProtocol`
78
+
79
+ Defined in: [Signalling/src/PlayerConnection.ts:33](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L33)
80
+
81
+ #### Implementation of
82
+
83
+ [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md).[`protocol`](../../PlayerRegistry/interfaces/IPlayer.md#protocol)
84
+
85
+ ***
86
+
87
+ ### remoteAddress?
88
+
89
+ > `optional` **remoteAddress**: `string`
90
+
91
+ Defined in: [Signalling/src/PlayerConnection.ts:37](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L37)
92
+
93
+ ***
94
+
95
+ ### subscribedStreamer
96
+
97
+ > **subscribedStreamer**: `null` \| [`IStreamer`](../../StreamerRegistry/interfaces/IStreamer.md)
98
+
99
+ Defined in: [Signalling/src/PlayerConnection.ts:35](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L35)
100
+
101
+ #### Implementation of
102
+
103
+ [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md).[`subscribedStreamer`](../../PlayerRegistry/interfaces/IPlayer.md#subscribedstreamer)
104
+
105
+ ***
106
+
107
+ ### transport
108
+
109
+ > **transport**: `ITransport`
110
+
111
+ Defined in: [Signalling/src/PlayerConnection.ts:31](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L31)
112
+
113
+ ## Methods
114
+
115
+ ### getPlayerInfo()
116
+
117
+ > **getPlayerInfo**(): [`IPlayerInfo`](../../PlayerRegistry/interfaces/IPlayerInfo.md)
118
+
119
+ Defined in: [Signalling/src/PlayerConnection.ts:88](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L88)
120
+
121
+ Returns a descriptive object for the REST API inspection operations.
122
+
123
+ #### Returns
124
+
125
+ [`IPlayerInfo`](../../PlayerRegistry/interfaces/IPlayerInfo.md)
126
+
127
+ An IPlayerInfo object containing viewable information about this connection.
128
+
129
+ #### Implementation of
130
+
131
+ [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md).[`getPlayerInfo`](../../PlayerRegistry/interfaces/IPlayer.md#getplayerinfo)
132
+
133
+ ***
134
+
135
+ ### getReadableIdentifier()
136
+
137
+ > **getReadableIdentifier**(): `string`
138
+
139
+ Defined in: [Signalling/src/PlayerConnection.ts:71](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L71)
140
+
141
+ Returns an identifier that is displayed in logs.
142
+
143
+ #### Returns
144
+
145
+ `string`
146
+
147
+ A string describing this connection.
148
+
149
+ #### Implementation of
150
+
151
+ [`IMessageLogger`](../../LoggingUtils/interfaces/IMessageLogger.md).[`getReadableIdentifier`](../../LoggingUtils/interfaces/IMessageLogger.md#getreadableidentifier)
152
+
153
+ ***
154
+
155
+ ### sendMessage()
156
+
157
+ > **sendMessage**(`message`): `void`
158
+
159
+ Defined in: [Signalling/src/PlayerConnection.ts:79](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/4dc9339cfc185a91d37d078aa9dd0951dfbae1a5/Signalling/src/PlayerConnection.ts#L79)
160
+
161
+ Sends a signalling message to the player.
162
+
163
+ #### Parameters
164
+
165
+ ##### message
166
+
167
+ `BaseMessage`
168
+
169
+ The message to send.
170
+
171
+ #### Returns
172
+
173
+ `void`
174
+
175
+ #### Implementation of
176
+
177
+ [`IPlayer`](../../PlayerRegistry/interfaces/IPlayer.md).[`sendMessage`](../../PlayerRegistry/interfaces/IPlayer.md#sendmessage)
@@ -0,0 +1,16 @@
1
+ [**@epicgames-ps/lib-pixelstreamingsignalling-ue5.5**](../README.md)
2
+
3
+ ***
4
+
5
+ [@epicgames-ps/lib-pixelstreamingsignalling-ue5.5](../README.md) / PlayerRegistry
6
+
7
+ # PlayerRegistry
8
+
9
+ ## Classes
10
+
11
+ - [PlayerRegistry](classes/PlayerRegistry.md)
12
+
13
+ ## Interfaces
14
+
15
+ - [IPlayer](interfaces/IPlayer.md)
16
+ - [IPlayerInfo](interfaces/IPlayerInfo.md)