jspurefix 1.1.2 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +1 -1
- package/README.md +48 -2
- package/appveyor.yml +43 -11
- package/data/FIX44-MD.xml +6596 -0
- package/data/examples/FIX.4.4/jsfix.test_client.txt +15 -13
- package/data/session/test-qf44-acceptor.json +21 -0
- package/data/session/test-qf44-initiator.json +22 -0
- package/dist/buffer/ascii/ascii-encoder.d.ts +9 -2
- package/dist/buffer/ascii/ascii-encoder.js +72 -31
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser.d.ts +1 -0
- package/dist/buffer/ascii/ascii-parser.js +7 -1
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.d.ts +0 -2
- package/dist/buffer/ascii/ascii-segment-parser.js +19 -25
- package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +2 -0
- package/dist/buffer/ascii/ascii-view.js +4 -0
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/ascii/time-formatter.js.map +1 -1
- package/dist/buffer/ascii-chars.d.ts +1 -0
- package/dist/buffer/ascii-chars.js +1 -0
- package/dist/buffer/ascii-chars.js.map +1 -1
- package/dist/buffer/elastic-buffer.d.ts +1 -0
- package/dist/buffer/elastic-buffer.js +8 -0
- package/dist/buffer/elastic-buffer.js.map +1 -1
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.d.ts +3 -0
- package/dist/buffer/fixml/fixml-encoder.js +6 -0
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.d.ts +2 -0
- package/dist/buffer/fixml/fixml-view.js +3 -0
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/msg-encoder.d.ts +2 -0
- package/dist/buffer/msg-encoder.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +2 -0
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/buffer/tags.js +5 -5
- package/dist/buffer/tags.js.map +1 -1
- package/dist/collections/dictionary.d.ts +1 -0
- package/dist/collections/dictionary.js +5 -0
- package/dist/collections/dictionary.js.map +1 -1
- package/dist/config/js-fix-config.d.ts +2 -0
- package/dist/config/js-fix-config.js +1 -0
- package/dist/config/js-fix-config.js.map +1 -1
- package/dist/dict-parser.js +2 -2
- package/dist/dict-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-set-parser.js +11 -4
- package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/message-parser.js +4 -0
- package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -0
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +15 -0
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/jsfix-cmd.js +2 -1
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/sample/http/oms/app.js +2 -0
- package/dist/sample/http/oms/app.js.map +1 -1
- package/dist/sample/launcher.d.ts +3 -2
- package/dist/sample/launcher.js +12 -3
- package/dist/sample/launcher.js.map +1 -1
- package/dist/sample/tcp/{trade_capture → qf-md}/app.d.ts +0 -0
- package/dist/sample/tcp/qf-md/app.js +22 -0
- package/dist/sample/tcp/qf-md/app.js.map +1 -0
- package/dist/sample/tcp/qf-md/md-client.d.ts +15 -0
- package/dist/sample/tcp/qf-md/md-client.js +42 -0
- package/dist/sample/tcp/qf-md/md-client.js.map +1 -0
- package/dist/sample/tcp/qf-md/md-factory.d.ts +4 -0
- package/dist/sample/tcp/qf-md/md-factory.js +35 -0
- package/dist/sample/tcp/qf-md/md-factory.js.map +1 -0
- package/dist/sample/tcp/qf-md/md-server.d.ts +16 -0
- package/dist/sample/tcp/qf-md/md-server.js +44 -0
- package/dist/sample/tcp/qf-md/md-server.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -0
- package/dist/sample/tcp/recovering-skeleton/app.js +27 -0
- package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +2 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js +3 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +7 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +52 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +16 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +45 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.d.ts +16 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +52 -0
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -0
- package/dist/sample/tcp/skeleton/app.js +2 -0
- package/dist/sample/tcp/skeleton/app.js.map +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.d.ts +5 -1
- package/dist/sample/tcp/skeleton/skeleton-session.js +22 -3
- package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/app.d.ts +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/app.js +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/app.js.map +1 -1
- package/dist/sample/tcp/{trade_capture → trade-capture}/index.d.ts +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/index.js +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/index.js.map +1 -1
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.d.ts +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.js +8 -4
- package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.d.ts +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.js +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.d.ts +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.js +0 -0
- package/dist/sample/tcp/{trade_capture → trade-capture}/trade-factory.js.map +1 -1
- package/dist/store/fix-msg-ascii-store-resend.d.ts +6 -2
- package/dist/store/fix-msg-ascii-store-resend.js +49 -22
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-memory-store.d.ts +11 -8
- package/dist/store/fix-msg-memory-store.js +108 -42
- package/dist/store/fix-msg-memory-store.js.map +1 -1
- package/dist/store/fix-msg-store-record.d.ts +7 -3
- package/dist/store/fix-msg-store-record.js +5 -1
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/store/fix-msg-store.d.ts +13 -9
- package/dist/store/fix-msg-store.js.map +1 -1
- package/dist/test/ascii-encode.test.js +20 -3
- package/dist/test/ascii-encode.test.js.map +1 -1
- package/dist/test/ascii-encoder.test.d.ts +1 -0
- package/dist/test/ascii-encoder.test.js +505 -0
- package/dist/test/ascii-encoder.test.js.map +1 -0
- package/dist/test/ascii-parser.test.js +8 -6
- package/dist/test/ascii-parser.test.js.map +1 -1
- package/dist/test/ascii-segment.test.js +6 -5
- package/dist/test/ascii-segment.test.js.map +1 -1
- package/dist/test/ascii-store-replay.test.js +59 -44
- package/dist/test/ascii-store-replay.test.js.map +1 -1
- package/dist/test/logon.test.js +1 -1
- package/dist/test/logon.test.js.map +1 -1
- package/dist/test/memory-store.test.js +24 -19
- package/dist/test/memory-store.test.js.map +1 -1
- package/dist/test/qf-full-msg.test.js +19 -14
- package/dist/test/qf-full-msg.test.js.map +1 -1
- package/dist/test/repo-full-ascii-msg.test.js +17 -15
- package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
- package/dist/test/repo-full-fixml-msg.test.js +14 -14
- package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
- package/dist/test/session-state.test.js +2 -2
- package/dist/test/session-state.test.js.map +1 -1
- package/dist/test/session.test.js +263 -143
- package/dist/test/session.test.js.map +1 -1
- package/dist/test/view-decode.test.js +2 -1
- package/dist/test/view-decode.test.js.map +1 -1
- package/dist/transport/a-session-msg-factory.d.ts +23 -0
- package/dist/transport/a-session-msg-factory.js +58 -0
- package/dist/transport/a-session-msg-factory.js.map +1 -0
- package/dist/transport/ascii/ascii-msg-transmitter.d.ts +1 -0
- package/dist/transport/ascii/ascii-msg-transmitter.js +39 -8
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.d.ts +16 -0
- package/dist/transport/ascii/ascii-session-msg-factory.js +47 -0
- package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -0
- package/dist/transport/ascii/ascii-session.d.ts +10 -2
- package/dist/transport/ascii/ascii-session.js +86 -31
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/ascii/index.d.ts +1 -0
- package/dist/transport/ascii/index.js +1 -0
- package/dist/transport/ascii/index.js.map +1 -1
- package/dist/transport/ascii-session-msg-factory.d.ts +16 -0
- package/dist/transport/ascii-session-msg-factory.js +47 -0
- package/dist/transport/ascii-session-msg-factory.js.map +1 -0
- package/dist/transport/duplex/http-duplex.js +2 -2
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/dist/transport/fix-msg-factory.d.ts +1 -1
- package/dist/transport/fix-msg-factory.js.map +1 -1
- package/dist/transport/fix-session-state.d.ts +38 -12
- package/dist/transport/fix-session-state.js +49 -15
- package/dist/transport/fix-session-state.js.map +1 -1
- package/dist/transport/fix-session.d.ts +13 -6
- package/dist/transport/fix-session.js +143 -39
- package/dist/transport/fix-session.js.map +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.d.ts +13 -0
- package/dist/transport/fixml/fixml-session-msg-factory.js +68 -0
- package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -0
- package/dist/transport/fixml/fixml-session.js +1 -1
- package/dist/transport/fixml/fixml-session.js.map +1 -1
- package/dist/transport/fixml/index.d.ts +2 -1
- package/dist/transport/fixml/index.js +2 -1
- package/dist/transport/fixml/index.js.map +1 -1
- package/dist/transport/fixml-session-msg-factory.d.ts +13 -0
- package/dist/transport/fixml-session-msg-factory.js +68 -0
- package/dist/transport/fixml-session-msg-factory.js.map +1 -0
- package/dist/transport/http/http-acceptor.js +8 -7
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/msg-transmitter.js +4 -3
- package/dist/transport/msg-transmitter.js.map +1 -1
- package/dist/transport/msg-transport.js +3 -2
- package/dist/transport/msg-transport.js.map +1 -1
- package/dist/transport/session-description.d.ts +1 -1
- package/dist/transport/session-description.js.map +1 -1
- package/dist/transport/session-msg-factory.d.ts +2 -2
- package/dist/transport/session-msg-factory.js +2 -2
- package/dist/transport/session-msg-factory.js.map +1 -1
- package/dist/transport/tcp/acceptor.js +5 -3
- package/dist/transport/tcp/acceptor.js.map +1 -1
- package/dist/transport/tcp/index.d.ts +1 -0
- package/dist/transport/tcp/index.js +1 -0
- package/dist/transport/tcp/index.js.map +1 -1
- package/dist/transport/tcp/initiator.js +1 -0
- package/dist/transport/tcp/initiator.js.map +1 -1
- package/dist/transport/tcp/recovering-initiator.d.ts +17 -0
- package/dist/transport/tcp/recovering-initiator.js +30 -0
- package/dist/transport/tcp/recovering-initiator.js.map +1 -0
- package/dist/transport/tcp/recovering-tcp-initiator.d.ts +28 -0
- package/dist/transport/tcp/recovering-tcp-initiator.js +120 -0
- package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -0
- package/dist/transport/tcp/tcp-acceptor.d.ts +7 -0
- package/dist/transport/tcp/tcp-acceptor.js +43 -11
- package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator.d.ts +4 -0
- package/dist/transport/tcp/tcp-initiator.js +72 -35
- package/dist/transport/tcp/tcp-initiator.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/advertisement.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/advertisement.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_instruction.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_instruction.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_instruction_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_instruction_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/allocation_report_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/allocation_report_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/assignment_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/assignment_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/bid_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/bid_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/bid_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/bid_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/business_message_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/business_message_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_assignment.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_assignment.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_inquiry.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_inquiry.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_inquiry_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_inquiry_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/collateral_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/collateral_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/confirmation.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/confirmation.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/confirmation_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/confirmation_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/confirmation_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/confirmation_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_replace_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_replace_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/cross_order_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/derivative_security_list.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/derivative_security_list.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/derivative_security_list_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/derivative_security_list_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/dont_know_trade.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/dont_know_trade.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/email.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/email.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/execution_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/execution_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/heartbeat.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/heartbeat.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/index.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/index.js +4 -0
- package/dist/types/FIX4.4/quickfix/index.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/ioi.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/ioi.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_execute.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_execute.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_status.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_status.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/list_strike_price.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/list_strike_price.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/logon.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/logon.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/logout.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/logout.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_incremental_refresh.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_incremental_refresh.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_request_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_request_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/mass_quote.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/mass_quote.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/mass_quote_acknowledgement.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/mass_quote_acknowledgement.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/multileg_order_cancel_replace.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/multileg_order_cancel_replace.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/network_counterparty_system_status_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_cross.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_cross.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_list.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_list.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_multileg.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_multileg.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/new_order_single.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/new_order_single.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/news.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/news.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_cancel_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_cancel_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_cancel_replace_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_cancel_replace_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_mass_cancel_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_mass_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_mass_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/order_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/order_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/position_maintenance_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/position_maintenance_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/position_maintenance_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/position_maintenance_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/position_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/position_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_cancel.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_cancel.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_request_reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_request_reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_status_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_status_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/quote_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/quote_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/registration_instructions.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/registration_instructions.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/registration_instructions_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/registration_instructions_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/reject.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/reject.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/request_for_positions.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/request_for_positions.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/request_for_positions_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/request_for_positions_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/resend_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/resend_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/rfq_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/rfq_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_definition.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_definition.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_definition_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_definition_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_list.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_list.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_list_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_list_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_status.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_status.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_type_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_type_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/security_types.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/security_types.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/sequence_reset.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/sequence_reset.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/set/header.d.ts +31 -0
- package/dist/types/FIX4.4/quickfix/set/header.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/header.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/hop.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/set/hop.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/hop.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/hop_no_hops.d.ts +5 -0
- package/dist/types/FIX4.4/quickfix/set/hop_no_hops.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/hop_no_hops.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/standard_header.d.ts +31 -0
- package/dist/types/FIX4.4/quickfix/set/standard_header.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/standard_header.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/standard_trailer.d.ts +6 -0
- package/dist/types/FIX4.4/quickfix/set/standard_trailer.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/standard_trailer.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +6 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/settlement_instruction_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/settlement_instruction_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/settlement_instructions.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/settlement_instructions.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/test_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/test_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request_ack.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trade_capture_report_request_ack.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trading_session_status.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trading_session_status.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/trading_session_status_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/trading_session_status_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/user_request.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/user_request.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/user_response.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/user_response.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/xm_lnon_fix.d.ts +4 -0
- package/dist/types/FIX4.4/quickfix/xm_lnon_fix.js.map +1 -1
- package/dist/types/FIX4.4/repo/enum/all-enum.js.map +1 -1
- package/package.json +25 -21
- package/script/build.sh +1 -0
- package/src/buffer/ascii/ascii-encoder.ts +110 -33
- package/src/buffer/ascii/ascii-parser.ts +8 -1
- package/src/buffer/ascii/ascii-segment-parser.ts +44 -38
- package/src/buffer/ascii/ascii-view.ts +5 -0
- package/src/buffer/ascii/time-formatter.ts +2 -2
- package/src/buffer/ascii-chars.ts +1 -0
- package/src/buffer/elastic-buffer.ts +9 -0
- package/src/buffer/encode-proxy.ts +2 -2
- package/src/buffer/fixml/fixml-encoder.ts +8 -0
- package/src/buffer/fixml/fixml-view.ts +5 -0
- package/src/buffer/msg-encoder.ts +2 -0
- package/src/buffer/msg-view.ts +3 -0
- package/src/buffer/tags.ts +1 -1
- package/src/collections/dictionary.ts +6 -0
- package/src/config/js-fix-config.ts +2 -0
- package/src/dictionary/parser/quickfix/field-set-parser.ts +11 -4
- package/src/dictionary/parser/quickfix/message-parser.ts +4 -0
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +16 -0
- package/src/jsfix-cmd.ts +2 -1
- package/src/sample/http/oms/app.ts +2 -0
- package/src/sample/launcher.ts +17 -7
- package/src/sample/tcp/qf-md/app.ts +26 -0
- package/src/sample/tcp/qf-md/md-client.ts +51 -0
- package/src/sample/tcp/qf-md/md-factory.ts +34 -0
- package/src/sample/tcp/qf-md/md-server.ts +56 -0
- package/src/sample/tcp/recovering-skeleton/app.ts +33 -0
- package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +41 -0
- package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +54 -0
- package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +60 -0
- package/src/sample/tcp/skeleton/app.ts +2 -0
- package/src/sample/tcp/skeleton/skeleton-session.ts +26 -4
- package/src/sample/tcp/tls-trade-capture/app.ts +1 -1
- package/src/sample/tcp/{trade_capture → trade-capture}/app.ts +0 -0
- package/src/sample/tcp/{trade_capture → trade-capture}/index.ts +0 -0
- package/src/sample/tcp/{trade_capture → trade-capture}/trade-capture-client.ts +10 -5
- package/src/sample/tcp/{trade_capture → trade-capture}/trade-capture-server.ts +2 -2
- package/src/sample/tcp/{trade_capture → trade-capture}/trade-factory.ts +0 -0
- package/src/store/fix-msg-ascii-store-resend.ts +87 -0
- package/src/store/fix-msg-memory-store.ts +171 -0
- package/src/store/fix-msg-store-record.ts +23 -0
- package/src/store/fix-msg-store.ts +23 -0
- package/src/store/index.ts +4 -0
- package/src/transport/a-session-msg-factory.ts +81 -0
- package/src/transport/ascii/ascii-msg-transmitter.ts +32 -11
- package/src/transport/ascii/ascii-session-msg-factory.ts +62 -0
- package/src/transport/ascii/ascii-session.ts +100 -36
- package/src/transport/ascii/index.ts +1 -0
- package/src/transport/duplex/http-duplex.ts +2 -2
- package/src/transport/fix-msg-factory.ts +1 -1
- package/src/transport/fix-session-state.ts +67 -15
- package/src/transport/fix-session.ts +156 -43
- package/src/transport/fixml/fixml-session-msg-factory.ts +76 -0
- package/src/transport/fixml/fixml-session.ts +1 -1
- package/src/transport/fixml/index.ts +2 -1
- package/src/transport/http/http-acceptor.ts +7 -6
- package/src/transport/index.ts +1 -1
- package/src/transport/msg-transmitter.ts +4 -3
- package/src/transport/msg-transport.ts +3 -2
- package/src/transport/session-description.ts +1 -1
- package/src/transport/tcp/acceptor.ts +5 -3
- package/src/transport/tcp/index.ts +1 -0
- package/src/transport/tcp/initiator.ts +1 -0
- package/src/transport/tcp/recovering-tcp-initiator.ts +149 -0
- package/src/transport/tcp/tcp-acceptor.ts +46 -11
- package/src/transport/tcp/tcp-initiator.ts +77 -40
- package/src/types/FIX4.4/quickfix/advertisement.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_instruction.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_instruction_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/allocation_report_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/assignment_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/bid_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/bid_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/business_message_reject.ts +5 -0
- package/src/types/FIX4.4/quickfix/collateral_assignment.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_inquiry.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_inquiry_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/collateral_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/confirmation.ts +4 -0
- package/src/types/FIX4.4/quickfix/confirmation_ack.ts +5 -0
- package/src/types/FIX4.4/quickfix/confirmation_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/cross_order_cancel_replace_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/cross_order_cancel_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/derivative_security_list.ts +4 -0
- package/src/types/FIX4.4/quickfix/derivative_security_list_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/dont_know_trade.ts +4 -0
- package/src/types/FIX4.4/quickfix/email.ts +4 -0
- package/src/types/FIX4.4/quickfix/execution_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/heartbeat.ts +5 -0
- package/src/types/FIX4.4/quickfix/index.ts +4 -0
- package/src/types/FIX4.4/quickfix/ioi.ts +4 -0
- package/src/types/FIX4.4/quickfix/list_cancel_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/list_execute.ts +6 -1
- package/src/types/FIX4.4/quickfix/list_status.ts +4 -0
- package/src/types/FIX4.4/quickfix/list_status_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/list_strike_price.ts +4 -0
- package/src/types/FIX4.4/quickfix/logon.ts +4 -0
- package/src/types/FIX4.4/quickfix/logout.ts +6 -1
- package/src/types/FIX4.4/quickfix/market_data_incremental_refresh.ts +4 -0
- package/src/types/FIX4.4/quickfix/market_data_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/market_data_request_reject.ts +4 -0
- package/src/types/FIX4.4/quickfix/market_data_snapshot_full_refresh.ts +4 -0
- package/src/types/FIX4.4/quickfix/mass_quote.ts +4 -0
- package/src/types/FIX4.4/quickfix/mass_quote_acknowledgement.ts +4 -0
- package/src/types/FIX4.4/quickfix/multileg_order_cancel_replace.ts +4 -0
- package/src/types/FIX4.4/quickfix/network_counterparty_system_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/network_counterparty_system_status_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_cross.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_list.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_multileg.ts +4 -0
- package/src/types/FIX4.4/quickfix/new_order_single.ts +4 -0
- package/src/types/FIX4.4/quickfix/news.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_cancel_reject.ts +5 -0
- package/src/types/FIX4.4/quickfix/order_cancel_replace_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_cancel_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_mass_cancel_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_mass_cancel_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_mass_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/order_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/position_maintenance_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/position_maintenance_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/position_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_cancel.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_request_reject.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_status_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/quote_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/registration_instructions.ts +4 -0
- package/src/types/FIX4.4/quickfix/registration_instructions_response.ts +4 -0
- package/src/types/FIX4.4/quickfix/reject.ts +6 -1
- package/src/types/FIX4.4/quickfix/request_for_positions.ts +4 -0
- package/src/types/FIX4.4/quickfix/request_for_positions_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/resend_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/rfq_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_definition.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_definition_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_list.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_list_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_status.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_status_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/security_type_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/security_types.ts +4 -0
- package/src/types/FIX4.4/quickfix/sequence_reset.ts +5 -0
- package/src/types/FIX4.4/quickfix/set/hop.ts +5 -0
- package/src/types/FIX4.4/quickfix/set/hop_no_hops.ts +5 -0
- package/src/types/FIX4.4/quickfix/set/standard_header.ts +31 -0
- package/src/types/FIX4.4/quickfix/set/standard_trailer.ts +5 -0
- package/src/types/FIX4.4/quickfix/settlement_instruction_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/settlement_instructions.ts +4 -0
- package/src/types/FIX4.4/quickfix/test_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report.ts +4 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report_request.ts +4 -0
- package/src/types/FIX4.4/quickfix/trade_capture_report_request_ack.ts +4 -0
- package/src/types/FIX4.4/quickfix/trading_session_status.ts +5 -0
- package/src/types/FIX4.4/quickfix/trading_session_status_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/user_request.ts +5 -0
- package/src/types/FIX4.4/quickfix/user_response.ts +5 -0
- package/src/types/FIX4.4/quickfix/xm_lnon_fix.ts +5 -0
- package/src/types/FIX4.4/repo/enum/all-enum.ts +0 -1
- package/dist/sample/tcp/tls-trade-capture/jsfix.test_client.txt +0 -77
- package/dist/sample/tcp/tls-trade-capture/jsfix.test_server.txt +0 -77
- package/dist/sample/tcp/trade_capture/jsfix.test_client.txt +0 -75
- package/dist/sample/tcp/trade_capture/jsfix.test_server.txt +0 -75
- package/dist/sample/tcp/trade_capture/trade-capture-client.js.map +0 -1
- package/dist/sample/tcp/trade_capture/trade-capture-server.js.map +0 -1
- package/src/transport/session-msg-factory.ts +0 -195
- package/src/transport/tcp/resilient-initiator.ts +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jspurefix",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "pure node js fix engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
"repo44-bench-sd": "cd dist && node jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/security-definition/fix.txt --benchmark --delimiter=\"|\" --repeats=150000",
|
|
38
38
|
"qf-bench-lo": "cd dist && node jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/quickfix/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
|
|
39
39
|
"fixml": "cd dist && node jsfix-cmd --dict=repofixml",
|
|
40
|
-
"tcp-
|
|
40
|
+
"tcp-qf-md": "cd dist/sample/tcp/qf-md && node app",
|
|
41
|
+
"tcp-tls-tc": "cd dist/sample/tcp/tls-trade-capture && node app",
|
|
42
|
+
"tcp-tc": "cd dist/sample/tcp/trade-capture && node app",
|
|
41
43
|
"tcp-sk": "cd dist/sample/tcp/skeleton && node app",
|
|
42
44
|
"http-oms": "cd dist/sample/http/oms && node app",
|
|
43
45
|
"repo40-compile": "cd dist && node jsfix-cmd \"--dict=repo40\" \"--compile\"",
|
|
@@ -59,38 +61,40 @@
|
|
|
59
61
|
"dependencies": {
|
|
60
62
|
"align-text": "^1.0.2",
|
|
61
63
|
"express": "^4.17.1",
|
|
62
|
-
"lodash": "^4.17.
|
|
64
|
+
"lodash": "^4.17.21",
|
|
63
65
|
"log4js": "^6.3.0",
|
|
64
|
-
"mathjs": "^
|
|
66
|
+
"mathjs": "^10.0.0",
|
|
65
67
|
"minimist": "^1.2.5",
|
|
66
68
|
"moment": "^2.29.1",
|
|
67
69
|
"node-fs-extra": "^0.8.2",
|
|
68
|
-
"request
|
|
70
|
+
"request": "^2.88.2",
|
|
71
|
+
"request-promise-native": "^1.0.9",
|
|
69
72
|
"sax": "^1.2.4",
|
|
70
|
-
"uuid": "^3.
|
|
73
|
+
"uuid": "^8.3.2",
|
|
71
74
|
"winston": "^3.3.3",
|
|
72
75
|
"word-wrap": "^1.2.3",
|
|
73
76
|
"xml2js": "^0.4.23",
|
|
74
|
-
"xmlbuilder": "^
|
|
77
|
+
"xmlbuilder": "^15.1.1",
|
|
75
78
|
"yauzl": "^2.10.0"
|
|
76
79
|
},
|
|
77
80
|
"devDependencies": {
|
|
78
|
-
"@types/express": "^4.17.
|
|
79
|
-
"@types/
|
|
80
|
-
"@types/
|
|
81
|
-
"@types/
|
|
82
|
-
"@types/
|
|
83
|
-
"@types/
|
|
84
|
-
"@types/
|
|
85
|
-
"@types/
|
|
86
|
-
"@types/
|
|
81
|
+
"@types/express": "^4.17.13",
|
|
82
|
+
"@types/express-serve-static-core": "^4.17.26",
|
|
83
|
+
"@types/jest": "^27.0.3",
|
|
84
|
+
"@types/lodash": "^4.14.177",
|
|
85
|
+
"@types/mathjs": "^9.4.1",
|
|
86
|
+
"@types/minimist": "^1.2.2",
|
|
87
|
+
"@types/node": "^16.11.11",
|
|
88
|
+
"@types/request-promise-native": "^1.0.18",
|
|
89
|
+
"@types/sax": "^1.2.3",
|
|
90
|
+
"@types/uuid": "^8.3.3",
|
|
87
91
|
"@types/winston": "^2.4.4",
|
|
88
|
-
"@types/xmlbuilder": "0.0.
|
|
89
|
-
"jest": "^
|
|
90
|
-
"standard": "^16.0.
|
|
91
|
-
"ts-jest": "^
|
|
92
|
+
"@types/xmlbuilder": "0.0.35",
|
|
93
|
+
"jest": "^27.4.3",
|
|
94
|
+
"standard": "^16.0.4",
|
|
95
|
+
"ts-jest": "^27.0.7",
|
|
92
96
|
"tslint": "^6.1.3",
|
|
93
97
|
"tslint-config-standard": "^9.0.0",
|
|
94
|
-
"typescript": "^4.
|
|
98
|
+
"typescript": "^4.5.2"
|
|
95
99
|
}
|
|
96
100
|
}
|
package/script/build.sh
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ILooseObject } from '../../collections/collection'
|
|
2
|
-
import { ContainedGroupField, ContainedSimpleField,
|
|
2
|
+
import { ContainedGroupField, ContainedSimpleField,
|
|
3
|
+
ContainedFieldSet, ContainedField,
|
|
4
|
+
ContainedComponentField, SimpleFieldDefinition,
|
|
5
|
+
FixDefinitions, dispatchFields } from '../../dictionary'
|
|
3
6
|
import { MsgEncoder } from '../msg-encoder'
|
|
4
7
|
import { ElasticBuffer } from '../elastic-buffer'
|
|
5
8
|
import { TimeFormatter } from './time-formatter'
|
|
@@ -11,50 +14,64 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
11
14
|
|
|
12
15
|
public bodyLengthPos: number
|
|
13
16
|
public msgTypePos: number
|
|
17
|
+
public tags: Tags
|
|
18
|
+
public checkGroups: boolean = true
|
|
14
19
|
|
|
15
20
|
constructor (public readonly buffer: ElasticBuffer,
|
|
16
21
|
public readonly definitions: FixDefinitions,
|
|
17
22
|
public readonly timeFormatter: ITimeFormatter = new TimeFormatter(buffer),
|
|
18
|
-
public readonly delimiter: number = AsciiChars.Soh
|
|
23
|
+
public readonly delimiter: number = AsciiChars.Soh,
|
|
24
|
+
public readonly logDelimiter: number = AsciiChars.Pipe) {
|
|
19
25
|
super(definitions)
|
|
26
|
+
this.tags = new Tags(definitions)
|
|
20
27
|
}
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
const first = gf.definition.fields[0]
|
|
33
|
-
switch (first.type) {
|
|
34
|
-
case ContainedFieldType.Component: {
|
|
35
|
-
const cf: ContainedComponentField = first as ContainedComponentField
|
|
36
|
-
instance = instance[cf.definition.name]
|
|
37
|
-
break
|
|
38
|
-
}
|
|
39
|
-
default:
|
|
40
|
-
instance = null
|
|
29
|
+
public trim (): Buffer {
|
|
30
|
+
const b = this.buffer.copy()
|
|
31
|
+
const delimiter = this.delimiter
|
|
32
|
+
const logDelimiter = this.logDelimiter
|
|
33
|
+
const tags = this.tags
|
|
34
|
+
if (delimiter !== logDelimiter) {
|
|
35
|
+
for (let p = 0; p < tags.nextTagPos; ++p) {
|
|
36
|
+
const tagPos = tags.tagPos[p]
|
|
37
|
+
b.writeUInt8(delimiter, tagPos.start + tagPos.len)
|
|
41
38
|
}
|
|
42
39
|
}
|
|
40
|
+
|
|
41
|
+
return b
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// only reset tags after entire message is encoded - <hdr>body<trl>
|
|
45
|
+
|
|
46
|
+
public reset (): void {
|
|
47
|
+
this.buffer.reset()
|
|
48
|
+
this.tags.reset()
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
public encodeSet (objectToEncode: ILooseObject, set: ContainedFieldSet): void {
|
|
52
|
+
const summary: AsciiEncodeSetSummary = new AsciiEncodeSetSummary()
|
|
53
|
+
this.encodeObject(objectToEncode, set, summary)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private encodeObject (objectToEncode: ILooseObject, set: ContainedFieldSet, state: AsciiEncodeSetSummary): void {
|
|
46
57
|
const fields: ContainedField[] = this.getFields(set, objectToEncode)
|
|
47
58
|
dispatchFields(fields, {
|
|
48
59
|
simple: (sf: ContainedSimpleField) => {
|
|
49
60
|
const val: any = objectToEncode[sf.name]
|
|
50
|
-
|
|
61
|
+
// Empty strings are omitted as they result in empty values for tags, which are considered malformed.
|
|
62
|
+
if (val != null && val !== '') {
|
|
63
|
+
if (state.count === 0) {
|
|
64
|
+
state.firstSimple = sf
|
|
65
|
+
}
|
|
66
|
+
state.lastSimple = sf
|
|
67
|
+
state.count++
|
|
51
68
|
this.encodeSimple(objectToEncode, set, sf, val)
|
|
52
69
|
}
|
|
53
70
|
},
|
|
54
71
|
component: (cf: ContainedComponentField) => {
|
|
55
72
|
const instance: ILooseObject = objectToEncode[cf.definition.name]
|
|
56
73
|
if (instance) {
|
|
57
|
-
this.
|
|
74
|
+
this.encodeObject(instance, cf.definition, state)
|
|
58
75
|
}
|
|
59
76
|
},
|
|
60
77
|
group: (gf: ContainedGroupField) => {
|
|
@@ -80,23 +97,29 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
80
97
|
private encodeInstances (o: ILooseObject, gf: ContainedGroupField): void {
|
|
81
98
|
const noOfField: SimpleFieldDefinition = gf.definition.noOfField
|
|
82
99
|
const instances: ILooseObject[] = o[gf.name] || o[noOfField.name]
|
|
100
|
+
|
|
83
101
|
const buffer = this.buffer
|
|
84
102
|
if (!Array.isArray(instances)) {
|
|
85
103
|
throw new Error(`expected array instance for group ${noOfField.name}`)
|
|
86
104
|
}
|
|
87
105
|
if (instances) {
|
|
106
|
+
const validator = new GroupValidator(gf)
|
|
107
|
+
const test: AsciiEncodeSetSummary = validator.test
|
|
108
|
+
|
|
88
109
|
// a repeated group has number of instances at the start of group
|
|
89
110
|
this.WriteTagEquals(noOfField.tag)
|
|
111
|
+
const posValBegin = buffer.getPos()
|
|
90
112
|
buffer.writeWholeNumber(instances.length)
|
|
91
|
-
|
|
92
|
-
instances.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
this.writeDelimiter(posValBegin, noOfField.tag)
|
|
114
|
+
for (let field = 0; field < instances.length; ++field) {
|
|
115
|
+
const instance: ILooseObject = instances[field]
|
|
116
|
+
test.reset()
|
|
117
|
+
const summary = validator.getSummary(field)
|
|
118
|
+
this.encodeObject(instance, gf.definition, summary)
|
|
119
|
+
if (this.checkGroups) {
|
|
120
|
+
validator.assertInstanceValid(field)
|
|
98
121
|
}
|
|
99
|
-
}
|
|
122
|
+
}
|
|
100
123
|
}
|
|
101
124
|
}
|
|
102
125
|
|
|
@@ -106,13 +129,21 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
106
129
|
buffer.writeChar(AsciiChars.Equal)
|
|
107
130
|
}
|
|
108
131
|
|
|
132
|
+
private writeDelimiter (posValBegin: number, tag: number): void {
|
|
133
|
+
const delimiter = this.logDelimiter
|
|
134
|
+
const buffer = this.buffer
|
|
135
|
+
this.tags.store(posValBegin, buffer.getPos() - posValBegin, tag)
|
|
136
|
+
buffer.writeChar(delimiter)
|
|
137
|
+
}
|
|
138
|
+
|
|
109
139
|
private encodeSimple (o: ILooseObject, set: ContainedFieldSet, sf: ContainedSimpleField, val: any): void {
|
|
110
140
|
const definition = sf.definition
|
|
111
141
|
const tag: number = definition.tag
|
|
112
142
|
const buffer = this.buffer
|
|
113
|
-
const delimiter = this.
|
|
143
|
+
const delimiter = this.logDelimiter
|
|
114
144
|
const tf = this.timeFormatter
|
|
115
145
|
const pos = buffer.getPos()
|
|
146
|
+
let posValBegin = 0
|
|
116
147
|
|
|
117
148
|
let tagType: TagType
|
|
118
149
|
if (typeof val === 'string') {
|
|
@@ -141,6 +172,7 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
141
172
|
|
|
142
173
|
default: {
|
|
143
174
|
this.WriteTagEquals(tag)
|
|
175
|
+
posValBegin = buffer.getPos()
|
|
144
176
|
break
|
|
145
177
|
}
|
|
146
178
|
}
|
|
@@ -197,6 +229,7 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
197
229
|
}
|
|
198
230
|
this.WriteTagEquals(tag)
|
|
199
231
|
buffer.writeBuffer(b)
|
|
232
|
+
posValBegin = buffer.getPos()
|
|
200
233
|
break
|
|
201
234
|
}
|
|
202
235
|
|
|
@@ -206,7 +239,7 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
206
239
|
}
|
|
207
240
|
}
|
|
208
241
|
|
|
209
|
-
|
|
242
|
+
this.writeDelimiter(posValBegin, tag)
|
|
210
243
|
|
|
211
244
|
switch (tag) {
|
|
212
245
|
case Tags.BodyLengthTag:
|
|
@@ -219,3 +252,47 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
219
252
|
}
|
|
220
253
|
}
|
|
221
254
|
}
|
|
255
|
+
|
|
256
|
+
class GroupValidator {
|
|
257
|
+
constructor (public readonly gf: ContainedGroupField,
|
|
258
|
+
public readonly first: AsciiEncodeSetSummary = new AsciiEncodeSetSummary(),
|
|
259
|
+
public readonly test: AsciiEncodeSetSummary = new AsciiEncodeSetSummary()) {
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
getSummary (field: number) {
|
|
263
|
+
return field === 0 ? this.first : this.test
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
assertInstanceValid (field: number): void {
|
|
267
|
+
const first = this.first
|
|
268
|
+
const test = this.test
|
|
269
|
+
if (field === 0 && first.empty()) {
|
|
270
|
+
throw new Error(`first group instance has no delimeter present ${this.gf.name}`)
|
|
271
|
+
}
|
|
272
|
+
if (field > 0 && test.empty()) {
|
|
273
|
+
throw new Error(`group instance [${field}] has no delimeter present ${this.gf.name}`)
|
|
274
|
+
}
|
|
275
|
+
if (field > 0) {
|
|
276
|
+
const firstTag = first.firstSimple.definition.tag
|
|
277
|
+
const tag = test.firstSimple.definition.tag
|
|
278
|
+
if (firstTag !== tag) {
|
|
279
|
+
throw new Error(`group instance [${field}] inconsisent delimeter ${tag} expected tag ${firstTag}`)
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
class AsciiEncodeSetSummary {
|
|
286
|
+
constructor (public firstSimple: ContainedSimpleField = null,
|
|
287
|
+
public lastSimple: ContainedSimpleField = null,
|
|
288
|
+
public count: number = 0) {
|
|
289
|
+
}
|
|
290
|
+
public reset (): void {
|
|
291
|
+
this.firstSimple = null
|
|
292
|
+
this.lastSimple = null
|
|
293
|
+
this.count = 0
|
|
294
|
+
}
|
|
295
|
+
public empty (): boolean {
|
|
296
|
+
return this.firstSimple === null || this.count === 0
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -33,7 +33,9 @@ export class AsciiParser extends MsgParser {
|
|
|
33
33
|
this.state = new AsciiParserState(this.receivingBuffer)
|
|
34
34
|
this.state.locations = new Tags(definitions, maxMessageLen / 10)
|
|
35
35
|
this.state.beginMessage()
|
|
36
|
-
|
|
36
|
+
if (readStream !== null) {
|
|
37
|
+
this.subscribe()
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
private subscribe (): void {
|
|
@@ -77,6 +79,11 @@ export class AsciiParser extends MsgParser {
|
|
|
77
79
|
state.beginMessage()
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
public parseText (text: string) {
|
|
83
|
+
const buff = Buffer.from(text)
|
|
84
|
+
this.parse(buff, buff.length)
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
private parse (readBuffer: Buffer, end: number): void {
|
|
81
88
|
const state = this.state
|
|
82
89
|
const eq: number = AsciiChars.Eq
|
|
@@ -1,61 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ContainedComponentField,
|
|
3
|
+
ContainedFieldType,
|
|
4
|
+
ContainedGroupField,
|
|
5
|
+
ContainedSimpleField,
|
|
6
|
+
FixDefinitions,
|
|
7
|
+
MessageDefinition
|
|
8
|
+
} from '../..'
|
|
2
9
|
import { SegmentDescription, SegmentType } from '../segment-description'
|
|
3
10
|
import { Structure } from '../structure'
|
|
4
11
|
import { Tags } from '../tags'
|
|
5
|
-
import { MsgTag } from '../../types'
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
// this takes linear time i.e. it constantly makes forward progress
|
|
14
|
+
// one tag at a time
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
private readonly trailerDefinition: ComponentFieldDefinition
|
|
16
|
+
export class AsciiSegmentParser {
|
|
11
17
|
|
|
12
18
|
constructor (public readonly definitions: FixDefinitions) {
|
|
13
|
-
this.headerDefinition = definitions.component.get('header')
|
|
14
|
-
this.trailerDefinition = definitions.component.get('trailer')
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
public parse (msgType: string, tags: Tags, last: number): Structure {
|
|
22
|
+
// completed segments in that they are fully parsed
|
|
18
23
|
const segments: SegmentDescription[] = []
|
|
19
|
-
const tr = this.trailerDefinition
|
|
20
|
-
const hd = this.headerDefinition
|
|
21
24
|
const msgDefinition: MessageDefinition = this.definitions.message.get(msgType)
|
|
22
25
|
if (!msgDefinition) {
|
|
23
26
|
return null
|
|
24
27
|
}
|
|
28
|
+
// in process of being discovered and may have any amount of depth
|
|
29
|
+
// i.e. a component containing a repeated group of components
|
|
30
|
+
// with sub-groups of components
|
|
25
31
|
const structureStack: SegmentDescription[] = []
|
|
26
32
|
let currentTagPosition: number = 0
|
|
27
|
-
// let currentContainedField: ContainedField;
|
|
28
33
|
let peek: SegmentDescription
|
|
29
34
|
|
|
30
|
-
function init (): void {
|
|
31
|
-
const firstTag: number = tags.tagPos[0].tag
|
|
32
|
-
structureStack[structureStack.length] = new SegmentDescription(tr.name, tags.tagPos[last].tag, tr,
|
|
33
|
-
currentTagPosition, structureStack.length, SegmentType.Component)
|
|
34
|
-
structureStack[structureStack.length] = new SegmentDescription(msgDefinition.name, firstTag, msgDefinition,
|
|
35
|
-
currentTagPosition, structureStack.length, SegmentType.Msg)
|
|
36
|
-
structureStack[structureStack.length] = new SegmentDescription(hd.name, firstTag, hd,
|
|
37
|
-
currentTagPosition, structureStack.length, SegmentType.Component)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
35
|
// having finished one segments keep unwinding until tag matches further up stack
|
|
41
36
|
function unwind (tag: number): void {
|
|
42
37
|
while (structureStack.length > 1) {
|
|
43
38
|
const done: SegmentDescription = structureStack.pop()
|
|
44
39
|
done.end(segments.length, currentTagPosition - 1, tags.tagPos[currentTagPosition - 1].tag)
|
|
45
|
-
segments
|
|
40
|
+
segments.push(done)
|
|
46
41
|
peek = structureStack[structureStack.length - 1]
|
|
47
42
|
if (peek.set.containedTag[tag]) {
|
|
48
43
|
// unwound to point this tag lives in this set.
|
|
49
44
|
break
|
|
50
45
|
}
|
|
51
|
-
if (peek.type === SegmentType.Msg
|
|
46
|
+
if (peek.type === SegmentType.Msg) {
|
|
52
47
|
// this is unknown tag and it is not part of trailer so raise unknown
|
|
53
48
|
break
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
function examine (tag: number):
|
|
53
|
+
function examine (tag: number): SegmentDescription {
|
|
54
|
+
let structure: SegmentDescription = null
|
|
59
55
|
switch (peek.currentField.type) {
|
|
60
56
|
|
|
61
57
|
case ContainedFieldType.Simple: {
|
|
@@ -68,16 +64,15 @@ export class AsciiSegmentParser {
|
|
|
68
64
|
// moving deeper into structure, start a new context
|
|
69
65
|
case ContainedFieldType.Component: {
|
|
70
66
|
const cf: ContainedComponentField = peek.currentField as ContainedComponentField
|
|
71
|
-
|
|
72
|
-
currentTagPosition, structureStack.length
|
|
67
|
+
structure = new SegmentDescription(cf.name, tag, cf.definition,
|
|
68
|
+
currentTagPosition, structureStack.length, SegmentType.Component)
|
|
73
69
|
break
|
|
74
70
|
}
|
|
75
|
-
|
|
71
|
+
// for a group also need to know where all delimiters are positioned
|
|
76
72
|
case ContainedFieldType.Group: {
|
|
77
73
|
const gf: ContainedComponentField = peek.currentField as ContainedGroupField
|
|
78
|
-
|
|
79
|
-
currentTagPosition, structureStack.length
|
|
80
|
-
structureStack[structureStack.length] = structure
|
|
74
|
+
structure = new SegmentDescription(gf.name, tag, gf.definition,
|
|
75
|
+
currentTagPosition, structureStack.length, SegmentType.Group)
|
|
81
76
|
currentTagPosition = currentTagPosition + 1
|
|
82
77
|
structure.startGroup(tags.tagPos[currentTagPosition].tag)
|
|
83
78
|
break
|
|
@@ -86,6 +81,8 @@ export class AsciiSegmentParser {
|
|
|
86
81
|
default:
|
|
87
82
|
throw new Error(`unknown tag type ${tag}`)
|
|
88
83
|
}
|
|
84
|
+
|
|
85
|
+
return structure
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
function groupDelimiter (tag: number): boolean {
|
|
@@ -104,7 +101,7 @@ export class AsciiSegmentParser {
|
|
|
104
101
|
const gap = new SegmentDescription('.undefined', tag, peek.set,
|
|
105
102
|
currentTagPosition, structureStack.length, SegmentType.Gap)
|
|
106
103
|
gap.end(segments.length, currentTagPosition, tag)
|
|
107
|
-
segments
|
|
104
|
+
segments.push(gap)
|
|
108
105
|
currentTagPosition++
|
|
109
106
|
}
|
|
110
107
|
|
|
@@ -114,7 +111,8 @@ export class AsciiSegmentParser {
|
|
|
114
111
|
peek = structureStack[structureStack.length - 1]
|
|
115
112
|
peek.setCurrentField(tag)
|
|
116
113
|
if (!peek.set.containedTag[tag] || groupDelimiter(tag)) {
|
|
117
|
-
|
|
114
|
+
// unravelled all way back to root hence this is not recognised
|
|
115
|
+
const unknown = peek.type === SegmentType.Msg
|
|
118
116
|
if (unknown) {
|
|
119
117
|
gap(tag)
|
|
120
118
|
} else if (structureStack.length > 1) {
|
|
@@ -123,27 +121,35 @@ export class AsciiSegmentParser {
|
|
|
123
121
|
}
|
|
124
122
|
continue
|
|
125
123
|
}
|
|
126
|
-
examine(tag)
|
|
124
|
+
const structure = examine(tag)
|
|
125
|
+
if (structure) {
|
|
126
|
+
structureStack.push(structure)
|
|
127
|
+
}
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
function clean (): void {
|
|
132
|
+
// any remainder components can be closed.
|
|
131
133
|
while (structureStack.length > 0) {
|
|
132
134
|
const done: SegmentDescription = structureStack.pop()
|
|
133
135
|
done.end(segments.length, currentTagPosition - 1, tags.tagPos[currentTagPosition - 1].tag)
|
|
134
136
|
segments[segments.length] = done
|
|
135
137
|
}
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
// logically reverse the trailer and message so trailer is last in list.
|
|
139
|
+
const m1 = segments.length - 1
|
|
140
|
+
const m2 = segments.length - 2
|
|
141
|
+
const tmp = segments[m1]
|
|
142
|
+
segments[m1] = segments[m2]
|
|
143
|
+
segments[m2] = tmp
|
|
141
144
|
}
|
|
142
145
|
|
|
143
|
-
|
|
146
|
+
const msgStructure = new SegmentDescription(msgDefinition.name, tags.tagPos[0].tag, msgDefinition,
|
|
147
|
+
currentTagPosition, structureStack.length, SegmentType.Msg)
|
|
148
|
+
structureStack.push(msgStructure)
|
|
144
149
|
discover()
|
|
145
150
|
clean()
|
|
146
151
|
|
|
152
|
+
// now know where all components and groups are positioned within message
|
|
147
153
|
return new Structure(tags, segments)
|
|
148
154
|
}
|
|
149
155
|
}
|
|
@@ -8,6 +8,7 @@ import { ITimeFormatter } from './itime-formatter'
|
|
|
8
8
|
import { TimeFormatter } from './time-formatter'
|
|
9
9
|
import { TagPos } from '../tag-pos'
|
|
10
10
|
import { MsgTag } from '../../types'
|
|
11
|
+
import { FixMsgStoreRecord, IFixMsgStoreRecord } from '../../store'
|
|
11
12
|
|
|
12
13
|
export class AsciiView extends MsgView {
|
|
13
14
|
private readonly timeFormatter: ITimeFormatter = new TimeFormatter(this.buffer)
|
|
@@ -34,6 +35,10 @@ export class AsciiView extends MsgView {
|
|
|
34
35
|
return new AsciiView(segment, buffer, null, this.ptr, delimiter, writeDelimiter)
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
public toMsgStoreRecord (): IFixMsgStoreRecord {
|
|
39
|
+
return new FixMsgStoreRecord(this.getString(MsgTag.MsgType), this.getTyped(MsgTag.SendingTime), this.getTyped(MsgTag.MsgSeqNum), this.toObject())
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
public checksum (): number {
|
|
38
43
|
const t = this.getPosition(MsgTag.CheckSum)
|
|
39
44
|
const structure = this.structure
|
|
@@ -23,13 +23,13 @@ export class TimeFormatter implements ITimeFormatter {
|
|
|
23
23
|
public writeUtcTimestamp (v: Date): void {
|
|
24
24
|
this.writeUtcDate(v)
|
|
25
25
|
this.buffer.writeChar(AsciiChars.Hyphen)
|
|
26
|
-
this.writeUtcTime(v
|
|
26
|
+
this.writeUtcTime(v)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public writeLocalTimestamp (v: Date): void {
|
|
30
30
|
this.writeLocalDate(v)
|
|
31
31
|
this.buffer.writeChar(AsciiChars.Hyphen)
|
|
32
|
-
this.writeLocalTime(v
|
|
32
|
+
this.writeLocalTime(v)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
public writeUtcTime (v: Date): void {
|
|
@@ -8,6 +8,7 @@ export abstract class AsciiChars {
|
|
|
8
8
|
public static readonly Colon: number = ':'.charCodeAt(0)
|
|
9
9
|
public static readonly Hyphen: number = '-'.charCodeAt(0)
|
|
10
10
|
public static readonly Pipe: number = '|'.charCodeAt(0)
|
|
11
|
+
public static readonly Carat: number = '^'.charCodeAt(0)
|
|
11
12
|
public static readonly N: number = 'N'.charCodeAt(0)
|
|
12
13
|
public static readonly Y: number = 'Y'.charCodeAt(0)
|
|
13
14
|
public static readonly Zero: number = '0'.charCodeAt(0)
|
|
@@ -37,6 +37,14 @@ export class ElasticBuffer {
|
|
|
37
37
|
return this.ptr
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
public setPos (ptr: number): number {
|
|
41
|
+
const r = this.ptr
|
|
42
|
+
if (ptr >= 0 && ptr < this.size) {
|
|
43
|
+
this.ptr = ptr
|
|
44
|
+
}
|
|
45
|
+
return r
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
public get (pos: number): number {
|
|
41
49
|
return this.buffer[pos]
|
|
42
50
|
}
|
|
@@ -140,6 +148,7 @@ export class ElasticBuffer {
|
|
|
140
148
|
public clone (): ElasticBuffer {
|
|
141
149
|
const cloned = new ElasticBuffer(this.ptr)
|
|
142
150
|
this.buffer.copy(cloned.buffer, 0, 0, this.ptr)
|
|
151
|
+
cloned.setPos(this.ptr)
|
|
143
152
|
return cloned
|
|
144
153
|
}
|
|
145
154
|
|
|
@@ -7,7 +7,7 @@ export class EncodeProxy {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
private static SimpleFieldCheck (field: ContainedSimpleField, val: any): void {
|
|
10
|
-
const sf: ContainedSimpleField = field
|
|
10
|
+
const sf: ContainedSimpleField = field
|
|
11
11
|
const definition: SimpleFieldDefinition = sf.definition
|
|
12
12
|
if (definition.isEnum()) {
|
|
13
13
|
const resolved: boolean = definition.containsEnum(val)
|
|
@@ -73,7 +73,7 @@ export class EncodeProxy {
|
|
|
73
73
|
if (!isComplex) {
|
|
74
74
|
throw new Error(`type ${field.name} is a component but is given type "${typeof val}"`)
|
|
75
75
|
}
|
|
76
|
-
const cf: ContainedComponentField = field
|
|
76
|
+
const cf: ContainedComponentField = field
|
|
77
77
|
return EncodeProxy.checkProperties(new Proxy({}, EncodeProxy.handler(cf.definition)), val)
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -5,6 +5,7 @@ import { SegmentDescription } from '../segment-description'
|
|
|
5
5
|
import { TagType } from '../tags'
|
|
6
6
|
import { AsciiChars } from '../ascii-chars'
|
|
7
7
|
import * as moment from 'moment'
|
|
8
|
+
import { IFixMsgStoreRecord } from '../../store'
|
|
8
9
|
|
|
9
10
|
export class FixmlView extends MsgView {
|
|
10
11
|
|
|
@@ -108,4 +109,8 @@ export class FixmlView extends MsgView {
|
|
|
108
109
|
}
|
|
109
110
|
return this.stringAtPosition(position)
|
|
110
111
|
}
|
|
112
|
+
|
|
113
|
+
public toMsgStoreRecord (): IFixMsgStoreRecord {
|
|
114
|
+
return null
|
|
115
|
+
}
|
|
111
116
|
}
|
package/src/buffer/msg-view.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Tags } from './tags'
|
|
|
6
6
|
import { ContainedGroupField, ContainedComponentField, ContainedField, ContainedFieldSet, ContainedSimpleField, SimpleFieldDefinition, GroupFieldDefinition, ITypeDispatcher, reduceSet, ContainedSetType } from '../dictionary'
|
|
7
7
|
import { ILooseObject } from '../collections/collection'
|
|
8
8
|
import { ElasticBuffer } from './elastic-buffer'
|
|
9
|
+
import { IFixMsgStoreRecord } from '../store'
|
|
9
10
|
|
|
10
11
|
export abstract class MsgView {
|
|
11
12
|
protected sortedTagPosForwards: TagPos[]
|
|
@@ -414,4 +415,6 @@ export abstract class MsgView {
|
|
|
414
415
|
|
|
415
416
|
return buffer.toString()
|
|
416
417
|
}
|
|
418
|
+
|
|
419
|
+
abstract toMsgStoreRecord (): IFixMsgStoreRecord
|
|
417
420
|
}
|