jspurefix 2.2.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (639) hide show
  1. package/.eslintrc +30 -0
  2. package/README.md +297 -249
  3. package/data/session/test-http-initiator.json +2 -2
  4. package/dist/buffer/ascii/ascii-chars.js.map +1 -1
  5. package/dist/buffer/ascii/ascii-encoder.js +9 -5
  6. package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
  7. package/dist/buffer/ascii/ascii-parser-state.d.ts +2 -2
  8. package/dist/buffer/ascii/ascii-parser-state.js +1 -1
  9. package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
  10. package/dist/buffer/ascii/ascii-parser.d.ts +2 -2
  11. package/dist/buffer/ascii/ascii-parser.js +17 -11
  12. package/dist/buffer/ascii/ascii-parser.js.map +1 -1
  13. package/dist/buffer/ascii/ascii-segment-parser.d.ts +1 -1
  14. package/dist/buffer/ascii/ascii-segment-parser.js +11 -3
  15. package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
  16. package/dist/buffer/ascii/ascii-view.d.ts +3 -3
  17. package/dist/buffer/ascii/ascii-view.js +18 -0
  18. package/dist/buffer/ascii/ascii-view.js.map +1 -1
  19. package/dist/buffer/ascii/itime-formatter.d.ts +12 -12
  20. package/dist/buffer/ascii/itime-formatter.js.map +1 -1
  21. package/dist/buffer/ascii/time-formatter.d.ts +6 -6
  22. package/dist/buffer/ascii/time-formatter.js.map +1 -1
  23. package/dist/buffer/elastic-buffer.d.ts +1 -1
  24. package/dist/buffer/elastic-buffer.js +2 -2
  25. package/dist/buffer/elastic-buffer.js.map +1 -1
  26. package/dist/buffer/encode-proxy.js +1 -1
  27. package/dist/buffer/encode-proxy.js.map +1 -1
  28. package/dist/buffer/encoder-state.d.ts +2 -2
  29. package/dist/buffer/encoder-state.js +4 -1
  30. package/dist/buffer/encoder-state.js.map +1 -1
  31. package/dist/buffer/fixml/fixml-encoder.js +4 -2
  32. package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
  33. package/dist/buffer/fixml/fixml-parser.js +61 -39
  34. package/dist/buffer/fixml/fixml-parser.js.map +1 -1
  35. package/dist/buffer/fixml/fixml-view.js +3 -3
  36. package/dist/buffer/fixml/fixml-view.js.map +1 -1
  37. package/dist/buffer/fixml/populated-attributes.js.map +1 -1
  38. package/dist/buffer/msg-encoder.js +2 -1
  39. package/dist/buffer/msg-encoder.js.map +1 -1
  40. package/dist/buffer/msg-view.d.ts +9 -9
  41. package/dist/buffer/msg-view.js +58 -25
  42. package/dist/buffer/msg-view.js.map +1 -1
  43. package/dist/buffer/segment/segment-description.d.ts +4 -4
  44. package/dist/buffer/segment/segment-description.js +7 -5
  45. package/dist/buffer/segment/segment-description.js.map +1 -1
  46. package/dist/buffer/segment/segment-summary.js +2 -1
  47. package/dist/buffer/segment/segment-summary.js.map +1 -1
  48. package/dist/buffer/structure.d.ts +1 -1
  49. package/dist/buffer/structure.js +1 -2
  50. package/dist/buffer/structure.js.map +1 -1
  51. package/dist/buffer/time-format-template.js.map +1 -1
  52. package/dist/collections/collection.d.ts +3 -7
  53. package/dist/collections/collection.js.map +1 -1
  54. package/dist/collections/dictionary.d.ts +1 -1
  55. package/dist/collections/dictionary.js +2 -1
  56. package/dist/collections/dictionary.js.map +1 -1
  57. package/dist/config/empty-log-factory.js.map +1 -1
  58. package/dist/config/get-js-fx-logger.d.ts +1 -3
  59. package/dist/config/get-js-fx-logger.js.map +1 -1
  60. package/dist/config/js-fix-config.d.ts +3 -3
  61. package/dist/config/js-fix-config.js.map +1 -1
  62. package/dist/config/js-fix-logger.d.ts +5 -5
  63. package/dist/config/js-fix-logger.js.map +1 -1
  64. package/dist/config/js-fix-winston-log-factory.d.ts +1 -1
  65. package/dist/config/js-fix-winston-log-factory.js.map +1 -1
  66. package/dist/config/winston-logger.js +7 -7
  67. package/dist/config/winston-logger.js.map +1 -1
  68. package/dist/dict-parser.js +27 -21
  69. package/dist/dict-parser.js.map +1 -1
  70. package/dist/dictionary/compiler/compiler-settings.js.map +1 -1
  71. package/dist/dictionary/compiler/compiler-type.js.map +1 -1
  72. package/dist/dictionary/compiler/enum-compiler.d.ts +2 -2
  73. package/dist/dictionary/compiler/enum-compiler.js +7 -10
  74. package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
  75. package/dist/dictionary/compiler/msg-compiler.js +9 -10
  76. package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
  77. package/dist/dictionary/compiler/standard-snippet.d.ts +1 -1
  78. package/dist/dictionary/compiler/standard-snippet.js +11 -10
  79. package/dist/dictionary/compiler/standard-snippet.js.map +1 -1
  80. package/dist/dictionary/contained/contained-component-field.d.ts +2 -2
  81. package/dist/dictionary/contained/contained-component-field.js +1 -1
  82. package/dist/dictionary/contained/contained-component-field.js.map +1 -1
  83. package/dist/dictionary/contained/contained-field-dispatcher.d.ts +3 -9
  84. package/dist/dictionary/contained/contained-field-dispatcher.js.map +1 -1
  85. package/dist/dictionary/contained/contained-field-set.d.ts +4 -4
  86. package/dist/dictionary/contained/contained-field-set.js +1 -1
  87. package/dist/dictionary/contained/contained-field-set.js.map +1 -1
  88. package/dist/dictionary/contained/contained-field.d.ts +1 -0
  89. package/dist/dictionary/contained/contained-field.js +3 -0
  90. package/dist/dictionary/contained/contained-field.js.map +1 -1
  91. package/dist/dictionary/contained/contained-group-field.d.ts +2 -2
  92. package/dist/dictionary/contained/contained-group-field.js +1 -1
  93. package/dist/dictionary/contained/contained-group-field.js.map +1 -1
  94. package/dist/dictionary/contained/contained-simple-field.d.ts +2 -2
  95. package/dist/dictionary/contained/contained-simple-field.js +1 -1
  96. package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
  97. package/dist/dictionary/contained/field-dispatcher.d.ts +3 -9
  98. package/dist/dictionary/contained/field-dispatcher.js.map +1 -1
  99. package/dist/dictionary/contained/fields-dispatch.js +0 -1
  100. package/dist/dictionary/contained/fields-dispatch.js.map +1 -1
  101. package/dist/dictionary/definition/component-field-definition.d.ts +3 -3
  102. package/dist/dictionary/definition/component-field-definition.js +1 -1
  103. package/dist/dictionary/definition/component-field-definition.js.map +1 -1
  104. package/dist/dictionary/definition/fix-definitions.d.ts +3 -3
  105. package/dist/dictionary/definition/fix-definitions.js +3 -2
  106. package/dist/dictionary/definition/fix-definitions.js.map +1 -1
  107. package/dist/dictionary/definition/group-field-definition.d.ts +4 -4
  108. package/dist/dictionary/definition/group-field-definition.js +1 -1
  109. package/dist/dictionary/definition/group-field-definition.js.map +1 -1
  110. package/dist/dictionary/definition/message-definition.d.ts +2 -2
  111. package/dist/dictionary/definition/message-definition.js.map +1 -1
  112. package/dist/dictionary/definition/simple-field-definition.d.ts +4 -4
  113. package/dist/dictionary/definition/simple-field-definition.js +3 -2
  114. package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
  115. package/dist/dictionary/dict-primitive.d.ts +1 -1
  116. package/dist/dictionary/dict-primitive.js.map +1 -1
  117. package/dist/dictionary/field-enum.js.map +1 -1
  118. package/dist/dictionary/fix-versions.js.map +1 -1
  119. package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +20 -18
  120. package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
  121. package/dist/dictionary/parser/fix-repository/repository.js +24 -16
  122. package/dist/dictionary/parser/fix-repository/repository.js.map +1 -1
  123. package/dist/dictionary/parser/fixml/components-parser.d.ts +1 -1
  124. package/dist/dictionary/parser/fixml/components-parser.js +24 -15
  125. package/dist/dictionary/parser/fixml/components-parser.js.map +1 -1
  126. package/dist/dictionary/parser/fixml/fields-parser.d.ts +1 -1
  127. package/dist/dictionary/parser/fixml/fields-parser.js +5 -5
  128. package/dist/dictionary/parser/fixml/fields-parser.js.map +1 -1
  129. package/dist/dictionary/parser/fixml/fix-xsd-parser.js +3 -2
  130. package/dist/dictionary/parser/fixml/fix-xsd-parser.js.map +1 -1
  131. package/dist/dictionary/parser/fixml/include-graph.d.ts +1 -1
  132. package/dist/dictionary/parser/fixml/include-graph.js +58 -48
  133. package/dist/dictionary/parser/fixml/include-graph.js.map +1 -1
  134. package/dist/dictionary/parser/fixml/xsd-parser.d.ts +1 -1
  135. package/dist/dictionary/parser/fixml/xsd-parser.js +34 -23
  136. package/dist/dictionary/parser/fixml/xsd-parser.js.map +1 -1
  137. package/dist/dictionary/parser/quickfix/field-definition-parser.js +0 -2
  138. package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
  139. package/dist/dictionary/parser/quickfix/field-set-parser.js +3 -2
  140. package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
  141. package/dist/dictionary/parser/quickfix/message-parser.js +10 -5
  142. package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
  143. package/dist/dictionary/parser/quickfix/node-parser.js +14 -8
  144. package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
  145. package/dist/dictionary/parser/quickfix/parse-context.d.ts +5 -5
  146. package/dist/dictionary/parser/quickfix/parse-context.js.map +1 -1
  147. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +22 -19
  148. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
  149. package/dist/dictionary/set-reduce.js.map +1 -1
  150. package/dist/dictionary/type-dispatcher.d.ts +3 -9
  151. package/dist/dictionary/type-dispatcher.js.map +1 -1
  152. package/dist/dictionary/version-util.js +8 -8
  153. package/dist/dictionary/version-util.js.map +1 -1
  154. package/dist/jsfix-cmd.d.ts +3 -1
  155. package/dist/jsfix-cmd.js +134 -99
  156. package/dist/jsfix-cmd.js.map +1 -1
  157. package/dist/runtime/make-config.js +34 -14
  158. package/dist/runtime/make-config.js.map +1 -1
  159. package/dist/runtime/session-container.d.ts +3 -2
  160. package/dist/runtime/session-container.js +36 -16
  161. package/dist/runtime/session-container.js.map +1 -1
  162. package/dist/runtime/session-launcher.d.ts +10 -6
  163. package/dist/runtime/session-launcher.js +80 -43
  164. package/dist/runtime/session-launcher.js.map +1 -1
  165. package/dist/sample/http/oms/app.js +37 -7
  166. package/dist/sample/http/oms/app.js.map +1 -1
  167. package/dist/sample/http/oms/http-client.js +4 -2
  168. package/dist/sample/http/oms/http-client.js.map +1 -1
  169. package/dist/sample/http/oms/http-server.js +7 -1
  170. package/dist/sample/http/oms/http-server.js.map +1 -1
  171. package/dist/sample/http/oms/oms-factory.js +4 -3
  172. package/dist/sample/http/oms/oms-factory.js.map +1 -1
  173. package/dist/sample/tcp/qf-md/app.js +3 -3
  174. package/dist/sample/tcp/qf-md/app.js.map +1 -1
  175. package/dist/sample/tcp/qf-md/md-client.js +2 -1
  176. package/dist/sample/tcp/qf-md/md-client.js.map +1 -1
  177. package/dist/sample/tcp/qf-md/md-factory.js.map +1 -1
  178. package/dist/sample/tcp/qf-md/md-server.d.ts +1 -1
  179. package/dist/sample/tcp/qf-md/md-server.js +2 -1
  180. package/dist/sample/tcp/qf-md/md-server.js.map +1 -1
  181. package/dist/sample/tcp/recovering-skeleton/app.js +29 -16
  182. package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -1
  183. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +9 -1
  184. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +51 -2
  185. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
  186. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +2 -1
  187. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -1
  188. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +4 -3
  189. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -1
  190. package/dist/sample/tcp/skeleton/app.js.map +1 -1
  191. package/dist/sample/tcp/skeleton/skeleton-session.js +7 -4
  192. package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
  193. package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
  194. package/dist/sample/tcp/trade-capture/app-launcher.js +3 -3
  195. package/dist/sample/tcp/trade-capture/app-launcher.js.map +1 -1
  196. package/dist/sample/tcp/trade-capture/trade-capture-client.d.ts +1 -1
  197. package/dist/sample/tcp/trade-capture/trade-capture-client.js +2 -1
  198. package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
  199. package/dist/sample/tcp/trade-capture/trade-capture-server.js +7 -2
  200. package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -1
  201. package/dist/sample/tcp/trade-capture/trade-factory.js.map +1 -1
  202. package/dist/store/fix-msg-ascii-store-resend.js +18 -7
  203. package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
  204. package/dist/store/fix-msg-memory-store.d.ts +3 -3
  205. package/dist/store/fix-msg-memory-store.js +93 -69
  206. package/dist/store/fix-msg-memory-store.js.map +1 -1
  207. package/dist/store/fix-msg-store-record.d.ts +6 -6
  208. package/dist/store/fix-msg-store-record.js +2 -1
  209. package/dist/store/fix-msg-store-record.js.map +1 -1
  210. package/dist/store/fix-msg-store-state.js.map +1 -1
  211. package/dist/store/fix-msg-store.d.ts +7 -7
  212. package/dist/store/fix-msg-store.js.map +1 -1
  213. package/dist/test/ascii/ascii-encoder.test.js +93 -63
  214. package/dist/test/ascii/ascii-encoder.test.js.map +1 -1
  215. package/dist/test/ascii/ascii-parser.test.js +28 -24
  216. package/dist/test/ascii/ascii-parser.test.js.map +1 -1
  217. package/dist/test/ascii/ascii-segment.test.js +16 -11
  218. package/dist/test/ascii/ascii-segment.test.js.map +1 -1
  219. package/dist/test/ascii/ascii-store-replay.test.js +1 -1
  220. package/dist/test/ascii/ascii-store-replay.test.js.map +1 -1
  221. package/dist/test/ascii/ascii-tag-pos.test.js +7 -3
  222. package/dist/test/ascii/ascii-tag-pos.test.js.map +1 -1
  223. package/dist/test/ascii/execution-report.test.js +80 -72
  224. package/dist/test/ascii/execution-report.test.js.map +1 -1
  225. package/dist/test/ascii/fix-log-replay.test.js +1 -1
  226. package/dist/test/ascii/fix-log-replay.test.js.map +1 -1
  227. package/dist/test/ascii/fix-repo-dict.test.js +58 -55
  228. package/dist/test/ascii/fix-repo-dict.test.js.map +1 -1
  229. package/dist/test/ascii/includes.test.js +1 -1
  230. package/dist/test/ascii/includes.test.js.map +1 -1
  231. package/dist/test/ascii/logon.test.js +3 -3
  232. package/dist/test/ascii/logon.test.js.map +1 -1
  233. package/dist/test/ascii/memory-store.test.js +3 -3
  234. package/dist/test/ascii/memory-store.test.js.map +1 -1
  235. package/dist/test/ascii/qf-full-msg.test.js +19 -16
  236. package/dist/test/ascii/qf-full-msg.test.js.map +1 -1
  237. package/dist/test/ascii/repo-full-ascii-msg.test.js +11 -11
  238. package/dist/test/ascii/repo-full-ascii-msg.test.js.map +1 -1
  239. package/dist/test/ascii/session-state.test.js.map +1 -1
  240. package/dist/test/ascii/session.test.js +59 -42
  241. package/dist/test/ascii/session.test.js.map +1 -1
  242. package/dist/test/ascii/view-decode.test.js +30 -22
  243. package/dist/test/ascii/view-decode.test.js.map +1 -1
  244. package/dist/test/encode-proxy.test.js +29 -29
  245. package/dist/test/encode-proxy.test.js.map +1 -1
  246. package/dist/test/env/experiment.js +5 -5
  247. package/dist/test/env/experiment.js.map +1 -1
  248. package/dist/test/env/parsing-result.d.ts +3 -3
  249. package/dist/test/env/parsing-result.js.map +1 -1
  250. package/dist/test/env/setup.d.ts +2 -2
  251. package/dist/test/env/setup.js +13 -11
  252. package/dist/test/env/setup.js.map +1 -1
  253. package/dist/test/env/skeleton-runner.d.ts +1 -1
  254. package/dist/test/env/skeleton-runner.js +16 -16
  255. package/dist/test/env/skeleton-runner.js.map +1 -1
  256. package/dist/test/env/test-recovery.d.ts +3 -3
  257. package/dist/test/env/test-recovery.js +1 -1
  258. package/dist/test/env/test-recovery.js.map +1 -1
  259. package/dist/test/env/to-views.d.ts +1 -1
  260. package/dist/test/env/to-views.js +2 -2
  261. package/dist/test/env/to-views.js.map +1 -1
  262. package/dist/test/fixml/fixml-alloc-parse.test.js +32 -15
  263. package/dist/test/fixml/fixml-alloc-parse.test.js.map +1 -1
  264. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js +2 -2
  265. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js.map +1 -1
  266. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js +2 -1
  267. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js.map +1 -1
  268. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js +19 -12
  269. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js.map +1 -1
  270. package/dist/test/fixml/repo-full-fixml-msg.test.js +2 -2
  271. package/dist/test/fixml/repo-full-fixml-msg.test.js.map +1 -1
  272. package/dist/transport/ascii/ascii-msg-transmitter.d.ts +1 -1
  273. package/dist/transport/ascii/ascii-msg-transmitter.js +18 -8
  274. package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
  275. package/dist/transport/ascii/ascii-session-msg-factory.d.ts +3 -3
  276. package/dist/transport/ascii/ascii-session-msg-factory.js +4 -2
  277. package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -1
  278. package/dist/transport/ascii/ascii-session.d.ts +1 -1
  279. package/dist/transport/ascii/ascii-session.js +34 -16
  280. package/dist/transport/ascii/ascii-session.js.map +1 -1
  281. package/dist/transport/duplex/http-duplex.js +10 -8
  282. package/dist/transport/duplex/http-duplex.js.map +1 -1
  283. package/dist/transport/duplex/string-duplex.js +2 -2
  284. package/dist/transport/duplex/string-duplex.js.map +1 -1
  285. package/dist/transport/factory/msg-transport.js +21 -10
  286. package/dist/transport/factory/msg-transport.js.map +1 -1
  287. package/dist/transport/fix-acceptor.d.ts +3 -3
  288. package/dist/transport/fix-acceptor.js.map +1 -1
  289. package/dist/transport/fix-entity.d.ts +1 -1
  290. package/dist/transport/fix-entity.js.map +1 -1
  291. package/dist/transport/fix-initiator.d.ts +2 -2
  292. package/dist/transport/fix-initiator.js.map +1 -1
  293. package/dist/transport/fixml/fixml-msg-transmitter.d.ts +1 -1
  294. package/dist/transport/fixml/fixml-msg-transmitter.js +4 -2
  295. package/dist/transport/fixml/fixml-msg-transmitter.js.map +1 -1
  296. package/dist/transport/fixml/fixml-session-msg-factory.d.ts +1 -1
  297. package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -1
  298. package/dist/transport/fixml/fixml-session.js +7 -3
  299. package/dist/transport/fixml/fixml-session.js.map +1 -1
  300. package/dist/transport/http/html-options.d.ts +2 -2
  301. package/dist/transport/http/html-options.js.map +1 -1
  302. package/dist/transport/http/html-route.js.map +1 -1
  303. package/dist/transport/http/http-acceptor-listener.js +27 -23
  304. package/dist/transport/http/http-acceptor-listener.js.map +1 -1
  305. package/dist/transport/http/http-acceptor.d.ts +2 -2
  306. package/dist/transport/http/http-acceptor.js +52 -41
  307. package/dist/transport/http/http-acceptor.js.map +1 -1
  308. package/dist/transport/http/http-adapter.d.ts +3 -3
  309. package/dist/transport/http/http-adapter.js.map +1 -1
  310. package/dist/transport/http/http-initiator.js +35 -23
  311. package/dist/transport/http/http-initiator.js.map +1 -1
  312. package/dist/transport/http/http-json-sample-adapter.d.ts +4 -4
  313. package/dist/transport/http/http-json-sample-adapter.js +16 -11
  314. package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
  315. package/dist/transport/http/http-transaction.js.map +1 -1
  316. package/dist/transport/http/http-transport-description.js.map +1 -1
  317. package/dist/transport/msg-application.js.map +1 -1
  318. package/dist/transport/msg-transmitter.d.ts +1 -1
  319. package/dist/transport/msg-transmitter.js +2 -2
  320. package/dist/transport/msg-transmitter.js.map +1 -1
  321. package/dist/transport/session/a-session-msg-factory.d.ts +3 -5
  322. package/dist/transport/session/a-session-msg-factory.js.map +1 -1
  323. package/dist/transport/session/fix-session-state.d.ts +8 -5
  324. package/dist/transport/session/fix-session-state.js +21 -16
  325. package/dist/transport/session/fix-session-state.js.map +1 -1
  326. package/dist/transport/session/fix-session.d.ts +19 -6
  327. package/dist/transport/session/fix-session.js +197 -110
  328. package/dist/transport/session/fix-session.js.map +1 -1
  329. package/dist/transport/session/make-fix-session.d.ts +1 -3
  330. package/dist/transport/session/make-fix-session.js.map +1 -1
  331. package/dist/transport/session/session-description.d.ts +1 -1
  332. package/dist/transport/session/session-description.js.map +1 -1
  333. package/dist/transport/session/session-msg-factory.d.ts +9 -9
  334. package/dist/transport/session/session-msg-factory.js.map +1 -1
  335. package/dist/transport/tcp/recovering-tcp-initiator.d.ts +4 -2
  336. package/dist/transport/tcp/recovering-tcp-initiator.js +62 -30
  337. package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -1
  338. package/dist/transport/tcp/tcp-acceptor-listener.js +28 -25
  339. package/dist/transport/tcp/tcp-acceptor-listener.js.map +1 -1
  340. package/dist/transport/tcp/tcp-acceptor.d.ts +2 -2
  341. package/dist/transport/tcp/tcp-acceptor.js +23 -15
  342. package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
  343. package/dist/transport/tcp/tcp-initiator-connector.js +39 -30
  344. package/dist/transport/tcp/tcp-initiator-connector.js.map +1 -1
  345. package/dist/transport/tcp/tcp-initiator.d.ts +1 -1
  346. package/dist/transport/tcp/tcp-initiator.js +130 -104
  347. package/dist/transport/tcp/tcp-initiator.js.map +1 -1
  348. package/dist/transport/tcp/tcp-transport-description.js.map +1 -1
  349. package/dist/transport/tcp/tls-options-factory.d.ts +3 -3
  350. package/dist/transport/tcp/tls-options-factory.js +10 -3
  351. package/dist/transport/tcp/tls-options-factory.js.map +1 -1
  352. package/dist/transport/tcp/tls-options.d.ts +6 -2
  353. package/dist/transport/tcp/tls-options.js.map +1 -1
  354. package/dist/util/json-helper.js +2 -1
  355. package/dist/util/json-helper.js.map +1 -1
  356. package/dist/util/message-generator.d.ts +1 -1
  357. package/dist/util/message-generator.js +1 -1
  358. package/dist/util/message-generator.js.map +1 -1
  359. package/package.json +53 -48
  360. package/src/buffer/ascii/ascii-chars.ts +0 -1
  361. package/src/buffer/ascii/ascii-encoder.ts +18 -16
  362. package/src/buffer/ascii/ascii-parser-state.ts +4 -4
  363. package/src/buffer/ascii/ascii-parser.ts +16 -13
  364. package/src/buffer/ascii/ascii-segment-parser.ts +16 -15
  365. package/src/buffer/ascii/ascii-view.ts +22 -14
  366. package/src/buffer/ascii/itime-formatter.ts +12 -12
  367. package/src/buffer/ascii/time-formatter.ts +11 -12
  368. package/src/buffer/elastic-buffer.ts +5 -6
  369. package/src/buffer/encode-proxy.ts +6 -5
  370. package/src/buffer/encoder-state.ts +7 -3
  371. package/src/buffer/fixml/fixml-encoder.ts +10 -10
  372. package/src/buffer/fixml/fixml-parser.ts +80 -60
  373. package/src/buffer/fixml/fixml-view.ts +6 -7
  374. package/src/buffer/fixml/populated-attributes.ts +1 -1
  375. package/src/buffer/msg-encoder.ts +2 -1
  376. package/src/buffer/msg-view.ts +73 -53
  377. package/src/buffer/segment/segment-description.ts +13 -13
  378. package/src/buffer/segment/segment-summary.ts +3 -2
  379. package/src/buffer/structure.ts +6 -6
  380. package/src/buffer/time-format-template.ts +1 -1
  381. package/src/collections/collection.ts +2 -6
  382. package/src/collections/dictionary.ts +4 -5
  383. package/src/config/empty-log-factory.ts +1 -0
  384. package/src/config/get-js-fx-logger.ts +1 -2
  385. package/src/config/js-fix-config.ts +6 -6
  386. package/src/config/js-fix-logger.ts +14 -9
  387. package/src/config/js-fix-winston-log-factory.ts +2 -1
  388. package/src/config/winston-logger.ts +9 -7
  389. package/src/dictionary/compiler/compiler-settings.ts +5 -5
  390. package/src/dictionary/compiler/compiler-type.ts +1 -1
  391. package/src/dictionary/compiler/enum-compiler.ts +14 -16
  392. package/src/dictionary/compiler/msg-compiler.ts +15 -17
  393. package/src/dictionary/compiler/standard-snippet.ts +28 -27
  394. package/src/dictionary/contained/contained-component-field.ts +5 -4
  395. package/src/dictionary/contained/contained-field-dispatcher.ts +3 -3
  396. package/src/dictionary/contained/contained-field-set.ts +21 -21
  397. package/src/dictionary/contained/contained-field.ts +4 -1
  398. package/src/dictionary/contained/contained-group-field.ts +4 -4
  399. package/src/dictionary/contained/contained-simple-field.ts +5 -5
  400. package/src/dictionary/contained/field-dispatcher.ts +3 -3
  401. package/src/dictionary/contained/fields-dispatch.ts +0 -1
  402. package/src/dictionary/definition/component-field-definition.ts +4 -4
  403. package/src/dictionary/definition/fix-definitions.ts +8 -8
  404. package/src/dictionary/definition/group-field-definition.ts +5 -5
  405. package/src/dictionary/definition/message-definition.ts +4 -4
  406. package/src/dictionary/definition/simple-field-definition.ts +9 -9
  407. package/src/dictionary/dict-primitive.ts +2 -2
  408. package/src/dictionary/field-enum.ts +3 -2
  409. package/src/dictionary/fix-versions.ts +10 -10
  410. package/src/dictionary/parser/fix-repository/repository-xml-parser.ts +7 -8
  411. package/src/dictionary/parser/fix-repository/repository.ts +38 -30
  412. package/src/dictionary/parser/fixml/components-parser.ts +57 -51
  413. package/src/dictionary/parser/fixml/fields-parser.ts +9 -10
  414. package/src/dictionary/parser/fixml/fix-xsd-parser.ts +2 -3
  415. package/src/dictionary/parser/fixml/include-graph.ts +26 -21
  416. package/src/dictionary/parser/fixml/xsd-parser.ts +5 -5
  417. package/src/dictionary/parser/quickfix/field-definition-parser.ts +3 -5
  418. package/src/dictionary/parser/quickfix/field-set-parser.ts +2 -2
  419. package/src/dictionary/parser/quickfix/message-parser.ts +9 -6
  420. package/src/dictionary/parser/quickfix/node-parser.ts +20 -18
  421. package/src/dictionary/parser/quickfix/parse-context.ts +4 -4
  422. package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +13 -15
  423. package/src/dictionary/set-reduce.ts +4 -3
  424. package/src/dictionary/type-dispatcher.ts +3 -3
  425. package/src/dictionary/version-util.ts +8 -8
  426. package/src/jsfix-cmd.ts +82 -58
  427. package/src/runtime/make-config.ts +15 -10
  428. package/src/runtime/session-container.ts +26 -18
  429. package/src/runtime/session-launcher.ts +58 -30
  430. package/src/sample/http/oms/app.ts +24 -7
  431. package/src/sample/http/oms/http-client.ts +3 -3
  432. package/src/sample/http/oms/http-server.ts +7 -1
  433. package/src/sample/http/oms/oms-factory.ts +3 -3
  434. package/src/sample/tcp/qf-md/app.ts +3 -3
  435. package/src/sample/tcp/qf-md/md-client.ts +1 -1
  436. package/src/sample/tcp/qf-md/md-factory.ts +3 -2
  437. package/src/sample/tcp/qf-md/md-server.ts +2 -2
  438. package/src/sample/tcp/recovering-skeleton/app.ts +37 -20
  439. package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +66 -4
  440. package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +2 -2
  441. package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +4 -4
  442. package/src/sample/tcp/skeleton/app.ts +1 -1
  443. package/src/sample/tcp/skeleton/skeleton-session.ts +7 -7
  444. package/src/sample/tcp/tls-trade-capture/app.ts +1 -1
  445. package/src/sample/tcp/trade-capture/app-launcher.ts +4 -4
  446. package/src/sample/tcp/trade-capture/trade-capture-client.ts +7 -5
  447. package/src/sample/tcp/trade-capture/trade-capture-server.ts +10 -5
  448. package/src/sample/tcp/trade-capture/trade-factory.ts +1 -1
  449. package/src/store/fix-msg-ascii-store-resend.ts +5 -6
  450. package/src/store/fix-msg-memory-store.ts +22 -21
  451. package/src/store/fix-msg-store-record.ts +8 -8
  452. package/src/store/fix-msg-store-state.ts +2 -2
  453. package/src/store/fix-msg-store.ts +7 -7
  454. package/src/transport/ascii/ascii-msg-transmitter.ts +20 -14
  455. package/src/transport/ascii/ascii-session-msg-factory.ts +5 -6
  456. package/src/transport/ascii/ascii-session.ts +40 -29
  457. package/src/transport/duplex/http-duplex.ts +11 -9
  458. package/src/transport/duplex/string-duplex.ts +4 -5
  459. package/src/transport/factory/msg-transport.ts +5 -6
  460. package/src/transport/fix-acceptor.ts +2 -2
  461. package/src/transport/fix-entity.ts +1 -1
  462. package/src/transport/fix-initiator.ts +1 -1
  463. package/src/transport/fixml/fixml-msg-transmitter.ts +4 -3
  464. package/src/transport/fixml/fixml-session-msg-factory.ts +1 -2
  465. package/src/transport/fixml/fixml-session.ts +7 -6
  466. package/src/transport/http/html-options.ts +5 -5
  467. package/src/transport/http/html-route.ts +1 -1
  468. package/src/transport/http/http-acceptor-listener.ts +6 -4
  469. package/src/transport/http/http-acceptor.ts +36 -34
  470. package/src/transport/http/http-adapter.ts +3 -3
  471. package/src/transport/http/http-initiator.ts +22 -16
  472. package/src/transport/http/http-json-sample-adapter.ts +17 -16
  473. package/src/transport/http/http-transaction.ts +1 -1
  474. package/src/transport/http/http-transport-description.ts +1 -1
  475. package/src/transport/msg-application.ts +4 -4
  476. package/src/transport/msg-transmitter.ts +5 -5
  477. package/src/transport/session/a-session-msg-factory.ts +2 -3
  478. package/src/transport/session/fix-session-state.ts +24 -18
  479. package/src/transport/session/fix-session.ts +169 -96
  480. package/src/transport/session/make-fix-session.ts +1 -2
  481. package/src/transport/session/session-description.ts +2 -2
  482. package/src/transport/session/session-msg-factory.ts +9 -9
  483. package/src/transport/tcp/recovering-tcp-initiator.ts +39 -21
  484. package/src/transport/tcp/tcp-acceptor-listener.ts +4 -3
  485. package/src/transport/tcp/tcp-acceptor.ts +23 -22
  486. package/src/transport/tcp/tcp-initiator-connector.ts +16 -10
  487. package/src/transport/tcp/tcp-initiator.ts +57 -46
  488. package/src/transport/tcp/tcp-transport-description.ts +1 -1
  489. package/src/transport/tcp/tls-options-factory.ts +21 -8
  490. package/src/transport/tcp/tls-options.ts +11 -7
  491. package/src/util/json-helper.ts +6 -5
  492. package/src/util/message-generator.ts +6 -7
  493. package/tsconfig.json +2 -0
  494. package/.eslintrc.js +0 -6
  495. package/dist/buffer/ascii-chars.d.ts +0 -22
  496. package/dist/buffer/ascii-chars.js +0 -29
  497. package/dist/buffer/ascii-chars.js.map +0 -1
  498. package/dist/buffer/segment-description.d.ts +0 -33
  499. package/dist/buffer/segment-description.js +0 -80
  500. package/dist/buffer/segment-description.js.map +0 -1
  501. package/dist/buffer/segment-summary.d.ts +0 -13
  502. package/dist/buffer/segment-summary.js +0 -20
  503. package/dist/buffer/segment-summary.js.map +0 -1
  504. package/dist/buffer/tag-pos.d.ts +0 -12
  505. package/dist/buffer/tag-pos.js +0 -55
  506. package/dist/buffer/tag-pos.js.map +0 -1
  507. package/dist/buffer/tags.d.ts +0 -32
  508. package/dist/buffer/tags.js +0 -135
  509. package/dist/buffer/tags.js.map +0 -1
  510. package/dist/dictionary/fields-dispatch.d.ts +0 -13
  511. package/dist/dictionary/fields-dispatch.js +0 -40
  512. package/dist/dictionary/fields-dispatch.js.map +0 -1
  513. package/dist/sample/launcher.d.ts +0 -12
  514. package/dist/sample/launcher.js +0 -63
  515. package/dist/sample/launcher.js.map +0 -1
  516. package/dist/test/ascii-encoder.test.d.ts +0 -1
  517. package/dist/test/ascii-encoder.test.js +0 -529
  518. package/dist/test/ascii-encoder.test.js.map +0 -1
  519. package/dist/test/ascii-parser.test.d.ts +0 -1
  520. package/dist/test/ascii-parser.test.js +0 -142
  521. package/dist/test/ascii-parser.test.js.map +0 -1
  522. package/dist/test/ascii-segment.test.d.ts +0 -1
  523. package/dist/test/ascii-segment.test.js +0 -107
  524. package/dist/test/ascii-segment.test.js.map +0 -1
  525. package/dist/test/ascii-store-replay.test.d.ts +0 -1
  526. package/dist/test/ascii-store-replay.test.js +0 -121
  527. package/dist/test/ascii-store-replay.test.js.map +0 -1
  528. package/dist/test/ascii-tag-pos.test.d.ts +0 -1
  529. package/dist/test/ascii-tag-pos.test.js +0 -105
  530. package/dist/test/ascii-tag-pos.test.js.map +0 -1
  531. package/dist/test/execution-report.test.d.ts +0 -1
  532. package/dist/test/execution-report.test.js +0 -490
  533. package/dist/test/execution-report.test.js.map +0 -1
  534. package/dist/test/fix-log-replay.test.d.ts +0 -1
  535. package/dist/test/fix-log-replay.test.js +0 -45
  536. package/dist/test/fix-log-replay.test.js.map +0 -1
  537. package/dist/test/fix-repo-dict.test.d.ts +0 -1
  538. package/dist/test/fix-repo-dict.test.js +0 -127
  539. package/dist/test/fix-repo-dict.test.js.map +0 -1
  540. package/dist/test/fixml-alloc-parse.test.d.ts +0 -1
  541. package/dist/test/fixml-alloc-parse.test.js +0 -160
  542. package/dist/test/fixml-alloc-parse.test.js.map +0 -1
  543. package/dist/test/fixml-mkt-data-fut-parse.test.d.ts +0 -1
  544. package/dist/test/fixml-mkt-data-fut-parse.test.js +0 -60
  545. package/dist/test/fixml-mkt-data-fut-parse.test.js.map +0 -1
  546. package/dist/test/fixml-mkt-data-settle-parse.test.d.ts +0 -1
  547. package/dist/test/fixml-mkt-data-settle-parse.test.js +0 -33
  548. package/dist/test/fixml-mkt-data-settle-parse.test.js.map +0 -1
  549. package/dist/test/fixml-tc-bi-lateral-parse.test.d.ts +0 -1
  550. package/dist/test/fixml-tc-bi-lateral-parse.test.js +0 -96
  551. package/dist/test/fixml-tc-bi-lateral-parse.test.js.map +0 -1
  552. package/dist/test/includes.test.d.ts +0 -1
  553. package/dist/test/includes.test.js +0 -42
  554. package/dist/test/includes.test.js.map +0 -1
  555. package/dist/test/logon.test.d.ts +0 -1
  556. package/dist/test/logon.test.js +0 -93
  557. package/dist/test/logon.test.js.map +0 -1
  558. package/dist/test/memory-store.test.d.ts +0 -1
  559. package/dist/test/memory-store.test.js +0 -75
  560. package/dist/test/memory-store.test.js.map +0 -1
  561. package/dist/test/qf-full-msg.test.d.ts +0 -1
  562. package/dist/test/qf-full-msg.test.js +0 -76
  563. package/dist/test/qf-full-msg.test.js.map +0 -1
  564. package/dist/test/repo-full-ascii-msg.test.d.ts +0 -1
  565. package/dist/test/repo-full-ascii-msg.test.js +0 -82
  566. package/dist/test/repo-full-ascii-msg.test.js.map +0 -1
  567. package/dist/test/repo-full-fixml-msg.test.d.ts +0 -1
  568. package/dist/test/repo-full-fixml-msg.test.js +0 -136
  569. package/dist/test/repo-full-fixml-msg.test.js.map +0 -1
  570. package/dist/test/session-state.test.d.ts +0 -1
  571. package/dist/test/session-state.test.js +0 -74
  572. package/dist/test/session-state.test.js.map +0 -1
  573. package/dist/test/session.test.d.ts +0 -1
  574. package/dist/test/session.test.js +0 -412
  575. package/dist/test/session.test.js.map +0 -1
  576. package/dist/test/time-formatter.test.d.ts +0 -1
  577. package/dist/test/time-formatter.test.js +0 -78
  578. package/dist/test/time-formatter.test.js.map +0 -1
  579. package/dist/test/to-views.d.ts +0 -11
  580. package/dist/test/to-views.js +0 -55
  581. package/dist/test/to-views.js.map +0 -1
  582. package/dist/test/view-decode.test.d.ts +0 -1
  583. package/dist/test/view-decode.test.js +0 -208
  584. package/dist/test/view-decode.test.js.map +0 -1
  585. package/dist/transport/a-session-msg-factory.d.ts +0 -23
  586. package/dist/transport/a-session-msg-factory.js +0 -58
  587. package/dist/transport/a-session-msg-factory.js.map +0 -1
  588. package/dist/transport/ascii-session-msg-factory.d.ts +0 -16
  589. package/dist/transport/ascii-session-msg-factory.js +0 -47
  590. package/dist/transport/ascii-session-msg-factory.js.map +0 -1
  591. package/dist/transport/fix-msg-factory.d.ts +0 -15
  592. package/dist/transport/fix-msg-factory.js +0 -3
  593. package/dist/transport/fix-msg-factory.js.map +0 -1
  594. package/dist/transport/fix-session-state-args.d.ts +0 -8
  595. package/dist/transport/fix-session-state-args.js +0 -3
  596. package/dist/transport/fix-session-state-args.js.map +0 -1
  597. package/dist/transport/fix-session-state.d.ts +0 -32
  598. package/dist/transport/fix-session-state.js +0 -133
  599. package/dist/transport/fix-session-state.js.map +0 -1
  600. package/dist/transport/fix-session.d.ts +0 -50
  601. package/dist/transport/fix-session.js +0 -290
  602. package/dist/transport/fix-session.js.map +0 -1
  603. package/dist/transport/fixml/acceptor.d.ts +0 -3
  604. package/dist/transport/fixml/acceptor.js +0 -38
  605. package/dist/transport/fixml/acceptor.js.map +0 -1
  606. package/dist/transport/fixml-session-msg-factory.d.ts +0 -13
  607. package/dist/transport/fixml-session-msg-factory.js +0 -68
  608. package/dist/transport/fixml-session-msg-factory.js.map +0 -1
  609. package/dist/transport/make-config.d.ts +0 -4
  610. package/dist/transport/make-config.js +0 -31
  611. package/dist/transport/make-config.js.map +0 -1
  612. package/dist/transport/make-fix-session.d.ts +0 -5
  613. package/dist/transport/make-fix-session.js +0 -3
  614. package/dist/transport/make-fix-session.js.map +0 -1
  615. package/dist/transport/make-fixl-session.d.ts +0 -5
  616. package/dist/transport/make-fixl-session.js +0 -3
  617. package/dist/transport/make-fixl-session.js.map +0 -1
  618. package/dist/transport/msg-transport.d.ts +0 -14
  619. package/dist/transport/msg-transport.js +0 -57
  620. package/dist/transport/msg-transport.js.map +0 -1
  621. package/dist/transport/session-description.d.ts +0 -64
  622. package/dist/transport/session-description.js +0 -3
  623. package/dist/transport/session-description.js.map +0 -1
  624. package/dist/transport/session-msg-factory.d.ts +0 -6
  625. package/dist/transport/session-msg-factory.js +0 -13
  626. package/dist/transport/session-msg-factory.js.map +0 -1
  627. package/dist/transport/session-state.d.ts +0 -25
  628. package/dist/transport/session-state.js +0 -30
  629. package/dist/transport/session-state.js.map +0 -1
  630. package/dist/transport/tcp/acceptor.d.ts +0 -3
  631. package/dist/transport/tcp/acceptor.js +0 -40
  632. package/dist/transport/tcp/acceptor.js.map +0 -1
  633. package/dist/transport/tcp/initiator.d.ts +0 -3
  634. package/dist/transport/tcp/initiator.js +0 -67
  635. package/dist/transport/tcp/initiator.js.map +0 -1
  636. package/dist/util/dictionary-definitions.d.ts +0 -8
  637. package/dist/util/dictionary-definitions.js +0 -51
  638. package/dist/util/dictionary-definitions.js.map +0 -1
  639. package/tslint.json +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jspurefix",
