@ldtr/nestjs-webtransport 0.0.5 → 0.0.6

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 (2) hide show
  1. package/README.md +2 -17
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -131,27 +131,12 @@ import {
131
131
 
132
132
  type EventsGatewayData = {
133
133
  session: {
134
- connectedAt: Date
135
- totalBytes: number
136
- }
137
- streamRW: {
138
- receivedBytes: number
139
- }
134
+ connectedAt: Date }
140
135
  }
141
136
 
142
137
  @WebTransportGateway({ server: "main", path: "/events" })
143
138
  export class EventsGateway implements WebTransportGatewayLifecycle<EventsGatewayData> {
144
139
  async onSession(session: WtSession<EventsGatewayData>): Promise<void> {
145
- session.data.connectedAt = new Date()
146
- session.data.totalBytes = 0
147
- }
148
-
149
- async onStreamRW(stream: WtStreamRW<EventsGatewayData>): Promise<void> {
150
- stream.data.receivedBytes = 0
151
-
152
- for await (const chunk of stream.read()) {
153
- stream.data.receivedBytes += chunk.length
154
- stream.session.data.totalBytes += chunk.length
155
- }
140
+ session.data = { connectedAt: new Date() }
156
141
  }
157
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldtr/nestjs-webtransport",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "NestJS module for creating WebTransport servers and gateways.",
5
5
  "type": "module",
6
6
  "files": [