@litert/televoke 1.1.0 → 1.2.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.
Files changed (206) hide show
  1. package/CHANGES.md +9 -0
  2. package/lib/client/Client.decl.d.ts +1 -1
  3. package/lib/client/Client.decl.js +1 -1
  4. package/lib/client/JsonApiClient.impl.d.ts +1 -1
  5. package/lib/client/JsonApiClient.impl.js +1 -1
  6. package/lib/client/index.d.ts +1 -1
  7. package/lib/client/index.js +1 -1
  8. package/lib/index.d.ts +1 -1
  9. package/lib/index.js +1 -1
  10. package/lib/server/LegacyServerChannel.impl.d.ts +1 -1
  11. package/lib/server/LegacyServerChannel.impl.js +1 -1
  12. package/lib/server/Server.decl.d.ts +1 -1
  13. package/lib/server/Server.decl.js +1 -1
  14. package/lib/server/Server.impl.d.ts +1 -1
  15. package/lib/server/Server.impl.js +1 -1
  16. package/lib/server/ServerChannel.d.ts +1 -1
  17. package/lib/server/ServerChannel.js +1 -1
  18. package/lib/server/SimpleJsonApiRouter.d.ts +1 -1
  19. package/lib/server/SimpleJsonApiRouter.js +1 -1
  20. package/lib/server/index.d.ts +1 -1
  21. package/lib/server/index.js +1 -1
  22. package/lib/shared/BinaryStream.d.ts +1 -1
  23. package/lib/shared/BinaryStream.js +1 -1
  24. package/lib/shared/BinaryStreamManager.d.ts +1 -1
  25. package/lib/shared/BinaryStreamManager.js +1 -1
  26. package/lib/shared/Channel.impl.d.ts +1 -1
  27. package/lib/shared/Channel.impl.js +1 -1
  28. package/lib/shared/Constants.d.ts +1 -1
  29. package/lib/shared/Constants.js +1 -1
  30. package/lib/shared/Encodings/index.d.ts +1 -1
  31. package/lib/shared/Encodings/index.js +1 -1
  32. package/lib/shared/Encodings/v1/EncoderV1.d.ts +1 -1
  33. package/lib/shared/Encodings/v1/EncoderV1.js +1 -1
  34. package/lib/shared/Encodings/v1/Protocol.v1.decls.d.ts +1 -1
  35. package/lib/shared/Encodings/v1/Protocol.v1.decls.js +1 -1
  36. package/lib/shared/Encodings/v1/index.d.ts +1 -1
  37. package/lib/shared/Encodings/v1/index.js +1 -1
  38. package/lib/shared/Encodings/v2/Constants.v2.d.ts +1 -1
  39. package/lib/shared/Encodings/v2/Constants.v2.js +1 -1
  40. package/lib/shared/Encodings/v2/DecoderV2.d.ts +1 -1
  41. package/lib/shared/Encodings/v2/DecoderV2.js +1 -1
  42. package/lib/shared/Encodings/v2/EncoderV2.d.ts +1 -1
  43. package/lib/shared/Encodings/v2/EncoderV2.js +1 -1
  44. package/lib/shared/Encodings/v2/Encoding.v2.decl.d.ts +1 -1
  45. package/lib/shared/Encodings/v2/Encoding.v2.decl.js +1 -1
  46. package/lib/shared/Encodings/v2/index.d.ts +1 -1
  47. package/lib/shared/Encodings/v2/index.js +1 -1
  48. package/lib/shared/Errors.d.ts +1 -1
  49. package/lib/shared/Errors.d.ts.map +1 -1
  50. package/lib/shared/Errors.js +1 -1
  51. package/lib/shared/Shared.decl.d.ts +2 -2
  52. package/lib/shared/Shared.decl.d.ts.map +1 -1
  53. package/lib/shared/Shared.decl.js +1 -1
  54. package/lib/shared/Utils.d.ts +1 -1
  55. package/lib/shared/Utils.js +1 -1
  56. package/lib/shared/index.d.ts +1 -1
  57. package/lib/shared/index.js +1 -1
  58. package/lib/transporters/Transporter.decl.d.ts +1 -1
  59. package/lib/transporters/Transporter.decl.js +1 -1
  60. package/lib/transporters/http-listener/AbstractHttpListener.d.ts +2 -2
  61. package/lib/transporters/http-listener/AbstractHttpListener.d.ts.map +1 -1
  62. package/lib/transporters/http-listener/AbstractHttpListener.js +10 -6
  63. package/lib/transporters/http-listener/AbstractHttpListener.js.map +1 -1
  64. package/lib/transporters/http-listener/Http.Decl.d.ts +1 -5
  65. package/lib/transporters/http-listener/Http.Decl.d.ts.map +1 -1
  66. package/lib/transporters/http-listener/Http.Decl.js +2 -21
  67. package/lib/transporters/http-listener/Http.Decl.js.map +1 -1
  68. package/lib/transporters/http-listener/HttpListener.d.ts +1 -1
  69. package/lib/transporters/http-listener/HttpListener.d.ts.map +1 -1
  70. package/lib/transporters/http-listener/HttpListener.js +4 -2
  71. package/lib/transporters/http-listener/HttpListener.js.map +1 -1
  72. package/lib/transporters/http-listener/HttpUnixSocketListener.d.ts +1 -1
  73. package/lib/transporters/http-listener/HttpUnixSocketListener.d.ts.map +1 -1
  74. package/lib/transporters/http-listener/HttpUnixSocketListener.js +4 -2
  75. package/lib/transporters/http-listener/HttpUnixSocketListener.js.map +1 -1
  76. package/lib/transporters/http-listener/HttpsListener.d.ts +1 -1
  77. package/lib/transporters/http-listener/HttpsListener.d.ts.map +1 -1
  78. package/lib/transporters/http-listener/HttpsListener.js +6 -4
  79. package/lib/transporters/http-listener/HttpsListener.js.map +1 -1
  80. package/lib/transporters/http-listener/index.d.ts +1 -1
  81. package/lib/transporters/http-listener/index.js +1 -1
  82. package/lib/transporters/index.d.ts +1 -1
  83. package/lib/transporters/index.js +1 -1
  84. package/lib/transporters/legacy-http/LegacyHttp.Client.Native.d.ts +12 -2
  85. package/lib/transporters/legacy-http/LegacyHttp.Client.Native.d.ts.map +1 -1
  86. package/lib/transporters/legacy-http/LegacyHttp.Client.Native.js +11 -1
  87. package/lib/transporters/legacy-http/LegacyHttp.Client.Native.js.map +1 -1
  88. package/lib/transporters/legacy-http/LegacyHttp.Server.d.ts +29 -1
  89. package/lib/transporters/legacy-http/LegacyHttp.Server.d.ts.map +1 -1
  90. package/lib/transporters/legacy-http/LegacyHttp.Server.js +35 -10
  91. package/lib/transporters/legacy-http/LegacyHttp.Server.js.map +1 -1
  92. package/lib/transporters/legacy-http/LegacyHttp.Transporter.d.ts +1 -1
  93. package/lib/transporters/legacy-http/LegacyHttp.Transporter.js +1 -1
  94. package/lib/transporters/legacy-http/index.d.ts +1 -1
  95. package/lib/transporters/legacy-http/index.js +1 -1
  96. package/lib/transporters/lwdfx/LwDFX.Tcp.Client.d.ts +1 -1
  97. package/lib/transporters/lwdfx/LwDFX.Tcp.Client.js +1 -1
  98. package/lib/transporters/lwdfx/LwDFX.Tcp.Server.d.ts +1 -1
  99. package/lib/transporters/lwdfx/LwDFX.Tcp.Server.js +1 -1
  100. package/lib/transporters/lwdfx/LwDFX.Tls.Client.d.ts +1 -1
  101. package/lib/transporters/lwdfx/LwDFX.Tls.Client.js +1 -1
  102. package/lib/transporters/lwdfx/LwDFX.Tls.Server.d.ts +1 -1
  103. package/lib/transporters/lwdfx/LwDFX.Tls.Server.js +1 -1
  104. package/lib/transporters/lwdfx/LwDFX.Transporter.d.ts +1 -1
  105. package/lib/transporters/lwdfx/LwDFX.Transporter.js +1 -1
  106. package/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.d.ts +1 -1
  107. package/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.js +1 -1
  108. package/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.d.ts +1 -1
  109. package/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.js +1 -1
  110. package/lib/transporters/lwdfx/LwDFX.decl.d.ts +1 -1
  111. package/lib/transporters/lwdfx/LwDFX.decl.js +1 -1
  112. package/lib/transporters/lwdfx/index.d.ts +1 -1
  113. package/lib/transporters/lwdfx/index.js +1 -1
  114. package/lib/transporters/memory/Memory.Impl.d.ts +1 -1
  115. package/lib/transporters/memory/Memory.Impl.js +1 -1
  116. package/lib/transporters/memory/index.d.ts +1 -1
  117. package/lib/transporters/memory/index.js +1 -1
  118. package/lib/transporters/websocket/WebSocket.Client.d.ts +18 -3
  119. package/lib/transporters/websocket/WebSocket.Client.d.ts.map +1 -1
  120. package/lib/transporters/websocket/WebSocket.Client.js +21 -1
  121. package/lib/transporters/websocket/WebSocket.Client.js.map +1 -1
  122. package/lib/transporters/websocket/WebSocket.Server.d.ts +24 -2
  123. package/lib/transporters/websocket/WebSocket.Server.d.ts.map +1 -1
  124. package/lib/transporters/websocket/WebSocket.Server.js +29 -10
  125. package/lib/transporters/websocket/WebSocket.Server.js.map +1 -1
  126. package/lib/transporters/websocket/WebSocket.Transporter.d.ts +1 -1
  127. package/lib/transporters/websocket/WebSocket.Transporter.js +1 -1
  128. package/lib/transporters/websocket/WebSocket.decl.d.ts +1 -1
  129. package/lib/transporters/websocket/WebSocket.decl.js +1 -1
  130. package/lib/transporters/websocket/index.d.ts +1 -1
  131. package/lib/transporters/websocket/index.js +1 -1
  132. package/lib/transporters/worker-thread/WorkerThread.Client.d.ts +1 -1
  133. package/lib/transporters/worker-thread/WorkerThread.Client.js +1 -1
  134. package/lib/transporters/worker-thread/WorkerThread.Constants.d.ts +1 -1
  135. package/lib/transporters/worker-thread/WorkerThread.Constants.js +1 -1
  136. package/lib/transporters/worker-thread/WorkerThread.Errors.d.ts +1 -1
  137. package/lib/transporters/worker-thread/WorkerThread.Errors.d.ts.map +1 -1
  138. package/lib/transporters/worker-thread/WorkerThread.Errors.js +1 -1
  139. package/lib/transporters/worker-thread/WorkerThread.Server.d.ts +1 -1
  140. package/lib/transporters/worker-thread/WorkerThread.Server.js +1 -1
  141. package/lib/transporters/worker-thread/WorkerThread.Transporter.d.ts +1 -1
  142. package/lib/transporters/worker-thread/WorkerThread.Transporter.js +1 -1
  143. package/lib/transporters/worker-thread/index.d.ts +1 -1
  144. package/lib/transporters/worker-thread/index.js +1 -1
  145. package/package.json +5 -5
  146. package/src/lib/client/Client.decl.ts +1 -1
  147. package/src/lib/client/JsonApiClient.impl.ts +1 -1
  148. package/src/lib/client/index.ts +1 -1
  149. package/src/lib/index.ts +1 -1
  150. package/src/lib/server/LegacyServerChannel.impl.ts +1 -1
  151. package/src/lib/server/Server.decl.ts +1 -1
  152. package/src/lib/server/Server.impl.ts +1 -1
  153. package/src/lib/server/ServerChannel.ts +1 -1
  154. package/src/lib/server/SimpleJsonApiRouter.ts +1 -1
  155. package/src/lib/server/index.ts +1 -1
  156. package/src/lib/shared/BinaryStream.ts +1 -1
  157. package/src/lib/shared/BinaryStreamManager.ts +1 -1
  158. package/src/lib/shared/Channel.impl.ts +1 -1
  159. package/src/lib/shared/Constants.ts +1 -1
  160. package/src/lib/shared/Encodings/index.ts +1 -1
  161. package/src/lib/shared/Encodings/v1/EncoderV1.ts +1 -1
  162. package/src/lib/shared/Encodings/v1/Protocol.v1.decls.ts +1 -1
  163. package/src/lib/shared/Encodings/v1/index.ts +1 -1
  164. package/src/lib/shared/Encodings/v2/Constants.v2.ts +1 -1
  165. package/src/lib/shared/Encodings/v2/DecoderV2.ts +1 -1
  166. package/src/lib/shared/Encodings/v2/EncoderV2.ts +1 -1
  167. package/src/lib/shared/Encodings/v2/Encoding.v2.decl.ts +1 -1
  168. package/src/lib/shared/Encodings/v2/index.ts +1 -1
  169. package/src/lib/shared/Errors.ts +1 -1
  170. package/src/lib/shared/Shared.decl.ts +3 -3
  171. package/src/lib/shared/Utils.ts +1 -1
  172. package/src/lib/shared/index.ts +1 -1
  173. package/src/lib/transporters/Transporter.decl.ts +1 -1
  174. package/src/lib/transporters/http-listener/AbstractHttpListener.ts +14 -6
  175. package/src/lib/transporters/http-listener/Http.Decl.ts +1 -26
  176. package/src/lib/transporters/http-listener/HttpListener.ts +10 -2
  177. package/src/lib/transporters/http-listener/HttpUnixSocketListener.ts +10 -2
  178. package/src/lib/transporters/http-listener/HttpsListener.ts +12 -4
  179. package/src/lib/transporters/http-listener/index.ts +1 -1
  180. package/src/lib/transporters/index.ts +1 -1
  181. package/src/lib/transporters/legacy-http/LegacyHttp.Client.Native.ts +30 -3
  182. package/src/lib/transporters/legacy-http/LegacyHttp.Server.ts +57 -9
  183. package/src/lib/transporters/legacy-http/LegacyHttp.Transporter.ts +1 -1
  184. package/src/lib/transporters/legacy-http/index.ts +1 -1
  185. package/src/lib/transporters/lwdfx/LwDFX.Tcp.Client.ts +1 -1
  186. package/src/lib/transporters/lwdfx/LwDFX.Tcp.Server.ts +1 -1
  187. package/src/lib/transporters/lwdfx/LwDFX.Tls.Client.ts +1 -1
  188. package/src/lib/transporters/lwdfx/LwDFX.Tls.Server.ts +1 -1
  189. package/src/lib/transporters/lwdfx/LwDFX.Transporter.ts +1 -1
  190. package/src/lib/transporters/lwdfx/LwDFX.UnixSocket.Client.ts +1 -1
  191. package/src/lib/transporters/lwdfx/LwDFX.UnixSocket.Server.ts +1 -1
  192. package/src/lib/transporters/lwdfx/LwDFX.decl.ts +1 -1
  193. package/src/lib/transporters/lwdfx/index.ts +1 -1
  194. package/src/lib/transporters/memory/Memory.Impl.ts +1 -1
  195. package/src/lib/transporters/memory/index.ts +1 -1
  196. package/src/lib/transporters/websocket/WebSocket.Client.ts +52 -7
  197. package/src/lib/transporters/websocket/WebSocket.Server.ts +55 -9
  198. package/src/lib/transporters/websocket/WebSocket.Transporter.ts +1 -1
  199. package/src/lib/transporters/websocket/WebSocket.decl.ts +1 -1
  200. package/src/lib/transporters/websocket/index.ts +1 -1
  201. package/src/lib/transporters/worker-thread/WorkerThread.Client.ts +1 -1
  202. package/src/lib/transporters/worker-thread/WorkerThread.Constants.ts +1 -1
  203. package/src/lib/transporters/worker-thread/WorkerThread.Errors.ts +1 -1
  204. package/src/lib/transporters/worker-thread/WorkerThread.Server.ts +1 -1
  205. package/src/lib/transporters/worker-thread/WorkerThread.Transporter.ts +1 -1
  206. package/src/lib/transporters/worker-thread/index.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,22 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import * as LibWS from '@litert/websocket';
