jspurefix 1.4.1 → 2.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 (1079) hide show
  1. package/appveyor.yml +3 -0
  2. package/data/session/certs/ca/ca.crt +33 -0
  3. package/data/session/certs/ca/ca.key +54 -0
  4. package/data/session/certs/client/client.crt +31 -0
  5. package/data/session/certs/client/client.key +51 -0
  6. package/data/session/certs/server/server.crt +31 -0
  7. package/data/session/certs/server/server.key +51 -0
  8. package/dist/a-session-msg-factory.d.ts +0 -0
  9. package/dist/a-session-msg-factory.js +1 -0
  10. package/dist/a-session-msg-factory.js.map +1 -0
  11. package/dist/ascii-encoder.test.d.ts +0 -0
  12. package/dist/ascii-encoder.test.js +1 -0
  13. package/dist/ascii-encoder.test.js.map +1 -0
  14. package/dist/ascii-parser.test.d.ts +0 -0
  15. package/dist/ascii-parser.test.js +1 -0
  16. package/dist/ascii-parser.test.js.map +1 -0
  17. package/dist/ascii-segment.test.d.ts +0 -0
  18. package/dist/ascii-segment.test.js +1 -0
  19. package/dist/ascii-segment.test.js.map +1 -0
  20. package/dist/ascii-store-replay.test.d.ts +0 -0
  21. package/dist/ascii-store-replay.test.js +1 -0
  22. package/dist/ascii-store-replay.test.js.map +1 -0
  23. package/dist/ascii-tag-pos.test.d.ts +0 -0
  24. package/dist/ascii-tag-pos.test.js +1 -0
  25. package/dist/ascii-tag-pos.test.js.map +1 -0
  26. package/dist/buffer/{ascii-chars.d.ts → ascii/ascii-chars.d.ts} +0 -0
  27. package/dist/buffer/{ascii-chars.js → ascii/ascii-chars.js} +0 -0
  28. package/dist/buffer/ascii/ascii-chars.js.map +1 -0
  29. package/dist/buffer/ascii/ascii-encoder.d.ts +4 -2
  30. package/dist/buffer/ascii/ascii-encoder.js +54 -32
  31. package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
  32. package/dist/buffer/ascii/ascii-parser-state.d.ts +3 -10
  33. package/dist/buffer/ascii/ascii-parser-state.js +37 -25
  34. package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
  35. package/dist/buffer/ascii/ascii-parser.d.ts +7 -7
  36. package/dist/buffer/ascii/ascii-parser.js +50 -24
  37. package/dist/buffer/ascii/ascii-parser.js.map +1 -1
  38. package/dist/buffer/ascii/ascii-segment-parser.d.ts +2 -2
  39. package/dist/buffer/ascii/ascii-segment-parser.js +34 -13
  40. package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
  41. package/dist/buffer/ascii/ascii-view.d.ts +2 -4
  42. package/dist/buffer/ascii/ascii-view.js +11 -15
  43. package/dist/buffer/ascii/ascii-view.js.map +1 -1
  44. package/dist/buffer/ascii/index.d.ts +1 -0
  45. package/dist/buffer/ascii/index.js +1 -0
  46. package/dist/buffer/ascii/index.js.map +1 -1
  47. package/dist/buffer/ascii/parse-state.d.ts +8 -0
  48. package/dist/buffer/ascii/parse-state.js +13 -0
  49. package/dist/buffer/ascii/parse-state.js.map +1 -0
  50. package/dist/buffer/ascii/time-formatter.js +1 -1
  51. package/dist/buffer/ascii/time-formatter.js.map +1 -1
  52. package/dist/buffer/elastic-buffer.js +29 -8
  53. package/dist/buffer/elastic-buffer.js.map +1 -1
  54. package/dist/buffer/encode-proxy.d.ts +1 -1
  55. package/dist/buffer/encode-proxy.js +16 -17
  56. package/dist/buffer/encode-proxy.js.map +1 -1
  57. package/dist/buffer/fixml/fixml-encoder.d.ts +2 -1
  58. package/dist/buffer/fixml/fixml-encoder.js +43 -20
  59. package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
  60. package/dist/buffer/fixml/fixml-parser.js +47 -24
  61. package/dist/buffer/fixml/fixml-parser.js.map +1 -1
  62. package/dist/buffer/fixml/fixml-view.d.ts +2 -4
  63. package/dist/buffer/fixml/fixml-view.js +13 -16
  64. package/dist/buffer/fixml/fixml-view.js.map +1 -1
  65. package/dist/buffer/fixml/populated-attributes.d.ts +5 -0
  66. package/dist/buffer/fixml/populated-attributes.js +3 -0
  67. package/dist/buffer/fixml/populated-attributes.js.map +1 -0
  68. package/dist/buffer/index.d.ts +4 -8
  69. package/dist/buffer/index.js +4 -8
  70. package/dist/buffer/index.js.map +1 -1
  71. package/dist/buffer/msg-encoder.d.ts +2 -1
  72. package/dist/buffer/msg-encoder.js.map +1 -1
  73. package/dist/buffer/msg-view.d.ts +3 -5
  74. package/dist/buffer/msg-view.js +8 -5
  75. package/dist/buffer/msg-view.js.map +1 -1
  76. package/dist/buffer/segment/segment-description.d.ts +26 -0
  77. package/dist/buffer/segment/segment-description.js +72 -0
  78. package/dist/buffer/segment/segment-description.js.map +1 -0
  79. package/dist/buffer/segment/segment-summary.d.ts +13 -0
  80. package/dist/buffer/segment/segment-summary.js +20 -0
  81. package/dist/buffer/segment/segment-summary.js.map +1 -0
  82. package/dist/buffer/segment/segment-type.d.ts +8 -0
  83. package/dist/buffer/segment/segment-type.js +13 -0
  84. package/dist/buffer/segment/segment-type.js.map +1 -0
  85. package/dist/buffer/segment-description.d.ts +2 -9
  86. package/dist/buffer/segment-description.js +5 -13
  87. package/dist/buffer/segment-description.js.map +1 -1
  88. package/dist/buffer/segment-type.d.ts +8 -0
  89. package/dist/buffer/segment-type.js +13 -0
  90. package/dist/buffer/segment-type.js.map +1 -0
  91. package/dist/buffer/structure.d.ts +3 -3
  92. package/dist/buffer/structure.js +1 -1
  93. package/dist/buffer/structure.js.map +1 -1
  94. package/dist/buffer/tag/tag-pos.d.ts +12 -0
  95. package/dist/buffer/tag/tag-pos.js +55 -0
  96. package/dist/buffer/tag/tag-pos.js.map +1 -0
  97. package/dist/buffer/tag/tag-type.d.ts +13 -0
  98. package/dist/buffer/tag/tag-type.js +18 -0
  99. package/dist/buffer/tag/tag-type.js.map +1 -0
  100. package/dist/buffer/tag/tags.d.ts +21 -0
  101. package/dist/buffer/tag/tags.js +122 -0
  102. package/dist/buffer/tag/tags.js.map +1 -0
  103. package/dist/buffer/tag-type.d.ts +13 -0
  104. package/dist/buffer/tag-type.js +18 -0
  105. package/dist/buffer/tag-type.js.map +1 -0
  106. package/dist/buffer/tags.d.ts +3 -14
  107. package/dist/buffer/tags.js +23 -36
  108. package/dist/buffer/tags.js.map +1 -1
  109. package/dist/config/get-js-fx-logger.d.ts +4 -0
  110. package/dist/{transport/make-fixl-session.js → config/get-js-fx-logger.js} +1 -1
  111. package/dist/config/get-js-fx-logger.js.map +1 -0
  112. package/dist/config/index.d.ts +1 -0
  113. package/dist/config/index.js +1 -0
  114. package/dist/config/index.js.map +1 -1
  115. package/dist/config/js-fix-config.d.ts +4 -1
  116. package/dist/config/js-fix-config.js +3 -3
  117. package/dist/config/js-fix-config.js.map +1 -1
  118. package/dist/config/js-fix-logger.d.ts +0 -3
  119. package/dist/config/js-fix-logger.js.map +1 -1
  120. package/dist/dict-parser.js +28 -23
  121. package/dist/dict-parser.js.map +1 -1
  122. package/dist/dictionary/compiler/compiler-type.js +7 -7
  123. package/dist/dictionary/compiler/compiler-type.js.map +1 -1
  124. package/dist/dictionary/compiler/enum-compiler.d.ts +1 -0
  125. package/dist/dictionary/compiler/enum-compiler.js +11 -1
  126. package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
  127. package/dist/dictionary/compiler/msg-compiler.js +8 -6
  128. package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
  129. package/dist/dictionary/contained/contained-component-field.js +2 -1
  130. package/dist/dictionary/contained/contained-component-field.js.map +1 -1
  131. package/dist/dictionary/contained/contained-field-dispatch.d.ts +1 -14
  132. package/dist/dictionary/contained/contained-field-dispatch.js +4 -4
  133. package/dist/dictionary/contained/contained-field-dispatch.js.map +1 -1
  134. package/dist/dictionary/contained/contained-field-dispatcher.d.ts +14 -0
  135. package/dist/dictionary/contained/contained-field-dispatcher.js +3 -0
  136. package/dist/dictionary/contained/contained-field-dispatcher.js.map +1 -0
  137. package/dist/dictionary/contained/contained-field-set.d.ts +1 -1
  138. package/dist/dictionary/contained/contained-field-set.js +12 -11
  139. package/dist/dictionary/contained/contained-field-set.js.map +1 -1
  140. package/dist/dictionary/contained/contained-field-type.d.ts +5 -0
  141. package/dist/dictionary/contained/contained-field-type.js +10 -0
  142. package/dist/dictionary/contained/contained-field-type.js.map +1 -0
  143. package/dist/dictionary/contained/contained-field.d.ts +1 -5
  144. package/dist/dictionary/contained/contained-field.js +1 -7
  145. package/dist/dictionary/contained/contained-field.js.map +1 -1
  146. package/dist/dictionary/contained/contained-group-field.js +2 -1
  147. package/dist/dictionary/contained/contained-group-field.js.map +1 -1
  148. package/dist/dictionary/contained/contained-simple-field.js +2 -1
  149. package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
  150. package/dist/dictionary/{fields-dispatch.d.ts → contained/field-dispatcher.d.ts} +3 -2
  151. package/dist/dictionary/contained/field-dispatcher.js +3 -0
  152. package/dist/dictionary/contained/field-dispatcher.js.map +1 -0
  153. package/dist/dictionary/contained/fields-dispatch.d.ts +6 -0
  154. package/dist/dictionary/contained/fields-dispatch.js +42 -0
  155. package/dist/dictionary/contained/fields-dispatch.js.map +1 -0
  156. package/dist/dictionary/contained/index.d.ts +2 -0
  157. package/dist/dictionary/contained/index.js +2 -0
  158. package/dist/dictionary/contained/index.js.map +1 -1
  159. package/dist/dictionary/contained-set-type.d.ts +5 -0
  160. package/dist/dictionary/contained-set-type.js +10 -0
  161. package/dist/dictionary/contained-set-type.js.map +1 -0
  162. package/dist/dictionary/definition/component-field-definition.js +2 -2
  163. package/dist/dictionary/definition/component-field-definition.js.map +1 -1
  164. package/dist/dictionary/definition/fix-definitions.d.ts +2 -1
  165. package/dist/dictionary/definition/fix-definitions.js.map +1 -1
  166. package/dist/dictionary/definition/group-field-definition.js +2 -2
  167. package/dist/dictionary/definition/group-field-definition.js.map +1 -1
  168. package/dist/dictionary/definition/index.d.ts +0 -1
  169. package/dist/dictionary/definition/index.js +0 -1
  170. package/dist/dictionary/definition/index.js.map +1 -1
  171. package/dist/dictionary/definition/message-definition.js +2 -2
  172. package/dist/dictionary/definition/message-definition.js.map +1 -1
  173. package/dist/dictionary/definition/simple-field-definition.d.ts +1 -1
  174. package/dist/dictionary/definition/simple-field-definition.js +5 -4
  175. package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
  176. package/dist/dictionary/dict-primitive.d.ts +0 -11
  177. package/dist/dictionary/dict-primitive.js +0 -7
  178. package/dist/dictionary/dict-primitive.js.map +1 -1
  179. package/dist/dictionary/fix-definition-source.d.ts +6 -0
  180. package/dist/dictionary/fix-definition-source.js +11 -0
  181. package/dist/dictionary/fix-definition-source.js.map +1 -0
  182. package/dist/dictionary/fix-versions.d.ts +0 -9
  183. package/dist/dictionary/fix-versions.js +1 -39
  184. package/dist/dictionary/fix-versions.js.map +1 -1
  185. package/dist/dictionary/index.d.ts +1 -5
  186. package/dist/dictionary/index.js +1 -5
  187. package/dist/dictionary/index.js.map +1 -1
  188. package/dist/dictionary/parser/fix-repository/abbreviations-parser.d.ts +1 -3
  189. package/dist/dictionary/parser/fix-repository/abbreviations-parser.js +2 -3
  190. package/dist/dictionary/parser/fix-repository/abbreviations-parser.js.map +1 -1
  191. package/dist/dictionary/parser/fix-repository/base-parser.d.ts +2 -4
  192. package/dist/dictionary/parser/fix-repository/base-parser.js +1 -2
  193. package/dist/dictionary/parser/fix-repository/base-parser.js.map +1 -1
  194. package/dist/dictionary/parser/fix-repository/components-parser.d.ts +1 -3
  195. package/dist/dictionary/parser/fix-repository/components-parser.js +2 -3
  196. package/dist/dictionary/parser/fix-repository/components-parser.js.map +1 -1
  197. package/dist/dictionary/parser/fix-repository/data-types-parser.d.ts +1 -3
  198. package/dist/dictionary/parser/fix-repository/data-types-parser.js +2 -3
  199. package/dist/dictionary/parser/fix-repository/data-types-parser.js.map +1 -1
  200. package/dist/dictionary/parser/fix-repository/enums-parser.d.ts +1 -3
  201. package/dist/dictionary/parser/fix-repository/enums-parser.js +2 -3
  202. package/dist/dictionary/parser/fix-repository/enums-parser.js.map +1 -1
  203. package/dist/dictionary/parser/fix-repository/fields-parser.d.ts +1 -3
  204. package/dist/dictionary/parser/fix-repository/fields-parser.js +2 -3
  205. package/dist/dictionary/parser/fix-repository/fields-parser.js.map +1 -1
  206. package/dist/dictionary/parser/fix-repository/messages-parser.d.ts +1 -3
  207. package/dist/dictionary/parser/fix-repository/messages-parser.js +2 -3
  208. package/dist/dictionary/parser/fix-repository/messages-parser.js.map +1 -1
  209. package/dist/dictionary/parser/fix-repository/msg-contents-parser.d.ts +1 -3
  210. package/dist/dictionary/parser/fix-repository/msg-contents-parser.js +2 -3
  211. package/dist/dictionary/parser/fix-repository/msg-contents-parser.js.map +1 -1
  212. package/dist/dictionary/parser/fix-repository/repository-abbreviation.d.ts +5 -0
  213. package/dist/dictionary/parser/fix-repository/repository-abbreviation.js +3 -0
  214. package/dist/dictionary/parser/fix-repository/repository-abbreviation.js.map +1 -0
  215. package/dist/dictionary/parser/fix-repository/repository-component.d.ts +10 -0
  216. package/dist/dictionary/parser/fix-repository/repository-component.js +3 -0
  217. package/dist/dictionary/parser/fix-repository/repository-component.js.map +1 -0
  218. package/dist/dictionary/parser/fix-repository/repository-data-type.d.ts +6 -0
  219. package/dist/dictionary/parser/fix-repository/repository-data-type.js +3 -0
  220. package/dist/dictionary/parser/fix-repository/repository-data-type.js.map +1 -0
  221. package/dist/dictionary/parser/fix-repository/repository-enum.d.ts +7 -0
  222. package/dist/dictionary/parser/fix-repository/repository-enum.js +3 -0
  223. package/dist/dictionary/parser/fix-repository/repository-enum.js.map +1 -0
  224. package/dist/dictionary/parser/fix-repository/repository-field.d.ts +11 -0
  225. package/dist/dictionary/parser/fix-repository/repository-field.js +3 -0
  226. package/dist/dictionary/parser/fix-repository/repository-field.js.map +1 -0
  227. package/dist/dictionary/parser/fix-repository/repository-message.d.ts +11 -0
  228. package/dist/dictionary/parser/fix-repository/repository-message.js +3 -0
  229. package/dist/dictionary/parser/fix-repository/repository-message.js.map +1 -0
  230. package/dist/dictionary/parser/fix-repository/repository-msg-content.d.ts +9 -0
  231. package/dist/dictionary/parser/fix-repository/repository-msg-content.js +3 -0
  232. package/dist/dictionary/parser/fix-repository/repository-msg-content.js.map +1 -0
  233. package/dist/dictionary/parser/fix-repository/repository-msg.d.ts +0 -0
  234. package/dist/dictionary/parser/fix-repository/repository-msg.js +1 -0
  235. package/dist/dictionary/parser/fix-repository/repository-msg.js.map +1 -0
  236. package/dist/dictionary/parser/fix-repository/repository-type.d.ts +0 -53
  237. package/dist/dictionary/parser/fix-repository/repository-type.js +0 -2
  238. package/dist/dictionary/parser/fix-repository/repository-type.js.map +1 -1
  239. package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +10 -10
  240. package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
  241. package/dist/dictionary/parser/fix-repository/repository.d.ts +12 -1
  242. package/dist/dictionary/parser/fix-repository/repository.js +50 -28
  243. package/dist/dictionary/parser/fix-repository/repository.js.map +1 -1
  244. package/dist/dictionary/parser/fixml/components-parser.d.ts +1 -1
  245. package/dist/dictionary/parser/fixml/components-parser.js.map +1 -1
  246. package/dist/dictionary/parser/fixml/fields-parser.d.ts +1 -1
  247. package/dist/dictionary/parser/fixml/fields-parser.js.map +1 -1
  248. package/dist/dictionary/parser/fixml/fix-xsd-parser.js +3 -2
  249. package/dist/dictionary/parser/fixml/fix-xsd-parser.js.map +1 -1
  250. package/dist/dictionary/parser/fixml/include-graph.js.map +1 -1
  251. package/dist/dictionary/parser/fixml/xsd-parser.d.ts +1 -1
  252. package/dist/dictionary/parser/fixml/xsd-parser.js.map +1 -1
  253. package/dist/dictionary/parser/quickfix/field-definition-parser.d.ts +4 -4
  254. package/dist/dictionary/parser/quickfix/field-definition-parser.js +3 -3
  255. package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
  256. package/dist/dictionary/parser/quickfix/field-set-parser.d.ts +4 -4
  257. package/dist/dictionary/parser/quickfix/field-set-parser.js +3 -3
  258. package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
  259. package/dist/dictionary/parser/quickfix/message-parser.d.ts +4 -4
  260. package/dist/dictionary/parser/quickfix/message-parser.js +3 -3
  261. package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
  262. package/dist/dictionary/parser/quickfix/node-parser.d.ts +4 -5
  263. package/dist/dictionary/parser/quickfix/node-parser.js +4 -4
  264. package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
  265. package/dist/dictionary/parser/quickfix/parse-state.d.ts +8 -0
  266. package/dist/dictionary/parser/quickfix/parse-state.js +13 -0
  267. package/dist/dictionary/parser/quickfix/parse-state.js.map +1 -0
  268. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -9
  269. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +28 -35
  270. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
  271. package/dist/dictionary/sax-node.d.ts +6 -0
  272. package/dist/{types/FIX4.4/quickfix/set/header.js → dictionary/sax-node.js} +1 -1
  273. package/dist/dictionary/sax-node.js.map +1 -0
  274. package/dist/dictionary/set-reduce.d.ts +5 -12
  275. package/dist/dictionary/set-reduce.js +28 -26
  276. package/dist/dictionary/set-reduce.js.map +1 -1
  277. package/dist/dictionary/type-dispatcher.d.ts +12 -0
  278. package/dist/dictionary/type-dispatcher.js +3 -0
  279. package/dist/dictionary/type-dispatcher.js.map +1 -0
  280. package/dist/dictionary/version-util.d.ts +4 -0
  281. package/dist/dictionary/version-util.js +36 -0
  282. package/dist/dictionary/version-util.js.map +1 -0
  283. package/dist/execution-report.test.d.ts +0 -0
  284. package/dist/execution-report.test.js +1 -0
  285. package/dist/execution-report.test.js.map +1 -0
  286. package/dist/experiment.d.ts +0 -0
  287. package/dist/experiment.js +1 -0
  288. package/dist/experiment.js.map +1 -0
  289. package/dist/fix-repo-dict.test.d.ts +0 -0
  290. package/dist/fix-repo-dict.test.js +1 -0
  291. package/dist/fix-repo-dict.test.js.map +1 -0
  292. package/dist/fix-session-state-args.d.ts +0 -0
  293. package/dist/fix-session-state-args.js +1 -0
  294. package/dist/fix-session-state-args.js.map +1 -0
  295. package/dist/fix-session-state.d.ts +0 -0
  296. package/dist/fix-session-state.js +1 -0
  297. package/dist/fix-session-state.js.map +1 -0
  298. package/dist/fix-session.d.ts +0 -0
  299. package/dist/fix-session.js +1 -0
  300. package/dist/fix-session.js.map +1 -0
  301. package/dist/fix.txt +1 -0
  302. package/dist/fixml-alloc-parse.test.d.ts +0 -0
  303. package/dist/fixml-alloc-parse.test.js +1 -0
  304. package/dist/fixml-alloc-parse.test.js.map +1 -0
  305. package/dist/fixml-mkt-data-fut-parse.test.d.ts +0 -0
  306. package/dist/fixml-mkt-data-fut-parse.test.js +1 -0
  307. package/dist/fixml-mkt-data-fut-parse.test.js.map +1 -0
  308. package/dist/fixml-mkt-data-settle-parse.test.d.ts +0 -0
  309. package/dist/fixml-mkt-data-settle-parse.test.js +1 -0
  310. package/dist/fixml-mkt-data-settle-parse.test.js.map +1 -0
  311. package/dist/fixml-tc-bi-lateral-parse.test.d.ts +0 -0
  312. package/dist/fixml-tc-bi-lateral-parse.test.js +1 -0
  313. package/dist/fixml-tc-bi-lateral-parse.test.js.map +1 -0
  314. package/dist/includes.test.d.ts +0 -0
  315. package/dist/includes.test.js +1 -0
  316. package/dist/includes.test.js.map +1 -0
  317. package/dist/index.d.ts +1 -0
  318. package/dist/index.js +1 -0
  319. package/dist/index.js.map +1 -1
  320. package/dist/jsfix-cmd.d.ts +5 -0
  321. package/dist/jsfix-cmd.js +28 -21
  322. package/dist/jsfix-cmd.js.map +1 -1
  323. package/dist/launcher.d.ts +0 -0
  324. package/dist/launcher.js +1 -0
  325. package/dist/launcher.js.map +1 -0
  326. package/dist/logon.test.d.ts +0 -0
  327. package/dist/logon.test.js +1 -0
  328. package/dist/logon.test.js.map +1 -0
  329. package/dist/make-fix-session.d.ts +0 -0
  330. package/dist/make-fix-session.js +1 -0
  331. package/dist/make-fix-session.js.map +1 -0
  332. package/dist/memory-store.test.d.ts +0 -0
  333. package/dist/memory-store.test.js +1 -0
  334. package/dist/memory-store.test.js.map +1 -0
  335. package/dist/object.json +691 -0
  336. package/dist/qf-full-msg.test.d.ts +0 -0
  337. package/dist/qf-full-msg.test.js +1 -0
  338. package/dist/qf-full-msg.test.js.map +1 -0
  339. package/dist/repo-full-ascii-msg.test.d.ts +0 -0
  340. package/dist/repo-full-ascii-msg.test.js +1 -0
  341. package/dist/repo-full-ascii-msg.test.js.map +1 -0
  342. package/dist/runtime/DITokens.d.ts +20 -0
  343. package/dist/runtime/DITokens.js +25 -0
  344. package/dist/runtime/DITokens.js.map +1 -0
  345. package/dist/runtime/app-launcher.d.ts +27 -0
  346. package/dist/runtime/app-launcher.js +131 -0
  347. package/dist/runtime/app-launcher.js.map +1 -0
  348. package/dist/runtime/di-tokens.d.ts +28 -0
  349. package/dist/runtime/di-tokens.js +33 -0
  350. package/dist/runtime/di-tokens.js.map +1 -0
  351. package/dist/runtime/engine-factory.d.ts +4 -0
  352. package/dist/runtime/engine-factory.js +3 -0
  353. package/dist/runtime/engine-factory.js.map +1 -0
  354. package/dist/runtime/index.d.ts +5 -0
  355. package/dist/runtime/index.js +18 -0
  356. package/dist/runtime/index.js.map +1 -0
  357. package/dist/runtime/launcher.d.ts +29 -0
  358. package/dist/runtime/launcher.js +131 -0
  359. package/dist/runtime/launcher.js.map +1 -0
  360. package/dist/runtime/make-config.d.ts +11 -0
  361. package/dist/runtime/make-config.js +57 -0
  362. package/dist/runtime/make-config.js.map +1 -0
  363. package/dist/runtime/session-container.d.ts +16 -0
  364. package/dist/runtime/session-container.js +168 -0
  365. package/dist/runtime/session-container.js.map +1 -0
  366. package/dist/runtime/session-launcher.d.ts +26 -0
  367. package/dist/runtime/session-launcher.js +131 -0
  368. package/dist/runtime/session-launcher.js.map +1 -0
  369. package/dist/sample/http/oms/app.d.ts +1 -1
  370. package/dist/sample/http/oms/app.js +16 -14
  371. package/dist/sample/http/oms/app.js.map +1 -1
  372. package/dist/sample/http/oms/http-client.js +22 -2
  373. package/dist/sample/http/oms/http-client.js.map +1 -1
  374. package/dist/sample/http/oms/http-server.js +21 -2
  375. package/dist/sample/http/oms/http-server.js.map +1 -1
  376. package/dist/sample/launcher.d.ts +21 -4
  377. package/dist/sample/launcher.js +87 -19
  378. package/dist/sample/launcher.js.map +1 -1
  379. package/dist/sample/tcp/qf-md/app.d.ts +1 -1
  380. package/dist/sample/tcp/qf-md/app.js +11 -11
  381. package/dist/sample/tcp/qf-md/app.js.map +1 -1
  382. package/dist/sample/tcp/qf-md/md-client.js +21 -2
  383. package/dist/sample/tcp/qf-md/md-client.js.map +1 -1
  384. package/dist/sample/tcp/qf-md/md-server.js +20 -2
  385. package/dist/sample/tcp/qf-md/md-server.js.map +1 -1
  386. package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -1
  387. package/dist/sample/tcp/recovering-skeleton/app.js +36 -16
  388. package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -1
  389. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +3 -1
  390. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +30 -8
  391. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
  392. package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +1 -1
  393. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +22 -3
  394. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -1
  395. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +21 -2
  396. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -1
  397. package/dist/sample/tcp/skeleton/app.d.ts +1 -1
  398. package/dist/sample/tcp/skeleton/app.js +8 -13
  399. package/dist/sample/tcp/skeleton/app.js.map +1 -1
  400. package/dist/sample/tcp/skeleton/skeleton-session.d.ts +1 -1
  401. package/dist/sample/tcp/skeleton/skeleton-session.js +26 -4
  402. package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
  403. package/dist/sample/tcp/tls-trade-capture/app.d.ts +1 -1
  404. package/dist/sample/tcp/tls-trade-capture/app.js +4 -24
  405. package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
  406. package/dist/sample/tcp/trade-capture/app-launcher.d.ts +6 -0
  407. package/dist/sample/tcp/trade-capture/app-launcher.js +21 -0
  408. package/dist/sample/tcp/trade-capture/app-launcher.js.map +1 -0
  409. package/dist/sample/tcp/trade-capture/app-launher.d.ts +0 -0
  410. package/dist/sample/tcp/trade-capture/app-launher.js +1 -0
  411. package/dist/sample/tcp/trade-capture/app-launher.js.map +1 -0
  412. package/dist/sample/tcp/trade-capture/app.d.ts +1 -1
  413. package/dist/sample/tcp/trade-capture/app.js +4 -21
  414. package/dist/sample/tcp/trade-capture/app.js.map +1 -1
  415. package/dist/sample/tcp/trade-capture/jsfix.test_client.txt +11 -0
  416. package/dist/sample/tcp/trade-capture/jsfix.test_server.txt +10 -0
  417. package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
  418. package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -1
  419. package/dist/sample/tcp/trade-capture/trade-factory.js +7 -1
  420. package/dist/sample/tcp/trade-capture/trade-factory.js.map +1 -1
  421. package/dist/segment-description.d.ts +0 -0
  422. package/dist/segment-description.js +1 -0
  423. package/dist/segment-description.js.map +1 -0
  424. package/dist/segment-summary.d.ts +0 -0
  425. package/dist/segment-summary.js +1 -0
  426. package/dist/segment-summary.js.map +1 -0
  427. package/dist/segment-type.d.ts +0 -0
  428. package/dist/segment-type.js +1 -0
  429. package/dist/segment-type.js.map +1 -0
  430. package/dist/session-description.d.ts +0 -0
  431. package/dist/session-description.js +1 -0
  432. package/dist/session-description.js.map +1 -0
  433. package/dist/session-msg-factory.d.ts +0 -0
  434. package/dist/session-msg-factory.js +1 -0
  435. package/dist/session-msg-factory.js.map +1 -0
  436. package/dist/session-state.d.ts +0 -0
  437. package/dist/session-state.js +1 -0
  438. package/dist/session-state.js.map +1 -0
  439. package/dist/session-state.test.d.ts +0 -0
  440. package/dist/session-state.test.js +1 -0
  441. package/dist/session-state.test.js.map +1 -0
  442. package/dist/session.test.d.ts +0 -0
  443. package/dist/session.test.js +1 -0
  444. package/dist/session.test.js.map +1 -0
  445. package/dist/setup.d.ts +0 -0
  446. package/dist/setup.js +1 -0
  447. package/dist/setup.js.map +1 -0
  448. package/dist/skeleton-runner.d.ts +0 -0
  449. package/dist/skeleton-runner.js +1 -0
  450. package/dist/skeleton-runner.js.map +1 -0
  451. package/dist/store/fix-msg-ascii-store-resend.d.ts +1 -1
  452. package/dist/store/fix-msg-ascii-store-resend.js +2 -1
  453. package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
  454. package/dist/store/fix-msg-memory-store.d.ts +1 -1
  455. package/dist/store/fix-msg-memory-store.js.map +1 -1
  456. package/dist/store/fix-msg-store-record.d.ts +2 -0
  457. package/dist/store/fix-msg-store-record.js +4 -0
  458. package/dist/store/fix-msg-store-record.js.map +1 -1
  459. package/dist/store/fix-msg-store-state.d.ts +6 -0
  460. package/dist/store/fix-msg-store-state.js +3 -0
  461. package/dist/store/fix-msg-store-state.js.map +1 -0
  462. package/dist/store/fix-msg-store.d.ts +1 -6
  463. package/dist/store/fix-msg-store.js.map +1 -1
  464. package/dist/structure.json +631 -0
  465. package/dist/tag-pos.d.ts +0 -0
  466. package/dist/tag-pos.js +1 -0
  467. package/dist/tag-pos.js.map +1 -0
  468. package/dist/tag-type.d.ts +0 -0
  469. package/dist/tag-type.js +1 -0
  470. package/dist/tag-type.js.map +1 -0
  471. package/dist/tags.d.ts +0 -0
  472. package/dist/tags.js +1 -0
  473. package/dist/tags.js.map +1 -0
  474. package/dist/test/ascii/ascii-encoder.test.d.ts +1 -0
  475. package/dist/test/{ascii-encode.test.js → ascii/ascii-encoder.test.js} +140 -49
  476. package/dist/test/ascii/ascii-encoder.test.js.map +1 -0
  477. package/dist/test/ascii/ascii-parser.test.d.ts +1 -0
  478. package/dist/test/ascii/ascii-parser.test.js +123 -0
  479. package/dist/test/ascii/ascii-parser.test.js.map +1 -0
  480. package/dist/test/ascii/ascii-segment.test.d.ts +1 -0
  481. package/dist/test/ascii/ascii-segment.test.js +86 -0
  482. package/dist/test/ascii/ascii-segment.test.js.map +1 -0
  483. package/dist/test/ascii/ascii-store-replay.test.d.ts +1 -0
  484. package/dist/test/ascii/ascii-store-replay.test.js +92 -0
  485. package/dist/test/ascii/ascii-store-replay.test.js.map +1 -0
  486. package/dist/test/ascii/ascii-tag-pos.test.d.ts +1 -0
  487. package/dist/test/ascii/ascii-tag-pos.test.js +105 -0
  488. package/dist/test/ascii/ascii-tag-pos.test.js.map +1 -0
  489. package/dist/test/ascii/execution-report.test.d.ts +1 -0
  490. package/dist/test/ascii/execution-report.test.js +489 -0
  491. package/dist/test/ascii/execution-report.test.js.map +1 -0
  492. package/dist/test/ascii/fix-log-replay.test.d.ts +1 -0
  493. package/dist/test/ascii/fix-log-replay.test.js +47 -0
  494. package/dist/test/ascii/fix-log-replay.test.js.map +1 -0
  495. package/dist/test/ascii/fix-repo-dict.test.d.ts +1 -0
  496. package/dist/test/ascii/fix-repo-dict.test.js +128 -0
  497. package/dist/test/ascii/fix-repo-dict.test.js.map +1 -0
  498. package/dist/test/ascii/includes.test.d.ts +1 -0
  499. package/dist/test/ascii/includes.test.js +43 -0
  500. package/dist/test/ascii/includes.test.js.map +1 -0
  501. package/dist/test/ascii/logon.test.d.ts +1 -0
  502. package/dist/test/ascii/logon.test.js +91 -0
  503. package/dist/test/ascii/logon.test.js.map +1 -0
  504. package/dist/test/ascii/memory-store.test.d.ts +1 -0
  505. package/dist/test/ascii/memory-store.test.js +75 -0
  506. package/dist/test/ascii/memory-store.test.js.map +1 -0
  507. package/dist/test/ascii/qf-full-msg.test.d.ts +1 -0
  508. package/dist/test/ascii/qf-full-msg.test.js +81 -0
  509. package/dist/test/ascii/qf-full-msg.test.js.map +1 -0
  510. package/dist/test/ascii/repo-full-ascii-msg.test.d.ts +1 -0
  511. package/dist/test/ascii/repo-full-ascii-msg.test.js +87 -0
  512. package/dist/test/ascii/repo-full-ascii-msg.test.js.map +1 -0
  513. package/dist/test/ascii/session-state.test.d.ts +1 -0
  514. package/dist/test/ascii/session-state.test.js +73 -0
  515. package/dist/test/ascii/session-state.test.js.map +1 -0
  516. package/dist/test/ascii/session.test.d.ts +1 -0
  517. package/dist/test/ascii/session.test.js +280 -0
  518. package/dist/test/ascii/session.test.js.map +1 -0
  519. package/dist/test/ascii/time-formatter.test.d.ts +1 -0
  520. package/dist/test/ascii/time-formatter.test.js +80 -0
  521. package/dist/test/ascii/time-formatter.test.js.map +1 -0
  522. package/dist/test/ascii/view-decode.test.d.ts +1 -0
  523. package/dist/test/ascii/view-decode.test.js +183 -0
  524. package/dist/test/ascii/view-decode.test.js.map +1 -0
  525. package/dist/test/ascii-encoder.test.d.ts +1 -1
  526. package/dist/test/ascii-encoder.test.js +51 -48
  527. package/dist/test/ascii-encoder.test.js.map +1 -1
  528. package/dist/test/ascii-parser.test.d.ts +1 -1
  529. package/dist/test/ascii-parser.test.js +26 -45
  530. package/dist/test/ascii-parser.test.js.map +1 -1
  531. package/dist/test/ascii-segment.test.d.ts +1 -1
  532. package/dist/test/ascii-segment.test.js +13 -34
  533. package/dist/test/ascii-segment.test.js.map +1 -1
  534. package/dist/test/ascii-store-replay.test.d.ts +1 -1
  535. package/dist/test/ascii-store-replay.test.js +12 -41
  536. package/dist/test/ascii-store-replay.test.js.map +1 -1
  537. package/dist/test/ascii-tag-pos.test.d.ts +1 -1
  538. package/dist/test/ascii-tag-pos.test.js +8 -8
  539. package/dist/test/ascii-tag-pos.test.js.map +1 -1
  540. package/dist/test/elastic-buffer.test.d.ts +1 -1
  541. package/dist/test/elastic-buffer.test.js +3 -1
  542. package/dist/test/elastic-buffer.test.js.map +1 -1
  543. package/dist/test/encode-proxy.test.d.ts +1 -1
  544. package/dist/test/encode-proxy.test.js +9 -9
  545. package/dist/test/encode-proxy.test.js.map +1 -1
  546. package/dist/test/env/experiment.d.ts +23 -0
  547. package/dist/test/env/experiment.js +33 -0
  548. package/dist/test/env/experiment.js.map +1 -0
  549. package/dist/test/env/parsing-result.d.ts +10 -0
  550. package/dist/test/env/parsing-result.js +14 -0
  551. package/dist/test/env/parsing-result.js.map +1 -0
  552. package/dist/test/env/setup.d.ts +39 -0
  553. package/dist/test/env/setup.js +98 -0
  554. package/dist/test/env/setup.js.map +1 -0
  555. package/dist/test/env/skeleton-runner.d.ts +15 -0
  556. package/dist/test/env/skeleton-runner.js +108 -0
  557. package/dist/test/env/skeleton-runner.js.map +1 -0
  558. package/dist/test/env/test-recovery.d.ts +13 -0
  559. package/dist/test/env/test-recovery.js +41 -0
  560. package/dist/test/env/test-recovery.js.map +1 -0
  561. package/dist/test/env/to-views.d.ts +11 -0
  562. package/dist/test/env/to-views.js +56 -0
  563. package/dist/test/env/to-views.js.map +1 -0
  564. package/dist/test/execution-report.test.d.ts +1 -1
  565. package/dist/test/execution-report.test.js +53 -49
  566. package/dist/test/execution-report.test.js.map +1 -1
  567. package/dist/test/experiment.d.ts +23 -0
  568. package/dist/test/experiment.js +33 -0
  569. package/dist/test/experiment.js.map +1 -0
  570. package/dist/test/expieriment.d.ts +23 -0
  571. package/dist/test/expieriment.js +33 -0
  572. package/dist/test/expieriment.js.map +1 -0
  573. package/dist/test/fix-log-replay.test.d.ts +1 -1
  574. package/dist/test/fix-log-replay.test.js +7 -5
  575. package/dist/test/fix-log-replay.test.js.map +1 -1
  576. package/dist/test/fix-repo-dict.test.d.ts +1 -1
  577. package/dist/test/fix-repo-dict.test.js +6 -5
  578. package/dist/test/fix-repo-dict.test.js.map +1 -1
  579. package/dist/test/fixml/fixml-alloc-parse.test.d.ts +1 -0
  580. package/dist/test/fixml/fixml-alloc-parse.test.js +161 -0
  581. package/dist/test/fixml/fixml-alloc-parse.test.js.map +1 -0
  582. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.d.ts +1 -0
  583. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js +61 -0
  584. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js.map +1 -0
  585. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.d.ts +1 -0
  586. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js +34 -0
  587. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js.map +1 -0
  588. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.d.ts +1 -0
  589. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js +97 -0
  590. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js.map +1 -0
  591. package/dist/test/fixml/repo-full-fixml-msg.test.d.ts +1 -0
  592. package/dist/test/fixml/repo-full-fixml-msg.test.js +143 -0
  593. package/dist/test/fixml/repo-full-fixml-msg.test.js.map +1 -0
  594. package/dist/test/fixml-alloc-parse.test.d.ts +1 -1
  595. package/dist/test/fixml-alloc-parse.test.js +2 -1
  596. package/dist/test/fixml-alloc-parse.test.js.map +1 -1
  597. package/dist/test/fixml-mkt-data-fut-parse.test.d.ts +1 -1
  598. package/dist/test/fixml-mkt-data-fut-parse.test.js +2 -1
  599. package/dist/test/fixml-mkt-data-fut-parse.test.js.map +1 -1
  600. package/dist/test/fixml-mkt-data-settle-parse.test.d.ts +1 -1
  601. package/dist/test/fixml-mkt-data-settle-parse.test.js +2 -1
  602. package/dist/test/fixml-mkt-data-settle-parse.test.js.map +1 -1
  603. package/dist/test/fixml-tc-bi-lateral-parse.test.d.ts +1 -1
  604. package/dist/test/fixml-tc-bi-lateral-parse.test.js +2 -1
  605. package/dist/test/fixml-tc-bi-lateral-parse.test.js.map +1 -1
  606. package/dist/test/includes.test.d.ts +1 -1
  607. package/dist/test/includes.test.js +1 -0
  608. package/dist/test/includes.test.js.map +1 -1
  609. package/dist/test/logon.test.d.ts +1 -1
  610. package/dist/test/logon.test.js +11 -11
  611. package/dist/test/logon.test.js.map +1 -1
  612. package/dist/test/memory-store.test.d.ts +1 -1
  613. package/dist/test/memory-store.test.js +11 -8
  614. package/dist/test/memory-store.test.js.map +1 -1
  615. package/dist/test/qf-full-msg.test.d.ts +1 -1
  616. package/dist/test/qf-full-msg.test.js +13 -9
  617. package/dist/test/qf-full-msg.test.js.map +1 -1
  618. package/dist/test/repo-full-ascii-msg.test.d.ts +1 -1
  619. package/dist/test/repo-full-ascii-msg.test.js +14 -10
  620. package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
  621. package/dist/test/repo-full-fixml-msg.test.d.ts +1 -1
  622. package/dist/test/repo-full-fixml-msg.test.js +7 -4
  623. package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
  624. package/dist/test/session-state.test.d.ts +1 -1
  625. package/dist/test/session-state.test.js +1 -0
  626. package/dist/test/session-state.test.js.map +1 -1
  627. package/dist/test/session.test.d.ts +1 -1
  628. package/dist/test/session.test.js +13 -144
  629. package/dist/test/session.test.js.map +1 -1
  630. package/dist/test/setup.d.ts +45 -0
  631. package/dist/test/setup.js +102 -0
  632. package/dist/test/setup.js.map +1 -0
  633. package/dist/test/skeleton-runner.d.ts +15 -0
  634. package/dist/test/skeleton-runner.js +108 -0
  635. package/dist/test/skeleton-runner.js.map +1 -0
  636. package/dist/test/time-formatter.test.d.ts +1 -1
  637. package/dist/test/time-formatter.test.js +3 -1
  638. package/dist/test/time-formatter.test.js.map +1 -1
  639. package/dist/test/to-views.d.ts +1 -1
  640. package/dist/test/to-views.js +5 -4
  641. package/dist/test/to-views.js.map +1 -1
  642. package/dist/test/view-decode.test.d.ts +1 -1
  643. package/dist/test/view-decode.test.js +9 -34
  644. package/dist/test/view-decode.test.js.map +1 -1
  645. package/dist/time-formatter.test.d.ts +0 -0
  646. package/dist/time-formatter.test.js +1 -0
  647. package/dist/time-formatter.test.js.map +1 -0
  648. package/dist/to-views.d.ts +0 -0
  649. package/dist/to-views.js +1 -0
  650. package/dist/to-views.js.map +1 -0
  651. package/dist/token.txt +248 -0
  652. package/dist/transport/FixEntity.d.ts +8 -0
  653. package/dist/transport/FixEntity.js +12 -0
  654. package/dist/transport/FixEntity.js.map +1 -0
  655. package/dist/transport/a-session-msg-factory.d.ts +2 -2
  656. package/dist/transport/a-session-msg-factory.js.map +1 -1
  657. package/dist/transport/ascii/ascii-msg-transmitter.js +25 -6
  658. package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
  659. package/dist/transport/ascii/ascii-session-msg-factory.d.ts +2 -2
  660. package/dist/transport/ascii/ascii-session-msg-factory.js +1 -1
  661. package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -1
  662. package/dist/transport/ascii/ascii-session.d.ts +1 -1
  663. package/dist/transport/ascii/ascii-session.js +26 -23
  664. package/dist/transport/ascii/ascii-session.js.map +1 -1
  665. package/dist/transport/ascii/index.d.ts +0 -1
  666. package/dist/transport/ascii/index.js +0 -1
  667. package/dist/transport/ascii/index.js.map +1 -1
  668. package/dist/transport/duplex/http-duplex.d.ts +1 -1
  669. package/dist/transport/duplex/http-duplex.js.map +1 -1
  670. package/dist/transport/duplex/tcp-duplex.js +22 -2
  671. package/dist/transport/duplex/tcp-duplex.js.map +1 -1
  672. package/dist/transport/factory/index.d.ts +1 -0
  673. package/dist/transport/factory/index.js +14 -0
  674. package/dist/transport/factory/index.js.map +1 -0
  675. package/dist/transport/{msg-transport.d.ts → factory/msg-transport.d.ts} +4 -4
  676. package/dist/transport/factory/msg-transport.js +61 -0
  677. package/dist/transport/factory/msg-transport.js.map +1 -0
  678. package/dist/transport/fix-acceptor.d.ts +2 -2
  679. package/dist/transport/fix-acceptor.js.map +1 -1
  680. package/dist/transport/fix-entity.d.ts +8 -0
  681. package/dist/transport/fix-entity.js +12 -0
  682. package/dist/transport/fix-entity.js.map +1 -0
  683. package/dist/transport/fix-initiator.d.ts +2 -2
  684. package/dist/transport/fix-initiator.js.map +1 -1
  685. package/dist/transport/fix-msg-factory.d.ts +1 -1
  686. package/dist/transport/fix-msg-factory.js.map +1 -1
  687. package/dist/transport/fix-session-state-args.d.ts +8 -0
  688. package/dist/transport/fix-session-state-args.js +3 -0
  689. package/dist/transport/fix-session-state-args.js.map +1 -0
  690. package/dist/transport/fix-session-state.d.ts +3 -41
  691. package/dist/transport/fix-session-state.js +21 -54
  692. package/dist/transport/fix-session-state.js.map +1 -1
  693. package/dist/transport/fix-session.d.ts +3 -2
  694. package/dist/transport/fix-session.js +44 -42
  695. package/dist/transport/fix-session.js.map +1 -1
  696. package/dist/transport/fixml/fixml-msg-transmitter.js +23 -5
  697. package/dist/transport/fixml/fixml-msg-transmitter.js.map +1 -1
  698. package/dist/transport/fixml/fixml-session-msg-factory.d.ts +2 -2
  699. package/dist/transport/fixml/fixml-session-msg-factory.js +1 -1
  700. package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -1
  701. package/dist/transport/fixml/fixml-session.d.ts +1 -1
  702. package/dist/transport/fixml/fixml-session.js +3 -3
  703. package/dist/transport/fixml/fixml-session.js.map +1 -1
  704. package/dist/transport/fixml/index.d.ts +0 -2
  705. package/dist/transport/fixml/index.js +0 -2
  706. package/dist/transport/fixml/index.js.map +1 -1
  707. package/dist/transport/http/html-options.d.ts +8 -0
  708. package/dist/{store/replay-record.js → transport/http/html-options.js} +1 -1
  709. package/dist/transport/http/html-options.js.map +1 -0
  710. package/dist/transport/http/html-route.d.ts +5 -0
  711. package/dist/{types/FIX4.4/quickfix/set/trailer.js → transport/http/html-route.js} +1 -1
  712. package/dist/transport/http/html-route.js.map +1 -0
  713. package/dist/transport/http/http-acceptor-listener.d.ts +7 -0
  714. package/dist/transport/http/http-acceptor-listener.js +68 -0
  715. package/dist/transport/http/http-acceptor-listener.js.map +1 -0
  716. package/dist/transport/http/http-acceptor.js +24 -5
  717. package/dist/transport/http/http-acceptor.js.map +1 -1
  718. package/dist/transport/http/http-adapter.d.ts +7 -0
  719. package/dist/transport/http/http-adapter.js +3 -0
  720. package/dist/transport/http/http-adapter.js.map +1 -0
  721. package/dist/transport/http/http-initiator.d.ts +9 -3
  722. package/dist/transport/http/http-initiator.js +57 -26
  723. package/dist/transport/http/http-initiator.js.map +1 -1
  724. package/dist/transport/http/http-json-sample-adapter.d.ts +2 -1
  725. package/dist/transport/http/http-json-sample-adapter.js +21 -2
  726. package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
  727. package/dist/transport/http/http-transaction.d.ts +1 -1
  728. package/dist/transport/http/http-transaction.js.map +1 -1
  729. package/dist/transport/http/http-transport-description.d.ts +8 -0
  730. package/dist/transport/http/http-transport-description.js +3 -0
  731. package/dist/transport/http/http-transport-description.js.map +1 -0
  732. package/dist/transport/http/index.d.ts +1 -0
  733. package/dist/transport/http/index.js +1 -0
  734. package/dist/transport/http/index.js.map +1 -1
  735. package/dist/transport/index.d.ts +11 -10
  736. package/dist/transport/index.js +11 -10
  737. package/dist/transport/index.js.map +1 -1
  738. package/dist/transport/{make-fixl-session.d.ts → make-fix-session.d.ts} +0 -0
  739. package/dist/transport/make-fix-session.js +3 -0
  740. package/dist/transport/make-fix-session.js.map +1 -0
  741. package/dist/transport/msg-application.d.ts +12 -0
  742. package/dist/transport/msg-application.js +3 -0
  743. package/dist/transport/msg-application.js.map +1 -0
  744. package/dist/transport/msg-transmitter.d.ts +5 -5
  745. package/dist/transport/msg-transmitter.js +2 -3
  746. package/dist/transport/msg-transmitter.js.map +1 -1
  747. package/dist/transport/session/a-session-msg-factory.d.ts +23 -0
  748. package/dist/transport/session/a-session-msg-factory.js +58 -0
  749. package/dist/transport/session/a-session-msg-factory.js.map +1 -0
  750. package/dist/transport/session/fix-session-state-args.d.ts +8 -0
  751. package/dist/transport/session/fix-session-state-args.js +3 -0
  752. package/dist/transport/session/fix-session-state-args.js.map +1 -0
  753. package/dist/transport/session/fix-session-state.d.ts +32 -0
  754. package/dist/transport/session/fix-session-state.js +133 -0
  755. package/dist/transport/session/fix-session-state.js.map +1 -0
  756. package/dist/transport/session/fix-session.d.ts +50 -0
  757. package/dist/transport/session/fix-session.js +291 -0
  758. package/dist/transport/session/fix-session.js.map +1 -0
  759. package/dist/transport/session/make-fix-session.d.ts +5 -0
  760. package/dist/transport/session/make-fix-session.js +3 -0
  761. package/dist/transport/session/make-fix-session.js.map +1 -0
  762. package/dist/transport/session/session-description.d.ts +17 -0
  763. package/dist/transport/session/session-description.js +3 -0
  764. package/dist/transport/session/session-description.js.map +1 -0
  765. package/dist/transport/session/session-msg-factory.d.ts +15 -0
  766. package/dist/transport/session/session-msg-factory.js +3 -0
  767. package/dist/transport/session/session-msg-factory.js.map +1 -0
  768. package/dist/transport/session/session-state.d.ts +25 -0
  769. package/dist/transport/session/session-state.js +30 -0
  770. package/dist/transport/session/session-state.js.map +1 -0
  771. package/dist/transport/session-description.d.ts +1 -48
  772. package/dist/transport/session-description.js.map +1 -1
  773. package/dist/transport/session-msg-factory.d.ts +7 -20
  774. package/dist/transport/session-msg-factory.js +0 -150
  775. package/dist/transport/session-msg-factory.js.map +1 -1
  776. package/dist/transport/session-state.d.ts +25 -0
  777. package/dist/transport/session-state.js +30 -0
  778. package/dist/transport/session-state.js.map +1 -0
  779. package/dist/transport/tcp/index.d.ts +3 -2
  780. package/dist/transport/tcp/index.js +3 -2
  781. package/dist/transport/tcp/index.js.map +1 -1
  782. package/dist/transport/tcp/recovering-tcp-initiator.d.ts +7 -9
  783. package/dist/transport/tcp/recovering-tcp-initiator.js +41 -16
  784. package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -1
  785. package/dist/transport/tcp/tcp-acceptor-listener.d.ts +7 -0
  786. package/dist/transport/tcp/tcp-acceptor-listener.js +70 -0
  787. package/dist/transport/tcp/tcp-acceptor-listener.js.map +1 -0
  788. package/dist/transport/tcp/tcp-acceptor.js +29 -12
  789. package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
  790. package/dist/transport/tcp/tcp-initiator-connector.d.ts +10 -0
  791. package/dist/transport/tcp/tcp-initiator-connector.js +97 -0
  792. package/dist/transport/tcp/tcp-initiator-connector.js.map +1 -0
  793. package/dist/transport/tcp/tcp-initiator.d.ts +2 -2
  794. package/dist/transport/tcp/tcp-initiator.js +28 -9
  795. package/dist/transport/tcp/tcp-initiator.js.map +1 -1
  796. package/dist/transport/tcp/tcp-transport-description.d.ts +6 -0
  797. package/dist/transport/tcp/tcp-transport-description.js +3 -0
  798. package/dist/transport/tcp/tcp-transport-description.js.map +1 -0
  799. package/dist/transport/tcp/tls-options-factory.d.ts +9 -0
  800. package/dist/transport/tcp/tls-options-factory.js +53 -0
  801. package/dist/transport/tcp/tls-options-factory.js.map +1 -0
  802. package/dist/transport/tcp/tls-options.d.ts +10 -5
  803. package/dist/transport/tcp/tls-options.js +0 -49
  804. package/dist/transport/tcp/tls-options.js.map +1 -1
  805. package/dist/transport/tick-action.d.ts +8 -0
  806. package/dist/transport/tick-action.js +13 -0
  807. package/dist/transport/tick-action.js.map +1 -0
  808. package/dist/util/buffer-helper.js +1 -1
  809. package/dist/util/buffer-helper.js.map +1 -1
  810. package/dist/util/definition-factory.d.ts +10 -0
  811. package/dist/util/definition-factory.js +56 -0
  812. package/dist/util/definition-factory.js.map +1 -0
  813. package/dist/util/dictionary-path.d.ts +4 -0
  814. package/dist/util/dictionary-path.js +3 -0
  815. package/dist/util/dictionary-path.js.map +1 -0
  816. package/dist/util/index.d.ts +1 -1
  817. package/dist/util/index.js +1 -1
  818. package/dist/util/index.js.map +1 -1
  819. package/dist/util/json-helper.d.ts +3 -1
  820. package/dist/util/json-helper.js +13 -12
  821. package/dist/util/json-helper.js.map +1 -1
  822. package/dist/util/message-generator.d.ts +1 -1
  823. package/dist/util/message-generator.js +16 -15
  824. package/dist/util/message-generator.js.map +1 -1
  825. package/dist/util/replay.d.ts +6 -3
  826. package/dist/util/replay.js +24 -26
  827. package/dist/util/replay.js.map +1 -1
  828. package/package.json +15 -10
  829. package/script/build.cmd +1 -0
  830. package/script/build.sh +1 -0
  831. package/script/test.cmd +3 -0
  832. package/src/buffer/{ascii-chars.ts → ascii/ascii-chars.ts} +0 -0
  833. package/src/buffer/ascii/ascii-encoder.ts +9 -6
  834. package/src/buffer/ascii/ascii-parser-state.ts +7 -12
  835. package/src/buffer/ascii/ascii-parser.ts +23 -16
  836. package/src/buffer/ascii/ascii-segment-parser.ts +14 -8
  837. package/src/buffer/ascii/ascii-view.ts +4 -9
  838. package/src/buffer/ascii/index.ts +1 -0
  839. package/src/buffer/ascii/parse-state.ts +8 -0
  840. package/src/buffer/ascii/time-formatter.ts +1 -1
  841. package/src/buffer/elastic-buffer.ts +7 -2
  842. package/src/buffer/encode-proxy.ts +9 -4
  843. package/src/buffer/fixml/fixml-encoder.ts +15 -11
  844. package/src/buffer/fixml/fixml-parser.ts +16 -6
  845. package/src/buffer/fixml/fixml-view.ts +4 -9
  846. package/src/buffer/fixml/populated-attributes.ts +6 -0
  847. package/src/buffer/index.ts +4 -8
  848. package/src/buffer/msg-encoder.ts +2 -1
  849. package/src/buffer/msg-view.ts +13 -9
  850. package/src/buffer/{segment-description.ts → segment/segment-description.ts} +4 -11
  851. package/src/buffer/{segment-summary.ts → segment/segment-summary.ts} +0 -0
  852. package/src/buffer/segment/segment-type.ts +8 -0
  853. package/src/buffer/structure.ts +3 -3
  854. package/src/buffer/{tag-pos.ts → tag/tag-pos.ts} +0 -0
  855. package/src/buffer/tag/tag-type.ts +13 -0
  856. package/src/buffer/{tags.ts → tag/tags.ts} +4 -16
  857. package/src/config/get-js-fx-logger.ts +4 -0
  858. package/src/config/index.ts +1 -0
  859. package/src/config/js-fix-config.ts +5 -2
  860. package/src/config/js-fix-logger.ts +0 -3
  861. package/src/dictionary/compiler/compiler-type.ts +3 -3
  862. package/src/dictionary/compiler/enum-compiler.ts +12 -1
  863. package/src/dictionary/compiler/msg-compiler.ts +8 -7
  864. package/src/dictionary/contained/contained-component-field.ts +2 -1
  865. package/src/dictionary/contained/contained-field-dispatch.ts +3 -7
  866. package/src/dictionary/contained/contained-field-dispatcher.ts +9 -0
  867. package/src/dictionary/contained/contained-field-set.ts +5 -3
  868. package/src/dictionary/contained/contained-field-type.ts +5 -0
  869. package/src/dictionary/contained/contained-field.ts +1 -6
  870. package/src/dictionary/contained/contained-group-field.ts +2 -1
  871. package/src/dictionary/contained/contained-simple-field.ts +2 -1
  872. package/src/dictionary/contained/field-dispatcher.ts +9 -0
  873. package/src/dictionary/contained/fields-dispatch.ts +46 -0
  874. package/src/dictionary/contained/index.ts +2 -0
  875. package/src/dictionary/contained-set-type.ts +5 -0
  876. package/src/dictionary/definition/component-field-definition.ts +1 -1
  877. package/src/dictionary/definition/fix-definitions.ts +2 -1
  878. package/src/dictionary/definition/group-field-definition.ts +1 -1
  879. package/src/dictionary/definition/index.ts +0 -1
  880. package/src/dictionary/definition/message-definition.ts +1 -1
  881. package/src/dictionary/definition/simple-field-definition.ts +3 -1
  882. package/src/dictionary/dict-primitive.ts +0 -13
  883. package/src/dictionary/fix-definition-source.ts +6 -0
  884. package/src/dictionary/fix-versions.ts +0 -32
  885. package/src/dictionary/index.ts +1 -5
  886. package/src/dictionary/parser/fix-repository/abbreviations-parser.ts +2 -3
  887. package/src/dictionary/parser/fix-repository/base-parser.ts +2 -3
  888. package/src/dictionary/parser/fix-repository/components-parser.ts +2 -3
  889. package/src/dictionary/parser/fix-repository/data-types-parser.ts +2 -3
  890. package/src/dictionary/parser/fix-repository/enums-parser.ts +2 -3
  891. package/src/dictionary/parser/fix-repository/fields-parser.ts +2 -3
  892. package/src/dictionary/parser/fix-repository/messages-parser.ts +2 -3
  893. package/src/dictionary/parser/fix-repository/msg-contents-parser.ts +2 -3
  894. package/src/dictionary/parser/fix-repository/repository-abbreviation.ts +6 -0
  895. package/src/dictionary/parser/fix-repository/repository-component.ts +11 -0
  896. package/src/dictionary/parser/fix-repository/repository-data-type.ts +7 -0
  897. package/src/dictionary/parser/fix-repository/repository-enum.ts +8 -0
  898. package/src/dictionary/parser/fix-repository/repository-field.ts +12 -0
  899. package/src/dictionary/parser/fix-repository/repository-message.ts +12 -0
  900. package/src/dictionary/parser/fix-repository/repository-msg-content.ts +10 -0
  901. package/src/dictionary/parser/fix-repository/repository-type.ts +0 -59
  902. package/src/dictionary/parser/fix-repository/repository-xml-parser.ts +10 -9
  903. package/src/dictionary/parser/fix-repository/repository.ts +69 -38
  904. package/src/dictionary/parser/fixml/components-parser.ts +6 -3
  905. package/src/dictionary/parser/fixml/fields-parser.ts +1 -1
  906. package/src/dictionary/parser/fixml/fix-xsd-parser.ts +2 -1
  907. package/src/dictionary/parser/fixml/include-graph.ts +2 -1
  908. package/src/dictionary/parser/fixml/xsd-parser.ts +2 -1
  909. package/src/dictionary/parser/quickfix/field-definition-parser.ts +4 -5
  910. package/src/dictionary/parser/quickfix/field-set-parser.ts +4 -5
  911. package/src/dictionary/parser/quickfix/message-parser.ts +4 -5
  912. package/src/dictionary/parser/quickfix/node-parser.ts +3 -6
  913. package/src/dictionary/parser/quickfix/parse-state.ts +8 -0
  914. package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +9 -15
  915. package/src/dictionary/sax-node.ts +7 -0
  916. package/src/dictionary/set-reduce.ts +30 -31
  917. package/src/dictionary/type-dispatcher.ts +7 -0
  918. package/src/dictionary/version-util.ts +25 -0
  919. package/src/index.ts +1 -0
  920. package/src/jsfix-cmd.ts +31 -16
  921. package/src/runtime/di-tokens.ts +48 -0
  922. package/src/runtime/engine-factory.ts +5 -0
  923. package/src/runtime/index.ts +5 -0
  924. package/src/runtime/make-config.ts +35 -0
  925. package/src/runtime/session-container.ts +180 -0
  926. package/src/runtime/session-launcher.ts +127 -0
  927. package/src/sample/http/oms/app.ts +20 -14
  928. package/src/sample/http/oms/http-client.ts +5 -2
  929. package/src/sample/http/oms/http-server.ts +5 -1
  930. package/src/sample/tcp/qf-md/app.ts +12 -12
  931. package/src/sample/tcp/qf-md/md-client.ts +4 -1
  932. package/src/sample/tcp/qf-md/md-server.ts +3 -1
  933. package/src/sample/tcp/recovering-skeleton/app.ts +37 -15
  934. package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +16 -9
  935. package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +4 -2
  936. package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +4 -2
  937. package/src/sample/tcp/skeleton/app.ts +10 -15
  938. package/src/sample/tcp/skeleton/skeleton-session.ts +8 -4
  939. package/src/sample/tcp/tls-trade-capture/app.ts +8 -31
  940. package/src/sample/tcp/trade-capture/app-launcher.ts +22 -0
  941. package/src/sample/tcp/trade-capture/app.ts +3 -26
  942. package/src/sample/tcp/trade-capture/trade-capture-client.ts +2 -1
  943. package/src/sample/tcp/trade-capture/trade-capture-server.ts +2 -1
  944. package/src/sample/tcp/trade-capture/trade-factory.ts +7 -1
  945. package/src/store/fix-msg-ascii-store-resend.ts +3 -2
  946. package/src/store/fix-msg-memory-store.ts +1 -1
  947. package/src/store/fix-msg-store-record.ts +6 -0
  948. package/src/store/fix-msg-store-state.ts +6 -0
  949. package/src/store/fix-msg-store.ts +1 -7
  950. package/src/transport/ascii/ascii-msg-transmitter.ts +9 -5
  951. package/src/transport/ascii/ascii-session-msg-factory.ts +2 -2
  952. package/src/transport/ascii/ascii-session.ts +9 -6
  953. package/src/transport/ascii/index.ts +0 -1
  954. package/src/transport/duplex/http-duplex.ts +1 -1
  955. package/src/transport/duplex/tcp-duplex.ts +4 -1
  956. package/src/transport/factory/index.ts +1 -0
  957. package/src/transport/factory/msg-transport.ts +55 -0
  958. package/src/transport/fix-acceptor.ts +2 -2
  959. package/src/transport/fix-entity.ts +9 -0
  960. package/src/transport/fix-initiator.ts +2 -2
  961. package/src/transport/fixml/fixml-msg-transmitter.ts +8 -4
  962. package/src/transport/fixml/fixml-session-msg-factory.ts +2 -2
  963. package/src/transport/fixml/fixml-session.ts +2 -2
  964. package/src/transport/fixml/index.ts +0 -2
  965. package/src/transport/http/html-options.ts +8 -0
  966. package/src/transport/http/html-route.ts +6 -0
  967. package/src/transport/http/http-acceptor-listener.ts +42 -0
  968. package/src/transport/http/http-acceptor.ts +5 -2
  969. package/src/transport/http/http-adapter.ts +7 -0
  970. package/src/transport/http/http-initiator.ts +40 -25
  971. package/src/transport/http/http-json-sample-adapter.ts +7 -2
  972. package/src/transport/http/http-transaction.ts +1 -1
  973. package/src/transport/http/http-transport-description.ts +9 -0
  974. package/src/transport/http/index.ts +1 -0
  975. package/src/transport/index.ts +11 -10
  976. package/src/transport/msg-application.ts +13 -0
  977. package/src/transport/msg-transmitter.ts +5 -5
  978. package/src/transport/{a-session-msg-factory.ts → session/a-session-msg-factory.ts} +4 -4
  979. package/src/transport/session/fix-session-state-args.ts +9 -0
  980. package/src/transport/{fix-session-state.ts → session/fix-session-state.ts} +4 -44
  981. package/src/transport/{fix-session.ts → session/fix-session.ts} +10 -7
  982. package/src/transport/{make-fixl-session.ts → session/make-fix-session.ts} +1 -1
  983. package/src/transport/session/session-description.ts +18 -0
  984. package/src/transport/{fix-msg-factory.ts → session/session-msg-factory.ts} +2 -2
  985. package/src/transport/session/session-state.ts +25 -0
  986. package/src/transport/tcp/index.ts +3 -2
  987. package/src/transport/tcp/recovering-tcp-initiator.ts +24 -13
  988. package/src/transport/tcp/tcp-acceptor-listener.ts +45 -0
  989. package/src/transport/tcp/tcp-acceptor.ts +11 -10
  990. package/src/transport/tcp/tcp-initiator-connector.ts +71 -0
  991. package/src/transport/tcp/tcp-initiator.ts +10 -6
  992. package/src/transport/tcp/tcp-transport-description.ts +7 -0
  993. package/src/transport/tcp/tls-options-factory.ts +55 -0
  994. package/src/transport/tcp/tls-options.ts +9 -51
  995. package/src/transport/tick-action.ts +8 -0
  996. package/src/util/definition-factory.ts +47 -0
  997. package/src/util/dictionary-path.ts +4 -0
  998. package/src/util/index.ts +1 -1
  999. package/src/util/json-helper.ts +14 -4
  1000. package/src/util/message-generator.ts +6 -3
  1001. package/src/util/replay.ts +26 -21
  1002. package/tsconfig.json +2 -0
  1003. package/dist/buffer/ascii-chars.js.map +0 -1
  1004. package/dist/dictionary/fields-dispatch.js +0 -40
  1005. package/dist/dictionary/fields-dispatch.js.map +0 -1
  1006. package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +0 -2
  1007. package/dist/sample/tcp/recovering-skeleton/respawn-2.js +0 -3
  1008. package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +0 -1
  1009. package/dist/store/fix-msg-ascii-store-recovery.d.ts +0 -12
  1010. package/dist/store/fix-msg-ascii-store-recovery.js +0 -60
  1011. package/dist/store/fix-msg-ascii-store-recovery.js.map +0 -1
  1012. package/dist/store/fix-msg-ascii-store-replay.d.ts +0 -13
  1013. package/dist/store/fix-msg-ascii-store-replay.js +0 -60
  1014. package/dist/store/fix-msg-ascii-store-replay.js.map +0 -1
  1015. package/dist/store/fix-replay-record.d.ts +0 -12
  1016. package/dist/store/fix-replay-record.js +0 -12
  1017. package/dist/store/fix-replay-record.js.map +0 -1
  1018. package/dist/store/fix-resend-record.d.ts +0 -12
  1019. package/dist/store/fix-resend-record.js +0 -12
  1020. package/dist/store/fix-resend-record.js.map +0 -1
  1021. package/dist/store/replay-record.d.ts +0 -6
  1022. package/dist/store/replay-record.js.map +0 -1
  1023. package/dist/store/store-replay-record.d.ts +0 -12
  1024. package/dist/store/store-replay-record.js +0 -12
  1025. package/dist/store/store-replay-record.js.map +0 -1
  1026. package/dist/tcp/tls-options.d.ts +0 -5
  1027. package/dist/tcp/tls-options.js +0 -45
  1028. package/dist/tcp/tls-options.js.map +0 -1
  1029. package/dist/test/ascii-encode.test.d.ts +0 -1
  1030. package/dist/test/ascii-encode.test.js.map +0 -1
  1031. package/dist/test/ascii-store-recovery.test.d.ts +0 -1
  1032. package/dist/test/ascii-store-recovery.test.js +0 -50
  1033. package/dist/test/ascii-store-recovery.test.js.map +0 -1
  1034. package/dist/transport/ascii-session-msg-factory.d.ts +0 -16
  1035. package/dist/transport/ascii-session-msg-factory.js +0 -47
  1036. package/dist/transport/ascii-session-msg-factory.js.map +0 -1
  1037. package/dist/transport/fixml/acceptor.d.ts +0 -3
  1038. package/dist/transport/fixml/acceptor.js +0 -38
  1039. package/dist/transport/fixml/acceptor.js.map +0 -1
  1040. package/dist/transport/fixml-session-msg-factory.d.ts +0 -13
  1041. package/dist/transport/fixml-session-msg-factory.js +0 -68
  1042. package/dist/transport/fixml-session-msg-factory.js.map +0 -1
  1043. package/dist/transport/make-config.d.ts +0 -4
  1044. package/dist/transport/make-config.js +0 -31
  1045. package/dist/transport/make-config.js.map +0 -1
  1046. package/dist/transport/make-fixl-session.js.map +0 -1
  1047. package/dist/transport/msg-transport.js +0 -57
  1048. package/dist/transport/msg-transport.js.map +0 -1
  1049. package/dist/transport/tcp/acceptor.d.ts +0 -3
  1050. package/dist/transport/tcp/acceptor.js +0 -40
  1051. package/dist/transport/tcp/acceptor.js.map +0 -1
  1052. package/dist/transport/tcp/initiator.d.ts +0 -3
  1053. package/dist/transport/tcp/initiator.js +0 -67
  1054. package/dist/transport/tcp/initiator.js.map +0 -1
  1055. package/dist/transport/tcp/recovering-initiator.d.ts +0 -17
  1056. package/dist/transport/tcp/recovering-initiator.js +0 -30
  1057. package/dist/transport/tcp/recovering-initiator.js.map +0 -1
  1058. package/dist/transport/tcp/recovering_initiator.d.ts +0 -12
  1059. package/dist/transport/tcp/recovering_initiator.js +0 -25
  1060. package/dist/transport/tcp/recovering_initiator.js.map +0 -1
  1061. package/dist/transport/tcp/resilient-initiator.d.ts +0 -12
  1062. package/dist/transport/tcp/resilient-initiator.js +0 -41
  1063. package/dist/transport/tcp/resilient-initiator.js.map +0 -1
  1064. package/dist/types/FIX4.4/quickfix/set/header.d.ts +0 -31
  1065. package/dist/types/FIX4.4/quickfix/set/header.js.map +0 -1
  1066. package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +0 -6
  1067. package/dist/types/FIX4.4/quickfix/set/trailer.js.map +0 -1
  1068. package/dist/util/dictionary-definitions.d.ts +0 -8
  1069. package/dist/util/dictionary-definitions.js +0 -51
  1070. package/dist/util/dictionary-definitions.js.map +0 -1
  1071. package/src/dictionary/fields-dispatch.ts +0 -45
  1072. package/src/sample/launcher.ts +0 -56
  1073. package/src/transport/fixml/acceptor.ts +0 -29
  1074. package/src/transport/make-config.ts +0 -19
  1075. package/src/transport/msg-transport.ts +0 -67
  1076. package/src/transport/session-description.ts +0 -70
  1077. package/src/transport/tcp/acceptor.ts +0 -31
  1078. package/src/transport/tcp/initiator.ts +0 -59
  1079. package/src/util/dictionary-definitions.ts +0 -41
