- Fixed issue that
logLevelnot works
- Ignore incoming data after heartbeat timeout
- New options
logConnectforWsServer - Protect
WebSocketProxy.onCloseexecuted duplicately.
- Bug:
WebSocketProxy.onCloseis not executed when heartbeat timeout when WIFI is broken
- New client flow:
preRecvMsgFlowandpostRecvMsgFlow - Support
server.listenMsgby regexp
httpsoptions forHttpServerwssoptions forWsServer- Support using the same name with API and message
- Deprecate
serviceNameinpreRecvDataFlow, useserviceIdinstead - Optimized log color
- Remove
bsondependency, importObjectIddynamically.
- Update dependencies
HttpConnection.statusnot correct when request aborted by client
- Builtin heartbeat support
- New options
logLevel
- Add response header
Content-Type: application/json; charset=utf-8for JSON mode under HttpServer, to fix the decoding issue in Chrome dev tools.
- New server options
corsMaxAgeto optimized preflight requests, default value is 3600.
NonNullablecannot be encoded and decoded when as a property in interface
- Print debug-level log when "pre flow" is canceled
- Log
[ResErr]renamed to[ApiErr]to consist with client's. - Log
ApiResandApiErronce they are ready to send, instead of after send them.
- When
preSendDataFlowreturn undefined, do not send "Internal Server Error". - Remove some unused code.
postDisconnectFlownot executed whendisconnect()manually
preRecvDataFlowadd paramserviceName- Support change
dataTypeinpostConnectFlow
- Remark text error
- Support using
keyof - Support type alias and
keyofinPickandOmit - Support
Pick<Intersection>andOmit<Intersection> - Support
interfaceextends Mapped Type, likePickOmit - Support
Pick<XXX, keyof XXX> - Support
Pick<XXX, TypeReference> - Support
Pick<UnionType>andPick<IntersectionType>, the same toOmit - Support reference enum value as literal type,like:
export enum Types { Type1, Type2 } export interface Obj { type: Types.Type1, value: string }
SchemaTypeswitched to class
mongodb-polyfill.d.tsto fixed mongodb type bug.
- Return request type error detail when using JSON
- Optimize aliyun FC support of
server.inputJSON
WsServernow support client usebufferas transfering format when server setjson: true
- Type error when disable
skipLibChecks - Cannot resolve JSON when
headersisapplication/json; charset=utf-8 - Cannot resolve serviceName when there is query string in the URL
conn.listenMsg
- Do not
broadcastMsgwhenconns.lengthis0
server.inputJSONandserver.inputBuffer- Add new dataType
json
- HTTP Text 传输模式下,区分 HTTP 状态码返回,不再统一返回 200
- WebSocket 支持 JSON 格式传输
- JSON 格式传输支持
ArrayBuffer、Date、ObjectId,自动根据协议编解码为string
jsonEnabled->json
- 增加
server.autoImplementApi第二个参数delay,用于延迟自动协议注册,加快冷启动速度。
- 增加
server.callApi的支持,以更方便的适配 Serverless 云函数等自定义传输场景。
- 修复
WsServer客户端断开连接后,日志显示的ActiveConn总是比实际多 1 的 BUG
- 增加对
mongodb/ObjectId的支持
BaseConnection泛型参数默认为any,便于扩展类型HttpClientandWsClientno longer have default type param
strictNullChecks默认改为false
- Optimize log level
- Optimize log color
- "Server started at ..." 前增加 "ERROR:X API registered failed."
HttpServer.onInputBufferError改为call.error('InputBufferError')- 替换
colors为chalk
- Optimize log for
sendMsgandbroadcastMsg - Return
Internal Server ErrorwhenSendReturnErroccured
- Remove error
API not return anything - handler of
client.listenMsgchanged to(msg, msgName, client)=>void
- NodeJS 12 compability issue (
Uint8ArrayandBufferis not treated samely)
server.listenMsgwould returnhandlerthat passed in