17
+ import type * as NodeHttp from 'node:http';
17
18
  import type * as dT from '../Transporter.decl';
18
- export declare function createWsConnector(opts: LibWS.IWsConnectOptions): dT.IConnector;
19
- export declare function createWssConnector(opts: LibWS.IWssConnectOptions): dT.IConnector;
19
+ export interface IWsConnector extends dT.IConnector {
20
+ /**
21
+ * Setup the custom headers for websocket negotiation on each connection.
22
+ *
23
+ * **WARNING:**
24
+ * **In browser environment, the Websocket class cannot send custom headers.**
25
+ * **Considering the compatibility, custom headers in Websocket protocol are not recommended to use.**
26
+ * ***Don't use this feature unless you don't care about the compatibility in browser environment.***
27
+ *
28
+ * @param newHeaders The new headers to set.
29
+ * @param append Whether to append the new headers to existing headers, or replace all headers. [Default: true]
30
+ */
31
+ setHeaders(newHeaders: NodeHttp.OutgoingHttpHeaders, append?: boolean): void;
32
+ }
33
+ export declare function createWsConnector(opts: LibWS.IWsConnectOptions): IWsConnector;
34
+ export declare function createWssConnector(opts: LibWS.IWssConnectOptions): IWsConnector;
20
35
  //# sourceMappingURL=WebSocket.Client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebSocket.Client.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/websocket/WebSocket.Client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AA+C/C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,iBAAiB,GAAG,EAAE,CAAC,UAAU,CAI9E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,GAAG,EAAE,CAAC,UAAU,CAIhF"}
