apache-iggy 0.8.0 → 0.8.1-edge.2

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 (280) hide show
  1. package/LICENSE +1 -1
  2. package/NOTICE +12 -0
  3. package/README.md +14 -0
  4. package/dist/client/client.connection.d.ts +0 -18
  5. package/dist/client/client.connection.js +17 -18
  6. package/dist/client/client.d.ts +0 -18
  7. package/dist/client/client.debug.d.ts +0 -18
  8. package/dist/client/client.debug.js +17 -18
  9. package/dist/client/client.js +17 -18
  10. package/dist/client/client.socket.d.ts +1 -19
  11. package/dist/client/client.socket.js +17 -18
  12. package/dist/client/client.type.d.ts +0 -18
  13. package/dist/client/client.type.js +17 -18
  14. package/dist/client/client.utils.d.ts +1 -18
  15. package/dist/client/client.utils.js +19 -19
  16. package/dist/client/client.utils.test.d.ts +2 -0
  17. package/dist/client/client.utils.test.js +58 -0
  18. package/dist/client/index.d.ts +0 -18
  19. package/dist/client/index.js +17 -18
  20. package/dist/client.e2e.d.ts +0 -18
  21. package/dist/client.e2e.js +17 -18
  22. package/dist/debug-send.d.ts +0 -18
  23. package/dist/debug-send.js +17 -18
  24. package/dist/debug.d.ts +0 -18
  25. package/dist/debug.js +17 -18
  26. package/dist/e2e/tcp.client.e2e.d.ts +0 -18
  27. package/dist/e2e/tcp.client.e2e.js +17 -18
  28. package/dist/e2e/tcp.cluster.e2e.d.ts +0 -18
  29. package/dist/e2e/tcp.cluster.e2e.js +17 -18
  30. package/dist/e2e/tcp.consumer-group.e2e.d.ts +0 -18
  31. package/dist/e2e/tcp.consumer-group.e2e.js +17 -18
  32. package/dist/e2e/tcp.consumer-stream.e2e.d.ts +0 -18
  33. package/dist/e2e/tcp.consumer-stream.e2e.js +17 -18
  34. package/dist/e2e/tcp.parallel.e2e.d.ts +0 -18
  35. package/dist/e2e/tcp.parallel.e2e.js +17 -18
  36. package/dist/e2e/tcp.raw.e2e.d.ts +2 -0
  37. package/dist/e2e/tcp.raw.e2e.js +42 -0
  38. package/dist/e2e/tcp.send-message.e2e.d.ts +0 -18
  39. package/dist/e2e/tcp.send-message.e2e.js +17 -18
  40. package/dist/e2e/tcp.stream.e2e.d.ts +0 -18
  41. package/dist/e2e/tcp.stream.e2e.js +17 -18
  42. package/dist/e2e/tcp.system.e2e.d.ts +0 -18
  43. package/dist/e2e/tcp.system.e2e.js +17 -18
  44. package/dist/e2e/tcp.token.e2e.d.ts +0 -18
  45. package/dist/e2e/tcp.token.e2e.js +17 -18
  46. package/dist/e2e/tcp.topic.e2e.d.ts +0 -18
  47. package/dist/e2e/tcp.topic.e2e.js +17 -18
  48. package/dist/e2e/tcp.user.e2e.d.ts +0 -18
  49. package/dist/e2e/tcp.user.e2e.js +51 -21
  50. package/dist/e2e/test-client.utils.d.ts +0 -18
  51. package/dist/e2e/test-client.utils.js +17 -18
  52. package/dist/e2e/tls.system.e2e.d.ts +0 -18
  53. package/dist/e2e/tls.system.e2e.js +17 -18
  54. package/dist/index.d.ts +0 -18
  55. package/dist/index.js +17 -18
  56. package/dist/stream/consumer-stream.d.ts +0 -18
  57. package/dist/stream/consumer-stream.js +17 -18
  58. package/dist/stream/index.d.ts +0 -18
  59. package/dist/stream/index.js +17 -18
  60. package/dist/tcp.e2e.d.ts +0 -18
  61. package/dist/tcp.e2e.js +17 -18
  62. package/dist/tcp.sm.utils.d.ts +0 -18
  63. package/dist/tcp.sm.utils.js +17 -18
  64. package/dist/tls.system.e2e.d.ts +0 -18
  65. package/dist/tls.system.e2e.js +17 -18
  66. package/dist/type.utils.d.ts +0 -18
  67. package/dist/type.utils.js +17 -18
  68. package/dist/wire/client/client.utils.d.ts +0 -18
  69. package/dist/wire/client/client.utils.js +17 -18
  70. package/dist/wire/client/get-client.command.d.ts +0 -18
  71. package/dist/wire/client/get-client.command.js +17 -18
  72. package/dist/wire/client/get-clients.command.d.ts +0 -18
  73. package/dist/wire/client/get-clients.command.js +17 -18
  74. package/dist/wire/client/get-me.command.d.ts +0 -18
  75. package/dist/wire/client/get-me.command.js +17 -18
  76. package/dist/wire/client/index.d.ts +0 -18
  77. package/dist/wire/client/index.js +17 -18
  78. package/dist/wire/cluster/cluster.type.d.ts +2 -20
  79. package/dist/wire/cluster/cluster.type.js +17 -18
  80. package/dist/wire/cluster/cluster.utils.d.ts +0 -18
  81. package/dist/wire/cluster/cluster.utils.js +17 -18
  82. package/dist/wire/cluster/get-cluster-metadata.command.d.ts +0 -18
  83. package/dist/wire/cluster/get-cluster-metadata.command.js +17 -18
  84. package/dist/wire/cluster/index.d.ts +0 -18
  85. package/dist/wire/cluster/index.js +17 -18
  86. package/dist/wire/command-set.d.ts +9 -18
  87. package/dist/wire/command-set.js +42 -19
  88. package/dist/wire/command-set.test.d.ts +2 -0
  89. package/dist/wire/command-set.test.js +93 -0
  90. package/dist/wire/command.code.d.ts +2 -18
  91. package/dist/wire/command.code.js +19 -18
  92. package/dist/wire/command.utils.d.ts +0 -18
  93. package/dist/wire/command.utils.js +17 -18
  94. package/dist/wire/consumer-group/create-group.command.d.ts +0 -18
  95. package/dist/wire/consumer-group/create-group.command.js +17 -18
  96. package/dist/wire/consumer-group/create-group.command.test.d.ts +0 -18
  97. package/dist/wire/consumer-group/create-group.command.test.js +17 -18
  98. package/dist/wire/consumer-group/delete-group.command.d.ts +0 -18
  99. package/dist/wire/consumer-group/delete-group.command.js +17 -18
  100. package/dist/wire/consumer-group/ensure-group.virtual.command.d.ts +0 -18
  101. package/dist/wire/consumer-group/ensure-group.virtual.command.js +17 -18
  102. package/dist/wire/consumer-group/get-group.command.d.ts +0 -18
  103. package/dist/wire/consumer-group/get-group.command.js +17 -18
  104. package/dist/wire/consumer-group/get-groups.command.d.ts +0 -18
  105. package/dist/wire/consumer-group/get-groups.command.js +17 -18
  106. package/dist/wire/consumer-group/group.command.test.d.ts +0 -18
  107. package/dist/wire/consumer-group/group.command.test.js +17 -18
  108. package/dist/wire/consumer-group/group.utils.d.ts +0 -18
  109. package/dist/wire/consumer-group/group.utils.js +17 -18
  110. package/dist/wire/consumer-group/index.d.ts +0 -18
  111. package/dist/wire/consumer-group/index.js +17 -18
  112. package/dist/wire/consumer-group/join-group.command.d.ts +0 -18
  113. package/dist/wire/consumer-group/join-group.command.js +17 -18
  114. package/dist/wire/consumer-group/leave-group.command.d.ts +0 -18
  115. package/dist/wire/consumer-group/leave-group.command.js +17 -18
  116. package/dist/wire/error.code.d.ts +0 -18
  117. package/dist/wire/error.code.js +17 -18
  118. package/dist/wire/error.utils.d.ts +0 -18
  119. package/dist/wire/error.utils.js +17 -18
  120. package/dist/wire/identifier.utils.d.ts +0 -18
  121. package/dist/wire/identifier.utils.js +17 -18
  122. package/dist/wire/identifier.utils.test.d.ts +0 -18
  123. package/dist/wire/identifier.utils.test.js +17 -18
  124. package/dist/wire/index.d.ts +0 -18
  125. package/dist/wire/index.js +17 -18
  126. package/dist/wire/message/flush-unsaved-buffers.command.d.ts +0 -18
  127. package/dist/wire/message/flush-unsaved-buffers.command.js +17 -18
  128. package/dist/wire/message/header.type.d.ts +1 -19
  129. package/dist/wire/message/header.type.js +17 -18
  130. package/dist/wire/message/header.utils.d.ts +0 -18
  131. package/dist/wire/message/header.utils.js +17 -18
  132. package/dist/wire/message/header.utils.test.d.ts +0 -18
  133. package/dist/wire/message/header.utils.test.js +17 -18
  134. package/dist/wire/message/iggy-header.utils.d.ts +0 -18
  135. package/dist/wire/message/iggy-header.utils.js +17 -18
  136. package/dist/wire/message/index.d.ts +0 -18
  137. package/dist/wire/message/index.js +17 -18
  138. package/dist/wire/message/message.utils.d.ts +0 -18
  139. package/dist/wire/message/message.utils.js +17 -18
  140. package/dist/wire/message/partitioning.utils.d.ts +0 -18
  141. package/dist/wire/message/partitioning.utils.js +17 -18
  142. package/dist/wire/message/poll-messages.command.d.ts +0 -18
  143. package/dist/wire/message/poll-messages.command.js +17 -18
  144. package/dist/wire/message/poll.utils.d.ts +0 -18
  145. package/dist/wire/message/poll.utils.js +17 -18
  146. package/dist/wire/message/send-messages.command.d.ts +0 -18
  147. package/dist/wire/message/send-messages.command.js +19 -20
  148. package/dist/wire/message/send-messages.command.test.d.ts +0 -18
  149. package/dist/wire/message/send-messages.command.test.js +35 -18
  150. package/dist/wire/number.utils.d.ts +0 -18
  151. package/dist/wire/number.utils.js +17 -18
  152. package/dist/wire/offset/delete-offset.command.d.ts +0 -18
  153. package/dist/wire/offset/delete-offset.command.js +17 -18
  154. package/dist/wire/offset/get-offset.command.d.ts +0 -18
  155. package/dist/wire/offset/get-offset.command.js +17 -18
  156. package/dist/wire/offset/index.d.ts +0 -18
  157. package/dist/wire/offset/index.js +17 -18
  158. package/dist/wire/offset/offset.utils.d.ts +0 -18
  159. package/dist/wire/offset/offset.utils.js +17 -18
  160. package/dist/wire/offset/store-offset.command.d.ts +0 -18
  161. package/dist/wire/offset/store-offset.command.js +17 -18
  162. package/dist/wire/partition/create-partition.command.d.ts +0 -18
  163. package/dist/wire/partition/create-partition.command.js +17 -18
  164. package/dist/wire/partition/delete-partition.command.d.ts +0 -18
  165. package/dist/wire/partition/delete-partition.command.js +17 -18
  166. package/dist/wire/partition/index.d.ts +0 -18
  167. package/dist/wire/partition/index.js +17 -18
  168. package/dist/wire/partition/partition.utils.d.ts +0 -18
  169. package/dist/wire/partition/partition.utils.js +17 -18
  170. package/dist/wire/partition/partition.utils.test.d.ts +0 -18
  171. package/dist/wire/partition/partition.utils.test.js +17 -18
  172. package/dist/wire/segment/delete-segments.command.d.ts +0 -18
  173. package/dist/wire/segment/delete-segments.command.js +17 -18
  174. package/dist/wire/segment/index.d.ts +0 -18
  175. package/dist/wire/segment/index.js +17 -18
  176. package/dist/wire/segment/segment.utils.d.ts +0 -18
  177. package/dist/wire/segment/segment.utils.js +17 -18
  178. package/dist/wire/serialize.utils.d.ts +0 -18
  179. package/dist/wire/serialize.utils.js +17 -18
  180. package/dist/wire/session/index.d.ts +0 -18
  181. package/dist/wire/session/index.js +17 -18
  182. package/dist/wire/session/login-with-token.command.d.ts +0 -18
  183. package/dist/wire/session/login-with-token.command.js +17 -18
  184. package/dist/wire/session/login-with-token.command.test.d.ts +0 -18
  185. package/dist/wire/session/login-with-token.command.test.js +17 -18
  186. package/dist/wire/session/login.command.d.ts +0 -18
  187. package/dist/wire/session/login.command.js +17 -18
  188. package/dist/wire/session/login.command.test.d.ts +0 -18
  189. package/dist/wire/session/login.command.test.js +17 -18
  190. package/dist/wire/session/login.utils.d.ts +0 -18
  191. package/dist/wire/session/login.utils.js +17 -18
  192. package/dist/wire/session/logout.command.d.ts +0 -18
  193. package/dist/wire/session/logout.command.js +17 -18
  194. package/dist/wire/stream/create-stream.command.d.ts +0 -18
  195. package/dist/wire/stream/create-stream.command.js +17 -18
  196. package/dist/wire/stream/create-stream.command.test.d.ts +0 -18
  197. package/dist/wire/stream/create-stream.command.test.js +17 -18
  198. package/dist/wire/stream/delete-stream.command.d.ts +0 -18
  199. package/dist/wire/stream/delete-stream.command.js +17 -18
  200. package/dist/wire/stream/ensure-stream.virtual.command.d.ts +0 -18
  201. package/dist/wire/stream/ensure-stream.virtual.command.js +17 -18
  202. package/dist/wire/stream/get-stream.command.d.ts +0 -18
  203. package/dist/wire/stream/get-stream.command.js +17 -18
  204. package/dist/wire/stream/get-streams.command.d.ts +0 -18
  205. package/dist/wire/stream/get-streams.command.js +17 -18
  206. package/dist/wire/stream/index.d.ts +0 -18
  207. package/dist/wire/stream/index.js +17 -18
  208. package/dist/wire/stream/purge-stream.command.d.ts +0 -18
  209. package/dist/wire/stream/purge-stream.command.js +17 -18
  210. package/dist/wire/stream/stream.utils.d.ts +0 -18
  211. package/dist/wire/stream/stream.utils.js +17 -18
  212. package/dist/wire/stream/update-stream.command.d.ts +0 -18
  213. package/dist/wire/stream/update-stream.command.js +17 -18
  214. package/dist/wire/system/get-stats.command.d.ts +0 -18
  215. package/dist/wire/system/get-stats.command.js +17 -18
  216. package/dist/wire/system/index.d.ts +0 -18
  217. package/dist/wire/system/index.js +17 -18
  218. package/dist/wire/system/ping.command.d.ts +0 -18
  219. package/dist/wire/system/ping.command.js +17 -18
  220. package/dist/wire/token/create-token.command.d.ts +0 -18
  221. package/dist/wire/token/create-token.command.js +17 -18
  222. package/dist/wire/token/create-token.command.test.d.ts +0 -18
  223. package/dist/wire/token/create-token.command.test.js +17 -18
  224. package/dist/wire/token/delete-token.command.d.ts +0 -18
  225. package/dist/wire/token/delete-token.command.js +17 -18
  226. package/dist/wire/token/delete-token.command.test.d.ts +0 -18
  227. package/dist/wire/token/delete-token.command.test.js +17 -18
  228. package/dist/wire/token/get-tokens.command.d.ts +0 -18
  229. package/dist/wire/token/get-tokens.command.js +17 -18
  230. package/dist/wire/token/index.d.ts +0 -18
  231. package/dist/wire/token/index.js +17 -18
  232. package/dist/wire/token/token.utils.d.ts +0 -18
  233. package/dist/wire/token/token.utils.js +17 -18
  234. package/dist/wire/topic/create-topic.command.d.ts +0 -18
  235. package/dist/wire/topic/create-topic.command.js +17 -18
  236. package/dist/wire/topic/create-topic.command.test.d.ts +0 -18
  237. package/dist/wire/topic/create-topic.command.test.js +17 -18
  238. package/dist/wire/topic/delete-topic.command.d.ts +0 -18
  239. package/dist/wire/topic/delete-topic.command.js +17 -18
  240. package/dist/wire/topic/ensure-topic.virtual.command.d.ts +0 -18
  241. package/dist/wire/topic/ensure-topic.virtual.command.js +17 -18
  242. package/dist/wire/topic/get-topic.command.d.ts +0 -18
  243. package/dist/wire/topic/get-topic.command.js +17 -18
  244. package/dist/wire/topic/get-topics.command.d.ts +0 -18
  245. package/dist/wire/topic/get-topics.command.js +17 -18
  246. package/dist/wire/topic/index.d.ts +0 -18
  247. package/dist/wire/topic/index.js +17 -18
  248. package/dist/wire/topic/purge-topic.command.d.ts +0 -18
  249. package/dist/wire/topic/purge-topic.command.js +17 -18
  250. package/dist/wire/topic/topic.utils.d.ts +0 -18
  251. package/dist/wire/topic/topic.utils.js +17 -18
  252. package/dist/wire/topic/update-topic.command.d.ts +0 -18
  253. package/dist/wire/topic/update-topic.command.js +17 -18
  254. package/dist/wire/user/change-password.command.d.ts +0 -18
  255. package/dist/wire/user/change-password.command.js +17 -18
  256. package/dist/wire/user/create-user.command.d.ts +0 -18
  257. package/dist/wire/user/create-user.command.js +25 -21
  258. package/dist/wire/user/create-user.command.test.d.ts +0 -18
  259. package/dist/wire/user/create-user.command.test.js +45 -22
  260. package/dist/wire/user/delete-user.command.d.ts +0 -18
  261. package/dist/wire/user/delete-user.command.js +17 -18
  262. package/dist/wire/user/get-user.command.d.ts +0 -18
  263. package/dist/wire/user/get-user.command.js +17 -18
  264. package/dist/wire/user/get-users.command.d.ts +0 -18
  265. package/dist/wire/user/get-users.command.js +17 -18
  266. package/dist/wire/user/index.d.ts +0 -18
  267. package/dist/wire/user/index.js +17 -18
  268. package/dist/wire/user/permissions.utils.d.ts +2 -21
  269. package/dist/wire/user/permissions.utils.js +48 -48
  270. package/dist/wire/user/permissions.utils.test.d.ts +0 -18
  271. package/dist/wire/user/permissions.utils.test.js +106 -36
  272. package/dist/wire/user/update-permissions.command.d.ts +0 -18
  273. package/dist/wire/user/update-permissions.command.js +17 -18
  274. package/dist/wire/user/update-user.command.d.ts +0 -18
  275. package/dist/wire/user/update-user.command.js +17 -18
  276. package/dist/wire/user/user.utils.d.ts +0 -18
  277. package/dist/wire/user/user.utils.js +17 -18
  278. package/dist/wire/uuid.utils.d.ts +0 -18
  279. package/dist/wire/uuid.utils.js +17 -18
  280. package/package.json +12 -10
