@forinda/kickjs-ws 1.7.1-alpha.0 → 2.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/dist/index.js +6 -5
- package/dist/ws-adapter.d.ts +1 -1
- package/dist/ws-adapter.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { randomUUID as
|
|
2
|
-
import { WebSocketServer as
|
|
3
|
-
import { Service as p, createLogger as R, ref as h } from "@forinda/kickjs
|
|
1
|
+
import { randomUUID as u } from "node:crypto";
|
|
2
|
+
import { WebSocketServer as k } from "ws";
|
|
3
|
+
import { Service as p, createLogger as R, ref as h } from "@forinda/kickjs";
|
|
4
4
|
import "reflect-metadata";
|
|
5
5
|
var c = {
|
|
6
6
|
WS_CONTROLLER: /* @__PURE__ */ Symbol("kick:ws:controller"),
|
|
@@ -139,7 +139,8 @@ var c = {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
afterStart({ server: e }) {
|
|
142
|
-
|
|
142
|
+
if (!e) return;
|
|
143
|
+
this.wss = new k({
|
|
143
144
|
noServer: !0,
|
|
144
145
|
maxPayload: this.maxPayload
|
|
145
146
|
}), e.on("upgrade", (s, a, o) => {
|
|
@@ -174,7 +175,7 @@ var c = {
|
|
|
174
175
|
this.wss?.close();
|
|
175
176
|
}
|
|
176
177
|
handleConnection(e, t) {
|
|
177
|
-
const s =
|
|
178
|
+
const s = u();
|
|
178
179
|
e.__alive = !0, t.sockets.set(s, e), this.totalConnections.value++, this.activeConnections.value++;
|
|
179
180
|
const a = new M(e, this.wss, this.roomManager, t.sockets, s, t.namespace);
|
|
180
181
|
t.contexts.set(s, a);
|
package/dist/ws-adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AppAdapter, type AdapterContext, type Ref } from '@forinda/kickjs
|
|
1
|
+
import { type AppAdapter, type AdapterContext, type Ref } from '@forinda/kickjs';
|
|
2
2
|
import { type WsAdapterOptions } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* WebSocket adapter for KickJS. Attaches to the HTTP server and routes
|
package/dist/ws-adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws-adapter.d.ts","sourceRoot":"","sources":["../src/ws-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,cAAc,EAInB,KAAK,GAAG,EACT,MAAM,
|
|
1
|
+
{"version":3,"file":"ws-adapter.d.ts","sourceRoot":"","sources":["../src/ws-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,cAAc,EAInB,KAAK,GAAG,EACT,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,cAAc,CAAA;AAcrB;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,SAAU,YAAW,UAAU;IAC1C,QAAQ,CAAC,IAAI,eAAc;IAE3B,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,iBAAiB,CAAQ;IACjC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,GAAG,CAA+B;IAC1C,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,cAAc,CAA8C;IAGpE,8CAA8C;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtC,mCAAmC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvC,8BAA8B;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtC,0BAA0B;IAC1B,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAClC,mBAAmB;IACnB,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;gBAElB,OAAO,GAAE,gBAAqB;IAY1C,qDAAqD;IACrD,QAAQ;;;;;;;yBAC8C,MAAM;sBAAY,MAAM;;;;IAkB9E,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,IAAI;IA4BhD,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,IAAI;IAiD5C,QAAQ,IAAI,IAAI;IAmBhB,OAAO,CAAC,gBAAgB;IAgFxB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,UAAU;CAYnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forinda/kickjs-ws",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "WebSocket support with decorators, namespaces, rooms, and DI integration for KickJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kickjs",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"reflect-metadata": "^0.2.2",
|
|
54
54
|
"ws": "^8.20.0",
|
|
55
|
-
"@forinda/kickjs
|
|
55
|
+
"@forinda/kickjs": "2.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@swc/core": "^1.7.28",
|