jspurefix 1.2.0 → 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 (1116) hide show
  1. package/.travis.yml +1 -1
  2. package/README.md +48 -2
  3. package/appveyor.yml +46 -11
  4. package/data/session/certs/ca/ca.crt +33 -0
  5. package/data/session/certs/ca/ca.key +54 -0
  6. package/data/session/certs/client/client.crt +31 -0
  7. package/data/session/certs/client/client.key +51 -0
  8. package/data/session/certs/server/server.crt +31 -0
  9. package/data/session/certs/server/server.key +51 -0
  10. package/data/session/genkey.ps1 +179 -0
  11. package/dist/a-session-msg-factory.d.ts +0 -0
  12. package/dist/a-session-msg-factory.js +1 -0
  13. package/dist/a-session-msg-factory.js.map +1 -0
  14. package/dist/ascii-encoder.test.d.ts +0 -0
  15. package/dist/ascii-encoder.test.js +1 -0
  16. package/dist/ascii-encoder.test.js.map +1 -0
  17. package/dist/ascii-parser.test.d.ts +0 -0
  18. package/dist/ascii-parser.test.js +1 -0
  19. package/dist/ascii-parser.test.js.map +1 -0
  20. package/dist/ascii-segment.test.d.ts +0 -0
  21. package/dist/ascii-segment.test.js +1 -0
  22. package/dist/ascii-segment.test.js.map +1 -0
  23. package/dist/ascii-store-replay.test.d.ts +0 -0
  24. package/dist/ascii-store-replay.test.js +1 -0
  25. package/dist/ascii-store-replay.test.js.map +1 -0
  26. package/dist/ascii-tag-pos.test.d.ts +0 -0
  27. package/dist/ascii-tag-pos.test.js +1 -0
  28. package/dist/ascii-tag-pos.test.js.map +1 -0
  29. package/dist/buffer/{ascii-chars.d.ts → ascii/ascii-chars.d.ts} +0 -0
  30. package/dist/buffer/{ascii-chars.js → ascii/ascii-chars.js} +0 -0
  31. package/dist/buffer/ascii/ascii-chars.js.map +1 -0
  32. package/dist/buffer/ascii/ascii-encoder.d.ts +5 -3
  33. package/dist/buffer/ascii/ascii-encoder.js +82 -48
  34. package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
  35. package/dist/buffer/ascii/ascii-parser-state.d.ts +3 -10
  36. package/dist/buffer/ascii/ascii-parser-state.js +37 -25
  37. package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
  38. package/dist/buffer/ascii/ascii-parser.d.ts +7 -7
  39. package/dist/buffer/ascii/ascii-parser.js +50 -24
  40. package/dist/buffer/ascii/ascii-parser.js.map +1 -1
  41. package/dist/buffer/ascii/ascii-segment-parser.d.ts +2 -2
  42. package/dist/buffer/ascii/ascii-segment-parser.js +34 -13
  43. package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
  44. package/dist/buffer/ascii/ascii-view.d.ts +2 -4
  45. package/dist/buffer/ascii/ascii-view.js +11 -15
  46. package/dist/buffer/ascii/ascii-view.js.map +1 -1
  47. package/dist/buffer/ascii/index.d.ts +1 -0
  48. package/dist/buffer/ascii/index.js +1 -0
  49. package/dist/buffer/ascii/index.js.map +1 -1
  50. package/dist/buffer/ascii/parse-state.d.ts +8 -0
  51. package/dist/buffer/ascii/parse-state.js +13 -0
  52. package/dist/buffer/ascii/parse-state.js.map +1 -0
  53. package/dist/buffer/ascii/time-formatter.js +1 -1
  54. package/dist/buffer/ascii/time-formatter.js.map +1 -1
  55. package/dist/buffer/elastic-buffer.js +29 -8
  56. package/dist/buffer/elastic-buffer.js.map +1 -1
  57. package/dist/buffer/encode-proxy.d.ts +1 -1
  58. package/dist/buffer/encode-proxy.js +16 -17
  59. package/dist/buffer/encode-proxy.js.map +1 -1
  60. package/dist/buffer/fixml/fixml-encoder.d.ts +2 -1
  61. package/dist/buffer/fixml/fixml-encoder.js +43 -20
  62. package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
  63. package/dist/buffer/fixml/fixml-parser.js +47 -24
  64. package/dist/buffer/fixml/fixml-parser.js.map +1 -1
  65. package/dist/buffer/fixml/fixml-view.d.ts +2 -2
  66. package/dist/buffer/fixml/fixml-view.js +13 -13
  67. package/dist/buffer/fixml/fixml-view.js.map +1 -1
  68. package/dist/buffer/fixml/populated-attributes.d.ts +5 -0
  69. package/dist/buffer/fixml/populated-attributes.js +3 -0
  70. package/dist/buffer/fixml/populated-attributes.js.map +1 -0
  71. package/dist/buffer/index.d.ts +4 -8
  72. package/dist/buffer/index.js +4 -8
  73. package/dist/buffer/index.js.map +1 -1
  74. package/dist/buffer/msg-encoder.d.ts +2 -1
  75. package/dist/buffer/msg-encoder.js.map +1 -1
  76. package/dist/buffer/msg-view.d.ts +3 -3
  77. package/dist/buffer/msg-view.js +8 -5
  78. package/dist/buffer/msg-view.js.map +1 -1
  79. package/dist/buffer/segment/segment-description.d.ts +26 -0
  80. package/dist/buffer/segment/segment-description.js +72 -0
  81. package/dist/buffer/segment/segment-description.js.map +1 -0
  82. package/dist/buffer/segment/segment-summary.d.ts +13 -0
  83. package/dist/buffer/segment/segment-summary.js +20 -0
  84. package/dist/buffer/segment/segment-summary.js.map +1 -0
  85. package/dist/buffer/segment/segment-type.d.ts +8 -0
  86. package/dist/buffer/segment/segment-type.js +13 -0
  87. package/dist/buffer/segment/segment-type.js.map +1 -0
  88. package/dist/buffer/segment-description.d.ts +2 -9
  89. package/dist/buffer/segment-description.js +5 -13
  90. package/dist/buffer/segment-description.js.map +1 -1
  91. package/dist/buffer/segment-type.d.ts +8 -0
  92. package/dist/buffer/segment-type.js +13 -0
  93. package/dist/buffer/segment-type.js.map +1 -0
  94. package/dist/buffer/structure.d.ts +3 -3
  95. package/dist/buffer/structure.js +1 -1
  96. package/dist/buffer/structure.js.map +1 -1
  97. package/dist/buffer/tag/tag-pos.d.ts +12 -0
  98. package/dist/buffer/tag/tag-pos.js +55 -0
  99. package/dist/buffer/tag/tag-pos.js.map +1 -0
  100. package/dist/buffer/tag/tag-type.d.ts +13 -0
  101. package/dist/buffer/tag/tag-type.js +18 -0
  102. package/dist/buffer/tag/tag-type.js.map +1 -0
  103. package/dist/buffer/tag/tags.d.ts +21 -0
  104. package/dist/buffer/tag/tags.js +122 -0
  105. package/dist/buffer/tag/tags.js.map +1 -0
  106. package/dist/buffer/tag-type.d.ts +13 -0
  107. package/dist/buffer/tag-type.js +18 -0
  108. package/dist/buffer/tag-type.js.map +1 -0
  109. package/dist/buffer/tags.d.ts +3 -14
  110. package/dist/buffer/tags.js +23 -36
  111. package/dist/buffer/tags.js.map +1 -1
  112. package/dist/config/get-js-fx-logger.d.ts +4 -0
  113. package/dist/config/get-js-fx-logger.js +3 -0
  114. package/dist/config/get-js-fx-logger.js.map +1 -0
  115. package/dist/config/index.d.ts +1 -0
  116. package/dist/config/index.js +1 -0
  117. package/dist/config/index.js.map +1 -1
  118. package/dist/config/js-fix-config.d.ts +4 -1
  119. package/dist/config/js-fix-config.js +3 -3
  120. package/dist/config/js-fix-config.js.map +1 -1
  121. package/dist/config/js-fix-logger.d.ts +0 -3
  122. package/dist/config/js-fix-logger.js.map +1 -1
  123. package/dist/dict-parser.js +30 -25
  124. package/dist/dict-parser.js.map +1 -1
  125. package/dist/dictionary/compiler/compiler-type.js +7 -7
  126. package/dist/dictionary/compiler/compiler-type.js.map +1 -1
  127. package/dist/dictionary/compiler/enum-compiler.d.ts +1 -0
  128. package/dist/dictionary/compiler/enum-compiler.js +11 -1
  129. package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
  130. package/dist/dictionary/compiler/msg-compiler.js +8 -6
  131. package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
  132. package/dist/dictionary/contained/contained-component-field.js +2 -1
  133. package/dist/dictionary/contained/contained-component-field.js.map +1 -1
  134. package/dist/dictionary/contained/contained-field-dispatch.d.ts +1 -14
  135. package/dist/dictionary/contained/contained-field-dispatch.js +4 -4
  136. package/dist/dictionary/contained/contained-field-dispatch.js.map +1 -1
  137. package/dist/dictionary/contained/contained-field-dispatcher.d.ts +14 -0
  138. package/dist/dictionary/contained/contained-field-dispatcher.js +3 -0
  139. package/dist/dictionary/contained/contained-field-dispatcher.js.map +1 -0
  140. package/dist/dictionary/contained/contained-field-set.d.ts +1 -1
  141. package/dist/dictionary/contained/contained-field-set.js +12 -11
  142. package/dist/dictionary/contained/contained-field-set.js.map +1 -1
  143. package/dist/dictionary/contained/contained-field-type.d.ts +5 -0
  144. package/dist/dictionary/contained/contained-field-type.js +10 -0
  145. package/dist/dictionary/contained/contained-field-type.js.map +1 -0
  146. package/dist/dictionary/contained/contained-field.d.ts +1 -5
  147. package/dist/dictionary/contained/contained-field.js +1 -7
  148. package/dist/dictionary/contained/contained-field.js.map +1 -1
  149. package/dist/dictionary/contained/contained-group-field.js +2 -1
  150. package/dist/dictionary/contained/contained-group-field.js.map +1 -1
  151. package/dist/dictionary/contained/contained-simple-field.js +2 -1
  152. package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
  153. package/dist/dictionary/{fields-dispatch.d.ts → contained/field-dispatcher.d.ts} +3 -2
  154. package/dist/dictionary/contained/field-dispatcher.js +3 -0
  155. package/dist/dictionary/contained/field-dispatcher.js.map +1 -0
  156. package/dist/dictionary/contained/fields-dispatch.d.ts +6 -0
  157. package/dist/dictionary/contained/fields-dispatch.js +42 -0
  158. package/dist/dictionary/contained/fields-dispatch.js.map +1 -0
  159. package/dist/dictionary/contained/index.d.ts +2 -0
  160. package/dist/dictionary/contained/index.js +2 -0
  161. package/dist/dictionary/contained/index.js.map +1 -1
  162. package/dist/dictionary/contained-set-type.d.ts +5 -0
  163. package/dist/dictionary/contained-set-type.js +10 -0
  164. package/dist/dictionary/contained-set-type.js.map +1 -0
  165. package/dist/dictionary/definition/component-field-definition.js +2 -2
  166. package/dist/dictionary/definition/component-field-definition.js.map +1 -1
  167. package/dist/dictionary/definition/fix-definitions.d.ts +2 -1
  168. package/dist/dictionary/definition/fix-definitions.js.map +1 -1
  169. package/dist/dictionary/definition/group-field-definition.js +2 -2
  170. package/dist/dictionary/definition/group-field-definition.js.map +1 -1
  171. package/dist/dictionary/definition/index.d.ts +0 -1
  172. package/dist/dictionary/definition/index.js +0 -1
  173. package/dist/dictionary/definition/index.js.map +1 -1
  174. package/dist/dictionary/definition/message-definition.js +2 -2
  175. package/dist/dictionary/definition/message-definition.js.map +1 -1
  176. package/dist/dictionary/definition/simple-field-definition.d.ts +1 -1
  177. package/dist/dictionary/definition/simple-field-definition.js +5 -4
  178. package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
  179. package/dist/dictionary/dict-primitive.d.ts +0 -11
  180. package/dist/dictionary/dict-primitive.js +0 -7
  181. package/dist/dictionary/dict-primitive.js.map +1 -1
  182. package/dist/dictionary/fix-definition-source.d.ts +6 -0
  183. package/dist/dictionary/fix-definition-source.js +11 -0
  184. package/dist/dictionary/fix-definition-source.js.map +1 -0
  185. package/dist/dictionary/fix-versions.d.ts +0 -9
  186. package/dist/dictionary/fix-versions.js +1 -39
  187. package/dist/dictionary/fix-versions.js.map +1 -1
  188. package/dist/dictionary/index.d.ts +1 -5
  189. package/dist/dictionary/index.js +1 -5
  190. package/dist/dictionary/index.js.map +1 -1
  191. package/dist/dictionary/parser/fix-repository/abbreviations-parser.d.ts +1 -3
  192. package/dist/dictionary/parser/fix-repository/abbreviations-parser.js +2 -3
  193. package/dist/dictionary/parser/fix-repository/abbreviations-parser.js.map +1 -1
  194. package/dist/dictionary/parser/fix-repository/base-parser.d.ts +2 -4
  195. package/dist/dictionary/parser/fix-repository/base-parser.js +1 -2
  196. package/dist/dictionary/parser/fix-repository/base-parser.js.map +1 -1
  197. package/dist/dictionary/parser/fix-repository/components-parser.d.ts +1 -3
  198. package/dist/dictionary/parser/fix-repository/components-parser.js +2 -3
  199. package/dist/dictionary/parser/fix-repository/components-parser.js.map +1 -1
  200. package/dist/dictionary/parser/fix-repository/data-types-parser.d.ts +1 -3
  201. package/dist/dictionary/parser/fix-repository/data-types-parser.js +2 -3
  202. package/dist/dictionary/parser/fix-repository/data-types-parser.js.map +1 -1
  203. package/dist/dictionary/parser/fix-repository/enums-parser.d.ts +1 -3
  204. package/dist/dictionary/parser/fix-repository/enums-parser.js +2 -3
  205. package/dist/dictionary/parser/fix-repository/enums-parser.js.map +1 -1
  206. package/dist/dictionary/parser/fix-repository/fields-parser.d.ts +1 -3
  207. package/dist/dictionary/parser/fix-repository/fields-parser.js +2 -3
  208. package/dist/dictionary/parser/fix-repository/fields-parser.js.map +1 -1
  209. package/dist/dictionary/parser/fix-repository/messages-parser.d.ts +1 -3
  210. package/dist/dictionary/parser/fix-repository/messages-parser.js +2 -3
  211. package/dist/dictionary/parser/fix-repository/messages-parser.js.map +1 -1
  212. package/dist/dictionary/parser/fix-repository/msg-contents-parser.d.ts +1 -3
  213. package/dist/dictionary/parser/fix-repository/msg-contents-parser.js +2 -3
  214. package/dist/dictionary/parser/fix-repository/msg-contents-parser.js.map +1 -1
  215. package/dist/dictionary/parser/fix-repository/repository-abbreviation.d.ts +5 -0
  216. package/dist/dictionary/parser/fix-repository/repository-abbreviation.js +3 -0
  217. package/dist/dictionary/parser/fix-repository/repository-abbreviation.js.map +1 -0
  218. package/dist/dictionary/parser/fix-repository/repository-component.d.ts +10 -0
  219. package/dist/dictionary/parser/fix-repository/repository-component.js +3 -0
  220. package/dist/dictionary/parser/fix-repository/repository-component.js.map +1 -0
  221. package/dist/dictionary/parser/fix-repository/repository-data-type.d.ts +6 -0
  222. package/dist/dictionary/parser/fix-repository/repository-data-type.js +3 -0
  223. package/dist/dictionary/parser/fix-repository/repository-data-type.js.map +1 -0
  224. package/dist/dictionary/parser/fix-repository/repository-enum.d.ts +7 -0
  225. package/dist/{standard_header.js → dictionary/parser/fix-repository/repository-enum.js} +1 -1
  226. package/dist/dictionary/parser/fix-repository/repository-enum.js.map +1 -0
  227. package/dist/dictionary/parser/fix-repository/repository-field.d.ts +11 -0
  228. package/dist/dictionary/parser/fix-repository/repository-field.js +3 -0
  229. package/dist/dictionary/parser/fix-repository/repository-field.js.map +1 -0
  230. package/dist/dictionary/parser/fix-repository/repository-message.d.ts +11 -0
  231. package/dist/dictionary/parser/fix-repository/repository-message.js +3 -0
  232. package/dist/dictionary/parser/fix-repository/repository-message.js.map +1 -0
  233. package/dist/dictionary/parser/fix-repository/repository-msg-content.d.ts +9 -0
  234. package/dist/dictionary/parser/fix-repository/repository-msg-content.js +3 -0
  235. package/dist/dictionary/parser/fix-repository/repository-msg-content.js.map +1 -0
  236. package/dist/dictionary/parser/fix-repository/repository-msg.d.ts +0 -0
  237. package/dist/dictionary/parser/fix-repository/repository-msg.js +1 -0
  238. package/dist/dictionary/parser/fix-repository/repository-msg.js.map +1 -0
  239. package/dist/dictionary/parser/fix-repository/repository-type.d.ts +0 -53
  240. package/dist/dictionary/parser/fix-repository/repository-type.js +0 -2
  241. package/dist/dictionary/parser/fix-repository/repository-type.js.map +1 -1
  242. package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +10 -10
  243. package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
  244. package/dist/dictionary/parser/fix-repository/repository.d.ts +12 -1
  245. package/dist/dictionary/parser/fix-repository/repository.js +50 -28
  246. package/dist/dictionary/parser/fix-repository/repository.js.map +1 -1
  247. package/dist/dictionary/parser/fixml/components-parser.d.ts +1 -1
  248. package/dist/dictionary/parser/fixml/components-parser.js.map +1 -1
  249. package/dist/dictionary/parser/fixml/fields-parser.d.ts +1 -1
  250. package/dist/dictionary/parser/fixml/fields-parser.js.map +1 -1
  251. package/dist/dictionary/parser/fixml/fix-xsd-parser.js +3 -2
  252. package/dist/dictionary/parser/fixml/fix-xsd-parser.js.map +1 -1
  253. package/dist/dictionary/parser/fixml/include-graph.js.map +1 -1
  254. package/dist/dictionary/parser/fixml/xsd-parser.d.ts +1 -1
  255. package/dist/dictionary/parser/fixml/xsd-parser.js.map +1 -1
  256. package/dist/dictionary/parser/quickfix/field-definition-parser.d.ts +4 -4
  257. package/dist/dictionary/parser/quickfix/field-definition-parser.js +3 -3
  258. package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
  259. package/dist/dictionary/parser/quickfix/field-set-parser.d.ts +4 -4
  260. package/dist/dictionary/parser/quickfix/field-set-parser.js +3 -3
  261. package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
  262. package/dist/dictionary/parser/quickfix/message-parser.d.ts +4 -4
  263. package/dist/dictionary/parser/quickfix/message-parser.js +3 -3
  264. package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
  265. package/dist/dictionary/parser/quickfix/node-parser.d.ts +4 -5
  266. package/dist/dictionary/parser/quickfix/node-parser.js +4 -4
  267. package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
  268. package/dist/dictionary/parser/quickfix/parse-state.d.ts +8 -0
  269. package/dist/dictionary/parser/quickfix/parse-state.js +13 -0
  270. package/dist/dictionary/parser/quickfix/parse-state.js.map +1 -0
  271. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -9
  272. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +28 -35
  273. package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
  274. package/dist/dictionary/sax-node.d.ts +6 -0
  275. package/dist/{header.js → dictionary/sax-node.js} +1 -1
  276. package/dist/dictionary/sax-node.js.map +1 -0
  277. package/dist/dictionary/set-reduce.d.ts +5 -12
  278. package/dist/dictionary/set-reduce.js +28 -26
  279. package/dist/dictionary/set-reduce.js.map +1 -1
  280. package/dist/dictionary/type-dispatcher.d.ts +12 -0
  281. package/dist/dictionary/type-dispatcher.js +3 -0
  282. package/dist/dictionary/type-dispatcher.js.map +1 -0
  283. package/dist/dictionary/version-util.d.ts +4 -0
  284. package/dist/dictionary/version-util.js +36 -0
  285. package/dist/dictionary/version-util.js.map +1 -0
  286. package/dist/execution-report.test.d.ts +0 -0
  287. package/dist/execution-report.test.js +1 -0
  288. package/dist/execution-report.test.js.map +1 -0
  289. package/dist/experiment.d.ts +0 -0
  290. package/dist/experiment.js +1 -0
  291. package/dist/experiment.js.map +1 -0
  292. package/dist/fix-repo-dict.test.d.ts +0 -0
  293. package/dist/fix-repo-dict.test.js +1 -0
  294. package/dist/fix-repo-dict.test.js.map +1 -0
  295. package/dist/fix-session-state-args.d.ts +0 -0
  296. package/dist/fix-session-state-args.js +1 -0
  297. package/dist/fix-session-state-args.js.map +1 -0
  298. package/dist/fix-session-state.d.ts +0 -0
  299. package/dist/fix-session-state.js +1 -0
  300. package/dist/fix-session-state.js.map +1 -0
  301. package/dist/fix-session.d.ts +0 -0
  302. package/dist/fix-session.js +1 -0
  303. package/dist/fix-session.js.map +1 -0
  304. package/dist/fix.txt +1 -1
  305. package/dist/fixml-alloc-parse.test.d.ts +0 -0
  306. package/dist/fixml-alloc-parse.test.js +1 -0
  307. package/dist/fixml-alloc-parse.test.js.map +1 -0
  308. package/dist/fixml-mkt-data-fut-parse.test.d.ts +0 -0
  309. package/dist/fixml-mkt-data-fut-parse.test.js +1 -0
  310. package/dist/fixml-mkt-data-fut-parse.test.js.map +1 -0
  311. package/dist/fixml-mkt-data-settle-parse.test.d.ts +0 -0
  312. package/dist/fixml-mkt-data-settle-parse.test.js +1 -0
  313. package/dist/fixml-mkt-data-settle-parse.test.js.map +1 -0
  314. package/dist/fixml-tc-bi-lateral-parse.test.d.ts +0 -0
  315. package/dist/fixml-tc-bi-lateral-parse.test.js +1 -0
  316. package/dist/fixml-tc-bi-lateral-parse.test.js.map +1 -0
  317. package/dist/includes.test.d.ts +0 -0
  318. package/dist/includes.test.js +1 -0
  319. package/dist/includes.test.js.map +1 -0
  320. package/dist/index.d.ts +1 -0
  321. package/dist/index.js +1 -0
  322. package/dist/index.js.map +1 -1
  323. package/dist/jsfix-cmd.d.ts +5 -0
  324. package/dist/jsfix-cmd.js +28 -21
  325. package/dist/jsfix-cmd.js.map +1 -1
  326. package/dist/launcher.d.ts +0 -0
  327. package/dist/launcher.js +1 -0
  328. package/dist/launcher.js.map +1 -0
  329. package/dist/logon.test.d.ts +0 -0
  330. package/dist/logon.test.js +1 -0
  331. package/dist/logon.test.js.map +1 -0
  332. package/dist/make-fix-session.d.ts +0 -0
  333. package/dist/make-fix-session.js +1 -0
  334. package/dist/make-fix-session.js.map +1 -0
  335. package/dist/memory-store.test.d.ts +0 -0
  336. package/dist/memory-store.test.js +1 -0
  337. package/dist/memory-store.test.js.map +1 -0
  338. package/dist/object.json +473 -698
  339. package/dist/qf-full-msg.test.d.ts +0 -0
  340. package/dist/qf-full-msg.test.js +1 -0
  341. package/dist/qf-full-msg.test.js.map +1 -0
  342. package/dist/repo-full-ascii-msg.test.d.ts +0 -0
  343. package/dist/repo-full-ascii-msg.test.js +1 -0
  344. package/dist/repo-full-ascii-msg.test.js.map +1 -0
  345. package/dist/runtime/DITokens.d.ts +20 -0
  346. package/dist/runtime/DITokens.js +25 -0
  347. package/dist/runtime/DITokens.js.map +1 -0
  348. package/dist/runtime/app-launcher.d.ts +27 -0
  349. package/dist/runtime/app-launcher.js +131 -0
  350. package/dist/runtime/app-launcher.js.map +1 -0
  351. package/dist/runtime/di-tokens.d.ts +28 -0
  352. package/dist/runtime/di-tokens.js +33 -0
  353. package/dist/runtime/di-tokens.js.map +1 -0
  354. package/dist/runtime/engine-factory.d.ts +4 -0
  355. package/dist/runtime/engine-factory.js +3 -0
  356. package/dist/runtime/engine-factory.js.map +1 -0
  357. package/dist/runtime/index.d.ts +5 -0
  358. package/dist/runtime/index.js +18 -0
  359. package/dist/runtime/index.js.map +1 -0
  360. package/dist/runtime/launcher.d.ts +29 -0
  361. package/dist/runtime/launcher.js +131 -0
  362. package/dist/runtime/launcher.js.map +1 -0
  363. package/dist/runtime/make-config.d.ts +11 -0
  364. package/dist/runtime/make-config.js +57 -0
  365. package/dist/runtime/make-config.js.map +1 -0
  366. package/dist/runtime/session-container.d.ts +16 -0
  367. package/dist/runtime/session-container.js +168 -0
  368. package/dist/runtime/session-container.js.map +1 -0
  369. package/dist/runtime/session-launcher.d.ts +26 -0
  370. package/dist/runtime/session-launcher.js +131 -0
  371. package/dist/runtime/session-launcher.js.map +1 -0
  372. package/dist/sample/http/oms/app.d.ts +1 -1
  373. package/dist/sample/http/oms/app.js +16 -12
  374. package/dist/sample/http/oms/app.js.map +1 -1
  375. package/dist/sample/http/oms/http-client.js +22 -2
  376. package/dist/sample/http/oms/http-client.js.map +1 -1
  377. package/dist/sample/http/oms/http-server.js +21 -2
  378. package/dist/sample/http/oms/http-server.js.map +1 -1
  379. package/dist/sample/launcher.d.ts +21 -3
  380. package/dist/sample/launcher.js +88 -11
  381. package/dist/sample/launcher.js.map +1 -1
  382. package/dist/sample/tcp/qf-md/app.d.ts +1 -1
  383. package/dist/sample/tcp/qf-md/app.js +11 -11
  384. package/dist/sample/tcp/qf-md/app.js.map +1 -1
  385. package/dist/sample/tcp/qf-md/md-client.js +21 -2
  386. package/dist/sample/tcp/qf-md/md-client.js.map +1 -1
  387. package/dist/sample/tcp/qf-md/md-server.js +20 -2
  388. package/dist/sample/tcp/qf-md/md-server.js.map +1 -1
  389. package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -1
  390. package/dist/sample/tcp/recovering-skeleton/app.js +36 -16
  391. package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -1
  392. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +3 -1
  393. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +30 -8
  394. package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
  395. package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +1 -1
  396. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +22 -3
  397. package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -1
  398. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +21 -2
  399. package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -1
  400. package/dist/sample/tcp/skeleton/app.d.ts +1 -1
  401. package/dist/sample/tcp/skeleton/app.js +8 -13
  402. package/dist/sample/tcp/skeleton/app.js.map +1 -1
  403. package/dist/sample/tcp/skeleton/skeleton-session.d.ts +5 -1
  404. package/dist/sample/tcp/skeleton/skeleton-session.js +45 -4
  405. package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
  406. package/dist/sample/tcp/tls-trade-capture/app.d.ts +1 -1
  407. package/dist/sample/tcp/tls-trade-capture/app.js +4 -24
  408. package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
  409. package/dist/sample/tcp/trade-capture/app-launcher.d.ts +6 -0
  410. package/dist/sample/tcp/trade-capture/app-launcher.js +21 -0
  411. package/dist/sample/tcp/trade-capture/app-launcher.js.map +1 -0
  412. package/dist/sample/tcp/trade-capture/app-launher.d.ts +0 -0
  413. package/dist/sample/tcp/trade-capture/app-launher.js +1 -0
  414. package/dist/sample/tcp/trade-capture/app-launher.js.map +1 -0
  415. package/dist/sample/tcp/trade-capture/app.d.ts +1 -1
  416. package/dist/sample/tcp/trade-capture/app.js +4 -21
  417. package/dist/sample/tcp/trade-capture/app.js.map +1 -1
  418. package/dist/sample/tcp/trade-capture/jsfix.test_client.txt +11 -14
  419. package/dist/sample/tcp/trade-capture/jsfix.test_server.txt +10 -14
  420. package/dist/sample/tcp/trade-capture/trade-capture-client.d.ts +1 -0
  421. package/dist/sample/tcp/trade-capture/trade-capture-client.js +7 -3
  422. package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
  423. package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -1
  424. package/dist/sample/tcp/trade-capture/trade-factory.js +7 -1
  425. package/dist/sample/tcp/trade-capture/trade-factory.js.map +1 -1
  426. package/dist/segment-description.d.ts +0 -0
  427. package/dist/segment-description.js +1 -0
  428. package/dist/segment-description.js.map +1 -0
  429. package/dist/segment-summary.d.ts +0 -0
  430. package/dist/segment-summary.js +1 -0
  431. package/dist/segment-summary.js.map +1 -0
  432. package/dist/segment-type.d.ts +0 -0
  433. package/dist/segment-type.js +1 -0
  434. package/dist/segment-type.js.map +1 -0
  435. package/dist/session-description.d.ts +0 -0
  436. package/dist/session-description.js +1 -0
  437. package/dist/session-description.js.map +1 -0
  438. package/dist/session-msg-factory.d.ts +0 -0
  439. package/dist/session-msg-factory.js +1 -0
  440. package/dist/session-msg-factory.js.map +1 -0
  441. package/dist/session-state.d.ts +0 -0
  442. package/dist/session-state.js +1 -0
  443. package/dist/session-state.js.map +1 -0
  444. package/dist/session-state.test.d.ts +0 -0
  445. package/dist/session-state.test.js +1 -0
  446. package/dist/session-state.test.js.map +1 -0
  447. package/dist/session.test.d.ts +0 -0
  448. package/dist/session.test.js +1 -0
  449. package/dist/session.test.js.map +1 -0
  450. package/dist/setup.d.ts +0 -0
  451. package/dist/setup.js +1 -0
  452. package/dist/setup.js.map +1 -0
  453. package/dist/skeleton-runner.d.ts +0 -0
  454. package/dist/skeleton-runner.js +1 -0
  455. package/dist/skeleton-runner.js.map +1 -0
  456. package/dist/store/fix-msg-ascii-store-resend.d.ts +3 -2
  457. package/dist/store/fix-msg-ascii-store-resend.js +30 -21
  458. package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
  459. package/dist/store/fix-msg-memory-store.d.ts +11 -8
  460. package/dist/store/fix-msg-memory-store.js +108 -42
  461. package/dist/store/fix-msg-memory-store.js.map +1 -1
  462. package/dist/store/fix-msg-store-record.d.ts +4 -0
  463. package/dist/store/fix-msg-store-record.js +7 -0
  464. package/dist/store/fix-msg-store-record.js.map +1 -1
  465. package/dist/store/fix-msg-store-state.d.ts +6 -0
  466. package/dist/store/fix-msg-store-state.js +3 -0
  467. package/dist/store/fix-msg-store-state.js.map +1 -0
  468. package/dist/store/fix-msg-store.d.ts +8 -9
  469. package/dist/store/fix-msg-store.js.map +1 -1
  470. package/dist/structure.json +225 -485
  471. package/dist/tag-pos.d.ts +0 -0
  472. package/dist/tag-pos.js +1 -0
  473. package/dist/tag-pos.js.map +1 -0
  474. package/dist/tag-type.d.ts +0 -0
  475. package/dist/tag-type.js +1 -0
  476. package/dist/tag-type.js.map +1 -0
  477. package/dist/tags.d.ts +0 -0
  478. package/dist/tags.js +1 -0
  479. package/dist/tags.js.map +1 -0
  480. package/dist/test/ascii/ascii-encoder.test.d.ts +1 -0
  481. package/dist/test/ascii/ascii-encoder.test.js +507 -0
  482. package/dist/test/ascii/ascii-encoder.test.js.map +1 -0
  483. package/dist/test/ascii/ascii-parser.test.d.ts +1 -0
  484. package/dist/test/ascii/ascii-parser.test.js +123 -0
  485. package/dist/test/ascii/ascii-parser.test.js.map +1 -0
  486. package/dist/test/ascii/ascii-segment.test.d.ts +1 -0
  487. package/dist/test/ascii/ascii-segment.test.js +86 -0
  488. package/dist/test/ascii/ascii-segment.test.js.map +1 -0
  489. package/dist/test/ascii/ascii-store-replay.test.d.ts +1 -0
  490. package/dist/test/ascii/ascii-store-replay.test.js +92 -0
  491. package/dist/test/ascii/ascii-store-replay.test.js.map +1 -0
  492. package/dist/test/ascii/ascii-tag-pos.test.d.ts +1 -0
  493. package/dist/test/ascii/ascii-tag-pos.test.js +105 -0
  494. package/dist/test/ascii/ascii-tag-pos.test.js.map +1 -0
  495. package/dist/test/ascii/execution-report.test.d.ts +1 -0
  496. package/dist/test/ascii/execution-report.test.js +489 -0
  497. package/dist/test/ascii/execution-report.test.js.map +1 -0
  498. package/dist/test/ascii/fix-log-replay.test.d.ts +1 -0
  499. package/dist/test/{memory-store-test.js → ascii/fix-log-replay.test.js} +11 -23
  500. package/dist/test/ascii/fix-log-replay.test.js.map +1 -0
  501. package/dist/test/ascii/fix-repo-dict.test.d.ts +1 -0
  502. package/dist/test/ascii/fix-repo-dict.test.js +128 -0
  503. package/dist/test/ascii/fix-repo-dict.test.js.map +1 -0
  504. package/dist/test/ascii/includes.test.d.ts +1 -0
  505. package/dist/test/ascii/includes.test.js +43 -0
  506. package/dist/test/ascii/includes.test.js.map +1 -0
  507. package/dist/test/ascii/logon.test.d.ts +1 -0
  508. package/dist/test/ascii/logon.test.js +91 -0
  509. package/dist/test/ascii/logon.test.js.map +1 -0
  510. package/dist/test/ascii/memory-store.test.d.ts +1 -0
  511. package/dist/test/ascii/memory-store.test.js +75 -0
  512. package/dist/test/ascii/memory-store.test.js.map +1 -0
  513. package/dist/test/ascii/qf-full-msg.test.d.ts +1 -0
  514. package/dist/test/ascii/qf-full-msg.test.js +81 -0
  515. package/dist/test/ascii/qf-full-msg.test.js.map +1 -0
  516. package/dist/test/ascii/repo-full-ascii-msg.test.d.ts +1 -0
  517. package/dist/test/ascii/repo-full-ascii-msg.test.js +87 -0
  518. package/dist/test/ascii/repo-full-ascii-msg.test.js.map +1 -0
  519. package/dist/test/ascii/session-state.test.d.ts +1 -0
  520. package/dist/test/ascii/session-state.test.js +73 -0
  521. package/dist/test/ascii/session-state.test.js.map +1 -0
  522. package/dist/test/ascii/session.test.d.ts +1 -0
  523. package/dist/test/ascii/session.test.js +280 -0
  524. package/dist/test/ascii/session.test.js.map +1 -0
  525. package/dist/test/ascii/time-formatter.test.d.ts +1 -0
  526. package/dist/test/ascii/time-formatter.test.js +80 -0
  527. package/dist/test/ascii/time-formatter.test.js.map +1 -0
  528. package/dist/test/ascii/view-decode.test.d.ts +1 -0
  529. package/dist/test/ascii/view-decode.test.js +183 -0
  530. package/dist/test/ascii/view-decode.test.js.map +1 -0
  531. package/dist/test/ascii-encoder.test.d.ts +1 -0
  532. package/dist/test/{ascii-encode.test.js → ascii-encoder.test.js} +140 -48
  533. package/dist/test/ascii-encoder.test.js.map +1 -0
  534. package/dist/test/ascii-parser.test.d.ts +1 -1
  535. package/dist/test/ascii-parser.test.js +31 -48
  536. package/dist/test/ascii-parser.test.js.map +1 -1
  537. package/dist/test/ascii-segment.test.d.ts +1 -1
  538. package/dist/test/ascii-segment.test.js +19 -39
  539. package/dist/test/ascii-segment.test.js.map +1 -1
  540. package/dist/test/ascii-store-replay.test.d.ts +1 -1
  541. package/dist/test/ascii-store-replay.test.js +32 -44
  542. package/dist/test/ascii-store-replay.test.js.map +1 -1
  543. package/dist/test/ascii-tag-pos.test.d.ts +1 -1
  544. package/dist/test/ascii-tag-pos.test.js +8 -8
  545. package/dist/test/ascii-tag-pos.test.js.map +1 -1
  546. package/dist/test/elastic-buffer.test.d.ts +1 -1
  547. package/dist/test/elastic-buffer.test.js +3 -1
  548. package/dist/test/elastic-buffer.test.js.map +1 -1
  549. package/dist/test/encode-proxy.test.d.ts +1 -1
  550. package/dist/test/encode-proxy.test.js +9 -9
  551. package/dist/test/encode-proxy.test.js.map +1 -1
  552. package/dist/test/env/experiment.d.ts +23 -0
  553. package/dist/test/env/experiment.js +33 -0
  554. package/dist/test/env/experiment.js.map +1 -0
  555. package/dist/test/env/parsing-result.d.ts +10 -0
  556. package/dist/test/env/parsing-result.js +14 -0
  557. package/dist/test/env/parsing-result.js.map +1 -0
  558. package/dist/test/env/setup.d.ts +39 -0
  559. package/dist/test/env/setup.js +98 -0
  560. package/dist/test/env/setup.js.map +1 -0
  561. package/dist/test/env/skeleton-runner.d.ts +15 -0
  562. package/dist/test/env/skeleton-runner.js +108 -0
  563. package/dist/test/env/skeleton-runner.js.map +1 -0
  564. package/dist/test/env/test-recovery.d.ts +13 -0
  565. package/dist/test/env/test-recovery.js +41 -0
  566. package/dist/test/env/test-recovery.js.map +1 -0
  567. package/dist/test/env/to-views.d.ts +11 -0
  568. package/dist/test/env/to-views.js +56 -0
  569. package/dist/test/env/to-views.js.map +1 -0
  570. package/dist/test/execution-report.test.d.ts +1 -1
  571. package/dist/test/execution-report.test.js +53 -49
  572. package/dist/test/execution-report.test.js.map +1 -1
  573. package/dist/test/experiment.d.ts +23 -0
  574. package/dist/test/experiment.js +33 -0
  575. package/dist/test/experiment.js.map +1 -0
  576. package/dist/test/expieriment.d.ts +23 -0
  577. package/dist/test/expieriment.js +33 -0
  578. package/dist/test/expieriment.js.map +1 -0
  579. package/dist/test/fix-log-replay.test.d.ts +1 -1
  580. package/dist/test/fix-log-replay.test.js +7 -5
  581. package/dist/test/fix-log-replay.test.js.map +1 -1
  582. package/dist/test/fix-repo-dict.test.d.ts +1 -1
  583. package/dist/test/fix-repo-dict.test.js +6 -5
  584. package/dist/test/fix-repo-dict.test.js.map +1 -1
  585. package/dist/test/fixml/fixml-alloc-parse.test.d.ts +1 -0
  586. package/dist/test/fixml/fixml-alloc-parse.test.js +161 -0
  587. package/dist/test/fixml/fixml-alloc-parse.test.js.map +1 -0
  588. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.d.ts +1 -0
  589. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js +61 -0
  590. package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js.map +1 -0
  591. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.d.ts +1 -0
  592. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js +34 -0
  593. package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js.map +1 -0
  594. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.d.ts +1 -0
  595. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js +97 -0
  596. package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js.map +1 -0
  597. package/dist/test/fixml/repo-full-fixml-msg.test.d.ts +1 -0
  598. package/dist/test/fixml/repo-full-fixml-msg.test.js +143 -0
  599. package/dist/test/fixml/repo-full-fixml-msg.test.js.map +1 -0
  600. package/dist/test/fixml-alloc-parse.test.d.ts +1 -1
  601. package/dist/test/fixml-alloc-parse.test.js +2 -1
  602. package/dist/test/fixml-alloc-parse.test.js.map +1 -1
  603. package/dist/test/fixml-mkt-data-fut-parse.test.d.ts +1 -1
  604. package/dist/test/fixml-mkt-data-fut-parse.test.js +2 -1
  605. package/dist/test/fixml-mkt-data-fut-parse.test.js.map +1 -1
  606. package/dist/test/fixml-mkt-data-settle-parse.test.d.ts +1 -1
  607. package/dist/test/fixml-mkt-data-settle-parse.test.js +2 -1
  608. package/dist/test/fixml-mkt-data-settle-parse.test.js.map +1 -1
  609. package/dist/test/fixml-tc-bi-lateral-parse.test.d.ts +1 -1
  610. package/dist/test/fixml-tc-bi-lateral-parse.test.js +2 -1
  611. package/dist/test/fixml-tc-bi-lateral-parse.test.js.map +1 -1
  612. package/dist/test/includes.test.d.ts +1 -1
  613. package/dist/test/includes.test.js +1 -0
  614. package/dist/test/includes.test.js.map +1 -1
  615. package/dist/test/logon.test.d.ts +1 -1
  616. package/dist/test/logon.test.js +11 -11
  617. package/dist/test/logon.test.js.map +1 -1
  618. package/dist/test/memory-store.test.d.ts +1 -1
  619. package/dist/test/memory-store.test.js +35 -27
  620. package/dist/test/memory-store.test.js.map +1 -1
  621. package/dist/test/qf-full-msg.test.d.ts +1 -1
  622. package/dist/test/qf-full-msg.test.js +25 -19
  623. package/dist/test/qf-full-msg.test.js.map +1 -1
  624. package/dist/test/repo-full-ascii-msg.test.d.ts +1 -1
  625. package/dist/test/repo-full-ascii-msg.test.js +28 -22
  626. package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
  627. package/dist/test/repo-full-fixml-msg.test.d.ts +1 -1
  628. package/dist/test/repo-full-fixml-msg.test.js +21 -18
  629. package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
  630. package/dist/test/session-state.test.d.ts +1 -1
  631. package/dist/test/session-state.test.js +2 -1
  632. package/dist/test/session-state.test.js.map +1 -1
  633. package/dist/test/session.test.d.ts +1 -1
  634. package/dist/test/session.test.js +152 -163
  635. package/dist/test/session.test.js.map +1 -1
  636. package/dist/test/setup.d.ts +45 -0
  637. package/dist/test/setup.js +102 -0
  638. package/dist/test/setup.js.map +1 -0
  639. package/dist/test/skeleton-runner.d.ts +15 -0
  640. package/dist/test/skeleton-runner.js +108 -0
  641. package/dist/test/skeleton-runner.js.map +1 -0
  642. package/dist/test/time-formatter.test.d.ts +1 -1
  643. package/dist/test/time-formatter.test.js +3 -1
  644. package/dist/test/time-formatter.test.js.map +1 -1
  645. package/dist/test/to-views.d.ts +1 -1
  646. package/dist/test/to-views.js +5 -4
  647. package/dist/test/to-views.js.map +1 -1
  648. package/dist/test/view-decode.test.d.ts +1 -1
  649. package/dist/test/view-decode.test.js +9 -33
  650. package/dist/test/view-decode.test.js.map +1 -1
  651. package/dist/time-formatter.test.d.ts +0 -0
  652. package/dist/time-formatter.test.js +1 -0
  653. package/dist/time-formatter.test.js.map +1 -0
  654. package/dist/to-views.d.ts +0 -0
  655. package/dist/to-views.js +1 -0
  656. package/dist/to-views.js.map +1 -0
  657. package/dist/token.txt +246 -308
  658. package/dist/transport/FixEntity.d.ts +8 -0
  659. package/dist/transport/FixEntity.js +12 -0
  660. package/dist/transport/FixEntity.js.map +1 -0
  661. package/dist/transport/a-session-msg-factory.d.ts +23 -0
  662. package/dist/transport/a-session-msg-factory.js +58 -0
  663. package/dist/transport/a-session-msg-factory.js.map +1 -0
  664. package/dist/transport/ascii/ascii-msg-transmitter.js +50 -12
  665. package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
  666. package/dist/transport/ascii/ascii-session-msg-factory.d.ts +16 -0
  667. package/dist/transport/ascii/ascii-session-msg-factory.js +47 -0
  668. package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -0
  669. package/dist/transport/ascii/ascii-session.d.ts +10 -1
  670. package/dist/transport/ascii/ascii-session.js +98 -41
  671. package/dist/transport/ascii/ascii-session.js.map +1 -1
  672. package/dist/transport/ascii/index.d.ts +1 -1
  673. package/dist/transport/ascii/index.js +1 -1
  674. package/dist/transport/ascii/index.js.map +1 -1
  675. package/dist/transport/duplex/http-duplex.d.ts +1 -1
  676. package/dist/transport/duplex/http-duplex.js +2 -2
  677. package/dist/transport/duplex/http-duplex.js.map +1 -1
  678. package/dist/transport/duplex/tcp-duplex.js +22 -2
  679. package/dist/transport/duplex/tcp-duplex.js.map +1 -1
  680. package/dist/transport/factory/index.d.ts +1 -0
  681. package/dist/{sample/tcp/trade_capture → transport/factory}/index.js +1 -2
  682. package/dist/transport/factory/index.js.map +1 -0
  683. package/dist/transport/{msg-transport.d.ts → factory/msg-transport.d.ts} +4 -4
  684. package/dist/transport/factory/msg-transport.js +61 -0
  685. package/dist/transport/factory/msg-transport.js.map +1 -0
  686. package/dist/transport/fix-acceptor.d.ts +2 -2
  687. package/dist/transport/fix-acceptor.js.map +1 -1
  688. package/dist/transport/fix-entity.d.ts +8 -0
  689. package/dist/transport/fix-entity.js +12 -0
  690. package/dist/transport/fix-entity.js.map +1 -0
  691. package/dist/transport/fix-initiator.d.ts +2 -2
  692. package/dist/transport/fix-initiator.js.map +1 -1
  693. package/dist/transport/fix-msg-factory.d.ts +1 -1
  694. package/dist/transport/fix-msg-factory.js.map +1 -1
  695. package/dist/transport/fix-session-state-args.d.ts +8 -0
  696. package/dist/transport/fix-session-state-args.js +3 -0
  697. package/dist/transport/fix-session-state-args.js.map +1 -0
  698. package/dist/transport/fix-session-state.d.ts +8 -38
  699. package/dist/transport/fix-session-state.js +26 -56
  700. package/dist/transport/fix-session-state.js.map +1 -1
  701. package/dist/transport/fix-session.d.ts +9 -2
  702. package/dist/transport/fix-session.js +115 -59
  703. package/dist/transport/fix-session.js.map +1 -1
  704. package/dist/transport/fixml/fixml-msg-transmitter.js +23 -5
  705. package/dist/transport/fixml/fixml-msg-transmitter.js.map +1 -1
  706. package/dist/transport/fixml/fixml-session-msg-factory.d.ts +13 -0
  707. package/dist/transport/fixml/fixml-session-msg-factory.js +68 -0
  708. package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -0
  709. package/dist/transport/fixml/fixml-session.d.ts +1 -1
  710. package/dist/transport/fixml/fixml-session.js +3 -3
  711. package/dist/transport/fixml/fixml-session.js.map +1 -1
  712. package/dist/transport/fixml/index.d.ts +1 -2
  713. package/dist/transport/fixml/index.js +1 -2
  714. package/dist/transport/fixml/index.js.map +1 -1
  715. package/dist/transport/http/html-options.d.ts +8 -0
  716. package/dist/{hop_no_hops.js → transport/http/html-options.js} +1 -1
  717. package/dist/transport/http/html-options.js.map +1 -0
  718. package/dist/transport/http/html-route.d.ts +5 -0
  719. package/dist/{hop.js → transport/http/html-route.js} +1 -1
  720. package/dist/transport/http/html-route.js.map +1 -0
  721. package/dist/transport/http/http-acceptor-listener.d.ts +7 -0
  722. package/dist/transport/http/http-acceptor-listener.js +68 -0
  723. package/dist/transport/http/http-acceptor-listener.js.map +1 -0
  724. package/dist/transport/http/http-acceptor.js +31 -11
  725. package/dist/transport/http/http-acceptor.js.map +1 -1
  726. package/dist/transport/http/http-adapter.d.ts +7 -0
  727. package/dist/{trailer.js → transport/http/http-adapter.js} +1 -1
  728. package/dist/transport/http/http-adapter.js.map +1 -0
  729. package/dist/transport/http/http-initiator.d.ts +9 -3
  730. package/dist/transport/http/http-initiator.js +57 -26
  731. package/dist/transport/http/http-initiator.js.map +1 -1
  732. package/dist/transport/http/http-json-sample-adapter.d.ts +2 -1
  733. package/dist/transport/http/http-json-sample-adapter.js +21 -2
  734. package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
  735. package/dist/transport/http/http-transaction.d.ts +1 -1
  736. package/dist/transport/http/http-transaction.js.map +1 -1
  737. package/dist/transport/http/http-transport-description.d.ts +8 -0
  738. package/dist/transport/http/http-transport-description.js +3 -0
  739. package/dist/transport/http/http-transport-description.js.map +1 -0
  740. package/dist/transport/http/index.d.ts +1 -0
  741. package/dist/transport/http/index.js +1 -0
  742. package/dist/transport/http/index.js.map +1 -1
  743. package/dist/transport/index.d.ts +11 -10
  744. package/dist/transport/index.js +11 -10
  745. package/dist/transport/index.js.map +1 -1
  746. package/dist/transport/{make-fixl-session.d.ts → make-fix-session.d.ts} +0 -0
  747. package/dist/transport/make-fix-session.js +3 -0
  748. package/dist/transport/make-fix-session.js.map +1 -0
  749. package/dist/transport/msg-application.d.ts +12 -0
  750. package/dist/transport/msg-application.js +3 -0
  751. package/dist/transport/msg-application.js.map +1 -0
  752. package/dist/transport/msg-transmitter.d.ts +5 -5
  753. package/dist/transport/msg-transmitter.js +2 -3
  754. package/dist/transport/msg-transmitter.js.map +1 -1
  755. package/dist/transport/session/a-session-msg-factory.d.ts +23 -0
  756. package/dist/transport/session/a-session-msg-factory.js +58 -0
  757. package/dist/transport/session/a-session-msg-factory.js.map +1 -0
  758. package/dist/transport/session/fix-session-state-args.d.ts +8 -0
  759. package/dist/transport/session/fix-session-state-args.js +3 -0
  760. package/dist/transport/session/fix-session-state-args.js.map +1 -0
  761. package/dist/transport/session/fix-session-state.d.ts +32 -0
  762. package/dist/transport/session/fix-session-state.js +133 -0
  763. package/dist/transport/session/fix-session-state.js.map +1 -0
  764. package/dist/transport/session/fix-session.d.ts +50 -0
  765. package/dist/transport/session/fix-session.js +291 -0
  766. package/dist/transport/session/fix-session.js.map +1 -0
  767. package/dist/transport/session/make-fix-session.d.ts +5 -0
  768. package/dist/transport/session/make-fix-session.js +3 -0
  769. package/dist/transport/session/make-fix-session.js.map +1 -0
  770. package/dist/transport/session/session-description.d.ts +17 -0
  771. package/dist/transport/session/session-description.js +3 -0
  772. package/dist/transport/session/session-description.js.map +1 -0
  773. package/dist/transport/session/session-msg-factory.d.ts +15 -0
  774. package/dist/transport/session/session-msg-factory.js +3 -0
  775. package/dist/transport/session/session-msg-factory.js.map +1 -0
  776. package/dist/transport/session/session-state.d.ts +25 -0
  777. package/dist/transport/session/session-state.js +30 -0
  778. package/dist/transport/session/session-state.js.map +1 -0
  779. package/dist/transport/session-description.d.ts +1 -48
  780. package/dist/transport/session-description.js.map +1 -1
  781. package/dist/transport/session-msg-factory.d.ts +7 -20
  782. package/dist/transport/session-msg-factory.js +0 -150
  783. package/dist/transport/session-msg-factory.js.map +1 -1
  784. package/dist/transport/session-state.d.ts +25 -0
  785. package/dist/transport/session-state.js +30 -0
  786. package/dist/transport/session-state.js.map +1 -0
  787. package/dist/transport/tcp/index.d.ts +3 -2
  788. package/dist/transport/tcp/index.js +3 -2
  789. package/dist/transport/tcp/index.js.map +1 -1
  790. package/dist/transport/tcp/recovering-tcp-initiator.d.ts +7 -9
  791. package/dist/transport/tcp/recovering-tcp-initiator.js +41 -16
  792. package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -1
  793. package/dist/transport/tcp/tcp-acceptor-listener.d.ts +7 -0
  794. package/dist/transport/tcp/tcp-acceptor-listener.js +70 -0
  795. package/dist/transport/tcp/tcp-acceptor-listener.js.map +1 -0
  796. package/dist/transport/tcp/tcp-acceptor.d.ts +7 -0
  797. package/dist/transport/tcp/tcp-acceptor.js +79 -43
  798. package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
  799. package/dist/transport/tcp/tcp-initiator-connector.d.ts +10 -0
  800. package/dist/transport/tcp/tcp-initiator-connector.js +97 -0
  801. package/dist/transport/tcp/tcp-initiator-connector.js.map +1 -0
  802. package/dist/transport/tcp/tcp-initiator.d.ts +4 -2
  803. package/dist/transport/tcp/tcp-initiator.js +82 -36
  804. package/dist/transport/tcp/tcp-initiator.js.map +1 -1
  805. package/dist/transport/tcp/tcp-transport-description.d.ts +6 -0
  806. package/dist/transport/tcp/tcp-transport-description.js +3 -0
  807. package/dist/transport/tcp/tcp-transport-description.js.map +1 -0
  808. package/dist/transport/tcp/tls-options-factory.d.ts +9 -0
  809. package/dist/transport/tcp/tls-options-factory.js +53 -0
  810. package/dist/transport/tcp/tls-options-factory.js.map +1 -0
  811. package/dist/transport/tcp/tls-options.d.ts +10 -5
  812. package/dist/transport/tcp/tls-options.js +0 -49
  813. package/dist/transport/tcp/tls-options.js.map +1 -1
  814. package/dist/transport/tick-action.d.ts +8 -0
  815. package/dist/transport/tick-action.js +13 -0
  816. package/dist/transport/tick-action.js.map +1 -0
  817. package/dist/types/FIX4.4/repo/enum/all-enum.js.map +1 -1
  818. package/dist/util/buffer-helper.js +1 -1
  819. package/dist/util/buffer-helper.js.map +1 -1
  820. package/dist/util/definition-factory.d.ts +10 -0
  821. package/dist/util/definition-factory.js +56 -0
  822. package/dist/util/definition-factory.js.map +1 -0
  823. package/dist/util/dictionary-path.d.ts +4 -0
  824. package/dist/util/dictionary-path.js +3 -0
  825. package/dist/util/dictionary-path.js.map +1 -0
  826. package/dist/util/index.d.ts +1 -1
  827. package/dist/util/index.js +1 -1
  828. package/dist/util/index.js.map +1 -1
  829. package/dist/util/json-helper.d.ts +3 -1
  830. package/dist/util/json-helper.js +13 -12
  831. package/dist/util/json-helper.js.map +1 -1
  832. package/dist/util/message-generator.d.ts +1 -1
  833. package/dist/util/message-generator.js +16 -15
  834. package/dist/util/message-generator.js.map +1 -1
  835. package/dist/util/replay.d.ts +6 -3
  836. package/dist/util/replay.js +24 -26
  837. package/dist/util/replay.js.map +1 -1
  838. package/package.json +27 -20
  839. package/script/build.cmd +1 -0
  840. package/script/build.sh +2 -0
  841. package/script/genkey.ps1 +179 -179
  842. package/script/test.cmd +3 -0
  843. package/src/buffer/{ascii-chars.ts → ascii/ascii-chars.ts} +0 -0
  844. package/src/buffer/ascii/ascii-encoder.ts +80 -38
  845. package/src/buffer/ascii/ascii-parser-state.ts +7 -12
  846. package/src/buffer/ascii/ascii-parser.ts +23 -16
  847. package/src/buffer/ascii/ascii-segment-parser.ts +14 -8
  848. package/src/buffer/ascii/ascii-view.ts +4 -9
  849. package/src/buffer/ascii/index.ts +1 -0
  850. package/src/buffer/ascii/parse-state.ts +8 -0
  851. package/src/buffer/ascii/time-formatter.ts +3 -3
  852. package/src/buffer/elastic-buffer.ts +7 -2
  853. package/src/buffer/encode-proxy.ts +10 -5
  854. package/src/buffer/fixml/fixml-encoder.ts +15 -11
  855. package/src/buffer/fixml/fixml-parser.ts +16 -6
  856. package/src/buffer/fixml/fixml-view.ts +4 -4
  857. package/src/buffer/fixml/populated-attributes.ts +6 -0
  858. package/src/buffer/index.ts +4 -8
  859. package/src/buffer/msg-encoder.ts +2 -1
  860. package/src/buffer/msg-view.ts +13 -6
  861. package/src/buffer/{segment-description.ts → segment/segment-description.ts} +4 -11
  862. package/src/buffer/{segment-summary.ts → segment/segment-summary.ts} +0 -0
  863. package/src/buffer/segment/segment-type.ts +8 -0
  864. package/src/buffer/structure.ts +3 -3
  865. package/src/buffer/{tag-pos.ts → tag/tag-pos.ts} +0 -0
  866. package/src/buffer/tag/tag-type.ts +13 -0
  867. package/src/buffer/{tags.ts → tag/tags.ts} +4 -16
  868. package/src/config/get-js-fx-logger.ts +4 -0
  869. package/src/config/index.ts +1 -0
  870. package/src/config/js-fix-config.ts +5 -2
  871. package/src/config/js-fix-logger.ts +0 -3
  872. package/src/dictionary/compiler/compiler-type.ts +3 -3
  873. package/src/dictionary/compiler/enum-compiler.ts +12 -1
  874. package/src/dictionary/compiler/msg-compiler.ts +8 -7
  875. package/src/dictionary/contained/contained-component-field.ts +2 -1
  876. package/src/dictionary/contained/contained-field-dispatch.ts +3 -7
  877. package/src/dictionary/contained/contained-field-dispatcher.ts +9 -0
  878. package/src/dictionary/contained/contained-field-set.ts +5 -3
  879. package/src/dictionary/contained/contained-field-type.ts +5 -0
  880. package/src/dictionary/contained/contained-field.ts +1 -6
  881. package/src/dictionary/contained/contained-group-field.ts +2 -1
  882. package/src/dictionary/contained/contained-simple-field.ts +2 -1
  883. package/src/dictionary/contained/field-dispatcher.ts +9 -0
  884. package/src/dictionary/contained/fields-dispatch.ts +46 -0
  885. package/src/dictionary/contained/index.ts +2 -0
  886. package/src/dictionary/contained-set-type.ts +5 -0
  887. package/src/dictionary/definition/component-field-definition.ts +1 -1
  888. package/src/dictionary/definition/fix-definitions.ts +2 -1
  889. package/src/dictionary/definition/group-field-definition.ts +1 -1
  890. package/src/dictionary/definition/index.ts +0 -1
  891. package/src/dictionary/definition/message-definition.ts +1 -1
  892. package/src/dictionary/definition/simple-field-definition.ts +3 -1
  893. package/src/dictionary/dict-primitive.ts +0 -13
  894. package/src/dictionary/fix-definition-source.ts +6 -0
  895. package/src/dictionary/fix-versions.ts +0 -32
  896. package/src/dictionary/index.ts +1 -5
  897. package/src/dictionary/parser/fix-repository/abbreviations-parser.ts +2 -3
  898. package/src/dictionary/parser/fix-repository/base-parser.ts +2 -3
  899. package/src/dictionary/parser/fix-repository/components-parser.ts +2 -3
  900. package/src/dictionary/parser/fix-repository/data-types-parser.ts +2 -3
  901. package/src/dictionary/parser/fix-repository/enums-parser.ts +2 -3
  902. package/src/dictionary/parser/fix-repository/fields-parser.ts +2 -3
  903. package/src/dictionary/parser/fix-repository/messages-parser.ts +2 -3
  904. package/src/dictionary/parser/fix-repository/msg-contents-parser.ts +2 -3
  905. package/src/dictionary/parser/fix-repository/repository-abbreviation.ts +6 -0
  906. package/src/dictionary/parser/fix-repository/repository-component.ts +11 -0
  907. package/src/dictionary/parser/fix-repository/repository-data-type.ts +7 -0
  908. package/src/dictionary/parser/fix-repository/repository-enum.ts +8 -0
  909. package/src/dictionary/parser/fix-repository/repository-field.ts +12 -0
  910. package/src/dictionary/parser/fix-repository/repository-message.ts +12 -0
  911. package/src/dictionary/parser/fix-repository/repository-msg-content.ts +10 -0
  912. package/src/dictionary/parser/fix-repository/repository-type.ts +0 -59
  913. package/src/dictionary/parser/fix-repository/repository-xml-parser.ts +10 -9
  914. package/src/dictionary/parser/fix-repository/repository.ts +69 -38
  915. package/src/dictionary/parser/fixml/components-parser.ts +6 -3
  916. package/src/dictionary/parser/fixml/fields-parser.ts +1 -1
  917. package/src/dictionary/parser/fixml/fix-xsd-parser.ts +2 -1
  918. package/src/dictionary/parser/fixml/include-graph.ts +2 -1
  919. package/src/dictionary/parser/fixml/xsd-parser.ts +2 -1
  920. package/src/dictionary/parser/quickfix/field-definition-parser.ts +4 -5
  921. package/src/dictionary/parser/quickfix/field-set-parser.ts +4 -5
  922. package/src/dictionary/parser/quickfix/message-parser.ts +4 -5
  923. package/src/dictionary/parser/quickfix/node-parser.ts +3 -6
  924. package/src/dictionary/parser/quickfix/parse-state.ts +8 -0
  925. package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +9 -15
  926. package/src/dictionary/sax-node.ts +7 -0
  927. package/src/dictionary/set-reduce.ts +30 -31
  928. package/src/dictionary/type-dispatcher.ts +7 -0
  929. package/src/dictionary/version-util.ts +25 -0
  930. package/src/index.ts +1 -0
  931. package/src/jsfix-cmd.ts +31 -16
  932. package/src/runtime/di-tokens.ts +48 -0
  933. package/src/runtime/engine-factory.ts +5 -0
  934. package/src/runtime/index.ts +5 -0
  935. package/src/runtime/make-config.ts +35 -0
  936. package/src/runtime/session-container.ts +180 -0
  937. package/src/runtime/session-launcher.ts +127 -0
  938. package/src/sample/http/oms/app.ts +20 -12
  939. package/src/sample/http/oms/http-client.ts +5 -2
  940. package/src/sample/http/oms/http-server.ts +5 -1
  941. package/src/sample/tcp/qf-md/app.ts +12 -12
  942. package/src/sample/tcp/qf-md/md-client.ts +4 -1
  943. package/src/sample/tcp/qf-md/md-server.ts +3 -1
  944. package/src/sample/tcp/recovering-skeleton/app.ts +37 -15
  945. package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +16 -9
  946. package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +4 -2
  947. package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +4 -2
  948. package/src/sample/tcp/skeleton/app.ts +10 -15
  949. package/src/sample/tcp/skeleton/skeleton-session.ts +29 -3
  950. package/src/sample/tcp/tls-trade-capture/app.ts +8 -31
  951. package/src/sample/tcp/trade-capture/app-launcher.ts +22 -0
  952. package/src/sample/tcp/trade-capture/app.ts +3 -26
  953. package/src/sample/tcp/trade-capture/trade-capture-client.ts +10 -4
  954. package/src/sample/tcp/trade-capture/trade-capture-server.ts +2 -1
  955. package/src/sample/tcp/trade-capture/trade-factory.ts +7 -1
  956. package/src/store/fix-msg-ascii-store-resend.ts +38 -26
  957. package/src/store/fix-msg-memory-store.ts +105 -42
  958. package/src/store/fix-msg-store-record.ts +11 -0
  959. package/src/store/fix-msg-store-state.ts +6 -0
  960. package/src/store/fix-msg-store.ts +8 -13
  961. package/src/transport/ascii/ascii-msg-transmitter.ts +23 -13
  962. package/src/transport/ascii/ascii-session-msg-factory.ts +62 -0
  963. package/src/transport/ascii/ascii-session.ts +102 -34
  964. package/src/transport/ascii/index.ts +1 -1
  965. package/src/transport/duplex/http-duplex.ts +3 -3
  966. package/src/transport/duplex/tcp-duplex.ts +4 -1
  967. package/src/transport/factory/index.ts +1 -0
  968. package/src/transport/factory/msg-transport.ts +55 -0
  969. package/src/transport/fix-acceptor.ts +2 -2
  970. package/src/transport/fix-entity.ts +9 -0
  971. package/src/transport/fix-initiator.ts +2 -2
  972. package/src/transport/fixml/fixml-msg-transmitter.ts +8 -4
  973. package/src/transport/fixml/fixml-session-msg-factory.ts +76 -0
  974. package/src/transport/fixml/fixml-session.ts +2 -2
  975. package/src/transport/fixml/index.ts +1 -2
  976. package/src/transport/http/html-options.ts +8 -0
  977. package/src/transport/http/html-route.ts +6 -0
  978. package/src/transport/http/http-acceptor-listener.ts +42 -0
  979. package/src/transport/http/http-acceptor.ts +12 -8
  980. package/src/transport/http/http-adapter.ts +7 -0
  981. package/src/transport/http/http-initiator.ts +40 -25
  982. package/src/transport/http/http-json-sample-adapter.ts +7 -2
  983. package/src/transport/http/http-transaction.ts +1 -1
  984. package/src/transport/http/http-transport-description.ts +9 -0
  985. package/src/transport/http/index.ts +1 -0
  986. package/src/transport/index.ts +11 -10
  987. package/src/transport/msg-application.ts +13 -0
  988. package/src/transport/msg-transmitter.ts +5 -5
  989. package/src/transport/session/a-session-msg-factory.ts +81 -0
  990. package/src/transport/session/fix-session-state-args.ts +9 -0
  991. package/src/transport/{fix-session-state.ts → session/fix-session-state.ts} +23 -43
  992. package/src/transport/{fix-session.ts → session/fix-session.ts} +111 -46
  993. package/src/transport/{make-fixl-session.ts → session/make-fix-session.ts} +1 -1
  994. package/src/transport/session/session-description.ts +18 -0
  995. package/src/transport/{fix-msg-factory.ts → session/session-msg-factory.ts} +2 -2
  996. package/src/transport/session/session-state.ts +25 -0
  997. package/src/transport/tcp/index.ts +3 -2
  998. package/src/transport/tcp/recovering-tcp-initiator.ts +24 -13
  999. package/src/transport/tcp/tcp-acceptor-listener.ts +45 -0
  1000. package/src/transport/tcp/tcp-acceptor.ts +65 -40
  1001. package/src/transport/tcp/tcp-initiator-connector.ts +71 -0
  1002. package/src/transport/tcp/tcp-initiator.ts +71 -42
  1003. package/src/transport/tcp/tcp-transport-description.ts +7 -0
  1004. package/src/transport/tcp/tls-options-factory.ts +55 -0
  1005. package/src/transport/tcp/tls-options.ts +9 -51
  1006. package/src/transport/tick-action.ts +8 -0
  1007. package/src/types/FIX4.4/repo/enum/all-enum.ts +0 -1
  1008. package/src/util/definition-factory.ts +47 -0
  1009. package/src/util/dictionary-path.ts +4 -0
  1010. package/src/util/index.ts +1 -1
  1011. package/src/util/json-helper.ts +14 -4
  1012. package/src/util/message-generator.ts +6 -3
  1013. package/src/util/replay.ts +26 -21
  1014. package/tsconfig.json +2 -0
  1015. package/dist/buffer/ascii-chars.js.map +0 -1
  1016. package/dist/dictionary/fields-dispatch.js +0 -40
  1017. package/dist/dictionary/fields-dispatch.js.map +0 -1
  1018. package/dist/header.d.ts +0 -31
  1019. package/dist/header.js.map +0 -1
  1020. package/dist/hop.d.ts +0 -4
  1021. package/dist/hop.js.map +0 -1
  1022. package/dist/hop_no_hops.d.ts +0 -5
  1023. package/dist/hop_no_hops.js.map +0 -1
  1024. package/dist/sample/http/oms/jsfix.test_http-client.txt +0 -170
  1025. package/dist/sample/http/oms/jsfix.test_http-server.txt +0 -170
  1026. package/dist/sample/tcp/qf-md/jsfix.test_client.txt +0 -18
  1027. package/dist/sample/tcp/qf-md/jsfix.test_server.txt +0 -17
  1028. package/dist/sample/tcp/recovering-skeleton/jsfix.test_client.txt +0 -96
  1029. package/dist/sample/tcp/recovering-skeleton/jsfix.test_server.txt +0 -93
  1030. package/dist/sample/tcp/recovering-skeleton/skeleton-session.d.ts +0 -17
  1031. package/dist/sample/tcp/recovering-skeleton/skeleton-session.js +0 -70
  1032. package/dist/sample/tcp/recovering-skeleton/skeleton-session.js.map +0 -1
  1033. package/dist/sample/tcp/skeleton/jsfix.test_client.txt +0 -6
  1034. package/dist/sample/tcp/skeleton/jsfix.test_server.txt +0 -6
  1035. package/dist/sample/tcp/tls-trade-capture/jsfix.test_client.txt +0 -1871
  1036. package/dist/sample/tcp/tls-trade-capture/jsfix.test_server.txt +0 -3059
  1037. package/dist/sample/tcp/trade_capture/app.d.ts +0 -1
  1038. package/dist/sample/tcp/trade_capture/app.js +0 -24
  1039. package/dist/sample/tcp/trade_capture/app.js.map +0 -1
  1040. package/dist/sample/tcp/trade_capture/index.d.ts +0 -2
  1041. package/dist/sample/tcp/trade_capture/index.js.map +0 -1
  1042. package/dist/sample/tcp/trade_capture/jsfix.test_client.txt +0 -193
  1043. package/dist/sample/tcp/trade_capture/jsfix.test_server.txt +0 -193
  1044. package/dist/sample/tcp/trade_capture/trade-capture-client.d.ts +0 -16
  1045. package/dist/sample/tcp/trade_capture/trade-capture-client.js +0 -57
  1046. package/dist/sample/tcp/trade_capture/trade-capture-client.js.map +0 -1
  1047. package/dist/sample/tcp/trade_capture/trade-capture-server.d.ts +0 -18
  1048. package/dist/sample/tcp/trade_capture/trade-capture-server.js +0 -72
  1049. package/dist/sample/tcp/trade_capture/trade-capture-server.js.map +0 -1
  1050. package/dist/sample/tcp/trade_capture/trade-factory.d.ts +0 -11
  1051. package/dist/sample/tcp/trade_capture/trade-factory.js +0 -81
  1052. package/dist/sample/tcp/trade_capture/trade-factory.js.map +0 -1
  1053. package/dist/standard_header.d.ts +0 -31
  1054. package/dist/standard_header.js.map +0 -1
  1055. package/dist/standard_trailer.d.ts +0 -6
  1056. package/dist/standard_trailer.js +0 -3
  1057. package/dist/standard_trailer.js.map +0 -1
  1058. package/dist/store/fix-msg-ascii-store-recovery.d.ts +0 -12
  1059. package/dist/store/fix-msg-ascii-store-recovery.js +0 -60
  1060. package/dist/store/fix-msg-ascii-store-recovery.js.map +0 -1
  1061. package/dist/store/fix-resend-record.d.ts +0 -12
  1062. package/dist/store/fix-resend-record.js +0 -12
  1063. package/dist/store/fix-resend-record.js.map +0 -1
  1064. package/dist/test/ascii-encode.test.d.ts +0 -1
  1065. package/dist/test/ascii-encode.test.js.map +0 -1
  1066. package/dist/test/ascii-store-recovery.test.d.ts +0 -1
  1067. package/dist/test/ascii-store-recovery.test.js +0 -50
  1068. package/dist/test/ascii-store-recovery.test.js.map +0 -1
  1069. package/dist/test/memory-store-test.d.ts +0 -1
  1070. package/dist/test/memory-store-test.js.map +0 -1
  1071. package/dist/trailer.d.ts +0 -6
  1072. package/dist/trailer.js.map +0 -1
  1073. package/dist/transport/fixml/acceptor.d.ts +0 -3
  1074. package/dist/transport/fixml/acceptor.js +0 -38
  1075. package/dist/transport/fixml/acceptor.js.map +0 -1
  1076. package/dist/transport/make-config.d.ts +0 -4
  1077. package/dist/transport/make-config.js +0 -31
  1078. package/dist/transport/make-config.js.map +0 -1
  1079. package/dist/transport/make-fixl-session.js +0 -3
  1080. package/dist/transport/make-fixl-session.js.map +0 -1
  1081. package/dist/transport/msg-store.d.ts +0 -2
  1082. package/dist/transport/msg-store.js +0 -3
  1083. package/dist/transport/msg-store.js.map +0 -1
  1084. package/dist/transport/msg-transport.js +0 -57
  1085. package/dist/transport/msg-transport.js.map +0 -1
  1086. package/dist/transport/tcp/acceptor.d.ts +0 -3
  1087. package/dist/transport/tcp/acceptor.js +0 -40
  1088. package/dist/transport/tcp/acceptor.js.map +0 -1
  1089. package/dist/transport/tcp/initiator.d.ts +0 -3
  1090. package/dist/transport/tcp/initiator.js +0 -67
  1091. package/dist/transport/tcp/initiator.js.map +0 -1
  1092. package/dist/transport/tcp/recovering-initiator.d.ts +0 -17
  1093. package/dist/transport/tcp/recovering-initiator.js +0 -30
  1094. package/dist/transport/tcp/recovering-initiator.js.map +0 -1
  1095. package/dist/transport/tcp/recovering_initiator.d.ts +0 -12
  1096. package/dist/transport/tcp/recovering_initiator.js +0 -25
  1097. package/dist/transport/tcp/recovering_initiator.js.map +0 -1
  1098. package/dist/types/FIX4.4/quickfix/set/header.d.ts +0 -31
  1099. package/dist/types/FIX4.4/quickfix/set/header.js +0 -3
  1100. package/dist/types/FIX4.4/quickfix/set/header.js.map +0 -1
  1101. package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +0 -6
  1102. package/dist/types/FIX4.4/quickfix/set/trailer.js +0 -3
  1103. package/dist/types/FIX4.4/quickfix/set/trailer.js.map +0 -1
  1104. package/dist/util/dictionary-definitions.d.ts +0 -8
  1105. package/dist/util/dictionary-definitions.js +0 -51
  1106. package/dist/util/dictionary-definitions.js.map +0 -1
  1107. package/src/dictionary/fields-dispatch.ts +0 -45
  1108. package/src/sample/launcher.ts +0 -46
  1109. package/src/transport/fixml/acceptor.ts +0 -29
  1110. package/src/transport/make-config.ts +0 -19
  1111. package/src/transport/msg-transport.ts +0 -67
  1112. package/src/transport/session-description.ts +0 -70
  1113. package/src/transport/session-msg-factory.ts +0 -195
  1114. package/src/transport/tcp/acceptor.ts +0 -31
  1115. package/src/transport/tcp/initiator.ts +0 -59
  1116. package/src/util/dictionary-definitions.ts +0 -41