3
- "version": "2.2.1",
3
+ "version": "3.0.0",
4
4
  "description": "pure node js fix engine",
5
5
  "keywords": [
6
6
  "typescript",
@@ -24,57 +24,58 @@
24
24
  },
25
25
  "scripts": {
26
26
  "circular": "madge --circular --extensions js dist && madge --circular --extensions ts src",
27
- "test": "jest",
27
+ "test": "jest --maxWorkers=1 --coverage",
28
28
  "build": "tsc",
29
29
  "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
30
- "cmd": "cd dist && node jsfix-cmd",
31
- "repo44": "cd dist && node jsfix-cmd --dict=repo44",
32
- "repo44-unit": "cd dist && node jsfix-cmd --dict=repo44 --generate --density=0.8 --unit --delimiter=\"|\" --session=data/session/test-initiator.json",
33
- "repo44-script": "cd dist && node jsfix-cmd --dict=repo44 --generate --density=0.8 --script --delimiter=\"|\" --session=data/session/test-initiator.json",
34
- "repo44-replay": "cd dist && node jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --session=data/session/test-initiator.json",
35
- "repo44-repscr": "cd dist && node jsfix-cmd --dict=repo44 --fix=dist/fix.txt --delimiter=\"|\" --stats",
36
- "repo44-bench": "cd dist && node jsfix-cmd --dict=repo44 --benchmark --delimiter=\"|\"",
37
- "repo44-bench-er": "cd dist && node jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/execution-report/fix.txt --benchmark --delimiter=\"|\" --repeats=125000",
38
- "repo44-bench-tc": "cd dist && node jsfix-cmd ---dict=repo44 --fix=data/examples/FIX.4.4/repo/trade-capture/fix.txt --benchmark --delimiter=\"|\" --repeats=30000",
39
- "repo44-bench-sd": "cd dist && node jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/security-definition/fix.txt --benchmark --delimiter=\"|\" --repeats=150000",
40
- "repo44-bench-lo": "cd dist && node jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
41
- "qf-bench-lo": "cd dist && node jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/quickfix/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
42
- "fixml": "cd dist && node jsfix-cmd --dict=repofixml",
43
- "tcp-qf-md": "cd dist/sample/tcp/qf-md && node app",
44
- "tcp-tls-tc": "cd dist/sample/tcp/tls-trade-capture && node app",
45
- "tcp-tc": "cd dist/sample/tcp/trade-capture && node app",
46
- "tcp-rec-sk": "cd dist/sample/tcp/recovering-skeleton && node app",
47
- "tcp-sk": "cd dist/sample/tcp/skeleton && node app",
48
- "http-oms": "cd dist/sample/http/oms && node app",
49
- "repo40-compile": "cd dist && node jsfix-cmd \"--dict=repo40\" \"--compile\"",
50
- "repo41-compile": "cd dist && node jsfix-cmd \"--dict=repo41\" \"--compile\"",
51
- "repo42-compile": "cd dist && node jsfix-cmd \"--dict=repo42\" \"--compile\"",
52
- "repo43-compile": "cd dist && node jsfix-cmd \"--dict=repo43\" \"--compile\"",
53
- "repo44-compile": "cd dist && node jsfix-cmd \"--dict=repo44\" \"--compile\"",
54
- "repo50-compile": "cd dist && node jsfix-cmd \"--dict=repo50\" \"--compile\"",
55
- "repo50sp1-compile": "cd dist && node jsfix-cmd \"--dict=repo50sp1\" \"--compile\"",
56
- "repo50sp2-compile": "cd dist && node jsfix-cmd \"--dict=repo50sp2\" \"--compile\"",
57
- "repofixml-compile": "cd dist && node jsfix-cmd \"--dict=repofixml\" \"--compile\"",
58
- "qf44-compile": "cd dist && node jsfix-cmd \"--dict=qf44\" \"--compile\"",
59
- "qf43-compile": "cd dist && node jsfix-cmd \"--dict=qf43\" \"--compile\"",
60
- "qf42-compile": "cd dist && node jsfix-cmd \"--dict=qf42\" \"--compile\"",
30
+ "cmd": "node dist/jsfix-cmd",
31
+ "repo44": "node dist/jsfix-cmd --dict=repo44",
32
+ "repo44-unit": "node dist/jsfix-cmd --dict=repo44 --generate --density=0.8 --unit --delimiter=\"|\" --session=data/session/test-initiator.json",
33
+ "repo44-script": "node dist/jsfix-cmd --dict=repo44 --generate --density=0.8 --script --delimiter=\"|\" --session=data/session/test-initiator.json",
34
+ "repo44-replay": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --stats--delimiter=\"|\" --objects",
35
+ "repo44-repscr": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --stats--delimiter=\"|\" --stats",
36
+ "repo44-bench": "node dist/jsfix-cmd --dict=repo44 --benchmark --delimiter=\"|\"",
37
+ "qf44-bench-er": "node dist/jsfix-cmd --dict=qf44 --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt --benchmark --delimiter=\"|\" --repeats=80000",
38
+ "repo44-bench-er": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/execution-report/fix.txt --benchmark --delimiter=\"|\" --repeats=125000",
39
+ "repo44-bench-tc": "node dist/jsfix-cmd jsfix-cmd ---dict=repo44 --fix=data/examples/FIX.4.4/repo/trade-capture/fix.txt --benchmark --delimiter=\"|\" --repeats=30000",
40
+ "repo44-bench-sd": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/security-definition/fix.txt --benchmark --delimiter=\"|\" --repeats=150000",
41
+ "repo44-bench-lo": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
42
+ "qf-bench-lo": "node dist/jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/quickfix/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
43
+ "qf-bench-hb": "node dist/jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/quickfix/heartbeat/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
44
+ "fixml": "node dist/jsfix-cmd --dict=repofixml",
45
+ "tcp-qf-md": "node dist/sample/tcp/qf-md/app",
46
+ "tcp-tls-tc": "node dist/sample/tcp/tls-trade-capture/app",
47
+ "tcp-tc": "node dist/sample/tcp/trade-capture/app",
48
+ "tcp-rec-sk": "node dist/sample/tcp/recovering-skeleton/app",
49
+ "tcp-sk": "node dist/sample/tcp/skeleton/app",
50
+ "http-oms": "node dist/sample/http/oms/app",
51
+ "repo40-compile": "node dist/jsfix-cmd \"--dict=repo40\" \"--compile\"",
52
+ "repo41-compile": "node dist/jsfix-cmd \"--dict=repo41\" \"--compile\"",
53
+ "repo42-compile": "node dist/jsfix-cmd \"--dict=repo42\" \"--compile\"",
54
+ "repo43-compile": "node dist/jsfix-cmd \"--dict=repo43\" \"--compile\"",
55
+ "repo44-compile": "node dist/jsfix-cmd \"--dict=repo44\" \"--compile\"",
56
+ "repo50-compile": "node dist/jsfix-cmd \"--dict=repo50\" \"--compile\"",
57
+ "repo50sp1-compile": "node dist/jsfix-cmd \"--dict=repo50sp1\" \"--compile\"",
58
+ "repo50sp2-compile": "node dist/jsfix-cmd \"--dict=repo50sp2\" \"--compile\"",
59
+ "repofixml-compile": "node dist/jsfix-cmd \"--dict=repofixml\" \"--compile\"",
60
+ "qf44-compile": "node dist/jsfix-cmd \"--dict=qf44\" \"--compile\"",
61
+ "qf43-compile": "node dist/jsfix-cmd \"--dict=qf43\" \"--compile\"",
62
+ "qf42-compile": "node dist/jsfix-cmd \"--dict=qf42\" \"--compile\"",
61
63
  "unzip-repo": "cd data && node ../src/util/unzip fix_repo.zip",
62
- "fixml-test-print": "cd dist && node jsfix-cmd --session=data/session/test-http-initiator.json --fix=data/examples/fixml/jsfix.test_http-client.txt --objects",
63
- "fix-test-print": "cd dist && node jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/jsfix.test_client.txt --objects --delimiter=\"|\""
64
+ "fixml-test-print": "node dist/jsfix-cmd --session=data/session/test-http-initiator.json --fix=data/examples/fixml/jsfix.test_http-client.txt --objects",
65
+ "fix-test-print": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/jsfix.test_client.txt --objects --delimiter=\"|\""
64
66
  },
