@midwayjs/ws 3.0.0-beta.4 → 3.0.0-beta.8
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/CHANGELOG.md +38 -0
- package/README.md +1 -1
- package/dist/framework.js +8 -8
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* middleware with ctx.body ([#1389](https://github.com/midwayjs/midway/issues/1389)) ([77af5c0](https://github.com/midwayjs/midway/commit/77af5c0b456f1843f4dcfd3dbfd2c0aa244c51bd))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @midwayjs/ws
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @midwayjs/ws
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
7
45
|
|
|
8
46
|
|
package/README.md
CHANGED
package/dist/framework.js
CHANGED
|
@@ -97,14 +97,11 @@ let MidwayWSFramework = class MidwayWSFramework extends core_1.BaseFramework {
|
|
|
97
97
|
// on user custom event
|
|
98
98
|
socket.on(wsEventInfo.messageEventName, async (...args) => {
|
|
99
99
|
debug('got message', wsEventInfo.messageEventName, args);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.logger.error(error);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
100
|
+
try {
|
|
101
|
+
const result = await (await this.getMiddleware(async (ctx, next) => {
|
|
102
|
+
// eslint-disable-next-line prefer-spread
|
|
103
|
+
return controller[wsEventInfo.propertyName].apply(controller, args);
|
|
104
|
+
}))(socket);
|
|
108
105
|
if (typeof args[args.length - 1] === 'function') {
|
|
109
106
|
// ack
|
|
110
107
|
args[args.length - 1](result);
|
|
@@ -114,6 +111,9 @@ let MidwayWSFramework = class MidwayWSFramework extends core_1.BaseFramework {
|
|
|
114
111
|
await this.bindSocketResponse(result, socket, wsEventInfo.propertyName, methodMap);
|
|
115
112
|
}
|
|
116
113
|
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
this.logger.error(error);
|
|
116
|
+
}
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
else if (wsEventInfo.eventType === decorator_1.WSEventTypeEnum.ON_DISCONNECTION) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/ws",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.8",
|
|
4
4
|
"description": "Midway Web Framework for ws",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@midwayjs/decorator": "^3.0.0-beta.
|
|
26
|
-
"@midwayjs/mock": "^3.0.0-beta.
|
|
25
|
+
"@midwayjs/decorator": "^3.0.0-beta.8",
|
|
26
|
+
"@midwayjs/mock": "^3.0.0-beta.8",
|
|
27
27
|
"@types/ws": "^7.4.4",
|
|
28
28
|
"fs-extra": "^8.0.1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@midwayjs/core": "^3.0.0-beta.
|
|
32
|
-
"@midwayjs/logger": "^3.0.0-beta.
|
|
31
|
+
"@midwayjs/core": "^3.0.0-beta.8",
|
|
32
|
+
"@midwayjs/logger": "^3.0.0-beta.8",
|
|
33
33
|
"ws": "^7.4.5"
|
|
34
34
|
},
|
|
35
35
|
"author": "Harry Chen <czy88840616@gmail.com>",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=12"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "bfafbdf8798f48d4daac5dd88ad53c6b2f33c110"
|
|
44
44
|
}
|