@litert/televoke 0.4.7 → 1.0.0-1
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 +36 -0
- package/lib/shared/BinaryStream.d.ts.map +1 -0
- package/lib/shared/BinaryStream.js +100 -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 +448 -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 +281 -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 +177 -0
- package/lib/shared/Encodings/v2/EncoderV2.js.map +1 -0
- package/lib/shared/Encodings/v2/Encoding.v2.decl.d.ts +99 -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 +61 -0
- package/lib/shared/Errors.d.ts.map +1 -0
- package/lib/shared/Errors.js +76 -0
- package/lib/shared/Errors.js.map +1 -0
- package/lib/shared/Shared.decl.d.ts +313 -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 +141 -0
- package/src/lib/shared/BinaryStreamManager.ts +142 -0
- package/src/lib/shared/Channel.impl.ts +658 -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 +406 -0
- package/src/lib/shared/Encodings/v2/EncoderV2.ts +284 -0
- package/src/lib/shared/Encodings/v2/Encoding.v2.decl.ts +138 -0
- package/src/lib/shared/Encodings/v2/index.ts +20 -0
- package/src/lib/shared/Errors.ts +95 -0
- package/src/lib/shared/Shared.decl.ts +366 -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 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyHttp.Server.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/legacy-http/LegacyHttp.Server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAgC/C,MAAM,WAAW,mBAAmB;IAEhC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAsMD,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,QAAQ,CAAC,aAAa,EAChC,MAAM,EAAE,EAAE,CAAC,OAAO,GACnB,EAAE,CAAC,QAAQ,CAGb"}
|
|
@@ -0,0 +1,167 @@
|
|
|
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.createLegacyHttpGateway = void 0;
|
|
19
|
+
const Shared = require("../../shared");
|
|
20
|
+
const node_events_1 = require("node:events");
|
|
21
|
+
const LegacyHttp_Transporter_1 = require("./LegacyHttp.Transporter");
|
|
22
|
+
const v1 = require("../../shared/Encodings/v1");
|
|
23
|
+
const encoder = new v1.TvEncoderV1();
|
|
24
|
+
const INVALID_REQUEST_RESPONSE = Buffer.from(encoder.encodeApiErrorResponse('null', Shared.Encodings.v1.EResponseCode.MALFORMED_ARGUMENTS, 'INVALID REQUEST', 0));
|
|
25
|
+
function refuseBadRequest(resp) {
|
|
26
|
+
try {
|
|
27
|
+
resp.writeHead(400, {
|
|
28
|
+
'content-length': INVALID_REQUEST_RESPONSE.byteLength,
|
|
29
|
+
});
|
|
30
|
+
const socket = resp.socket;
|
|
31
|
+
resp.end(INVALID_REQUEST_RESPONSE);
|
|
32
|
+
socket.destroy();
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// do nothing.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class LegacyHttpGateway extends node_events_1.EventEmitter {
|
|
39
|
+
constructor(_listener, _server) {
|
|
40
|
+
super();
|
|
41
|
+
this._listener = _listener;
|
|
42
|
+
this._server = _server;
|
|
43
|
+
this._onRequest = (req, resp) => {
|
|
44
|
+
if (req.method !== 'POST' || !req.headers['content-length']) {
|
|
45
|
+
refuseBadRequest(resp);
|
|
46
|
+
this.emit('error', new Shared.errors.invalid_packet({
|
|
47
|
+
reason: 'invalid_request',
|
|
48
|
+
data: {
|
|
49
|
+
'method': req.method,
|
|
50
|
+
'headers': req.headers,
|
|
51
|
+
'url': req.url,
|
|
52
|
+
},
|
|
53
|
+
}));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const length = parseInt(req.headers['content-length']);
|
|
57
|
+
if (!Number.isSafeInteger(length) || length > v1.MAX_PACKET_SIZE) { // Maximum request packet is 64MB
|
|
58
|
+
refuseBadRequest(resp);
|
|
59
|
+
this.emit('error', new Shared.errors.invalid_packet({
|
|
60
|
+
reason: 'invalid_packet_length',
|
|
61
|
+
data: {
|
|
62
|
+
'length': length,
|
|
63
|
+
'max': v1.MAX_PACKET_SIZE,
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const buf = Buffer.allocUnsafe(length);
|
|
69
|
+
let offset = 0;
|
|
70
|
+
const recvAt = Date.now();
|
|
71
|
+
resp.on('error', (e) => this.emit('error', e));
|
|
72
|
+
req.on('error', (e) => this.emit('error', e))
|
|
73
|
+
.on('data', (chunk) => {
|
|
74
|
+
const index = offset;
|
|
75
|
+
offset += chunk.byteLength;
|
|
76
|
+
if (offset > length) {
|
|
77
|
+
refuseBadRequest(resp);
|
|
78
|
+
this.emit('error', new Shared.errors.invalid_packet({
|
|
79
|
+
reason: 'length_exceeded',
|
|
80
|
+
recv: offset,
|
|
81
|
+
expected: length,
|
|
82
|
+
}));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
chunk.copy(buf, index);
|
|
86
|
+
})
|
|
87
|
+
.on('end', () => {
|
|
88
|
+
let input;
|
|
89
|
+
if (offset !== length || buf[0] !== 123 || buf[offset - 1] !== 125) {
|
|
90
|
+
refuseBadRequest(resp);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
input = JSON.parse(buf);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
refuseBadRequest(resp);
|
|
98
|
+
this.emit('error', new Shared.errors.invalid_packet({
|
|
99
|
+
reason: 'invalid_json',
|
|
100
|
+
data: buf,
|
|
101
|
+
}, e));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (typeof input?.api !== 'string') {
|
|
105
|
+
refuseBadRequest(resp);
|
|
106
|
+
this.emit('error', new Shared.errors.invalid_packet({
|
|
107
|
+
reason: 'malformed_json',
|
|
108
|
+
data: input,
|
|
109
|
+
}));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this._server.processLegacyApi((result) => {
|
|
113
|
+
if (!resp.writable) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (result instanceof Shared.TelevokeError) {
|
|
117
|
+
if (result instanceof Shared.errors.app_error) {
|
|
118
|
+
const data = encoder.encodeApiErrorResponse(input.rid, v1.EResponseCode.FAILURE, result.message, recvAt);
|
|
119
|
+
resp.setHeader('content-length', Buffer.byteLength(data));
|
|
120
|
+
resp.end(data);
|
|
121
|
+
}
|
|
122
|
+
else if (result instanceof Shared.errors.api_not_found) {
|
|
123
|
+
const data = encoder.encodeApiErrorResponse(input.rid, v1.EResponseCode.API_NOT_FOUND, 'null', recvAt);
|
|
124
|
+
resp.setHeader('content-length', Buffer.byteLength(data));
|
|
125
|
+
resp.end(data);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const data = encoder.encodeApiErrorResponse(input.rid, v1.EResponseCode.SYSTEM_ERROR, 'null', recvAt);
|
|
129
|
+
resp.setHeader('content-length', Buffer.byteLength(data));
|
|
130
|
+
resp.end(data);
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const data = encoder.encodeApiOkResponse(input.rid, result ?? null, recvAt);
|
|
135
|
+
resp.setHeader('content-length', Buffer.byteLength(data));
|
|
136
|
+
resp.end(data);
|
|
137
|
+
}, input.api, input.args, new LegacyHttp_Transporter_1.LegacyHttpTransporter(req));
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
if (this._server.router.encoding !== 'json') {
|
|
141
|
+
throw new TypeError('Legacy HTTP gateway only supports JSON encoding');
|
|
142
|
+
}
|
|
143
|
+
this._listener
|
|
144
|
+
.on('error', (e) => this.emit('error', e))
|
|
145
|
+
.setLegacyApiProcessor(this._onRequest);
|
|
146
|
+
}
|
|
147
|
+
get running() {
|
|
148
|
+
return this._listener.running;
|
|
149
|
+
}
|
|
150
|
+
async start() {
|
|
151
|
+
if (this.running) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
await this._listener.start();
|
|
155
|
+
}
|
|
156
|
+
async stop() {
|
|
157
|
+
if (!this.running) {
|
|
158
|
+
return Promise.resolve();
|
|
159
|
+
}
|
|
160
|
+
await this._listener.stop();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function createLegacyHttpGateway(listener, server) {
|
|
164
|
+
return new LegacyHttpGateway(listener, server);
|
|
165
|
+
}
|
|
166
|
+
exports.createLegacyHttpGateway = createLegacyHttpGateway;
|
|
167
|
+
//# sourceMappingURL=LegacyHttp.Server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyHttp.Server.js","sourceRoot":"","sources":["../../../src/lib/transporters/legacy-http/LegacyHttp.Server.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAKF,uCAAuC;AACvC,6CAA2C;AAC3C,qEAAiE;AACjE,gDAAgD;AAEhD,MAAM,OAAO,GAAG,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAErC,MAAM,wBAAwB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CACvE,MAAM,EACN,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,aAA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CAAC,CAAC;QACX,CAAC,CAAC;QApKE,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,KAAK,MAAM,EAAE;YAEzC,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAC;SAC1E;QAED,IAAI,CAAC,SAAS;aACT,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;aACzC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAED,IAAW,OAAO;QAEd,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;IAClC,CAAC;IAyJM,KAAK,CAAC,KAAK;QAEd,IAAI,IAAI,CAAC,OAAO,EAAE;YAEd,OAAO;SACV;QAED,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,IAAI;QAEb,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YAEf,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC5B;QAED,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CACJ;AAED,SAAgB,uBAAuB,CACnC,QAAgC,EAChC,MAAkB;IAGlB,OAAO,IAAI,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAND,0DAMC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 * as Http from 'node:http';
|
|
18
|
+
import type * as Shared from '../../shared';
|
|
19
|
+
export declare class LegacyHttpTransporter implements Shared.ITransporter {
|
|
20
|
+
private readonly _req;
|
|
21
|
+
readonly protocol = "http";
|
|
22
|
+
constructor(_req: Http.IncomingMessage);
|
|
23
|
+
readonly writable = false;
|
|
24
|
+
getPropertyNames(): string[];
|
|
25
|
+
getAllProperties(): Record<string, unknown>;
|
|
26
|
+
getProperty(name: string): unknown;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=LegacyHttp.Transporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyHttp.Transporter.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/legacy-http/LegacyHttp.Transporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;AAEF,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAI5C,qBAAa,qBAAsB,YAAW,MAAM,CAAC,YAAY;IAKzD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHzB,SAAgB,QAAQ,UAAU;gBAGb,IAAI,EAAE,IAAI,CAAC,eAAe;IAK/C,SAAgB,QAAQ,SAAS;IAE1B,gBAAgB,IAAI,MAAM,EAAE;IAK5B,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAY3C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAe5C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.LegacyHttpTransporter = void 0;
|
|
19
|
+
const PROPERTY_NAMES = ['remoteAddress', 'remotePort', 'localAddress', 'localPort', 'url', 'headers'];
|
|
20
|
+
class LegacyHttpTransporter {
|
|
21
|
+
constructor(_req) {
|
|
22
|
+
this._req = _req;
|
|
23
|
+
this.protocol = 'http';
|
|
24
|
+
this.writable = false;
|
|
25
|
+
}
|
|
26
|
+
getPropertyNames() {
|
|
27
|
+
return PROPERTY_NAMES;
|
|
28
|
+
}
|
|
29
|
+
getAllProperties() {
|
|
30
|
+
return {
|
|
31
|
+
'remoteAddress': this._req.socket.remoteAddress,
|
|
32
|
+
'remotePort': this._req.socket.remotePort,
|
|
33
|
+
'localAddress': this._req.socket.localAddress,
|
|
34
|
+
'localPort': this._req.socket.localPort,
|
|
35
|
+
'url': this._req.url,
|
|
36
|
+
'headers': this._req.headers,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
getProperty(name) {
|
|
40
|
+
switch (name) {
|
|
41
|
+
case 'localPort':
|
|
42
|
+
case 'localAddress':
|
|
43
|
+
case 'remotePort':
|
|
44
|
+
case 'remoteAddress':
|
|
45
|
+
return this._req.socket[name];
|
|
46
|
+
case 'url':
|
|
47
|
+
case 'headers':
|
|
48
|
+
return this._req[name];
|
|
49
|
+
default:
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.LegacyHttpTransporter = LegacyHttpTransporter;
|
|
55
|
+
//# sourceMappingURL=LegacyHttp.Transporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyHttp.Transporter.js","sourceRoot":"","sources":["../../../src/lib/transporters/legacy-http/LegacyHttp.Transporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAKF,MAAM,cAAc,GAAG,CAAC,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAEtG,MAAa,qBAAqB;IAI9B,YACqB,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;QAH/B,aAAQ,GAAG,MAAM,CAAC;QAQlB,aAAQ,GAAG,KAAK,CAAC;IAFjC,CAAC;IAIM,gBAAgB;QAEnB,OAAO,cAAc,CAAC;IAC1B,CAAC;IAEM,gBAAgB;QAEnB,OAAO;YACH,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;YAC/C,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU;YACzC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY;YAC7C,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS;YACvC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG;YACpB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO;SAC/B,CAAC;IACN,CAAC;IAEM,WAAW,CAAC,IAAY;QAE3B,QAAQ,IAAI,EAAE;YACV,KAAK,WAAW,CAAC;YACjB,KAAK,cAAc,CAAC;YACpB,KAAK,YAAY,CAAC;YAClB,KAAK,eAAe;gBAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClC,KAAK,KAAK,CAAC;YACX,KAAK,SAAS;gBACV,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3B;gBACI,OAAO,SAAS,CAAC;SACxB;IACL,CAAC;CACJ;AA5CD,sDA4CC"}
|
|
@@ -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 './LegacyHttp.Server';
|
|
17
|
+
export * from './LegacyHttp.Transporter';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/legacy-http/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,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("./LegacyHttp.Server"), exports);
|
|
33
|
+
__exportStar(require("./LegacyHttp.Transporter"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/transporters/legacy-http/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;;;;;;;;;;;;;;AAEF,sDAAoC;AACpC,2DAAyC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import * as LwDFX from '@litert/lwdfx';
|
|
17
|
+
import type * as dT from '../Transporter.decl';
|
|
18
|
+
export declare function createTcpConnector(opts: LwDFX.Tcp.ITcpClientOptions): dT.IConnector;
|
|
19
|
+
//# sourceMappingURL=LwDFX.Tcp.Client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tcp.Client.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tcp.Client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAa/C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,EAAE,CAAC,UAAU,CAGnF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.createTcpConnector = void 0;
|
|
19
|
+
const LwDFX = require("@litert/lwdfx");
|
|
20
|
+
const LwDFX_Transporter_1 = require("./LwDFX.Transporter");
|
|
21
|
+
class LwDfxTcpConnector {
|
|
22
|
+
constructor(_opts) {
|
|
23
|
+
this._opts = _opts;
|
|
24
|
+
}
|
|
25
|
+
async connect() {
|
|
26
|
+
return new LwDFX_Transporter_1.LwDFXTransporter('lwdfx/tcp', await LwDFX.Tcp.connect(this._opts));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function createTcpConnector(opts) {
|
|
30
|
+
return new LwDfxTcpConnector(opts);
|
|
31
|
+
}
|
|
32
|
+
exports.createTcpConnector = createTcpConnector;
|
|
33
|
+
//# sourceMappingURL=LwDFX.Tcp.Client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tcp.Client.js","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tcp.Client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,uCAAuC;AAEvC,2DAAuD;AAEvD,MAAM,iBAAiB;IAEnB,YAAoC,KAAkC;QAAlC,UAAK,GAAL,KAAK,CAA6B;IAAG,CAAC;IAEnE,KAAK,CAAC,OAAO;QAEhB,OAAO,IAAI,oCAAgB,CAAC,WAAW,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAClF,CAAC;CACJ;AAED,SAAgB,kBAAkB,CAAC,IAAiC;IAEhE,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAHD,gDAGC"}
|
|
@@ -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
|
+
import * as LwDFX from '@litert/lwdfx';
|
|
17
|
+
import type * as dT from '../Transporter.decl';
|
|
18
|
+
import type * as dL from './LwDFX.decl';
|
|
19
|
+
export type ILwDfxTcpGatewayOptions = LwDFX.Tcp.ITcpGatewayOptions;
|
|
20
|
+
export declare function createTcpGateway(server: dT.IServer, gatewayOpts?: ILwDfxTcpGatewayOptions, serverOpts?: dL.ILwDfxServerOptions): dT.IGateway;
|
|
21
|
+
//# sourceMappingURL=LwDFX.Tcp.Server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tcp.Server.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tcp.Server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG/C,OAAO,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC;AAgEnE,wBAAgB,gBAAgB,CAC5B,MAAM,EAAE,EAAE,CAAC,OAAO,EAClB,WAAW,GAAE,uBAA4B,EACzC,UAAU,GAAE,EAAE,CAAC,mBAAwB,GACxC,EAAE,CAAC,QAAQ,CAGb"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.createTcpGateway = void 0;
|
|
19
|
+
const LwDFX = require("@litert/lwdfx");
|
|
20
|
+
const node_events_1 = require("node:events");
|
|
21
|
+
const LwDFX_Transporter_1 = require("./LwDFX.Transporter");
|
|
22
|
+
class LwDfxTcpGateway extends node_events_1.EventEmitter {
|
|
23
|
+
constructor(serverOpts, _gatewayOpts, _server) {
|
|
24
|
+
super();
|
|
25
|
+
this._gatewayOpts = _gatewayOpts;
|
|
26
|
+
this._server = _server;
|
|
27
|
+
this._gateway = null;
|
|
28
|
+
this._lwdfxServer = LwDFX.createServer({
|
|
29
|
+
...serverOpts,
|
|
30
|
+
alpWhitelist: ['televoke2']
|
|
31
|
+
});
|
|
32
|
+
this._lwdfxServer.on('connection', (conn) => {
|
|
33
|
+
this._server.registerChannel(new LwDFX_Transporter_1.LwDFXTransporter('lwdfx/tcp', conn));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
get running() {
|
|
37
|
+
return !!this._gateway;
|
|
38
|
+
}
|
|
39
|
+
async start() {
|
|
40
|
+
if (this._gateway) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this._gateway = LwDFX.Tcp.createGateway(this._lwdfxServer, this._gatewayOpts);
|
|
44
|
+
try {
|
|
45
|
+
await this._gateway.start();
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
this._gateway = null;
|
|
49
|
+
throw e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async stop() {
|
|
53
|
+
if (!this._gateway) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
await this._gateway.stop();
|
|
57
|
+
this._gateway = null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function createTcpGateway(server, gatewayOpts = {}, serverOpts = {}) {
|
|
61
|
+
return new LwDfxTcpGateway(serverOpts, gatewayOpts, server);
|
|
62
|
+
}
|
|
63
|
+
exports.createTcpGateway = createTcpGateway;
|
|
64
|
+
//# sourceMappingURL=LwDFX.Tcp.Server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tcp.Server.js","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tcp.Server.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,uCAAuC;AAEvC,6CAA2C;AAC3C,2DAAuD;AAKvD,MAAM,eAAgB,SAAQ,0BAAY;IAMtC,YACI,UAAkC,EACjB,YAAqC,EACrC,OAAmB;QAGpC,KAAK,EAAE,CAAC;QAJS,iBAAY,GAAZ,YAAY,CAAyB;QACrC,YAAO,GAAP,OAAO,CAAY;QAPhC,aAAQ,GAAiC,IAAI,CAAC;QAYlD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YA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
|
|
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
|
+
import * as LwDFX from '@litert/lwdfx';
|
|
17
|
+
import type * as dT from '../Transporter.decl';
|
|
18
|
+
export declare function createTlsConnector(opts: LwDFX.Tls.ITlsClientOptions): dT.IConnector;
|
|
19
|
+
//# sourceMappingURL=LwDFX.Tls.Client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tls.Client.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tls.Client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAa/C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,EAAE,CAAC,UAAU,CAGnF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.createTlsConnector = void 0;
|
|
19
|
+
const LwDFX = require("@litert/lwdfx");
|
|
20
|
+
const LwDFX_Transporter_1 = require("./LwDFX.Transporter");
|
|
21
|
+
class LwDfxTlsConnector {
|
|
22
|
+
constructor(_opts) {
|
|
23
|
+
this._opts = _opts;
|
|
24
|
+
}
|
|
25
|
+
async connect() {
|
|
26
|
+
return new LwDFX_Transporter_1.LwDFXTransporter('lwdfx/tls', await LwDFX.Tls.connect(this._opts));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function createTlsConnector(opts) {
|
|
30
|
+
return new LwDfxTlsConnector(opts);
|
|
31
|
+
}
|
|
32
|
+
exports.createTlsConnector = createTlsConnector;
|
|
33
|
+
//# sourceMappingURL=LwDFX.Tls.Client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tls.Client.js","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tls.Client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,uCAAuC;AAEvC,2DAAuD;AAEvD,MAAM,iBAAiB;IAEnB,YAAoC,KAAkC;QAAlC,UAAK,GAAL,KAAK,CAA6B;IAAG,CAAC;IAEnE,KAAK,CAAC,OAAO;QAEhB,OAAO,IAAI,oCAAgB,CAAC,WAAW,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAClF,CAAC;CACJ;AAED,SAAgB,kBAAkB,CAAC,IAAiC;IAEhE,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAHD,gDAGC"}
|
|
@@ -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
|
+
import * as LwDFX from '@litert/lwdfx';
|
|
17
|
+
import type * as dT from '../Transporter.decl';
|
|
18
|
+
import type * as dL from './LwDFX.decl';
|
|
19
|
+
export type ILwDfxTlsGatewayOptions = LwDFX.Tls.ITlsGatewayOptions;
|
|
20
|
+
export declare function createTlsGateway(server: dT.IServer, gatewayOpts: ILwDfxTlsGatewayOptions, serverOpts?: dL.ILwDfxServerOptions): dT.IGateway;
|
|
21
|
+
//# sourceMappingURL=LwDFX.Tls.Server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LwDFX.Tls.Server.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/lwdfx/LwDFX.Tls.Server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAIxC,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC;AAgEnE,wBAAgB,gBAAgB,CAC5B,MAAM,EAAE,EAAE,CAAC,OAAO,EAClB,WAAW,EAAE,uBAAuB,EACpC,UAAU,GAAE,EAAE,CAAC,mBAAwB,GACxC,EAAE,CAAC,QAAQ,CAGb"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.createTlsGateway = void 0;
|
|
19
|
+
const LwDFX = require("@litert/lwdfx");
|
|
20
|
+
const node_events_1 = require("node:events");
|
|
21
|
+
const LwDFX_Transporter_1 = require("./LwDFX.Transporter");
|
|
22
|
+
class LwDfxTlsGateway extends node_events_1.EventEmitter {
|
|
23
|
+
constructor(serverOpts, _gatewayOpts, _server) {
|
|
24
|
+
super();
|
|
25
|
+
this._gatewayOpts = _gatewayOpts;
|
|
26
|
+
this._server = _server;
|
|
27
|
+
this._gateway = null;
|
|
28
|
+
this._lwdfxServer = LwDFX.createServer({
|
|
29
|
+
...serverOpts,
|
|
30
|
+
alpWhitelist: ['televoke2']
|
|
31
|
+
});
|
|
32
|
+
this._lwdfxServer.on('connection', (conn) => {
|
|
33
|
+
this._server.registerChannel(new LwDFX_Transporter_1.LwDFXTransporter('lwdfx/tls', conn));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
get running() {
|
|
37
|
+
return !!this._gateway;
|
|
38
|
+
}
|
|
39
|
+
async start() {
|
|
40
|
+
if (this._gateway) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this._gateway = LwDFX.Tls.createGateway(this._lwdfxServer, this._gatewayOpts);
|
|
44
|
+
try {
|
|
45
|
+
await this._gateway.start();
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
this._gateway = null;
|
|
49
|
+
throw e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async stop() {
|
|
53
|
+
if (!this._gateway) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
await this._gateway.stop();
|
|
57
|
+
this._gateway = null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function createTlsGateway(server, gatewayOpts, serverOpts = {}) {
|
|
61
|
+
return new LwDfxTlsGateway(serverOpts, gatewayOpts, server);
|
|
62
|
+
}
|
|
63
|
+
exports.createTlsGateway = createTlsGateway;
|
|
64
|
+
//# sourceMappingURL=LwDFX.Tls.Server.js.map
|