65
67
  "author": "",
66
68
  "license": "MIT",
67
69
  "dependencies": {
68
70
  "align-text": "^1.0.2",
71
+ "axios": "^1.2.2",
69
72
  "express": "^4.18.2",
70
73
  "lodash": "^4.17.21",
71
- "mathjs": "^11.3.0",
74
+ "mathjs": "^11.5.0",
72
75
  "minimist": "^1.2.7",
73
76
  "moment": "^2.29.4",
74
77
  "node-fs-extra": "^0.8.2",
75
78
  "reflect-metadata": "^0.1.13",
76
- "request": "^2.88.2",
77
- "request-promise-native": "^1.0.9",
78
79
  "sax": "^1.2.4",
79
80
  "tsyringe": "^4.7.0",
80
81
  "uuid": "^9.0.0",
@@ -83,23 +84,27 @@
83
84
  "yauzl": "^2.10.0"
84
85
  },
85
86
  "devDependencies": {
86
- "@types/express": "^4.17.14",
87
- "@types/express-serve-static-core": "^4.17.31",
88
- "@types/jest": "^29.1.2",
89
- "@types/lodash": "^4.14.186",
87
+ "@types/express": "^4.17.15",
88
+ "@types/express-serve-static-core": "^4.17.32",
89
+ "@types/jest": "^29.2.5",
90
+ "@types/lodash": "^4.14.191",
90
91
  "@types/mathjs": "^9.4.1",
91
92
  "@types/minimist": "^1.2.2",
92
- "@types/node": "^18.11.0",
93
+ "@types/node": "^18.11.18",
93
94
  "@types/request-promise-native": "^1.0.18",
94
95
  "@types/sax": "^1.2.4",
95
- "@types/uuid": "^8.3.4",
96
+ "@types/uuid": "^9.0.0",
96
97
  "@types/winston": "^2.4.4",
97
- "jest": "^29.2.0",
98
+ "@typescript-eslint/eslint-plugin-tslint": "^5.47.1",
99
+ "eslint": "^8.31.0",
100
+ "eslint-config-standard-with-typescript": "^24.0.0",
101
+ "eslint-plugin-jquery": "^1.5.1",
102
+ "eslint-plugin-jsdoc": "^39.6.4",
103
+ "eslint-plugin-node": "^11.1.0",
104
+ "jest": "^29.3.1",
98
105
  "madge": "^5.0.1",
99
106
  "standard": "^17.0.0",
100
107
  "ts-jest": "^29.0.3",
101
- "tslint": "^6.1.3",
102
- "tslint-config-standard": "^9.0.0",
103
- "typescript": "^4.8.4"
108
+ "typescript": "^4.9.4"
104
109
  }
