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
@@ -1,82 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const path = require("path");
13
- const buffer_1 = require("../buffer");
14
- const util_1 = require("../util");
15
- const config_1 = require("../config");
16
- const ascii_1 = require("../transport/ascii");
17
- const __1 = require("..");
18
- let definitions;
19
- let jsonHelper;
20
- let session;
21
- const root = path.join(__dirname, '../../data/examples/FIX.4.4/repo/');
22
- beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
23
- const sessionDescription = require(path.join(root, '../../../session/test-initiator.json'));
24
- definitions = yield (0, util_1.getDefinitions)(sessionDescription.application.dictionary);
25
- jsonHelper = new util_1.JsonHelper(definitions);
26
- const config = new config_1.JsFixConfig(new ascii_1.AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
27
- session = new ascii_1.AsciiMsgTransmitter(config);
28
- }), 45000);
29
- function testEncodeDecode(msgType, msg) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
32
- const parser = new buffer_1.AsciiParser(definitions, session.encodeStream, buffer_1.AsciiChars.Pipe);
33
- parser.on('msg', (msgType, view) => {
34
- const o = view.toObject();
35
- delete o['StandardHeader'];
36
- delete o['StandardTrailer'];
37
- resolve(o);
38
- });
39
- parser.on('error', (e) => {
40
- reject(e);
41
- });
42
- session.send(msgType, msg);
43
- }));
44
- });
45
- }
46
- test('check 1 digit checksum format', () => __awaiter(void 0, void 0, void 0, function* () {
47
- const factory = session.config.factory;
48
- const cs = factory.trailer(1);
49
- expect(cs.CheckSum).toEqual('001');
50
- }));
51
- test('check 2 digit checksum format', () => __awaiter(void 0, void 0, void 0, function* () {
52
- const factory = session.config.factory;
53
- const cs = factory.trailer(10);
54
- expect(cs.CheckSum).toEqual('010');
55
- }));
56
- test('check 3 digit checksum format', () => __awaiter(void 0, void 0, void 0, function* () {
57
- const factory = session.config.factory;
58
- const cs = factory.trailer(100);
59
- expect(cs.CheckSum).toEqual('100');
60
- }));
61
- test('AE object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
62
- const msgType = __1.MsgType.TradeCaptureReport;
63
- const file = path.join(root, 'trade-capture/object.json');
64
- const msg = jsonHelper.fromJson(file, msgType);
65
- const o = yield testEncodeDecode(msgType, msg);
66
- expect(o).toEqual(msg);
67
- }), 1000);
68
- test('d object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
69
- const msgType = __1.MsgType.SecurityDefinition;
70
- const file = path.join(root, 'security-definition/object.json');
71
- const msg = jsonHelper.fromJson(file, msgType);
72
- const o = yield testEncodeDecode(msgType, msg);
73
- expect(o).toEqual(msg);
74
- }), 1000);
75
- test('D object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
76
- const msgType = __1.MsgType.NewOrderSingle;
77
- const file = path.join(root, 'new-order-single/object.json');
78
- const msg = jsonHelper.fromJson(file, msgType);
79
- const o = yield testEncodeDecode(msgType, msg);
80
- expect(o).toEqual(msg);
81
- }), 1000);
82
- //# sourceMappingURL=repo-full-ascii-msg.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repo-full-ascii-msg.test.js","sourceRoot":"","sources":["../../src/test/repo-full-ascii-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAA8D;AAG9D,kCAAoD;AAEpD,sCAAuC;AACvC,8CAAgF;AAChF,0BAA4B;AAE5B,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,IAAI,OAA4B,CAAA;AAChC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAA;AAE9E,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,kBAAkB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,sCAAsC,CAAC,CAAC,CAAA;IAChH,WAAW,GAAG,MAAM,IAAA,qBAAc,EAAC,kBAAkB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAC7E,UAAU,GAAG,IAAI,iBAAU,CAAC,WAAW,CAAC,CAAA;IACxC,MAAM,MAAM,G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B,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAE5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,iCAAiC,EAAE,GAAS,EAAE;IACjD,MAAM,OAAO,GAAW,WAAO,CAAC,cAAc,CAAA;IAC9C,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,8BAA8B,CAAC,CAAA;IACpE,MAAM,GAAG,GAAiB,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAE5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { AsciiParser, AsciiView, AsciiChars } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { JsonHelper, getDefinitions } from '../util'\r\nimport { ISessionDescription } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { AsciiMsgTransmitter, AsciiSessionMsgFactory } from '../transport/ascii'\r\nimport { MsgType } from '..'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet session: AsciiMsgTransmitter\r\nconst root: string = path.join(__dirname, '../../data/examples/FIX.4.4/repo/')\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, '../../../session/test-initiator.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n jsonHelper = new JsonHelper(definitions)\r\n const config = new JsFixConfig(new AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (msgType: string, msg: ILooseObject): Promise<ILooseObject> {\r\n // encode to FIX format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const parser: AsciiParser = new AsciiParser(definitions, session.encodeStream, AsciiChars.Pipe)\r\n parser.on('msg', (msgType: string, view: AsciiView) => {\r\n const o = view.toObject()\r\n delete o['StandardHeader']\r\n delete o['StandardTrailer']\r\n resolve(o)\r\n })\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n // encode the message\r\n session.send(msgType, msg)\r\n })\r\n}\r\n\r\ntest('check 1 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(1)\r\n expect(cs.CheckSum).toEqual('001')\r\n})\r\n\r\ntest('check 2 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(10)\r\n expect(cs.CheckSum).toEqual('010')\r\n})\r\n\r\ntest('check 3 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(100)\r\n expect(cs.CheckSum).toEqual('100')\r\n})\r\n\r\ntest('AE object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.TradeCaptureReport\r\n const file: string = path.join(root, 'trade-capture/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n\r\ntest('d object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.SecurityDefinition\r\n const file: string = path.join(root, 'security-definition/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n\r\ntest('D object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.NewOrderSingle\r\n const file: string = path.join(root, 'new-order-single/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,136 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const path = require("path");
13
- const transport_1 = require("../transport");
14
- const config_1 = require("../config");
15
- const buffer_1 = require("../buffer");
16
- const util_1 = require("../util");
17
- let definitions;
18
- let jsonHelper;
19
- let sessionDescription;
20
- const root = path.join(__dirname, '../../data/examples/FIXML');
21
- beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
22
- sessionDescription = require(path.join(root, '../../session/test-initiator.json'));
23
- definitions = yield (0, util_1.getDefinitions)('repofixml');
24
- jsonHelper = new util_1.JsonHelper(definitions);
25
- }), 45000);
26
- function testEncodeDecode(asObj, msgType) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
29
- const fe = new buffer_1.FixmlEncoder(new buffer_1.ElasticBuffer(), definitions);
30
- fe.encode(asObj, msgType);
31
- const fixml = fe.buffer.toString();
32
- const config = new config_1.JsFixConfig(null, definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
33
- const xmlParser = new buffer_1.FiXmlParser(config, new transport_1.StringDuplex(fixml).readable);
34
- if (asObj.Batch) {
35
- xmlParser.on('batch', (msgType, v) => {
36
- const o = v.toObject();
37
- resolve(o);
38
- });
39
- }
40
- else {
41
- xmlParser.on('msg', (msgType, v) => {
42
- const o = v.toObject();
43
- resolve(o);
44
- });
45
- }
46
- xmlParser.on('error', (e) => {
47
- reject(e);
48
- });
49
- }));
50
- });
51
- }
52
- test('MktDataFull settle fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
53
- const msgType = 'MktDataFull';
54
- const file = path.join(root, 'cme/md/settle');
55
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
56
- const o = yield testEncodeDecode(asObj, msgType);
57
- expect(o).toEqual(asObj);
58
- }), 1000);
59
- test('AllocInstrctn fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
60
- const msgType = 'AllocInstrctn';
61
- const file = path.join(root, 'cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/');
62
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
63
- const o = yield testEncodeDecode(asObj, msgType);
64
- expect(o).toEqual(asObj);
65
- }), 1000);
66
- test('AllocRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
67
- const msgType = 'AllocRpt';
68
- const file = path.join(root, 'cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/');
69
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
70
- const o = yield testEncodeDecode(asObj, msgType);
71
- expect(o).toEqual(asObj);
72
- }), 1000);
73
- test('TrdCaptRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
74
- const msgType = 'TrdCaptRpt';
75
- const file = path.join(root, 'cme/tc/Delivery Fixed Commodity Swap');
76
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
77
- const o = yield testEncodeDecode(asObj, msgType);
78
- expect(o).toEqual(asObj);
79
- }), 1000);
80
- test('MktDataFull fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
81
- const msgType = 'MktDataFull';
82
- const file = path.join(root, 'cme/md/futures');
83
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
84
- const o = yield testEncodeDecode(asObj, msgType);
85
- expect(o).toEqual(asObj);
86
- }), 1000);
87
- test('UserReq logon fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
88
- const msgType = 'UserReq';
89
- const file = path.join(root, 'cme/ur/logon');
90
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
91
- const o = yield testEncodeDecode(asObj, msgType);
92
- expect(o).toEqual(asObj);
93
- }), 1000);
94
- test('UserReq logoff fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
95
- const msgType = 'UserReq';
96
- const file = path.join(root, 'cme/ur/logoff');
97
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
98
- const o = yield testEncodeDecode(asObj, msgType);
99
- expect(o).toEqual(asObj);
100
- }), 1000);
101
- test('TrdCaptRpt 2 fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
102
- const msgType = 'TrdCaptRpt';
103
- const file = path.join(root, 'cme/tc/Initial Single Side Submission');
104
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
105
- const o = yield testEncodeDecode(asObj, msgType);
106
- expect(o).toEqual(asObj);
107
- }), 1000);
108
- test('TrdCaptRpt 3 fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
109
- const msgType = 'TrdCaptRpt';
110
- const file = path.join(root, 'cme/tc/Accepted Unmatched');
111
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
112
- const o = yield testEncodeDecode(asObj, msgType);
113
- expect(o).toEqual(asObj);
114
- }), 1000);
115
- test('TrdCaptRptReq fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
116
- const msgType = 'TrdCaptRptReq';
117
- const file = path.join(root, 'cme/tc/Trading Firm Continued Subscription');
118
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
119
- const o = yield testEncodeDecode(asObj, msgType);
120
- expect(o).toEqual(asObj);
121
- }), 1000);
122
- test('Order fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
123
- const msgType = 'Order';
124
- const file = path.join(root, 'om/nso');
125
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
126
- const o = yield testEncodeDecode(asObj, msgType);
127
- expect(o).toEqual(asObj);
128
- }), 1000);
129
- test('ExecRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
130
- const msgType = 'ExecRpt';
131
- const file = path.join(root, 'om/er');
132
- const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
133
- const o = yield testEncodeDecode(asObj, msgType);
134
- expect(o).toEqual(asObj);
135
- }), 1000);
136
- //# sourceMappingURL=repo-full-fixml-msg.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repo-full-fixml-msg.test.js","sourceRoot":"","sources":["../../src/test/repo-full-fixml-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAG5B,4CAAgE;AAChE,sCAAuC;AACvC,sCAAoG;AACpG,kCAAoD;AAEpD,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,IAAI,kBAAuC,CAAA;AAC3C,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAA;AAEtE,SAAS,CAAC,GAAS,EAAE;IACnB,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC,CAAA;IAClF,WAAW,GAAG,MAAM,IAAA,qBAAc,EAAC,WAAW,CAAC,CAAA;IAC/C,UAAU,GAAG,IAAI,iBAAU,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,SAAe,gBAAgB,CAAE,KAAmB,EAAE,OAAe;;QAEnE,OAAO,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,EAAE,GAAG,IAAI,qBAAY,CAAC,IAAI,sBAAa,EAAE,EAAE,WAAW,CA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,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, StringDuplex } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { MsgView, ElasticBuffer, MsgParser, AsciiChars, FixmlEncoder, FiXmlParser } from '../buffer'\r\nimport { getDefinitions, JsonHelper } from '../util'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet sessionDescription: ISessionDescription\r\nconst root: string = path.join(__dirname, '../../data/examples/FIXML')\r\n\r\nbeforeAll(async () => {\r\n sessionDescription = require(path.join(root, '../../session/test-initiator.json'))\r\n definitions = await getDefinitions('repofixml')\r\n jsonHelper = new JsonHelper(definitions)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (asObj: ILooseObject, msgType: string): Promise<ILooseObject> {\r\n // encode to FIXML format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(asObj, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const xmlParser: MsgParser = new FiXmlParser(config, new StringDuplex(fixml).readable)\r\n if (asObj.Batch) {\r\n xmlParser.on('batch', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n } else {\r\n xmlParser.on('msg', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n }\r\n\r\n xmlParser.on('error', (e) => {\r\n reject(e)\r\n })\r\n })\r\n}\r\n\r\ntest('MktDataFull settle fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'cme/md/settle')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocInstrctn fixml object', async () => {\r\n const msgType: string = 'AllocInstrctn'\r\n const file: string = path.join(root,'cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocRpt fixml object', async () => {\r\n const msgType: string = 'AllocRpt'\r\n const file: string = path.join(root,'cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Delivery Fixed Commodity Swap')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('MktDataFull fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'cme/md/futures')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logon fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'cme/ur/logon')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logoff fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'cme/ur/logoff')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 2 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Initial Single Side Submission')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 3 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Accepted Unmatched')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRptReq fixml object', async () => {\r\n const msgType: string = 'TrdCaptRptReq'\r\n const file: string = path.join(root,'cme/tc/Trading Firm Continued Subscription')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('Order fixml object', async () => {\r\n const msgType: string = 'Order'\r\n const file: string = path.join(root,'om/nso')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('ExecRpt fixml object', async () => {\r\n const msgType: string = 'ExecRpt'\r\n const file: string = path.join(root,'om/er')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const transport_1 = require("../transport");
13
- const fix_session_state_1 = require("../transport/fix-session-state");
14
- const tick_action_1 = require("../transport/tick-action");
15
- let state;
16
- let now;
17
- beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
18
- state = new fix_session_state_1.FixSessionState({ heartBeat: 30 });
19
- state.state = transport_1.SessionState.InitiationLogonResponse;
20
- now = new Date(2018, 0, 1, 20, 0, 0, 0);
21
- state.LastSentAt = now;
22
- state.lastReceivedAt = now;
23
- state.peerHeartBeatSecs = 30;
24
- state.lastPeerMsgSeqNum = 1;
25
- }));
26
- test('do nothing', () => {
27
- const action = state.calcAction(now);
28
- expect(action).toEqual(tick_action_1.TickAction.Nothing);
29
- });
30
- test('heartbeat', () => {
31
- const next = new Date(now.getTime() + 31 * 1000);
32
- state.lastReceivedAt = next;
33
- const action = state.calcAction(next);
34
- expect(state.timeToDie()).toEqual(false);
35
- expect(state.timeToHeartbeat()).toEqual(true);
36
- expect(state.timeToTerminate()).toEqual(false);
37
- expect(state.timeToTestRequest()).toEqual(false);
38
- expect(action).toEqual(tick_action_1.TickAction.Heartbeat);
39
- });
40
- test('testrequest', () => {
41
- const next = new Date(now.getTime() + 51 * 1000);
42
- state.LastSentAt = next;
43
- const action = state.calcAction(next);
44
- expect(state.timeToDie()).toEqual(false);
45
- expect(state.timeToHeartbeat()).toEqual(false);
46
- expect(state.timeToTerminate()).toEqual(false);
47
- expect(state.timeToTestRequest()).toEqual(true);
48
- expect(action).toEqual(tick_action_1.TickAction.TestRequest);
49
- });
50
- test('testrequest - no response', () => {
51
- const next = new Date(now.getTime() + 55 * 2 * 1000);
52
- state.LastSentAt = next;
53
- state.lastTestRequestAt = now;
54
- const action = state.calcAction(next);
55
- expect(state.timeToDie()).toEqual(false);
56
- expect(state.timeToHeartbeat()).toEqual(false);
57
- expect(state.timeToTerminate()).toEqual(true);
58
- expect(state.timeToTestRequest()).toEqual(true);
59
- expect(action).toEqual(tick_action_1.TickAction.TerminateOnError);
60
- });
61
- test('time to die - no logout response', () => {
62
- const next = new Date(now.getTime() + 20 * 1000);
63
- state.state = transport_1.SessionState.WaitingLogoutConfirm;
64
- state.LastSentAt = now;
65
- state.lastReceivedAt = now;
66
- state.logoutSentAt = now;
67
- const action = state.calcAction(next);
68
- expect(state.timeToDie()).toEqual(true);
69
- expect(state.timeToHeartbeat()).toEqual(false);
70
- expect(state.timeToTerminate()).toEqual(false);
71
- expect(state.timeToTestRequest()).toEqual(false);
72
- expect(action).toEqual(tick_action_1.TickAction.Stop);
73
- });
74
- //# sourceMappingURL=session-state.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-state.test.js","sourceRoot":"","sources":["../../src/test/session-state.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4CAA2C;AAC3C,sEAAgE;AAChE,0DAAqD;AAErD,IAAI,KAAsB,CAAA;AAC1B,IAAI,GAAS,CAAA;AAEb,UAAU,CAAC,GAAS,EAAE;IACpB,KAAK,GAAG,IAAI,mCAAe,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAA;IAC9C,KAAK,CAAC,KAAK,GAAG,wBAAY,CAAC,uBAAuB,CAAA;IAClD,GAAG,GAAG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CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,wBAAU,CAAC,gBAAgB,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC5C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;IAChD,KAAK,CAAC,KAAK,GAAG,wBAAY,CAAC,oBAAoB,CAAA;IAC/C,KAAK,CAAC,UAAU,GAAG,GAAG,CAAA;IACtB,KAAK,CAAC,cAAc,GAAG,GAAG,CAAA;IAC1B,KAAK,CAAC,YAAY,GAAG,GAAG,CAAA;IACxB,MAAM,MAAM,GAAe,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAEjD,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAEhD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,wBAAU,CAAC,IAAI,CAAC,CAAA;AACzC,CAAC,CAAC,CAAA","sourcesContent":["import { SessionState } from '../transport'\r\nimport { FixSessionState } from '../transport/fix-session-state'\r\nimport { TickAction } from '../transport/tick-action'\r\n\r\nlet state: FixSessionState\r\nlet now: Date\r\n\r\nbeforeEach(async () => {\r\n state = new FixSessionState({ heartBeat: 30 })\r\n state.state = SessionState.InitiationLogonResponse\r\n now = new Date(2018, 0, 1, 20, 0, 0, 0)\r\n state.LastSentAt = now\r\n state.lastReceivedAt = now\r\n state.peerHeartBeatSecs = 30\r\n state.lastPeerMsgSeqNum = 1\r\n})\r\n\r\ntest('do nothing', () => {\r\n const action: TickAction = state.calcAction(now)\r\n expect(action).toEqual(TickAction.Nothing)\r\n})\r\n\r\ntest('heartbeat', () => {\r\n const next = new Date(now.getTime() + 31 * 1000)\r\n state.lastReceivedAt = next\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(false)\r\n expect(state.timeToHeartbeat()).toEqual(true)\r\n expect(state.timeToTerminate()).toEqual(false)\r\n expect(state.timeToTestRequest()).toEqual(false)\r\n\r\n expect(action).toEqual(TickAction.Heartbeat)\r\n})\r\n\r\ntest('testrequest', () => {\r\n const next = new Date(now.getTime() + 51 * 1000)\r\n state.LastSentAt = next\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(false)\r\n expect(state.timeToHeartbeat()).toEqual(false)\r\n expect(state.timeToTerminate()).toEqual(false)\r\n expect(state.timeToTestRequest()).toEqual(true)\r\n\r\n expect(action).toEqual(TickAction.TestRequest)\r\n})\r\n\r\ntest('testrequest - no response', () => {\r\n const next = new Date(now.getTime() + 55 * 2 * 1000)\r\n state.LastSentAt = next\r\n state.lastTestRequestAt = now\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(false)\r\n expect(state.timeToHeartbeat()).toEqual(false)\r\n expect(state.timeToTerminate()).toEqual(true)\r\n expect(state.timeToTestRequest()).toEqual(true)\r\n\r\n expect(action).toEqual(TickAction.TerminateOnError)\r\n})\r\n\r\ntest('time to die - no logout response', () => {\r\n const next = new Date(now.getTime() + 20 * 1000)\r\n state.state = SessionState.WaitingLogoutConfirm\r\n state.LastSentAt = now\r\n state.lastReceivedAt = now\r\n state.logoutSentAt = now\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(true)\r\n expect(state.timeToHeartbeat()).toEqual(false)\r\n expect(state.timeToTerminate()).toEqual(false)\r\n expect(state.timeToTestRequest()).toEqual(false)\r\n\r\n expect(action).toEqual(TickAction.Stop)\r\n})\r\n"]}
@@ -1 +0,0 @@
1
- export {};