jspurefix 1.1.2 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (602) hide show
  1. package/.travis.yml +1 -1
  2. package/README.md +48 -2
  3. package/appveyor.yml +43 -11
  4. package/data/FIX44-MD.xml +6596 -0
  5. package/data/examples/FIX.4.4/jsfix.test_client.txt +15 -13
  6. package/data/session/test-qf44-acceptor.json +21 -0
  7. package/data/session/test-qf44-initiator.json +22 -0
  8. package/dist/buffer/ascii/ascii-encoder.d.ts +9 -2
  9. package/dist/buffer/ascii/ascii-encoder.js +72 -31
  10. package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
  11. package/dist/buffer/ascii/ascii-parser.d.ts +1 -0
  12. package/dist/buffer/ascii/ascii-parser.js +7 -1
  13. package/dist/buffer/ascii/ascii-parser.js.map +1 -1
  14. package/dist/buffer/ascii/ascii-segment-parser.d.ts +0 -2
  15. package/dist/buffer/ascii/ascii-segment-parser.js +19 -25
  16. package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
  17. package/dist/buffer/ascii/ascii-view.d.ts +2 -0
  18. package/dist/buffer/ascii/ascii-view.js +4 -0
  19. package/dist/buffer/ascii/ascii-view.js.map +1 -1
  20. package/dist/buffer/ascii/time-formatter.js.map +1 -1
  21. package/dist/buffer/ascii-chars.d.ts +1 -0
  22. package/dist/buffer/ascii-chars.js +1 -0
  23. package/dist/buffer/ascii-chars.js.map +1 -1
  24. package/dist/buffer/elastic-buffer.d.ts +1 -0
  25. package/dist/buffer/elastic-buffer.js +8 -0
  26. package/dist/buffer/elastic-buffer.js.map +1 -1
  27. package/dist/buffer/encode-proxy.js.map +1 -1
  28. package/dist/buffer/fixml/fixml-encoder.d.ts +3 -0
  29. package/dist/buffer/fixml/fixml-encoder.js +6 -0
  30. package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
  31. package/dist/buffer/fixml/fixml-view.d.ts +2 -0
  32. package/dist/buffer/fixml/fixml-view.js +3 -0
  33. package/dist/buffer/fixml/fixml-view.js.map +1 -1
  34. package/dist/buffer/msg-encoder.d.ts +2 -0
  35. package/dist/buffer/msg-encoder.js.map +1 -1
  36. package/dist/buffer/msg-view.d.ts +2 -0
  37. package/dist/buffer/msg-view.js.map +1 -1
  38. package/dist/buffer/tags.js +5 -5
  39. package/dist/buffer/tags.js.map +1 -1
  40. package/dist/collections/dictionary.d.ts +1 -0
  41. package/dist/collections/dictionary.js +5 -0
  42. package/dist/collections/dictionary.js.map +1 -1
  43. package/dist/config/js-fix-config.d.ts +2 -0
  44. package/dist/config/js-fix-config.js +1 -0
  45. package/dist/config/js-fix-config.js.map +1 -1
  46. package/dist/dict-parser.js +2 -2
  47. package/dist/dict-parser.js.map +1 -1
  48. package/dist/dictionary/parser/quickfix/field-set-parser.js +11 -4
  49. package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
  50. package/dist/dictionary/parser/quickfix/message-parser.js +4 -0
  51. package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
  52. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -0
  53. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +15 -0
  54. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
  55. package/dist/jsfix-cmd.js +2 -1
  56. package/dist/jsfix-cmd.js.map +1 -1
  57. package/dist/sample/http/oms/app.js +2 -0
  58. package/dist/sample/http/oms/app.js.map +1 -1
  59. package/dist/sample/launcher.d.ts +3 -2
  60. package/dist/sample/launcher.js +12 -3
  61. package/dist/sample/launcher.js.map +1 -1
  62. package/dist/sample/tcp/{trade_capture → qf-md}/app.d.ts +0 -0
  63. package/dist/sample/tcp/qf-md/app.js +22 -0
  64. package/dist/sample/tcp/qf-md/app.js.map +1 -0
  65. package/dist/sample/tcp/qf-md/md-client.d.ts +15 -0
  66. package/dist/sample/tcp/qf-md/md-client.js +42 -0
  67. package/dist/sample/tcp/qf-md/md-client.js.map +1 -0
  68. package/dist/sample/tcp/qf-md/md-factory.d.ts +4 -0
  69. package/dist/sample/tcp/qf-md/md-factory.js +35 -0
  70. package/dist/sample/tcp/qf-md/md-factory.js.map +1 -0
  71. package/dist/sample/tcp/qf-md/md-server.d.ts +16 -0
  72. package/dist/sample/tcp/qf-md/md-server.js +44 -0
  73. package/dist/sample/tcp/qf-md/md-server.js.map +1 -0
  74. package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -0
  75. package/dist/sample/tcp/recovering-skeleton/app.js +27 -0
  76. package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -0
  77. package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +2 -0
  78. package/dist/sample/tcp/recovering-skeleton/respawn-2.js +3 -0
  79. package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +1 -0
  80. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +7 -0
  81. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +52 -0
  82. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -0
  83. package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +16 -0
  84. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +45 -0
  85. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -0
  86. package/dist/sample/tcp/recovering-skeleton/skeleton-server.d.ts +16 -0
  87. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +52 -0
  88. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -0
  89. package/dist/sample/tcp/skeleton/app.js +2 -0
  90. package/dist/sample/tcp/skeleton/app.js.map +1 -1
  91. package/dist/sample/tcp/skeleton/skeleton-session.d.ts +5 -1
  92. package/dist/sample/tcp/skeleton/skeleton-session.js +22 -3
  93. package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
  94. package/dist/sample/tcp/tls-trade-capture/app.js +1 -1
  95. package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
  96. package/dist/sample/tcp/trade-capture/app.d.ts +1 -0
  97. package/dist/sample/tcp/{trade_capture → trade-capture}/app.js +0 -0
  98. package/dist/sample/tcp/{trade_capture → trade-capture}/app.js.map +1 -1
  99. package/dist/sample/tcp/{trade_capture → trade-capture}/index.d.ts +0 -0
  100. package/dist/sample/tcp/{trade_capture → trade-capture}/index.js +0 -0
  101. package/dist/sample/tcp/{trade_capture → trade-capture}/index.js.map +1 -1
  102. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.d.ts +1 -0
  103. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.js +8 -4
  104. package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -0
  105. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.d.ts +0 -0
  106. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.js +1 -1
  107. package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -0
  108. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.d.ts +0 -0
  109. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.js +0 -0
  110. package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.js.map +1 -1
  111. package/dist/store/fix-msg-ascii-store-resend.d.ts +6 -2
  112. package/dist/store/fix-msg-ascii-store-resend.js +49 -22
  113. package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
  114. package/dist/store/fix-msg-memory-store.d.ts +11 -8
  115. package/dist/store/fix-msg-memory-store.js +108 -42
  116. package/dist/store/fix-msg-memory-store.js.map +1 -1
  117. package/dist/store/fix-msg-store-record.d.ts +7 -3
  118. package/dist/store/fix-msg-store-record.js +5 -1
  119. package/dist/store/fix-msg-store-record.js.map +1 -1
  120. package/dist/store/fix-msg-store.d.ts +13 -9
  121. package/dist/store/fix-msg-store.js.map +1 -1
  122. package/dist/test/ascii-encode.test.js +20 -3
  123. package/dist/test/ascii-encode.test.js.map +1 -1
  124. package/dist/test/ascii-encoder.test.d.ts +1 -0
  125. package/dist/test/ascii-encoder.test.js +505 -0
  126. package/dist/test/ascii-encoder.test.js.map +1 -0
  127. package/dist/test/ascii-parser.test.js +8 -6
  128. package/dist/test/ascii-parser.test.js.map +1 -1
  129. package/dist/test/ascii-segment.test.js +6 -5
  130. package/dist/test/ascii-segment.test.js.map +1 -1
  131. package/dist/test/ascii-store-replay.test.js +59 -44
  132. package/dist/test/ascii-store-replay.test.js.map +1 -1
  133. package/dist/test/logon.test.js +1 -1
  134. package/dist/test/logon.test.js.map +1 -1
  135. package/dist/test/memory-store.test.js +24 -19
  136. package/dist/test/memory-store.test.js.map +1 -1
  137. package/dist/test/qf-full-msg.test.js +19 -14
  138. package/dist/test/qf-full-msg.test.js.map +1 -1
  139. package/dist/test/repo-full-ascii-msg.test.js +17 -15
  140. package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
  141. package/dist/test/repo-full-fixml-msg.test.js +14 -14
  142. package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
  143. package/dist/test/session-state.test.js +2 -2
  144. package/dist/test/session-state.test.js.map +1 -1
  145. package/dist/test/session.test.js +263 -143
  146. package/dist/test/session.test.js.map +1 -1
  147. package/dist/test/view-decode.test.js +2 -1
  148. package/dist/test/view-decode.test.js.map +1 -1
  149. package/dist/transport/a-session-msg-factory.d.ts +23 -0
  150. package/dist/transport/a-session-msg-factory.js +58 -0
  151. package/dist/transport/a-session-msg-factory.js.map +1 -0
  152. package/dist/transport/ascii/ascii-msg-transmitter.d.ts +1 -0
  153. package/dist/transport/ascii/ascii-msg-transmitter.js +39 -8
  154. package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
  155. package/dist/transport/ascii/ascii-session-msg-factory.d.ts +16 -0
  156. package/dist/transport/ascii/ascii-session-msg-factory.js +47 -0
  157. package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -0
  158. package/dist/transport/ascii/ascii-session.d.ts +10 -2
  159. package/dist/transport/ascii/ascii-session.js +86 -31
  160. package/dist/transport/ascii/ascii-session.js.map +1 -1
  161. package/dist/transport/ascii/index.d.ts +1 -0
  162. package/dist/transport/ascii/index.js +1 -0
  163. package/dist/transport/ascii/index.js.map +1 -1
  164. package/dist/transport/ascii-session-msg-factory.d.ts +16 -0
  165. package/dist/transport/ascii-session-msg-factory.js +47 -0
  166. package/dist/transport/ascii-session-msg-factory.js.map +1 -0
  167. package/dist/transport/duplex/http-duplex.js +2 -2
  168. package/dist/transport/duplex/http-duplex.js.map +1 -1
  169. package/dist/transport/fix-msg-factory.d.ts +1 -1
  170. package/dist/transport/fix-msg-factory.js.map +1 -1
  171. package/dist/transport/fix-session-state.d.ts +38 -12
  172. package/dist/transport/fix-session-state.js +49 -15
  173. package/dist/transport/fix-session-state.js.map +1 -1
  174. package/dist/transport/fix-session.d.ts +13 -6
  175. package/dist/transport/fix-session.js +143 -39
  176. package/dist/transport/fix-session.js.map +1 -1
  177. package/dist/transport/fixml/fixml-session-msg-factory.d.ts +13 -0
  178. package/dist/transport/fixml/fixml-session-msg-factory.js +68 -0
  179. package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -0
  180. package/dist/transport/fixml/fixml-session.js +1 -1
  181. package/dist/transport/fixml/fixml-session.js.map +1 -1
  182. package/dist/transport/fixml/index.d.ts +2 -1
  183. package/dist/transport/fixml/index.js +2 -1
  184. package/dist/transport/fixml/index.js.map +1 -1
  185. package/dist/transport/fixml-session-msg-factory.d.ts +13 -0
  186. package/dist/transport/fixml-session-msg-factory.js +68 -0
  187. package/dist/transport/fixml-session-msg-factory.js.map +1 -0
  188. package/dist/transport/http/http-acceptor.js +8 -7
  189. package/dist/transport/http/http-acceptor.js.map +1 -1
  190. package/dist/transport/index.d.ts +1 -1
  191. package/dist/transport/index.js +1 -1
  192. package/dist/transport/index.js.map +1 -1
  193. package/dist/transport/msg-transmitter.js +4 -3
  194. package/dist/transport/msg-transmitter.js.map +1 -1
  195. package/dist/transport/msg-transport.js +3 -2
  196. package/dist/transport/msg-transport.js.map +1 -1
  197. package/dist/transport/session-description.d.ts +1 -1
  198. package/dist/transport/session-description.js.map +1 -1
  199. package/dist/transport/session-msg-factory.d.ts +2 -2
  200. package/dist/transport/session-msg-factory.js +2 -2
  201. package/dist/transport/session-msg-factory.js.map +1 -1
  202. package/dist/transport/tcp/acceptor.js +5 -3
  203. package/dist/transport/tcp/acceptor.js.map +1 -1
  204. package/dist/transport/tcp/index.d.ts +1 -0
  205. package/dist/transport/tcp/index.js +1 -0
  206. package/dist/transport/tcp/index.js.map +1 -1
  207. package/dist/transport/tcp/initiator.js +1 -0
  208. package/dist/transport/tcp/initiator.js.map +1 -1
  209. package/dist/transport/tcp/recovering-initiator.d.ts +17 -0
  210. package/dist/transport/tcp/recovering-initiator.js +30 -0
  211. package/dist/transport/tcp/recovering-initiator.js.map +1 -0
  212. package/dist/transport/tcp/recovering-tcp-initiator.d.ts +28 -0
  213. package/dist/transport/tcp/recovering-tcp-initiator.js +120 -0
  214. package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -0
  215. package/dist/transport/tcp/tcp-acceptor.d.ts +7 -0
  216. package/dist/transport/tcp/tcp-acceptor.js +43 -11
  217. package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
  218. package/dist/transport/tcp/tcp-initiator.d.ts +4 -0
  219. package/dist/transport/tcp/tcp-initiator.js +72 -35
  220. package/dist/transport/tcp/tcp-initiator.js.map +1 -1
  221. package/dist/types/FIX4.4/quickfix/advertisement.d.ts +4 -0
  222. package/dist/types/FIX4.4/quickfix/advertisement.js.map +1 -1
  223. package/dist/types/FIX4.4/quickfix/allocation_instruction.d.ts +4 -0
  224. package/dist/types/FIX4.4/quickfix/allocation_instruction.js.map +1 -1
  225. package/dist/types/FIX4.4/quickfix/allocation_instruction_ack.d.ts +4 -0
  226. package/dist/types/FIX4.4/quickfix/allocation_instruction_ack.js.map +1 -1
  227. package/dist/types/FIX4.4/quickfix/allocation_report.d.ts +4 -0
  228. package/dist/types/FIX4.4/quickfix/allocation_report.js.map +1 -1
  229. package/dist/types/FIX4.4/quickfix/allocation_report_ack.d.ts +4 -0
  230. package/dist/types/FIX4.4/quickfix/allocation_report_ack.js.map +1 -1
  231. package/dist/types/FIX4.4/quickfix/assignment_report.d.ts +4 -0
  232. package/dist/types/FIX4.4/quickfix/assignment_report.js.map +1 -1
  233. package/dist/types/FIX4.4/quickfix/bid_request.d.ts +4 -0
  234. package/dist/types/FIX4.4/quickfix/bid_request.js.map +1 -1
  235. package/dist/types/FIX4.4/quickfix/bid_response.d.ts +4 -0
  236. package/dist/types/FIX4.4/quickfix/bid_response.js.map +1 -1
  237. package/dist/types/FIX4.4/quickfix/business_message_reject.d.ts +4 -0
  238. package/dist/types/FIX4.4/quickfix/business_message_reject.js.map +1 -1
  239. package/dist/types/FIX4.4/quickfix/collateral_assignment.d.ts +4 -0
  240. package/dist/types/FIX4.4/quickfix/collateral_assignment.js.map +1 -1
  241. package/dist/types/FIX4.4/quickfix/collateral_inquiry.d.ts +4 -0
  242. package/dist/types/FIX4.4/quickfix/collateral_inquiry.js.map +1 -1
  243. package/dist/types/FIX4.4/quickfix/collateral_inquiry_ack.d.ts +4 -0
  244. package/dist/types/FIX4.4/quickfix/collateral_inquiry_ack.js.map +1 -1
  245. package/dist/types/FIX4.4/quickfix/collateral_report.d.ts +4 -0
  246. package/dist/types/FIX4.4/quickfix/collateral_report.js.map +1 -1
  247. package/dist/types/FIX4.4/quickfix/collateral_request.d.ts +4 -0
  248. package/dist/types/FIX4.4/quickfix/collateral_request.js.map +1 -1
  249. package/dist/types/FIX4.4/quickfix/collateral_response.d.ts +4 -0
  250. package/dist/types/FIX4.4/quickfix/collateral_response.js.map +1 -1
  251. package/dist/types/FIX4.4/quickfix/confirmation.d.ts +4 -0
  252. package/dist/types/FIX4.4/quickfix/confirmation.js.map +1 -1
  253. package/dist/types/FIX4.4/quickfix/confirmation_ack.d.ts +4 -0
  254. package/dist/types/FIX4.4/quickfix/confirmation_ack.js.map +1 -1
  255. package/dist/types/FIX4.4/quickfix/confirmation_request.d.ts +4 -0
  256. package/dist/types/FIX4.4/quickfix/confirmation_request.js.map +1 -1
  257. package/dist/types/FIX4.4/quickfix/cross_order_cancel_replace_request.d.ts +4 -0
  258. package/dist/types/FIX4.4/quickfix/cross_order_cancel_replace_request.js.map +1 -1
  259. package/dist/types/FIX4.4/quickfix/cross_order_cancel_request.d.ts +4 -0
  260. package/dist/types/FIX4.4/quickfix/cross_order_cancel_request.js.map +1 -1
  261. package/dist/types/FIX4.4/quickfix/derivative_security_list.d.ts +4 -0
  262. package/dist/types/FIX4.4/quickfix/derivative_security_list.js.map +1 -1
  263. package/dist/types/FIX4.4/quickfix/derivative_security_list_request.d.ts +4 -0
  264. package/dist/types/FIX4.4/quickfix/derivative_security_list_request.js.map +1 -1
  265. package/dist/types/FIX4.4/quickfix/dont_know_trade.d.ts +4 -0
  266. package/dist/types/FIX4.4/quickfix/dont_know_trade.js.map +1 -1
  267. package/dist/types/FIX4.4/quickfix/email.d.ts +4 -0
  268. package/dist/types/FIX4.4/quickfix/email.js.map +1 -1
  269. package/dist/types/FIX4.4/quickfix/execution_report.d.ts +4 -0
  270. package/dist/types/FIX4.4/quickfix/execution_report.js.map +1 -1
  271. package/dist/types/FIX4.4/quickfix/heartbeat.d.ts +4 -0
  272. package/dist/types/FIX4.4/quickfix/heartbeat.js.map +1 -1
  273. package/dist/types/FIX4.4/quickfix/index.d.ts +4 -0
  274. package/dist/types/FIX4.4/quickfix/index.js +4 -0
  275. package/dist/types/FIX4.4/quickfix/index.js.map +1 -1
  276. package/dist/types/FIX4.4/quickfix/ioi.d.ts +4 -0
  277. package/dist/types/FIX4.4/quickfix/ioi.js.map +1 -1
  278. package/dist/types/FIX4.4/quickfix/list_cancel_request.d.ts +4 -0
  279. package/dist/types/FIX4.4/quickfix/list_cancel_request.js.map +1 -1
  280. package/dist/types/FIX4.4/quickfix/list_execute.d.ts +4 -0
  281. package/dist/types/FIX4.4/quickfix/list_execute.js.map +1 -1
  282. package/dist/types/FIX4.4/quickfix/list_status.d.ts +4 -0
  283. package/dist/types/FIX4.4/quickfix/list_status.js.map +1 -1
  284. package/dist/types/FIX4.4/quickfix/list_status_request.d.ts +4 -0
  285. package/dist/types/FIX4.4/quickfix/list_status_request.js.map +1 -1
  286. package/dist/types/FIX4.4/quickfix/list_strike_price.d.ts +4 -0
  287. package/dist/types/FIX4.4/quickfix/list_strike_price.js.map +1 -1
  288. package/dist/types/FIX4.4/quickfix/logon.d.ts +4 -0
  289. package/dist/types/FIX4.4/quickfix/logon.js.map +1 -1
  290. package/dist/types/FIX4.4/quickfix/logout.d.ts +4 -0
  291. package/dist/types/FIX4.4/quickfix/logout.js.map +1 -1
  292. package/dist/types/FIX4.4/quickfix/market_data_incremental_refresh.d.ts +4 -0
  293. package/dist/types/FIX4.4/quickfix/market_data_incremental_refresh.js.map +1 -1
  294. package/dist/types/FIX4.4/quickfix/market_data_request.d.ts +4 -0
  295. package/dist/types/FIX4.4/quickfix/market_data_request.js.map +1 -1
  296. package/dist/types/FIX4.4/quickfix/market_data_request_reject.d.ts +4 -0
  297. package/dist/types/FIX4.4/quickfix/market_data_request_reject.js.map +1 -1
  298. package/dist/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.d.ts +4 -0
  299. package/dist/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.js.map +1 -1
  300. package/dist/types/FIX4.4/quickfix/mass_quote.d.ts +4 -0
  301. package/dist/types/FIX4.4/quickfix/mass_quote.js.map +1 -1
  302. package/dist/types/FIX4.4/quickfix/mass_quote_acknowledgement.d.ts +4 -0
  303. package/dist/types/FIX4.4/quickfix/mass_quote_acknowledgement.js.map +1 -1
  304. package/dist/types/FIX4.4/quickfix/multileg_order_cancel_replace.d.ts +4 -0
  305. package/dist/types/FIX4.4/quickfix/multileg_order_cancel_replace.js.map +1 -1
  306. package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_request.d.ts +4 -0
  307. package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_request.js.map +1 -1
  308. package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_response.d.ts +4 -0
  309. package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_response.js.map +1 -1
  310. package/dist/types/FIX4.4/quickfix/new_order_cross.d.ts +4 -0
  311. package/dist/types/FIX4.4/quickfix/new_order_cross.js.map +1 -1
  312. package/dist/types/FIX4.4/quickfix/new_order_list.d.ts +4 -0
  313. package/dist/types/FIX4.4/quickfix/new_order_list.js.map +1 -1
  314. package/dist/types/FIX4.4/quickfix/new_order_multileg.d.ts +4 -0
  315. package/dist/types/FIX4.4/quickfix/new_order_multileg.js.map +1 -1
  316. package/dist/types/FIX4.4/quickfix/new_order_single.d.ts +4 -0
  317. package/dist/types/FIX4.4/quickfix/new_order_single.js.map +1 -1
  318. package/dist/types/FIX4.4/quickfix/news.d.ts +4 -0
  319. package/dist/types/FIX4.4/quickfix/news.js.map +1 -1
  320. package/dist/types/FIX4.4/quickfix/order_cancel_reject.d.ts +4 -0
  321. package/dist/types/FIX4.4/quickfix/order_cancel_reject.js.map +1 -1
  322. package/dist/types/FIX4.4/quickfix/order_cancel_replace_request.d.ts +4 -0
  323. package/dist/types/FIX4.4/quickfix/order_cancel_replace_request.js.map +1 -1
  324. package/dist/types/FIX4.4/quickfix/order_cancel_request.d.ts +4 -0
  325. package/dist/types/FIX4.4/quickfix/order_cancel_request.js.map +1 -1
  326. package/dist/types/FIX4.4/quickfix/order_mass_cancel_report.d.ts +4 -0
  327. package/dist/types/FIX4.4/quickfix/order_mass_cancel_report.js.map +1 -1
  328. package/dist/types/FIX4.4/quickfix/order_mass_cancel_request.d.ts +4 -0
  329. package/dist/types/FIX4.4/quickfix/order_mass_cancel_request.js.map +1 -1
  330. package/dist/types/FIX4.4/quickfix/order_mass_status_request.d.ts +4 -0
  331. package/dist/types/FIX4.4/quickfix/order_mass_status_request.js.map +1 -1
  332. package/dist/types/FIX4.4/quickfix/order_status_request.d.ts +4 -0
  333. package/dist/types/FIX4.4/quickfix/order_status_request.js.map +1 -1
  334. package/dist/types/FIX4.4/quickfix/position_maintenance_report.d.ts +4 -0
  335. package/dist/types/FIX4.4/quickfix/position_maintenance_report.js.map +1 -1
  336. package/dist/types/FIX4.4/quickfix/position_maintenance_request.d.ts +4 -0
  337. package/dist/types/FIX4.4/quickfix/position_maintenance_request.js.map +1 -1
  338. package/dist/types/FIX4.4/quickfix/position_report.d.ts +4 -0
  339. package/dist/types/FIX4.4/quickfix/position_report.js.map +1 -1
  340. package/dist/types/FIX4.4/quickfix/quote.d.ts +4 -0
  341. package/dist/types/FIX4.4/quickfix/quote.js.map +1 -1
  342. package/dist/types/FIX4.4/quickfix/quote_cancel.d.ts +4 -0
  343. package/dist/types/FIX4.4/quickfix/quote_cancel.js.map +1 -1
  344. package/dist/types/FIX4.4/quickfix/quote_request.d.ts +4 -0
  345. package/dist/types/FIX4.4/quickfix/quote_request.js.map +1 -1
  346. package/dist/types/FIX4.4/quickfix/quote_request_reject.d.ts +4 -0
  347. package/dist/types/FIX4.4/quickfix/quote_request_reject.js.map +1 -1
  348. package/dist/types/FIX4.4/quickfix/quote_response.d.ts +4 -0
  349. package/dist/types/FIX4.4/quickfix/quote_response.js.map +1 -1
  350. package/dist/types/FIX4.4/quickfix/quote_status_report.d.ts +4 -0
  351. package/dist/types/FIX4.4/quickfix/quote_status_report.js.map +1 -1
  352. package/dist/types/FIX4.4/quickfix/quote_status_request.d.ts +4 -0
  353. package/dist/types/FIX4.4/quickfix/quote_status_request.js.map +1 -1
  354. package/dist/types/FIX4.4/quickfix/registration_instructions.d.ts +4 -0
  355. package/dist/types/FIX4.4/quickfix/registration_instructions.js.map +1 -1
  356. package/dist/types/FIX4.4/quickfix/registration_instructions_response.d.ts +4 -0
  357. package/dist/types/FIX4.4/quickfix/registration_instructions_response.js.map +1 -1
  358. package/dist/types/FIX4.4/quickfix/reject.d.ts +4 -0
  359. package/dist/types/FIX4.4/quickfix/reject.js.map +1 -1
  360. package/dist/types/FIX4.4/quickfix/request_for_positions.d.ts +4 -0
  361. package/dist/types/FIX4.4/quickfix/request_for_positions.js.map +1 -1
  362. package/dist/types/FIX4.4/quickfix/request_for_positions_ack.d.ts +4 -0
  363. package/dist/types/FIX4.4/quickfix/request_for_positions_ack.js.map +1 -1
  364. package/dist/types/FIX4.4/quickfix/resend_request.d.ts +4 -0
  365. package/dist/types/FIX4.4/quickfix/resend_request.js.map +1 -1
  366. package/dist/types/FIX4.4/quickfix/rfq_request.d.ts +4 -0
  367. package/dist/types/FIX4.4/quickfix/rfq_request.js.map +1 -1
  368. package/dist/types/FIX4.4/quickfix/security_definition.d.ts +4 -0
  369. package/dist/types/FIX4.4/quickfix/security_definition.js.map +1 -1
  370. package/dist/types/FIX4.4/quickfix/security_definition_request.d.ts +4 -0
  371. package/dist/types/FIX4.4/quickfix/security_definition_request.js.map +1 -1
  372. package/dist/types/FIX4.4/quickfix/security_list.d.ts +4 -0
  373. package/dist/types/FIX4.4/quickfix/security_list.js.map +1 -1
  374. package/dist/types/FIX4.4/quickfix/security_list_request.d.ts +4 -0
  375. package/dist/types/FIX4.4/quickfix/security_list_request.js.map +1 -1
  376. package/dist/types/FIX4.4/quickfix/security_status.d.ts +4 -0
  377. package/dist/types/FIX4.4/quickfix/security_status.js.map +1 -1
  378. package/dist/types/FIX4.4/quickfix/security_status_request.d.ts +4 -0
  379. package/dist/types/FIX4.4/quickfix/security_status_request.js.map +1 -1
  380. package/dist/types/FIX4.4/quickfix/security_type_request.d.ts +4 -0
  381. package/dist/types/FIX4.4/quickfix/security_type_request.js.map +1 -1
  382. package/dist/types/FIX4.4/quickfix/security_types.d.ts +4 -0
  383. package/dist/types/FIX4.4/quickfix/security_types.js.map +1 -1
  384. package/dist/types/FIX4.4/quickfix/sequence_reset.d.ts +4 -0
  385. package/dist/types/FIX4.4/quickfix/sequence_reset.js.map +1 -1
  386. package/dist/types/FIX4.4/quickfix/set/header.d.ts +31 -0
  387. package/dist/types/FIX4.4/quickfix/set/header.js +3 -0
  388. package/dist/types/FIX4.4/quickfix/set/header.js.map +1 -0
  389. package/dist/types/FIX4.4/quickfix/set/hop.d.ts +4 -0
  390. package/dist/types/FIX4.4/quickfix/set/hop.js +3 -0
  391. package/dist/types/FIX4.4/quickfix/set/hop.js.map +1 -0
  392. package/dist/types/FIX4.4/quickfix/set/hop_no_hops.d.ts +5 -0
  393. package/dist/types/FIX4.4/quickfix/set/hop_no_hops.js +3 -0
  394. package/dist/types/FIX4.4/quickfix/set/hop_no_hops.js.map +1 -0
  395. package/dist/types/FIX4.4/quickfix/set/standard_header.d.ts +31 -0
  396. package/dist/types/FIX4.4/quickfix/set/standard_header.js +3 -0
  397. package/dist/types/FIX4.4/quickfix/set/standard_header.js.map +1 -0
  398. package/dist/types/FIX4.4/quickfix/set/standard_trailer.d.ts +6 -0
  399. package/dist/types/FIX4.4/quickfix/set/standard_trailer.js +3 -0
  400. package/dist/types/FIX4.4/quickfix/set/standard_trailer.js.map +1 -0
  401. package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +6 -0
  402. package/dist/types/FIX4.4/quickfix/set/trailer.js +3 -0
  403. package/dist/types/FIX4.4/quickfix/set/trailer.js.map +1 -0
  404. package/dist/types/FIX4.4/quickfix/settlement_instruction_request.d.ts +4 -0
  405. package/dist/types/FIX4.4/quickfix/settlement_instruction_request.js.map +1 -1
  406. package/dist/types/FIX4.4/quickfix/settlement_instructions.d.ts +4 -0
  407. package/dist/types/FIX4.4/quickfix/settlement_instructions.js.map +1 -1
  408. package/dist/types/FIX4.4/quickfix/test_request.d.ts +4 -0
  409. package/dist/types/FIX4.4/quickfix/test_request.js.map +1 -1
  410. package/dist/types/FIX4.4/quickfix/trade_capture_report.d.ts +4 -0
  411. package/dist/types/FIX4.4/quickfix/trade_capture_report.js.map +1 -1
  412. package/dist/types/FIX4.4/quickfix/trade_capture_report_ack.d.ts +4 -0
  413. package/dist/types/FIX4.4/quickfix/trade_capture_report_ack.js.map +1 -1
  414. package/dist/types/FIX4.4/quickfix/trade_capture_report_request.d.ts +4 -0
  415. package/dist/types/FIX4.4/quickfix/trade_capture_report_request.js.map +1 -1
  416. package/dist/types/FIX4.4/quickfix/trade_capture_report_request_ack.d.ts +4 -0
  417. package/dist/types/FIX4.4/quickfix/trade_capture_report_request_ack.js.map +1 -1
  418. package/dist/types/FIX4.4/quickfix/trading_session_status.d.ts +4 -0
  419. package/dist/types/FIX4.4/quickfix/trading_session_status.js.map +1 -1
  420. package/dist/types/FIX4.4/quickfix/trading_session_status_request.d.ts +4 -0
  421. package/dist/types/FIX4.4/quickfix/trading_session_status_request.js.map +1 -1
  422. package/dist/types/FIX4.4/quickfix/user_request.d.ts +4 -0
  423. package/dist/types/FIX4.4/quickfix/user_request.js.map +1 -1
  424. package/dist/types/FIX4.4/quickfix/user_response.d.ts +4 -0
  425. package/dist/types/FIX4.4/quickfix/user_response.js.map +1 -1
  426. package/dist/types/FIX4.4/quickfix/xm_lnon_fix.d.ts +4 -0
  427. package/dist/types/FIX4.4/quickfix/xm_lnon_fix.js.map +1 -1
  428. package/dist/types/FIX4.4/repo/enum/all-enum.js.map +1 -1
  429. package/package.json +25 -21
  430. package/script/build.sh +1 -0
  431. package/src/buffer/ascii/ascii-encoder.ts +110 -33
  432. package/src/buffer/ascii/ascii-parser.ts +8 -1
  433. package/src/buffer/ascii/ascii-segment-parser.ts +44 -38
  434. package/src/buffer/ascii/ascii-view.ts +5 -0
  435. package/src/buffer/ascii/time-formatter.ts +2 -2
  436. package/src/buffer/ascii-chars.ts +1 -0
  437. package/src/buffer/elastic-buffer.ts +9 -0
  438. package/src/buffer/encode-proxy.ts +2 -2
  439. package/src/buffer/fixml/fixml-encoder.ts +8 -0
  440. package/src/buffer/fixml/fixml-view.ts +5 -0
  441. package/src/buffer/msg-encoder.ts +2 -0
  442. package/src/buffer/msg-view.ts +3 -0
  443. package/src/buffer/tags.ts +1 -1
  444. package/src/collections/dictionary.ts +6 -0
  445. package/src/config/js-fix-config.ts +2 -0
  446. package/src/dictionary/parser/quickfix/field-set-parser.ts +11 -4
  447. package/src/dictionary/parser/quickfix/message-parser.ts +4 -0
  448. package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +16 -0
  449. package/src/jsfix-cmd.ts +2 -1
  450. package/src/sample/http/oms/app.ts +2 -0
  451. package/src/sample/launcher.ts +17 -7
  452. package/src/sample/tcp/qf-md/app.ts +26 -0
  453. package/src/sample/tcp/qf-md/md-client.ts +51 -0
  454. package/src/sample/tcp/qf-md/md-factory.ts +34 -0
  455. package/src/sample/tcp/qf-md/md-server.ts +56 -0
  456. package/src/sample/tcp/recovering-skeleton/app.ts +33 -0
  457. package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +41 -0
  458. package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +54 -0
  459. package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +60 -0
  460. package/src/sample/tcp/skeleton/app.ts +2 -0
  461. package/src/sample/tcp/skeleton/skeleton-session.ts +26 -4
  462. package/src/sample/tcp/tls-trade-capture/app.ts +1 -1
  463. package/src/sample/tcp/{trade_capture → trade-capture}/app.ts +0 -0
  464. package/src/sample/tcp/{trade_capture → trade-capture}/index.ts +0 -0
  465. package/src/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.ts +10 -5
  466. package/src/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.ts +2 -2
  467. package/src/sample/tcp/{trade_capture → trade-capture}/trade-factory.ts +0 -0
  468. package/src/store/fix-msg-ascii-store-resend.ts +87 -0
  469. package/src/store/fix-msg-memory-store.ts +171 -0
  470. package/src/store/fix-msg-store-record.ts +23 -0
  471. package/src/store/fix-msg-store.ts +23 -0
  472. package/src/store/index.ts +4 -0
  473. package/src/transport/a-session-msg-factory.ts +81 -0
  474. package/src/transport/ascii/ascii-msg-transmitter.ts +32 -11
  475. package/src/transport/ascii/ascii-session-msg-factory.ts +62 -0
  476. package/src/transport/ascii/ascii-session.ts +100 -36
  477. package/src/transport/ascii/index.ts +1 -0
  478. package/src/transport/duplex/http-duplex.ts +2 -2
  479. package/src/transport/fix-msg-factory.ts +1 -1
  480. package/src/transport/fix-session-state.ts +67 -15
  481. package/src/transport/fix-session.ts +156 -43
  482. package/src/transport/fixml/fixml-session-msg-factory.ts +76 -0
  483. package/src/transport/fixml/fixml-session.ts +1 -1
  484. package/src/transport/fixml/index.ts +2 -1
  485. package/src/transport/http/http-acceptor.ts +7 -6
  486. package/src/transport/index.ts +1 -1
  487. package/src/transport/msg-transmitter.ts +4 -3
  488. package/src/transport/msg-transport.ts +3 -2
  489. package/src/transport/session-description.ts +1 -1
  490. package/src/transport/tcp/acceptor.ts +5 -3
  491. package/src/transport/tcp/index.ts +1 -0
  492. package/src/transport/tcp/initiator.ts +1 -0
  493. package/src/transport/tcp/recovering-tcp-initiator.ts +149 -0
  494. package/src/transport/tcp/tcp-acceptor.ts +46 -11
  495. package/src/transport/tcp/tcp-initiator.ts +77 -40
  496. package/src/types/FIX4.4/quickfix/advertisement.ts +4 -0
  497. package/src/types/FIX4.4/quickfix/allocation_instruction.ts +4 -0
  498. package/src/types/FIX4.4/quickfix/allocation_instruction_ack.ts +4 -0
  499. package/src/types/FIX4.4/quickfix/allocation_report.ts +4 -0
  500. package/src/types/FIX4.4/quickfix/allocation_report_ack.ts +4 -0
  501. package/src/types/FIX4.4/quickfix/assignment_report.ts +4 -0
  502. package/src/types/FIX4.4/quickfix/bid_request.ts +4 -0
  503. package/src/types/FIX4.4/quickfix/bid_response.ts +4 -0
  504. package/src/types/FIX4.4/quickfix/business_message_reject.ts +5 -0
  505. package/src/types/FIX4.4/quickfix/collateral_assignment.ts +4 -0
  506. package/src/types/FIX4.4/quickfix/collateral_inquiry.ts +4 -0
  507. package/src/types/FIX4.4/quickfix/collateral_inquiry_ack.ts +4 -0
  508. package/src/types/FIX4.4/quickfix/collateral_report.ts +4 -0
  509. package/src/types/FIX4.4/quickfix/collateral_request.ts +4 -0
  510. package/src/types/FIX4.4/quickfix/collateral_response.ts +4 -0
  511. package/src/types/FIX4.4/quickfix/confirmation.ts +4 -0
  512. package/src/types/FIX4.4/quickfix/confirmation_ack.ts +5 -0
  513. package/src/types/FIX4.4/quickfix/confirmation_request.ts +4 -0
  514. package/src/types/FIX4.4/quickfix/cross_order_cancel_replace_request.ts +4 -0
  515. package/src/types/FIX4.4/quickfix/cross_order_cancel_request.ts +4 -0
  516. package/src/types/FIX4.4/quickfix/derivative_security_list.ts +4 -0
  517. package/src/types/FIX4.4/quickfix/derivative_security_list_request.ts +4 -0
  518. package/src/types/FIX4.4/quickfix/dont_know_trade.ts +4 -0
  519. package/src/types/FIX4.4/quickfix/email.ts +4 -0
  520. package/src/types/FIX4.4/quickfix/execution_report.ts +4 -0
  521. package/src/types/FIX4.4/quickfix/heartbeat.ts +5 -0
  522. package/src/types/FIX4.4/quickfix/index.ts +4 -0
  523. package/src/types/FIX4.4/quickfix/ioi.ts +4 -0
  524. package/src/types/FIX4.4/quickfix/list_cancel_request.ts +5 -0
  525. package/src/types/FIX4.4/quickfix/list_execute.ts +6 -1
  526. package/src/types/FIX4.4/quickfix/list_status.ts +4 -0
  527. package/src/types/FIX4.4/quickfix/list_status_request.ts +5 -0
  528. package/src/types/FIX4.4/quickfix/list_strike_price.ts +4 -0
  529. package/src/types/FIX4.4/quickfix/logon.ts +4 -0
  530. package/src/types/FIX4.4/quickfix/logout.ts +6 -1
  531. package/src/types/FIX4.4/quickfix/market_data_incremental_refresh.ts +4 -0
  532. package/src/types/FIX4.4/quickfix/market_data_request.ts +4 -0
  533. package/src/types/FIX4.4/quickfix/market_data_request_reject.ts +4 -0
  534. package/src/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.ts +4 -0
  535. package/src/types/FIX4.4/quickfix/mass_quote.ts +4 -0
  536. package/src/types/FIX4.4/quickfix/mass_quote_acknowledgement.ts +4 -0
  537. package/src/types/FIX4.4/quickfix/multileg_order_cancel_replace.ts +4 -0
  538. package/src/types/FIX4.4/quickfix/network_counterparty_system_status_request.ts +4 -0
  539. package/src/types/FIX4.4/quickfix/network_counterparty_system_status_response.ts +4 -0
  540. package/src/types/FIX4.4/quickfix/new_order_cross.ts +4 -0
  541. package/src/types/FIX4.4/quickfix/new_order_list.ts +4 -0
  542. package/src/types/FIX4.4/quickfix/new_order_multileg.ts +4 -0
  543. package/src/types/FIX4.4/quickfix/new_order_single.ts +4 -0
  544. package/src/types/FIX4.4/quickfix/news.ts +4 -0
  545. package/src/types/FIX4.4/quickfix/order_cancel_reject.ts +5 -0
  546. package/src/types/FIX4.4/quickfix/order_cancel_replace_request.ts +4 -0
  547. package/src/types/FIX4.4/quickfix/order_cancel_request.ts +4 -0
  548. package/src/types/FIX4.4/quickfix/order_mass_cancel_report.ts +4 -0
  549. package/src/types/FIX4.4/quickfix/order_mass_cancel_request.ts +4 -0
  550. package/src/types/FIX4.4/quickfix/order_mass_status_request.ts +4 -0
  551. package/src/types/FIX4.4/quickfix/order_status_request.ts +4 -0
  552. package/src/types/FIX4.4/quickfix/position_maintenance_report.ts +4 -0
  553. package/src/types/FIX4.4/quickfix/position_maintenance_request.ts +4 -0
  554. package/src/types/FIX4.4/quickfix/position_report.ts +4 -0
  555. package/src/types/FIX4.4/quickfix/quote.ts +4 -0
  556. package/src/types/FIX4.4/quickfix/quote_cancel.ts +4 -0
  557. package/src/types/FIX4.4/quickfix/quote_request.ts +4 -0
  558. package/src/types/FIX4.4/quickfix/quote_request_reject.ts +4 -0
  559. package/src/types/FIX4.4/quickfix/quote_response.ts +4 -0
  560. package/src/types/FIX4.4/quickfix/quote_status_report.ts +4 -0
  561. package/src/types/FIX4.4/quickfix/quote_status_request.ts +4 -0
  562. package/src/types/FIX4.4/quickfix/registration_instructions.ts +4 -0
  563. package/src/types/FIX4.4/quickfix/registration_instructions_response.ts +4 -0
  564. package/src/types/FIX4.4/quickfix/reject.ts +6 -1
  565. package/src/types/FIX4.4/quickfix/request_for_positions.ts +4 -0
  566. package/src/types/FIX4.4/quickfix/request_for_positions_ack.ts +4 -0
  567. package/src/types/FIX4.4/quickfix/resend_request.ts +5 -0
  568. package/src/types/FIX4.4/quickfix/rfq_request.ts +4 -0
  569. package/src/types/FIX4.4/quickfix/security_definition.ts +4 -0
  570. package/src/types/FIX4.4/quickfix/security_definition_request.ts +4 -0
  571. package/src/types/FIX4.4/quickfix/security_list.ts +4 -0
  572. package/src/types/FIX4.4/quickfix/security_list_request.ts +4 -0
  573. package/src/types/FIX4.4/quickfix/security_status.ts +4 -0
  574. package/src/types/FIX4.4/quickfix/security_status_request.ts +4 -0
  575. package/src/types/FIX4.4/quickfix/security_type_request.ts +5 -0
  576. package/src/types/FIX4.4/quickfix/security_types.ts +4 -0
  577. package/src/types/FIX4.4/quickfix/sequence_reset.ts +5 -0
  578. package/src/types/FIX4.4/quickfix/set/hop.ts +5 -0
  579. package/src/types/FIX4.4/quickfix/set/hop_no_hops.ts +5 -0
  580. package/src/types/FIX4.4/quickfix/set/standard_header.ts +31 -0
  581. package/src/types/FIX4.4/quickfix/set/standard_trailer.ts +5 -0
  582. package/src/types/FIX4.4/quickfix/settlement_instruction_request.ts +4 -0
  583. package/src/types/FIX4.4/quickfix/settlement_instructions.ts +4 -0
  584. package/src/types/FIX4.4/quickfix/test_request.ts +5 -0
  585. package/src/types/FIX4.4/quickfix/trade_capture_report.ts +4 -0
  586. package/src/types/FIX4.4/quickfix/trade_capture_report_ack.ts +4 -0
  587. package/src/types/FIX4.4/quickfix/trade_capture_report_request.ts +4 -0
  588. package/src/types/FIX4.4/quickfix/trade_capture_report_request_ack.ts +4 -0
  589. package/src/types/FIX4.4/quickfix/trading_session_status.ts +5 -0
  590. package/src/types/FIX4.4/quickfix/trading_session_status_request.ts +5 -0
  591. package/src/types/FIX4.4/quickfix/user_request.ts +5 -0
  592. package/src/types/FIX4.4/quickfix/user_response.ts +5 -0
  593. package/src/types/FIX4.4/quickfix/xm_lnon_fix.ts +5 -0
  594. package/src/types/FIX4.4/repo/enum/all-enum.ts +0 -1
  595. package/dist/sample/tcp/tls-trade-capture/jsfix.test_client.txt +0 -77
  596. package/dist/sample/tcp/tls-trade-capture/jsfix.test_server.txt +0 -77
  597. package/dist/sample/tcp/trade_capture/jsfix.test_client.txt +0 -75
  598. package/dist/sample/tcp/trade_capture/jsfix.test_server.txt +0 -75
  599. package/dist/sample/tcp/trade_capture/trade-capture-client.js.map +0 -1
  600. package/dist/sample/tcp/trade_capture/trade-capture-server.js.map +0 -1
  601. package/src/transport/session-msg-factory.ts +0 -195
  602. package/src/transport/tcp/resilient-initiator.ts +0 -35