105
110
  }
@@ -1,5 +1,4 @@
1
1
  export abstract class AsciiChars {
2
-
3
2
  public static readonly Minus: number = '-'.charCodeAt(0)
4
3
  public static readonly Equal: number = '='.charCodeAt(0)
5
4
  public static readonly ForwardSlash: number = '/'.charCodeAt(0)
@@ -14,17 +14,16 @@ import { Tags } from '../tag/tags'
14
14
  import { TagType } from '../tag/tag-type'
15
15
 
16
16
  export class AsciiEncoder extends MsgEncoder {
17
-
18
17
  public bodyLengthPos: number
19
18
  public msgTypePos: number
20
19
  public tags: Tags
21
20
  public checkGroups: boolean = true
22
21
 
23
22
  constructor (public readonly buffer: ElasticBuffer,
24
- public readonly definitions: FixDefinitions,
25
- public readonly timeFormatter: ITimeFormatter = new TimeFormatter(buffer),
26
- public readonly delimiter: number = AsciiChars.Soh,
27
- public readonly logDelimiter: number = AsciiChars.Pipe) {
23
+ public readonly definitions: FixDefinitions,
24
+ public readonly timeFormatter: ITimeFormatter = new TimeFormatter(buffer),
25
+ public readonly delimiter: number = AsciiChars.Soh,
26
+ public readonly logDelimiter: number = AsciiChars.Pipe) {
28
27
  super(definitions)
29
28
  this.tags = new Tags(definitions)
30
29
  }
@@ -87,7 +86,7 @@ export class AsciiEncoder extends MsgEncoder {
87
86
  const keys: string[] = Object.keys(o)
88
87
  let j: number = 0
89
88
  const fields: ContainedField[] = keys.reduce((a: ContainedField[], current: string) => {
90
- const field: ContainedField = set.localNameToField.get(current)
89
+ const field: ContainedField | null = set.localNameToField.get(current)
91
90
  if (field) {
92
91
  a[j++] = field
93
92
  }
@@ -98,7 +97,8 @@ export class AsciiEncoder extends MsgEncoder {
98
97
  }
99
98
 
100
99
  private encodeInstances (o: ILooseObject, gf: ContainedGroupField): void {
101
- const noOfField: SimpleFieldDefinition = gf.definition.noOfField
100
+ const noOfField: SimpleFieldDefinition | null = gf.definition.noOfField
101
+ if (!noOfField) return
102
102
  const instances: ILooseObject[] = o[gf.name] || o[noOfField.name]
103
103
 
104
104
  const buffer = this.buffer
@@ -167,7 +167,6 @@ export class AsciiEncoder extends MsgEncoder {
167
167
  }
168
168
 
169
169
  switch (tagType) {
170
-
171
170
  case TagType.RawData: {
172
171
  // may need to first write raw message length (see below)
173
172
  break
@@ -262,7 +261,7 @@ class GroupValidator {
262
261
  public readonly test: AsciiEncodeSetSummary = new AsciiEncodeSetSummary()) {
263
262
  }
264
263
 
265
- getSummary (field: number) {
264
+ getSummary (field: number): AsciiEncodeSetSummary {
266
265
  return field === 0 ? this.first : this.test
267
266
  }
268
267
 
@@ -270,31 +269,34 @@ class GroupValidator {
270
269
  const first = this.first
271
270
  const test = this.test
272
271
  if (field === 0 && first.empty()) {
273
- throw new Error(`first group instance has no delimeter present ${this.gf.name}`)
272
+ throw new Error(`first group instance has no delimiter present ${this.gf.name}`)
274
273
  }
275
274
  if (field > 0 && test.empty()) {
276
- throw new Error(`group instance [${field}] has no delimeter present ${this.gf.name}`)
275
+ throw new Error(`group instance [${field}] has no delimiter present ${this.gf.name}`)
277
276
  }
278
277
  if (field > 0) {
279
- const firstTag = first.firstSimple.definition.tag
280
- const tag = test.firstSimple.definition.tag
278
+ const firstTag = first.firstSimple?.definition.tag
279
+ const tag = test.firstSimple?.definition.tag
281
280
  if (firstTag !== tag) {
282
- throw new Error(`group instance [${field}] inconsisent delimeter ${tag} expected tag ${firstTag}`)
281
+ const msg = `group instance [${field}] inconsistent delimiter ${tag} expected tag ${firstTag}`
282
+ throw new Error(msg)
283
283
  }
284
284
  }
285
285
  }
286
286
  }
287
287
 
288
288
  class AsciiEncodeSetSummary {
289
- constructor (public firstSimple: ContainedSimpleField = null,
290
- public lastSimple: ContainedSimpleField = null,
289
+ constructor (public firstSimple: ContainedSimpleField | null = null,
290
+ public lastSimple: ContainedSimpleField | null = null,
291
291
  public count: number = 0) {
292
292
  }
293
+
293
294
  public reset (): void {
294
295
  this.firstSimple = null
295
296
  this.lastSimple = null
296
297
  this.count = 0
297
298
  }
299
+
298
300
  public empty (): boolean {
299
301
  return this.firstSimple === null || this.count === 0
300
302
  }
@@ -7,7 +7,7 @@ import { DITokens } from '../../runtime/di-tokens'
7
7
 
8
8
  @injectable()
9
9
  export class AsciiParserState {
10
- public message: MessageDefinition
10
+ public message: MessageDefinition | null
11
11
  public locations: Tags
12
12
  public parseState: ParseState
13
13
  public bodyLen: number
@@ -19,12 +19,12 @@ export class AsciiParserState {
19
19
  public currentTag: number
20
20
  public rawDataLen: number
21
21
  public rawDataRead: number
22
- public msgType: string
22
+ public msgType: string | null
23
23
 
24
24
  constructor (@inject(DITokens.ParseBuffer) public readonly elasticBuffer: ElasticBuffer) {
25
25
  }
26
26
 
27
- public beginTag (pos: number) {
27
+ public beginTag (pos: number): void {
28
28
  this.parseState = ParseState.ParsingTag
29
29
  this.tagStartPos = pos
30
30
  this.equalPos = this.valueEndPos = -1
@@ -54,7 +54,7 @@ export class AsciiParserState {
54
54
 
55
55
  public checkRawTag (): void {
56
56
  const msg = this.message
57
- if (!msg || !msg.containsRaw) {
57
+ if (!msg?.containsRaw) {
58
58
  // optimisation as will never hit raw data
59
59
  this.parseState = ParseState.ParsingValue
60
60
  return
@@ -28,12 +28,12 @@ export class AsciiParser extends MsgParser {
28
28
  // want to keep one slice of memory and constantly reuse it
29
29
 
30
30
  constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig,
31
- @inject(DITokens.readStream) public readonly readStream: Readable,
32
- @inject(DITokens.ParseBuffer) protected readonly receivingBuffer: ElasticBuffer) {
31
+ @inject(DITokens.readStream) public readonly readStream: Readable | null,
32
+ @inject(DITokens.ParseBuffer) protected readonly receivingBuffer: ElasticBuffer) {
33
33
  super()
34
34
 
35
- this.delimiter = config.delimiter
36
- this.writeDelimiter = config.logDelimiter || AsciiChars.Pipe
35
+ this.delimiter = config.delimiter ?? AsciiChars.Soh
36
+ this.writeDelimiter = config.logDelimiter ?? AsciiChars.Pipe
37
37
  const definitions = config.definitions
38
38
  this.id = AsciiParser.nextId++
39
39
  this.segmentParser = config.sessionContainer.resolve<AsciiSegmentParser>(AsciiSegmentParser)
@@ -65,13 +65,13 @@ export class AsciiParser extends MsgParser {
65
65
  })
66
66
 
67
67
  // receive from say a socket or file and pipe to parser which discovers messages
68
- stream.pipe(receiver).on('finish', () => {
68
+ stream?.pipe(receiver).on('finish', () => {
69
69
  this.emit('done')
70
70
  })
71
- stream.on('error', (e) => {
71
+ stream?.on('error', (e) => {
72
72
  this.emit('error', e)
73
73
  })
74
- stream.on('end', () => {
74
+ stream?.on('end', () => {
75
75
  this.emit('end')
76
76
  })
77
77
  }
@@ -86,7 +86,7 @@ export class AsciiParser extends MsgParser {
86
86
  state.beginMessage()
87
87
  }
88
88
 
89
- public parseText (text: string) {
89
+ public parseText (text: string): void {
90
90
  const buff = Buffer.from(text)
91
91
  this.parse(buff, buff.length)
92
92
  }
@@ -103,11 +103,10 @@ export class AsciiParser extends MsgParser {
103
103
  let readPtr: number = 0
104
104
 
105
105
  while (readPtr < end) {
106
- let charAtPos: number = readBuffer[readPtr]
106
+ const charAtPos: number = readBuffer[readPtr]
107
107
 
108
108
  const writePtr = receivingBuffer.saveChar(charAtPos) - 1
109
109
  switch (state.parseState) {
110
-
111
110
  case ParseState.MsgComplete: {
112
111
  this.msg(writePtr)
113
112
  continue
@@ -157,7 +156,8 @@ export class AsciiParser extends MsgParser {
157
156
  }
158
157
 
159
158
  default: {
160
- throw new Error(`fix parser in unknown state ${state}`)
159
+ const st = state.parseState
160
+ throw new Error(`fix parser in unknown state ${st}`)
161
161
  }
162
162
  }
163
163
  readPtr++
@@ -171,15 +171,18 @@ export class AsciiParser extends MsgParser {
171
171
  }
172
172
  }
173
173
 
174
- private getView (ptr: number): MsgView {
174
+ private getView (ptr: number): MsgView | null {
175
175
  const state = this.state
176
176
  const locations = state.locations
177
177
  const source = this.receivingBuffer
178
178
  const delimiter = this.delimiter
179
179
  const replace = this.writeDelimiter
180
+ const msgType = state.msgType ?? null
181
+ if (!msgType) return null
180
182
  if (state.message) {
181
- const structure: Structure = this.segmentParser.parse(state.msgType, locations,
183
+ const structure: Structure | null = this.segmentParser.parse(msgType, locations,
182
184
  locations.nextTagPos - 1)
185
+ if (!structure) return null
183
186
  return new AsciiView(structure.msg(),
184
187
  source,
185
188
  structure,
@@ -20,14 +20,13 @@ import { SegmentType } from '../segment/segment-type'
20
20
 
21
21
  @injectable()
22
22
  export class AsciiSegmentParser {
23
-
24
23
  constructor (@inject(DITokens.Definitions) public readonly definitions: FixDefinitions) {
25
24
  }
26
25
 
27
- public parse (msgType: string, tags: Tags, last: number): Structure {
26
+ public parse (msgType: string, tags: Tags, last: number): Structure | null {
28
27
  // completed segments in that they are fully parsed
29
28
  const segments: SegmentDescription[] = []
30
- const msgDefinition: MessageDefinition = this.definitions.message.get(msgType)
29
+ const msgDefinition: MessageDefinition | null = this.definitions.message.get(msgType)
31
30
  if (!msgDefinition) {
32
31
  return null
33
32
  }
@@ -41,11 +40,12 @@ export class AsciiSegmentParser {
41
40
  // having finished one segments keep unwinding until tag matches further up stack
42
41
  function unwind (tag: number): void {
43
42
  while (structureStack.length > 1) {
44
- const done: SegmentDescription = structureStack.pop()
43
+ const done = structureStack.pop()
44
+ if (!done) continue
45
45
  done.end(segments.length, currentTagPosition - 1, tags.tagPos[currentTagPosition - 1].tag)
46
46
  segments.push(done)
47
47
  peek = structureStack[structureStack.length - 1]
48
- if (peek.set.containedTag[tag]) {
48
+ if (peek.set?.containedTag[tag]) {
49
49
  // unwound to point this tag lives in this set.
50
50
  break
51
51
  }
@@ -56,10 +56,10 @@ export class AsciiSegmentParser {
56
56
  }
57
57
  }
58
58
 
59
- function examine (tag: number): SegmentDescription {
60
- let structure: SegmentDescription = null
61
- switch (peek.currentField.type) {
62
-
59
+ function examine (tag: number): SegmentDescription | null {
60
+ let structure: SegmentDescription | null = null
61
+ const type = peek.currentField?.type
62
+ switch (type) {
63
63
  case ContainedFieldType.Simple: {
64
64
  const sf: ContainedSimpleField = peek.currentField as ContainedSimpleField
65
65
  if (sf.definition.tag === tag) {
@@ -71,14 +71,14 @@ export class AsciiSegmentParser {
71
71
  case ContainedFieldType.Component: {
72
72
  const cf: ContainedComponentField = peek.currentField as ContainedComponentField
73
73
  structure = new SegmentDescription(cf.name, tag, cf.definition,
74
- currentTagPosition, structureStack.length, SegmentType.Component)
74
+ currentTagPosition, structureStack.length, SegmentType.Component)
75
75
  break
76
76
  }
77
77
  // for a group also need to know where all delimiters are positioned
78
78
  case ContainedFieldType.Group: {
79
79
  const gf: ContainedComponentField = peek.currentField as ContainedGroupField
80
80
  structure = new SegmentDescription(gf.name, tag, gf.definition,
81
- currentTagPosition, structureStack.length, SegmentType.Group)
81
+ currentTagPosition, structureStack.length, SegmentType.Group)
82
82
  currentTagPosition = currentTagPosition + 1
83
83
  structure.startGroup(tags.tagPos[currentTagPosition].tag)
84
84
  break
@@ -96,8 +96,8 @@ export class AsciiSegmentParser {
96
96
  if (tag === peek.delimiterTag) {
97
97
  peek.addDelimiterPosition(currentTagPosition)
98
98
  } else if (structureStack.length > 1) {
99
- // if a group is represented by a repeated component, then the tag representing delimiter
100
- // needs to be added further up stack to group itself.
99
+ // if a group is represented by a repeated component, then the tag representing delimiter
100
+ // needs to be added further up stack to group itself.
101
101
  delimiter = structureStack[structureStack.length - 2].groupAddDelimiter(tag, currentTagPosition)
102
102
  }
103
103
  return delimiter
@@ -116,7 +116,7 @@ export class AsciiSegmentParser {
116
116
  const tag: number = tags.tagPos[currentTagPosition].tag
117
117
  peek = structureStack[structureStack.length - 1]
118
118
  peek.setCurrentField(tag)
119
- if (!peek.set.containedTag[tag] || groupDelimiter(tag)) {
119
+ if (!peek.set?.containedTag[tag] || groupDelimiter(tag)) {
120
120
  // unravelled all way back to root hence this is not recognised
121
121
  const unknown = peek.type === SegmentType.Msg
122
122
  if (unknown) {
@@ -137,7 +137,8 @@ export class AsciiSegmentParser {
137
137
  function clean (): void {
138
138
  // any remainder components can be closed.
139
139
  while (structureStack.length > 0) {
140
- const done: SegmentDescription = structureStack.pop()
140
+ const done = structureStack.pop()
141
+ if (!done) continue
141
142
  done.end(segments.length, currentTagPosition - 1, tags.tagPos[currentTagPosition - 1].tag)
142
143
  segments[segments.length] = done
143
144
  }
@@ -12,12 +12,11 @@ import { TagType } from '../tag/tag-type'
12
12
  export class AsciiView extends MsgView {
13
13
  private readonly timeFormatter: ITimeFormatter = new TimeFormatter(this.buffer)
14
14
  constructor (public readonly segment: SegmentDescription,
15
- public readonly buffer: ElasticBuffer,
16
- public readonly structure: Structure,
17
- public readonly ptr: number,
18
- public readonly delimiter: number,
19
- public readonly writeDelimiter: number) {
20
-
15
+ public readonly buffer: ElasticBuffer,
16
+ public readonly structure: Structure | null,
17
+ public readonly ptr: number,
18
+ public readonly delimiter: number,
19
+ public readonly writeDelimiter: number) {
21
20
  super(segment, structure)
22
21
  }
23
22
 
@@ -35,6 +34,7 @@ export class AsciiView extends MsgView {
35
34
  }
36
35
 
37
36
  private replaceDelimiter (viewBuffer: Buffer, replaceDelimiter?: number): void {
37
+ if (this.structure == null) return
38
38
  const delimiter = replaceDelimiter ?? this.delimiter
39
39
  if (delimiter !== this.writeDelimiter) {
40
40
  const structure = this.structure
@@ -55,6 +55,7 @@ export class AsciiView extends MsgView {
55
55
  }
56
56
 
57
57
  public checksum (): number {
58
+ if (this.structure == null) return -1
58
59
  const t = this.getPosition(MsgTag.CheckSum)
59
60
  const structure = this.structure
60
61
  const prev = structure.tags.tagPos[t - 1]
@@ -127,7 +128,8 @@ export class AsciiView extends MsgView {
127
128
  this.writeDelimiter)
128
129
  }
129
130
 
130
- protected stringAtPosition (position: number): string {
131
+ protected stringAtPosition (position: number): string | null {
132
+ if (this.structure == null) return null
131
133
  const tags = this.structure.tags
132
134
  if (position < 0 || position >= tags.nextTagPos) {
133
135
  return null
@@ -136,12 +138,14 @@ export class AsciiView extends MsgView {
136
138
  return this.buffer.getString(tag.start, tag.start + tag.len)
137
139
  }
138
140
 
139
- private getBuffer (position: number): Buffer {
141
+ private getBuffer (position: number): Buffer | null {
142
+ if (this.structure == null) return null
140
143
  const tag: TagPos = this.structure.tags.tagPos[position]
141
144
  return this.buffer.getBuffer(tag.start, tag.start + tag.len)
142
145
  }
143
146
 
144
- private getNumber (position: number, isFloat: boolean = false): number {
147
+ private getNumber (position: number, isFloat: boolean = false): number | null {
148
+ if (this.structure == null) return null
145
149
  const buffer = this.buffer
146
150
  const tag: TagPos = this.structure.tags.tagPos[position]
147
151
  if (isFloat) {
@@ -151,7 +155,8 @@ export class AsciiView extends MsgView {
151
155
  }
152
156
  }
153
157
 
154
- private getTime (tag: number, useUtc: boolean): Date {
158
+ private getTime (tag: number, useUtc: boolean): Date | null {
159
+ if (this.structure == null) return null
155
160
  const formatter = this.timeFormatter
156
161
  const position: number = this.getPosition(tag)
157
162
  const tagPos: TagPos = this.structure.tags.tagPos[position]
@@ -165,7 +170,8 @@ export class AsciiView extends MsgView {
165
170
  }
166
171
  }
167
172
 
168
- private getDate (tag: number, useUtc: boolean): Date {
173
+ private getDate (tag: number, useUtc: boolean): Date | null {
174
+ if (this.structure == null) return null
169
175
  const formatter = this.timeFormatter
170
176
  const position: number = this.getPosition(tag)
171
177
  if (position < 0) {
@@ -183,14 +189,15 @@ export class AsciiView extends MsgView {
183
189
  }
184
190
  }
185
191
 
186
- private getDateTime (tag: number, useUtc: boolean): Date {
192
+ private getDateTime (tag: number, useUtc: boolean): Date | null {
193
+ if (this.structure == null) return null
187
194
  const position: number = this.getPosition(tag)
188
195
  const tagPos: TagPos = this.structure.tags.tagPos[position]
189
196
  const formatter = this.timeFormatter
190
197
  if (position < 0) {
191
198
  return null
192
199
  }
193
- // (SendingTime) = 20150417-01:00:08.201
200
+ // (SendingTime) = 20150417-01:00:08.201
194
201
  if (tagPos.len < 8) {
195
202
  return null
196
203
  }
@@ -202,7 +209,8 @@ export class AsciiView extends MsgView {
202
209
  }
203
210
  }
204
211
 
205
- private getBoolean (tag: number): boolean {
212
+ private getBoolean (tag: number): boolean | null {
213
+ if (this.structure == null) return null
206
214
  const position: number = this.getPosition(tag)
207
215
  if (position < 0) {
208
216
  return null
@@ -1,19 +1,19 @@
1
1
  export interface ITimeFormatter {
2
- writeLocalDate (v: Date): void
3
- writeUtcDate (v: Date): void
2
+ writeLocalDate: (v: Date) => void
3
+ writeUtcDate: (v: Date) => void
4
4
 
5
- writeLocalTimestamp (v: Date): void
6
- writeUtcTimestamp (v: Date): void
5
+ writeLocalTimestamp: (v: Date) => void
6
+ writeUtcTimestamp: (v: Date) => void
7
7
 
8
- writeLocalTime (v: Date): void
9
- writeUtcTime (v: Date): void
8
+ writeLocalTime: (v: Date) => void
9
+ writeUtcTime: (v: Date) => void
10
10
 
11
- getLocalDate (start: number): Date
12
- getUtcDate (start: number): Date
11
+ getLocalDate: (start: number) => Date | null
12
+ getUtcDate: (start: number) => Date | null
13
13
 
14
- getLocalTime (start: number): Date
15
- getUtcTime (start: number): Date
14
+ getLocalTime: (start: number) => Date | null
15
+ getUtcTime: (start: number) => Date | null
16
16
 
17
- getLocalTimestamp (start: number, end: number): Date
18
- getUtcTimestamp (start: number, end: number): Date
17
+ getLocalTimestamp: (start: number, end: number) => Date | null
18
+ getUtcTimestamp: (start: number, end: number) => Date | null
19
19
  }