@@ -1 +1 @@
1
- {"version":3,"file":"dict-parser.js","sourceRoot":"","sources":["../src/dict-parser.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,iCAA+E;AAC/E,qCAA2H;AAE3H,2CAAgG;AAChG,6CAA2F;AAC3F,mCAAiC;AACjC,qCAA6E;AAC7E,kDAAiD;AACjD,mDAAiF;AAEjF,SAAe,gBAAgB;;QAC7B,MAAM,OAAO,GAAW,GAAG,CAAA;QAC3B,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAChD,MAAM,kBAAkB,GAAwB,OAAO,CAAC,qCAAqC,CAAC,CAAA;QAC9F,MAAM,WAAW,GAAG,MAAM,qBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;QACpG,MAAM,EAAE,GAAe,IAAI,iBAAU,CAAC,WAAW,CAAC,CAAA;QAClD,MAAM,GAAG,GAAiB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mEAAmE,CAAC,EAAE,OAAO,CAAC,CAAA;QACpI,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAU,CAAC,IAAI,CAAC,CAAA;QACtF,MAAM,OAAO,GAAwB,IAAI,+BAAmB,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D,UAAU,EAAE,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ILooseObject } from './collections/collection'\r\nimport { MessageGenerator, JsonHelper, getDefinitions, getWords } from './util'\r\nimport { AsciiChars, MsgView, MsgParser, ElasticBuffer, AsciiParser, AsciiView, FiXmlParser, FixmlEncoder } from './buffer'\r\nimport { ReadStream } from 'fs'\r\nimport { ISessionDescription, AsciiMsgTransmitter, StringDuplex, MsgPayload } from './transport'\r\nimport { EnumCompiler, MsgCompiler, ICompilerSettings, FixDefinitions } from './dictionary'\r\nimport { MsgType } from './types'\r\nimport { JsFixWinstonLogFactory, JsFixConfig, WinstonLogger } from './config'\r\nimport * as requestPromise from 'request-promise'\r\nimport { BusinessRejectReason, IBusinessMessageReject } from './types/FIXML50SP2'\r\n\r\nasync function testEncodeDecode (): Promise<any> {\r\n const msgType: string = 'W'\r\n const root: string = path.join(__dirname, '../')\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const definitions = await getDefinitions(path.join(root, sessionDescription.application.dictionary))\r\n const jh: JsonHelper = new JsonHelper(definitions)\r\n const msg: ILooseObject = jh.fromJson(path.join(root, 'data/examples/FIXML/cme/tc/Initial Single Side Submission/fix.xml'), msgType)\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const session: AsciiMsgTransmitter = new AsciiMsgTransmitter(config)\r\n const payload: MsgPayload = new MsgPayload(msgType, msg)\r\n const encoderStream = session.encodeStream\r\n encoderStream.write(payload)\r\n session.encodeMessage(msgType, msg)\r\n const parser: MsgParser = new AsciiParser(definitions, encoderStream, AsciiChars.Pipe)\r\n const fix: string = session.buffer.toString()\r\n console.log(fix)\r\n return new Promise(async (resolve, reject) => {\r\n parser.on('msg', (msgType: string, view: AsciiView) => {\r\n resolve(view.toObject())\r\n })\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n })\r\n}\r\n\r\nasync function testGenerator (): Promise<any> {\r\n const root: string = path.join(__dirname, '../')\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const definitions = await getDefinitions('C:/Users/Stephen/dev/ts/jsfix/data/fix_repo/FIX.4.4/Base')\r\n const lipsum: string[] = await getWords(path.join(root, 'data/examples/lipsum.txt'))\r\n const generator: MessageGenerator = new MessageGenerator(lipsum, definitions)\r\n const msgType: string = MsgType.NewOrderSingle\r\n const example: ILooseObject = generator.generate(msgType)\r\n console.log(JSON.stringify(example, null, 4))\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const session: AsciiMsgTransmitter = new AsciiMsgTransmitter(config)\r\n session.encodeMessage(msgType, example)\r\n const fix: string = session.buffer.toString()\r\n const encoderStream = session.encodeStream\r\n const payload: MsgPayload = new MsgPayload(msgType, example)\r\n encoderStream.write(payload)\r\n const parser: MsgParser = new AsciiParser(definitions, encoderStream, AsciiChars.Pipe)\r\n parser.on('msg', (mt: string, view: MsgView) => {\r\n console.log(view.toString())\r\n })\r\n console.log(fix)\r\n}\r\n\r\n/*\r\nfix.xml\r\nClearing System Confirms Allocation to Executing Firm.xml\r\nClearing System Confirms Allocation to CME Executing Firm_Cross-exchange.xml\r\nClearing System Confirms Completed Reversal to Executing Firm.xml\r\nClearing System Notifies Allocation to the Claiming Firm.xml\r\nfix.xml\r\nClearing System Notifies Claiming Firm of Completed Reversal.xml\r\nClearing System Notifies Executing Firm of Alleged Reversal.xml\r\nExecuting Firm Un-completes Group-Average_Price.xml\r\nExecuting Firm Marks a Trade for Give-up.xml\r\n */\r\nasync function repository (): Promise<any> {\r\n const root: string = path.join(__dirname, '../')\r\n const definitions: FixDefinitions = await getDefinitions('repofixml')\r\n // cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange\r\n // const file: string = path.join(root,'data/examples/FIXML/cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n // const file: string = path.join(root,'data/examples/FIXML/cme/md/settle')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/')\r\n const file: string = path.join(root,'data/examples/FIXML/cme/tc/Delivery Fixed Commodity Swap/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Trading Firm Continued Subscription')\r\n // const file: string = path.join(root,'data/examples/FIXML/cme/md/futures')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Delivery Fixed Commodity Swap')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Initial Single Side Submission/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Accepted Unmatched')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Trading Firm Continued Subscription/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/om/nso/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/om/er/')\r\n const so = definitions.message.get('ExecutionReport')\r\n const t855 = definitions.simple.get('SecondaryTrdType')\r\n\r\n const reject = {\r\n Text: `no response`,\r\n BusinessRejectReason: BusinessRejectReason.ApplicationNotAvailable\r\n } as IBusinessMessageReject\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(reject, 'BusinessMessageReject')\r\n const fixml: string = fe.buffer.toString()\r\n // console.log(fixml)\r\n const jh: JsonHelper = new JsonHelper(definitions)\r\n const fs: any = require('fs')\r\n let readStream: ReadStream = fs.createReadStream(`${file}/fix.xml`)\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const xmlParser: MsgParser = new FiXmlParser(config, readStream)\r\n xmlParser.on('batch', (msgType: string, v: MsgView) => {\r\n console.log(`received message ${msgType}`)\r\n const o: ILooseObject = v.toObject()\r\n console.log(JSON.stringify(o, null, 4))\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(o, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n console.log(fixml)\r\n console.log(v.toString())\r\n })\r\n xmlParser.on('msg', (msgType: string, v: MsgView) => {\r\n console.log(`received message ${msgType}`)\r\n const o: ILooseObject = v.toObject()\r\n console.log(JSON.stringify(o, null, 4))\r\n console.log(v.toString())\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(o, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n console.log(fixml)\r\n })\r\n}\r\n\r\nasync function runTest (): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n try {\r\n const res: any = await testGenerator()\r\n accept(res)\r\n } catch (e) {\r\n console.log(e.message)\r\n reject(e)\r\n }\r\n })\r\n}\r\n\r\nfunction streamExample () {\r\n const fs: any = require('fs')\r\n const root: string = path.join(__dirname, '../')\r\n const file: string = path.join(root,'data/examples/FIXML/cme/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n let readStream: ReadStream = fs.createReadStream(`${file}/fix.xml`)\r\n const Writable = require('stream').Writable\r\n const receiver = new Writable({\r\n write: (data: Buffer, _: any, done: Function) => {\r\n console.log('receive ' + data)\r\n done()\r\n }\r\n })\r\n readStream.pipe(receiver).on('finish', () => {\r\n console.log('done')\r\n })\r\n}\r\n\r\nasync function compileDefinitions (definitionPath: string, outputPath: string) {\r\n const definitions = await getDefinitions(definitionPath)\r\n const compilerSettings: ICompilerSettings = require('../data/compiler.json')\r\n compilerSettings.output = outputPath\r\n const msgCompiler: MsgCompiler = new MsgCompiler(definitions, compilerSettings)\r\n await msgCompiler.generate()\r\n const enumCompiler: EnumCompiler = new EnumCompiler(definitions, compilerSettings)\r\n const writeFile = path.join(compilerSettings.output, './enum/all-enum.ts')\r\n await enumCompiler.generate(writeFile)\r\n\r\n const writeFileTypes = path.join(compilerSettings.output, './enum/msg-type.ts')\r\n await enumCompiler.generate(writeFile)\r\n}\r\n\r\nasync function compiler () {\r\n // 'C:/Users/Stephen/dev/js/jsfix/data/fix_repo/fixmlschema_FIX.5.0SP2_EP228'\r\n // await compileDefinitions('data/fix_repo/FIX.4.4/Base', 'C:/Users/Stephen/dev/ts/jsfix/src/types/FIX4.4/repo')\r\n // await compileDefinitions('data/FIX44.xml', 'C:/Users/Stephen/dev/ts/jsfix/src/types/FIX4.4/quickfix')\r\n await compileDefinitions('data/fix_repo/fixmlschema_FIX.5.0SP2_EP228', 'C:/Users/Stephen/dev/ts/jsfix/src/types/FIXML50SP2')\r\n}\r\n\r\nasync function generateMessage () {\r\n await testGenerator()\r\n}\r\n\r\nasync function decode (): Promise<any> {\r\n const definitions: FixDefinitions = await getDefinitions('data/fix_repo/FIX.4.4/Base')\r\n const txt = '8=FIX4.4|9=0001022|35=AE|49=init-comp|56=accept-comp|34=1|57=fix|52=20180909-14:22:09.841|571=Lorem|487=23513|856=1|568=ipsum|828=6|855=23619|830=dolor|150=F|748=17140|912=N|325=N|263=1|881=sit|818=amet,|820=consectetur|880=adipiscing|17=elit.|39=3|527=Nunc|570=N|423=8|55=odio|65=orci,|48=blandit|22=3|460=4|461=vel|167=MPT|762=semper|200=sed,|541=20180909|201=0|224=20180909|225=20180909|227=-8796.1|228=-23.537|255=bibendum|543=cursus|470=lectus.|471=Aenean|472=vel|240=20180909|202=891.7|947=-2928.1|231=5.7237|223=-1894.1|106=diam|348=9|349=6YYz0zu5s|350=8|351=TuH3tTNd|691=magna.|667=Aenean|875=99|876=et|873=20180909|874=20180909|913=viverra|914=leo,|915=20180909|916=20180909|919=0|898=0.5594|38=96682|152=19226|516=9.1251|854=0|235=PREVCLOSE|236=-2833.5|701=20180909|696=20180909|697=-6.095|698=26303|823=non|32=9253|31=2065.4|194=-73.233|30=iaculis|75=20180909|715=20180909|6=5.9279|218=0.0001953|221=neque.|222=Nullam|663=16216|699=arcu|761=lectus,|824=dignissim|63=3|64=20180909|573=0|574=M3|797=Y|852=Y|853=3|10=16|'\r\n const startsAt: Date = new Date()\r\n let i = 0\r\n const repeats = 1\r\n const asciiParser: MsgParser = new AsciiParser(definitions, new StringDuplex(txt.repeat(repeats)).readable, AsciiChars.Pipe)\r\n asciiParser.on('msg', (msgType: string, v: MsgView) => {\r\n ++i\r\n console.log(v.toJson())\r\n if (i === repeats) {\r\n const elapsed: number = new Date().getTime() - startsAt.getTime()\r\n console.log(`elapsed ms ${elapsed} ${(elapsed / repeats) * 1000} micros per msg`)\r\n }\r\n })\r\n}\r\n\r\nasync function http (): Promise<any> {\r\n const sessionDescription: ISessionDescription = require('../data/session/test-http-acceptor.json')\r\n const definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n const logFactory = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions('info'))\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe, logFactory)\r\n // const acceptor = acceptor(config)\r\n const xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' +\r\n '<FIXML v=\"5.0 SP2\" s=\"20090815\" xv=\"109\" cv=\"CME.0001\">\\n' +\r\n ' <UserReq UserReqID=\"123456\" UserReqTyp=\"1\" Username=\"user123\" Password=\"User!Pass5\">\\n' +\r\n ' <Hdr SID=\"BRKR\" SSub=\"user123\" TID=\"CME\" TSub=\"CPAPI\"/>\\n' +\r\n ' </UserReq>\\n' +\r\n '</FIXML>'\r\n // acceptor.listen()\r\n requestPromise({\r\n method: 'POST',\r\n uri: 'http://localhost:2343/session',\r\n body: {\r\n fixml : xml\r\n },\r\n json: true // Automatically stringifies the body to JSON\r\n }).then(function (parsedBody) {\r\n console.log(parsedBody)\r\n // POST succeeded...\r\n })\r\n .catch((err: Error) => {\r\n console.log(err)\r\n // POST failed...\r\n })\r\n}\r\n\r\n// http()\r\n// decode()\r\n// generateMessage()\r\n// compiler()\r\n// stronglyTyped()\r\n// streamExample()\r\n// testEncodeDecode()\r\nrepository()\r\n// testEncodeDecode()\r\n// runTest();\r\n// testSocket()\r\n// testRead();\r\n"]}
1
+ {"version":3,"file":"dict-parser.js","sourceRoot":"","sources":["../src/dict-parser.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,iCAAkF;AAClF,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,EAAE,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ILooseObject } from './collections/collection'\r\nimport { MessageGenerator, JsonHelper, getWords, DefinitionFactory } from './util'\r\nimport { MsgView, MsgParser, ElasticBuffer } from './buffer'\r\nimport { AsciiChars, AsciiParser, AsciiView } from './buffer/ascii'\r\nimport { FiXmlParser, FixmlEncoder } from './buffer/fixml'\r\nimport { ReadStream } from 'fs'\r\nimport { ISessionDescription, StringDuplex, MsgPayload } from './transport'\r\nimport { FixDefinitions } from './dictionary/definition'\r\nimport { MsgType } from './types'\r\nimport { JsFixWinstonLogFactory, JsFixConfig, WinstonLogger } from './config'\r\nimport { BusinessRejectReason, IBusinessMessageReject } from './types/FIXML50SP2'\r\nimport * as rp from 'request-promise-native'\r\nimport { EnumCompiler, ICompilerSettings, MsgCompiler } from './dictionary/compiler'\r\nimport { AsciiMsgTransmitter } from './transport/ascii/ascii-msg-transmitter'\r\n\r\nasync function testEncodeDecode (): Promise<any> {\r\n const msgType: string = 'W'\r\n const root: string = path.join(__dirname, '../')\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const definitions = await new DefinitionFactory().getDefinitions(path.join(root, sessionDescription.application.dictionary))\r\n const jh: JsonHelper = new JsonHelper(definitions)\r\n const msg: ILooseObject = jh.fromJson(path.join(root, 'data/examples/FIXML/cme/tc/Initial Single Side Submission/fix.xml'), msgType)\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const session: AsciiMsgTransmitter = new AsciiMsgTransmitter(config)\r\n const payload: MsgPayload = new MsgPayload(msgType, msg)\r\n const encoderStream = session.encodeStream\r\n encoderStream.write(payload)\r\n session.encodeMessage(msgType, msg)\r\n const parser: MsgParser = new AsciiParser(config, encoderStream, new ElasticBuffer(160 * 1024))\r\n const fix: string = session.buffer.toString()\r\n console.log(fix)\r\n return new Promise(async (resolve, reject) => {\r\n parser.on('msg', (msgType: string, view: AsciiView) => {\r\n resolve(view.toObject())\r\n })\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n })\r\n}\r\n\r\nasync function testGenerator (): Promise<any> {\r\n const root: string = path.join(__dirname, '../')\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const definitions = await new DefinitionFactory().getDefinitions('C:/Users/Stephen/dev/ts/jsfix/data/fix_repo/FIX.4.4/Base')\r\n const lipsum: string[] = await getWords(path.join(root, 'data/examples/lipsum.txt'))\r\n const generator: MessageGenerator = new MessageGenerator(lipsum, definitions)\r\n const msgType: string = MsgType.NewOrderSingle\r\n const example: ILooseObject = generator.generate(msgType)\r\n console.log(JSON.stringify(example, null, 4))\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const session: AsciiMsgTransmitter = new AsciiMsgTransmitter(config)\r\n session.encodeMessage(msgType, example)\r\n const fix: string = session.buffer.toString()\r\n const encoderStream = session.encodeStream\r\n const payload: MsgPayload = new MsgPayload(msgType, example)\r\n encoderStream.write(payload)\r\n const parser: MsgParser = new AsciiParser(config, encoderStream, new ElasticBuffer(160 * 1024))\r\n parser.on('msg', (mt: string, view: MsgView) => {\r\n console.log(view.toString())\r\n })\r\n console.log(fix)\r\n}\r\n\r\n/*\r\nfix.xml\r\nClearing System Confirms Allocation to Executing Firm.xml\r\nClearing System Confirms Allocation to CME Executing Firm_Cross-exchange.xml\r\nClearing System Confirms Completed Reversal to Executing Firm.xml\r\nClearing System Notifies Allocation to the Claiming Firm.xml\r\nfix.xml\r\nClearing System Notifies Claiming Firm of Completed Reversal.xml\r\nClearing System Notifies Executing Firm of Alleged Reversal.xml\r\nExecuting Firm Un-completes Group-Average_Price.xml\r\nExecuting Firm Marks a Trade for Give-up.xml\r\n */\r\nasync function repository (): Promise<any> {\r\n const root: string = path.join(__dirname, '../')\r\n const definitions: FixDefinitions = await new DefinitionFactory().getDefinitions('repofixml')\r\n // cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange\r\n // const file: string = path.join(root,'data/examples/FIXML/cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n // const file: string = path.join(root,'data/examples/FIXML/cme/md/settle')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/')\r\n const file: string = path.join(root,'data/examples/FIXML/cme/tc/Delivery Fixed Commodity Swap/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Trading Firm Continued Subscription')\r\n // const file: string = path.join(root,'data/examples/FIXML/cme/md/futures')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Delivery Fixed Commodity Swap')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Initial Single Side Submission/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Accepted Unmatched')\r\n // const file: string = path.join(root, 'data/examples/FIXML/cme/tc/Trading Firm Continued Subscription/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/om/nso/')\r\n // const file: string = path.join(root, 'data/examples/FIXML/om/er/')\r\n const so = definitions.message.get('ExecutionReport')\r\n const t855 = definitions.simple.get('SecondaryTrdType')\r\n\r\n const reject = {\r\n Text: `no response`,\r\n BusinessRejectReason: BusinessRejectReason.ApplicationNotAvailable\r\n } as IBusinessMessageReject\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(reject, 'BusinessMessageReject')\r\n const fixml: string = fe.buffer.toString()\r\n // console.log(fixml)\r\n const jh: JsonHelper = new JsonHelper(definitions)\r\n const fs: any = require('fs')\r\n let readStream: ReadStream = fs.createReadStream(`${file}/fix.xml`)\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const xmlParser: MsgParser = new FiXmlParser(config, readStream)\r\n xmlParser.on('batch', (msgType: string, v: MsgView) => {\r\n console.log(`received message ${msgType}`)\r\n const o: ILooseObject = v.toObject()\r\n console.log(JSON.stringify(o, null, 4))\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(o, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n console.log(fixml)\r\n console.log(v.toString())\r\n })\r\n xmlParser.on('msg', (msgType: string, v: MsgView) => {\r\n console.log(`received message ${msgType}`)\r\n const o: ILooseObject = v.toObject()\r\n console.log(JSON.stringify(o, null, 4))\r\n console.log(v.toString())\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(o, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n console.log(fixml)\r\n })\r\n}\r\n\r\nasync function runTest (): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n try {\r\n const res: any = await testGenerator()\r\n accept(res)\r\n } catch (e) {\r\n console.log(e.message)\r\n reject(e)\r\n }\r\n })\r\n}\r\n\r\nfunction streamExample () {\r\n const fs: any = require('fs')\r\n const root: string = path.join(__dirname, '../')\r\n const file: string = path.join(root,'data/examples/FIXML/cme/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n let readStream: ReadStream = fs.createReadStream(`${file}/fix.xml`)\r\n const Writable = require('stream').Writable\r\n const receiver = new Writable({\r\n write: (data: Buffer, _: any, done: Function) => {\r\n console.log('receive ' + data)\r\n done()\r\n }\r\n })\r\n readStream.pipe(receiver).on('finish', () => {\r\n console.log('done')\r\n })\r\n}\r\n\r\nasync function compileDefinitions (definitionPath: string, outputPath: string) {\r\n const definitions = await new DefinitionFactory().getDefinitions(definitionPath)\r\n const compilerSettings: ICompilerSettings = require('../data/compiler.json')\r\n compilerSettings.output = outputPath\r\n const msgCompiler: MsgCompiler = new MsgCompiler(definitions, compilerSettings)\r\n await msgCompiler.generate()\r\n const enumCompiler: EnumCompiler = new EnumCompiler(definitions, compilerSettings)\r\n const writeFile = path.join(compilerSettings.output, './enum/all-enum.ts')\r\n await enumCompiler.generate(writeFile)\r\n\r\n const writeFileTypes = path.join(compilerSettings.output, './enum/msg-type.ts')\r\n await enumCompiler.generate(writeFile)\r\n}\r\n\r\nasync function compiler () {\r\n // 'C:/Users/Stephen/dev/js/jsfix/data/fix_repo/fixmlschema_FIX.5.0SP2_EP228'\r\n // await compileDefinitions('data/fix_repo/FIX.4.4/Base', 'C:/Users/Stephen/dev/ts/jsfix/src/types/FIX4.4/repo')\r\n // await compileDefinitions('data/FIX44.xml', 'C:/Users/Stephen/dev/ts/jsfix/src/types/FIX4.4/quickfix')\r\n await compileDefinitions('data/fix_repo/fixmlschema_FIX.5.0SP2_EP228', 'C:/Users/Stephen/dev/ts/jsfix/src/types/FIXML50SP2')\r\n}\r\n\r\nasync function generateMessage () {\r\n await testGenerator()\r\n}\r\n\r\nasync function decode (): Promise<any> {\r\n const definitions: FixDefinitions = await new DefinitionFactory().getDefinitions('data/fix_repo/FIX.4.4/Base')\r\n const txt = '8=FIX4.4|9=0001022|35=AE|49=init-comp|56=accept-comp|34=1|57=fix|52=20180909-14:22:09.841|571=Lorem|487=23513|856=1|568=ipsum|828=6|855=23619|830=dolor|150=F|748=17140|912=N|325=N|263=1|881=sit|818=amet,|820=consectetur|880=adipiscing|17=elit.|39=3|527=Nunc|570=N|423=8|55=odio|65=orci,|48=blandit|22=3|460=4|461=vel|167=MPT|762=semper|200=sed,|541=20180909|201=0|224=20180909|225=20180909|227=-8796.1|228=-23.537|255=bibendum|543=cursus|470=lectus.|471=Aenean|472=vel|240=20180909|202=891.7|947=-2928.1|231=5.7237|223=-1894.1|106=diam|348=9|349=6YYz0zu5s|350=8|351=TuH3tTNd|691=magna.|667=Aenean|875=99|876=et|873=20180909|874=20180909|913=viverra|914=leo,|915=20180909|916=20180909|919=0|898=0.5594|38=96682|152=19226|516=9.1251|854=0|235=PREVCLOSE|236=-2833.5|701=20180909|696=20180909|697=-6.095|698=26303|823=non|32=9253|31=2065.4|194=-73.233|30=iaculis|75=20180909|715=20180909|6=5.9279|218=0.0001953|221=neque.|222=Nullam|663=16216|699=arcu|761=lectus,|824=dignissim|63=3|64=20180909|573=0|574=M3|797=Y|852=Y|853=3|10=16|'\r\n const startsAt: Date = new Date()\r\n const sessionDescription: ISessionDescription = require('../data/session/test-initiator.json')\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n let i = 0\r\n const repeats = 1\r\n const asciiParser: MsgParser = new AsciiParser(config, new StringDuplex(txt.repeat(repeats)).readable, new ElasticBuffer(160 * 1024))\r\n asciiParser.on('msg', (msgType: string, v: MsgView) => {\r\n ++i\r\n console.log(v.toJson())\r\n if (i === repeats) {\r\n const elapsed: number = new Date().getTime() - startsAt.getTime()\r\n console.log(`elapsed ms ${elapsed} ${(elapsed / repeats) * 1000} micros per msg`)\r\n }\r\n })\r\n}\r\n\r\nasync function http (): Promise<any> {\r\n const sessionDescription: ISessionDescription = require('../data/session/test-http-acceptor.json')\r\n const definitions = await new DefinitionFactory().getDefinitions(sessionDescription.application.dictionary)\r\n const logFactory = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions('info'))\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe, logFactory)\r\n // const acceptor = acceptor(config)\r\n const xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' +\r\n '<FIXML v=\"5.0 SP2\" s=\"20090815\" xv=\"109\" cv=\"CME.0001\">\\n' +\r\n ' <UserReq UserReqID=\"123456\" UserReqTyp=\"1\" Username=\"user123\" Password=\"User!Pass5\">\\n' +\r\n ' <Hdr SID=\"BRKR\" SSub=\"user123\" TID=\"CME\" TSub=\"CPAPI\"/>\\n' +\r\n ' </UserReq>\\n' +\r\n '</FIXML>'\r\n // acceptor.listen()\r\n rp({\r\n method: 'POST',\r\n uri: 'http://localhost:2343/session',\r\n body: {\r\n fixml : xml\r\n },\r\n json: true // Automatically stringifies the body to JSON\r\n }).then(function (parsedBody) {\r\n console.log(parsedBody)\r\n // POST succeeded...\r\n })\r\n .catch((err: Error) => {\r\n console.log(err)\r\n // POST failed...\r\n })\r\n}\r\n\r\n// http()\r\n// decode()\r\n// generateMessage()\r\n// compiler()\r\n// stronglyTyped()\r\n// streamExample()\r\n// testEncodeDecode()\r\nrepository()\r\n// testEncodeDecode()\r\n// runTest();\r\n// testSocket()\r\n// testRead();\r\n"]}
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompilerType = void 0;
4
4
  const contained_1 = require("../contained");