@@ -9,45 +9,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const buffer_1 = require("../buffer");
13
- const transport_1 = require("../transport");
12
+ require("reflect-metadata");
14
13
  const util_1 = require("../util");
15
- const path = require("path");
16
14
  const __1 = require("..");
15
+ const setup_1 = require("./env/setup");
17
16
  let definitions;
18
17
  let jsonHelper;
19
- const root = path.join(__dirname, '../../data');
20
18
  const logon = '8=FIX4.4|9=0000208|35=A|49=sender-10|56=target-20|34=1|57=sub-a|52=20180610-10:39:01.621|98=2|108=62441|95=20|96=VgfoSqo56NqSVI1fLdlI|141=Y|789=4886|383=20|384=1|372=ipsum|385=R|464=N|553=sit|554=consectetur|10=49|';
19
+ let config;
20
+ let setup = null;
21
21
  beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
22
- const sessionDescription = require(path.join(root, 'session/test-initiator.json'));
23
- definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
22
+ setup = new setup_1.Setup();
23
+ yield setup.init();
24
+ definitions = setup.definitions;
24
25
  jsonHelper = new util_1.JsonHelper(definitions);
26
+ config = setup.clientConfig;
25
27
  }), 45000);
26
- class ParsingResult {
27
- constructor(event, msgType, view, contents, parser) {
28
- this.event = event;
29
- this.msgType = msgType;
30
- this.view = view;
31
- this.contents = contents;
32
- this.parser = parser;
33
- }
34
- }
35
- function toParse(text, chunks = false) {
36
- return new Promise((resolve, reject) => {
37
- const parser = new buffer_1.AsciiParser(definitions, new transport_1.StringDuplex(text, chunks).readable, buffer_1.AsciiChars.Pipe);
38
- parser.on('error', (e) => {
39
- reject(e);
40
- });
41
- parser.on('msg', (msgType, view) => {
42
- resolve(new ParsingResult('msg', msgType, view.clone(), parser.state.elasticBuffer.toString(), parser));
43
- });
44
- parser.on('done', () => {
45
- resolve(new ParsingResult('done', null, null, parser.state.elasticBuffer.toString(), parser));
46
- });
47
- });
48
- }
49
28
  test('0 gaps', () => __awaiter(void 0, void 0, void 0, function* () {
50
- const res = yield toParse(logon);
29
+ const res = yield setup.client.parseText(logon);
51
30
  expect(res.event).toEqual('msg');
52
31
  expect(res.msgType).toEqual(__1.MsgType.Logon);
53
32
  const unknowns = res.view.structure.layout['.undefined'];
@@ -59,7 +38,7 @@ test('0 gaps', () => __awaiter(void 0, void 0, void 0, function* () {
59
38
  }));
60
39
  test('1 gap', () => __awaiter(void 0, void 0, void 0, function* () {
61
40
  const gap = logon.replace('108=62441|', '108=62441|9999=im not here');
62
- const res = yield toParse(gap);
41
+ const res = yield setup.client.parseText(gap);
63
42
  expect(res.event).toEqual('msg');
64
43
  expect(res.msgType).toEqual(__1.MsgType.Logon);
65
44
  const unknown = res.view.structure.layout['.undefined'];
@@ -73,7 +52,7 @@ test('1 gap', () => __awaiter(void 0, void 0, void 0, function* () {
73
52
  }));
74
53
  test('1 gap next to 1 gap', () => __awaiter(void 0, void 0, void 0, function* () {
75
54
  const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|');
76
- const res = yield toParse(gap);
55
+ const res = yield setup.client.parseText(gap);
77
56
  expect(res.event).toEqual('msg');
78
57
  expect(res.msgType).toEqual(__1.MsgType.Logon);
79
58
  const unknowns = res.view.structure.layout['.undefined'];
@@ -90,7 +69,7 @@ test('1 gap next to 1 gap', () => __awaiter(void 0, void 0, void 0, function* ()
90
69
  }));
91
70
  test('1 gap undefined msg', () => __awaiter(void 0, void 0, void 0, function* () {
92
71
  const gap = logon.replace('108=62441|', '108=62441|9999=im not here');
93
- const res = yield toParse(gap);
72
+ const res = yield setup.client.parseText(gap);
94
73
  expect(res.event).toEqual('msg');
95
74
  expect(res.msgType).toEqual(__1.MsgType.Logon);
96
75
  expect(res.view.getUndefined()).toBeTruthy();
@@ -98,7 +77,7 @@ test('1 gap undefined msg', () => __awaiter(void 0, void 0, void 0, function* ()
98
77
  }));
99
78
  test('2 gap undefined msg', () => __awaiter(void 0, void 0, void 0, function* () {
100
79
  const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|');
101
- const res = yield toParse(gap);
80
+ const res = yield setup.client.parseText(gap);
102
81
  expect(res.event).toEqual('msg');
103
82
  expect(res.msgType).toEqual(__1.MsgType.Logon);
104
83
  expect(res.view.getUndefined()).toBeTruthy();
@@ -1 +1 @@
1
- {"version":3,"file":"ascii-segment.test.js","sourceRoot":"","sources":["../../src/test/ascii-segment.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgF;AAEhF,4CAAgE;AAEhE,kCAAoD;AACpD,6BAA4B;AAC5B,0BAA4B;AAE5B,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AACvD,MAAM,KAAK,GAAW,wNAAwN,CAAA;AAE9O,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,kBAAkB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC,CAAA;IACvG,WAAW,GAAG,MAAM,qBAAc,CAAC,kBAAkB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAC7E,UAAU,GAAG,IAAI,iBAAU,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,MAAM,aAAa;IACjB,YAA6B,KAAa,EACb,OAAe,EACf,IAAa,EACb,QAAgB,EAChB,MAAmB;QAJnB,UAAK,GAAL,KAAK,CAAQ;QACb,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAS;QACb,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAa;IAChD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,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE,CAAA;IAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACrE,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import { AsciiParser, AsciiChars, MsgView, SegmentDescription } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, StringDuplex } from '../transport'\r\nimport { ILogon } from '../types/FIX4.4/repo'\r\nimport { getDefinitions, JsonHelper } from '../util'\r\nimport * as path from 'path'\r\nimport { MsgType } from '..'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nconst root: string = path.join(__dirname, '../../data')\r\nconst logon: string = '8=FIX4.4|9=0000208|35=A|49=sender-10|56=target-20|34=1|57=sub-a|52=20180610-10:39:01.621|98=2|108=62441|95=20|96=VgfoSqo56NqSVI1fLdlI|141=Y|789=4886|383=20|384=1|372=ipsum|385=R|464=N|553=sit|554=consectetur|10=49|'\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}, 45000)\r\n\r\nclass ParsingResult {\r\n constructor (public readonly event: string,\r\n public readonly msgType: string,\r\n public readonly view: MsgView,\r\n public readonly contents: string,\r\n public readonly parser: AsciiParser) {\r\n }\r\n}\r\n\r\nfunction toParse (text: string, chunks: boolean = false): Promise<ParsingResult> {\r\n return new Promise<any>((resolve, reject) => {\r\n const parser = new AsciiParser(definitions, new StringDuplex(text, chunks).readable, AsciiChars.Pipe)\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n parser.on('msg', (msgType: string, view: MsgView) => {\r\n resolve(new ParsingResult('msg', msgType, view.clone(), parser.state.elasticBuffer.toString(), parser))\r\n })\r\n parser.on('done', () => {\r\n resolve(new ParsingResult('done', null,null, parser.state.elasticBuffer.toString(), parser))\r\n })\r\n })\r\n}\r\n\r\ntest('0 gaps', async () => {\r\n const res: ParsingResult = await toParse(logon)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknowns: SegmentDescription[] = res.view.structure.layout['.undefined']\r\n expect(unknowns).toBeFalsy()\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|9999=im not here')\r\n const res: ParsingResult = await toParse(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknown: SegmentDescription = res.view.structure.layout['.undefined']\r\n expect(unknown).toBeTruthy()\r\n expect(unknown.startTag).toEqual(9999)\r\n expect(unknown.startPosition).toEqual(10)\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap next to 1 gap', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|')\r\n const res: ParsingResult = await toParse(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknowns: SegmentDescription[] = res.view.structure.layout['.undefined']\r\n expect(unknowns).toBeTruthy()\r\n expect(Array.isArray(unknowns)).toEqual(true)\r\n expect(unknowns[0].startTag).toEqual(1)\r\n expect(unknowns[0].startPosition).toEqual(10)\r\n expect(unknowns[1].startTag).toEqual(2)\r\n expect(unknowns[1].startPosition).toEqual(11)\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap undefined msg', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|9999=im not here')\r\n const res: ParsingResult = await toParse(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n expect(res.view.getUndefined()).toBeTruthy()\r\n expect(res.view.undefinedForMsg()).toEqual('undefined tag = 9999')\r\n})\r\n\r\ntest('2 gap undefined msg', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|')\r\n const res: ParsingResult = await toParse(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n expect(res.view.getUndefined()).toBeTruthy()\r\n expect(res.view.undefinedForMsg()).toEqual('undefined tags = 1, 2')\r\n})\r\n"]}
1
+ {"version":3,"file":"ascii-segment.test.js","sourceRoot":"","sources":["../../src/test/ascii-segment.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAKzB,kCAAoC;AACpC,0BAA0C;AAC1C,uCAAmC;AAGnC,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,MAAM,KAAK,GAAW,wNAAwN,CAAA;AAC9O,IAAI,MAAoB,CAAA;AAExB,IAAI,KAAK,GAAU,IAAI,CAAA;AACvB,SAAS,CAAC,GAAS,EAAE;IACnB,KAAK,GAAG,IAAI,aAAK,EAAE,CAAA;IACnB,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAClB,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAC/B,UAAU,GAAG,IAAI,iBAAU,CAAC,WAAW,CAAC,CAAA;IACxC,MAAM,GAAG,KAAK,CAAC,YAAY,CAAA;AAC7B,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,IAAI,CAAC,QAAQ,EAAE,GAAS,EAAE;IACxB,MAAM,GAAG,GAAkB,MAAM,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9D,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;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MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAO,CAAC,KAAK,CAAC,CAAA;IAC1C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE,CAAA;IAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACrE,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { SegmentDescription } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\nimport { ILogon } from '../types/FIX4.4/repo'\r\nimport { JsonHelper } from '../util'\r\nimport { IJsFixConfig, MsgType } from '..'\r\nimport { Setup } from './env/setup'\r\nimport { ParsingResult } from './env/parsing-result'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nconst logon: string = '8=FIX4.4|9=0000208|35=A|49=sender-10|56=target-20|34=1|57=sub-a|52=20180610-10:39:01.621|98=2|108=62441|95=20|96=VgfoSqo56NqSVI1fLdlI|141=Y|789=4886|383=20|384=1|372=ipsum|385=R|464=N|553=sit|554=consectetur|10=49|'\r\nlet config: IJsFixConfig\r\n\r\nlet setup: Setup = null\r\nbeforeAll(async () => {\r\n setup = new Setup()\r\n await setup.init()\r\n definitions = setup.definitions\r\n jsonHelper = new JsonHelper(definitions)\r\n config = setup.clientConfig\r\n}, 45000)\r\n\r\ntest('0 gaps', async () => {\r\n const res: ParsingResult = await setup.client.parseText(logon)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknowns: SegmentDescription[] = res.view.structure.layout['.undefined']\r\n expect(unknowns).toBeFalsy()\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|9999=im not here')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknown: SegmentDescription = res.view.structure.layout['.undefined']\r\n expect(unknown).toBeTruthy()\r\n expect(unknown.startTag).toEqual(9999)\r\n expect(unknown.startPosition).toEqual(10)\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap next to 1 gap', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknowns: SegmentDescription[] = res.view.structure.layout['.undefined']\r\n expect(unknowns).toBeTruthy()\r\n expect(Array.isArray(unknowns)).toEqual(true)\r\n expect(unknowns[0].startTag).toEqual(1)\r\n expect(unknowns[0].startPosition).toEqual(10)\r\n expect(unknowns[1].startTag).toEqual(2)\r\n expect(unknowns[1].startPosition).toEqual(11)\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap undefined msg', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|9999=im not here')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n expect(res.view.getUndefined()).toBeTruthy()\r\n expect(res.view.undefinedForMsg()).toEqual('undefined tag = 9999')\r\n})\r\n\r\ntest('2 gap undefined msg', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n expect(res.view.getUndefined()).toBeTruthy()\r\n expect(res.view.undefinedForMsg()).toEqual('undefined tags = 1, 2')\r\n})\r\n"]}
@@ -1 +1 @@
1
- export {};
1
+ import 'reflect-metadata';
@@ -9,54 +9,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ require("reflect-metadata");
12
13
  const path = require("path");
13
- const buffer_1 = require("../buffer");
14
- const util_1 = require("../util");
15
- const store_1 = require("../store");
16
14
  const types_1 = require("../types");
17
- const config_1 = require("../config");
18
- const ascii_1 = require("../transport/ascii");
15
+ const setup_1 = require("./env/setup");
16
+ const test_recovery_1 = require("./env/test-recovery");
19
17
  const root = path.join(__dirname, '../../data');
20
18
  let definitions;
21
- class TestRecovery {
22
- constructor(views, config) {
23
- this.views = views;
24
- this.config = config;
25
- const id = config.description.SenderCompId;
26
- this.store = new store_1.FixMsgMemoryStore(`test-${id}`, config);
27
- this.records = this.getRecords(id);
28
- this.recovery = new store_1.FixMsgAsciiStoreResend(this.store, config);
29
- }
30
- populate() {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- const records = this.records;
33
- const toWrite = records.map(r => this.store.put(r));
34
- yield Promise.all(toWrite);
35
- });
36
- }
37
- getRecords(comp) {
38
- return this.views.reduce((agg, v) => {
39
- if (v.getString(types_1.MsgTag.SenderCompID) === comp) {
40
- agg.push(v.toMsgStoreRecord());
41
- }
42
- return agg;
43
- }, []);
44
- }
45
- }
46
19
  let server;
47
20
  let client;
21
+ let setup = null;
48
22
  beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
49
- const delimiter = buffer_1.AsciiChars.Pipe;
50
- const serverDescription = require(path.join(root, 'session/test-acceptor-tls.json'));
51
- const clientDescription = require(path.join(root, 'session/test-initiator-tls.json'));
52
- const serverFactory = new ascii_1.AsciiSessionMsgFactory(serverDescription);
53
- const clientFactory = new ascii_1.AsciiSessionMsgFactory(clientDescription);
54
- definitions = yield util_1.getDefinitions(serverDescription.application.dictionary);
55
- const serverConfig = new config_1.JsFixConfig(serverFactory, definitions, serverDescription, delimiter);
56
- const clientConfig = new config_1.JsFixConfig(clientFactory, definitions, clientDescription, delimiter);
57
- const views = yield util_1.replayFixFile(definitions, serverDescription, path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'), delimiter);
58
- server = new TestRecovery(views, serverConfig);
59
- client = new TestRecovery(views, clientConfig);
23
+ setup = new setup_1.Setup('session/test-initiator-tls.json', 'session/test-acceptor-tls.json');
24
+ yield setup.init();
25
+ definitions = setup.definitions;
26
+ const serverConfig = setup.serverConfig;
27
+ const clientConfig = setup.clientConfig;
28
+ const views = yield setup.server.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'));
29
+ server = new test_recovery_1.TestRecovery(views, serverConfig);
30
+ client = new test_recovery_1.TestRecovery(views, clientConfig);
60
31
  yield server.populate();
61
32
  yield client.populate();
62
33
  }), 45000);
@@ -1 +1 @@
1
- {"version":3,"file":"ascii-store-replay.test.js","sourceRoot":"","sources":["../../src/test/ascii-store-replay.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,sCAA0D;AAE1D,kCAAuD;AACvD,oCAMiB;AACjB,oCAA0C;AAC1C,sCAAuC;AAEvC,8CAA2D;AAE3D,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAE/B,MAAM,YAAY;IAKhB,YAA6B,KAAgB,EAAkB,MAAmB;QAArD,UAAK,GAAL,KAAK,CAAW;QAAkB,WAAM,GAAN,MAAM,CAAa;QAChF,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,YAAY,CAAA;QAE1C,IAAI,CAAC,KAAK,GAAG,IAAI,yBAAiB,CA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{ AsciiChars, AsciiView, MsgView } from '../buffer'\r\nimport { ISessionDescription } from '../transport'\r\nimport { getDefinitions, replayFixFile } from '../util'\r\nimport {\r\n FixMsgAsciiStoreResend,\r\n FixMsgMemoryStore,\r\n FixMsgStoreRecord,\r\n IFixMsgStore,\r\n IFixMsgStoreRecord\r\n} from '../store'\r\nimport { MsgTag, MsgType } from '../types'\r\nimport { JsFixConfig } from '../config'\r\nimport { ISequenceReset } from '../types/FIX4.4/repo'\r\nimport { AsciiSessionMsgFactory } from '../transport/ascii'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\n\r\nclass TestRecovery {\r\n public readonly store: IFixMsgStore\r\n public readonly records: FixMsgStoreRecord[]\r\n public readonly recovery: FixMsgAsciiStoreResend\r\n\r\n constructor (public readonly views: MsgView[], public readonly config: JsFixConfig) {\r\n const id = config.description.SenderCompId\r\n\r\n this.store = new FixMsgMemoryStore(`test-${id}`, config)\r\n this.records = this.getRecords(id)\r\n this.recovery = new FixMsgAsciiStoreResend(this.store, config)\r\n }\r\n\r\n async populate () {\r\n const records = this.records\r\n const toWrite = records.map(r => this.store.put(r))\r\n await Promise.all(toWrite)\r\n }\r\n\r\n getRecords (comp: string) {\r\n return this.views.reduce((agg: FixMsgStoreRecord[], v: AsciiView) => {\r\n if (v.getString(MsgTag.SenderCompID) === comp) {\r\n agg.push(v.toMsgStoreRecord())\r\n }\r\n return agg\r\n }, [])\r\n }\r\n}\r\n\r\nlet server: TestRecovery\r\nlet client: TestRecovery\r\n\r\nbeforeAll(async () => {\r\n const delimiter = AsciiChars.Pipe\r\n const serverDescription: ISessionDescription = require(path.join(root, 'session/test-acceptor-tls.json'))\r\n const clientDescription: ISessionDescription = require(path.join(root, 'session/test-initiator-tls.json'))\r\n const serverFactory = new AsciiSessionMsgFactory(serverDescription)\r\n const clientFactory = new AsciiSessionMsgFactory(clientDescription)\r\n definitions = await getDefinitions(serverDescription.application.dictionary)\r\n const serverConfig = new JsFixConfig(serverFactory, definitions, serverDescription, delimiter)\r\n const clientConfig = new JsFixConfig(clientFactory, definitions, clientDescription, delimiter)\r\n const views = await replayFixFile(definitions, serverDescription, path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'), delimiter)\r\n server = new TestRecovery(views, serverConfig)\r\n client = new TestRecovery(views, clientConfig)\r\n await server.populate()\r\n await client.populate()\r\n}, 45000)\r\n\r\ntest('expect 15 messages in log', () => {\r\n expect(server.views.length).toEqual(15)\r\n expect(client.views.length).toEqual(15)\r\n})\r\n\r\n/*\r\nclient: (all client messages)\r\n8=FIX4.4|9=000124|35=AD|49=init-tls-comp|56=accept-tls-comp|34=2|57=fix|52=20210307-16:16:44.388|568=all-trades|569=0|263=1|580=1|75=20210307|10=187|\r\n8=FIX4.4|9=000112|35=0|49=init-tls-comp|56=accept-tls-comp|34=3|57=fix|52=20210307-16:17:14.431|112=Sun, 07 Mar 2021 16:17:14 GMT|10=220|\r\n8=FIX4.4|9=000109|35=5|49=init-tls-comp|56=accept-tls-comp|34=4|57=fix|52=20210307-16:17:16.397|58=test_client initiate logout|10=191|\r\n */\r\n\r\n/*\r\nserver: (application only)\r\n\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=2|57=fix|52=20210307-16:16:44.429|568=all-trades|569=0|749=0|750=0|10=142|\r\n8=FIX4.4|9=000209|35=AE|49=accept-tls-comp|56=init-tls-comp|34=3|57=fix|52=20210307-16:16:44.430|571=100000|487=0|856=0|828=0|17=600000|39=2|570=N|55=Platinum|48=Platinum.INC|32=172|31=7.36|75=20210307|60=20210307-16:16:44.430|10=043|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=4|57=fix|52=20210307-16:16:44.431|571=100001|487=0|856=0|828=0|17=600001|39=2|570=N|55=Gold|48=Gold.INC|32=175|31=83.67|75=20210307|60=20210307-16:16:44.430|10=219|\r\n8=FIX4.4|9=000210|35=AE|49=accept-tls-comp|56=init-tls-comp|34=5|57=fix|52=20210307-16:16:44.432|571=100002|487=0|856=0|828=0|17=600002|39=2|570=N|55=Platinum|48=Platinum.INC|32=146|31=41.79|75=20210307|60=20210307-16:16:44.430|10=097|\r\n8=FIX4.4|9=000211|35=AE|49=accept-tls-comp|56=init-tls-comp|34=6|57=fix|52=20210307-16:16:44.432|571=100003|487=0|856=0|828=0|17=600003|39=2|570=N|55=Magnesium|48=Magnesium.INC|32=156|31=8.02|75=20210307|60=20210307-16:16:44.430|10=227|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=7|57=fix|52=20210307-16:16:44.432|571=100004|487=0|856=0|828=0|17=600004|39=2|570=N|55=Gold|48=Gold.INC|32=136|31=32.13|75=20210307|60=20210307-16:16:44.430|10=211|\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=8|57=fix|52=20210307-16:16:44.433|568=all-trades|569=0|749=0|750=1|10=144|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=9|57=fix|52=20210307-16:16:59.449|571=100005|487=0|856=0|828=0|17=600005|39=2|570=N|55=Gold|48=Gold.INC|32=166|31=53.91|75=20210307|60=20210307-16:16:59.449|10=001|\r\n8=FIX4.4|9=000206|35=AE|49=accept-tls-comp|56=init-tls-comp|34=10|57=fix|52=20210307-16:17:14.477|571=100006|487=0|856=0|828=0|17=600006|39=2|570=N|55=Silver|48=Silver.INC|32=105|31=61.2|75=20210307|60=20210307-16:17:14.477|10=191|\r\n */\r\n\r\ntest('server store states',async () => {\r\n const s1 = await server.recovery.store.getState()\r\n expect(s1.length).toEqual(9)\r\n})\r\n\r\ntest('client store states',async () => {\r\n const s1 = await client.recovery.store.getState()\r\n expect(s1.length).toEqual(1)\r\n})\r\n\r\ntest('server replay request from seq=1 to seq=10', async () => {\r\n const vec = await server.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(10)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n for (let i = 2; i <= 6; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n\r\n expect(vec[7].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[7].seqNum).toEqual(8)\r\n\r\n for (let i = 8; i < 10; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n})\r\n\r\ntest('client replay request from seq=1 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(3)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequest)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n checkSeqReset(vec[2], 3, 11)\r\n})\r\n\r\nfunction checkSeqReset (rec: IFixMsgStoreRecord, from: number, to: number) {\r\n const reset: ISequenceReset = rec.obj as ISequenceReset\r\n expect(rec.msgType).toEqual(MsgType.SequenceReset)\r\n expect(rec.obj).toBeTruthy()\r\n expect(rec.seqNum).toEqual(to)\r\n expect(reset.GapFillFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgType).toEqual(MsgType.SequenceReset)\r\n expect(reset.StandardHeader.PossDupFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgSeqNum).toEqual(from)\r\n}\r\n\r\n// expect to gap fill entire request - and move expected seqNo to 11\r\n// which will be the next message sent\r\ntest('client replay request from seq=4 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(4, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(1)\r\n checkSeqReset(vec[0], 4, 11)\r\n})\r\n"]}
1
+ {"version":3,"file":"ascii-store-replay.test.js","sourceRoot":"","sources":["../../src/test/ascii-store-replay.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,6BAA4B;AAM5B,oCAAkC;AAGlC,uCAAmC;AACnC,uDAAkD;AAElD,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAE/B,IAAI,MAAoB,CAAA;AACxB,IAAI,MAAoB,CAAA;AACxB,IAAI,KAAK,GAAU,IAAI,CAAA;AAEvB,SAAS,CAAC,GAAS,EAAE;IACnB,KAAK,GAAG,IAAI,aAAK,CAAC,iCAAiC,EAAE,gCAAgC,CAAC,CAAA;IACtF,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAClB,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,wCAAwC,CAAC,CAAC,CAAA;IAClH,MAAM,GAAG,IAAI,4BAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;IAC9C,MAAM,GAAG,IAAI,4BAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;IAC9C,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAA;IACvB,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAA;AACzB,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACrC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,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zD,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;IACxB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7B,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9B,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\n\r\nimport {\r\n IFixMsgStoreRecord\r\n} from '../store'\r\nimport { MsgType } from '../types'\r\nimport { ISequenceReset } from '../types/FIX4.4/repo'\r\n\r\nimport { Setup } from './env/setup'\r\nimport { TestRecovery } from './env/test-recovery'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\n\r\nlet server: TestRecovery\r\nlet client: TestRecovery\r\nlet setup: Setup = null\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup('session/test-initiator-tls.json', 'session/test-acceptor-tls.json')\r\n await setup.init()\r\n definitions = setup.definitions\r\n const serverConfig = setup.serverConfig\r\n const clientConfig = setup.clientConfig\r\n const views = await setup.server.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'))\r\n server = new TestRecovery(views, serverConfig)\r\n client = new TestRecovery(views, clientConfig)\r\n await server.populate()\r\n await client.populate()\r\n}, 45000)\r\n\r\ntest('expect 15 messages in log', () => {\r\n expect(server.views.length).toEqual(15)\r\n expect(client.views.length).toEqual(15)\r\n})\r\n\r\n/*\r\nclient: (all client messages)\r\n8=FIX4.4|9=000124|35=AD|49=init-tls-comp|56=accept-tls-comp|34=2|57=fix|52=20210307-16:16:44.388|568=all-trades|569=0|263=1|580=1|75=20210307|10=187|\r\n8=FIX4.4|9=000112|35=0|49=init-tls-comp|56=accept-tls-comp|34=3|57=fix|52=20210307-16:17:14.431|112=Sun, 07 Mar 2021 16:17:14 GMT|10=220|\r\n8=FIX4.4|9=000109|35=5|49=init-tls-comp|56=accept-tls-comp|34=4|57=fix|52=20210307-16:17:16.397|58=test_client initiate logout|10=191|\r\n */\r\n\r\n/*\r\nserver: (application only)\r\n\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=2|57=fix|52=20210307-16:16:44.429|568=all-trades|569=0|749=0|750=0|10=142|\r\n8=FIX4.4|9=000209|35=AE|49=accept-tls-comp|56=init-tls-comp|34=3|57=fix|52=20210307-16:16:44.430|571=100000|487=0|856=0|828=0|17=600000|39=2|570=N|55=Platinum|48=Platinum.INC|32=172|31=7.36|75=20210307|60=20210307-16:16:44.430|10=043|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=4|57=fix|52=20210307-16:16:44.431|571=100001|487=0|856=0|828=0|17=600001|39=2|570=N|55=Gold|48=Gold.INC|32=175|31=83.67|75=20210307|60=20210307-16:16:44.430|10=219|\r\n8=FIX4.4|9=000210|35=AE|49=accept-tls-comp|56=init-tls-comp|34=5|57=fix|52=20210307-16:16:44.432|571=100002|487=0|856=0|828=0|17=600002|39=2|570=N|55=Platinum|48=Platinum.INC|32=146|31=41.79|75=20210307|60=20210307-16:16:44.430|10=097|\r\n8=FIX4.4|9=000211|35=AE|49=accept-tls-comp|56=init-tls-comp|34=6|57=fix|52=20210307-16:16:44.432|571=100003|487=0|856=0|828=0|17=600003|39=2|570=N|55=Magnesium|48=Magnesium.INC|32=156|31=8.02|75=20210307|60=20210307-16:16:44.430|10=227|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=7|57=fix|52=20210307-16:16:44.432|571=100004|487=0|856=0|828=0|17=600004|39=2|570=N|55=Gold|48=Gold.INC|32=136|31=32.13|75=20210307|60=20210307-16:16:44.430|10=211|\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=8|57=fix|52=20210307-16:16:44.433|568=all-trades|569=0|749=0|750=1|10=144|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=9|57=fix|52=20210307-16:16:59.449|571=100005|487=0|856=0|828=0|17=600005|39=2|570=N|55=Gold|48=Gold.INC|32=166|31=53.91|75=20210307|60=20210307-16:16:59.449|10=001|\r\n8=FIX4.4|9=000206|35=AE|49=accept-tls-comp|56=init-tls-comp|34=10|57=fix|52=20210307-16:17:14.477|571=100006|487=0|856=0|828=0|17=600006|39=2|570=N|55=Silver|48=Silver.INC|32=105|31=61.2|75=20210307|60=20210307-16:17:14.477|10=191|\r\n */\r\n\r\ntest('server store states',async () => {\r\n const s1 = await server.recovery.store.getState()\r\n expect(s1.length).toEqual(9)\r\n})\r\n\r\ntest('client store states',async () => {\r\n const s1 = await client.recovery.store.getState()\r\n expect(s1.length).toEqual(1)\r\n})\r\n\r\ntest('server replay request from seq=1 to seq=10', async () => {\r\n const vec = await server.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(10)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n for (let i = 2; i <= 6; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n\r\n expect(vec[7].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[7].seqNum).toEqual(8)\r\n\r\n for (let i = 8; i < 10; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n})\r\n\r\ntest('client replay request from seq=1 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(3)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequest)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n checkSeqReset(vec[2], 3, 11)\r\n})\r\n\r\nfunction checkSeqReset (rec: IFixMsgStoreRecord, from: number, to: number) {\r\n const reset: ISequenceReset = rec.obj as ISequenceReset\r\n expect(rec.msgType).toEqual(MsgType.SequenceReset)\r\n expect(rec.obj).toBeTruthy()\r\n expect(rec.seqNum).toEqual(to)\r\n expect(reset.GapFillFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgType).toEqual(MsgType.SequenceReset)\r\n expect(reset.StandardHeader.PossDupFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgSeqNum).toEqual(from)\r\n}\r\n\r\n// expect to gap fill entire request - and move expected seqNo to 11\r\n// which will be the next message sent\r\ntest('client replay request from seq=4 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(4, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(1)\r\n checkSeqReset(vec[0], 4, 11)\r\n})\r\n"]}
@@ -1 +1 @@
1
- export {};
1
+ import 'reflect-metadata';
@@ -9,11 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ require("reflect-metadata");
12
13
  const path = require("path");
13
14
  const buffer_1 = require("../buffer");
14
- const transport_1 = require("../transport");
15
- const config_1 = require("../config");
16
- const util_1 = require("../util");
15
+ const setup_1 = require("./env/setup");
17
16
  const root = path.join(__dirname, '../../data');
18
17
  let definitions;
19
18
  let session;
@@ -57,12 +56,13 @@ const unsortedLogon = [
57
56
  new buffer_1.TagPos(19, 553, 188, 3),
58
57
  new buffer_1.TagPos(20, 554, 196, 11)
59
58
  ];
59
+ let setup = null;
60
60
  beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
61
- const sessionDescription = require(path.join(root, 'session/test-initiator.json'));
62
- definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
63
- const config = new config_1.JsFixConfig(null, definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
64
- session = new transport_1.AsciiMsgTransmitter(config);
65
- views = yield util_1.replayFixFile(definitions, sessionDescription, path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'), buffer_1.AsciiChars.Pipe);
61
+ setup = new setup_1.Setup('session/test-initiator.json');
62
+ yield setup.init();
63
+ definitions = setup.clientConfig.definitions;
64
+ session = setup.client.transmitter;
65
+ views = yield setup.client.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'));
66
66
  if (views && views.length > 0) {
67
67
  structure = views[0].structure;
68
68
  tp = views[0].structure.tags.tagPos.slice(0, views[0].segment.endPosition);
@@ -1 +1 @@
1
- {"version":3,"file":"ascii-tag-pos.test.js","sourceRoot":"","sources":["../../src/test/ascii-tag-pos.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAAkE;AAElE,4CAAuE;AACvE,sCAAuC;AACvC,kCAAuD;AAEvD,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,KAAgB,CAAA;AACpB,IAAI,SAAoB,CAAA;AACxB,IAAI,EAAY,CAAA;AAEhB,MAAM,QAAQ,GAAa;IACzB,IAAI,eAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACxB,IAAI,eAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACvB,IAAI,eAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACvB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,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,CAAA;IAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { AsciiChars, MsgView, TagPos, Structure } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, AsciiMsgTransmitter } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { getDefinitions, replayFixFile } from '../util'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet views: MsgView[]\r\nlet structure: Structure\r\nlet tp: TagPos[]\r\n\r\nconst testTags: TagPos[] = [\r\n new TagPos(0, 120, 0, 1), // 3\r\n new TagPos(1, 50, 1, 1), // 0\r\n new TagPos(2, 50, 2, 1), // 1\r\n new TagPos(3, 120, 3, 1), // 4\r\n new TagPos(4, 100, 4, 1) // 2\r\n]\r\n\r\nconst expected: TagPos[] = [\r\n new TagPos(1, 50, 1, 1), // 0\r\n new TagPos(2, 50, 2, 1), // 1\r\n new TagPos(4, 100, 4, 1), // 2\r\n new TagPos(0, 120, 0, 1), // 3\r\n new TagPos(3, 120, 3, 1) // 4\r\n]\r\n\r\nconst unsortedLogon = [\r\n new TagPos(0, 8, 2, 6),\r\n new TagPos(1, 9, 11, 7),\r\n new TagPos(2, 35, 22, 1),\r\n new TagPos(3, 49, 27, 9),\r\n new TagPos(4, 56, 40, 9),\r\n new TagPos(5, 34, 53, 1),\r\n new TagPos(6, 57, 58, 5),\r\n new TagPos(7, 52, 67, 21),\r\n new TagPos(8, 98, 92, 1),\r\n new TagPos(9, 108, 98, 5),\r\n new TagPos(10, 95, 107, 2),\r\n new TagPos(11, 96, 113, 20),\r\n new TagPos(12, 141, 138, 1),\r\n new TagPos(13, 789, 144, 4),\r\n new TagPos(14, 383, 153, 2),\r\n new TagPos(15, 384, 160, 1),\r\n new TagPos(16, 372, 166, 5),\r\n new TagPos(17, 385, 176, 1),\r\n new TagPos(18, 464, 182, 1),\r\n new TagPos(19, 553, 188, 3),\r\n new TagPos(20, 554, 196, 11)\r\n]\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 const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n views = await replayFixFile(definitions, sessionDescription, path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'), AsciiChars.Pipe)\r\n if (views && views.length > 0) {\r\n structure = views[0].structure\r\n tp = views[0].structure.tags.tagPos.slice(0, views[0].segment.endPosition)\r\n }\r\n}, 45000)\r\n\r\ntest('logon tags parsed fully', () => {\r\n expect(tp).toEqual(unsortedLogon)\r\n})\r\n\r\ntest('expect tags to sort in tag first order', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n const sortedTags = sorted.map(e => e.tag)\r\n expect(sortedTags).toEqual([50, 50, 100, 120, 120])\r\n})\r\n\r\ntest('expect tags to sort in tag then start order', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(sorted[0].tag).toEqual(sorted[1].tag)\r\n expect(sorted[0].start < sorted[1].start).toEqual(true)\r\n})\r\n\r\ntest('expect start to carry with its tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(sorted).toEqual(expected)\r\n})\r\n\r\ntest('binary search on sorted', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 100)).toEqual(2)\r\n})\r\n\r\ntest('binary search for non existing tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 1000) < 0).toEqual(true)\r\n})\r\n\r\ntest('binary search duplicate tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 50) <= 1).toEqual(true)\r\n})\r\n\r\ntest('check logon', () => {\r\n const sorted = tp.slice().sort(TagPos.compare)\r\n expect(sorted[0].tag).toEqual(8)\r\n expect(sorted[sorted.length - 1].tag).toEqual(789)\r\n})\r\n"]}
1
+ {"version":3,"file":"ascii-tag-pos.test.js","sourceRoot":"","sources":["../../src/test/ascii-tag-pos.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,6BAA4B;AAC5B,sCAAsD;AAGtD,uCAAmC;AAEnC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,KAAgB,CAAA;AACpB,IAAI,SAAoB,CAAA;AACxB,IAAI,EAAY,CAAA;AAEhB,MAAM,QAAQ,GAAa;IACzB,IAAI,eAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACxB,IAAI,eAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACvB,IAAI,eAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACvB,IAAI,eAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACxB,IAAI,eAAM,CAAC,CAAC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AAC,OAAO,CAAC,CAAA;IAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { MsgView, TagPos, Structure } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\nimport { AsciiMsgTransmitter } from '../transport/ascii/ascii-msg-transmitter'\r\nimport { Setup } from './env/setup'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet views: MsgView[]\r\nlet structure: Structure\r\nlet tp: TagPos[]\r\n\r\nconst testTags: TagPos[] = [\r\n new TagPos(0, 120, 0, 1), // 3\r\n new TagPos(1, 50, 1, 1), // 0\r\n new TagPos(2, 50, 2, 1), // 1\r\n new TagPos(3, 120, 3, 1), // 4\r\n new TagPos(4, 100, 4, 1) // 2\r\n]\r\n\r\nconst expected: TagPos[] = [\r\n new TagPos(1, 50, 1, 1), // 0\r\n new TagPos(2, 50, 2, 1), // 1\r\n new TagPos(4, 100, 4, 1), // 2\r\n new TagPos(0, 120, 0, 1), // 3\r\n new TagPos(3, 120, 3, 1) // 4\r\n]\r\n\r\nconst unsortedLogon = [\r\n new TagPos(0, 8, 2, 6),\r\n new TagPos(1, 9, 11, 7),\r\n new TagPos(2, 35, 22, 1),\r\n new TagPos(3, 49, 27, 9),\r\n new TagPos(4, 56, 40, 9),\r\n new TagPos(5, 34, 53, 1),\r\n new TagPos(6, 57, 58, 5),\r\n new TagPos(7, 52, 67, 21),\r\n new TagPos(8, 98, 92, 1),\r\n new TagPos(9, 108, 98, 5),\r\n new TagPos(10, 95, 107, 2),\r\n new TagPos(11, 96, 113, 20),\r\n new TagPos(12, 141, 138, 1),\r\n new TagPos(13, 789, 144, 4),\r\n new TagPos(14, 383, 153, 2),\r\n new TagPos(15, 384, 160, 1),\r\n new TagPos(16, 372, 166, 5),\r\n new TagPos(17, 385, 176, 1),\r\n new TagPos(18, 464, 182, 1),\r\n new TagPos(19, 553, 188, 3),\r\n new TagPos(20, 554, 196, 11)\r\n]\r\n\r\nlet setup: Setup = null\r\nbeforeAll(async () => {\r\n setup = new Setup('session/test-initiator.json')\r\n await setup.init()\r\n definitions = setup.clientConfig.definitions\r\n session = setup.client.transmitter as AsciiMsgTransmitter\r\n views = await setup.client.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'))\r\n if (views && views.length > 0) {\r\n structure = views[0].structure\r\n tp = views[0].structure.tags.tagPos.slice(0, views[0].segment.endPosition)\r\n }\r\n}, 45000)\r\n\r\ntest('logon tags parsed fully', () => {\r\n expect(tp).toEqual(unsortedLogon)\r\n})\r\n\r\ntest('expect tags to sort in tag first order', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n const sortedTags = sorted.map(e => e.tag)\r\n expect(sortedTags).toEqual([50, 50, 100, 120, 120])\r\n})\r\n\r\ntest('expect tags to sort in tag then start order', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(sorted[0].tag).toEqual(sorted[1].tag)\r\n expect(sorted[0].start < sorted[1].start).toEqual(true)\r\n})\r\n\r\ntest('expect start to carry with its tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(sorted).toEqual(expected)\r\n})\r\n\r\ntest('binary search on sorted', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 100)).toEqual(2)\r\n})\r\n\r\ntest('binary search for non existing tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 1000) < 0).toEqual(true)\r\n})\r\n\r\ntest('binary search duplicate tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 50) <= 1).toEqual(true)\r\n})\r\n\r\ntest('check logon', () => {\r\n const sorted = tp.slice().sort(TagPos.compare)\r\n expect(sorted[0].tag).toEqual(8)\r\n expect(sorted[sorted.length - 1].tag).toEqual(789)\r\n})\r\n"]}
@@ -1 +1 @@
1
- export {};
1
+ import 'reflect-metadata';
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("reflect-metadata");
3
4
  const buffer_1 = require("../buffer");
5
+ const ascii_1 = require("../buffer/ascii");
4
6
  test('1 char in buffer length 1', () => {
5
7
  const buffer = new buffer_1.ElasticBuffer(1);
6
- buffer.writeChar(buffer_1.AsciiChars.Dot);
8
+ buffer.writeChar(ascii_1.AsciiChars.Dot);
7
9
  expect(buffer.getPos()).toEqual(1);
8
10
  expect(buffer.toString()).toEqual('.');
9
11
  expect(buffer.currentSize()).toEqual(1);
@@ -1 +1 @@
1
- {"version":3,"file":"elastic-buffer.test.js","sourceRoot":"","sources":["../../src/test/elastic-buffer.test.ts"],"names":[],"mappings":";;AAAA,sCAAqD;AAErD,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,SAAS,CAAC,mBAAU,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACtC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACzC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,QAAQ,EAAE,GAAG,E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,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACpC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA","sourcesContent":["import { ElasticBuffer, AsciiChars } from '../buffer'\r\n\r\ntest('1 char in buffer length 1', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeChar(AsciiChars.Dot)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('.')\r\n expect(buffer.currentSize()).toEqual(1)\r\n})\r\n\r\ntest('string', () => {\r\n const s: string = 'fixing up fix'\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(16)\r\n})\r\n\r\ntest('whole number', () => {\r\n const n: number = 12345\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize() === 10)\r\n})\r\n\r\ntest('-ve number', () => {\r\n const n: number = -2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('+ve number with explicit sign', () => {\r\n const n: number = 2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n}`)\r\n const asString = buffer.toString()\r\n expect(asString).toEqual('+2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n})\r\n\r\ntest('floating point', () => {\r\n const n: number = 12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('floating point 1 dp', () => {\r\n const n: number = 12345678.9\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345678.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('-ve floating point', () => {\r\n const n: number = -12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(buffer.toString()).toEqual('-12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('floating point many dp', () => {\r\n const n: number = 0.123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('simple floating point 3.90', () => {\r\n const n: number = 3.90\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('3.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 35.77', () => {\r\n const n: number = 35.77\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('35.77')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 0.058457', () => {\r\n const n: number = 0.058457\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.058457')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point -0.06445', () => {\r\n const n: number = -0.06445\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.06445')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('whole number as floating point', () => {\r\n const n: number = 123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString.toString()).toEqual('123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('tiny floating point', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(14)\r\n expect(asString).toEqual('0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny -ve floating point', () => {\r\n const n: number = -0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny +ve floating point with sign', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n.toFixed(12)}`)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('+0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('boolean true', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(true)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('Y')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(true)\r\n})\r\n\r\ntest('boolean false', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(false)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('N')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(false)\r\n})\r\n\r\ntest('write buffer', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s: string = 'fixing up fix'\r\n const b = Buffer.from(s)\r\n buffer.writeBuffer(b)\r\n expect(buffer.getPos()).toEqual(b.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize() === 16)\r\n const fetched: Buffer = buffer.getBuffer(0, b.length)\r\n expect(fetched).toEqual(b)\r\n})\r\n\r\ntest('buffer shrinks', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s = '.'.repeat(60 * 1024)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(65536)\r\n expect(buffer.reset()).toBe(true)\r\n expect(buffer.getPos()).toEqual(0)\r\n expect(buffer.currentSize() < 60 * 1024).toBe(true)\r\n})\r\n"]}
1
+ {"version":3,"file":"elastic-buffer.test.js","sourceRoot":"","sources":["../../src/test/elastic-buffer.test.ts"],"names":[],"mappings":";;AAAA,4BAAyB;AAEzB,sCAAyC;AACzC,2CAA4C;AAE5C,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,SAAS,CAAC,kBAAU,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACtC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACzC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;IAClB,MAAM,CAAC,GAAW,eAAe,CAAA;IACjC,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IACrB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAA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MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { ElasticBuffer } from '../buffer'\r\nimport { AsciiChars } from '../buffer/ascii'\r\n\r\ntest('1 char in buffer length 1', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeChar(AsciiChars.Dot)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('.')\r\n expect(buffer.currentSize()).toEqual(1)\r\n})\r\n\r\ntest('string', () => {\r\n const s: string = 'fixing up fix'\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(16)\r\n})\r\n\r\ntest('whole number', () => {\r\n const n: number = 12345\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize() === 10)\r\n})\r\n\r\ntest('-ve number', () => {\r\n const n: number = -2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('+ve number with explicit sign', () => {\r\n const n: number = 2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n}`)\r\n const asString = buffer.toString()\r\n expect(asString).toEqual('+2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n})\r\n\r\ntest('floating point', () => {\r\n const n: number = 12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('floating point 1 dp', () => {\r\n const n: number = 12345678.9\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345678.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('-ve floating point', () => {\r\n const n: number = -12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(buffer.toString()).toEqual('-12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('floating point many dp', () => {\r\n const n: number = 0.123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('simple floating point 3.90', () => {\r\n const n: number = 3.90\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('3.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 35.77', () => {\r\n const n: number = 35.77\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('35.77')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 0.058457', () => {\r\n const n: number = 0.058457\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.058457')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point -0.06445', () => {\r\n const n: number = -0.06445\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.06445')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('whole number as floating point', () => {\r\n const n: number = 123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString.toString()).toEqual('123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('tiny floating point', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(14)\r\n expect(asString).toEqual('0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny -ve floating point', () => {\r\n const n: number = -0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny +ve floating point with sign', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n.toFixed(12)}`)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('+0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('boolean true', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(true)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('Y')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(true)\r\n})\r\n\r\ntest('boolean false', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(false)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('N')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(false)\r\n})\r\n\r\ntest('write buffer', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s: string = 'fixing up fix'\r\n const b = Buffer.from(s)\r\n buffer.writeBuffer(b)\r\n expect(buffer.getPos()).toEqual(b.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize() === 16)\r\n const fetched: Buffer = buffer.getBuffer(0, b.length)\r\n expect(fetched).toEqual(b)\r\n})\r\n\r\ntest('buffer shrinks', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s = '.'.repeat(60 * 1024)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(65536)\r\n expect(buffer.reset()).toBe(true)\r\n expect(buffer.getPos()).toEqual(0)\r\n expect(buffer.currentSize() < 60 * 1024).toBe(true)\r\n})\r\n"]}
@@ -1 +1 @@
1
- export {};
1
+ import 'reflect-metadata';
@@ -9,20 +9,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const path = require("path");
12
+ require("reflect-metadata");
13
13
  const buffer_1 = require("../buffer");
14
- const transport_1 = require("../transport");
15
- const config_1 = require("../config");
16
- const util_1 = require("../util");
17
- const root = path.join(__dirname, '../../data');
14
+ const ascii_msg_transmitter_1 = require("../transport/ascii/ascii-msg-transmitter");
15
+ const setup_1 = require("./env/setup");
18
16
  let definitions;
19
17
  let session;
20
18
  let proxyFactory;
19
+ let setup = null;
21
20
  beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
22
- const sessionDescription = require(path.join(root, 'session/qf-fix44.json'));
23
- definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
24
- const config = new config_1.JsFixConfig(null, definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
25
- session = new transport_1.AsciiMsgTransmitter(config);
21
+ setup = new setup_1.Setup('session/qf-fix44.json', 'session/qf-fix44.json');
22
+ yield setup.init();
23
+ definitions = setup.definitions;
24
+ const config = setup.clientConfig;
25
+ session = new ascii_msg_transmitter_1.AsciiMsgTransmitter(config);
26
26
  proxyFactory = new buffer_1.EncodeProxy(definitions);
27
27
  }), 45000);
28
28
  test('check wrapper will reject unknown field', () => {
@@ -1 +1 @@
1
- {"version":3,"file":"encode-proxy.test.js","sourceRoot":"","sources":["../../src/test/encode-proxy.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAAmD;AAGnD,4CAAuE;AACvE,sCAAuC;AACvC,kCAAwC;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,CAAA;AACtD,CAAC,CAAC,CAAA;AAEF,SAAS,UAAU;IACjB,OAAO;QACL;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,EAAE;YACf,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,QAAQ;wBACtB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,SAAS;wBACvB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,CAAC;qBACpB;iBACF;aACF;SACF;KACF,CAAA;AACH,CAAC","sourcesContent":["import * as path from 'path'\r\nimport { EncodeProxy, AsciiChars } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { ISessionDescription, AsciiMsgTransmitter } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { getDefinitions } from '../util'\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet proxyFactory: EncodeProxy\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/qf-fix44.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n proxyFactory = new EncodeProxy(definitions)\r\n}, 45000)\r\n\r\ntest('check wrapper will reject unknown field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Unknown = 999\r\n }\r\n expect(run).toThrow(/no field named Unknown/)\r\n})\r\n\r\ntest('check wrapper will accept known field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.OrderID = 'ipsum'\r\n }\r\n run()\r\n expect(proxy.OrderID).toEqual('ipsum')\r\n})\r\n\r\ntest('check wrapper rejects unknown enum value', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '23'\r\n }\r\n expect(run).toThrow(/enum field SettlType does not support \"23\"/)\r\n})\r\n\r\ntest('check wrapper will accept known enum field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '1'\r\n }\r\n run()\r\n expect(proxy.SettlType).toEqual('1')\r\n})\r\n\r\ntest('check wrapper rejects Date field when not given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = \"I'm not a good date\"\r\n }\r\n expect(run).toThrow(/expects Date but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Date field when given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = new Date()\r\n }\r\n run()\r\n expect(proxy.SettlDate).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects boolean field when not given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = \"I'm not a good boolean\"\r\n }\r\n expect(run).toThrow(/expects boolean but receives/)\r\n})\r\n\r\ntest('check wrapper will accept boolean field when given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = true\r\n }\r\n run()\r\n expect(proxy.LastRptRequested).toEqual(true)\r\n})\r\n\r\ntest('check wrapper rejects Buffer field when not given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = \"I'm not a Buffer, don't accept me!\"\r\n }\r\n expect(run).toThrow(/expects Buffer but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Buffer field when given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = new Buffer('I am a buffer.', 'utf8')\r\n }\r\n run()\r\n expect(proxy.EncodedText).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects string field when not given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = 123\r\n }\r\n expect(run).toThrow(/expects string but receives/)\r\n})\r\n\r\ntest('check wrapper will accept string field when given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = \"I'm a great string\"\r\n }\r\n run()\r\n expect(proxy.ClOrdID).toEqual(\"I'm a great string\")\r\n})\r\n\r\ntest('check wrapper rejects number field when not given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = \"I'm no number\"\r\n }\r\n expect(run).toThrow(/expects number but receives/)\r\n})\r\n\r\ntest('check wrapper will accept number field when given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = 12234\r\n }\r\n run()\r\n expect(proxy.GrossTradeAmt).toEqual(12234)\r\n})\r\n\r\ntest('check wrapper rejects non object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = 'I should be an object, but I am sadly not'\r\n }\r\n expect(run).toThrow(/is a component but/)\r\n})\r\n\r\ntest('check wrapper accepts object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when assigned component wraps so it can be checked.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.YieldData.GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n proxy.YieldData.YieldCalcDate = new Date()\r\n // accept this\r\n expect(proxy.YieldData).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when given populated component.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n ClOrdID: \"I don't belong here.\"\r\n }\r\n }\r\n // reject this\r\n expect(run).toThrow(/no field named ClOrdID/)\r\n})\r\n\r\ntest('check wrapper accepts number for group field and wraps n elements', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: 2\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n expect(Array.isArray(proxy.Parties.NoPartyIDs)).toEqual(true)\r\n expect(proxy.Parties.NoPartyIDs.length).toEqual(2)\r\n // now assign a field, this should also be wrapped\r\n proxy.Parties.NoPartyIDs[0].PartyID = 'hello'\r\n expect(proxy.Parties.NoPartyIDs[0].PartyID).toBeTruthy()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\ntest('check wrapper accepts array of objects in group component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: getParties()\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return [\r\n {\r\n 'PartyID': 'magna.',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'et',\r\n 'PartySubIDType': 22\r\n },\r\n {\r\n 'PartySubID': 'leo,',\r\n 'PartySubIDType': 10\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'iaculis',\r\n 'PartyIDSource': 'F',\r\n 'PartyRole': 2,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'Nullam',\r\n 'PartySubIDType': 12\r\n },\r\n {\r\n 'PartySubID': 'lectus,',\r\n 'PartySubIDType': 13\r\n },\r\n {\r\n 'PartySubID': 'eget',\r\n 'PartySubIDType': 18\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'vitae,',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 5,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'ac',\r\n 'PartySubIDType': 6\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}\r\n"]}
1
+ {"version":3,"file":"encode-proxy.test.js","sourceRoot":"","sources":["../../src/test/encode-proxy.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,sCAAuC;AAGvC,oFAA8E;AAC9E,uCAAmC;AAEnC,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,YAAyB,CAAA;AAC7B,IAAI,KAAK,GAAU,IAAI,CAAA;AAEvB,SAAS,CAAC,GAAS,EAAE;IACnB,KAAK,GAAG,IAAI,aAAK,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,CAAA;IACnE,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAClB,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAA;IACjC,OAAO,GAAG,IAAI,2CAAmB,CAAC,MAAM,CAAC,CAAA;IACzC,YAAY,GAAG,IAAI,oBAAW,CAAC,WAAW,CAAC,CAAA;AAC7C,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,IAAI,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACnD,MAAM,KAAK,GAAiB,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAChE,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAA;IAC1B,SAAS,GAAG;QACV,KAAK,CAAC,OAAO,GAAG,GAAG,CAAA;IACrB,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC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AAE,CAAA;IAC1B,SAAS,GAAG;QACV,KAAK,CAAC,OAAO,GAAG;YACd,UAAU,EAAE,UAAU,EAAE;SACzB,CAAA;IACH,CAAC;IACD,GAAG,EAAE,CAAA;IACL,SAAS,IAAI;QACX,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,GAAG,CAAA;IACjD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAA;AACtD,CAAC,CAAC,CAAA;AAEF,SAAS,UAAU;IACjB,OAAO;QACL;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,EAAE;YACf,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,QAAQ;wBACtB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,SAAS;wBACvB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,CAAC;qBACpB;iBACF;aACF;SACF;KACF,CAAA;AACH,CAAC","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { EncodeProxy } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { AsciiMsgTransmitter } from '../transport/ascii/ascii-msg-transmitter'\r\nimport { Setup } from './env/setup'\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet proxyFactory: EncodeProxy\r\nlet setup: Setup = null\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup('session/qf-fix44.json', 'session/qf-fix44.json')\r\n await setup.init()\r\n definitions = setup.definitions\r\n const config = setup.clientConfig\r\n session = new AsciiMsgTransmitter(config)\r\n proxyFactory = new EncodeProxy(definitions)\r\n}, 45000)\r\n\r\ntest('check wrapper will reject unknown field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Unknown = 999\r\n }\r\n expect(run).toThrow(/no field named Unknown/)\r\n})\r\n\r\ntest('check wrapper will accept known field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.OrderID = 'ipsum'\r\n }\r\n run()\r\n expect(proxy.OrderID).toEqual('ipsum')\r\n})\r\n\r\ntest('check wrapper rejects unknown enum value', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '23'\r\n }\r\n expect(run).toThrow(/enum field SettlType does not support \"23\"/)\r\n})\r\n\r\ntest('check wrapper will accept known enum field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '1'\r\n }\r\n run()\r\n expect(proxy.SettlType).toEqual('1')\r\n})\r\n\r\ntest('check wrapper rejects Date field when not given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = \"I'm not a good date\"\r\n }\r\n expect(run).toThrow(/expects Date but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Date field when given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = new Date()\r\n }\r\n run()\r\n expect(proxy.SettlDate).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects boolean field when not given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = \"I'm not a good boolean\"\r\n }\r\n expect(run).toThrow(/expects boolean but receives/)\r\n})\r\n\r\ntest('check wrapper will accept boolean field when given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = true\r\n }\r\n run()\r\n expect(proxy.LastRptRequested).toEqual(true)\r\n})\r\n\r\ntest('check wrapper rejects Buffer field when not given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = \"I'm not a Buffer, don't accept me!\"\r\n }\r\n expect(run).toThrow(/expects Buffer but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Buffer field when given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = new Buffer('I am a buffer.', 'utf8')\r\n }\r\n run()\r\n expect(proxy.EncodedText).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects string field when not given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = 123\r\n }\r\n expect(run).toThrow(/expects string but receives/)\r\n})\r\n\r\ntest('check wrapper will accept string field when given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = \"I'm a great string\"\r\n }\r\n run()\r\n expect(proxy.ClOrdID).toEqual(\"I'm a great string\")\r\n})\r\n\r\ntest('check wrapper rejects number field when not given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = \"I'm no number\"\r\n }\r\n expect(run).toThrow(/expects number but receives/)\r\n})\r\n\r\ntest('check wrapper will accept number field when given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = 12234\r\n }\r\n run()\r\n expect(proxy.GrossTradeAmt).toEqual(12234)\r\n})\r\n\r\ntest('check wrapper rejects non object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = 'I should be an object, but I am sadly not'\r\n }\r\n expect(run).toThrow(/is a component but/)\r\n})\r\n\r\ntest('check wrapper accepts object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when assigned component wraps so it can be checked.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.YieldData.GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n proxy.YieldData.YieldCalcDate = new Date()\r\n // accept this\r\n expect(proxy.YieldData).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when given populated component.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n ClOrdID: \"I don't belong here.\"\r\n }\r\n }\r\n // reject this\r\n expect(run).toThrow(/no field named ClOrdID/)\r\n})\r\n\r\ntest('check wrapper accepts number for group field and wraps n elements', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: 2\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n expect(Array.isArray(proxy.Parties.NoPartyIDs)).toEqual(true)\r\n expect(proxy.Parties.NoPartyIDs.length).toEqual(2)\r\n // now assign a field, this should also be wrapped\r\n proxy.Parties.NoPartyIDs[0].PartyID = 'hello'\r\n expect(proxy.Parties.NoPartyIDs[0].PartyID).toBeTruthy()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\ntest('check wrapper accepts array of objects in group component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: getParties()\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return [\r\n {\r\n 'PartyID': 'magna.',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'et',\r\n 'PartySubIDType': 22\r\n },\r\n {\r\n 'PartySubID': 'leo,',\r\n 'PartySubIDType': 10\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'iaculis',\r\n 'PartyIDSource': 'F',\r\n 'PartyRole': 2,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'Nullam',\r\n 'PartySubIDType': 12\r\n },\r\n {\r\n 'PartySubID': 'lectus,',\r\n 'PartySubIDType': 13\r\n },\r\n {\r\n 'PartySubID': 'eget',\r\n 'PartySubIDType': 18\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'vitae,',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 5,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'ac',\r\n 'PartySubIDType': 6\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}\r\n"]}