@@ -0,0 +1,87 @@
1
+ import { IFixMsgStore } from './fix-msg-store'
2
+ import { FixMsgStoreRecord, IFixMsgStoreRecord } from './fix-msg-store-record'
3
+ import { IJsFixConfig } from '../config'
4
+ import { MsgType } from '../types'
5
+ import { AsciiParser, MsgView } from '../buffer'
6
+ import { ISequenceReset, IStandardHeader } from '../types/FIX4.4/repo'
7
+
8
+ export class FixMsgAsciiStoreResend {
9
+ parser: AsciiParser
10
+ constructor (public readonly store: IFixMsgStore, public readonly config: IJsFixConfig) {
11
+ this.parser = new AsciiParser(this.config.definitions, null, this.config.delimiter)
12
+ }
13
+
14
+ public getResendRequest (startSeq: number, endSeq: number): Promise<IFixMsgStoreRecord[]> {
15
+
16
+ // need to cover request from start to end where any missing numbers are
17
+ // included as gaps to allow vector of messages to be sent by the session
18
+ // on a request
19
+
20
+ return new Promise((resolve, reject) => {
21
+ this.store.getSeqNumRange(startSeq, endSeq).then(res => {
22
+ resolve(this.inflateRange(startSeq, endSeq, res))
23
+ }).catch(e => {
24
+ reject(e)
25
+ })
26
+ })
27
+ }
28
+
29
+ private inflateRange (startSeq: number, endSeq: number, input: IFixMsgStoreRecord[]): IFixMsgStoreRecord[] {
30
+ const toResend: IFixMsgStoreRecord[] = []
31
+ let expected = startSeq
32
+ for (let i = 0; i < input.length; ++i) {
33
+ const record = input[i].clone()
34
+ const seqNum = record.seqNum
35
+ const toGap = seqNum - expected
36
+ if (toGap > 0) {
37
+ this.gap(expected, seqNum, toResend)
38
+ }
39
+ expected = seqNum + 1
40
+ if (record.encoded) {
41
+ this.inflate(record)
42
+ }
43
+ toResend.push(record)
44
+ }
45
+ if (endSeq - expected > 0) {
46
+ this.gap(expected, endSeq + 1, toResend)
47
+ }
48
+ return toResend
49
+ }
50
+
51
+ public gap (beginGap: number, seqNum: number, arr: IFixMsgStoreRecord[]) {
52
+ if (beginGap > 0) {
53
+ arr.push(this.sequenceResetGap(beginGap, seqNum))
54
+ }
55
+ }
56
+
57
+ // if records were sent as encoded text then inflate back to object
58
+ // so can be resent or examined
59
+
60
+ public inflate (record: IFixMsgStoreRecord): void {
61
+ if (record.obj) return
62
+ if (!record.encoded) return
63
+ const parser = this.parser
64
+ parser.on('error', (e: Error) => {
65
+ record.obj = null
66
+ })
67
+ parser.on('msg', (view: MsgView) => {
68
+ record.obj = view.toObject()
69
+ })
70
+ // inline parse
71
+ parser.parseText(record.encoded)
72
+ }
73
+
74
+ public sequenceResetGap (startGap: number, newSeq: number): IFixMsgStoreRecord {
75
+ const factory = this.config.factory
76
+ const gapFill: ISequenceReset = factory.sequenceReset(newSeq, true) as ISequenceReset
77
+ gapFill.StandardHeader = factory.header(MsgType.SequenceReset, startGap) as IStandardHeader
78
+ gapFill.StandardHeader.PossDupFlag = true
79
+ gapFill.NewSeqNo = newSeq
80
+ return new FixMsgStoreRecord(
81
+ MsgType.SequenceReset,
82
+ new Date(),
83
+ newSeq,
84
+ gapFill,
85
+ null)
86
+ }
87
+ }
@@ -0,0 +1,171 @@
1
+ import { IFixMsgStore } from './fix-msg-store'
2
+ import { IJsFixConfig, IJsFixLogger } from '../config'
3
+ import { IFixMsgStoreRecord } from './fix-msg-store-record'
4
+ import { Dictionary } from '../collections'
5
+ import { MsgType } from '../types'
6
+ import { IFixMsgStoreState } from '.'
7
+
8
+ export class FixMsgMemoryStore implements IFixMsgStore {
9
+ protected readonly logger: IJsFixLogger
10
+ public heartbeat: boolean = true
11
+ private sortedBySeqNum: IFixMsgStoreRecord[] = []
12
+ private excluded: Dictionary<boolean> = new Dictionary<boolean>()
13
+ public length: number = 0
14
+ private sessionMessages: string[] = [
15
+ MsgType.Logon,
16
+ MsgType.Logout,
17
+ MsgType.ResendRequest,
18
+ MsgType.Heartbeat,
19
+ MsgType.TestRequest,
20
+ MsgType.SequenceReset
21
+ ]
22
+
23
+ public constructor (public readonly id: string, public readonly config: IJsFixConfig) {
24
+ this.logger = config.logFactory.logger(`${this.id}:FixMsgMemoryStore`)
25
+ this.setExcMsgType([])
26
+ }
27
+
28
+ public static search (ar: IFixMsgStoreRecord[], target?: number, isDate?: boolean): number {
29
+ let m: number = 0
30
+ let n: number = ar.length - 1
31
+ while (m <= n) {
32
+ const k: number = (n + m) >> 1
33
+ const check: number = isDate ? ar[k].timestamp.getDate() : ar[k].seqNum
34
+ const cmp: number = target - check
35
+ if (cmp > 0) {
36
+ m = k + 1
37
+ } else if (cmp < 0) {
38
+ n = k - 1
39
+ } else {
40
+ return k
41
+ }
42
+ }
43
+ return -m - 1
44
+ }
45
+
46
+ public getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]> {
47
+ return new Promise((resolve, reject: any) => {
48
+ const data = this.sortedBySeqNum
49
+ if (data === null) reject(new Error('no store'))
50
+ const required = data.filter(x => x.msgType === msgType)
51
+ resolve(required)
52
+ })
53
+ }
54
+
55
+ private getIndex (seq: number): number {
56
+ const arr = this.sortedBySeqNum
57
+ let index = FixMsgMemoryStore.search(arr, seq)
58
+ if (index < 0) {
59
+ index = -(index + 1)
60
+ }
61
+ return index
62
+ }
63
+
64
+ private bounded (fromIdx: number, toIdx: number) {
65
+ const arr = this.sortedBySeqNum
66
+ return fromIdx >= 0 && fromIdx <= arr.length && toIdx >= fromIdx && toIdx <= arr.length
67
+ }
68
+
69
+ public get (from: number): Promise<IFixMsgStoreRecord> {
70
+ return new Promise((resolve, reject) => {
71
+ this.getSeqNumRange(from, from).then(res => {
72
+ if (res.length > 0) {
73
+ const record = res[0].clone()
74
+ resolve(record)
75
+ } else {
76
+ reject(new Error(`${from} not in store`))
77
+ }
78
+ }).catch(e => {
79
+ reject(e)
80
+ })
81
+ })
82
+ }
83
+
84
+ public getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]> {
85
+ return new Promise((resolve, reject) => {
86
+ const arr = this.sortedBySeqNum
87
+ if (from < 0) reject(new Error(`illegal from ${from}`))
88
+ if (to < 0) reject(new Error(`illegal to ${to}`))
89
+ let fromIdx = this.getIndex(from)
90
+ const toEnd = to === 0 || isNaN(to)
91
+ let toIdx = toEnd ? arr.length - 1 : this.getIndex(to)
92
+ if (this.bounded(fromIdx, toIdx)) {
93
+ resolve(arr.slice(fromIdx, toIdx + 1))
94
+ } else {
95
+ reject(new Error(`incorrect bounds from=${from}, fromIdx=${fromIdx}, to=${to}, toIdx=${toIdx}, length=${arr.length}`))
96
+ }
97
+ })
98
+ }
99
+
100
+ private buildState (): IFixMsgStoreState {
101
+ const arr = this.sortedBySeqNum
102
+ return {
103
+ firstSeq: arr.length > 0 ? arr[0].seqNum : 0,
104
+ lastSeq: arr.length > 0 ? arr[arr.length - 1].seqNum : 0,
105
+ id: this.id,
106
+ length: arr.length
107
+ } as IFixMsgStoreState
108
+ }
109
+
110
+ public getState (): Promise<IFixMsgStoreState> {
111
+ return new Promise((resolve, reject) => {
112
+ try {
113
+ resolve(this.buildState())
114
+ } catch (e) {
115
+ reject(e)
116
+ }
117
+ })
118
+ }
119
+
120
+ public clear (): Promise<IFixMsgStoreState> {
121
+ this.sortedBySeqNum = []
122
+ return new Promise((resolve, reject) => {
123
+ try {
124
+ resolve(this.buildState())
125
+ } catch (e) {
126
+ reject(e)
127
+ }
128
+ })
129
+ }
130
+
131
+ public put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState> {
132
+ return new Promise((resolve, reject) => {
133
+ if (this.excluded.containsKey(record.msgType)) {
134
+ resolve(this.buildState())
135
+ } else {
136
+ const arr = this.sortedBySeqNum
137
+ const idx = FixMsgMemoryStore.search(arr, record.seqNum)
138
+ if (idx >= 0) { // seen this before
139
+ reject(new Error(`this seqNum ${record.seqNum} already in store`))
140
+ }
141
+ arr.splice(-idx, 0, record)
142
+ this.length = arr.length
143
+ resolve(this.buildState())
144
+ }
145
+ })
146
+ }
147
+
148
+ public setExcMsgType (exclude: string[]): void {
149
+ this.excluded.clear()
150
+ this.excludeRange(this.sessionMessages)
151
+ this.excludeRange(exclude)
152
+ }
153
+
154
+ private excludeRange (exclude: string[]): void {
155
+ exclude.forEach(s => {
156
+ this.excluded.add(s, true)
157
+ })
158
+ }
159
+
160
+ exists (seqNum: number): Promise<boolean> {
161
+ return new Promise((resolve, reject) => {
162
+ try {
163
+ const arr = this.sortedBySeqNum
164
+ let index = FixMsgMemoryStore.search(arr, seqNum)
165
+ resolve(index >= 0)
166
+ } catch (e) {
167
+ reject(e)
168
+ }
169
+ })
170
+ }
171
+ }
@@ -0,0 +1,23 @@
1
+ import { ILooseObject } from '../collections/collection'
2
+
3
+ export interface IFixMsgStoreRecord {
4
+ readonly msgType: string
5
+ readonly timestamp: Date
6
+ readonly seqNum: number
7
+ obj?: ILooseObject
8
+ readonly encoded?: string
9
+ clone (): IFixMsgStoreRecord
10
+ }
11
+
12
+ export class FixMsgStoreRecord implements IFixMsgStoreRecord {
13
+ constructor (public readonly msgType: string,
14
+ public readonly timestamp: Date,
15
+ public readonly seqNum: number,
16
+ public obj?: ILooseObject,
17
+ public readonly encoded?: string) {
18
+ }
19
+
20
+ clone (): IFixMsgStoreRecord {
21
+ return new FixMsgStoreRecord(this.msgType, this.timestamp, this.seqNum, this.obj, this.encoded)
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ a message store that represents a single entity which can be queried for recovery
3
+ */
4
+
5
+ import { IFixMsgStoreRecord } from './fix-msg-store-record'
6
+
7
+ export interface IFixMsgStoreState {
8
+ readonly length: number,
9
+ readonly firstSeq: number,
10
+ readonly lastSeq: number
11
+ readonly id: string
12
+ }
13
+
14
+ export interface IFixMsgStore {
15
+ clear (): Promise<IFixMsgStoreState>
16
+ getState (): Promise<IFixMsgStoreState>
17
+ put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState>
18
+ get (seq: number): Promise<IFixMsgStoreRecord>
19
+ exists (seq: number): Promise<boolean>
20
+ // if to = 0, then to the end of sequence
21
+ getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]>
22
+ getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]>
23
+ }
@@ -0,0 +1,4 @@
1
+ export * from './fix-msg-memory-store'
2
+ export * from './fix-msg-store'
3
+ export * from './fix-msg-store-record'
4
+ export * from './fix-msg-ascii-store-resend'
@@ -0,0 +1,81 @@
1
+ import { ISessionMsgFactory } from './fix-msg-factory'
2
+ import { ISessionDescription } from './session-description'
3
+ import { ILooseObject } from '../collections/collection'
4
+ import { MsgType } from '../types'
5
+
6
+ import {
7
+ IHeartbeat,
8
+ IReject,
9
+ IResendRequest,
10
+ ISequenceReset,
11
+ IStandardHeader,
12
+ IStandardTrailer,
13
+ ITestRequest
14
+ } from '../types/FIX4.4/repo'
15
+
16
+ export interface ObjectMutator { (description: ISessionDescription, type: string, o: ILooseObject): ILooseObject
17
+ }
18
+
19
+ export abstract class ASessionMsgFactory implements ISessionMsgFactory {
20
+ public isAscii: boolean
21
+ constructor (public readonly description: ISessionDescription, public mutator: ObjectMutator = null) {
22
+ }
23
+
24
+ public reject (msgType: string, seqNo: number, msg: string, reason: number): ILooseObject {
25
+ const o: IReject = {
26
+ RefMsgType: msgType,
27
+ SessionRejectReason: reason,
28
+ RefSeqNum: seqNo,
29
+ Text: msg
30
+ } as IReject
31
+ return this.mutator ? this.mutator(this.description, MsgType.Reject, o) : o
32
+ }
33
+
34
+ // see implementations Ascii and Fixml
35
+ public abstract logon (userRequestId: string, isResponse: boolean): ILooseObject
36
+ public abstract logout (msgType: string, text: string): ILooseObject
37
+ public abstract header (msgType: string, seqNum: number, time: Date, overrideData?: Partial<IStandardHeader>): ILooseObject
38
+
39
+ protected mutate (o: ILooseObject, type: string): ILooseObject {
40
+ return this.mutator ? this.mutator(this.description, type, o) : o
41
+ }
42
+
43
+ public testRequest (reqId: string = `ping-${new Date().toUTCString()}`): ILooseObject {
44
+ const o: ITestRequest = {
45
+ TestReqID: reqId
46
+ } as ITestRequest
47
+ return this.mutate(o, MsgType.TestRequest)
48
+ }
49
+
50
+ public heartbeat (testReqId: string): ILooseObject {
51
+ const o: IHeartbeat = {
52
+ TestReqID: testReqId
53
+ } as IHeartbeat
54
+ return this.mutate(o, MsgType.Heartbeat)
55
+ }
56
+
57
+ public resendRequest (from: number, to: number): ILooseObject {
58
+ const o: IResendRequest = {
59
+ BeginSeqNo: from,
60
+ EndSeqNo: to
61
+ } as IResendRequest
62
+ return this.mutate(o, MsgType.ResendRequest)
63
+ }
64
+
65
+ public sequenceReset (newSeqNo: number, gapFill?: boolean): ILooseObject {
66
+ const o: ISequenceReset = {
67
+ GapFillFlag: gapFill === true,
68
+ NewSeqNo: newSeqNo
69
+ } as ISequenceReset
70
+ return this.mutate(o, MsgType.SequenceReset)
71
+ }
72
+
73
+ public trailer (checksum: number): ILooseObject {
74
+ const s = checksum.toString()
75
+ const padded = s.padStart(3, '0')
76
+ const o = {
77
+ CheckSum: padded
78
+ } as IStandardTrailer
79
+ return this.mutate(o, 'StandardTrailer')
80
+ }
81
+ }
@@ -1,4 +1,4 @@
1
- import { AsciiEncoder, TimeFormatter } from '../../buffer'
1
+ import { AsciiChars, AsciiEncoder, TimeFormatter } from '../../buffer'
2
2
  import { MsgTransmitter } from '../msg-transmitter'
