@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
package/CHANGES.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Changes Logs
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## v1.0.0
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- build(project): full refactored.
|
|
6
|
+
- feat(protocol): added televoke/2 protocol supports.
|
|
7
|
+
- build(protocol): removed supports for TCP-based televoke/1 protocol.
|
|
6
8
|
|
|
7
9
|
## v0.4.6
|
|
8
10
|
|
package/README.md
CHANGED
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
A simple RPC service framework.
|
|
9
9
|
|
|
10
|
-
> NOTICES: There are no built-in TLS supports for the server-side, and if it's needed, please use a
|
|
11
|
-
> TLS gateway like NGINX, and put it in front of your Televoke server.
|
|
12
|
-
|
|
13
10
|
## Installation
|
|
14
11
|
|
|
15
12
|
```sh
|
|
@@ -18,14 +15,22 @@ npm install @litert/televoke --save
|
|
|
18
15
|
|
|
19
16
|
## Requirements
|
|
20
17
|
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
18
|
+
- Node.js v18.x (Or newer)
|
|
19
|
+
- TypeScript v5.0.x (Or newer)
|
|
23
20
|
|
|
24
21
|
## Implemented Protocol
|
|
25
22
|
|
|
26
|
-
- http/1.1
|
|
27
|
-
- https/1.1
|
|
28
|
-
-
|
|
23
|
+
- `http/1.1` (televoke/1)
|
|
24
|
+
- `https/1.1` (televoke/1)
|
|
25
|
+
- `ws/wss` (televoke/2)
|
|
26
|
+
|
|
27
|
+
> [`@litert/websocket`](https://github.com/litert/websocket.js) package is required.
|
|
28
|
+
|
|
29
|
+
- `lwdfx/1` (televoke/2)
|
|
30
|
+
|
|
31
|
+
> [`@litert/lwdfx`](https://github.com/litert/lwdfx.js) package is required.
|
|
32
|
+
|
|
33
|
+
Check documents about `televoke/2` protocol [here](./docs/Televoke_v2.md).
|
|
29
34
|
|
|
30
35
|
## Documents
|
|
31
36
|
|
|
@@ -0,0 +1,47 @@
|
|
|
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 Shared from '../shared';
|
|
18
|
+
export interface IChannelEvents extends Shared.IDefaultEvents {
|
|
19
|
+
close(): void;
|
|
20
|
+
['push_message'](msg: Buffer[]): void;
|
|
21
|
+
}
|
|
22
|
+
export interface IClient<TApis extends Shared.IObject> extends Shared.IEventListener<IChannelEvents>, Pick<Shared.IChannelBase<IChannelEvents>, 'close' | 'sendBinaryChunk' | 'finished' | 'ended' | 'ping' | 'writable' | 'streams'> {
|
|
23
|
+
/**
|
|
24
|
+
* The timeout for waiting replies of each command sent to the remote endpoint, in milliseconds.
|
|
25
|
+
*
|
|
26
|
+
* @default 60000
|
|
27
|
+
*/
|
|
28
|
+
timeout: number;
|
|
29
|
+
/**
|
|
30
|
+
* The transporter object is used to send and receive data to and from the remote endpoint.
|
|
31
|
+
*
|
|
32
|
+
* > Should be `null` when disconnected.
|
|
33
|
+
*/
|
|
34
|
+
readonly transporter: Shared.ITransporter | null;
|
|
35
|
+
/**
|
|
36
|
+
* Connect to the remote endpoint.
|
|
37
|
+
*/
|
|
38
|
+
connect(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Invoke an API.
|
|
41
|
+
*
|
|
42
|
+
* @param name The API name.
|
|
43
|
+
* @param args The arguments.
|
|
44
|
+
*/
|
|
45
|
+
invoke<TName extends keyof TApis>(name: Shared.IfIsFn<TApis[TName], TName>, ...args: TApis[TName] extends Shared.IFn<infer TArgs, any> ? TArgs : never): Promise<TApis[TName] extends Shared.IFn<any[], infer TRet> ? TRet : never>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=Client.decl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Client.decl.d.ts","sourceRoot":"","sources":["../../src/lib/client/Client.decl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;AAEF,OAAO,KAAK,KAAK,MAAM,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,cAAc;IAEzD,KAAK,IAAI,IAAI,CAAC;IAEd,CAAC,cAAc,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,OAAO,CAAC,KAAK,SAAS,MAAM,CAAC,OAAO,CACjD,SAAQ,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAC/C,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,EACnC,OAAO,GAAG,iBAAiB,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CACvF;IAED;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,SAAS,MAAM,KAAK,EAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,EACxC,GAAG,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,MAAM,KAAK,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,GAC3E,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;CACjF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
//# sourceMappingURL=Client.decl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Client.decl.js","sourceRoot":"","sources":["../../src/lib/client/Client.decl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE"}
|
|
@@ -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
|
+
import * as Shared from '../shared';
|
|
17
|
+
import type * as dC from './Client.decl';
|
|
18
|
+
import type * as dT from '../transporters';
|
|
19
|
+
/**
|
|
20
|
+
* Create a JSON-RPC client instance, over televoke2 protocol.
|
|
21
|
+
*
|
|
22
|
+
* @param connector The connector instance.
|
|
23
|
+
* @param streamManagerFactory The stream manager factory function. [default: createSharedStreamManagerFactory()]
|
|
24
|
+
* @param timeout The default timeout value of commands, in milliseconds. [default: 60000]
|
|
25
|
+
* @returns The client instance.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createJsonApiClient<TApis extends Shared.IObject>(connector: dT.IConnector, streamManagerFactory?: Shared.IStreamManagerFactory, timeout?: number): dC.IClient<TApis>;
|
|
28
|
+
//# sourceMappingURL=JsonApiClient.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonApiClient.impl.d.ts","sourceRoot":"","sources":["../../src/lib/client/JsonApiClient.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAgO3C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,CAAC,OAAO,EAC5D,SAAS,EAAE,EAAE,CAAC,UAAU,EACxB,oBAAoB,GAAE,MAAM,CAAC,qBAAiE,EAC9F,OAAO,GAAE,MAAe,GACzB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAGnB"}
|
|
@@ -0,0 +1,169 @@
|
|
|
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.createJsonApiClient = void 0;
|
|
19
|
+
const Shared = require("../shared");
|
|
20
|
+
const node_events_1 = require("node:events");
|
|
21
|
+
const Channel_impl_1 = require("../shared/Channel.impl");
|
|
22
|
+
const v2 = require("../shared/Encodings/v2");
|
|
23
|
+
const Utils_1 = require("../shared/Utils");
|
|
24
|
+
let channelIdCounter = Date.now();
|
|
25
|
+
class TvJsonApiClient extends node_events_1.EventEmitter {
|
|
26
|
+
constructor(_connector, timeout, _streamManagerFactory) {
|
|
27
|
+
super();
|
|
28
|
+
this._connector = _connector;
|
|
29
|
+
this.timeout = timeout;
|
|
30
|
+
this._streamManagerFactory = _streamManagerFactory;
|
|
31
|
+
this._channel = null;
|
|
32
|
+
this._connecting = null;
|
|
33
|
+
this._onChannelClose = () => {
|
|
34
|
+
this._channel?.off('close', this._onChannelClose)
|
|
35
|
+
.off('push_message', this._onMessage);
|
|
36
|
+
this._channel = null;
|
|
37
|
+
};
|
|
38
|
+
this._onMessage = (msg) => {
|
|
39
|
+
this.emit('push_message', msg);
|
|
40
|
+
};
|
|
41
|
+
this._onError = (e) => {
|
|
42
|
+
this.emit('error', e);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
get streams() {
|
|
46
|
+
const ret = this._channel?.streams;
|
|
47
|
+
if (!ret) {
|
|
48
|
+
throw new Shared.errors.channel_inactive();
|
|
49
|
+
}
|
|
50
|
+
return ret;
|
|
51
|
+
}
|
|
52
|
+
get transporter() {
|
|
53
|
+
return this._channel?.transporter ?? null;
|
|
54
|
+
}
|
|
55
|
+
get ended() {
|
|
56
|
+
return false !== this._channel?.ended;
|
|
57
|
+
}
|
|
58
|
+
get finished() {
|
|
59
|
+
return false !== this._channel?.finished;
|
|
60
|
+
}
|
|
61
|
+
get writable() {
|
|
62
|
+
return false !== this._channel?.writable;
|
|
63
|
+
}
|
|
64
|
+
async _getChannel() {
|
|
65
|
+
if (this._channel?.transporter?.writable) {
|
|
66
|
+
// debugLog('televoke', 'Reusing existing channel.');
|
|
67
|
+
return this._channel;
|
|
68
|
+
}
|
|
69
|
+
if (this._connecting) {
|
|
70
|
+
// debugLog('televoke', 'Waiting for previous connection to be established.');
|
|
71
|
+
return this._connecting;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
// debugLog('televoke', 'Attempting to connect...');
|
|
75
|
+
return this._channel = await (this._connecting = this._connect());
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
// debugLog('televoke', 'Attempts to connect failed.');
|
|
79
|
+
this._channel = null;
|
|
80
|
+
this._connecting = null;
|
|
81
|
+
throw e;
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
// debugLog('televoke', 'Attempts to connect finished.');
|
|
85
|
+
this._connecting = null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async _connect() {
|
|
89
|
+
this._channel = new TvClientChannel(await this._connector.connect(), this._streamManagerFactory, this.timeout)
|
|
90
|
+
.on('close', this._onChannelClose)
|
|
91
|
+
.on('error', this._onError)
|
|
92
|
+
.on('push_message', this._onMessage);
|
|
93
|
+
return this._channel;
|
|
94
|
+
}
|
|
95
|
+
async invoke(name, ...args) {
|
|
96
|
+
try {
|
|
97
|
+
const resp = await (await this._getChannel()).apiCall(name, JSON.stringify(args));
|
|
98
|
+
return (0, Utils_1.buffer2json)(resp);
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
if (e instanceof Shared.errors.app_error) {
|
|
102
|
+
let info;
|
|
103
|
+
try {
|
|
104
|
+
info = JSON.parse(e.message);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
throw e;
|
|
108
|
+
}
|
|
109
|
+
throw new Shared.TvErrorResponse(info);
|
|
110
|
+
}
|
|
111
|
+
throw e;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
close() {
|
|
115
|
+
this._channel?.close();
|
|
116
|
+
// this._onChannelClose();
|
|
117
|
+
}
|
|
118
|
+
async ping(msg) {
|
|
119
|
+
return (await this._getChannel()).ping(msg);
|
|
120
|
+
}
|
|
121
|
+
async connect() {
|
|
122
|
+
await this._getChannel();
|
|
123
|
+
}
|
|
124
|
+
async sendBinaryChunk(streamId, chunk) {
|
|
125
|
+
return (await this._getChannel()).sendBinaryChunk(streamId, chunk);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
class TvClientChannel extends Channel_impl_1.AbstractTvChannelV2 {
|
|
129
|
+
constructor(transporter, streamManagerFactory, timeout = 60000) {
|
|
130
|
+
super(channelIdCounter++, transporter, timeout, streamManagerFactory);
|
|
131
|
+
}
|
|
132
|
+
apiCall(name, argsBody) {
|
|
133
|
+
if (!this.writable) {
|
|
134
|
+
return Promise.reject(new Shared.errors.channel_inactive());
|
|
135
|
+
}
|
|
136
|
+
const seq = this._seqCounter++;
|
|
137
|
+
this.transporter.write(Channel_impl_1.encoder.encode({
|
|
138
|
+
'typ': v2.EPacketType.REQUEST,
|
|
139
|
+
'cmd': v2.ECommand.API_CALL,
|
|
140
|
+
'seq': seq,
|
|
141
|
+
'ct': {
|
|
142
|
+
'name': name,
|
|
143
|
+
'body': typeof argsBody === 'string' ? Buffer.from(argsBody) : argsBody
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
return new Promise((resolve, reject) => {
|
|
147
|
+
this._setTimeout(v2.ECommand.API_CALL, seq, (resp) => {
|
|
148
|
+
if (resp.ct instanceof Shared.TelevokeError) {
|
|
149
|
+
reject(resp.ct);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
resolve(resp.ct);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Create a JSON-RPC client instance, over televoke2 protocol.
|
|
159
|
+
*
|
|
160
|
+
* @param connector The connector instance.
|
|
161
|
+
* @param streamManagerFactory The stream manager factory function. [default: createSharedStreamManagerFactory()]
|
|
162
|
+
* @param timeout The default timeout value of commands, in milliseconds. [default: 60000]
|
|
163
|
+
* @returns The client instance.
|
|
164
|
+
*/
|
|
165
|
+
function createJsonApiClient(connector, streamManagerFactory = Shared.createSharedStreamManagerFactory(), timeout = 60000) {
|
|
166
|
+
return new TvJsonApiClient(connector, timeout, streamManagerFactory);
|
|
167
|
+
}
|
|
168
|
+
exports.createJsonApiClient = createJsonApiClient;
|
|
169
|
+
//# sourceMappingURL=JsonApiClient.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonApiClient.impl.js","sourceRoot":"","sources":["../../src/lib/client/JsonApiClient.impl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,oCAAoC;AAGpC,6CAA2C;AAC3C,yDAAsE;AACtE,6CAA6C;AAC7C,2CAA8D;AAE9D,IAAI,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAElC,MAAM,eAA8C,SAAQ,0BAAY;IAMpE,YACqB,UAAyB,EACnC,OAAe,EACL,qBAAmD;QAGpE,KAAK,EAAE,CAAC;QALS,eAAU,GAAV,UAAU,CAAe;QACnC,YAAO,GAAP,OAAO,CAAQ;QACL,0BAAqB,GAArB,qBAAqB,CAA8B;QAPhE,aAAQ,GAA2B,IAAI,CAAC;QAExC,gBAAW,GAAoC,IAAI,CAAC;QAuB3C,oBAAe,GAAG,GAAS,EAAE;YAE1C,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC;iBAC5C,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAE1C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC;QAEe,eAAU,GAAG,CAAC,GAAa,EAAQ,EAAE;YAElD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC;QAEe,aAAQ,GAAG,CAAC,CAAU,EAAQ,EAAE;YAE7C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC;IA9BF,CAAC;IAED,IAAW,O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CAAC,EAAE,YAAY,MAAM,CAAC,aAAa,EAAE;oBAEzC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBAChB,OAAO;iBACV;gBAED,OAAO,CAAC,IAAI,CAAC,EAAc,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAC/B,SAAwB,EACxB,uBAAqD,MAAM,CAAC,gCAAgC,EAAE,EAC9F,UAAkB,KAAM;IAGxB,OAAO,IAAI,eAAe,CAAQ,SAAS,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC;AAChF,CAAC;AAPD,kDAOC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 $Https from 'https';
|
|
18
|
+
import * as C from './Client.decl';
|
|
19
|
+
import * as Shared from '../shared';
|
|
20
|
+
export interface IHttpClientNetworkOptions extends $Https.RequestOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Whether to use HTTPS.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
https?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The hostname of HTTP server.
|
|
29
|
+
*
|
|
30
|
+
* @default 'localhost'
|
|
31
|
+
*/
|
|
32
|
+
hostname: string;
|
|
33
|
+
/**
|
|
34
|
+
* The port of HTTP server.
|
|
35
|
+
*
|
|
36
|
+
* @default 80 or 443
|
|
37
|
+
*/
|
|
38
|
+
port?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The path to the RPC entry.
|
|
41
|
+
*
|
|
42
|
+
* @default '/'
|
|
43
|
+
*/
|
|
44
|
+
path?: string;
|
|
45
|
+
apiNameWrapper?: (name: string) => string;
|
|
46
|
+
}
|
|
47
|
+
export interface IHttpClientUnixSocketOptions extends $Https.RequestOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Whether to use HTTPS.
|
|
50
|
+
*
|
|
51
|
+
* > Always `false` for Unix domain socket.
|
|
52
|
+
*/
|
|
53
|
+
https?: false;
|
|
54
|
+
/**
|
|
55
|
+
* The path of Unix domain socket to connect to.
|
|
56
|
+
*/
|
|
57
|
+
socketPath: string;
|
|
58
|
+
apiNameWrapper?: (name: string) => string;
|
|
59
|
+
}
|
|
60
|
+
export type IHttpClientOptions = IHttpClientNetworkOptions | IHttpClientUnixSocketOptions;
|
|
61
|
+
export declare function createLegacyHttpClient<TAPIs extends Shared.IObject>(opts: IHttpClientOptions): C.IClient<TAPIs>;
|
|
62
|
+
//# sourceMappingURL=LegacyHttpClient.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyHttpClient.impl.d.ts","sourceRoot":"","sources":["../../src/lib/client/LegacyHttpClient.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;AAGF,OAAO,KAAK,MAAM,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,CAAC,MAAM,eAAe,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AA8LpC,MAAM,WAAW,yBAA0B,SAAQ,MAAM,CAAC,cAAc;IAEpE;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED,MAAM,WAAW,4BAA6B,SAAQ,MAAM,CAAC,cAAc;IAEvE;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,GAAG,4BAA4B,CAAC;AAE1F,wBAAgB,sBAAsB,CAAC,KAAK,SAAS,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAgB/G"}
|
|
@@ -0,0 +1,163 @@
|
|
|
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.createLegacyHttpClient = void 0;
|
|
19
|
+
const $Http = require("http");
|
|
20
|
+
const $Https = require("https");
|
|
21
|
+
const Shared = require("../shared");
|
|
22
|
+
const v1 = require("../shared/Encodings/v1");
|
|
23
|
+
const node_events_1 = require("node:events");
|
|
24
|
+
const HTTP_HEADER_CONTENT_LENGTH = 'content-length';
|
|
25
|
+
const HTTP_HEADER_TV_VER = 'x-tv-ver';
|
|
26
|
+
const DEFAULT_TIMEOUT = 30000;
|
|
27
|
+
const disabledStreamManager = Shared.createDisabledStreamManagerFactory()(null);
|
|
28
|
+
class TvLegacyHttpClient extends node_events_1.EventEmitter {
|
|
29
|
+
constructor(_request, _opts, _agent, _apiNameWrapper) {
|
|
30
|
+
super();
|
|
31
|
+
this._request = _request;
|
|
32
|
+
this._opts = _opts;
|
|
33
|
+
this._agent = _agent;
|
|
34
|
+
this._apiNameWrapper = _apiNameWrapper;
|
|
35
|
+
this.writable = true;
|
|
36
|
+
this.ended = false;
|
|
37
|
+
this.finished = false;
|
|
38
|
+
this.transporter = null;
|
|
39
|
+
}
|
|
40
|
+
get timeout() {
|
|
41
|
+
return this._opts.timeout ?? DEFAULT_TIMEOUT;
|
|
42
|
+
}
|
|
43
|
+
get streams() {
|
|
44
|
+
return disabledStreamManager;
|
|
45
|
+
}
|
|
46
|
+
sendBinaryChunk() {
|
|
47
|
+
return Promise.reject(new Shared.errors.cmd_not_impl());
|
|
48
|
+
}
|
|
49
|
+
sendMessage() {
|
|
50
|
+
return Promise.reject(new Shared.errors.cmd_not_impl());
|
|
51
|
+
}
|
|
52
|
+
ping() {
|
|
53
|
+
return Promise.reject(new Shared.errors.cmd_not_impl());
|
|
54
|
+
}
|
|
55
|
+
invoke(api, ...args) {
|
|
56
|
+
const CST = Date.now();
|
|
57
|
+
const content = JSON.stringify({
|
|
58
|
+
ttl: this._opts.timeout ?? DEFAULT_TIMEOUT,
|
|
59
|
+
rid: 0,
|
|
60
|
+
cst: CST,
|
|
61
|
+
args,
|
|
62
|
+
api: this._apiNameWrapper ? this._apiNameWrapper(api) : api
|
|
63
|
+
});
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
const length = Buffer.byteLength(content);
|
|
66
|
+
if (length > v1.MAX_PACKET_SIZE) {
|
|
67
|
+
reject(new Shared.errors.invalid_packet({ reason: 'packet_too_large' }));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const req = this._request({
|
|
71
|
+
...this._opts,
|
|
72
|
+
agent: this._agent,
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: {
|
|
75
|
+
...this._opts.headers,
|
|
76
|
+
[HTTP_HEADER_CONTENT_LENGTH]: Buffer.byteLength(content),
|
|
77
|
+
[HTTP_HEADER_TV_VER]: 1
|
|
78
|
+
},
|
|
79
|
+
}, (resp) => {
|
|
80
|
+
if (!resp.headers[HTTP_HEADER_CONTENT_LENGTH]) {
|
|
81
|
+
reject(new Shared.errors.invalid_response());
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const length = parseInt(resp.headers[HTTP_HEADER_CONTENT_LENGTH]);
|
|
85
|
+
if (!Number.isSafeInteger(length) || length > v1.MAX_PACKET_SIZE) { // Maximum request packet is 64MB
|
|
86
|
+
reject(new Shared.errors.invalid_packet({ reason: 'packet_too_large' }));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const buf = Buffer.allocUnsafe(length);
|
|
90
|
+
let offset = 0;
|
|
91
|
+
resp.on('data', (chunk) => {
|
|
92
|
+
const index = offset;
|
|
93
|
+
offset += chunk.byteLength;
|
|
94
|
+
if (offset > length) {
|
|
95
|
+
resp.removeAllListeners('end');
|
|
96
|
+
resp.removeAllListeners('data');
|
|
97
|
+
resp.destroy();
|
|
98
|
+
reject(new Shared.errors.invalid_packet({ reason: 'packet_length_mismatched' }));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
chunk.copy(buf, index);
|
|
102
|
+
}).on('end', () => {
|
|
103
|
+
let data;
|
|
104
|
+
try {
|
|
105
|
+
data = JSON.parse(buf);
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
reject(new Shared.errors.invalid_response({
|
|
109
|
+
reason: 'invalid_json',
|
|
110
|
+
raw: buf
|
|
111
|
+
}, e));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
switch (data.code) {
|
|
115
|
+
case v1.EResponseCode.OK:
|
|
116
|
+
resolve(data.body);
|
|
117
|
+
break;
|
|
118
|
+
case v1.EResponseCode.FAILURE:
|
|
119
|
+
reject(new Shared.TvErrorResponse(data.body));
|
|
120
|
+
break;
|
|
121
|
+
case v1.EResponseCode.API_NOT_FOUND:
|
|
122
|
+
reject(new Shared.errors.api_not_found({ api }));
|
|
123
|
+
break;
|
|
124
|
+
case v1.EResponseCode.MALFORMED_ARGUMENTS:
|
|
125
|
+
case v1.EResponseCode.SYSTEM_ERROR:
|
|
126
|
+
default:
|
|
127
|
+
reject(new Shared.errors.unknown({
|
|
128
|
+
api, ...data
|
|
129
|
+
}));
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
req.once('timeout', () => {
|
|
135
|
+
reject(new Shared.errors.timeout({
|
|
136
|
+
metadata: { api, time: Date.now(), details: null }
|
|
137
|
+
}));
|
|
138
|
+
});
|
|
139
|
+
req.once('error', reject);
|
|
140
|
+
req.end(content);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
connect() {
|
|
144
|
+
return Promise.resolve();
|
|
145
|
+
}
|
|
146
|
+
close() {
|
|
147
|
+
this._agent.destroy();
|
|
148
|
+
return Promise.resolve();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function createLegacyHttpClient(opts) {
|
|
152
|
+
return new TvLegacyHttpClient(opts.https ? $Https.request : $Http.request, opts, opts.https ? new $Https.Agent({
|
|
153
|
+
maxSockets: 0,
|
|
154
|
+
keepAlive: true,
|
|
155
|
+
keepAliveMsecs: DEFAULT_TIMEOUT
|
|
156
|
+
}) : new $Http.Agent({
|
|
157
|
+
maxSockets: 0,
|
|
158
|
+
keepAlive: true,
|
|
159
|
+
keepAliveMsecs: DEFAULT_TIMEOUT
|
|
160
|
+
}), opts.apiNameWrapper);
|
|
161
|
+
}
|
|
162
|
+
exports.createLegacyHttpClient = createLegacyHttpClient;
|
|
163
|
+
//# sourceMappingURL=LegacyHttpClient.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyHttpClient.impl.js","sourceRoot":"","sources":["../../src/lib/client/LegacyHttpClient.impl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,8BAA8B;AAC9B,gCAAgC;AAEhC,oCAAoC;AACpC,6CAA6C;AAC7C,6CAA2C;AAE3C,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AACpD,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAEtC,MAAM,eAAe,GAAG,KAAM,CAAC;AAE/B,MAAM,qBAAqB,GAAG,MAAM,CAAC,kCAAkC,EAAE,CAAC,IAAW,CAAC,CAAC;AAEvF,MAAM,kBAAmB,SAAQ,0BAAY;IAIzC,YACqB,QAAuF,EACvF,KAA4B,EAC5B,MAAmB,EACnB,eAA0C;QAG3D,KAAK,EAAE,CAAC;QANS,aAAQ,GAAR,QAAQ,CAA+E;QACvF,UAAK,GAAL,KAAK,CAAuB;QAC5B,WAAM,GAAN,MAAM,CAAa;QACnB,oBAAe,GAAf,eAAe,CAA2B;QAgB/C,aAAQ,GAAY,IAAI,CAAC;QAEzB,UAAK,GAAY,KAAK,CAAC;QAEvB,aAAQ,GAAY,KAAK,CAAC;QAE1B,gBAAW,GAAG,IAAI,CAAC;IAlBnC,CAAC;IAED,IAAW,OAAO;QAEd,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,eAAe,CAAC;IACjD,CAAC;IAED,IAAW,OAAO;QAEd,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAUM,eAAe;QAElB,O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CAAC,MAAM,CAAC,OAAO,CAAC;oBAC7B,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;iBACrD,CAAC,CAAC,CAAC;YACR,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAE1B,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,OAAO;QAEV,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAEM,KAAK;QAER,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAEtB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ;AAsDD,SAAgB,sBAAsB,CAA+B,IAAwB;IAEzF,OAAO,IAAI,kBAAkB,CACzB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAC3C,IAAI,EACJ,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;QAC1B,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,eAAe;KAClC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC;QACjB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,eAAe;KAClC,CAAC,EACF,IAAI,CAAC,cAAc,CACtB,CAAC;AACN,CAAC;AAhBD,wDAgBC"}
|
|
@@ -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
|
+
export * from './Client.decl';
|
|
17
|
+
export * from './JsonApiClient.impl';
|
|
18
|
+
export * from './LegacyHttpClient.impl';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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("./Client.decl"), exports);
|
|
33
|
+
__exportStar(require("./JsonApiClient.impl"), exports);
|
|
34
|
+
__exportStar(require("./LegacyHttpClient.impl"), exports);
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/client/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;;;;;;;;;;;;;;AAEF,gDAA8B;AAC9B,uDAAqC;AACrC,0DAAwC"}
|