@zapo-js/fake-server 0.3.0 → 1.1.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 (301) hide show
  1. package/README.md +96 -8
  2. package/dist/api/AppStateSyncManager.d.ts +0 -1
  3. package/dist/api/AppStateSyncManager.js +0 -1
  4. package/dist/api/FakePairingDriver.d.ts +0 -1
  5. package/dist/api/FakePairingDriver.js +0 -1
  6. package/dist/api/FakePeer.d.ts +77 -4
  7. package/dist/api/FakePeer.js +208 -2
  8. package/dist/api/FakeServerSession.d.ts +67 -0
  9. package/dist/api/FakeServerSession.js +293 -0
  10. package/dist/api/FakeWaServer.d.ts +77 -31
  11. package/dist/api/FakeWaServer.js +140 -259
  12. package/dist/api/PreKeyDispenser.d.ts +0 -1
  13. package/dist/api/PreKeyDispenser.js +0 -1
  14. package/dist/api/Scenario.d.ts +0 -1
  15. package/dist/api/Scenario.js +0 -1
  16. package/dist/api/ServerRegistries.d.ts +0 -1
  17. package/dist/api/ServerRegistries.js +0 -1
  18. package/dist/api/iq-handlers.d.ts +1 -1
  19. package/dist/api/iq-handlers.js +23 -1
  20. package/dist/{cli.d.ts → bin.d.ts} +0 -1
  21. package/dist/bin.js +296 -0
  22. package/dist/esm/api/AppStateSyncManager.js +146 -0
  23. package/dist/esm/api/FakePairingDriver.js +31 -0
  24. package/dist/esm/api/FakePeer.js +610 -0
  25. package/dist/esm/api/FakeServerSession.js +287 -0
  26. package/dist/esm/api/FakeWaServer.js +528 -0
  27. package/dist/esm/api/PreKeyDispenser.js +93 -0
  28. package/dist/esm/api/Scenario.js +32 -0
  29. package/dist/esm/api/ServerRegistries.js +261 -0
  30. package/dist/esm/api/iq-handlers.js +515 -0
  31. package/dist/{cli.js → esm/bin.js} +70 -25
  32. package/dist/esm/index.js +26 -0
  33. package/dist/esm/infra/WaFakeConnection.js +49 -0
  34. package/dist/esm/infra/WaFakeConnectionPipeline.js +235 -0
  35. package/dist/esm/infra/WaFakeFrameSocket.js +117 -0
  36. package/dist/esm/infra/WaFakeMediaHttpsServer.js +126 -0
  37. package/dist/esm/infra/WaFakeNoiseHandshake.js +67 -0
  38. package/dist/esm/infra/WaFakeTransport.js +31 -0
  39. package/dist/esm/infra/WaFakeWsServer.js +96 -0
  40. package/dist/esm/package.json +3 -0
  41. package/dist/esm/protocol/auth/cert-chain.js +50 -0
  42. package/dist/esm/protocol/auth/client-payload-validate.js +55 -0
  43. package/dist/esm/protocol/auth/fake-primary-device.js +47 -0
  44. package/dist/esm/protocol/auth/pair-device.js +87 -0
  45. package/dist/esm/protocol/auth/success-node.js +26 -0
  46. package/dist/esm/protocol/iq/abprops.js +30 -0
  47. package/dist/esm/protocol/iq/appstate-sync.js +146 -0
  48. package/dist/esm/protocol/iq/business.js +59 -0
  49. package/dist/esm/protocol/iq/dirty-bits.js +19 -0
  50. package/dist/esm/protocol/iq/group-ops.js +154 -0
  51. package/dist/esm/protocol/iq/newsletter.js +14 -0
  52. package/dist/esm/protocol/iq/prekey-fetch.js +88 -0
  53. package/dist/esm/protocol/iq/privacy-token.js +26 -0
  54. package/dist/esm/protocol/iq/privacy.js +123 -0
  55. package/dist/esm/protocol/iq/profile.js +72 -0
  56. package/dist/esm/protocol/iq/router.js +117 -0
  57. package/dist/esm/protocol/iq/usync.js +64 -0
  58. package/dist/esm/protocol/push/app-state-key-share.js +26 -0
  59. package/dist/esm/protocol/push/call-failure.js +27 -0
  60. package/dist/esm/protocol/push/chatstate.js +23 -0
  61. package/dist/esm/protocol/push/error-stanza.js +13 -0
  62. package/dist/esm/protocol/push/history-sync.js +111 -0
  63. package/dist/esm/protocol/push/message.js +38 -0
  64. package/dist/esm/protocol/push/notification.js +29 -0
  65. package/dist/esm/protocol/push/presence.js +14 -0
  66. package/dist/esm/protocol/push/receipt.js +21 -0
  67. package/dist/esm/protocol/signal/fake-app-state-crypto.js +196 -0
  68. package/dist/esm/protocol/signal/fake-peer-double-ratchet.js +398 -0
  69. package/dist/esm/protocol/signal/fake-peer-group-recv-session.js +120 -0
  70. package/dist/esm/protocol/signal/fake-peer-identity.js +8 -0
  71. package/dist/esm/protocol/signal/fake-peer-key-bundle.js +25 -0
  72. package/dist/esm/protocol/signal/fake-sender-key.js +83 -0
  73. package/dist/esm/protocol/signal/prekey-upload.js +107 -0
  74. package/dist/esm/protocol/stream/stream-error.js +56 -0
  75. package/dist/esm/state/fake-app-state-collection.js +134 -0
  76. package/dist/esm/state/fake-media-store.js +53 -0
  77. package/dist/esm/transport/codec.js +8 -0
  78. package/dist/esm/transport/crypto.js +8 -0
  79. package/dist/esm/transport/protos.js +7 -0
  80. package/dist/esm/transport/util.js +8 -0
  81. package/dist/index.d.ts +2 -3
  82. package/dist/index.js +2 -2
  83. package/dist/infra/WaFakeConnection.d.ts +0 -1
  84. package/dist/infra/WaFakeConnection.js +0 -1
  85. package/dist/infra/WaFakeConnectionPipeline.d.ts +10 -3
  86. package/dist/infra/WaFakeConnectionPipeline.js +47 -32
  87. package/dist/infra/WaFakeFrameSocket.d.ts +0 -1
  88. package/dist/infra/WaFakeFrameSocket.js +0 -1
  89. package/dist/infra/WaFakeMediaHttpsServer.d.ts +0 -1
  90. package/dist/infra/WaFakeMediaHttpsServer.js +0 -1
  91. package/dist/infra/WaFakeNoiseHandshake.d.ts +8 -10
  92. package/dist/infra/WaFakeNoiseHandshake.js +19 -24
  93. package/dist/infra/WaFakeTransport.d.ts +2 -4
  94. package/dist/infra/WaFakeTransport.js +2 -1
  95. package/dist/infra/WaFakeWsServer.d.ts +0 -1
  96. package/dist/infra/WaFakeWsServer.js +0 -1
  97. package/dist/protocol/auth/cert-chain.d.ts +4 -1
  98. package/dist/protocol/auth/cert-chain.js +13 -3
  99. package/dist/protocol/auth/client-payload-validate.d.ts +0 -1
  100. package/dist/protocol/auth/client-payload-validate.js +0 -1
  101. package/dist/protocol/auth/fake-primary-device.d.ts +0 -1
  102. package/dist/protocol/auth/fake-primary-device.js +1 -3
  103. package/dist/protocol/auth/pair-device.d.ts +0 -1
  104. package/dist/protocol/auth/pair-device.js +4 -16
  105. package/dist/protocol/auth/success-node.d.ts +0 -1
  106. package/dist/protocol/auth/success-node.js +0 -1
  107. package/dist/protocol/iq/abprops.d.ts +0 -1
  108. package/dist/protocol/iq/abprops.js +0 -1
  109. package/dist/protocol/iq/appstate-sync.d.ts +0 -1
  110. package/dist/protocol/iq/appstate-sync.js +0 -1
  111. package/dist/protocol/iq/business.d.ts +0 -1
  112. package/dist/protocol/iq/business.js +0 -1
  113. package/dist/protocol/iq/dirty-bits.d.ts +0 -1
  114. package/dist/protocol/iq/dirty-bits.js +0 -1
  115. package/dist/protocol/iq/group-ops.d.ts +0 -1
  116. package/dist/protocol/iq/group-ops.js +0 -1
  117. package/dist/protocol/iq/newsletter.d.ts +0 -1
  118. package/dist/protocol/iq/newsletter.js +0 -1
  119. package/dist/protocol/iq/prekey-fetch.d.ts +0 -1
  120. package/dist/protocol/iq/prekey-fetch.js +0 -1
  121. package/dist/protocol/iq/privacy-token.d.ts +0 -1
  122. package/dist/protocol/iq/privacy-token.js +0 -1
  123. package/dist/protocol/iq/privacy.d.ts +0 -1
  124. package/dist/protocol/iq/privacy.js +15 -16
  125. package/dist/protocol/iq/profile.d.ts +0 -1
  126. package/dist/protocol/iq/profile.js +0 -1
  127. package/dist/protocol/iq/router.d.ts +7 -2
  128. package/dist/protocol/iq/router.js +8 -3
  129. package/dist/protocol/iq/usync.d.ts +0 -1
  130. package/dist/protocol/iq/usync.js +0 -1
  131. package/dist/protocol/push/app-state-key-share.d.ts +0 -1
  132. package/dist/protocol/push/app-state-key-share.js +0 -1
  133. package/dist/protocol/push/call-failure.d.ts +0 -1
  134. package/dist/protocol/push/call-failure.js +0 -1
  135. package/dist/protocol/push/chatstate.d.ts +0 -1
  136. package/dist/protocol/push/chatstate.js +0 -1
  137. package/dist/protocol/push/error-stanza.d.ts +0 -1
  138. package/dist/protocol/push/error-stanza.js +0 -1
  139. package/dist/protocol/push/history-sync.d.ts +0 -1
  140. package/dist/protocol/push/history-sync.js +0 -1
  141. package/dist/protocol/push/message.d.ts +0 -1
  142. package/dist/protocol/push/message.js +0 -1
  143. package/dist/protocol/push/notification.d.ts +0 -1
  144. package/dist/protocol/push/notification.js +0 -1
  145. package/dist/protocol/push/presence.d.ts +0 -1
  146. package/dist/protocol/push/presence.js +0 -1
  147. package/dist/protocol/push/receipt.d.ts +0 -1
  148. package/dist/protocol/push/receipt.js +0 -1
  149. package/dist/protocol/signal/fake-app-state-crypto.d.ts +7 -9
  150. package/dist/protocol/signal/fake-app-state-crypto.js +31 -33
  151. package/dist/protocol/signal/fake-peer-double-ratchet.d.ts +0 -1
  152. package/dist/protocol/signal/fake-peer-double-ratchet.js +23 -28
  153. package/dist/protocol/signal/fake-peer-group-recv-session.d.ts +0 -1
  154. package/dist/protocol/signal/fake-peer-group-recv-session.js +6 -10
  155. package/dist/protocol/signal/fake-peer-identity.d.ts +0 -1
  156. package/dist/protocol/signal/fake-peer-identity.js +0 -1
  157. package/dist/protocol/signal/fake-peer-key-bundle.d.ts +0 -1
  158. package/dist/protocol/signal/fake-peer-key-bundle.js +0 -1
  159. package/dist/protocol/signal/fake-sender-key.d.ts +0 -1
  160. package/dist/protocol/signal/fake-sender-key.js +5 -9
  161. package/dist/protocol/signal/prekey-upload.d.ts +0 -1
  162. package/dist/protocol/signal/prekey-upload.js +0 -1
  163. package/dist/protocol/stream/stream-error.d.ts +0 -1
  164. package/dist/protocol/stream/stream-error.js +0 -1
  165. package/dist/state/fake-app-state-collection.d.ts +0 -1
  166. package/dist/state/fake-app-state-collection.js +0 -1
  167. package/dist/state/fake-media-store.d.ts +0 -1
  168. package/dist/state/fake-media-store.js +2 -2
  169. package/dist/transport/codec.d.ts +2 -3
  170. package/dist/transport/codec.js +2 -3
  171. package/dist/transport/crypto.d.ts +5 -7
  172. package/dist/transport/crypto.js +6 -11
  173. package/dist/transport/protos.d.ts +2 -4
  174. package/dist/transport/protos.js +2 -4
  175. package/dist/transport/util.d.ts +8 -0
  176. package/dist/transport/util.js +16 -0
  177. package/package.json +26 -6
  178. package/dist/api/AppStateSyncManager.d.ts.map +0 -1
  179. package/dist/api/AppStateSyncManager.js.map +0 -1
  180. package/dist/api/FakePairingDriver.d.ts.map +0 -1
  181. package/dist/api/FakePairingDriver.js.map +0 -1
  182. package/dist/api/FakePeer.d.ts.map +0 -1
  183. package/dist/api/FakePeer.js.map +0 -1
  184. package/dist/api/FakeWaServer.d.ts.map +0 -1
  185. package/dist/api/FakeWaServer.js.map +0 -1
  186. package/dist/api/PreKeyDispenser.d.ts.map +0 -1
  187. package/dist/api/PreKeyDispenser.js.map +0 -1
  188. package/dist/api/Scenario.d.ts.map +0 -1
  189. package/dist/api/Scenario.js.map +0 -1
  190. package/dist/api/ServerRegistries.d.ts.map +0 -1
  191. package/dist/api/ServerRegistries.js.map +0 -1
  192. package/dist/api/iq-handlers.d.ts.map +0 -1
  193. package/dist/api/iq-handlers.js.map +0 -1
  194. package/dist/cli.d.ts.map +0 -1
  195. package/dist/cli.js.map +0 -1
  196. package/dist/index.d.ts.map +0 -1
  197. package/dist/index.js.map +0 -1
  198. package/dist/infra/WaFakeConnection.d.ts.map +0 -1
  199. package/dist/infra/WaFakeConnection.js.map +0 -1
  200. package/dist/infra/WaFakeConnectionPipeline.d.ts.map +0 -1
  201. package/dist/infra/WaFakeConnectionPipeline.js.map +0 -1
  202. package/dist/infra/WaFakeFrameSocket.d.ts.map +0 -1
  203. package/dist/infra/WaFakeFrameSocket.js.map +0 -1
  204. package/dist/infra/WaFakeMediaHttpsServer.d.ts.map +0 -1
  205. package/dist/infra/WaFakeMediaHttpsServer.js.map +0 -1
  206. package/dist/infra/WaFakeNoiseHandshake.d.ts.map +0 -1
  207. package/dist/infra/WaFakeNoiseHandshake.js.map +0 -1
  208. package/dist/infra/WaFakeTransport.d.ts.map +0 -1
  209. package/dist/infra/WaFakeTransport.js.map +0 -1
  210. package/dist/infra/WaFakeWsServer.d.ts.map +0 -1
  211. package/dist/infra/WaFakeWsServer.js.map +0 -1
  212. package/dist/protocol/auth/cert-chain.d.ts.map +0 -1
  213. package/dist/protocol/auth/cert-chain.js.map +0 -1
  214. package/dist/protocol/auth/client-payload-validate.d.ts.map +0 -1
  215. package/dist/protocol/auth/client-payload-validate.js.map +0 -1
  216. package/dist/protocol/auth/fake-primary-device.d.ts.map +0 -1
  217. package/dist/protocol/auth/fake-primary-device.js.map +0 -1
  218. package/dist/protocol/auth/pair-device.d.ts.map +0 -1
  219. package/dist/protocol/auth/pair-device.js.map +0 -1
  220. package/dist/protocol/auth/success-node.d.ts.map +0 -1
  221. package/dist/protocol/auth/success-node.js.map +0 -1
  222. package/dist/protocol/iq/abprops.d.ts.map +0 -1
  223. package/dist/protocol/iq/abprops.js.map +0 -1
  224. package/dist/protocol/iq/appstate-sync.d.ts.map +0 -1
  225. package/dist/protocol/iq/appstate-sync.js.map +0 -1
  226. package/dist/protocol/iq/business.d.ts.map +0 -1
  227. package/dist/protocol/iq/business.js.map +0 -1
  228. package/dist/protocol/iq/dirty-bits.d.ts.map +0 -1
  229. package/dist/protocol/iq/dirty-bits.js.map +0 -1
  230. package/dist/protocol/iq/group-ops.d.ts.map +0 -1
  231. package/dist/protocol/iq/group-ops.js.map +0 -1
  232. package/dist/protocol/iq/newsletter.d.ts.map +0 -1
  233. package/dist/protocol/iq/newsletter.js.map +0 -1
  234. package/dist/protocol/iq/prekey-fetch.d.ts.map +0 -1
  235. package/dist/protocol/iq/prekey-fetch.js.map +0 -1
  236. package/dist/protocol/iq/privacy-token.d.ts.map +0 -1
  237. package/dist/protocol/iq/privacy-token.js.map +0 -1
  238. package/dist/protocol/iq/privacy.d.ts.map +0 -1
  239. package/dist/protocol/iq/privacy.js.map +0 -1
  240. package/dist/protocol/iq/profile.d.ts.map +0 -1
  241. package/dist/protocol/iq/profile.js.map +0 -1
  242. package/dist/protocol/iq/router.d.ts.map +0 -1
  243. package/dist/protocol/iq/router.js.map +0 -1
  244. package/dist/protocol/iq/usync.d.ts.map +0 -1
  245. package/dist/protocol/iq/usync.js.map +0 -1
  246. package/dist/protocol/push/app-state-key-share.d.ts.map +0 -1
  247. package/dist/protocol/push/app-state-key-share.js.map +0 -1
  248. package/dist/protocol/push/call-failure.d.ts.map +0 -1
  249. package/dist/protocol/push/call-failure.js.map +0 -1
  250. package/dist/protocol/push/chatstate.d.ts.map +0 -1
  251. package/dist/protocol/push/chatstate.js.map +0 -1
  252. package/dist/protocol/push/error-stanza.d.ts.map +0 -1
  253. package/dist/protocol/push/error-stanza.js.map +0 -1
  254. package/dist/protocol/push/history-sync.d.ts.map +0 -1
  255. package/dist/protocol/push/history-sync.js.map +0 -1
  256. package/dist/protocol/push/message.d.ts.map +0 -1
  257. package/dist/protocol/push/message.js.map +0 -1
  258. package/dist/protocol/push/notification.d.ts.map +0 -1
  259. package/dist/protocol/push/notification.js.map +0 -1
  260. package/dist/protocol/push/presence.d.ts.map +0 -1
  261. package/dist/protocol/push/presence.js.map +0 -1
  262. package/dist/protocol/push/receipt.d.ts.map +0 -1
  263. package/dist/protocol/push/receipt.js.map +0 -1
  264. package/dist/protocol/signal/fake-app-state-crypto.d.ts.map +0 -1
  265. package/dist/protocol/signal/fake-app-state-crypto.js.map +0 -1
  266. package/dist/protocol/signal/fake-peer-double-ratchet.d.ts.map +0 -1
  267. package/dist/protocol/signal/fake-peer-double-ratchet.js.map +0 -1
  268. package/dist/protocol/signal/fake-peer-group-recv-session.d.ts.map +0 -1
  269. package/dist/protocol/signal/fake-peer-group-recv-session.js.map +0 -1
  270. package/dist/protocol/signal/fake-peer-identity.d.ts.map +0 -1
  271. package/dist/protocol/signal/fake-peer-identity.js.map +0 -1
  272. package/dist/protocol/signal/fake-peer-key-bundle.d.ts.map +0 -1
  273. package/dist/protocol/signal/fake-peer-key-bundle.js.map +0 -1
  274. package/dist/protocol/signal/fake-peer-recv-session.d.ts +0 -60
  275. package/dist/protocol/signal/fake-peer-recv-session.d.ts.map +0 -1
  276. package/dist/protocol/signal/fake-peer-recv-session.js +0 -284
  277. package/dist/protocol/signal/fake-peer-recv-session.js.map +0 -1
  278. package/dist/protocol/signal/fake-peer-session.d.ts +0 -87
  279. package/dist/protocol/signal/fake-peer-session.d.ts.map +0 -1
  280. package/dist/protocol/signal/fake-peer-session.js +0 -207
  281. package/dist/protocol/signal/fake-peer-session.js.map +0 -1
  282. package/dist/protocol/signal/fake-sender-key.d.ts.map +0 -1
  283. package/dist/protocol/signal/fake-sender-key.js.map +0 -1
  284. package/dist/protocol/signal/prekey-upload.d.ts.map +0 -1
  285. package/dist/protocol/signal/prekey-upload.js.map +0 -1
  286. package/dist/protocol/stream/stream-error.d.ts.map +0 -1
  287. package/dist/protocol/stream/stream-error.js.map +0 -1
  288. package/dist/state/fake-app-state-collection.d.ts.map +0 -1
  289. package/dist/state/fake-app-state-collection.js.map +0 -1
  290. package/dist/state/fake-media-store.d.ts.map +0 -1
  291. package/dist/state/fake-media-store.js.map +0 -1
  292. package/dist/transport/codec.d.ts.map +0 -1
  293. package/dist/transport/codec.js.map +0 -1
  294. package/dist/transport/crypto.d.ts.map +0 -1
  295. package/dist/transport/crypto.js.map +0 -1
  296. package/dist/transport/index.d.ts +0 -4
  297. package/dist/transport/index.d.ts.map +0 -1
  298. package/dist/transport/index.js +0 -20
  299. package/dist/transport/index.js.map +0 -1
  300. package/dist/transport/protos.d.ts.map +0 -1
  301. package/dist/transport/protos.js.map +0 -1