1
+ {"version":3,"file":"WebSocket.Client.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/websocket/WebSocket.Client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,KAAK,QAAQ,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AA2E/C,MAAM,WAAW,YAAa,SAAQ,EAAE,CAAC,UAAU;IAE/C;;;;;;;;;;OAUG;IACH,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAChF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,iBAAiB,GAAG,YAAY,CAI7E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,GAAG,YAAY,CAI/E"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,17 @@ const dWS = require("./WebSocket.decl");
22
22
  const WebSocket_Transporter_1 = require("./WebSocket.Transporter");
23
23
  class WsConnector {
24
24
  constructor(_opts) {
25
+ var _a;
25
26
  this._opts = _opts;
27
+ (_a = this._opts).headers ?? (_a.headers = {});
28
+ }
29
+ setHeaders(newHeaders, append = true) {
30
+ if (append) {
31
+ Object.assign(this._opts.headers, newHeaders);
32
+ }
33
+ else {
34
+ this._opts.headers = newHeaders;
35
+ }
26
36
  }
27
37
  async connect() {
28
38
  const ws = await LibWS.wsConnect({
@@ -40,7 +50,17 @@ class WsConnector {
40
50
  }
41
51
  class WssConnector {
42
52
  constructor(_opts) {
53
+ var _a;
43
54
  this._opts = _opts;
55
+ (_a = this._opts).headers ?? (_a.headers = {});
56
+ }
57
+ setHeaders(newHeaders, append = true) {
58
+ if (append) {
59
+ Object.assign(this._opts.headers, newHeaders);
60
+ }
61
+ else {
62
+ this._opts.headers = newHeaders;
63
+ }
44
64
  }
45
65
  async connect() {
46
66
  const ws = await LibWS.wssConnect({
@@ -1 +1 @@
1
- {"version":3,"file":"WebSocket.Client.js","sourceRoot":"","sources":["../../../src/lib/transporters/websocket/WebSocket.Client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAmDH,8CAIC;AAED,gDAIC;AA3DD,2CAA2C;AAC3C,wCAAwC;AAExC,mEAA+D;AAE/D,MAAM,WAAW;IAEb,YAAoC,KAA8B;QAA9B,UAAK,GAAL,KAAK,CAAyB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO;QAEhB,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;YAC7B,GAAG,IAAI,CAAC,KAAK;YACb,OAAO,EAAE;gBACL,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO;gBACtB,GAAG,KAAK,CAAC,4BAA4B,CAAC;oBAClC,cAAc,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC;iBAC/C,CAAC;aACL;SACJ,CA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C;QACpC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,OAAO;QAEhB,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC;YAC9B,GAAG,IAAI,CAAC,KAAK;YACb,OAAO,EAAE;gBACL,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO;gBACtB,GAAG,KAAK,CAAC,4BAA4B,CAAC;oBAClC,cAAc,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC;iBAC/C,CAAC;aACL;SACJ,CAAC,CAAC;QAEH,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAErB,OAAO,IAAI,4CAAoB,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;CACJ;AAkBD,SAAgB,iBAAiB,CAAC,IAA6B;IAE3D,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC;IACrD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,SAAgB,kBAAkB,CAAC,IAA8B;IAE7D,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC;IACrD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,8 +13,18 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type * as NodeHttp from 'node:http';
16
17
  import type * as Listener from '../http-listener';
17
18
  import type * as dT from '../Transporter.decl';
19
+ export interface IRegisterListenerOptions {
20
+ onErrorCallback: (e: Error) => void;
21
+ onUpgradeCallback: (req: NodeHttp.IncomingMessage, socket: NodeJS.Socket, head: Buffer) => void;
22
+ }
23
+ export interface IRegisterListenerResult {
24
+ stop?: () => void | Promise<void>;
25
+ start?: () => void | Promise<void>;
26
+ readonly running: boolean;
27
+ }
18
28
  export interface IWebSocketGatewayOptions {
19
29
  /**
20
30
  * The timeout of WebSocket connections.
@@ -26,10 +36,22 @@ export interface IWebSocketGatewayOptions {
26
36
  timeout?: number;
27
37
  }
28
38
  /**
29
- * Create a WebSocket gateway.
39
+ * Create a WebSocket gateway, binding to a simple built-in HTTP(S) listener.
40
+ *
41
+ * > When using built-in HTTP server, the api will ignore other headers, path and query string in the URL.
30
42
  *
31
43
  * @param listener The HTTP(S) listener object.
32
44
  * @param server The televoke server object.
33
45
  */
34
46
  export declare function createWebsocketGateway(listener: Listener.IHttpListener, server: dT.IServer, options?: IWebSocketGatewayOptions): dT.IGateway;
47
+ /**
48
+ * Create a WebSocket gateway, binding to a custom HTTP server.
49
+ *
50
+ * > When using a custom HTTP server, it's able to preprocess the request before passing to the server, like
51
+ * > authentication, rate limiting, custom routing, etc.
52
+ *
53
+ * @param registerListener The function to register the listener to the custom HTTP server.
54
+ * @param server The server to process the requests.
55
+ */
56
+ export declare function createCustomWebsocketGateway(registerListener: (opts: IRegisterListenerOptions) => IRegisterListenerResult, server: dT.IServer): dT.IGateway;
35
57
  //# sourceMappingURL=WebSocket.Server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebSocket.Server.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/websocket/WebSocket.Server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAwF/C,MAAM,WAAW,wBAAwB;IAErC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,QAAQ,CAA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O,GACnB,EAAE,CAAC,QAAQ,CAGb"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -16,14 +16,14 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.createWebsocketGateway = createWebsocketGateway;
19
+ exports.createCustomWebsocketGateway = createCustomWebsocketGateway;
19
20
  const LibWS = require("@litert/websocket");
20
21
  const dWS = require("./WebSocket.decl");
21
22
  const node_events_1 = require("node:events");
22
23
  const WebSocket_Transporter_1 = require("./WebSocket.Transporter");
23
24
  class WebSocketGateway extends node_events_1.EventEmitter {
24
- constructor(_listener, _server, timeout) {
25
+ constructor(registerListener, _server, timeout) {
25
26
  super();
26
- this._listener = _listener;
27
27
  this._server = _server;
28
28
  this._onUpgrade = (req, socket) => {
29
29
  let apn = req.headers[LibWS.H1_HDR_NAME_WS_PROTOCOL];
@@ -51,9 +51,10 @@ class WebSocketGateway extends node_events_1.EventEmitter {
51
51
  });
52
52
  this._server.registerChannel(new WebSocket_Transporter_1.WebSocketTransporter(dWS.WS_PROTOCOL_NAME, ws));
53
53
  };
54
- this._listener
55
- .on('error', (e) => this.emit('error', e))
56
- .setUpgradeProcessor(this._onUpgrade);
54
+ this._listener = registerListener({
55
+ 'onErrorCallback': (e) => this.emit('error', e),
56
+ 'onUpgradeCallback': this._onUpgrade,
57
+ });
57
58
  this._wsServer = LibWS.createServer({
58
59
  frameReceiveMode: LibWS.EFrameReceiveMode.LITE,
59
60
  timeout,
@@ -66,22 +67,40 @@ class WebSocketGateway extends node_events_1.EventEmitter {
66
67
  if (this.running) {
67
68
  return;
68
69
  }
69
- await this._listener.start();
70
+ await this._listener.start?.();
70
71
  }
71
72
  async stop() {
72
73
  if (!this.running) {
73
74
  return;
74
75
  }
75
- await this._listener.stop();
76
+ await this._listener.stop?.();
76
77
  }
77
78
  }
78
79
  /**
79
- * Create a WebSocket gateway.
80
+ * Create a WebSocket gateway, binding to a simple built-in HTTP(S) listener.
81
+ *
82
+ * > When using built-in HTTP server, the api will ignore other headers, path and query string in the URL.
80
83
  *
81
84
  * @param listener The HTTP(S) listener object.
82
85
  * @param server The televoke server object.
83
86
  */
84
87
  function createWebsocketGateway(listener, server, options = {}) {
85
- return new WebSocketGateway(listener, server, options.timeout);
88
+ return new WebSocketGateway((o) => {
89
+ listener.on('error', o.onErrorCallback);
90
+ listener.setUpgradeProcessor(o.onUpgradeCallback);
91
+ return listener;
92
+ }, server, options.timeout);
93
+ }
94
+ /**
95
+ * Create a WebSocket gateway, binding to a custom HTTP server.
96
+ *
97
+ * > When using a custom HTTP server, it's able to preprocess the request before passing to the server, like
98
+ * > authentication, rate limiting, custom routing, etc.
99
+ *
100
+ * @param registerListener The function to register the listener to the custom HTTP server.
101
+ * @param server The server to process the requests.
102
+ */
103
+ function createCustomWebsocketGateway(registerListener, server) {
104
+ return new WebSocketGateway(registerListener, server);
86
105
  }
87
106
  //# sourceMappingURL=WebSocket.Server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebSocket.Server.js","sourceRoot":"","sources":["../../../src/lib/transporters/websocket/WebSocket.Server.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AA+GH,wDAOC;AApHD,2CAA2C;AAC3C,wCAAwC;AAGxC,6CAA2C;AAC3C,mEAA+D;AAE/D,MAAM,gBAAiB,SAAQ,0BAAY;IAIvC,YACqB,SAAiC,EACjC,OAAmB,EACpC,OAAgB;QAGhB,KAAK,EAAE,CAAC;QALS,cAAS,GAAT,SAAS,CAAwB;QACjC,YAAO,GAAP,OAAO,CAAY;QAgBvB,eAAU,GAA+B,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAEtE,IAAI,GAAG,GAAsB,GAAG,CAAC,OAAO,CAAC,KAAK,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b,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAEhB,OAAO;QACX,CAAC;QAED,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;IAClC,CAAC;CACJ;AAcD;;;;;;;GAOG;AACH,SAAgB,sBAAsB,CAClC,QAAgC,EAChC,MAAkB,EAClB,UAAoC,EAAE;IAGtC,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE;QAE9B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC;QACxC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAElD,OAAO,QAAQ,CAAC;IAEpB,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,4BAA4B,CACxC,gBAA6E,EAC7E,MAAkB;IAGlB,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1 +1 @@
1
- {"version":3,"file":"WorkerThread.Errors.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/worker-thread/WorkerThread.Errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,uBAAuB;kBAEL,OAAO;;;;;;;mDA4BmB,OAC7C,QAAJ;;CArBP,CAAC;AAEF,eAAO,MAAM,kBAAkB;kBAEA,OAAO;;;;;;;mDAgBmB,OAC7C,QAAJ;;CATP,CAAC;AAEF,eAAO,MAAM,oBAAoB;kBAEF,OAAO;;;;;;;mDAImB,OAC7C,QAAJ;;CAGP,CAAC"}
1
+ {"version":3,"file":"WorkerThread.Errors.d.ts","sourceRoot":"","sources":["../../../src/lib/transporters/worker-thread/WorkerThread.Errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,uBAAuB;kBAEL,OAAO;;;;;;;mDAiCmwI,OAAQ,QAAQ;;CAzBxzI,CAAC;AAEF,eAAO,MAAM,kBAAkB;kBAEA,OAAO;;;;;;;mDAqBmwI,OAAQ,QAAQ;;CAbxzI,CAAC;AAEF,eAAO,MAAM,oBAAoB;kBAEF,OAAO;;;;;;;mDASmwI,OAAQ,QAAQ;;CADxzI,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
3
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litert/televoke",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A simple RPC service framework.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "test": "mocha",
13
13
  "prepare": "husky",
14
14
  "clean": "rm -rf lib examples benchmarks test",
15
- "lint": "eslint -c .eslintrc --ext '.ts' ./src"
15
+ "lint": "./utils/eslint.sh"
16
16
  },
17
17
  "keywords": [
18
18
  "litert",
@@ -34,13 +34,13 @@
34
34
  "devDependencies": {
35
35
  "@commitlint/cli": "^19.2.1",
36
36
  "@commitlint/config-conventional": "^19.1.0",
37
- "@litert/eslint-plugin-rules": "^0.1.7",
37
+ "@litert/eslint-plugin-rules": "^0.2.5",
38
38
  "@litert/lwdfx": "^1.1.3",
39
39
  "@litert/websocket": "^0.2.3",
40
40
  "@types/mocha": "^10.0.6",
41
- "@types/node": "^20.12.5",
41
+ "@types/node": "^22.13.5",
42
42
  "husky": "^9.0.11",
43
- "mocha": "^10.4.0",
43
+ "mocha": "^11.1.0",
44
44
  "typescript": "^5.4.4"
45
45
  },
46
46
  "engines": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2024 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2025 Angus.Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.