3
3
  import { ILooseObject } from '../../collections/collection'
4
4
  import { ContainedFieldSet, MessageDefinition } from '../../dictionary'
@@ -18,20 +18,40 @@ export class AsciiMsgTransmitter extends MsgTransmitter {
18
18
  this.msgSeqNum = (config.description.LastSentSeqNum || 0) + 1 // adding 1 as this the next sequence # to use.
19
19
  const buffer = this.buffer
20
20
  const tf: TimeFormatter = new TimeFormatter(buffer)
21
- this.encoder = new AsciiEncoder(buffer, config.definitions, tf, config.delimiter)
22
- this.header = config.definitions.component.get('header')
23
- this.trailer = config.definitions.component.get('trailer')
21
+ this.encoder = new AsciiEncoder(buffer, config.definitions, tf,
22
+ config.delimiter || AsciiChars.Soh,
23
+ config.logDelimiter || AsciiChars.Pipe)
24
+ const components = config.definitions.component
25
+ this.header = components.get('StandardHeader')
26
+ this.trailer = components.get('StandardTrailer')
27
+ }
28
+
29
+ private checksum (): number {
30
+ const buffer = this.buffer
31
+ const encoder: AsciiEncoder = this.encoder as AsciiEncoder
32
+ let checksum: number = buffer.sum()
33
+ if (encoder.delimiter !== encoder.logDelimiter) {
34
+ const changes = encoder.tags.nextTagPos
35
+ checksum -= changes * encoder.logDelimiter
36
+ checksum += changes * encoder.delimiter
37
+ }
38
+ checksum = checksum % 256
39
+ return checksum
24
40
  }