@@ -1,126 +1,98 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FakeWaServer = void 0;
3
+ exports.FakeWaServer = exports.FakeServerSession = void 0;
4
4
  const node_https_1 = require("node:https");
5
5
  const WaFakeConnectionPipeline_1 = require("../infra/WaFakeConnectionPipeline");
6
6
  const WaFakeMediaHttpsServer_1 = require("../infra/WaFakeMediaHttpsServer");
7
7
  const WaFakeWsServer_1 = require("../infra/WaFakeWsServer");
8
8
  const cert_chain_1 = require("../protocol/auth/cert-chain");
9
- const router_1 = require("../protocol/iq/router");
10
9
  const fake_media_store_1 = require("../state/fake-media-store");
11
10
  const crypto_1 = require("../transport/crypto");
12
- const AppStateSyncManager_1 = require("./AppStateSyncManager");
13
11
  const FakePairingDriver_1 = require("./FakePairingDriver");
14
12
  const FakePeer_1 = require("./FakePeer");
15
- const iq_handlers_1 = require("./iq-handlers");
16
- const PreKeyDispenser_1 = require("./PreKeyDispenser");
13
+ const FakeServerSession_1 = require("./FakeServerSession");
17
14
  const Scenario_1 = require("./Scenario");
18
- const ServerRegistries_1 = require("./ServerRegistries");
15
+ var FakeServerSession_2 = require("./FakeServerSession");
16
+ Object.defineProperty(exports, "FakeServerSession", { enumerable: true, get: function () { return FakeServerSession_2.FakeServerSession; } });
19
17
  class FakeWaServer {
20
18
  constructor(options = {}) {
21
- this.registries = new ServerRegistries_1.ServerRegistries();
22
- this.preKeyDispenser = new PreKeyDispenser_1.PreKeyDispenser();
23
- this.appStateSync = new AppStateSyncManager_1.AppStateSyncManager();
24
19
  this.pipelines = new Set();
25
- this.iqRouter = new router_1.WaFakeIqRouter();
26
- this.capturedStanzas = [];
27
- this.pendingIqExpectations = new Set();
28
- this.pendingStanzaExpectations = new Set();
20
+ this.pipelineSessions = new WeakMap();
29
21
  this.authenticatedListeners = new Set();
30
- this.inboundStanzaListeners = new Set();
22
+ this.sessions = new Map();
23
+ this.globalIqHandlers = new Set();
31
24
  this.rootCa = null;
32
25
  this.serverStaticKeyPair = null;
33
26
  this.listenInfo = null;
34
- this.pipelineListener = null;
27
+ this.pipelineListeners = new Set();
35
28
  this.rejectMode = null;
36
29
  this.mediaStore = new fake_media_store_1.FakeMediaStore();
37
30
  this.mediaHttpsServer = new WaFakeMediaHttpsServer_1.WaFakeMediaHttpsServer();
38
31
  this.capturedMediaUploads = [];
39
32
  this.nextUploadCounter = 0;
40
33
  this.cachedMediaProxyAgent = null;
34
+ this.options = options;
41
35
  this.wsServer = new WaFakeWsServer_1.WaFakeWsServer(options);
42
36
  this.wsServer.onConnection((connection) => this.handleConnection(connection));
43
- (0, iq_handlers_1.registerDefaultIqHandlers)(this.iqRouter, this.buildIqHandlerDeps());
44
- }
45
- buildIqHandlerDeps() {
46
- const reg = this.registries;
47
- const preKey = this.preKeyDispenser;
48
- const appState = this.appStateSync;
49
- return {
50
- get peerRegistry() {
51
- return reg.peerRegistry;
52
- },
53
- get groupRegistry() {
54
- return reg.groupRegistry;
55
- },
56
- get privacySettings() {
57
- return reg.privacySettings;
58
- },
59
- get blocklistJids() {
60
- return reg.blocklistJids;
61
- },
62
- get profilePicturesByJid() {
63
- return reg.profilePicturesByJid;
64
- },
65
- get businessProfilesByJid() {
66
- return reg.businessProfilesByJid;
67
- },
68
- get abPropsInput() {
69
- return reg.abPropsInput;
70
- },
71
- get issuedPrivacyTokens() {
72
- return reg.issuedPrivacyTokens;
73
- },
74
- get latestStatusText() {
75
- return reg.latestStatusText;
76
- },
77
- setLatestStatusText: (text) => {
78
- reg.latestStatusText = text;
79
- },
80
- lookupDeviceIdsForUser: (userJid) => reg.lookupDeviceIdsForUser(userJid),
81
- notifyGroupOp: (op) => reg.notifyGroupOp(op),
82
- mutatePrivacySettings: (category, value) => reg.mutatePrivacySettings(category, value),
83
- mutateBlocklist: (action, jid) => reg.mutateBlocklist(action, jid),
84
- notifyProfilePictureSet: (op) => reg.notifyProfilePictureSet(op),
85
- handleProfilePictureSet: (targetJid, newId) => reg.handleProfilePictureSet(targetJid, newId),
86
- notifyStatusSet: (text) => reg.notifyStatusSet(text),
87
- notifyLogout: () => reg.notifyLogout(),
88
- notifyPrivacyTokenIssue: (token) => reg.notifyPrivacyTokenIssue(token),
89
- notifyDirtyBitsClear: (op) => reg.notifyDirtyBitsClear(op),
90
- notifyPrivacySet: (change) => {
91
- for (const listener of reg.privacySetListeners) {
92
- try {
93
- listener(change);
94
- }
95
- catch (error) {
96
- void error;
97
- }
98
- }
99
- },
100
- notifyBlocklistChange: (change) => {
101
- for (const listener of reg.blocklistChangeListeners) {
102
- try {
103
- listener(change);
104
- }
105
- catch (error) {
106
- void error;
107
- }
108
- }
109
- },
110
- capturePreKeyBundle: (bundle) => preKey.captureBundle(bundle),
111
- consumeOutboundAppStatePatches: (iq) => appState.consumeOutboundAppStatePatches(iq),
112
- get appStateCollectionProviders() {
113
- return appState.appStateCollectionProviders;
114
- },
115
- requireMediaHttpsInfo: () => this.requireMediaHttpsInfo()
116
- };
37
+ this.defaultSession = this.createSession('__default__');
38
+ }
39
+ /** State of the single default session (the only session for one client). */
40
+ get registries() {
41
+ return this.defaultSession.registries;
42
+ }
43
+ get preKeyDispenser() {
44
+ return this.defaultSession.preKeyDispenser;
45
+ }
46
+ get appStateSync() {
47
+ return this.defaultSession.appStateSync;
48
+ }
49
+ /**
50
+ * Returns the isolated session for `id`, creating it on first use. Every
51
+ * session gets its own registries, prekey dispenser, app-state, IQ router,
52
+ * and stanza capture. Use with the `sessionKey` option to run several
53
+ * `WaClient`s against one server without them sharing any state.
54
+ */
55
+ session(id) {
56
+ const existing = this.sessions.get(id);
57
+ if (existing) {
58
+ return existing;
59
+ }
60
+ return this.createSession(id);
61
+ }
62
+ /** The session a connection is bound to (default before authentication). */
63
+ sessionFor(pipeline) {
64
+ return this.pipelineSessions.get(pipeline) ?? this.defaultSession;
65
+ }
66
+ createSession(id) {
67
+ const session = new FakeServerSession_1.FakeServerSession(id, { requireMediaHttpsInfo: () => this.requireMediaHttpsInfo() }, { defaultIqHandlers: this.options.defaultIqHandlers !== false });
68
+ this.sessions.set(id, session);
69
+ // Server-level custom handlers apply to every session, present and future.
70
+ for (const handler of this.globalIqHandlers) {
71
+ handler.unregisterBySession.set(session, session.registerIqHandler(handler.matcher, handler.respond, handler.label));
72
+ }
73
+ return session;
117
74
  }
118
75
  registerIqHandler(matcher, respond, label) {
119
- const handler = { matcher, respond, label };
120
- return this.iqRouter.register(handler, { priority: 'high' });
76
+ const entry = {
77
+ matcher,
78
+ respond,
79
+ label,
80
+ unregisterBySession: new Map()
81
+ };
82
+ for (const session of this.sessions.values()) {
83
+ entry.unregisterBySession.set(session, session.registerIqHandler(matcher, respond, label));
84
+ }
85
+ this.globalIqHandlers.add(entry);
86
+ return () => {
87
+ for (const unregister of entry.unregisterBySession.values()) {
88
+ unregister();
89
+ }
90
+ entry.unregisterBySession.clear();
91
+ this.globalIqHandlers.delete(entry);
92
+ };
121
93
  }
122
94
  async routeIqForTest(iq) {
123
- return this.iqRouter.route(iq);
95
+ return this.defaultSession.routeIq(iq);
124
96
  }
125
97
  onOutboundGroupOp(listener) {
126
98
  return this.registries.onOutboundGroupOp(listener);
@@ -177,7 +149,7 @@ class FakeWaServer {
177
149
  return this.registries.createFakeGroup(input);
178
150
  }
179
151
  async triggerPreKeyUpload(pipeline, options = {}) {
180
- return this.preKeyDispenser.triggerPreKeyUpload(pipeline, options);
152
+ return this.sessionFor(pipeline).preKeyDispenser.triggerPreKeyUpload(pipeline, options);
181
153
  }
182
154
  awaitPreKeyBundle(timeoutMs = 15000) {
183
155
  return this.preKeyDispenser.awaitPreKeyBundle(timeoutMs);
@@ -207,7 +179,7 @@ class FakeWaServer {
207
179
  return this.appStateSync.provideAppStateCollection(name, provider);
208
180
  }
209
181
  async pushServerSyncNotification(pipeline, input) {
210
- return this.appStateSync.pushServerSyncNotification(pipeline, input);
182
+ return this.sessionFor(pipeline).appStateSync.pushServerSyncNotification(pipeline, input);
211
183
  }
212
184
  onAuthenticatedPipeline(listener) {
213
185
  this.authenticatedListeners.add(listener);
@@ -217,63 +189,24 @@ class FakeWaServer {
217
189
  configure(new Scenario_1.Scenario(this));
218
190
  }
219
191
  expectIq(matcher, options = {}) {
220
- const timeoutMs = options.timeoutMs ?? 2000;
221
- for (const captured of this.capturedStanzas) {
222
- if (matchesIq(captured, matcher)) {
223
- return Promise.resolve(captured);
224
- }
225
- }
226
- return new Promise((resolve, reject) => {
227
- const expectation = {
228
- matcher,
229
- resolve: (iq) => {
230
- this.pendingIqExpectations.delete(expectation);
231
- clearTimeout(expectation.timer);
232
- resolve(iq);
233
- },
234
- reject: (error) => {
235
- this.pendingIqExpectations.delete(expectation);
236
- clearTimeout(expectation.timer);
237
- reject(error);
238
- },
239
- timer: setTimeout(() => {
240
- this.pendingIqExpectations.delete(expectation);
241
- reject(new Error(`expectIq timed out after ${timeoutMs}ms (${describeMatcher(matcher)})`));
242
- }, timeoutMs)
243
- };
244
- this.pendingIqExpectations.add(expectation);
245
- });
192
+ return this.defaultSession.expectIq(matcher, options);
246
193
  }
247
194
  capturedStanzaSnapshot() {
248
- return this.capturedStanzas.slice();
195
+ return this.defaultSession.capturedStanzaSnapshot();
196
+ }
197
+ /**
198
+ * Subscribes to every stanza captured from the client side (the lib) of
199
+ * the default session. The listener is called synchronously for each new
200
+ * stanza as it arrives. Returns an unsubscribe function. Useful for
201
+ * benches that need to count or react to a stream of receipts/messages
202
+ * without paying the O(N²) cost of polling `capturedStanzaSnapshot()` or
203
+ * queuing one `expectStanza(...)` per iteration.
204
+ */
205
+ onCapturedStanza(listener) {
206
+ return this.defaultSession.onCapturedStanza(listener);
249
207
  }
250
208
  expectStanza(matcher, options = {}) {
251
- const timeoutMs = options.timeoutMs ?? 2000;
252
- for (const captured of this.capturedStanzas) {
253
- if (matchesStanza(captured, matcher)) {
254
- return Promise.resolve(captured);
255
- }
256
- }
257
- return new Promise((resolve, reject) => {
258
- const expectation = {
259
- matcher,
260
- resolve: (node) => {
261
- this.pendingStanzaExpectations.delete(expectation);
262
- clearTimeout(expectation.timer);
263
- resolve(node);
264
- },
265
- reject: (error) => {
266
- this.pendingStanzaExpectations.delete(expectation);
267
- clearTimeout(expectation.timer);
268
- reject(error);
269
- },
270
- timer: setTimeout(() => {
271
- this.pendingStanzaExpectations.delete(expectation);
272
- reject(new Error(`expectStanza timed out after ${timeoutMs}ms (${describeStanzaMatcher(matcher)})`));
273
- }, timeoutMs)
274
- };
275
- this.pendingStanzaExpectations.add(expectation);
276
- });
209
+ return this.defaultSession.expectStanza(matcher, options);
277
210
  }
278
211
  async broadcastStanza(node) {
279
212
  const tasks = [];
@@ -318,7 +251,16 @@ class FakeWaServer {
318
251
  }
319
252
  get mediaProxyAgent() {
320
253
  if (!this.cachedMediaProxyAgent) {
321
- this.cachedMediaProxyAgent = new node_https_1.Agent({ rejectUnauthorized: false });
254
+ // keepAlive is required for representative perf measurements
255
+ // and matches what real-world WhatsApp clients do – every
256
+ // media upload/download would otherwise pay a full TLS
257
+ // handshake. The `src/media/__tests__/media.test.ts` fixtures
258
+ // and a production-quality `proxy.mediaUpload` configuration
259
+ // all set this; mirroring it here keeps benches in line.
260
+ this.cachedMediaProxyAgent = new node_https_1.Agent({
261
+ rejectUnauthorized: false,
262
+ keepAlive: true
263
+ });
322
264
  }
323
265
  return this.cachedMediaProxyAgent;
324
266
  }
@@ -326,8 +268,9 @@ class FakeWaServer {
326
268
  return this.capturedMediaUploads.slice();
327
269
  }
328
270
  async createFakePeer(options, pipeline) {
329
- const peer = await FakePeer_1.FakePeer.create(options, this.buildFakePeerDeps(pipeline));
330
- this.registries.registerPeer(peer);
271
+ const session = this.sessionFor(pipeline);
272
+ const peer = await FakePeer_1.FakePeer.create(options, this.buildFakePeerDeps(pipeline, session));
273
+ session.registries.registerPeer(peer);
331
274
  return peer;
332
275
  }
333
276
  async createFakePeerWithDevices(input, pipeline) {
@@ -340,6 +283,7 @@ class FakeWaServer {
340
283
  }
341
284
  const userPart = input.userJid.slice(0, atIdx);
342
285
  const server = input.userJid.slice(atIdx + 1);
286
+ const session = this.sessionFor(pipeline);
343
287
  const peers = [];
344
288
  for (const deviceId of input.deviceIds) {
345
289
  const deviceJid = deviceId === 0 ? input.userJid : `${userPart}:${deviceId}@${server}`;
@@ -347,36 +291,27 @@ class FakeWaServer {
347
291
  jid: deviceJid,
348
292
  displayName: input.displayName,
349
293
  skipOneTimePreKey: input.skipOneTimePreKey
350
- }, this.buildFakePeerDeps(pipeline));
351
- this.registries.registerPeer(peer);
294
+ }, this.buildFakePeerDeps(pipeline, session));
295
+ session.registries.registerPeer(peer);
352
296
  peers.push(peer);
353
297
  }
354
298
  return peers;
355
299
  }
356
- buildFakePeerDeps(pipeline) {
300
+ buildFakePeerDeps(pipeline, session) {
357
301
  return {
358
- bundleResolver: () => this.preKeyDispenser.awaitPreKeyBundle(),
359
- reserveOneTimePreKey: () => this.preKeyDispenser.dispenseOneTimePreKey(),
302
+ bundleResolver: () => session.preKeyDispenser.awaitPreKeyBundle(),
303
+ reserveOneTimePreKey: () => session.preKeyDispenser.dispenseOneTimePreKey(),
360
304
  pushStanza: (stanza) => pipeline.sendStanza(stanza),
361
- subscribeInboundMessages: (listener) => {
362
- const wrapped = (node) => {
363
- if (node.tag !== 'message')
364
- return;
365
- listener(node);
366
- };
367
- this.inboundStanzaListeners.add(wrapped);
368
- return () => {
369
- this.inboundStanzaListeners.delete(wrapped);
370
- };
371
- }
305
+ subscribeInboundMessages: (listener) => session.subscribeInboundMessages(listener)
372
306
  };
373
307
  }
374
308
  async runPairing(pipeline, options, companionMaterialResolver) {
309
+ const session = this.sessionFor(pipeline);
375
310
  const driver = new FakePairingDriver_1.FakePairingDriver(options, {
376
311
  pipeline,
377
312
  companionMaterialResolver,
378
313
  waitForPairDeviceAck: async (pairDeviceIqId) => {
379
- await this.expectIq({
314
+ await session.expectIq({
380
315
  id: pairDeviceIqId
381
316
  }, {
382
317
  timeoutMs: 15000
@@ -413,8 +348,15 @@ class FakeWaServer {
413
348
  const root = this.requireRootCa();
414
349
  return { publicKey: root.publicKey, serial: root.serial };
415
350
  }
351
+ /**
352
+ * Subscribes to every new connection pipeline (pre-auth). Listeners
353
+ * fan out; returns an unsubscribe function.
354
+ */
416
355
  onPipeline(listener) {
417
- this.pipelineListener = listener;
356
+ this.pipelineListeners.add(listener);
357
+ return () => {
358
+ this.pipelineListeners.delete(listener);
359
+ };
418
360
  }
419
361
  async listen() {
420
362
  if (this.listenInfo) {
@@ -456,45 +398,51 @@ class FakeWaServer {
456
398
  connection,
457
399
  rootCa: this.rootCa,
458
400
  serverStaticKeyPair: this.serverStaticKeyPair,
459
- iqRouter: this.iqRouter
401
+ routeIq: (node) => this.sessionFor(pipeline).routeIq(node),
402
+ ...(this.options.successNodeAttributes !== undefined
403
+ ? { successNodeAttributes: this.options.successNodeAttributes }
404
+ : {})
460
405
  });
461
406
  this.pipelines.add(pipeline);
407
+ this.pipelineSessions.set(pipeline, this.defaultSession);
462
408
  pipeline.setEvents({
463
409
  onAuthenticated: () => {
410
+ this.bindPipelineSession(pipeline);
464
411
  for (const listener of this.authenticatedListeners) {
465
- void listener(pipeline);
412
+ try {
413
+ void Promise.resolve(listener(pipeline)).catch(() => undefined);
414
+ }
415
+ catch {
416
+ /* ignore */
417
+ }
466
418
  }
467
419
  },
468
- onStanza: (node) => this.handleCapturedStanza(node),
420
+ onStanza: (node) => this.sessionFor(pipeline).handleCapturedStanza(node),
469
421
  onClose: () => this.pipelines.delete(pipeline)
470
422
  });
471
- this.pipelineListener?.(pipeline);
472
- }
473
- handleCapturedStanza(node) {
474
- this.capturedStanzas.push(node);
475
- for (const listener of this.inboundStanzaListeners) {
423
+ for (const listener of this.pipelineListeners) {
476
424
  try {
477
- listener(node);
425
+ void Promise.resolve(listener(pipeline)).catch(() => undefined);
478
426
  }
479
- catch (error) {
480
- void error;
427
+ catch {
428
+ /* ignore */
481
429
  }
482
430
  }
483
- for (const expectation of this.pendingStanzaExpectations) {
484
- if (matchesStanza(node, expectation.matcher)) {
485
- expectation.resolve(node);
486
- break;
487
- }
488
- }
489
- if (node.tag !== 'iq') {
431
+ }
432
+ /**
433
+ * Rebinds a connection to its keyed session once authenticated. Runs
434
+ * before user `onAuthenticated` listeners and before any client stanza, so
435
+ * captures and IQ routing land in the right session from the first frame.
436
+ * No-op without a `sessionKey` resolver (single default session).
437
+ */
438
+ bindPipelineSession(pipeline) {
439
+ const resolveKey = this.options.sessionKey;
440
+ const clientPayload = pipeline.clientPayload;
441
+ if (!resolveKey || !clientPayload) {
490
442
  return;
491
443
  }
492
- for (const expectation of this.pendingIqExpectations) {
493
- if (matchesIq(node, expectation.matcher)) {
494
- expectation.resolve(node);
495
- return;
496
- }
497
- }
444
+ const id = resolveKey({ clientPayload, pipeline });
445
+ this.pipelineSessions.set(pipeline, this.session(id));
498
446
  }
499
447
  buildMediaRequestHandler() {
500
448
  return (req, res) => {
@@ -583,70 +531,3 @@ function parseQueryParam(query, name) {
583
531
  }
584
532
  return undefined;
585
533
  }
586
- function matchesIq(iq, matcher) {
587
- if (iq.tag !== 'iq')
588
- return false;
589
- if (matcher.id !== undefined && iq.attrs.id !== matcher.id)
590
- return false;
591
- if (matcher.type !== undefined && iq.attrs.type !== matcher.type)
592
- return false;
593
- if (matcher.xmlns !== undefined && iq.attrs.xmlns !== matcher.xmlns)
594
- return false;
595
- if (matcher.childTag !== undefined) {
596
- const children = Array.isArray(iq.content) ? iq.content : null;
597
- if (!children || children.length === 0)
598
- return false;
599
- if (children[0].tag !== matcher.childTag)
600
- return false;
601
- }
602
- return true;
603
- }
604
- function describeMatcher(matcher) {
605
- const parts = [];
606
- if (matcher.id !== undefined)
607
- parts.push(`id=${matcher.id}`);
608
- if (matcher.type !== undefined)
609
- parts.push(`type=${matcher.type}`);
610
- if (matcher.xmlns !== undefined)
611
- parts.push(`xmlns=${matcher.xmlns}`);
612
- if (matcher.childTag !== undefined)
613
- parts.push(`childTag=${matcher.childTag}`);
614
- return parts.length > 0 ? parts.join(', ') : 'any iq';
615
- }
616
- function matchesStanza(node, matcher) {
617
- if (matcher.tag !== undefined && node.tag !== matcher.tag)
618
- return false;
619
- if (matcher.type !== undefined && node.attrs.type !== matcher.type)
620
- return false;
621
- if (matcher.xmlns !== undefined && node.attrs.xmlns !== matcher.xmlns)
622
- return false;
623
- if (matcher.from !== undefined && node.attrs.from !== matcher.from)
624
- return false;
625
- if (matcher.to !== undefined && node.attrs.to !== matcher.to)
626
- return false;
627
- if (matcher.childTag !== undefined) {
628
- const children = Array.isArray(node.content) ? node.content : null;
629
- if (!children || children.length === 0)
630
- return false;
631
- if (children[0].tag !== matcher.childTag)
632
- return false;
633
- }
634
- return true;
635
- }
636
- function describeStanzaMatcher(matcher) {
637
- const parts = [];
638
- if (matcher.tag !== undefined)
639
- parts.push(`tag=${matcher.tag}`);
640
- if (matcher.type !== undefined)
641
- parts.push(`type=${matcher.type}`);
642
- if (matcher.xmlns !== undefined)
643
- parts.push(`xmlns=${matcher.xmlns}`);
644
- if (matcher.from !== undefined)
645
- parts.push(`from=${matcher.from}`);
646
- if (matcher.to !== undefined)
647
- parts.push(`to=${matcher.to}`);
648
- if (matcher.childTag !== undefined)
649
- parts.push(`childTag=${matcher.childTag}`);
650
- return parts.length > 0 ? parts.join(', ') : 'any stanza';
651
- }
652
- //# sourceMappingURL=FakeWaServer.js.map
@@ -20,4 +20,3 @@ export declare class PreKeyDispenser {
20
20
  readonly force?: boolean;
21
21
  } | number): Promise<ClientPreKeyBundle>;
22
22
  }
23
- //# sourceMappingURL=PreKeyDispenser.d.ts.map
@@ -95,4 +95,3 @@ class PreKeyDispenser {
95
95
  }
96
96
  }
97
97
  exports.PreKeyDispenser = PreKeyDispenser;
98
- //# sourceMappingURL=PreKeyDispenser.js.map
@@ -21,4 +21,3 @@ export declare class IqExpectation {
21
21
  respond(responder: WaFakeIqResponder): this;
22
22
  respondOnce(response: BinaryNode | WaFakeIqResponder): this;
23
23
  }
24
- //# sourceMappingURL=Scenario.d.ts.map
@@ -35,4 +35,3 @@ class IqExpectation {
35
35
  }
36
36
  }
37
37
  exports.IqExpectation = IqExpectation;
38
- //# sourceMappingURL=Scenario.js.map
@@ -107,4 +107,3 @@ export declare class ServerRegistries {
107
107
  notifyDirtyBitsClear(op: CapturedDirtyBitsClear): void;
108
108
  handleProfilePictureSet(targetJid: string, newId: string): void;
109
109
  }
110
- //# sourceMappingURL=ServerRegistries.d.ts.map
@@ -265,4 +265,3 @@ class ServerRegistries {
265
265
  }
266
266
  }
267
267
  exports.ServerRegistries = ServerRegistries;
268
- //# sourceMappingURL=ServerRegistries.js.map
@@ -34,6 +34,7 @@ export interface IqHandlerDeps {
34
34
  notifyPrivacySet(change: CapturedPrivacySet): void;
35
35
  notifyBlocklistChange(change: CapturedBlocklistChange): void;
36
36
  capturePreKeyBundle(bundle: ClientPreKeyBundle): void;
37
+ countServerPreKeys(): number;
37
38
  consumeOutboundAppStatePatches(iq: BinaryNode): Promise<void>;
38
39
  readonly appStateCollectionProviders: ReadonlyMap<string, () => Promise<FakeAppStateCollectionPayload | null> | FakeAppStateCollectionPayload | null>;
39
40
  requireMediaHttpsInfo(): {
@@ -44,4 +45,3 @@ export interface IqHandlerDeps {
44
45
  export declare function parseUsyncRequestedUserJids(iq: BinaryNode): readonly string[];
45
46
  export declare function parseRequestedKeyJids(iq: BinaryNode): readonly string[];
46
47
  export declare function registerDefaultIqHandlers(router: WaFakeIqRouter, deps: IqHandlerDeps): void;
47
- //# sourceMappingURL=iq-handlers.d.ts.map
@@ -98,6 +98,29 @@ function registerDefaultIqHandlers(router, deps) {
98
98
  matcher: { xmlns: 'encrypt', type: 'get', childTag: 'digest' },
99
99
  respond: (iq) => (0, router_1.buildIqError)(iq, { code: 404, text: 'item-not-found' })
100
100
  });
101
+ // Baileys-family and whatsmeow clients block on this query before
102
+ // reporting the connection as open; zapo-js uses <digest> instead.
103
+ router.register({
104
+ label: 'prekey-count',
105
+ matcher: { xmlns: 'encrypt', type: 'get', childTag: 'count' },
106
+ respond: (iq) => {
107
+ const result = (0, router_1.buildIqResult)(iq);
108
+ return {
109
+ ...result,
110
+ content: [
111
+ {
112
+ tag: 'count',
113
+ attrs: { value: String(deps.countServerPreKeys()) }
114
+ }
115
+ ]
116
+ };
117
+ }
118
+ });
119
+ router.register({
120
+ label: 'passive-mode',
121
+ matcher: { xmlns: 'passive', type: 'set' },
122
+ respond: (iq) => (0, router_1.buildIqResult)(iq)
123
+ });
101
124
  router.register({
102
125
  label: 'media-conn',
103
126
  matcher: { xmlns: 'w:m', type: 'set', childTag: 'media_conn' },
@@ -495,4 +518,3 @@ function registerDefaultIqHandlers(router, deps) {
495
518
  respond: (iq) => (0, router_1.buildIqResult)(iq)
496
519
  });
497
520
  }
498
- //# sourceMappingURL=iq-handlers.js.map
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  /** Standalone CLI for `@zapo-js/fake-server`. */
3
3
  export {};
4
- //# sourceMappingURL=cli.d.ts.map