@moostjs/event-ws 0.7.4 → 0.7.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.
- package/dist/index.cjs +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +4 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -155,6 +155,7 @@ const LOGGER_TITLE = "moost-ws";
|
|
|
155
155
|
}
|
|
156
156
|
onInit(moost$1) {
|
|
157
157
|
this.moost = moost$1;
|
|
158
|
+
(0, moost.claimWooks)(moost$1, this.wsApp.getWooks(), this.name, { created: this.createdApp });
|
|
158
159
|
}
|
|
159
160
|
/**
|
|
160
161
|
* Called by `Moost.dispose()` before any `@MoostDispose` hook runs: stops the
|
|
@@ -227,10 +228,12 @@ const LOGGER_TITLE = "moost-ws";
|
|
|
227
228
|
_define_property$1(this, "opts", void 0);
|
|
228
229
|
_define_property$1(this, "name", void 0);
|
|
229
230
|
_define_property$1(this, "wsApp", void 0);
|
|
231
|
+
/** Neither a `WooksWs` nor an HTTP app was passed in: standalone on the global Wooks. */ _define_property$1(this, "createdApp", void 0);
|
|
230
232
|
_define_property$1(this, "moost", void 0);
|
|
231
233
|
this.opts = opts;
|
|
232
234
|
this.name = "ws";
|
|
233
235
|
const wsOpts = opts?.wooksWs;
|
|
236
|
+
this.createdApp = !(wsOpts instanceof _wooksjs_event_ws.WooksWs) && !opts?.httpApp;
|
|
234
237
|
if (wsOpts && wsOpts instanceof _wooksjs_event_ws.WooksWs) this.wsApp = wsOpts;
|
|
235
238
|
else {
|
|
236
239
|
const httpApp = opts?.httpApp && "getHttpApp" in opts.httpApp ? opts.httpApp.getHttpApp() : opts?.httpApp;
|
package/dist/index.d.ts
CHANGED
|
@@ -144,6 +144,8 @@ declare class MoostWs implements TMoostAdapter<TWsHandlerMeta> {
|
|
|
144
144
|
static readonly [MOOST_ADAPTER_BRAND] = "@moostjs/event-ws/MoostWs";
|
|
145
145
|
readonly name = "ws";
|
|
146
146
|
protected wsApp: WooksWs;
|
|
147
|
+
/** Neither a `WooksWs` nor an HTTP app was passed in: standalone on the global Wooks. */
|
|
148
|
+
private readonly createdApp;
|
|
147
149
|
constructor(opts?: (TMoostWsOpts & {
|
|
148
150
|
/**
|
|
149
151
|
* WooksHttp instance or an adapter with getHttpApp() for HTTP-integrated mode.
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Controller, Description, Intercept, MOOST_ADAPTER_BRAND, Moost, Param, Resolve, defineAfterInterceptor, defineBeforeInterceptor, defineInterceptor, defineMoostEventHandler, getMoostMate } from "moost";
|
|
1
|
+
import { Controller, Description, Intercept, MOOST_ADAPTER_BRAND, Moost, Param, Resolve, claimWooks, defineAfterInterceptor, defineBeforeInterceptor, defineInterceptor, defineMoostEventHandler, getMoostMate } from "moost";
|
|
2
2
|
import { WooksWs, WooksWs as WooksWs$1, WsError, WsRoomManager, createWsApp, currentConnection, prepareTestWsConnectionContext, prepareTestWsMessageContext, useWsConnection, useWsConnection as useWsConnection$1, useWsMessage, useWsMessage as useWsMessage$1, useWsRooms, useWsServer, wsConnectionKind, wsMessageKind } from "@wooksjs/event-ws";
|
|
3
3
|
import { createProvideRegistry } from "@prostojs/infact";
|
|
4
4
|
|
|
@@ -154,6 +154,7 @@ const LOGGER_TITLE = "moost-ws";
|
|
|
154
154
|
}
|
|
155
155
|
onInit(moost) {
|
|
156
156
|
this.moost = moost;
|
|
157
|
+
claimWooks(moost, this.wsApp.getWooks(), this.name, { created: this.createdApp });
|
|
157
158
|
}
|
|
158
159
|
/**
|
|
159
160
|
* Called by `Moost.dispose()` before any `@MoostDispose` hook runs: stops the
|
|
@@ -226,10 +227,12 @@ const LOGGER_TITLE = "moost-ws";
|
|
|
226
227
|
_define_property$1(this, "opts", void 0);
|
|
227
228
|
_define_property$1(this, "name", void 0);
|
|
228
229
|
_define_property$1(this, "wsApp", void 0);
|
|
230
|
+
/** Neither a `WooksWs` nor an HTTP app was passed in: standalone on the global Wooks. */ _define_property$1(this, "createdApp", void 0);
|
|
229
231
|
_define_property$1(this, "moost", void 0);
|
|
230
232
|
this.opts = opts;
|
|
231
233
|
this.name = "ws";
|
|
232
234
|
const wsOpts = opts?.wooksWs;
|
|
235
|
+
this.createdApp = !(wsOpts instanceof WooksWs$1) && !opts?.httpApp;
|
|
233
236
|
if (wsOpts && wsOpts instanceof WooksWs$1) this.wsApp = wsOpts;
|
|
234
237
|
else {
|
|
235
238
|
const httpApp = opts?.httpApp && "getHttpApp" in opts.httpApp ? opts.httpApp.getHttpApp() : opts?.httpApp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moostjs/event-ws",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "@moostjs/event-ws",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"composables",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@wooksjs/event-ws": "^0.8.
|
|
42
|
+
"@wooksjs/event-ws": "^0.8.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"vitest": "4.1.12",
|
|
46
|
-
"@moostjs/event-http": "^0.7.
|
|
46
|
+
"@moostjs/event-http": "^0.7.6"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@prostojs/infact": "^0.6.1",
|
|
50
|
-
"@wooksjs/event-core": "^0.8.
|
|
51
|
-
"moost": "^0.7.
|
|
50
|
+
"@wooksjs/event-core": "^0.8.3",
|
|
51
|
+
"moost": "^0.7.6"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"pub": "pnpm publish --access public",
|