5
- const fix_versions_1 = require("../fix-versions");
6
- const dict_primitive_1 = require("../dict-primitive");
7
5
  const _ = require("lodash");
6
+ const contained_set_type_1 = require("../contained-set-type");
7
+ const fix_definition_source_1 = require("../fix-definition-source");
8
8
  class CompilerType {
9
9
  constructor(definitions, set, qualifiedName) {
10
10
  this.definitions = definitions;
11
11
  this.set = set;
12
12
  this.qualifiedName = qualifiedName;
13
13
  const snake = _.snakeCase(this.qualifiedName);
14
- if (set.type === dict_primitive_1.ContainedSetType.Msg) {
14
+ if (set.type === contained_set_type_1.ContainedSetType.Msg) {
15
15
  this.snaked = `./${snake}`;
16
16
  }
17
17
  else {
@@ -23,10 +23,10 @@ class CompilerType {
23
23
  case contained_1.ContainedFieldType.Group: {
24
24
  const gf = field;
25
25
  switch (this.definitions.source) {
26
- case fix_versions_1.FixDefinitionSource.QuickFix: {
26
+ case fix_definition_source_1.FixDefinitionSource.QuickFix: {
27
27
  return this.qualifiedName + field.name;
28
28
  }
29
- case fix_versions_1.FixDefinitionSource.FixmlRepo: {
29
+ case fix_definition_source_1.FixDefinitionSource.FixmlRepo: {
30
30
  return gf.definition.name;
31
31
  }
32
32
  default: {
@@ -37,7 +37,7 @@ class CompilerType {
37
37
  case contained_1.ContainedFieldType.Component: {
38
38
  const cf = field;
39
39
  switch (this.definitions.source) {
40
- case fix_versions_1.FixDefinitionSource.FixmlRepo: {
40
+ case fix_definition_source_1.FixDefinitionSource.FixmlRepo: {
41
41
  return cf.definition.name;
42
42
  }
43
43
  default: {
@@ -54,7 +54,7 @@ class CompilerType {
54
54
  case contained_1.ContainedFieldType.Group: {
55
55
  const gf = field;
56
56
  switch (this.definitions.source) {
57
- case fix_versions_1.FixDefinitionSource.FixmlRepo: {
57
+ case fix_definition_source_1.FixDefinitionSource.FixmlRepo: {
58
58
  return gf.definition.name;
59
59
  }
60
60
  default: {
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-type.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/compiler-type.ts"],"names":[],"mappings":";;;AAAA,4CAAkI;AAElI,kDAAqD;AACrD,sDAAoD;AAEpD,4BAA4B;AAE5B,MAAa,YAAY;IAEvB,YAA6B,WAA2B,EAAkB,GAAsB,EAAkB,aAAqB;QAA1G,gBAAW,GAAX,WAAW,CAAgB;QAAkB,QAAG,GAAH,GAAG,CAAmB;QAAkB,kBAAa,GAAb,aAAa,CAAQ;QACrI,MAAM,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,iCAAgB,CAAC,GAAG,EAAE;YACrC,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,EAAE,CAAA;SAC3B;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,SAAS,KAAK,EAAE,CAAA;SAC/B;IACH,CAAC;IAEM,WAAW,CAAE,KAAqB;QACvC,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,8BAAkB,CAAC,KAAK,CAAC,CAAC;gBAC7B,MAAM,EAAE,GAAG,KAA4B,CAAA;gBACvC,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;oBAC/B,KAAK,kCAAmB,CAAC,QAAQ,CAAC,CAAC;wBACjC,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAA;qBACvC;oBAED,KAAK,kCAAmB,CAAC,SAAS,CAAC,CAAC;wBAClC,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAA;qBAC1B;oBACD,OAAO,CAAC,CAAC;wBACP,OAAO,KAAK,CAAC,IAAI,CAAA;qBAClB;iBACF;aACF;YAED,KAAK,8BAAkB,CAAC,SAAS,CAAC,CAAC;gBACjC,MAAM,EAAE,GAAG,KAAgC,CAAA;gBAC3C,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;oBAC/B,KAAK,kCAAmB,CAAC,SAAS,CAAC,CAAC;wBAClC,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAA;qBAC1B;oBACD,OAAO,CAAC,CAAC;wBACP,OAAO,KAAK,CAAC,IAAI,CAAA;qBAClB;iBACF;aACF;YAED;gBACE,OAAO,KAAK,CAAC,IAAI,CAAA;SACpB;IACH,CAAC;IAEM,iBAAiB,CAAE,KAAqB;QAC7C,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,8BAAkB,CAAC,KAAK,CAAC,CAAC;gBAC7B,MAAM,EAAE,GAAG,KAA4B,CAAA;gBACvC,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;oBAC/B,KAAK,kCAAmB,CAAC,SAAS,CAAC,CAAC;wBAClC,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAA;qBAC1B;oBACD,OAAO,CAAC,CAAC;wBACP,OAAO,KAAK,CAAC,IAAI,CAAA;qBAClB;iBACF;aACF;YACD;gBACE,OAAO,KAAK,CAAC,IAAI,CAAA;SACpB;IACH,CAAC;CACF;AA/DD,oCA+DC","sourcesContent":["import { ContainedField, ContainedFieldType, ContainedFieldSet, ContainedGroupField, ContainedComponentField } from '../contained'\r\nimport { FixDefinitions } from '../definition'\r\nimport { FixDefinitionSource } from '../fix-versions'\r\nimport { ContainedSetType } from '../dict-primitive'\r\n\r\nimport _ = require('lodash')\r\n\r\nexport class CompilerType {\r\n public readonly snaked: string\r\n constructor (public readonly definitions: FixDefinitions, public readonly set: ContainedFieldSet, public readonly qualifiedName: string) {\r\n const snake = _.snakeCase(this.qualifiedName)\r\n if (set.type === ContainedSetType.Msg) {\r\n this.snaked = `./${snake}`\r\n } else {\r\n this.snaked = `./set/${snake}`\r\n }\r\n }\r\n\r\n public getExtended (field: ContainedField): string {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n const gf = field as ContainedGroupField\r\n switch (this.definitions.source) {\r\n case FixDefinitionSource.QuickFix: {\r\n return this.qualifiedName + field.name\r\n }\r\n\r\n case FixDefinitionSource.FixmlRepo: {\r\n return gf.definition.name\r\n }\r\n default: {\r\n return field.name\r\n }\r\n }\r\n }\r\n\r\n case ContainedFieldType.Component: {\r\n const cf = field as ContainedComponentField\r\n switch (this.definitions.source) {\r\n case FixDefinitionSource.FixmlRepo: {\r\n return cf.definition.name\r\n }\r\n default: {\r\n return field.name\r\n }\r\n }\r\n }\r\n\r\n default:\r\n return field.name\r\n }\r\n }\r\n\r\n public getFieldGroupName (field: ContainedField) {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n const gf = field as ContainedGroupField\r\n switch (this.definitions.source) {\r\n case FixDefinitionSource.FixmlRepo: {\r\n return gf.definition.name\r\n }\r\n default: {\r\n return field.name\r\n }\r\n }\r\n }\r\n default:\r\n return field.name\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"compiler-type.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/compiler-type.ts"],"names":[],"mappings":";;;AAAA,4CAAkI;AAGlI,4BAA4B;AAC5B,8DAAwD;AACxD,oEAA8D;AAE9D,MAAa,YAAY;IAEvB,YAA6B,WAA2B,EAAkB,GAAsB,EAAkB,aAAqB;QAA1G,gBAAW,GAAX,WAAW,CAAgB;QAAkB,QAAG,GAAH,GAAG,CAAmB;QAAkB,kBAAa,GAAb,aAAa,CAAQ;QACrI,MAAM,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,qCAAgB,CAAC,GAAG,EAAE;YACrC,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,EAAE,CAAA;SAC3B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IAAI,CAAA;qBAC1B;oBACD,OAAO,CAAC,CAAC;wBACP,OAAO,KAAK,CAAC,IAAI,CAAA;qBAClB;iBACF;aACF;YACD;gBACE,OAAO,KAAK,CAAC,IAAI,CAAA;SACpB;IACH,CAAC;CACF;AA/DD,oCA+DC","sourcesContent":["import { ContainedField, ContainedFieldSet, ContainedGroupField, ContainedComponentField, ContainedFieldType } from '../contained'\r\nimport { FixDefinitions } from '../definition'\r\n\r\nimport _ = require('lodash')\r\nimport { ContainedSetType } from '../contained-set-type'\r\nimport { FixDefinitionSource } from '../fix-definition-source'\r\n\r\nexport class CompilerType {\r\n public readonly snaked: string\r\n constructor (public readonly definitions: FixDefinitions, public readonly set: ContainedFieldSet, public readonly qualifiedName: string) {\r\n const snake = _.snakeCase(this.qualifiedName)\r\n if (set.type === ContainedSetType.Msg) {\r\n this.snaked = `./${snake}`\r\n } else {\r\n this.snaked = `./set/${snake}`\r\n }\r\n }\r\n\r\n public getExtended (field: ContainedField): string {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n const gf = field as ContainedGroupField\r\n switch (this.definitions.source) {\r\n case FixDefinitionSource.QuickFix: {\r\n return this.qualifiedName + field.name\r\n }\r\n\r\n case FixDefinitionSource.FixmlRepo: {\r\n return gf.definition.name\r\n }\r\n default: {\r\n return field.name\r\n }\r\n }\r\n }\r\n\r\n case ContainedFieldType.Component: {\r\n const cf = field as ContainedComponentField\r\n switch (this.definitions.source) {\r\n case FixDefinitionSource.FixmlRepo: {\r\n return cf.definition.name\r\n }\r\n default: {\r\n return field.name\r\n }\r\n }\r\n }\r\n\r\n default:\r\n return field.name\r\n }\r\n }\r\n\r\n public getFieldGroupName (field: ContainedField) {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n const gf = field as ContainedGroupField\r\n switch (this.definitions.source) {\r\n case FixDefinitionSource.FixmlRepo: {\r\n return gf.definition.name\r\n }\r\n default: {\r\n return field.name\r\n }\r\n }\r\n }\r\n default:\r\n return field.name\r\n }\r\n }\r\n}\r\n"]}
@@ -7,6 +7,7 @@ export declare class EnumCompiler {
7
7
  private readonly consolidated;
8
8
  private readonly snippets;
9
9
  constructor(definitions: FixDefinitions, settings: ICompilerSettings);
10
+ private static getIndex;
10
11
  generate(asOneFile?: string): Promise<void>;
11
12
  oneEnum(field: SimpleFieldDefinition, asOneFile: string): Promise<void>;
12
13
  generateEnum(field: SimpleFieldDefinition): string;
@@ -16,6 +16,7 @@ const fs = require("fs");
16
16
  const util = require("util");
17
17
  const Path = require("path");
18
18
  const _ = require("lodash");
19
+ const tag_type_1 = require("../../buffer/tag/tag-type");
19
20
  class EnumCompiler {
20
21
  constructor(definitions, settings) {
21
22
  this.definitions = definitions;
@@ -24,6 +25,14 @@ class EnumCompiler {
24
25
  this.consolidated = new buffer_1.ElasticBuffer();
25
26
  this.snippets = new standard_snippet_1.StandardSnippet(settings);
26
27
  }
28
+ static getIndex() {
29
+ const lines = [
30
+ `export * from './all-enum'`,
31
+ `export * from './msg_tag'`,
32
+ ''
33
+ ];
34
+ return lines.join(require('os').EOL);
35
+ }
27
36
  generate(asOneFile = null) {
28
37
  return __awaiter(this, void 0, void 0, function* () {
29
38
  this.generateTagEnum('MsgTag').then(() => __awaiter(this, void 0, void 0, function* () {
@@ -33,6 +42,7 @@ class EnumCompiler {
33
42
  }));
34
43
  if (asOneFile) {
35
44
  yield this.writeAsOne(asOneFile);
45
+ yield this.writeFile('index', EnumCompiler.getIndex());
36
46
  }
37
47
  })).catch((e) => {
38
48
  throw e;
@@ -68,7 +78,7 @@ class EnumCompiler {
68
78
  let k = field.resolveEnum(latest);
69
79
  let v = latest;
70
80
  switch (field.tagType) {
71
- case buffer_1.TagType.Int: {
81
+ case tag_type_1.TagType.Int: {
72
82
  v = parseInt(latest, 10);
73
83
  break;
74
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"enum-compiler.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/enum-compiler.ts"],"names":[],"mappings":";;;;;;;;;;;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A;QAC1B,MAAM,CAAC,KAAK,EAAE,CAAA;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAE9B,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,WAAW,EAAE;YACxC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;SAC/B;QACD,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC1C,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;QACvB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1C,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAC3B,eAAe,EAAE,CAAA;QACjB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;QACxC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAC3B,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAA;IAC1B,CAAC;CACF;AAxKD,oCAwKC","sourcesContent":["import { FixDefinitions, SimpleFieldDefinition } from '../definition'\r\nimport { ICompilerSettings } from './compiler-settings'\r\nimport { StandardSnippet } from './standard-snippet'\r\nimport { TagType, ElasticBuffer } from '../../buffer'\r\nimport { ILooseObject } from '../../collections/collection'\r\n\r\nimport * as fs from 'fs'\r\nimport * as util from 'util'\r\nimport * as Path from 'path'\r\nimport * as _ from 'lodash'\r\n\r\nexport class EnumCompiler {\r\n private readonly buffer: ElasticBuffer = new ElasticBuffer()\r\n private readonly consolidated: ElasticBuffer = new ElasticBuffer()\r\n private readonly snippets: StandardSnippet\r\n\r\n constructor (public readonly definitions: FixDefinitions, public readonly settings: ICompilerSettings) {\r\n this.snippets = new StandardSnippet(settings)\r\n }\r\n\r\n /*\r\n enum MessageTypes {\r\n Logon = 'A',\r\n Heartbeat = '0',\r\n TestRequest = '1'\r\n}\r\n */\r\n\r\n public async generate (asOneFile: string = null) {\r\n this.generateTagEnum('MsgTag').then(async () => {\r\n const toDo: SimpleFieldDefinition[] = this.toDo()\r\n toDo.forEach(async (field: SimpleFieldDefinition) => {\r\n await this.oneEnum(field, asOneFile)\r\n })\r\n if (asOneFile) {\r\n await this.writeAsOne(asOneFile)\r\n }\r\n }).catch((e: Error) => {\r\n throw e\r\n })\r\n }\r\n\r\n public async oneEnum (field: SimpleFieldDefinition, asOneFile: string) {\r\n const newLine = require('os').EOL\r\n const api = this.generateEnum(field)\r\n if (!asOneFile) {\r\n await this.writeFile(field.name, api).catch((e: Error) => {\r\n throw e\r\n })\r\n } else {\r\n this.consolidated.writeString(api)\r\n this.consolidated.writeString(newLine)\r\n }\r\n }\r\n\r\n public generateEnum (field: SimpleFieldDefinition): string {\r\n const buffer = this.buffer\r\n if (field == null) {\r\n throw new Error(`no simple field ${name} exists in definitions`)\r\n }\r\n if (!field.isEnum()) {\r\n throw new Error(`field ${name} is not an enum type`)\r\n }\r\n return this.create(field.name, field.description, () => {\r\n const newLine = require('os').EOL\r\n return field.enums.keys().reduce((a: number, latest: string, i: number, arr: string[]) => {\r\n let k = field.resolveEnum(latest)\r\n let v: any = latest\r\n switch (field.tagType) {\r\n case TagType.Int: {\r\n v = parseInt(latest, 10)\r\n break\r\n }\r\n }\r\n\r\n buffer.writeString(this.snippets.enumValue(k, v, 1))\r\n if (i < arr.length - 1) {\r\n buffer.writeString(',')\r\n }\r\n buffer.writeString(newLine)\r\n return 0\r\n }, 0)\r\n })\r\n }\r\n\r\n public async generateTagEnum (name: string) {\r\n const newLine = require('os').EOL\r\n const tags = this.definitions.tagToSimple\r\n const snippets = this.snippets\r\n const api = this.create(name, null, () => {\r\n const buffer = this.buffer\r\n return Object.keys(tags).reduce((a: number, latest: string, i: number, arr: string[]) => {\r\n const tag = parseInt(latest, 10)\r\n const sf = tags[tag]\r\n if (sf) {\r\n if (this.settings.comment && sf.description) {\r\n this.commentBlock(sf.description)\r\n }\r\n buffer.writeString(snippets.enumValue(sf.name, tag, 1))\r\n if (i < arr.length - 1) {\r\n buffer.writeString(',')\r\n }\r\n buffer.writeString(newLine)\r\n }\r\n return a\r\n }, 0)\r\n })\r\n await this.writeFile(name, api)\r\n }\r\n\r\n private toDo (): SimpleFieldDefinition[] {\r\n const done: ILooseObject = {}\r\n return this.definitions.simple.values().reduce((a: SimpleFieldDefinition[], latest: SimpleFieldDefinition) => {\r\n if (latest.isEnum() && !done[latest.name]) {\r\n done[latest.name] = true\r\n a.push(latest)\r\n }\r\n return a\r\n }, [])\r\n }\r\n\r\n private async writeAsOne (asOneFile: string) {\r\n const writer = util.promisify(fs.writeFile)\r\n await writer(asOneFile, this.consolidated.toString(), {\r\n encoding: 'utf8'\r\n }\r\n ).catch((e: Error) => {\r\n throw e\r\n })\r\n }\r\n\r\n private commentBlock (comment: string) {\r\n const buffer = this.buffer\r\n const snippets = this.snippets\r\n const newLine = require('os').EOL\r\n buffer.writeString(snippets.startBlockComment(0))\r\n buffer.writeString(newLine)\r\n buffer.writeString(snippets.commentBox(comment))\r\n buffer.writeString(newLine)\r\n buffer.writeString(snippets.endBlockComment(0))\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private async writeFile (name: string, api: string) {\r\n const writer = util.promisify(fs.writeFile)\r\n const fullName = this.getFileName(name)\r\n await writer(fullName, api, {\r\n encoding: 'utf8'}\r\n ).catch((e: Error) => {\r\n throw e\r\n })\r\n }\r\n\r\n private getFileName (name: string): string {\r\n const snake = _.snakeCase(name)\r\n const settings = this.settings\r\n const fileName = `${snake}.ts`\r\n let path: string = `${settings.output}/enum/`\r\n return Path.join(path, fileName)\r\n }\r\n\r\n private create (name: string, description: string, populateMembers: Function): string {\r\n const newLine = require('os').EOL\r\n const buffer = this.buffer\r\n buffer.reset()\r\n const snippets = this.snippets\r\n\r\n if (this.settings.comment && description) {\r\n this.commentBlock(description)\r\n }\r\n buffer.writeString(snippets.enum(name, 0))\r\n buffer.writeString(' ')\r\n buffer.writeString(snippets.startBlock(0))\r\n buffer.writeString(newLine)\r\n populateMembers()\r\n buffer.writeString(snippets.endBlock(0))\r\n buffer.writeString(newLine)\r\n return buffer.toString()\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"enum-compiler.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/enum-compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yDAAoD;AACpD,yCAA4C;AAG5C,yBAAwB;AACxB,6BAA4B;AAC5B,6BAA4B;AAC5B,4BAA2B;AAC3B,wDAAmD;AAEnD,MAAa,YAAY;IAKvB,YAA6B,WAA2B,EAAkB,QAA2B;QAAxE,gBAAW,GAAX,WAAW,CAAgB;QAAkB,aAAQ,GAAR,QAAQ,CAAmB;QAJpF,WAAM,GAAkB,IAAI,sBAAa,EAAE,CAAA;QAC3C,iBAAY,GAAkB,IAAI,sBAAa,EAAE,CAAA;QAIhE,IAAI,CAAC,QAAQ,GAAG,IAAI,kCAAe,CAAC,QAAQ,CAAC,CAAA;IAC/C,CAAC;IAEO,MAAM,CAAC,QAAQ;QACrB,MAAM,KAAK,GAAG;YACZ,4BAA4B;YAC5B,2BAA2B;YAC3B,EAAE;SACH,CAAA;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACtC,CAAC;IAUY,QAAQ,CAAE,YAAoB,IAAI;;YAC7C,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAS,EAAE;gBAC7C,MAAM,IAAI,GAA4B,IAAI,CAAC,IAAI,EAAE,CAAA;gBACjD,IAAI,CAAC,OAAO,CAAC,CAAO,KAA4B,EAAE,EAAE;oBAClD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;gBACtC,CAAC,CAAA,CAAC,CAAA;gBACF,IAAI,SAAS,EAAE;oBACb,MAAM,IAAI,CAAC,UAAU,CA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AC;CACF;AAlLD,oCAkLC","sourcesContent":["import { FixDefinitions, SimpleFieldDefinition } from '../definition'\r\nimport { ICompilerSettings } from './compiler-settings'\r\nimport { StandardSnippet } from './standard-snippet'\r\nimport { ElasticBuffer } from '../../buffer'\r\nimport { ILooseObject } from '../../collections/collection'\r\n\r\nimport * as fs from 'fs'\r\nimport * as util from 'util'\r\nimport * as Path from 'path'\r\nimport * as _ from 'lodash'\r\nimport { TagType } from '../../buffer/tag/tag-type'\r\n\r\nexport class EnumCompiler {\r\n private readonly buffer: ElasticBuffer = new ElasticBuffer()\r\n private readonly consolidated: ElasticBuffer = new ElasticBuffer()\r\n private readonly snippets: StandardSnippet\r\n\r\n constructor (public readonly definitions: FixDefinitions, public readonly settings: ICompilerSettings) {\r\n this.snippets = new StandardSnippet(settings)\r\n }\r\n\r\n private static getIndex (): string {\r\n const lines = [\r\n `export * from './all-enum'`,\r\n `export * from './msg_tag'`,\r\n ''\r\n ]\r\n return lines.join(require('os').EOL)\r\n }\r\n\r\n /*\r\n enum MessageTypes {\r\n Logon = 'A',\r\n Heartbeat = '0',\r\n TestRequest = '1'\r\n}\r\n */\r\n\r\n public async generate (asOneFile: string = null) {\r\n this.generateTagEnum('MsgTag').then(async () => {\r\n const toDo: SimpleFieldDefinition[] = this.toDo()\r\n toDo.forEach(async (field: SimpleFieldDefinition) => {\r\n await this.oneEnum(field, asOneFile)\r\n })\r\n if (asOneFile) {\r\n await this.writeAsOne(asOneFile)\r\n await this.writeFile('index', EnumCompiler.getIndex())\r\n }\r\n }).catch((e: Error) => {\r\n throw e\r\n })\r\n }\r\n\r\n public async oneEnum (field: SimpleFieldDefinition, asOneFile: string) {\r\n const newLine = require('os').EOL\r\n const api = this.generateEnum(field)\r\n if (!asOneFile) {\r\n await this.writeFile(field.name, api).catch((e: Error) => {\r\n throw e\r\n })\r\n } else {\r\n this.consolidated.writeString(api)\r\n this.consolidated.writeString(newLine)\r\n }\r\n }\r\n\r\n public generateEnum (field: SimpleFieldDefinition): string {\r\n const buffer = this.buffer\r\n if (field == null) {\r\n throw new Error(`no simple field ${name} exists in definitions`)\r\n }\r\n if (!field.isEnum()) {\r\n throw new Error(`field ${name} is not an enum type`)\r\n }\r\n return this.create(field.name, field.description, () => {\r\n const newLine = require('os').EOL\r\n return field.enums.keys().reduce((a: number, latest: string, i: number, arr: string[]) => {\r\n let k = field.resolveEnum(latest)\r\n let v: any = latest\r\n switch (field.tagType) {\r\n case TagType.Int: {\r\n v = parseInt(latest, 10)\r\n break\r\n }\r\n }\r\n\r\n buffer.writeString(this.snippets.enumValue(k, v, 1))\r\n if (i < arr.length - 1) {\r\n buffer.writeString(',')\r\n }\r\n buffer.writeString(newLine)\r\n return 0\r\n }, 0)\r\n })\r\n }\r\n\r\n public async generateTagEnum (name: string) {\r\n const newLine = require('os').EOL\r\n const tags = this.definitions.tagToSimple\r\n const snippets = this.snippets\r\n const api = this.create(name, null, () => {\r\n const buffer = this.buffer\r\n return Object.keys(tags).reduce((a: number, latest: string, i: number, arr: string[]) => {\r\n const tag = parseInt(latest, 10)\r\n const sf = tags[tag]\r\n if (sf) {\r\n if (this.settings.comment && sf.description) {\r\n this.commentBlock(sf.description)\r\n }\r\n buffer.writeString(snippets.enumValue(sf.name, tag, 1))\r\n if (i < arr.length - 1) {\r\n buffer.writeString(',')\r\n }\r\n buffer.writeString(newLine)\r\n }\r\n return a\r\n }, 0)\r\n })\r\n await this.writeFile(name, api)\r\n }\r\n\r\n private toDo (): SimpleFieldDefinition[] {\r\n const done: ILooseObject = {}\r\n return this.definitions.simple.values().reduce((a: SimpleFieldDefinition[], latest: SimpleFieldDefinition) => {\r\n if (latest.isEnum() && !done[latest.name]) {\r\n done[latest.name] = true\r\n a.push(latest)\r\n }\r\n return a\r\n }, [])\r\n }\r\n\r\n private async writeAsOne (asOneFile: string) {\r\n const writer = util.promisify(fs.writeFile)\r\n await writer(asOneFile, this.consolidated.toString(), {\r\n encoding: 'utf8'\r\n }\r\n ).catch((e: Error) => {\r\n throw e\r\n })\r\n }\r\n\r\n private commentBlock (comment: string) {\r\n const buffer = this.buffer\r\n const snippets = this.snippets\r\n const newLine = require('os').EOL\r\n buffer.writeString(snippets.startBlockComment(0))\r\n buffer.writeString(newLine)\r\n buffer.writeString(snippets.commentBox(comment))\r\n buffer.writeString(newLine)\r\n buffer.writeString(snippets.endBlockComment(0))\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private async writeFile (name: string, api: string) {\r\n const writer = util.promisify(fs.writeFile)\r\n const fullName = this.getFileName(name)\r\n await writer(fullName, api, {\r\n encoding: 'utf8'}\r\n ).catch((e: Error) => {\r\n throw e\r\n })\r\n }\r\n\r\n private getFileName (name: string): string {\r\n const snake = _.snakeCase(name)\r\n const settings = this.settings\r\n const fileName = `${snake}.ts`\r\n let path: string = `${settings.output}/enum/`\r\n return Path.join(path, fileName)\r\n }\r\n\r\n private create (name: string, description: string, populateMembers: Function): string {\r\n const newLine = require('os').EOL\r\n const buffer = this.buffer\r\n buffer.reset()\r\n const snippets = this.snippets\r\n\r\n if (this.settings.comment && description) {\r\n this.commentBlock(description)\r\n }\r\n buffer.writeString(snippets.enum(name, 0))\r\n buffer.writeString(' ')\r\n buffer.writeString(snippets.startBlock(0))\r\n buffer.writeString(newLine)\r\n populateMembers()\r\n buffer.writeString(snippets.endBlock(0))\r\n buffer.writeString(newLine)\r\n return buffer.toString()\r\n }\r\n}\r\n"]}
@@ -11,15 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MsgCompiler = void 0;
13
13
  const buffer_1 = require("../../buffer");
14
+ const ascii_1 = require("../../buffer/ascii/");
15
+ const contained_1 = require("../contained");
14
16
  const standard_snippet_1 = require("./standard-snippet");
15
- const dict_primitive_1 = require("../dict-primitive");
16
17
  const compiler_type_1 = require("./compiler-type");
17
18
  const collections_1 = require("../../collections");
18
19
  const fs = require("fs");
19
20
  const Util = require("util");
20
21
  const Path = require("path");
21
- const fields_dispatch_1 = require("../fields-dispatch");
22
22
  const set_reduce_1 = require("../set-reduce");
23
+ const contained_set_type_1 = require("../contained-set-type");
23
24
  class MsgCompiler {
24
25
  constructor(definitions, settings) {
25
26
  this.definitions = definitions;
@@ -110,7 +111,7 @@ class MsgCompiler {
110
111
  buffer.writeString(newLine);
111
112
  }
112
113
  buffer.writeString(snippets.interface(compilerType.qualifiedName, 0));
113
- buffer.writeChar(buffer_1.AsciiChars.Space);
114
+ buffer.writeChar(ascii_1.AsciiChars.Space);
114
115
  buffer.writeString(snippets.startBlock(0));
115
116
  buffer.writeString(newLine);
116
117
  this.fields(compilerType);
@@ -158,7 +159,7 @@ class MsgCompiler {
158
159
  }
159
160
  fields(compilerType) {
160
161
  this.attributes(compilerType);
161
- fields_dispatch_1.dispatchFields(compilerType.set.fields, {
162
+ new contained_1.FieldsDispatch().dispatchFields(compilerType.set.fields, {
162
163
  group: (g) => this.fieldGroup(g, compilerType),
163
164
  simple: (simple) => this.fieldSimple(simple),
164
165
  component: (c) => this.fieldComponent(c, compilerType)
@@ -178,9 +179,10 @@ class MsgCompiler {
178
179
  });
179
180
  }
180
181
  imports(compilerType) {
181
- const isMsg = compilerType.set.type === dict_primitive_1.ContainedSetType.Msg;
182
+ const reducer = new set_reduce_1.SetReduce();
183
+ const isMsg = compilerType.set.type === contained_set_type_1.ContainedSetType.Msg;
182
184
  const snippets = this.snippets;
183
- const imports = set_reduce_1.reduceSet(compilerType.set, {
185
+ const imports = reducer.reduce(compilerType.set, {
184
186
  component: (a, c) => {
185
187
  a.push(`${snippets.import(compilerType.getExtended(c), isMsg, 0)}`);
186
188
  return a;
@@ -1 +1 @@
1
- {"version":3,"file":"msg-compiler.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/msg-compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA8D;AAI9D,yDAAoD;AACpD,sDAAoD;AACpD,mDAA8C;AAC9C,mDAA8C;AAE9C,yBAAwB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AC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACjE,CAAC;CACF;AAtLD,kCAsLC","sourcesContent":["import { ElasticBuffer, AsciiChars, Tags } from '../../buffer'\r\nimport { ICompilerSettings } from './compiler-settings'\r\nimport { FixDefinitions } from '../definition'\r\nimport { ContainedGroupField, ContainedSimpleField, ContainedComponentField } from '../contained'\r\nimport { StandardSnippet } from './standard-snippet'\r\nimport { ContainedSetType } from '../dict-primitive'\r\nimport { CompilerType } from './compiler-type'\r\nimport { Dictionary } from '../../collections'\r\n\r\nimport * as fs from 'fs'\r\nimport * as Util from 'util'\r\nimport * as Path from 'path'\r\nimport { dispatchFields } from '../fields-dispatch'\r\nimport { reduceSet } from '../set-reduce'\r\n\r\nexport class MsgCompiler {\r\n readonly queue: CompilerType[] = []\r\n readonly snippets: StandardSnippet\r\n readonly buffer: ElasticBuffer = new ElasticBuffer()\r\n readonly completed: Dictionary<CompilerType>\r\n\r\n constructor (public readonly definitions: FixDefinitions, public readonly settings: ICompilerSettings) {\r\n this.completed = new Dictionary<CompilerType>()\r\n this.snippets = new StandardSnippet(this.settings)\r\n }\r\n\r\n public async generate () {\r\n const types: string[] = this.settings.types || this.definitions.message.keys()\r\n return this.createTypes(types)\r\n }\r\n\r\n private getFileName (compilerType: CompilerType): string {\r\n const settings = this.settings\r\n const fileName = `${compilerType.snaked}.ts`\r\n return Path.join(settings.output, fileName)\r\n }\r\n\r\n private async createTypes (types: string[]) {\r\n const definitions = this.definitions\r\n types.forEach((type: string) => {\r\n const definition = definitions.containedSet(type)\r\n if (!definition) {\r\n throw new Error(`no type ${type} defined`)\r\n }\r\n const ct = new CompilerType(this.definitions, definition, definition.name)\r\n this.enqueue(ct)\r\n })\r\n await this.work()\r\n await this.index()\r\n }\r\n\r\n private async work () {\r\n const q = this.queue\r\n const writeFile = Util.promisify(fs.writeFile)\r\n while (q.length > 0) {\r\n const compilerType: CompilerType = q.pop()\r\n const api: string = this.generateMessages(compilerType)\r\n const fullName = this.getFileName(compilerType)\r\n await writeFile(fullName, api, {\r\n encoding: 'utf8'}\r\n )\r\n }\r\n }\r\n\r\n private async index () {\r\n const writeFile = Util.promisify(fs.writeFile)\r\n const settings = this.settings\r\n const fileName = 'index.ts'\r\n const done = this.completed.values()\r\n const exports: string[] = done.reduce((prev: string[], current: CompilerType) => {\r\n prev.push(`export * from '${current.snaked}'`)\r\n return prev\r\n }, [`export * from './enum'`] as string[])\r\n const newLine = require('os').EOL\r\n exports.sort()\r\n exports.push('')\r\n const api: string = exports.join(newLine)\r\n const fullName: string = Path.join(settings.output, fileName)\r\n await writeFile(fullName, api, {\r\n encoding: 'utf8'}\r\n )\r\n }\r\n\r\n private generateMessages (compilerType: CompilerType): string {\r\n const definition = compilerType.set\r\n const buffer: ElasticBuffer = this.buffer\r\n buffer.reset()\r\n const snippets = this.snippets\r\n const newLine = require('os').EOL\r\n // a single class with dependencies included\r\n let ptr: number = this.imports(compilerType)\r\n if (ptr > 0) {\r\n buffer.writeString(newLine)\r\n buffer.writeString(newLine)\r\n }\r\n if (this.settings.comment && definition.description) {\r\n const comment = snippets.commentBox(definition.description)\r\n buffer.writeString(snippets.startBlockComment(0))\r\n buffer.writeString(newLine)\r\n buffer.writeString(comment)\r\n buffer.writeString(newLine)\r\n buffer.writeString(snippets.endBlockComment(0))\r\n buffer.writeString(newLine)\r\n }\r\n buffer.writeString(snippets.interface(compilerType.qualifiedName, 0))\r\n buffer.writeChar(AsciiChars.Space)\r\n buffer.writeString(snippets.startBlock(0))\r\n buffer.writeString(newLine)\r\n this.fields(compilerType)\r\n buffer.writeString(snippets.endBlock(0))\r\n buffer.writeString(newLine)\r\n return buffer.toString()\r\n }\r\n\r\n // only generate once\r\n private enqueue (ct: CompilerType): void {\r\n const completed = this.completed\r\n const fullName = this.getFileName(ct)\r\n if (completed.get(fullName)) {\r\n return\r\n }\r\n this.queue.push(ct)\r\n completed.addUpdate(fullName, ct)\r\n }\r\n\r\n private fieldSimple (simple: ContainedSimpleField): void {\r\n const snippets = this.snippets\r\n const settings = this.settings\r\n const buffer = this.buffer\r\n const newLine = require('os').EOL\r\n const len = buffer.writeString(snippets.simple(simple.name, Tags.toJSType(simple), simple.required, 1))\r\n if (settings.tags) {\r\n buffer.writeString(snippets.commentLine(`${simple.definition.tag}`, 50 - len))\r\n }\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private fieldGroup (groupField: ContainedGroupField, compilerType: CompilerType): void {\r\n const newLine = require('os').EOL\r\n const buffer = this.buffer\r\n const snippets = this.snippets\r\n // for a group its field name is as defined in type, its type is qualified to avoid collisions\r\n const extended: string = compilerType.getExtended(groupField)\r\n buffer.writeString(snippets.group(compilerType.getFieldGroupName(groupField), extended, groupField.required, 1))\r\n this.enqueue(new CompilerType(this.definitions, groupField.definition, extended))\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private fieldComponent (componentField: ContainedComponentField, compilerType: CompilerType): void {\r\n const newLine = require('os').EOL\r\n const buffer = this.buffer\r\n const snippets = this.snippets\r\n const extended: string = compilerType.getExtended(componentField)\r\n buffer.writeString(snippets.component(extended, componentField.required, 1))\r\n this.enqueue(new CompilerType(this.definitions, componentField.definition, extended))\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private fields (compilerType: CompilerType): void {\r\n this.attributes(compilerType)\r\n dispatchFields(compilerType.set.fields, {\r\n group: (g: ContainedGroupField) => this.fieldGroup(g, compilerType),\r\n simple: (simple: ContainedSimpleField) => this.fieldSimple(simple),\r\n component: (c: ContainedComponentField) => this.fieldComponent(c, compilerType)\r\n })\r\n }\r\n\r\n private attributes (compilerType: CompilerType): void {\r\n const settings = this.settings\r\n const newLine = require('os').EOL\r\n const snippets = this.snippets\r\n const buffer = this.buffer\r\n compilerType.set.localAttribute.forEach((simple: ContainedSimpleField) => {\r\n const len = buffer.writeString(snippets.simple(simple.definition.name, Tags.toJSType(simple), simple.required, 1))\r\n if (settings.tags) {\r\n buffer.writeString(snippets.commentLine(`${simple.definition.tag}`, 50 - len))\r\n }\r\n buffer.writeString(newLine)\r\n })\r\n }\r\n\r\n private imports (compilerType: CompilerType): number {\r\n const isMsg = compilerType.set.type === ContainedSetType.Msg\r\n const snippets = this.snippets\r\n const imports: string[] = reduceSet<string[]>(compilerType.set, {\r\n component: (a: string[], c: ContainedComponentField) => {\r\n a.push(`${snippets.import(compilerType.getExtended(c), isMsg, 0)}`)\r\n return a\r\n },\r\n group: (a: string[], g: ContainedGroupField) => {\r\n a.push(`${snippets.import(compilerType.getExtended(g), isMsg, 0)}`)\r\n return a\r\n }\r\n }, [])\r\n\r\n return this.buffer.writeString(imports.join(require('os').EOL))\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"msg-compiler.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/msg-compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAkD;AAClD,+CAAgD;AAGhD,4CAAiH;AACjH,yDAAoD;AACpD,mDAA8C;AAC9C,mDAA8C;AAE9C,yBAAwB;AACxB,6BAA4B;AAC5B,6BAA4B;AAC5B,8CAAyC;AACzC,8DAAwD;AAExD,MAAa,WAAW;IAMtB,YAA6B,WAA2B,EAAkB,QAA2B;QAAxE,gBAAW,GAAX,WAAW,CAAgB;QAAkB,aAAQ,GAAR,QAAQ,CAAmB;QAL5F,UAAK,GAAmB,EAAE,CAAA;QAE1B,WAAM,GAAkB,IAAI,sBAAa,EAAE,CAAA;QAIlD,IAAI,CAAC,SAAS,GAAG,IAAI,wBAAU,EAAgB,CAAA;QAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,kCAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACpD,CAAC;IAEY,QAAQ;;YACnB,MAAM,KAAK,GAAa,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;YAC9E,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,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,GAAG,CAAC,IAAI,KAAK,qCAAgB,CAAC,GAAG,CAAA;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,MAAM,OAAO,GAAa,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE;YACzD,SAAS,EAAE,CAAC,CAAW,EAAE,CAA0B,EAAE,EAAE;gBACrD,CAAC,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;gBACnE,OAAO,CAAC,CAAA;YACV,CAAC;YACD,KAAK,EAAE,CAAC,CAAW,EAAE,CAAsB,EAAE,EAAE;gBAC7C,CAAC,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;gBACnE,OAAO,CAAC,CAAA;YACV,CAAC;SACF,EAAE,EAAE,CAAC,CAAA;QAEN,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACjE,CAAC;CACF;AAvLD,kCAuLC","sourcesContent":["import { ElasticBuffer, Tags } from '../../buffer'\r\nimport { AsciiChars } from '../../buffer/ascii/'\r\nimport { ICompilerSettings } from './compiler-settings'\r\nimport { FixDefinitions } from '../definition'\r\nimport { ContainedGroupField, ContainedSimpleField, ContainedComponentField, FieldsDispatch } from '../contained'\r\nimport { StandardSnippet } from './standard-snippet'\r\nimport { CompilerType } from './compiler-type'\r\nimport { Dictionary } from '../../collections'\r\n\r\nimport * as fs from 'fs'\r\nimport * as Util from 'util'\r\nimport * as Path from 'path'\r\nimport { SetReduce } from '../set-reduce'\r\nimport { ContainedSetType } from '../contained-set-type'\r\n\r\nexport class MsgCompiler {\r\n readonly queue: CompilerType[] = []\r\n readonly snippets: StandardSnippet\r\n readonly buffer: ElasticBuffer = new ElasticBuffer()\r\n readonly completed: Dictionary<CompilerType>\r\n\r\n constructor (public readonly definitions: FixDefinitions, public readonly settings: ICompilerSettings) {\r\n this.completed = new Dictionary<CompilerType>()\r\n this.snippets = new StandardSnippet(this.settings)\r\n }\r\n\r\n public async generate () {\r\n const types: string[] = this.settings.types || this.definitions.message.keys()\r\n return this.createTypes(types)\r\n }\r\n\r\n private getFileName (compilerType: CompilerType): string {\r\n const settings = this.settings\r\n const fileName = `${compilerType.snaked}.ts`\r\n return Path.join(settings.output, fileName)\r\n }\r\n\r\n private async createTypes (types: string[]) {\r\n const definitions = this.definitions\r\n types.forEach((type: string) => {\r\n const definition = definitions.containedSet(type)\r\n if (!definition) {\r\n throw new Error(`no type ${type} defined`)\r\n }\r\n const ct = new CompilerType(this.definitions, definition, definition.name)\r\n this.enqueue(ct)\r\n })\r\n await this.work()\r\n await this.index()\r\n }\r\n\r\n private async work () {\r\n const q = this.queue\r\n const writeFile = Util.promisify(fs.writeFile)\r\n while (q.length > 0) {\r\n const compilerType: CompilerType = q.pop()\r\n const api: string = this.generateMessages(compilerType)\r\n const fullName = this.getFileName(compilerType)\r\n await writeFile(fullName, api, {\r\n encoding: 'utf8'}\r\n )\r\n }\r\n }\r\n\r\n private async index () {\r\n const writeFile = Util.promisify(fs.writeFile)\r\n const settings = this.settings\r\n const fileName = 'index.ts'\r\n const done = this.completed.values()\r\n const exports: string[] = done.reduce((prev: string[], current: CompilerType) => {\r\n prev.push(`export * from '${current.snaked}'`)\r\n return prev\r\n }, [`export * from './enum'`] as string[])\r\n const newLine = require('os').EOL\r\n exports.sort()\r\n exports.push('')\r\n const api: string = exports.join(newLine)\r\n const fullName: string = Path.join(settings.output, fileName)\r\n await writeFile(fullName, api, {\r\n encoding: 'utf8'}\r\n )\r\n }\r\n\r\n private generateMessages (compilerType: CompilerType): string {\r\n const definition = compilerType.set\r\n const buffer: ElasticBuffer = this.buffer\r\n buffer.reset()\r\n const snippets = this.snippets\r\n const newLine = require('os').EOL\r\n // a single class with dependencies included\r\n let ptr: number = this.imports(compilerType)\r\n if (ptr > 0) {\r\n buffer.writeString(newLine)\r\n buffer.writeString(newLine)\r\n }\r\n if (this.settings.comment && definition.description) {\r\n const comment = snippets.commentBox(definition.description)\r\n buffer.writeString(snippets.startBlockComment(0))\r\n buffer.writeString(newLine)\r\n buffer.writeString(comment)\r\n buffer.writeString(newLine)\r\n buffer.writeString(snippets.endBlockComment(0))\r\n buffer.writeString(newLine)\r\n }\r\n buffer.writeString(snippets.interface(compilerType.qualifiedName, 0))\r\n buffer.writeChar(AsciiChars.Space)\r\n buffer.writeString(snippets.startBlock(0))\r\n buffer.writeString(newLine)\r\n this.fields(compilerType)\r\n buffer.writeString(snippets.endBlock(0))\r\n buffer.writeString(newLine)\r\n return buffer.toString()\r\n }\r\n\r\n // only generate once\r\n private enqueue (ct: CompilerType): void {\r\n const completed = this.completed\r\n const fullName = this.getFileName(ct)\r\n if (completed.get(fullName)) {\r\n return\r\n }\r\n this.queue.push(ct)\r\n completed.addUpdate(fullName, ct)\r\n }\r\n\r\n private fieldSimple (simple: ContainedSimpleField): void {\r\n const snippets = this.snippets\r\n const settings = this.settings\r\n const buffer = this.buffer\r\n const newLine = require('os').EOL\r\n const len = buffer.writeString(snippets.simple(simple.name, Tags.toJSType(simple), simple.required, 1))\r\n if (settings.tags) {\r\n buffer.writeString(snippets.commentLine(`${simple.definition.tag}`, 50 - len))\r\n }\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private fieldGroup (groupField: ContainedGroupField, compilerType: CompilerType): void {\r\n const newLine = require('os').EOL\r\n const buffer = this.buffer\r\n const snippets = this.snippets\r\n // for a group its field name is as defined in type, its type is qualified to avoid collisions\r\n const extended: string = compilerType.getExtended(groupField)\r\n buffer.writeString(snippets.group(compilerType.getFieldGroupName(groupField), extended, groupField.required, 1))\r\n this.enqueue(new CompilerType(this.definitions, groupField.definition, extended))\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private fieldComponent (componentField: ContainedComponentField, compilerType: CompilerType): void {\r\n const newLine = require('os').EOL\r\n const buffer = this.buffer\r\n const snippets = this.snippets\r\n const extended: string = compilerType.getExtended(componentField)\r\n buffer.writeString(snippets.component(extended, componentField.required, 1))\r\n this.enqueue(new CompilerType(this.definitions, componentField.definition, extended))\r\n buffer.writeString(newLine)\r\n }\r\n\r\n private fields (compilerType: CompilerType): void {\r\n this.attributes(compilerType)\r\n new FieldsDispatch().dispatchFields(compilerType.set.fields, {\r\n group: (g: ContainedGroupField) => this.fieldGroup(g, compilerType),\r\n simple: (simple: ContainedSimpleField) => this.fieldSimple(simple),\r\n component: (c: ContainedComponentField) => this.fieldComponent(c, compilerType)\r\n })\r\n }\r\n\r\n private attributes (compilerType: CompilerType): void {\r\n const settings = this.settings\r\n const newLine = require('os').EOL\r\n const snippets = this.snippets\r\n const buffer = this.buffer\r\n compilerType.set.localAttribute.forEach((simple: ContainedSimpleField) => {\r\n const len = buffer.writeString(snippets.simple(simple.definition.name, Tags.toJSType(simple), simple.required, 1))\r\n if (settings.tags) {\r\n buffer.writeString(snippets.commentLine(`${simple.definition.tag}`, 50 - len))\r\n }\r\n buffer.writeString(newLine)\r\n })\r\n }\r\n\r\n private imports (compilerType: CompilerType): number {\r\n const reducer = new SetReduce<string[]>()\r\n const isMsg = compilerType.set.type === ContainedSetType.Msg\r\n const snippets = this.snippets\r\n const imports: string[] = reducer.reduce(compilerType.set, {\r\n component: (a: string[], c: ContainedComponentField) => {\r\n a.push(`${snippets.import(compilerType.getExtended(c), isMsg, 0)}`)\r\n return a\r\n },\r\n group: (a: string[], g: ContainedGroupField) => {\r\n a.push(`${snippets.import(compilerType.getExtended(g), isMsg, 0)}`)\r\n return a\r\n }\r\n }, [])\r\n\r\n return this.buffer.writeString(imports.join(require('os').EOL))\r\n }\r\n}\r\n"]}
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ContainedComponentField = void 0;
4
4
  const contained_field_1 = require("./contained-field");
5
+ const contained_field_type_1 = require("./contained-field-type");
5
6
  class ContainedComponentField extends contained_field_1.ContainedField {
6
7
  constructor(definition, position, required, override) {
7
- super(override || definition.name, position, contained_field_1.ContainedFieldType.Component, required);
8
+ super(override || definition.name, position, contained_field_type_1.ContainedFieldType.Component, required);
8
9
  this.definition = definition;
9
10
  this.position = position;
10
11
  this.required = required;
@@ -1 +1 @@
1
- {"version":3,"file":"contained-component-field.js","sourceRoot":"","sources":["../../../src/dictionary/contained/contained-component-field.ts"],"names":[],"mappings":";;;AACA,uDAAsE;AAEtE,MAAa,uBAAwB,SAAQ,gCAAc;IACzD,YAA6B,UAAoC,EAC7C,QAAgB,EACP,QAAiB,EACjB,QAAiB;QAC5C,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,oCAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QAJzD,eAAU,GAAV,UAAU,CAA0B;QAC7C,aAAQ,GAAR,QAAQ,CAAQ;QACP,aAAQ,GAAR,QAAQ,CAAS;QACjB,aAAQ,GAAR,QAAQ,CAAS;IAE9C,CAAC;IACM,QAAQ;QACb,OAAO,IAAI,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,GAAG,CAAA;IAC/E,CAAC;CACF;AAVD,0DAUC","sourcesContent":["import { ComponentFieldDefinition } from '../definition'\r\nimport { ContainedField, ContainedFieldType } from './contained-field'\r\n\r\nexport class ContainedComponentField extends ContainedField {\r\n constructor (public readonly definition: ComponentFieldDefinition,\r\n public position: number,\r\n public readonly required: boolean,\r\n public readonly override?: string) {\r\n super(override || definition.name, position, ContainedFieldType.Component, required)\r\n }\r\n public toString (): string {\r\n return `[${this.position}]=C.${this.definition.fields.length} (${this.name})`\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"contained-component-field.js","sourceRoot":"","sources":["../../../src/dictionary/contained/contained-component-field.ts"],"names":[],"mappings":";;;AACA,uDAAkD;AAClD,iEAA2D;AAE3D,MAAa,uBAAwB,SAAQ,gCAAc;IACzD,YAA6B,UAAoC,EAC7C,QAAgB,EACP,QAAiB,EACjB,QAAiB;QAC5C,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,yCAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QAJzD,eAAU,GAAV,UAAU,CAA0B;QAC7C,aAAQ,GAAR,QAAQ,CAAQ;QACP,aAAQ,GAAR,QAAQ,CAAS;QACjB,aAAQ,GAAR,QAAQ,CAAS;IAE9C,CAAC;IACM,QAAQ;QACb,OAAO,IAAI,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,GAAG,CAAA;IAC/E,CAAC;CACF;AAVD,0DAUC","sourcesContent":["import { ComponentFieldDefinition } from '../definition'\r\nimport { ContainedField } from './contained-field'\r\nimport { ContainedFieldType } from './contained-field-type'\r\n\r\nexport class ContainedComponentField extends ContainedField {\r\n constructor (public readonly definition: ComponentFieldDefinition,\r\n public position: number,\r\n public readonly required: boolean,\r\n public readonly override?: string) {\r\n super(override || definition.name, position, ContainedFieldType.Component, required)\r\n }\r\n public toString (): string {\r\n return `[${this.position}]=C.${this.definition.fields.length} (${this.name})`\r\n }\r\n}\r\n"]}
@@ -1,16 +1,3 @@
1
- import { ContainedGroupField } from './contained-group-field';
2
- import { ContainedSimpleField } from './contained-simple-field';
3
- import { ContainedComponentField } from './contained-component-field';
4
1
  import { ContainedField } from './contained-field';
5
- export interface IContainedFieldDispatcher {
6
- group?: {
7
- (field: ContainedGroupField): void;
8
- };
9
- simple?: {
10
- (field: ContainedSimpleField): void;
11
- };
12
- component?: {
13
- (field: ContainedComponentField): void;
14
- };
15
- }
2
+ import { IContainedFieldDispatcher } from './contained-field-dispatcher';
16
3
  export declare function dispatchContainedField(field: ContainedField, dispatcher: IContainedFieldDispatcher): void;
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dispatchContainedField = void 0;
4
- const contained_field_1 = require("./contained-field");
4
+ const contained_field_type_1 = require("./contained-field-type");
5
5
  function dispatchContainedField(field, dispatcher) {
6
6
  switch (field.type) {
7
- case contained_field_1.ContainedFieldType.Group: {
7
+ case contained_field_type_1.ContainedFieldType.Group: {
8
8
  if (dispatcher.group) {
9
9
  dispatcher.group(field);
10
10
  }
11
11
  break;
12
12
  }
13
- case contained_field_1.ContainedFieldType.Simple: {
13
+ case contained_field_type_1.ContainedFieldType.Simple: {
14
14
  if (dispatcher.simple) {
15
15
  dispatcher.simple(field);
16
16
  }
17
17
  break;
18
18
  }
19
- case contained_field_1.ContainedFieldType.Component: {
19
+ case contained_field_type_1.ContainedFieldType.Component: {
20
20
  if (dispatcher.component) {
21
21
  dispatcher.component(field);
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"contained-field-dispatch.js","sourceRoot":"","sources":["../../../src/dictionary/contained/contained-field-dispatch.ts"],"names":[],"mappings":";;;AAGA,uDAAsE;AAQtE,SAAgB,sBAAsB,CAAE,KAAqB,EAAE,UAAqC;IAClG,QAAQ,KAAK,CAAC,IAAI,EAAE;QAClB,KAAK,oCAAkB,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,UAAU,CAAC,KAAK,EAAE;gBACpB,UAAU,CAAC,KAAK,CAAC,KAA4B,CAAC,CAAA;aAC/C;YACD,MAAK;SACN;QAED,KAAK,oCAAkB,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAI,UAAU,CAAC,MAAM,EAAE;gBACrB,UAAU,CAAC,MAAM,CAAC,KAA6B,CAAC,CAAA;aACjD;YACD,MAAK;SACN;QAED,KAAK,oCAAkB,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,UAAU,CAAC,SAAS,EAAE;gBACxB,UAAU,CAAC,SAAS,CAAC,KAAgC,CAAC,CAAA;aACvD;YACD,MAAK;SACN;QAED;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;KAChD;AACH,CAAC;AA1BD,wDA0BC","sourcesContent":["import { ContainedGroupField } from './contained-group-field'\r\nimport { ContainedSimpleField } from './contained-simple-field'\r\nimport { ContainedComponentField } from './contained-component-field'\r\nimport { ContainedField, ContainedFieldType } from './contained-field'\r\n\r\nexport interface IContainedFieldDispatcher {\r\n group?: { (field: ContainedGroupField): void }\r\n simple?: { (field: ContainedSimpleField): void }\r\n component?: { (field: ContainedComponentField): void }\r\n}\r\n\r\nexport function dispatchContainedField (field: ContainedField, dispatcher: IContainedFieldDispatcher): void {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n if (dispatcher.group) {\r\n dispatcher.group(field as ContainedGroupField)\r\n }\r\n break\r\n }\r\n\r\n case ContainedFieldType.Simple: {\r\n if (dispatcher.simple) {\r\n dispatcher.simple(field as ContainedSimpleField)\r\n }\r\n break\r\n }\r\n\r\n case ContainedFieldType.Component: {\r\n if (dispatcher.component) {\r\n dispatcher.component(field as ContainedComponentField)\r\n }\r\n break\r\n }\r\n\r\n default:\r\n throw new Error(`unknown type ${field.type}`)\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"contained-field-dispatch.js","sourceRoot":"","sources":["../../../src/dictionary/contained/contained-field-dispatch.ts"],"names":[],"mappings":";;;AAKA,iEAA2D;AAE3D,SAAgB,sBAAsB,CAAE,KAAqB,EAAE,UAAqC;IAClG,QAAQ,KAAK,CAAC,IAAI,EAAE;QAClB,KAAK,yCAAkB,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,UAAU,CAAC,KAAK,EAAE;gBACpB,UAAU,CAAC,KAAK,CAAC,KAA4B,CAAC,CAAA;aAC/C;YACD,MAAK;SACN;QAED,KAAK,yCAAkB,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAI,UAAU,CAAC,MAAM,EAAE;gBACrB,UAAU,CAAC,MAAM,CAAC,KAA6B,CAAC,CAAA;aACjD;YACD,MAAK;SACN;QAED,KAAK,yCAAkB,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,UAAU,CAAC,SAAS,EAAE;gBACxB,UAAU,CAAC,SAAS,CAAC,KAAgC,CAAC,CAAA;aACvD;YACD,MAAK;SACN;QAED;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;KAChD;AACH,CAAC;AA1BD,wDA0BC","sourcesContent":["import { ContainedGroupField } from './contained-group-field'\r\nimport { ContainedSimpleField } from './contained-simple-field'\r\nimport { ContainedComponentField } from './contained-component-field'\r\nimport { ContainedField } from './contained-field'\r\nimport { IContainedFieldDispatcher } from './contained-field-dispatcher'\r\nimport { ContainedFieldType } from './contained-field-type'\r\n\r\nexport function dispatchContainedField (field: ContainedField, dispatcher: IContainedFieldDispatcher): void {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n if (dispatcher.group) {\r\n dispatcher.group(field as ContainedGroupField)\r\n }\r\n break\r\n }\r\n\r\n case ContainedFieldType.Simple: {\r\n if (dispatcher.simple) {\r\n dispatcher.simple(field as ContainedSimpleField)\r\n }\r\n break\r\n }\r\n\r\n case ContainedFieldType.Component: {\r\n if (dispatcher.component) {\r\n dispatcher.component(field as ContainedComponentField)\r\n }\r\n break\r\n }\r\n\r\n default:\r\n throw new Error(`unknown type ${field.type}`)\r\n }\r\n}\r\n"]}
@@ -0,0 +1,14 @@
1
+ import { ContainedGroupField } from './contained-group-field';
2
+ import { ContainedSimpleField } from './contained-simple-field';
3
+ import { ContainedComponentField } from './contained-component-field';
4
+ export interface IContainedFieldDispatcher {
5
+ group?: {
6
+ (field: ContainedGroupField): void;
7
+ };
8
+ simple?: {
9
+ (field: ContainedSimpleField): void;
10
+ };
11
+ component?: {
12
+ (field: ContainedComponentField): void;
13
+ };
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=contained-field-dispatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contained-field-dispatcher.js","sourceRoot":"","sources":["../../../src/dictionary/contained/contained-field-dispatcher.ts"],"names":[],"mappings":"","sourcesContent":["import { ContainedGroupField } from './contained-group-field'\r\nimport { ContainedSimpleField } from './contained-simple-field'\r\nimport { ContainedComponentField } from './contained-component-field'\r\n\r\nexport interface IContainedFieldDispatcher {\r\n group?: { (field: ContainedGroupField): void }\r\n simple?: { (field: ContainedSimpleField): void }\r\n component?: { (field: ContainedComponentField): void }\r\n}\r\n"]}
@@ -4,7 +4,7 @@ import { ContainedComponentField } from './contained-component-field';
4
4
  import { ContainedField } from './contained-field';
5
5
  import { ContainedGroupField } from './contained-group-field';
6
6
  import { ContainedSimpleField } from './contained-simple-field';
7
- import { ContainedSetType } from '../dict-primitive';
7
+ import { ContainedSetType } from '../contained-set-type';
8
8
  export declare abstract class ContainedFieldSet {
9
9
  readonly type: ContainedSetType;
10
10
  readonly name: string;
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ContainedFieldSet = void 0;
4
4
  const collections_1 = require("../../collections");
5
- const contained_field_1 = require("./contained-field");
6
- const buffer_1 = require("../../buffer");
5
+ const elastic_buffer_1 = require("../../buffer/elastic-buffer");
6
+ const contained_field_type_1 = require("./contained-field-type");
7
+ const tag_type_1 = require("../../buffer/tag/tag-type");
7
8
  class ContainedFieldSet {
8
9
  constructor(type, name, category, abbreviation, description) {
9
10
  this.type = type;
@@ -27,7 +28,7 @@ class ContainedFieldSet {
27
28
  this.containsRaw = false;
28
29
  }
29
30
  toString() {
30
- const buffer = new buffer_1.ElasticBuffer(2 * 1024);
31
+ const buffer = new elastic_buffer_1.ElasticBuffer(2 * 1024);
31
32
  const fields = this.fields;
32
33
  buffer.writeString(`Set: ${this.name}(${this.getPrefix()}) fields [${fields.length}]: `);
33
34
  const set = fields.map(f => f.toString());
@@ -43,11 +44,11 @@ class ContainedFieldSet {
43
44
  }
44
45
  addUpdate(field) {
45
46
  switch (field.type) {
46
- case contained_field_1.ContainedFieldType.Simple: {
47
+ case contained_field_type_1.ContainedFieldType.Simple: {
47
48
  this.addLocalSimple(field);
48
49
  break;
49
50
  }
50
- case contained_field_1.ContainedFieldType.Component: {
51
+ case contained_field_type_1.ContainedFieldType.Component: {
51
52
  const cf = field;
52
53
  const definition = cf.definition;
53
54
  if (definition.abbreviation && definition.abbreviation !== field.name) {
@@ -55,7 +56,7 @@ class ContainedFieldSet {
55
56
  }
56
57
  break;
57
58
  }
58
- case contained_field_1.ContainedFieldType.Group: {
59
+ case contained_field_type_1.ContainedFieldType.Group: {
59
60
  const gf = field;
60
61
  const definition = gf.definition;
61
62
  if (definition.abbreviation && definition.abbreviation !== field.name) {
@@ -88,15 +89,15 @@ class ContainedFieldSet {
88
89
  }
89
90
  addContained(parent, field) {
90
91
  switch (field.type) {
91
- case contained_field_1.ContainedFieldType.Group: {
92
+ case contained_field_type_1.ContainedFieldType.Group: {
92
93
  this.addGroupFieldDef(field);
93
94
  break;
94
95
  }
95
- case contained_field_1.ContainedFieldType.Component: {
96
+ case contained_field_type_1.ContainedFieldType.Component: {
96
97
  this.addComponentFieldDef(field);
97
98
  break;
98
99
  }
99
- case contained_field_1.ContainedFieldType.Simple: {
100
+ case contained_field_type_1.ContainedFieldType.Simple: {
100
101
  this.addSimpleFieldDef(parent, field);
101
102
  break;
102
103
  }
@@ -153,9 +154,9 @@ class ContainedFieldSet {
153
154
  this.firstSimple = field;
154
155
  }
155
156
  switch (field.definition.tagType) {
156
- case buffer_1.TagType.RawData: {
157
+ case tag_type_1.TagType.RawData: {
157
158
  const dataLengthField = parent.fields[field.position - 1];
158
- if (dataLengthField && dataLengthField.definition.tagType === buffer_1.TagType.Length) {
159
+ if (dataLengthField && dataLengthField.definition.tagType === tag_type_1.TagType.Length) {
159
160
  this.containedLength[dataLengthField.definition.tag] = true;
160
161
  this.containsRaw = true;
161
162
  }