@litert/televoke 0.4.7 → 1.0.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/CHANGES.md +4 -2
- package/README.md +13 -8
- package/lib/client/Client.decl.d.ts +47 -0
- package/lib/client/Client.decl.d.ts.map +1 -0
- package/lib/client/Client.decl.js +18 -0
- package/lib/client/Client.decl.js.map +1 -0
- package/lib/client/JsonApiClient.impl.d.ts +28 -0
- package/lib/client/JsonApiClient.impl.d.ts.map +1 -0
- package/lib/client/JsonApiClient.impl.js +169 -0
- package/lib/client/JsonApiClient.impl.js.map +1 -0
- package/lib/client/LegacyHttpClient.impl.d.ts +62 -0
- package/lib/client/LegacyHttpClient.impl.d.ts.map +1 -0
- package/lib/client/LegacyHttpClient.impl.js +163 -0
- package/lib/client/LegacyHttpClient.impl.js.map +1 -0
- package/lib/client/index.d.ts +19 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +35 -0
- package/lib/client/index.js.map +1 -0
- package/lib/index.d.ts +18 -20
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -20
- package/lib/index.js.map +1 -1
- package/lib/server/LegacyServerChannel.impl.d.ts +38 -0
- package/lib/server/LegacyServerChannel.impl.d.ts.map +1 -0
- package/lib/server/LegacyServerChannel.impl.js +51 -0
- package/lib/server/LegacyServerChannel.impl.js.map +1 -0
- package/lib/server/Server.decl.d.ts +81 -0
- package/lib/server/Server.decl.d.ts.map +1 -0
- package/lib/server/Server.decl.js +18 -0
- package/lib/server/Server.decl.js.map +1 -0
- package/lib/server/Server.impl.d.ts +33 -0
- package/lib/server/Server.impl.d.ts.map +1 -0
- package/lib/server/Server.impl.js +58 -0
- package/lib/server/Server.impl.js.map +1 -0
- package/lib/server/ServerChannel.d.ts +20 -0
- package/lib/server/ServerChannel.d.ts.map +1 -0
- package/lib/server/ServerChannel.js +23 -0
- package/lib/server/ServerChannel.js.map +1 -0
- package/lib/server/SimpleJsonApiRouter.d.ts +28 -0
- package/lib/server/SimpleJsonApiRouter.d.ts.map +1 -0
- package/lib/server/SimpleJsonApiRouter.js +92 -0
- package/lib/server/SimpleJsonApiRouter.js.map +1 -0
- package/lib/server/index.d.ts +19 -0
- package/lib/server/index.d.ts.map +1 -0
- package/lib/server/index.js +35 -0
- package/lib/server/index.js.map +1 -0
- package/lib/shared/BinaryStream.d.ts +32 -0
- package/lib/shared/BinaryStream.d.ts.map +1 -0
- package/lib/shared/BinaryStream.js +93 -0
- package/lib/shared/BinaryStream.js.map +1 -0
- package/lib/shared/BinaryStreamManager.d.ts +52 -0
- package/lib/shared/BinaryStreamManager.d.ts.map +1 -0
- package/lib/shared/BinaryStreamManager.js +105 -0
- package/lib/shared/BinaryStreamManager.js.map +1 -0
- package/lib/shared/Channel.impl.d.ts +79 -0
- package/lib/shared/Channel.impl.d.ts.map +1 -0
- package/lib/shared/Channel.impl.js +433 -0
- package/lib/shared/Channel.impl.js.map +1 -0
- package/lib/shared/Constants.d.ts +32 -0
- package/lib/shared/Constants.d.ts.map +1 -0
- package/lib/shared/Constants.js +35 -0
- package/lib/shared/Constants.js.map +1 -0
- package/lib/shared/Encodings/index.d.ts +18 -0
- package/lib/shared/Encodings/index.d.ts.map +1 -0
- package/lib/shared/Encodings/index.js +21 -0
- package/lib/shared/Encodings/index.js.map +1 -0
- package/lib/shared/Encodings/v1/EncoderV1.d.ts +22 -0
- package/lib/shared/Encodings/v1/EncoderV1.d.ts.map +1 -0
- package/lib/shared/Encodings/v1/EncoderV1.js +47 -0
- package/lib/shared/Encodings/v1/EncoderV1.js.map +1 -0
- package/lib/shared/Encodings/v1/Protocol.v1.decls.d.ts +78 -0
- package/lib/shared/Encodings/v1/Protocol.v1.decls.d.ts.map +1 -0
- package/lib/shared/Encodings/v1/Protocol.v1.decls.js +53 -0
- package/lib/shared/Encodings/v1/Protocol.v1.decls.js.map +1 -0
- package/lib/shared/Encodings/v1/index.d.ts +18 -0
- package/lib/shared/Encodings/v1/index.d.ts.map +1 -0
- package/lib/shared/Encodings/v1/index.js +34 -0
- package/lib/shared/Encodings/v1/index.js.map +1 -0
- package/lib/shared/Encodings/v2/Constants.v2.d.ts +29 -0
- package/lib/shared/Encodings/v2/Constants.v2.d.ts.map +1 -0
- package/lib/shared/Encodings/v2/Constants.v2.js +34 -0
- package/lib/shared/Encodings/v2/Constants.v2.js.map +1 -0
- package/lib/shared/Encodings/v2/DecoderV2.d.ts +27 -0
- package/lib/shared/Encodings/v2/DecoderV2.d.ts.map +1 -0
- package/lib/shared/Encodings/v2/DecoderV2.js +279 -0
- package/lib/shared/Encodings/v2/DecoderV2.js.map +1 -0
- package/lib/shared/Encodings/v2/EncoderV2.d.ts +21 -0
- package/lib/shared/Encodings/v2/EncoderV2.d.ts.map +1 -0
- package/lib/shared/Encodings/v2/EncoderV2.js +176 -0
- package/lib/shared/Encodings/v2/EncoderV2.js.map +1 -0
- package/lib/shared/Encodings/v2/Encoding.v2.decl.d.ts +95 -0
- package/lib/shared/Encodings/v2/Encoding.v2.decl.d.ts.map +1 -0
- package/lib/shared/Encodings/v2/Encoding.v2.decl.js +18 -0
- package/lib/shared/Encodings/v2/Encoding.v2.decl.js.map +1 -0
- package/lib/shared/Encodings/v2/index.d.ts +20 -0
- package/lib/shared/Encodings/v2/index.d.ts.map +1 -0
- package/lib/shared/Encodings/v2/index.js +35 -0
- package/lib/shared/Encodings/v2/index.js.map +1 -0
- package/lib/shared/Errors.d.ts +60 -0
- package/lib/shared/Errors.d.ts.map +1 -0
- package/lib/shared/Errors.js +75 -0
- package/lib/shared/Errors.js.map +1 -0
- package/lib/shared/Shared.decl.d.ts +296 -0
- package/lib/shared/Shared.decl.d.ts.map +1 -0
- package/lib/shared/Shared.decl.js +18 -0
- package/lib/shared/Shared.decl.js.map +1 -0
- package/lib/shared/Utils.d.ts +25 -0
- package/lib/shared/Utils.d.ts.map +1 -0
- package/lib/shared/Utils.js +46 -0
- package/lib/shared/Utils.js.map +1 -0
- package/lib/shared/index.d.ts +23 -0
- package/lib/shared/index.d.ts.map +1 -0
- package/lib/shared/index.js +39 -0
- package/lib/shared/index.js.map +1 -0
- package/lib/transporters/Transporter.decl.d.ts +90 -0
- package/lib/transporters/Transporter.decl.d.ts.map +1 -0
- package/lib/transporters/Transporter.decl.js +18 -0
- package/lib/transporters/Transporter.decl.js.map +1 -0
- package/lib/transporters/http-listener/AbstractHttpListener.d.ts +32 -0
- package/lib/transporters/http-listener/AbstractHttpListener.d.ts.map +1 -0
- package/lib/transporters/http-listener/AbstractHttpListener.js +46 -0
- package/lib/transporters/http-listener/AbstractHttpListener.js.map +1 -0
- package/lib/transporters/http-listener/Http.Decl.d.ts +95 -0
- package/lib/transporters/http-listener/Http.Decl.d.ts.map +1 -0
- package/lib/transporters/http-listener/Http.Decl.js +52 -0
- package/lib/transporters/http-listener/Http.Decl.js.map +1 -0
- package/lib/transporters/http-listener/HttpListener.d.ts +18 -0
- package/lib/transporters/http-listener/HttpListener.d.ts.map +1 -0
- package/lib/transporters/http-listener/HttpListener.js +73 -0
- package/lib/transporters/http-listener/HttpListener.js.map +1 -0
- package/lib/transporters/http-listener/HttpUnixSocketListener.d.ts +18 -0
- package/lib/transporters/http-listener/HttpUnixSocketListener.d.ts.map +1 -0
- package/lib/transporters/http-listener/HttpUnixSocketListener.js +72 -0
- package/lib/transporters/http-listener/HttpUnixSocketListener.js.map +1 -0
- package/lib/transporters/http-listener/HttpsListener.d.ts +18 -0
- package/lib/transporters/http-listener/HttpsListener.d.ts.map +1 -0
- package/lib/transporters/http-listener/HttpsListener.js +73 -0
- package/lib/transporters/http-listener/HttpsListener.js.map +1 -0
- package/lib/transporters/http-listener/index.d.ts +20 -0
- package/lib/transporters/http-listener/index.d.ts.map +1 -0
- package/lib/transporters/http-listener/index.js +36 -0
- package/lib/transporters/http-listener/index.js.map +1 -0
- package/lib/transporters/index.d.ts +17 -0
- package/lib/transporters/index.d.ts.map +1 -0
- package/lib/transporters/index.js +18 -0
- package/lib/transporters/index.js.map +1 -0
- package/lib/transporters/legacy-http/LegacyHttp.Server.d.ts +24 -0
- package/lib/transporters/legacy-http/LegacyHttp.Server.d.ts.map +1 -0
- package/lib/transporters/legacy-http/LegacyHttp.Server.js +167 -0
- package/lib/transporters/legacy-http/LegacyHttp.Server.js.map +1 -0
- package/lib/transporters/legacy-http/LegacyHttp.Transporter.d.ts +28 -0
- package/lib/transporters/legacy-http/LegacyHttp.Transporter.d.ts.map +1 -0
- package/lib/transporters/legacy-http/LegacyHttp.Transporter.js +55 -0
- package/lib/transporters/legacy-http/LegacyHttp.Transporter.js.map +1 -0
- package/lib/transporters/legacy-http/index.d.ts +18 -0
- package/lib/transporters/legacy-http/index.d.ts.map +1 -0
- package/lib/transporters/legacy-http/index.js +34 -0
- package/lib/transporters/legacy-http/index.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Client.d.ts +19 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Client.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Client.js +33 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Client.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Server.d.ts +21 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Server.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Server.js +64 -0
- package/lib/transporters/lwdfx/LwDFX.Tcp.Server.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Client.d.ts +19 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Client.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Client.js +33 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Client.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Server.d.ts +21 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Server.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Server.js +64 -0
- package/lib/transporters/lwdfx/LwDFX.Tls.Server.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Transporter.d.ts +34 -0
- package/lib/transporters/lwdfx/LwDFX.Transporter.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.Transporter.js +78 -0
- package/lib/transporters/lwdfx/LwDFX.Transporter.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.d.ts +19 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.js +33 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.d.ts +21 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.js +64 -0
- package/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.js.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.decl.d.ts +18 -0
- package/lib/transporters/lwdfx/LwDFX.decl.d.ts.map +1 -0
- package/lib/transporters/lwdfx/LwDFX.decl.js +18 -0
- package/lib/transporters/lwdfx/LwDFX.decl.js.map +1 -0
- package/lib/transporters/lwdfx/index.d.ts +23 -0
- package/lib/transporters/lwdfx/index.d.ts.map +1 -0
- package/lib/transporters/lwdfx/index.js +39 -0
- package/lib/transporters/lwdfx/index.js.map +1 -0
- package/lib/transporters/memory/Memory.Impl.d.ts +43 -0
- package/lib/transporters/memory/Memory.Impl.d.ts.map +1 -0
- package/lib/transporters/memory/Memory.Impl.js +227 -0
- package/lib/transporters/memory/Memory.Impl.js.map +1 -0
- package/lib/transporters/memory/index.d.ts +17 -0
- package/lib/transporters/memory/index.d.ts.map +1 -0
- package/lib/transporters/memory/index.js +33 -0
- package/lib/transporters/memory/index.js.map +1 -0
- package/lib/transporters/websocket/WebSocket.Client.d.ts +20 -0
- package/lib/transporters/websocket/WebSocket.Client.d.ts.map +1 -0
- package/lib/transporters/websocket/WebSocket.Client.js +68 -0
- package/lib/transporters/websocket/WebSocket.Client.js.map +1 -0
- package/lib/transporters/websocket/WebSocket.Server.d.ts +25 -0
- package/lib/transporters/websocket/WebSocket.Server.d.ts.map +1 -0
- package/lib/transporters/websocket/WebSocket.Server.js +87 -0
- package/lib/transporters/websocket/WebSocket.Server.js.map +1 -0
- package/lib/transporters/websocket/WebSocket.Transporter.d.ts +34 -0
- package/lib/transporters/websocket/WebSocket.Transporter.d.ts.map +1 -0
- package/lib/transporters/websocket/WebSocket.Transporter.js +106 -0
- package/lib/transporters/websocket/WebSocket.Transporter.js.map +1 -0
- package/lib/transporters/websocket/WebSocket.decl.d.ts +19 -0
- package/lib/transporters/websocket/WebSocket.decl.d.ts.map +1 -0
- package/lib/transporters/websocket/WebSocket.decl.js +22 -0
- package/lib/transporters/websocket/WebSocket.decl.js.map +1 -0
- package/lib/transporters/websocket/index.d.ts +19 -0
- package/lib/transporters/websocket/index.d.ts.map +1 -0
- package/lib/transporters/websocket/index.js +35 -0
- package/lib/transporters/websocket/index.js.map +1 -0
- package/package.json +12 -12
- package/src/lib/client/Client.decl.ts +61 -0
- package/src/lib/client/JsonApiClient.impl.ts +258 -0
- package/src/lib/client/LegacyHttpClient.impl.ts +278 -0
- package/src/lib/client/index.ts +19 -0
- package/src/lib/index.ts +18 -20
- package/src/lib/server/LegacyServerChannel.impl.ts +71 -0
- package/src/lib/server/Server.decl.ts +109 -0
- package/src/lib/server/Server.impl.ts +90 -0
- package/src/lib/server/ServerChannel.ts +20 -0
- package/src/lib/server/SimpleJsonApiRouter.ts +135 -0
- package/src/lib/server/index.ts +19 -0
- package/src/lib/shared/BinaryStream.ts +131 -0
- package/src/lib/shared/BinaryStreamManager.ts +142 -0
- package/src/lib/shared/Channel.impl.ts +641 -0
- package/src/lib/shared/Constants.ts +35 -0
- package/src/lib/shared/Encodings/index.ts +18 -0
- package/src/lib/shared/Encodings/v1/EncoderV1.ts +66 -0
- package/src/lib/shared/Encodings/v1/Protocol.v1.decls.ts +96 -0
- package/src/lib/shared/Encodings/v1/index.ts +18 -0
- package/src/lib/shared/Encodings/v2/Constants.v2.ts +31 -0
- package/src/lib/shared/Encodings/v2/DecoderV2.ts +404 -0
- package/src/lib/shared/Encodings/v2/EncoderV2.ts +283 -0
- package/src/lib/shared/Encodings/v2/Encoding.v2.decl.ts +133 -0
- package/src/lib/shared/Encodings/v2/index.ts +20 -0
- package/src/lib/shared/Errors.ts +94 -0
- package/src/lib/shared/Shared.decl.ts +347 -0
- package/src/lib/shared/Utils.ts +51 -0
- package/src/lib/shared/index.ts +23 -0
- package/src/lib/transporters/Transporter.decl.ts +117 -0
- package/src/lib/transporters/http-listener/AbstractHttpListener.ts +57 -0
- package/src/lib/transporters/http-listener/Http.Decl.ts +141 -0
- package/src/lib/transporters/http-listener/HttpListener.ts +102 -0
- package/src/lib/transporters/http-listener/HttpUnixSocketListener.ts +97 -0
- package/src/lib/transporters/http-listener/HttpsListener.ts +102 -0
- package/src/lib/transporters/http-listener/index.ts +20 -0
- package/src/lib/transporters/index.ts +17 -0
- package/src/lib/transporters/legacy-http/LegacyHttp.Server.ts +262 -0
- package/src/lib/transporters/legacy-http/LegacyHttp.Transporter.ts +66 -0
- package/src/lib/transporters/legacy-http/index.ts +18 -0
- package/src/lib/transporters/lwdfx/LwDFX.Tcp.Client.ts +34 -0
- package/src/lib/transporters/lwdfx/LwDFX.Tcp.Server.ts +94 -0
- package/src/lib/transporters/lwdfx/LwDFX.Tls.Client.ts +34 -0
- package/src/lib/transporters/lwdfx/LwDFX.Tls.Server.ts +94 -0
- package/src/lib/transporters/lwdfx/LwDFX.Transporter.ts +100 -0
- package/src/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.ts +34 -0
- package/src/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.ts +94 -0
- package/src/lib/transporters/lwdfx/LwDFX.decl.ts +19 -0
- package/src/lib/transporters/lwdfx/index.ts +23 -0
- package/src/lib/transporters/memory/Memory.Impl.ts +363 -0
- package/src/lib/transporters/memory/index.ts +17 -0
- package/src/lib/transporters/websocket/WebSocket.Client.ts +76 -0
- package/src/lib/transporters/websocket/WebSocket.Server.ts +118 -0
- package/src/lib/transporters/websocket/WebSocket.Transporter.ts +132 -0
- package/src/lib/transporters/websocket/WebSocket.decl.ts +21 -0
- package/src/lib/transporters/websocket/index.ts +19 -0
- package/lib/Client/BuiltInRIDGenerator.d.ts +0 -4
- package/lib/Client/BuiltInRIDGenerator.d.ts.map +0 -1
- package/lib/Client/BuiltInRIDGenerator.js +0 -18
- package/lib/Client/BuiltInRIDGenerator.js.map +0 -1
- package/lib/Client/Common.d.ts +0 -47
- package/lib/Client/Common.d.ts.map +0 -1
- package/lib/Client/Common.js +0 -18
- package/lib/Client/Common.js.map +0 -1
- package/lib/Client/Errors.d.ts +0 -26
- package/lib/Client/Errors.d.ts.map +0 -1
- package/lib/Client/Errors.js +0 -80
- package/lib/Client/Errors.js.map +0 -1
- package/lib/Client/HttpClient.d.ts +0 -37
- package/lib/Client/HttpClient.d.ts.map +0 -1
- package/lib/Client/HttpClient.js +0 -148
- package/lib/Client/HttpClient.js.map +0 -1
- package/lib/Client/HttpsClient.d.ts +0 -40
- package/lib/Client/HttpsClient.d.ts.map +0 -1
- package/lib/Client/HttpsClient.js +0 -144
- package/lib/Client/HttpsClient.js.map +0 -1
- package/lib/Client/TCPClient.d.ts +0 -34
- package/lib/Client/TCPClient.d.ts.map +0 -1
- package/lib/Client/TCPClient.js +0 -271
- package/lib/Client/TCPClient.js.map +0 -1
- package/lib/Client/TLSClient.d.ts +0 -34
- package/lib/Client/TLSClient.d.ts.map +0 -1
- package/lib/Client/TLSClient.js +0 -265
- package/lib/Client/TLSClient.js.map +0 -1
- package/lib/Client/index.d.ts +0 -23
- package/lib/Client/index.d.ts.map +0 -1
- package/lib/Client/index.js +0 -39
- package/lib/Client/index.js.map +0 -1
- package/lib/Common/API.d.ts +0 -19
- package/lib/Common/API.d.ts.map +0 -1
- package/lib/Common/API.js +0 -18
- package/lib/Common/API.js.map +0 -1
- package/lib/Common/Encoding.d.ts +0 -32
- package/lib/Common/Encoding.d.ts.map +0 -1
- package/lib/Common/Encoding.js +0 -20
- package/lib/Common/Encoding.js.map +0 -1
- package/lib/Common/Request.d.ts +0 -23
- package/lib/Common/Request.d.ts.map +0 -1
- package/lib/Common/Request.js +0 -18
- package/lib/Common/Request.js.map +0 -1
- package/lib/Common/Response.d.ts +0 -60
- package/lib/Common/Response.d.ts.map +0 -1
- package/lib/Common/Response.js +0 -42
- package/lib/Common/Response.js.map +0 -1
- package/lib/Common/index.d.ts +0 -20
- package/lib/Common/index.d.ts.map +0 -1
- package/lib/Common/index.js +0 -36
- package/lib/Common/index.js.map +0 -1
- package/lib/Encoder/Decoder.d.ts +0 -18
- package/lib/Encoder/Decoder.d.ts.map +0 -1
- package/lib/Encoder/Decoder.js +0 -136
- package/lib/Encoder/Decoder.js.map +0 -1
- package/lib/Encoder/Encoder.d.ts +0 -18
- package/lib/Encoder/Encoder.d.ts.map +0 -1
- package/lib/Encoder/Encoder.js +0 -35
- package/lib/Encoder/Encoder.js.map +0 -1
- package/lib/Encoder/Errors.d.ts +0 -17
- package/lib/Encoder/Errors.d.ts.map +0 -1
- package/lib/Encoder/Errors.js +0 -26
- package/lib/Encoder/Errors.js.map +0 -1
- package/lib/Errors.d.ts +0 -20
- package/lib/Errors.d.ts.map +0 -1
- package/lib/Errors.js +0 -40
- package/lib/Errors.js.map +0 -1
- package/lib/Server/Common/Gateway.d.ts +0 -26
- package/lib/Server/Common/Gateway.d.ts.map +0 -1
- package/lib/Server/Common/Gateway.js +0 -18
- package/lib/Server/Common/Gateway.js.map +0 -1
- package/lib/Server/Common/Request.d.ts +0 -21
- package/lib/Server/Common/Request.d.ts.map +0 -1
- package/lib/Server/Common/Request.js +0 -18
- package/lib/Server/Common/Request.js.map +0 -1
- package/lib/Server/Common/Router.d.ts +0 -41
- package/lib/Server/Common/Router.d.ts.map +0 -1
- package/lib/Server/Common/Router.js +0 -18
- package/lib/Server/Common/Router.js.map +0 -1
- package/lib/Server/Common/Server.d.ts +0 -57
- package/lib/Server/Common/Server.d.ts.map +0 -1
- package/lib/Server/Common/Server.js +0 -18
- package/lib/Server/Common/Server.js.map +0 -1
- package/lib/Server/Common/index.d.ts +0 -20
- package/lib/Server/Common/index.d.ts.map +0 -1
- package/lib/Server/Common/index.js +0 -36
- package/lib/Server/Common/index.js.map +0 -1
- package/lib/Server/Errors.d.ts +0 -25
- package/lib/Server/Errors.d.ts.map +0 -1
- package/lib/Server/Errors.js +0 -74
- package/lib/Server/Errors.js.map +0 -1
- package/lib/Server/Gateways/Http.d.ts +0 -18
- package/lib/Server/Gateways/Http.d.ts.map +0 -1
- package/lib/Server/Gateways/Http.js +0 -148
- package/lib/Server/Gateways/Http.js.map +0 -1
- package/lib/Server/Gateways/TCP.d.ts +0 -23
- package/lib/Server/Gateways/TCP.d.ts.map +0 -1
- package/lib/Server/Gateways/TCP.js +0 -146
- package/lib/Server/Gateways/TCP.js.map +0 -1
- package/lib/Server/Server.d.ts +0 -18
- package/lib/Server/Server.d.ts.map +0 -1
- package/lib/Server/Server.js +0 -200
- package/lib/Server/Server.js.map +0 -1
- package/lib/Server/SimpleRouter.d.ts +0 -41
- package/lib/Server/SimpleRouter.d.ts.map +0 -1
- package/lib/Server/SimpleRouter.js +0 -54
- package/lib/Server/SimpleRouter.js.map +0 -1
- package/lib/Server/index.d.ts +0 -22
- package/lib/Server/index.d.ts.map +0 -1
- package/lib/Server/index.js +0 -38
- package/lib/Server/index.js.map +0 -1
- package/src/lib/Client/BuiltInRIDGenerator.ts +0 -21
- package/src/lib/Client/Common.ts +0 -63
- package/src/lib/Client/Errors.ts +0 -87
- package/src/lib/Client/HttpClient.ts +0 -232
- package/src/lib/Client/HttpsClient.ts +0 -238
- package/src/lib/Client/TCPClient.ts +0 -420
- package/src/lib/Client/TLSClient.ts +0 -422
- package/src/lib/Client/index.ts +0 -23
- package/src/lib/Common/API.ts +0 -20
- package/src/lib/Common/Encoding.ts +0 -42
- package/src/lib/Common/Request.ts +0 -28
- package/src/lib/Common/Response.ts +0 -67
- package/src/lib/Common/index.ts +0 -20
- package/src/lib/Encoder/Decoder.ts +0 -206
- package/src/lib/Encoder/Encoder.ts +0 -41
- package/src/lib/Encoder/Errors.ts +0 -24
- package/src/lib/Errors.ts +0 -40
- package/src/lib/Server/Common/Gateway.ts +0 -37
- package/src/lib/Server/Common/Request.ts +0 -24
- package/src/lib/Server/Common/Router.ts +0 -52
- package/src/lib/Server/Common/Server.ts +0 -68
- package/src/lib/Server/Common/index.ts +0 -20
- package/src/lib/Server/Errors.ts +0 -80
- package/src/lib/Server/Gateways/Http.ts +0 -209
- package/src/lib/Server/Gateways/TCP.ts +0 -221
- package/src/lib/Server/Server.ts +0 -268
- package/src/lib/Server/SimpleRouter.ts +0 -95
- package/src/lib/Server/index.ts +0 -22
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum EResponseCode {
|
|
17
|
+
/**
|
|
18
|
+
* API was called succeed
|
|
19
|
+
*/
|
|
20
|
+
OK = 0,
|
|
21
|
+
/**
|
|
22
|
+
* The invoked API does not exist on the remote server.
|
|
23
|
+
*/
|
|
24
|
+
API_NOT_FOUND = 1,
|
|
25
|
+
/**
|
|
26
|
+
* Some unexpected error happened.
|
|
27
|
+
*/
|
|
28
|
+
SYSTEM_ERROR = 2,
|
|
29
|
+
/**
|
|
30
|
+
* Logical error happened inside the API handler.
|
|
31
|
+
*/
|
|
32
|
+
FAILURE = 3,
|
|
33
|
+
/**
|
|
34
|
+
* The arguments inside the request is malformed.
|
|
35
|
+
*/
|
|
36
|
+
MALFORMED_ARGUMENTS = 4
|
|
37
|
+
}
|
|
38
|
+
export interface IRequestPayloadV1 {
|
|
39
|
+
ttl: number;
|
|
40
|
+
api: string;
|
|
41
|
+
args: unknown;
|
|
42
|
+
cst: number;
|
|
43
|
+
rid: string | number;
|
|
44
|
+
}
|
|
45
|
+
export interface IResponsePayloadV1 {
|
|
46
|
+
/**
|
|
47
|
+
* The time when server sent the response.
|
|
48
|
+
*/
|
|
49
|
+
sst: number;
|
|
50
|
+
/**
|
|
51
|
+
* The time when server received the request.
|
|
52
|
+
*/
|
|
53
|
+
srt: number;
|
|
54
|
+
/**
|
|
55
|
+
* The identity of the request.
|
|
56
|
+
*/
|
|
57
|
+
rid: string | number;
|
|
58
|
+
/**
|
|
59
|
+
* The protocol status code of the response.
|
|
60
|
+
*/
|
|
61
|
+
code: number;
|
|
62
|
+
/**
|
|
63
|
+
* The content of API response.
|
|
64
|
+
*/
|
|
65
|
+
body: unknown;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The default port for HTTP.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DEFAULT_INSECURE_PORT = 80;
|
|
71
|
+
/**
|
|
72
|
+
* The default port for HTTPS.
|
|
73
|
+
*/
|
|
74
|
+
export declare const DEFAULT_SECURE_PORT = 443;
|
|
75
|
+
export declare const DEFAULT_BACKLOG = 511;
|
|
76
|
+
export declare const DEFAULT_HOSTNAME = "localhost";
|
|
77
|
+
export declare const MAX_PACKET_SIZE: number;
|
|
78
|
+
//# sourceMappingURL=Protocol.v1.decls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Protocol.v1.decls.d.ts","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v1/Protocol.v1.decls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,oBAAY,aAAa;IAErB;;OAEG;IACH,EAAE,IAAA;IACF;;OAEG;IACH,aAAa,IAAA;IACb;;OAEG;IACH,YAAY,IAAA;IACZ;;OAEG;IACH,OAAO,IAAA;IACP;;OAEG;IACH,mBAAmB,IAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAE9B,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,EAAE,OAAO,CAAC;IAEd,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAE/B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C,eAAO,MAAM,eAAe,QAAmB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MAX_PACKET_SIZE = exports.DEFAULT_HOSTNAME = exports.DEFAULT_BACKLOG = exports.DEFAULT_SECURE_PORT = exports.DEFAULT_INSECURE_PORT = exports.EResponseCode = void 0;
|
|
19
|
+
var EResponseCode;
|
|
20
|
+
(function (EResponseCode) {
|
|
21
|
+
/**
|
|
22
|
+
* API was called succeed
|
|
23
|
+
*/
|
|
24
|
+
EResponseCode[EResponseCode["OK"] = 0] = "OK";
|
|
25
|
+
/**
|
|
26
|
+
* The invoked API does not exist on the remote server.
|
|
27
|
+
*/
|
|
28
|
+
EResponseCode[EResponseCode["API_NOT_FOUND"] = 1] = "API_NOT_FOUND";
|
|
29
|
+
/**
|
|
30
|
+
* Some unexpected error happened.
|
|
31
|
+
*/
|
|
32
|
+
EResponseCode[EResponseCode["SYSTEM_ERROR"] = 2] = "SYSTEM_ERROR";
|
|
33
|
+
/**
|
|
34
|
+
* Logical error happened inside the API handler.
|
|
35
|
+
*/
|
|
36
|
+
EResponseCode[EResponseCode["FAILURE"] = 3] = "FAILURE";
|
|
37
|
+
/**
|
|
38
|
+
* The arguments inside the request is malformed.
|
|
39
|
+
*/
|
|
40
|
+
EResponseCode[EResponseCode["MALFORMED_ARGUMENTS"] = 4] = "MALFORMED_ARGUMENTS";
|
|
41
|
+
})(EResponseCode || (exports.EResponseCode = EResponseCode = {}));
|
|
42
|
+
/**
|
|
43
|
+
* The default port for HTTP.
|
|
44
|
+
*/
|
|
45
|
+
exports.DEFAULT_INSECURE_PORT = 80;
|
|
46
|
+
/**
|
|
47
|
+
* The default port for HTTPS.
|
|
48
|
+
*/
|
|
49
|
+
exports.DEFAULT_SECURE_PORT = 443;
|
|
50
|
+
exports.DEFAULT_BACKLOG = 511;
|
|
51
|
+
exports.DEFAULT_HOSTNAME = 'localhost';
|
|
52
|
+
exports.MAX_PACKET_SIZE = 64 * 1024 * 1024;
|
|
53
|
+
//# sourceMappingURL=Protocol.v1.decls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Protocol.v1.decls.js","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v1/Protocol.v1.decls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,IAAY,aAsBX;AAtBD,WAAY,aAAa;IAErB;;OAEG;IACH,6CAAE,CAAA;IACF;;OAEG;IACH,mEAAa,CAAA;IACb;;OAEG;IACH,iEAAY,CAAA;IACZ;;OAEG;IACH,uDAAO,CAAA;IACP;;OAEG;IACH,+EAAmB,CAAA;AACvB,CAAC,EAtBW,aAAa,6BAAb,aAAa,QAsBxB;AA2CD;;GAEG;AACU,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAExC;;GAEG;AACU,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAE1B,QAAA,eAAe,GAAG,GAAG,CAAC;AAEtB,QAAA,gBAAgB,GAAG,WAAW,CAAC;AAE/B,QAAA,eAAe,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './EncoderV1';
|
|
17
|
+
export * from './Protocol.v1.decls';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v1/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
__exportStar(require("./EncoderV1"), exports);
|
|
33
|
+
__exportStar(require("./Protocol.v1.decls"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v1/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;;;;;;;;;;;;;;AAEF,8CAA4B;AAC5B,sDAAoC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum ECommand {
|
|
17
|
+
API_CALL = 0,
|
|
18
|
+
PUSH_MESSAGE = 1,
|
|
19
|
+
BINARY_CHUNK = 2,
|
|
20
|
+
PING = 254,
|
|
21
|
+
CLOSE = 255
|
|
22
|
+
}
|
|
23
|
+
export declare enum EPacketType {
|
|
24
|
+
REQUEST = 0,
|
|
25
|
+
SUCCESS_RESPONSE = 1,
|
|
26
|
+
ERROR_RESPONSE = 2
|
|
27
|
+
}
|
|
28
|
+
export declare const HEADER_SIZE = 8;
|
|
29
|
+
//# sourceMappingURL=Constants.v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.v2.d.ts","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v2/Constants.v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,oBAAY,QAAQ;IAChB,QAAQ,IAAO;IACf,YAAY,IAAO;IACnB,YAAY,IAAO;IACnB,IAAI,MAAO;IACX,KAAK,MAAO;CACf;AAED,oBAAY,WAAW;IACnB,OAAO,IAAO;IACd,gBAAgB,IAAO;IACvB,cAAc,IAAO;CACxB;AAED,eAAO,MAAM,WAAW,IAAI,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.HEADER_SIZE = exports.EPacketType = exports.ECommand = void 0;
|
|
19
|
+
var ECommand;
|
|
20
|
+
(function (ECommand) {
|
|
21
|
+
ECommand[ECommand["API_CALL"] = 0] = "API_CALL";
|
|
22
|
+
ECommand[ECommand["PUSH_MESSAGE"] = 1] = "PUSH_MESSAGE";
|
|
23
|
+
ECommand[ECommand["BINARY_CHUNK"] = 2] = "BINARY_CHUNK";
|
|
24
|
+
ECommand[ECommand["PING"] = 254] = "PING";
|
|
25
|
+
ECommand[ECommand["CLOSE"] = 255] = "CLOSE";
|
|
26
|
+
})(ECommand || (exports.ECommand = ECommand = {}));
|
|
27
|
+
var EPacketType;
|
|
28
|
+
(function (EPacketType) {
|
|
29
|
+
EPacketType[EPacketType["REQUEST"] = 0] = "REQUEST";
|
|
30
|
+
EPacketType[EPacketType["SUCCESS_RESPONSE"] = 1] = "SUCCESS_RESPONSE";
|
|
31
|
+
EPacketType[EPacketType["ERROR_RESPONSE"] = 2] = "ERROR_RESPONSE";
|
|
32
|
+
})(EPacketType || (exports.EPacketType = EPacketType = {}));
|
|
33
|
+
exports.HEADER_SIZE = 8;
|
|
34
|
+
//# sourceMappingURL=Constants.v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.v2.js","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v2/Constants.v2.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,+CAAe,CAAA;IACf,uDAAmB,CAAA;IACnB,uDAAmB,CAAA;IACnB,yCAAW,CAAA;IACX,2CAAY,CAAA;AAChB,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,mDAAc,CAAA;IACd,qEAAuB,CAAA;IACvB,iEAAqB,CAAA;AACzB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAEY,QAAA,WAAW,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/// <reference types="node" />
|
|
17
|
+
import type * as dEnc2 from './Encoding.v2.decl';
|
|
18
|
+
export declare class TvDecoderV2 {
|
|
19
|
+
/**
|
|
20
|
+
* Pass all chunks of a whole packet to this method, and it will return an array of decoded results.
|
|
21
|
+
*
|
|
22
|
+
* @throws {TelevokeError}
|
|
23
|
+
*/
|
|
24
|
+
decode(packetChunks: Buffer[]): dEnc2.ICommandPacket;
|
|
25
|
+
private _decodeHeader;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=DecoderV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecoderV2.d.ts","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v2/DecoderV2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;AAKF,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAwTjD,qBAAa,WAAW;IAEpB;;;;OAIG;IACI,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,cAAc;IAmB3D,OAAO,CAAC,aAAa;CA8CxB"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TvDecoderV2 = void 0;
|
|
19
|
+
const CSv2 = require("./Constants.v2");
|
|
20
|
+
const CS = require("../../Constants");
|
|
21
|
+
const Errors_1 = require("../../Errors");
|
|
22
|
+
const B8 = Buffer.allocUnsafe(8);
|
|
23
|
+
const B4 = Buffer.allocUnsafe(4);
|
|
24
|
+
const B2 = Buffer.allocUnsafe(2);
|
|
25
|
+
function readSmallBytes(bytes, buf, ctx) {
|
|
26
|
+
let readBytes = 0;
|
|
27
|
+
while (readBytes < bytes) {
|
|
28
|
+
if (ctx.chIndex === ctx.chunks.length) {
|
|
29
|
+
throw new Errors_1.errors.incomplete_packet();
|
|
30
|
+
}
|
|
31
|
+
const c = ctx.chunks[ctx.chIndex];
|
|
32
|
+
const cLen = c.byteLength;
|
|
33
|
+
let cOff = ctx.chOffset;
|
|
34
|
+
do {
|
|
35
|
+
buf[readBytes++] = c[cOff++];
|
|
36
|
+
} while (cOff < cLen && readBytes < bytes);
|
|
37
|
+
if (cOff === cLen) {
|
|
38
|
+
ctx.chIndex++;
|
|
39
|
+
ctx.chOffset = 0;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
ctx.chOffset = cOff;
|
|
43
|
+
}
|
|
44
|
+
if (readBytes === bytes) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return buf;
|
|
49
|
+
}
|
|
50
|
+
function readLargeBytes(bytes, ctx) {
|
|
51
|
+
let readBytes = 0;
|
|
52
|
+
const ret = [];
|
|
53
|
+
while (readBytes < bytes) {
|
|
54
|
+
if (ctx.chIndex === ctx.chunks.length) {
|
|
55
|
+
throw new Errors_1.errors.incomplete_packet();
|
|
56
|
+
}
|
|
57
|
+
const c = ctx.chunks[ctx.chIndex];
|
|
58
|
+
const bytes2Read = Math.min(bytes - readBytes, c.byteLength - ctx.chOffset);
|
|
59
|
+
ret.push(c.subarray(ctx.chOffset, ctx.chOffset + bytes2Read));
|
|
60
|
+
readBytes += bytes2Read;
|
|
61
|
+
ctx.chOffset += bytes2Read;
|
|
62
|
+
if (ctx.chOffset === c.byteLength) {
|
|
63
|
+
ctx.chIndex++;
|
|
64
|
+
ctx.chOffset = 0;
|
|
65
|
+
}
|
|
66
|
+
if (readBytes === bytes) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return ret;
|
|
71
|
+
}
|
|
72
|
+
function readString(bytes, ctx) {
|
|
73
|
+
const td = new TextDecoder('utf8');
|
|
74
|
+
let readBytes = 0;
|
|
75
|
+
let ret = '';
|
|
76
|
+
while (readBytes < bytes) {
|
|
77
|
+
if (ctx.chIndex === ctx.chunks.length) {
|
|
78
|
+
throw new Errors_1.errors.incomplete_packet();
|
|
79
|
+
}
|
|
80
|
+
const c = ctx.chunks[ctx.chIndex];
|
|
81
|
+
const bytes2Read = Math.min(bytes - readBytes, c.byteLength - ctx.chOffset);
|
|
82
|
+
ret += td.decode(c.subarray(ctx.chOffset, ctx.chOffset + bytes2Read), { stream: true });
|
|
83
|
+
readBytes += bytes2Read;
|
|
84
|
+
ctx.chOffset += bytes2Read;
|
|
85
|
+
if (ctx.chOffset === c.byteLength) {
|
|
86
|
+
ctx.chIndex++;
|
|
87
|
+
ctx.chOffset = 0;
|
|
88
|
+
}
|
|
89
|
+
if (readBytes === bytes) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return ret;
|
|
94
|
+
}
|
|
95
|
+
function readVarString(ctx) {
|
|
96
|
+
const len = readSmallBytes(2, B2, ctx).readUInt16LE(0);
|
|
97
|
+
return readString(len, ctx);
|
|
98
|
+
}
|
|
99
|
+
function readVarBuffer(ctx) {
|
|
100
|
+
const len = readSmallBytes(4, B4, ctx).readUInt32LE(0);
|
|
101
|
+
return readLargeBytes(len, ctx);
|
|
102
|
+
}
|
|
103
|
+
function readVarBuffer16(ctx) {
|
|
104
|
+
const len = readSmallBytes(2, B4, ctx).readUInt16LE(0);
|
|
105
|
+
return readLargeBytes(len, ctx);
|
|
106
|
+
}
|
|
107
|
+
class TvErrorResponseDecoder {
|
|
108
|
+
decode(ctx) {
|
|
109
|
+
const len = readSmallBytes(2, B2, ctx).readUInt16LE(0);
|
|
110
|
+
const errorMsg = readString(len, ctx);
|
|
111
|
+
return {
|
|
112
|
+
'cmd': ctx.command,
|
|
113
|
+
'typ': CSv2.EPacketType.ERROR_RESPONSE,
|
|
114
|
+
'seq': ctx.seq,
|
|
115
|
+
'ct': errorMsg.startsWith(CS.PROTOCOL_ERROR_NAMESPACE) ?
|
|
116
|
+
new Errors_1.ProtocolError(errorMsg.slice(CS.PROTOCOL_ERROR_NAMESPACE.length + 1), null) :
|
|
117
|
+
new Errors_1.errors.app_error(errorMsg.slice(CS.APP_ERROR_NAMESPACE.length + 1), null),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
class TvApiRequestDecoder {
|
|
122
|
+
decode(ctx) {
|
|
123
|
+
const name = readVarString(ctx);
|
|
124
|
+
return {
|
|
125
|
+
'cmd': CSv2.ECommand.API_CALL,
|
|
126
|
+
'typ': CSv2.EPacketType.REQUEST,
|
|
127
|
+
'seq': ctx.seq,
|
|
128
|
+
'ct': {
|
|
129
|
+
'name': name,
|
|
130
|
+
'body': readVarBuffer(ctx),
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
class TvPingRequestDecoder {
|
|
136
|
+
decode(ctx) {
|
|
137
|
+
return {
|
|
138
|
+
'cmd': CSv2.ECommand.PING,
|
|
139
|
+
'typ': CSv2.EPacketType.REQUEST,
|
|
140
|
+
'seq': ctx.seq,
|
|
141
|
+
'ct': readVarBuffer16(ctx)
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
class TvPushMessageRequestDecoder {
|
|
146
|
+
decode(ctx) {
|
|
147
|
+
return {
|
|
148
|
+
'cmd': CSv2.ECommand.PUSH_MESSAGE,
|
|
149
|
+
'typ': CSv2.EPacketType.REQUEST,
|
|
150
|
+
'seq': ctx.seq,
|
|
151
|
+
'ct': readVarBuffer16(ctx)
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
class TvBinaryChunkRequestDecoder {
|
|
156
|
+
decode(ctx) {
|
|
157
|
+
const streamId = readSmallBytes(4, B4, ctx).readUInt32LE(0);
|
|
158
|
+
return {
|
|
159
|
+
'cmd': CSv2.ECommand.BINARY_CHUNK,
|
|
160
|
+
'typ': CSv2.EPacketType.REQUEST,
|
|
161
|
+
'seq': ctx.seq,
|
|
162
|
+
'ct': {
|
|
163
|
+
'streamId': streamId,
|
|
164
|
+
'body': readVarBuffer(ctx),
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
class TvCloseRequestDecoder {
|
|
170
|
+
decode(ctx) {
|
|
171
|
+
return {
|
|
172
|
+
'cmd': CSv2.ECommand.CLOSE,
|
|
173
|
+
'typ': CSv2.EPacketType.REQUEST,
|
|
174
|
+
'seq': ctx.seq,
|
|
175
|
+
'ct': null
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
class TvVoidResponseDecoder {
|
|
180
|
+
decode(ctx) {
|
|
181
|
+
return {
|
|
182
|
+
'cmd': ctx.command,
|
|
183
|
+
'typ': CSv2.EPacketType.SUCCESS_RESPONSE,
|
|
184
|
+
'seq': ctx.seq,
|
|
185
|
+
'ct': null
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
class TvApiResponseDecoder {
|
|
190
|
+
decode(ctx) {
|
|
191
|
+
return {
|
|
192
|
+
'cmd': CSv2.ECommand.API_CALL,
|
|
193
|
+
'typ': CSv2.EPacketType.SUCCESS_RESPONSE,
|
|
194
|
+
'seq': ctx.seq,
|
|
195
|
+
'ct': readVarBuffer(ctx)
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
class TvPingResponseDecoder {
|
|
200
|
+
decode(ctx) {
|
|
201
|
+
return {
|
|
202
|
+
'cmd': CSv2.ECommand.PING,
|
|
203
|
+
'typ': CSv2.EPacketType.SUCCESS_RESPONSE,
|
|
204
|
+
'seq': ctx.seq,
|
|
205
|
+
'ct': readVarBuffer16(ctx)
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const packetDecoders = {
|
|
210
|
+
[CSv2.EPacketType.ERROR_RESPONSE + 0x100 * CSv2.ECommand.API_CALL]: new TvErrorResponseDecoder(),
|
|
211
|
+
[CSv2.EPacketType.ERROR_RESPONSE + 0x100 * CSv2.ECommand.PING]: new TvErrorResponseDecoder(),
|
|
212
|
+
[CSv2.EPacketType.ERROR_RESPONSE + 0x100 * CSv2.ECommand.BINARY_CHUNK]: new TvErrorResponseDecoder(),
|
|
213
|
+
[CSv2.EPacketType.ERROR_RESPONSE + 0x100 * CSv2.ECommand.CLOSE]: new TvErrorResponseDecoder(),
|
|
214
|
+
[CSv2.EPacketType.ERROR_RESPONSE + 0x100 * CSv2.ECommand.PUSH_MESSAGE]: new TvErrorResponseDecoder(),
|
|
215
|
+
[CSv2.EPacketType.REQUEST + 0x100 * CSv2.ECommand.API_CALL]: new TvApiRequestDecoder(),
|
|
216
|
+
[CSv2.EPacketType.REQUEST + 0x100 * CSv2.ECommand.PING]: new TvPingRequestDecoder(),
|
|
217
|
+
[CSv2.EPacketType.REQUEST + 0x100 * CSv2.ECommand.PUSH_MESSAGE]: new TvPushMessageRequestDecoder(),
|
|
218
|
+
[CSv2.EPacketType.REQUEST + 0x100 * CSv2.ECommand.CLOSE]: new TvCloseRequestDecoder(),
|
|
219
|
+
[CSv2.EPacketType.REQUEST + 0x100 * CSv2.ECommand.BINARY_CHUNK]: new TvBinaryChunkRequestDecoder(),
|
|
220
|
+
[CSv2.EPacketType.SUCCESS_RESPONSE + 0x100 * CSv2.ECommand.PUSH_MESSAGE]: new TvVoidResponseDecoder(),
|
|
221
|
+
[CSv2.EPacketType.SUCCESS_RESPONSE + 0x100 * CSv2.ECommand.CLOSE]: new TvVoidResponseDecoder(),
|
|
222
|
+
[CSv2.EPacketType.SUCCESS_RESPONSE + 0x100 * CSv2.ECommand.BINARY_CHUNK]: new TvVoidResponseDecoder(),
|
|
223
|
+
[CSv2.EPacketType.SUCCESS_RESPONSE + 0x100 * CSv2.ECommand.API_CALL]: new TvApiResponseDecoder(),
|
|
224
|
+
[CSv2.EPacketType.SUCCESS_RESPONSE + 0x100 * CSv2.ECommand.PING]: new TvPingResponseDecoder(),
|
|
225
|
+
};
|
|
226
|
+
class TvDecoderV2 {
|
|
227
|
+
/**
|
|
228
|
+
* Pass all chunks of a whole packet to this method, and it will return an array of decoded results.
|
|
229
|
+
*
|
|
230
|
+
* @throws {TelevokeError}
|
|
231
|
+
*/
|
|
232
|
+
decode(packetChunks) {
|
|
233
|
+
const ctx = this._decodeHeader(packetChunks);
|
|
234
|
+
try {
|
|
235
|
+
return packetDecoders[ctx.command * 0x100 + ctx.type].decode(ctx);
|
|
236
|
+
}
|
|
237
|
+
catch (e) {
|
|
238
|
+
if (e instanceof Errors_1.TelevokeError) {
|
|
239
|
+
throw e;
|
|
240
|
+
}
|
|
241
|
+
throw new Errors_1.errors.invalid_packet(null, e);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
_decodeHeader(chunks) {
|
|
245
|
+
try {
|
|
246
|
+
const ctx = {
|
|
247
|
+
chunks,
|
|
248
|
+
chIndex: 0,
|
|
249
|
+
chOffset: 0,
|
|
250
|
+
command: 0,
|
|
251
|
+
type: 0,
|
|
252
|
+
seq: 0,
|
|
253
|
+
};
|
|
254
|
+
readSmallBytes(8, B8, ctx);
|
|
255
|
+
ctx.command = B8[0];
|
|
256
|
+
ctx.type = B8[1];
|
|
257
|
+
if (undefined === CSv2.EPacketType[ctx.type]) {
|
|
258
|
+
throw new Errors_1.errors.invalid_packet({
|
|
259
|
+
unknownPacketType: ctx.type,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
if (undefined === CSv2.ECommand[ctx.command]) {
|
|
263
|
+
throw new Errors_1.errors.invalid_packet({
|
|
264
|
+
unknownCommand: ctx.command,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
ctx.seq = B8.readUInt16LE(2) * 4294967296 + B8.readUInt32LE(4);
|
|
268
|
+
return ctx;
|
|
269
|
+
}
|
|
270
|
+
catch (e) {
|
|
271
|
+
if (e instanceof Errors_1.TelevokeError) {
|
|
272
|
+
throw e;
|
|
273
|
+
}
|
|
274
|
+
throw new Errors_1.errors.invalid_packet(null, e);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
exports.TvDecoderV2 = TvDecoderV2;
|
|
279
|
+
//# sourceMappingURL=DecoderV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecoderV2.js","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v2/DecoderV2.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,uCAAuC;AACvC,sCAAsC;AACtC,yCAAoE;AAkBpE,MAAM,EAAE,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,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,UAAa,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAEnE,OAAO,GAAG,CAAC;SACd;QACD,OAAO,CAAC,EAAE;YAEN,IAAI,CAAC,YAAY,sBAAa,EAAE;gBAE5B,MAAM,CAAC,CAAC;aACX;YAED,MAAM,IAAI,eAAM,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SAC5C;IACL,CAAC;CACJ;AAxED,kCAwEC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Angus.Fenying <fenying@litert.org>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/// <reference types="node" />
|
|
17
|
+
import type * as dEnc2 from './Encoding.v2.decl';
|
|
18
|
+
export declare class TvEncoderV2 {
|
|
19
|
+
encode(packet: dEnc2.ICommandPacket): Array<Buffer | string>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=EncoderV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EncoderV2.d.ts","sourceRoot":"","sources":["../../../../src/lib/shared/Encodings/v2/EncoderV2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;AAIF,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAkQjD,qBAAa,WAAW;IAEb,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;CAItE"}
|