25
41
 
26
42
  public encodeMessage (msgType: string, obj: ILooseObject): void {
27
43
  const encoder: AsciiEncoder = this.encoder as AsciiEncoder
28
44
  const factory = this.config.factory
29
-
30
- const headerProps: Partial<IStandardHeader> = {
31
- ...(obj.StandardHeader?.PossDupFlag ? { PossDupFlag: obj.StandardHeader?.PossDupFlag } : {}),
32
- ...(obj.StandardHeader?.MsgSeqNum ? { MsgSeqNum: obj.StandardHeader?.MsgSeqNum } : {})
45
+ let headerProps: Partial<IStandardHeader> = {}
46
+ const { StandardHeader, ...bodyProps } = obj
47
+ if (StandardHeader) {
48
+ const { BeginString, BodyLength, MsgType, SenderCompID, SendingTime, TargetCompID, TargetSubID, ...hp } = StandardHeader
49
+ headerProps = hp // pick up any optional applied by application
50
+ headerProps.OrigSendingTime = SendingTime // when first sent
33
51
  }
34
- const hdr: ILooseObject = factory.header(msgType, this.msgSeqNum,this.time || new Date(), headerProps)
52
+
53
+ const sendingTime = this.time || new Date()
54
+ const hdr: ILooseObject = factory.header(msgType, this.msgSeqNum, sendingTime, headerProps)
35
55
 
36
56
  // Only increment sequence number if this is not a duplicate message.
37
57
  if (!headerProps.PossDupFlag) {
@@ -42,15 +62,16 @@ export class AsciiMsgTransmitter extends MsgTransmitter {
42
62
  buffer.reset()
43
63
  const msgDef: MessageDefinition = this.definitions.message.get(msgType)
44
64
  if (!msgDef) {
65
+ this.emit('error', new Error(`ascii transmitter cannot find definition for ${msgType}`))
45
66
  return
46
67
  }
47
68
  encoder.encode(hdr, this.header.name)
48
- encoder.encode(obj, msgDef.name)
69
+ encoder.encode(bodyProps, msgDef.name)
49
70
  const lenPos = encoder.bodyLengthPos
50
71
  const bodyLength: number = Math.max(4, this.config.description.BodyLengthChars || 7)
51
72
  const len = buffer.getPos() - encoder.msgTypePos
52
73
  buffer.patchPaddedNumberAtPos(lenPos, len, bodyLength)
53
- const checksum: number = buffer.checksum()
74
+ let checksum: number = this.checksum()
54
75
  const trl: ILooseObject = factory.trailer(checksum)
55
76
  encoder.encode(trl, this.trailer.name)
56
77
  }
@@ -0,0 +1,62 @@
1
+ import { ISessionDescription } from '../session-description'
2
+ import { ILooseObject } from '../../collections/collection'
3
+ import { MsgType } from '../../types'
4
+ import { ASessionMsgFactory, ObjectMutator } from '../a-session-msg-factory'
5
+
6
+ import {
7
+ EncryptMethod,
8
+ ILogon,
9
+ ILogout,
10
+ IStandardHeader
11
+ } from '../../types/FIX4.4/repo'
12
+
13
+ export class AsciiSessionMsgFactory extends ASessionMsgFactory {
14
+
15
+ constructor (readonly description: ISessionDescription, mutator: ObjectMutator = null) {
16
+ super(description, mutator)
17
+ this.isAscii = description.application.protocol === 'ascii'
18
+ }
19
+
20
+ public logon (): ILooseObject {
21
+ const description = this.description
22
+ const o: ILogon = {
23
+ Username: description.Username,
24
+ Password: description.Password,
25
+ HeartBtInt: description.HeartBtInt,
26
+ ResetSeqNumFlag: description.ResetSeqNumFlag,
27
+ EncryptMethod: EncryptMethod.None
28
+ } as ILogon
29
+ return this.mutate(o, MsgType.Logon)
30
+ }
31
+
32
+ public logout (text: string): ILooseObject {
33
+ const o: ILogout = {
34
+ Text: text
35
+ } as ILogout
36
+ return this.mutate(o, MsgType.Logout)
37
+ }
38
+
39
+ public header (msgType: string, seqNum: number, time: Date, overrideData?: Partial<IStandardHeader>): ILooseObject {
40
+ const description = this.description
41
+ const bodyLength: number = Math.max(4, description.BodyLengthChars || 7)
42
+ const placeHolder = Math.pow(10, bodyLength - 1) + 1
43
+ const o: IStandardHeader = {
44
+ BeginString: description.BeginString,
45
+ BodyLength: placeHolder,
46
+ MsgType: msgType,
47
+ SenderCompID: description.SenderCompId,
48
+ MsgSeqNum: seqNum,
49
+ SendingTime: time,
50
+ TargetCompID: description.TargetCompID,
51
+ TargetSubID: description.TargetSubID,
52
+ ...overrideData
53
+ }
54
+ return this.mutate(o, 'StandardHeader')
55
+ }
56
+ }
57
+
58
+ export class SessionMsgFactory extends AsciiSessionMsgFactory {
59
+ constructor (public readonly description: ISessionDescription, public mutator: ObjectMutator = null) {
60
+ super(description, mutator)
61
+ }
62
+ }