server.inputJSON
supportlogger
param
- Update dependencies
tsbuffer
- Update dependencies
- Change log level of
[SendReturnErr]
todebug
when ws connection is closed
- Add
closeTimeout
forWsConnection.close
- Heartbeat timeout should terminate ws connection instantly
- Update deps
- Add
httpReq.rawBody
forHttpConnection
postConnectFlow
now would execute when http connection is established instead of request end
- Fixed that
preRecvDataFlow
is not enter if URL is not standard when using JSON mode
- Update to
[email protected]
- Issue that
ws.onClose
is not called whenwsClient.disconnect()
manually at CocosCreator Android platform. - Issue that the name of Api cannot be the same with it of Msg when using
WsClient
in JSON mode.
- Fixed issue that
logLevel
not works
- Ignore incoming data after heartbeat timeout
- New options
logConnect
forWsServer
- Protect
WebSocketProxy.onClose
executed duplicately.
- Bug:
WebSocketProxy.onClose
is not executed when heartbeat timeout when WIFI is broken
- New client flow:
preRecvMsgFlow
andpostRecvMsgFlow
- Support
server.listenMsg
by regexp
https
options forHttpServer
wss
options forWsServer
- Support using the same name with API and message
- Deprecate
serviceName
inpreRecvDataFlow
, useserviceId
instead - Optimized log color
- Remove
bson
dependency, importObjectId
dynamically.
- Update dependencies
HttpConnection.status
not correct when request aborted by client
- Builtin heartbeat support
- New options
logLevel
- Add response header
Content-Type: application/json; charset=utf-8
for JSON mode under HttpServer, to fix the decoding issue in Chrome dev tools.
- New server options
corsMaxAge
to optimized preflight requests, default value is 3600.
NonNullable
cannot 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
ApiRes
andApiErr
once they are ready to send, instead of after send them.
- When
preSendDataFlow
return undefined, do not send "Internal Server Error". - Remove some unused code.
postDisconnectFlow
not executed whendisconnect()
manually
preRecvDataFlow
add paramserviceName
- Support change
dataType
inpostConnectFlow
- Remark text error
- Support using
keyof
- Support type alias and
keyof
inPick
andOmit
- Support
Pick<Intersection>
andOmit<Intersection>
- Support
interface
extends Mapped Type, likePick
Omit
- 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 }
SchemaType
switched to class
mongodb-polyfill.d.ts
to fixed mongodb type bug.
- Return request type error detail when using JSON
- Optimize aliyun FC support of
server.inputJSON
WsServer
now support client usebuffer
as transfering format when server setjson: true
- Type error when disable
skipLibChecks
- Cannot resolve JSON when
headers
isapplication/json; charset=utf-8
- Cannot resolve serviceName when there is query string in the URL
conn.listenMsg
- Do not
broadcastMsg
whenconns.length
is0
server.inputJSON
andserver.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
,便于扩展类型HttpClient
andWsClient
no 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
sendMsg
andbroadcastMsg
- Return
Internal Server Error
whenSendReturnErr
occured
- Remove error
API not return anything
- handler of
client.listenMsg
changed to(msg, msgName, client)=>void
- NodeJS 12 compability issue (
Uint8Array
andBuffer
is not treated samely)
server.listenMsg
would returnhandler
that passed in