package/LICENSE CHANGED
@@ -198,4 +198,4 @@
198
198
  distributed under the License is distributed on an "AS IS" BASIS,
199
199
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  See the License for the specific language governing permissions and
201
- limitations under the License.
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,12 @@
1
+ Apache Iggy (Incubating)
2
+ Copyright 2026 The Apache Software Foundation
3
+
4
+ This product includes software developed at
5
+ The Apache Software Foundation (http://www.apache.org/).
6
+
7
+ ================================================================
8
+
9
+ The Iggy project code was originally created, designed, developed by Piotr Gankiewicz in April 2023.
10
+ It was released as an open-source project under MIT License, later converted to Apache 2.0 License,
11
+ and donated by LaserData, Inc. to the Apache Software Foundation (ASF) in February 2025.
12
+ Copyright April 2023 - February 2025 Piotr Gankiewicz, LaserData, Inc.
package/README.md CHANGED
@@ -1,7 +1,21 @@
1
+ <div align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/apache/iggy/refs/heads/master/assets/logo/SVG/iggy-apache-color-darkbg.svg">
4
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/apache/iggy/refs/heads/master/assets/logo/SVG/iggy-apache-color-lightbg.svg">
5
+ <img alt="Apache Iggy" src="https://raw.githubusercontent.com/apache/iggy/refs/heads/master/assets/logo/SVG/iggy-apache-color-lightbg.svg" width="320">
6
+ </picture>
7
+ </div>
8
+
1
9
  # Apache Iggy Node.js Client
2
10
 
3
11
  Apache Iggy Node.js client written in typescript, it currently only supports tcp & tls transports.
4
12
 
13
+ > Apache Iggy (Incubating) is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC.
14
+ >
15
+ > Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
16
+ >
17
+ > While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
18
+
5
19
  diclaimer: although all iggy commands & basic client/stream are implemented this is still a WIP, provided as is, and has still a long way to go to be considered "battle tested".
6
20
 
7
21
  note: This lib started as _iggy-bin_ ( [github](https://github.com/T1B0/iggy-bin) / [npm](https://www.npmjs.com/package/iggy-bin)) before migrating under iggy-rs org. package iggy-bin@v1.3.4 is equivalent to @iggy.rs/sdk@v1.0.3 and migrating again under apache iggy monorepo ( [github](https://github.com/apache/iggy/tree/master/foreign/node) and is now published on npmjs as apache-iggy
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  import { EventEmitter } from 'node:events';
20
2
  import type { Socket } from 'node:net';
21
3
  import type { ClientConfig } from "./client.type.js";
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  import { EventEmitter } from 'node:events';
20
19
  import { createConnection } from 'node:net';
21
20
  import { connect as TLSConnect } from 'node:tls';
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  import { type Pool } from 'generic-pool';
20
2
  import type { RawClient, ClientConfig } from "./client.type.js";
21
3
  import { CommandAPI } from '../wire/command-set.js';
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  import Debug from 'debug';
20
2
  /**
21
3
  * Debug logger for the Iggy client.
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  import Debug from 'debug';
20
19
  /**
21
20
  * Debug logger for the Iggy client.
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  import { createPool } from 'generic-pool';
20
19
  import { getRawClient } from '../client/client.socket.js';
21
20
  import { CommandAPI } from '../wire/command-set.js';
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  import { EventEmitter } from 'node:events';
20
2
  import type { ClientConfig, ClientCredentials, CommandResponse, PasswordCredentials, RawClient, TokenCredentials } from '../client/client.type.js';
21
3
  /**
@@ -122,7 +104,7 @@ export declare class CommandResponseStream extends EventEmitter {
122
104
  *
123
105
  * @returns The connection socket
124
106
  */
125
- getReadStream(): import("net").Socket;
107
+ getReadStream(): import("node:net").Socket;
126
108
  /**
127
109
  * Destroys the stream and cleans up resources.
128
110
  * Stops heartbeat and destroys the connection.
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  import { EventEmitter } from 'node:events';
20
19
  import { handleResponse } from './client.utils.js';
21
20
  import { responseError } from '../wire/error.utils.js';
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  import type { Readable } from 'stream';
20
2
  import { type TcpSocketConnectOpts } from 'node:net';
21
3
  import { type ConnectionOptions } from 'node:tls';
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  /**
20
19
  * Available transport protocols for connecting to the Iggy server.
21
20
  */
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  import { Transform } from 'node:stream';
20
2
  import type { CommandResponse } from './client.type.js';
21
3
  /**
@@ -45,6 +27,7 @@ export declare const handleResponseTransform: () => Transform;
45
27
  * @returns True if the response indicates success with no data
46
28
  */
47
29
  export declare const deserializeVoidResponse: (r: CommandResponse) => boolean;
30
+ export declare const deserializeStatusResponse: (r: CommandResponse) => boolean;
48
31
  /**
49
32
  * Serializes a command and its payload into a buffer for sending to the server.
50
33
  * Creates the wire format: [payload_size (4 bytes)][command (4 bytes)][payload]
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  import { Transform } from 'node:stream';
20
19
  import { translateCommandCode } from '../wire/command.code.js';
21
20
  import { debug } from './client.debug.js';
@@ -31,7 +30,7 @@ export const handleResponse = (r) => {
31
30
  const length = r.readUint32LE(4);
32
31
  debug('<== handleResponse', { status, length });
33
32
  return {
34
- status, length, data: r.subarray(8)
33
+ status, length, data: r.subarray(8, 8 + length)
35
34
  };
36
35
  };
37
36
  /**
@@ -60,6 +59,7 @@ export const handleResponseTransform = () => new Transform({
60
59
  * @returns True if the response indicates success with no data
61
60
  */
62
61
  export const deserializeVoidResponse = (r) => r.status === 0 && r.data.length === 0;
62
+ export const deserializeStatusResponse = (r) => r.status === 0;
63
63
  /** Length of the command code in bytes */
64
64
  const COMMAND_LENGTH = 4;
65
65
  /**
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.utils.test.d.ts.map
@@ -0,0 +1,58 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
18
+ import { describe, it } from 'node:test';
19
+ import assert from 'node:assert/strict';
20
+ import { handleResponse, deserializeVoidResponse, deserializeStatusResponse } from './client.utils.js';
21
+ const SUCCESS = 0;
22
+ const ERROR = 1;
23
+ describe('handleResponse', () => {
24
+ it('bounds data to the length field, not the full buffer', () => {
25
+ // Server says: status=0, length=0, no payload.
26
+ // But the raw buffer has 4 trailing bytes (e.g. start of next response).
27
+ const buf = Buffer.alloc(12);
28
+ buf.writeUInt32LE(SUCCESS, 0); // status
29
+ buf.writeUInt32LE(0, 4); // length = 0 (void response)
30
+ buf.writeUInt32LE(42, 8); // trailing bytes — NOT part of this response
31
+ const r = handleResponse(buf);
32
+ assert.equal(r.data.length, 0);
33
+ });
34
+ it('deserializeVoidResponse returns true for a valid void response with trailing buffer bytes', () => {
35
+ const buf = Buffer.alloc(12);
36
+ buf.writeUInt32LE(SUCCESS, 0);
37
+ buf.writeUInt32LE(0, 4); // length = 0
38
+ buf.writeUInt32LE(42, 8); // trailing bytes
39
+ const r = handleResponse(buf);
40
+ assert.equal(deserializeVoidResponse(r), true);
41
+ });
42
+ });
43
+ describe('deserializeStatusResponse', () => {
44
+ it('returns true when status is SUCCESS and data is empty', () => {
45
+ const r = { status: SUCCESS, length: 0, data: Buffer.alloc(0) };
46
+ assert.equal(deserializeStatusResponse(r), true);
47
+ });
48
+ it('returns true when status is SUCCESS and data is non-empty (e.g. SendMessages server payload)', () => {
49
+ // Key difference from deserializeVoidResponse: non-empty data is accepted.
50
+ const r = { status: SUCCESS, length: 4, data: Buffer.from([1, 2, 3, 4]) };
51
+ assert.equal(deserializeStatusResponse(r), true);
52
+ });
53
+ it('returns false when status is an error code', () => {
54
+ const r = { status: ERROR, length: 0, data: Buffer.alloc(0) };
55
+ assert.equal(deserializeStatusResponse(r), false);
56
+ });
57
+ });
58
+ //# sourceMappingURL=client.utils.test.js.map
@@ -1,21 +1,3 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  export { Client, SimpleClient, SingleClient } from './client.js';
20
2
  export * from './client.utils.js';
21
3
  export * from './client.socket.js';
@@ -1,21 +1,20 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+ //
19
18
  export { Client, SimpleClient, SingleClient } from './client.js';
20
19
  export * from './client.utils.js';
21
20
  export * from './client.socket.js';
@@ -1,20 +1,2 @@
1
- /**
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
1
  export {};
20
2
  //# sourceMappingURL=client.e2e.d.ts.map