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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-encode.test.js","sourceRoot":"","sources":["../../src/test/ascii-encode.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,sCAA+F;AAE/F,4CAAwG;AACxG,sCAAuC;AACvC,kCAAwC;AAExC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,OAAqB,CAAA;AACzB,IAAI,GAAsB,CAAA;AAC1B,IAAI,EAAqB,CAAA;AAEzB,MAAM,SAAS,GAAS,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,YAAY,GAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;AAC1E,MAAM,OAAO,GAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACjE,MAAM,OAAO,GAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;AAEpE,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,kBAAkB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAA;IACjG,WAAW,GAAG,MAAM,qBAAc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AAA;IAClD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,+FAA+F,CAAC,CAAA;AAC/H,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC1C,MAAM,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,CAAA;IACvB,MAAM,CAAC,GAAiB,wBAAwB,EAAE,CAAA;IAClD,OAAO,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;IACnE,SAAS,GAAG;QACV,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACd,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,sDAAsD,CAAC,CAAA;AAC7E,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACxC,MAAM,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,CAAA;IACvB,MAAM,CAAC,GAAiB;QACtB,YAAY,EAAE;YACZ,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,cAAc;YAC5B,kBAAkB,EAAE,GAAG;YACvB,aAAa,EAAE;gBACb,iBAAiB,EAAE;oBACjB,QAAQ,EAAE,EAAE;iBACb;aACF;YACD,SAAS,EAAE,CAAC;SACb;KACF,CAAA;IACD,SAAS,GAAG;QACV,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACd,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC1E,CAAC,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ComponentFieldDefinition, ContainedFieldSet, FixDefinitions, MessageDefinition } from '../dictionary'\r\nimport { AsciiChars, AsciiEncoder, AsciiParser, MsgView, Tags, TimeFormatter } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { AsciiMsgTransmitter, ISessionDescription, SessionMsgFactory, StringDuplex } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { getDefinitions } from '../util'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet encoder: AsciiEncoder\r\nlet nos: MessageDefinition\r\nlet er: MessageDefinition\r\n\r\nconst localDate: Date = new Date(2018, 6, 25)\r\nconst utcTimeStamp: Date = new Date(Date.UTC(2018, 5, 10, 16, 35, 0, 246))\r\nconst utcDate: Date = new Date(Date.UTC(2018, 5, 10, 0, 0, 0, 0))\r\nconst utcTime: Date = new Date(Date.UTC(2018, 0, 1, 16, 35, 0, 246))\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/qf-fix44.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n const config = new JsFixConfig(new SessionMsgFactory(sessionDescription), definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n encoder = new AsciiEncoder(session.buffer, definitions, new TimeFormatter(session.buffer), AsciiChars.Pipe)\r\n nos = definitions.message.get('NewOrderSingle')\r\n er = definitions.message.get('ExecutionReport')\r\n}, 45000)\r\n\r\ntest('expect a definition ', () => {\r\n expect(nos).toBeTruthy()\r\n})\r\n\r\nfunction toFix (o: ILooseObject, set?: ContainedFieldSet): string {\r\n session.buffer.reset()\r\n if (set) {\r\n encoder.encode(o, set.name)\r\n } else {\r\n encoder.encode(o, nos.name)\r\n }\r\n return session.buffer.toString()\r\n}\r\n\r\nfunction toFixMessage (o: ILooseObject, msg: MessageDefinition): string {\r\n session.encodeMessage(msg.msgType, o)\r\n return session.buffer.toString()\r\n}\r\n\r\nclass ParsingResult {\r\n constructor (public readonly event: string, public readonly msgType: string, public readonly view: MsgView,\r\n public readonly contents: string, public readonly parser: AsciiParser) {\r\n }\r\n}\r\n\r\nfunction toParse (text: string, chunks: boolean = false): Promise<ParsingResult> {\r\n return new Promise<any>((resolve, reject) => {\r\n const parser = new AsciiParser(definitions, new StringDuplex(text, chunks).readable, AsciiChars.Pipe)\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n parser.on('msg', (msgType: string, view: MsgView) => {\r\n resolve(new ParsingResult('msg', msgType, view.clone(), parser.state.elasticBuffer.toString(), parser))\r\n })\r\n parser.on('done', () => {\r\n resolve(new ParsingResult('done', null,null, parser.state.elasticBuffer.toString(), parser))\r\n })\r\n })\r\n}\r\n\r\ntest('encode heartbeat', async () => {\r\n const factory = session.config.factory\r\n const hb = factory.heartbeat('test01')\r\n const hbd = definitions.message.get('Heartbeat')\r\n const fix = toFixMessage(hb, hbd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await toParse(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual('0')\r\n const len = res.view.getTyped(Tags.BodyLengthTag)\r\n const expected = fix.length - '8=FIX4.4|9=0000081|'.length - '10=159|'.length\r\n expect(len).toEqual(expected)\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n PossDupFlag: true\r\n }\r\n }\r\n const fix: string = toFixMessage(no, definitions.message.get('Heartbeat'))\r\n expect(fix).toMatch('43=Y|')\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n MsgSeqNum: 9999\r\n }\r\n }\r\n const fix: string = toFixMessage(no, definitions.message.get('Heartbeat'))\r\n expect(fix).toMatch('34=9999|')\r\n})\r\n\r\ntest('encode string ClOrdID ', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = 'Order-a'\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('11=Order-a|')\r\n})\r\n\r\ntest('encode empty string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = ''\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('11=|')\r\n})\r\n\r\ntest('encode null string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = null\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('encode +ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 100\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=100|')\r\n})\r\n\r\ntest('encode -ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -100\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=-100|')\r\n})\r\n\r\ntest('encode +ve numeric (double 8dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=123.12345678|')\r\n})\r\n\r\ntest('encode +ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678901234\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode -ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -123.12345678901234\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=-123.12345678901234|')\r\n})\r\n\r\ntest('encode +ve string Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = '123.12345678901234'\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode LocalDate TradeDate ', () => {\r\n const no: ILooseObject = {}\r\n no.TradeDate = localDate\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('75=20180725|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime ', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = utcTimeStamp\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('126=20180610-16:35:00.246|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime - check padding', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 1))\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('126=20180101-00:00:00.001|')\r\n})\r\n\r\ntest('encode UTCDATEONLY MDEntryDate', () => {\r\n const mdGrp: ComponentFieldDefinition = definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryDate: utcDate\r\n }\r\n ]\r\n }\r\n const fix: string = toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|272=20180610|')\r\n})\r\n\r\ntest('encode UTCTIMEONLY MDEntryTime', () => {\r\n const mdGrp: ComponentFieldDefinition = definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryTime: utcTime\r\n }\r\n ]\r\n }\r\n const fix: string = toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|273=16:35:00.246|')\r\n})\r\n\r\ntest('encode BOOLEAN (true) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = true\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (truthy) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 1\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (string) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 'TRUE'\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (false) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = false\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode BOOLEAN (falsy) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 0\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode RawData EncodedText', () => {\r\n expect(er).toBeTruthy()\r\n const toEncode: string = 'this is fix'\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('354=11|355=this is fix|')\r\n})\r\n\r\ntest('encode empty RawData EncodedText', () => {\r\n expect(er).toBeTruthy()\r\n const toEncode: string = ''\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('354=0|355=|')\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return {\r\n 'Parties': {\r\n 'NoPartyIDs': [\r\n {\r\n 'PartyID': 'magna.',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28\r\n },\r\n {\r\n 'PartyID': 'iaculis',\r\n 'PartyIDSource': 'F',\r\n 'PartyRole': 2\r\n }]\r\n }\r\n }\r\n}\r\n\r\nfunction getPartiesNoDelimiter (): ILooseObject {\r\n return {\r\n 'Parties': {\r\n 'NoPartyIDs': [\r\n {\r\n // missing PartyID\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n\r\ntest('encode repeated group of simple repository Parties', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getParties()\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('453=2|448=magna.|447=9|452=28|448=iaculis|447=F|452=2|')\r\n})\r\n\r\ntest('encode repeated group with no delimiter - should throw', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getPartiesNoDelimiter()\r\n function run (): void {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/no delimiter/)\r\n})\r\n\r\ntest('encode repeated group with no array - should throw', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {\r\n 'Parties': {\r\n 'NoPartyIDs': 'should be an array'\r\n }\r\n }\r\n function run (): void {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/expected array/)\r\n})\r\n\r\ntest('encode repeated group with empty array', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {\r\n 'Parties': {\r\n 'NoPartyIDs': []\r\n }\r\n }\r\n expect(toFix(e, er)).toEqual('453=0|')\r\n})\r\n\r\nfunction getInstrument (): ILooseObject {\r\n return {\r\n 'Instrument': {\r\n 'Symbol': 'ac,',\r\n 'SymbolSfx': 'non',\r\n 'SecurityID': 'Pellentesque',\r\n 'SecurityIDSource': 'B',\r\n 'Product': 2\r\n }\r\n }\r\n}\r\n\r\nfunction getInstrumentNestedGroup (): ILooseObject {\r\n return {\r\n 'Instrument': {\r\n 'Symbol': 'ac,',\r\n 'SymbolSfx': 'non',\r\n 'SecurityID': 'Pellentesque',\r\n 'SecurityIDSource': 'B',\r\n 'SecAltIDGrp': {\r\n 'NoSecurityAltID': [\r\n {\r\n 'SecurityAltID': 'lorem',\r\n 'SecurityAltIDSource': 'consequat'\r\n },\r\n {\r\n 'SecurityAltID': 'sapien',\r\n 'SecurityAltIDSource': 'tempor'\r\n }\r\n ]\r\n },\r\n 'Product': 2\r\n }\r\n }\r\n}\r\n\r\ntest('encode component', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getInstrument()\r\n expect(toFix(e, er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|460=2|')\r\n})\r\n\r\ntest('encode component nested group', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n expect(toFix(e, er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|454=2|455=lorem|456=consequat|455=sapien|456=tempor|460=2|')\r\n})\r\n\r\ntest('encode group missing delimiter', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n delete e.Instrument.SecAltIDGrp.NoSecurityAltID[0]['SecurityAltID']\r\n function run () {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/group instance with no delimiter field SecurityAltID/)\r\n})\r\n\r\ntest('encode group not an array of', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {\r\n 'Instrument': {\r\n 'Symbol': 'ac,',\r\n 'SymbolSfx': 'non',\r\n 'SecurityID': 'Pellentesque',\r\n 'SecurityIDSource': 'B',\r\n 'SecAltIDGrp': {\r\n 'NoSecurityAltID': {\r\n elements: []\r\n }\r\n },\r\n 'Product': 2\r\n }\r\n }\r\n function run () {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/expected array instance for group NoSecurityAltID/)\r\n})\r\n"]}
|
|
1
|
+
{"version":3,"file":"ascii-encode.test.js","sourceRoot":"","sources":["../../src/test/ascii-encode.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,sCAA+F;AAE/F,4CAAwG;AACxG,sCAAuC;AACvC,kCAAwC;AAExC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,OAAqB,CAAA;AACzB,IAAI,GAAsB,CAAA;AAC1B,IAAI,EAAqB,CAAA;AAEzB,MAAM,SAAS,GAAS,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,YAAY,GAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;AAC1E,MAAM,OAAO,GAAS,IAAI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BAAkB,EAAE,GAAG;YACvB,aAAa,EAAE;gBACb,iBAAiB,EAAE;oBACjB,QAAQ,EAAE,EAAE;iBACb;aACF;YACD,SAAS,EAAE,CAAC;SACb;KACF,CAAA;IACD,SAAS,GAAG;QACV,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACd,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC1E,CAAC,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ComponentFieldDefinition, ContainedFieldSet, FixDefinitions, MessageDefinition } from '../dictionary'\r\nimport { AsciiChars, AsciiEncoder, AsciiParser, MsgView, Tags, TimeFormatter } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { AsciiMsgTransmitter, ISessionDescription, SessionMsgFactory, StringDuplex } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { getDefinitions } from '../util'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet encoder: AsciiEncoder\r\nlet nos: MessageDefinition\r\nlet er: MessageDefinition\r\n\r\nconst localDate: Date = new Date(2018, 6, 25)\r\nconst utcTimeStamp: Date = new Date(Date.UTC(2018, 5, 10, 16, 35, 0, 246))\r\nconst utcDate: Date = new Date(Date.UTC(2018, 5, 10, 0, 0, 0, 0))\r\nconst utcTime: Date = new Date(Date.UTC(2018, 0, 1, 16, 35, 0, 246))\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/qf-fix44.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n const config = new JsFixConfig(new SessionMsgFactory(sessionDescription), definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n encoder = new AsciiEncoder(session.buffer, definitions, new TimeFormatter(session.buffer), AsciiChars.Pipe)\r\n nos = definitions.message.get('NewOrderSingle')\r\n er = definitions.message.get('ExecutionReport')\r\n}, 45000)\r\n\r\ntest('expect a definition ', () => {\r\n expect(nos).toBeTruthy()\r\n})\r\n\r\nfunction toFix (o: ILooseObject, set?: ContainedFieldSet, enc?: AsciiEncoder): string {\r\n const theEncode = enc ? enc : encoder\r\n session.buffer.reset()\r\n if (set) {\r\n theEncode.encode(o, set.name)\r\n } else {\r\n theEncode.encode(o, nos.name)\r\n }\r\n return session.buffer.toString()\r\n}\r\n\r\nfunction toFixMessage (o: ILooseObject, msg: MessageDefinition): string {\r\n session.encodeMessage(msg.msgType, o)\r\n return session.buffer.toString()\r\n}\r\n\r\nclass ParsingResult {\r\n constructor (public readonly event: string, public readonly msgType: string, public readonly view: MsgView,\r\n public readonly contents: string, public readonly parser: AsciiParser) {\r\n }\r\n}\r\n\r\nfunction toParse (text: string, chunks: boolean = false): Promise<ParsingResult> {\r\n return new Promise<any>((resolve, reject) => {\r\n const parser = new AsciiParser(definitions, new StringDuplex(text, chunks).readable, AsciiChars.Pipe)\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n parser.on('msg', (msgType: string, view: MsgView) => {\r\n resolve(new ParsingResult('msg', msgType, view.clone(), parser.state.elasticBuffer.toString(), parser))\r\n })\r\n parser.on('done', () => {\r\n resolve(new ParsingResult('done', null,null, parser.state.elasticBuffer.toString(), parser))\r\n })\r\n })\r\n}\r\n\r\ntest('encode heartbeat', async () => {\r\n const factory = session.config.factory\r\n const hb = factory.heartbeat('test01')\r\n const hbd = definitions.message.get('Heartbeat')\r\n const fix = toFixMessage(hb, hbd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await toParse(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual('0')\r\n const len = res.view.getTyped(Tags.BodyLengthTag)\r\n const expected = fix.length - '8=FIX4.4|9=0000081|'.length - '10=159|'.length\r\n expect(len).toEqual(expected)\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n PossDupFlag: true\r\n }\r\n }\r\n const fix: string = toFixMessage(no, definitions.message.get('Heartbeat'))\r\n expect(fix).toMatch('43=Y|')\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n MsgSeqNum: 9999\r\n }\r\n }\r\n const fix: string = toFixMessage(no, definitions.message.get('Heartbeat'))\r\n expect(fix).toMatch('34=9999|')\r\n})\r\n\r\ntest('encode string ClOrdID ', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = 'Order-a'\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('11=Order-a|')\r\n})\r\n\r\ntest('encode empty string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = ''\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('11=|')\r\n})\r\n\r\ntest('encode null string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = null\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('encode +ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 100\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=100|')\r\n})\r\n\r\ntest('encode -ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -100\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=-100|')\r\n})\r\n\r\ntest('encode +ve numeric (double 8dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=123.12345678|')\r\n})\r\n\r\ntest('encode +ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678901234\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode -ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -123.12345678901234\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=-123.12345678901234|')\r\n})\r\n\r\ntest('encode +ve string Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = '123.12345678901234'\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode LocalDate TradeDate ', () => {\r\n const no: ILooseObject = {}\r\n no.TradeDate = localDate\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('75=20180725|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime ', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = utcTimeStamp\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('126=20180610-16:35:00.246|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime - check padding', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 1))\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('126=20180101-00:00:00.001|')\r\n})\r\n\r\ntest('encode UTCDATEONLY MDEntryDate', () => {\r\n const mdGrp: ComponentFieldDefinition = definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryDate: utcDate\r\n }\r\n ]\r\n }\r\n const fix: string = toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|272=20180610|')\r\n})\r\n\r\ntest('encode UTCTIMEONLY MDEntryTime', () => {\r\n const mdGrp: ComponentFieldDefinition = definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryTime: utcTime\r\n }\r\n ]\r\n }\r\n const fix: string = toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|273=16:35:00.246|')\r\n})\r\n\r\ntest('encode BOOLEAN (true) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = true\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (truthy) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 1\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (string) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 'TRUE'\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (false) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = false\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode BOOLEAN (falsy) ReportToExch', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 0\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode RawData EncodedText', () => {\r\n expect(er).toBeTruthy()\r\n const toEncode: string = 'this is fix'\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('354=11|355=this is fix|')\r\n})\r\n\r\ntest('encode empty RawData EncodedText', () => {\r\n expect(er).toBeTruthy()\r\n const toEncode: string = ''\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('354=0|355=|')\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return {\r\n 'Parties': {\r\n 'NoPartyIDs': [\r\n {\r\n 'PartyID': 'magna.',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28\r\n },\r\n {\r\n 'PartyID': 'iaculis',\r\n 'PartyIDSource': 'F',\r\n 'PartyRole': 2\r\n }]\r\n }\r\n }\r\n}\r\n\r\nfunction getPartiesNoDelimiter (): ILooseObject {\r\n return {\r\n 'Parties': {\r\n 'NoPartyIDs': [\r\n {\r\n // missing PartyID\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n\r\ntest('encode repeated group of simple repository Parties', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getParties()\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('453=2|448=magna.|447=9|452=28|448=iaculis|447=F|452=2|')\r\n})\r\n\r\ntest('use a carat as log delimiter', () => {\r\n expect(er).toBeTruthy()\r\n const caratEncoder = new AsciiEncoder(session.buffer, definitions, new TimeFormatter(session.buffer), AsciiChars.Soh, AsciiChars.Carat)\r\n const e: ILooseObject = getParties()\r\n const fix: string = toFix(e, er, caratEncoder)\r\n expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^')\r\n})\r\n\r\ntest('use a carat as log delimiter with Soh in buffer to show encoding still works', () => {\r\n expect(er).toBeTruthy()\r\n const caratEncoder = new AsciiEncoder(session.buffer, definitions, new TimeFormatter(session.buffer), AsciiChars.Soh, AsciiChars.Carat)\r\n const e: ILooseObject = getParties()\r\n const fix: string = toFix(e, er, caratEncoder)\r\n expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^')\r\n const trimmed = caratEncoder.trim().toString()\r\n expect(trimmed).toEqual('453=2\u0001448=magna.\u0001447=9\u0001452=28\u0001448=iaculis\u0001447=F\u0001452=2\u0001')\r\n})\r\n\r\ntest('encode repeated group with no delimiter - should throw', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getPartiesNoDelimiter()\r\n function run (): void {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/no delimiter/)\r\n})\r\n\r\ntest('encode repeated group with no array - should throw', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {\r\n 'Parties': {\r\n 'NoPartyIDs': 'should be an array'\r\n }\r\n }\r\n function run (): void {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/expected array/)\r\n})\r\n\r\ntest('encode repeated group with empty array', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {\r\n 'Parties': {\r\n 'NoPartyIDs': []\r\n }\r\n }\r\n expect(toFix(e, er)).toEqual('453=0|')\r\n})\r\n\r\nfunction getInstrument (): ILooseObject {\r\n return {\r\n 'Instrument': {\r\n 'Symbol': 'ac,',\r\n 'SymbolSfx': 'non',\r\n 'SecurityID': 'Pellentesque',\r\n 'SecurityIDSource': 'B',\r\n 'Product': 2\r\n }\r\n }\r\n}\r\n\r\nfunction getInstrumentNestedGroup (): ILooseObject {\r\n return {\r\n 'Instrument': {\r\n 'Symbol': 'ac,',\r\n 'SymbolSfx': 'non',\r\n 'SecurityID': 'Pellentesque',\r\n 'SecurityIDSource': 'B',\r\n 'SecAltIDGrp': {\r\n 'NoSecurityAltID': [\r\n {\r\n 'SecurityAltID': 'lorem',\r\n 'SecurityAltIDSource': 'consequat'\r\n },\r\n {\r\n 'SecurityAltID': 'sapien',\r\n 'SecurityAltIDSource': 'tempor'\r\n }\r\n ]\r\n },\r\n 'Product': 2\r\n }\r\n }\r\n}\r\n\r\ntest('encode component', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getInstrument()\r\n expect(toFix(e, er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|460=2|')\r\n})\r\n\r\ntest('encode component nested group', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n expect(toFix(e, er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|454=2|455=lorem|456=consequat|455=sapien|456=tempor|460=2|')\r\n})\r\n\r\ntest('encode group missing delimiter', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n delete e.Instrument.SecAltIDGrp.NoSecurityAltID[0]['SecurityAltID']\r\n function run () {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/group instance with no delimiter field SecurityAltID/)\r\n})\r\n\r\ntest('encode group not an array of', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = {\r\n 'Instrument': {\r\n 'Symbol': 'ac,',\r\n 'SymbolSfx': 'non',\r\n 'SecurityID': 'Pellentesque',\r\n 'SecurityIDSource': 'B',\r\n 'SecAltIDGrp': {\r\n 'NoSecurityAltID': {\r\n elements: []\r\n }\r\n },\r\n 'Product': 2\r\n }\r\n }\r\n function run () {\r\n toFix(e, er)\r\n }\r\n expect(run).toThrow(/expected array instance for group NoSecurityAltID/)\r\n})\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const buffer_1 = require("../buffer");
|
|
14
|
+
const transport_1 = require("../transport");
|
|
15
|
+
const config_1 = require("../config");
|
|
16
|
+
const util_1 = require("../util");
|
|
17
|
+
const quickfix_1 = require("../types/FIX4.4/quickfix");
|
|
18
|
+
const __1 = require("..");
|
|
19
|
+
const ascii_1 = require("../transport/ascii");
|
|
20
|
+
const root = path.join(__dirname, '../../data');
|
|
21
|
+
let definitions;
|
|
22
|
+
let session;
|
|
23
|
+
let encoder;
|
|
24
|
+
let nos;
|
|
25
|
+
let er;
|
|
26
|
+
const localDate = new Date(2018, 6, 25);
|
|
27
|
+
const utcTimeStamp = new Date(Date.UTC(2018, 5, 10, 16, 35, 0, 246));
|
|
28
|
+
const utcDate = new Date(Date.UTC(2018, 5, 10, 0, 0, 0, 0));
|
|
29
|
+
const utcTime = new Date(Date.UTC(2018, 0, 1, 16, 35, 0, 246));
|
|
30
|
+
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const sessionDescription = require(path.join(root, 'session/qf-fix44.json'));
|
|
32
|
+
definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
|
|
33
|
+
const config = new config_1.JsFixConfig(new ascii_1.AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
34
|
+
session = new transport_1.AsciiMsgTransmitter(config);
|
|
35
|
+
encoder = new buffer_1.AsciiEncoder(session.buffer, definitions, new buffer_1.TimeFormatter(session.buffer), buffer_1.AsciiChars.Pipe);
|
|
36
|
+
nos = definitions.message.get('NewOrderSingle');
|
|
37
|
+
er = definitions.message.get('ExecutionReport');
|
|
38
|
+
}), 45000);
|
|
39
|
+
test('expect a definition ', () => {
|
|
40
|
+
expect(nos).toBeTruthy();
|
|
41
|
+
});
|
|
42
|
+
function toFix(o, set, enc) {
|
|
43
|
+
const theEncode = enc ? enc : encoder;
|
|
44
|
+
session.buffer.reset();
|
|
45
|
+
if (set) {
|
|
46
|
+
theEncode.encode(o, set.name);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
theEncode.encode(o, nos.name);
|
|
50
|
+
}
|
|
51
|
+
return session.buffer.toString();
|
|
52
|
+
}
|
|
53
|
+
function toFixMessage(o, msg) {
|
|
54
|
+
session.encodeMessage(msg.msgType, o);
|
|
55
|
+
return session.buffer.toString();
|
|
56
|
+
}
|
|
57
|
+
class ParsingResult {
|
|
58
|
+
constructor(event, msgType, view, contents, parser) {
|
|
59
|
+
this.event = event;
|
|
60
|
+
this.msgType = msgType;
|
|
61
|
+
this.view = view;
|
|
62
|
+
this.contents = contents;
|
|
63
|
+
this.parser = parser;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function toParse(text, chunks = false) {
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
const parser = new buffer_1.AsciiParser(definitions, new transport_1.StringDuplex(text, chunks).readable, buffer_1.AsciiChars.Pipe);
|
|
69
|
+
parser.on('error', (e) => {
|
|
70
|
+
reject(e);
|
|
71
|
+
});
|
|
72
|
+
parser.on('msg', (msgType, view) => {
|
|
73
|
+
resolve(new ParsingResult('msg', msgType, view.clone(), parser.state.elasticBuffer.toString(), parser));
|
|
74
|
+
});
|
|
75
|
+
parser.on('done', () => {
|
|
76
|
+
resolve(new ParsingResult('done', null, null, parser.state.elasticBuffer.toString(), parser));
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
test('encode heartbeat', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
+
const factory = session.config.factory;
|
|
82
|
+
const hb = factory.heartbeat('test01');
|
|
83
|
+
const hbd = definitions.message.get('Heartbeat');
|
|
84
|
+
const fix = toFixMessage(hb, hbd);
|
|
85
|
+
expect(fix).toBeTruthy();
|
|
86
|
+
const res = yield toParse(fix);
|
|
87
|
+
expect(res.event).toEqual('msg');
|
|
88
|
+
expect(res.msgType).toEqual('0');
|
|
89
|
+
const len = res.view.getTyped(buffer_1.Tags.BodyLengthTag);
|
|
90
|
+
const expected = fix.length - '8=FIX4.4|9=0000081|'.length - '10=159|'.length;
|
|
91
|
+
expect(len).toEqual(expected);
|
|
92
|
+
}));
|
|
93
|
+
test('encode custom header PossDupFlag', () => {
|
|
94
|
+
const no = {
|
|
95
|
+
StandardHeader: {
|
|
96
|
+
PossDupFlag: true
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const fix = toFixMessage(no, definitions.message.get('Heartbeat'));
|
|
100
|
+
expect(fix).toMatch('43=Y|');
|
|
101
|
+
});
|
|
102
|
+
test('encode custom header PossDupFlag', () => {
|
|
103
|
+
const no = {
|
|
104
|
+
StandardHeader: {
|
|
105
|
+
MsgSeqNum: 9999
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const fix = toFixMessage(no, definitions.message.get('Heartbeat'));
|
|
109
|
+
expect(fix).toMatch('34=9999|');
|
|
110
|
+
});
|
|
111
|
+
test('encode string ClOrdID ', () => {
|
|
112
|
+
const no = {};
|
|
113
|
+
no.ClOrdID = 'Order-a';
|
|
114
|
+
const fix = toFix(no);
|
|
115
|
+
expect(fix).toEqual('11=Order-a|');
|
|
116
|
+
});
|
|
117
|
+
test('should not encode empty string', () => {
|
|
118
|
+
const no = {};
|
|
119
|
+
no.ClOrdID = '';
|
|
120
|
+
const fix = toFix(no);
|
|
121
|
+
expect(fix).toEqual('');
|
|
122
|
+
});
|
|
123
|
+
test('should not encode null string', () => {
|
|
124
|
+
const no = {};
|
|
125
|
+
no.ClOrdID = null;
|
|
126
|
+
const fix = toFix(no);
|
|
127
|
+
expect(fix).toEqual('');
|
|
128
|
+
});
|
|
129
|
+
test('encode +ve numeric (int) Price ', () => {
|
|
130
|
+
const no = {};
|
|
131
|
+
no.Price = 100;
|
|
132
|
+
const fix = toFix(no);
|
|
133
|
+
expect(fix).toEqual('44=100|');
|
|
134
|
+
});
|
|
135
|
+
test('encode -ve numeric (int) Price ', () => {
|
|
136
|
+
const no = {};
|
|
137
|
+
no.Price = -100;
|
|
138
|
+
const fix = toFix(no);
|
|
139
|
+
expect(fix).toEqual('44=-100|');
|
|
140
|
+
});
|
|
141
|
+
test('encode +ve numeric (double 8dp) Price ', () => {
|
|
142
|
+
const no = {};
|
|
143
|
+
no.Price = 123.12345678;
|
|
144
|
+
const fix = toFix(no);
|
|
145
|
+
expect(fix).toEqual('44=123.12345678|');
|
|
146
|
+
});
|
|
147
|
+
test('encode +ve numeric (double 14dp) Price ', () => {
|
|
148
|
+
const no = {};
|
|
149
|
+
no.Price = 123.12345678901234;
|
|
150
|
+
const fix = toFix(no);
|
|
151
|
+
expect(fix).toEqual('44=123.12345678901234|');
|
|
152
|
+
});
|
|
153
|
+
test('encode -ve numeric (double 14dp) Price ', () => {
|
|
154
|
+
const no = {};
|
|
155
|
+
no.Price = -123.12345678901234;
|
|
156
|
+
const fix = toFix(no);
|
|
157
|
+
expect(fix).toEqual('44=-123.12345678901234|');
|
|
158
|
+
});
|
|
159
|
+
test('encode +ve string Price ', () => {
|
|
160
|
+
const no = {};
|
|
161
|
+
no.Price = '123.12345678901234';
|
|
162
|
+
const fix = toFix(no);
|
|
163
|
+
expect(fix).toEqual('44=123.12345678901234|');
|
|
164
|
+
});
|
|
165
|
+
test('encode LocalDate TradeDate ', () => {
|
|
166
|
+
const no = {};
|
|
167
|
+
no.TradeDate = localDate;
|
|
168
|
+
const fix = toFix(no);
|
|
169
|
+
expect(fix).toEqual('75=20180725|');
|
|
170
|
+
});
|
|
171
|
+
test('encode UTCTIMESTAMP ExpireTime ', () => {
|
|
172
|
+
const no = {};
|
|
173
|
+
no.ExpireTime = utcTimeStamp;
|
|
174
|
+
const fix = toFix(no);
|
|
175
|
+
expect(fix).toEqual('126=20180610-16:35:00.246|');
|
|
176
|
+
});
|
|
177
|
+
test('encode UTCTIMESTAMP ExpireTime - check padding', () => {
|
|
178
|
+
const no = {};
|
|
179
|
+
no.ExpireTime = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 1));
|
|
180
|
+
const fix = toFix(no);
|
|
181
|
+
expect(fix).toEqual('126=20180101-00:00:00.001|');
|
|
182
|
+
});
|
|
183
|
+
test('encode UTCDATEONLY MDEntryDate', () => {
|
|
184
|
+
const mdGrp = definitions.component.get('MDFullGrp');
|
|
185
|
+
expect(mdGrp).toBeTruthy();
|
|
186
|
+
const grp = {
|
|
187
|
+
NoMDEntries: [
|
|
188
|
+
{
|
|
189
|
+
MDEntryType: '0',
|
|
190
|
+
MDEntryDate: utcDate
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
};
|
|
194
|
+
const fix = toFix(grp, mdGrp);
|
|
195
|
+
expect(fix).toEqual('268=1|269=0|272=20180610|');
|
|
196
|
+
});
|
|
197
|
+
test('encode UTCTIMEONLY MDEntryTime', () => {
|
|
198
|
+
const mdGrp = definitions.component.get('MDFullGrp');
|
|
199
|
+
expect(mdGrp).toBeTruthy();
|
|
200
|
+
const grp = {
|
|
201
|
+
NoMDEntries: [
|
|
202
|
+
{
|
|
203
|
+
MDEntryType: '0',
|
|
204
|
+
MDEntryTime: utcTime
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
};
|
|
208
|
+
const fix = toFix(grp, mdGrp);
|
|
209
|
+
expect(fix).toEqual('268=1|269=0|273=16:35:00.246|');
|
|
210
|
+
});
|
|
211
|
+
test('encode BOOLEAN (true) ReportToExch', () => {
|
|
212
|
+
expect(er).toBeTruthy();
|
|
213
|
+
const e = {};
|
|
214
|
+
e.ReportToExch = true;
|
|
215
|
+
const fix = toFix(e, er);
|
|
216
|
+
expect(fix).toEqual('113=Y|');
|
|
217
|
+
});
|
|
218
|
+
test('encode BOOLEAN (truthy) ReportToExch', () => {
|
|
219
|
+
expect(er).toBeTruthy();
|
|
220
|
+
const e = {};
|
|
221
|
+
e.ReportToExch = 1;
|
|
222
|
+
const fix = toFix(e, er);
|
|
223
|
+
expect(fix).toEqual('113=Y|');
|
|
224
|
+
});
|
|
225
|
+
test('encode BOOLEAN (string) ReportToExch', () => {
|
|
226
|
+
expect(er).toBeTruthy();
|
|
227
|
+
const e = {};
|
|
228
|
+
e.ReportToExch = 'TRUE';
|
|
229
|
+
const fix = toFix(e, er);
|
|
230
|
+
expect(fix).toEqual('113=Y|');
|
|
231
|
+
});
|
|
232
|
+
test('encode BOOLEAN (false) ReportToExch', () => {
|
|
233
|
+
expect(er).toBeTruthy();
|
|
234
|
+
const e = {};
|
|
235
|
+
e.ReportToExch = false;
|
|
236
|
+
const fix = toFix(e, er);
|
|
237
|
+
expect(fix).toEqual('113=N|');
|
|
238
|
+
});
|
|
239
|
+
test('encode BOOLEAN (falsy) ReportToExch', () => {
|
|
240
|
+
expect(er).toBeTruthy();
|
|
241
|
+
const e = {};
|
|
242
|
+
e.ReportToExch = 0;
|
|
243
|
+
const fix = toFix(e, er);
|
|
244
|
+
expect(fix).toEqual('113=N|');
|
|
245
|
+
});
|
|
246
|
+
test('encode RawData EncodedText', () => {
|
|
247
|
+
expect(er).toBeTruthy();
|
|
248
|
+
const toEncode = 'this is fix';
|
|
249
|
+
const e = {
|
|
250
|
+
EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')
|
|
251
|
+
};
|
|
252
|
+
const fix = toFix(e, er);
|
|
253
|
+
expect(fix).toEqual('354=11|355=this is fix|');
|
|
254
|
+
});
|
|
255
|
+
test('encode empty RawData EncodedText', () => {
|
|
256
|
+
expect(er).toBeTruthy();
|
|
257
|
+
const toEncode = '';
|
|
258
|
+
const e = {
|
|
259
|
+
EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')
|
|
260
|
+
};
|
|
261
|
+
const fix = toFix(e, er);
|
|
262
|
+
expect(fix).toEqual('354=0|355=|');
|
|
263
|
+
});
|
|
264
|
+
function getParties() {
|
|
265
|
+
return {
|
|
266
|
+
'Parties': {
|
|
267
|
+
'NoPartyIDs': [
|
|
268
|
+
{
|
|
269
|
+
'PartyID': 'magna.',
|
|
270
|
+
'PartyIDSource': '9',
|
|
271
|
+
'PartyRole': 28
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
'PartyID': 'iaculis',
|
|
275
|
+
'PartyIDSource': 'F',
|
|
276
|
+
'PartyRole': 2
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function getPartiesNoDelimiter() {
|
|
283
|
+
return {
|
|
284
|
+
'Parties': {
|
|
285
|
+
'NoPartyIDs': [
|
|
286
|
+
{
|
|
287
|
+
'PartyIDSource': '9',
|
|
288
|
+
'PartyRole': 28
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
test('encode repeated group of simple repository Parties', () => {
|
|
295
|
+
expect(er).toBeTruthy();
|
|
296
|
+
const e = getParties();
|
|
297
|
+
const fix = toFix(e, er);
|
|
298
|
+
expect(fix).toEqual('453=2|448=magna.|447=9|452=28|448=iaculis|447=F|452=2|');
|
|
299
|
+
});
|
|
300
|
+
test('use a carat as log delimiter', () => {
|
|
301
|
+
expect(er).toBeTruthy();
|
|
302
|
+
const caratEncoder = new buffer_1.AsciiEncoder(session.buffer, definitions, new buffer_1.TimeFormatter(session.buffer), buffer_1.AsciiChars.Soh, buffer_1.AsciiChars.Carat);
|
|
303
|
+
const e = getParties();
|
|
304
|
+
const fix = toFix(e, er, caratEncoder);
|
|
305
|
+
expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^');
|
|
306
|
+
});
|
|
307
|
+
test('use a carat as log delimiter with Soh in buffer to show encoding still works', () => {
|
|
308
|
+
expect(er).toBeTruthy();
|
|
309
|
+
const caratEncoder = new buffer_1.AsciiEncoder(session.buffer, definitions, new buffer_1.TimeFormatter(session.buffer), buffer_1.AsciiChars.Soh, buffer_1.AsciiChars.Carat);
|
|
310
|
+
const e = getParties();
|
|
311
|
+
const fix = toFix(e, er, caratEncoder);
|
|
312
|
+
expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^');
|
|
313
|
+
const trimmed = caratEncoder.trim().toString();
|
|
314
|
+
expect(trimmed).toEqual('453=2448=magna.447=9452=28448=iaculis447=F452=2');
|
|
315
|
+
});
|
|
316
|
+
test('encode repeated group with no delimiter - should throw', () => {
|
|
317
|
+
expect(er).toBeTruthy();
|
|
318
|
+
const e = getPartiesNoDelimiter();
|
|
319
|
+
function run() {
|
|
320
|
+
toFix(e, er);
|
|
321
|
+
}
|
|
322
|
+
expect(run).toThrow(/no delimiter/);
|
|
323
|
+
});
|
|
324
|
+
test('encode repeated group with no array - should throw', () => {
|
|
325
|
+
expect(er).toBeTruthy();
|
|
326
|
+
const e = {
|
|
327
|
+
'Parties': {
|
|
328
|
+
'NoPartyIDs': 'should be an array'
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
function run() {
|
|
332
|
+
toFix(e, er);
|
|
333
|
+
}
|
|
334
|
+
expect(run).toThrow(/expected array/);
|
|
335
|
+
});
|
|
336
|
+
test('encode repeated group with empty array', () => {
|
|
337
|
+
expect(er).toBeTruthy();
|
|
338
|
+
const e = {
|
|
339
|
+
'Parties': {
|
|
340
|
+
'NoPartyIDs': []
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
expect(toFix(e, er)).toEqual('453=0|');
|
|
344
|
+
});
|
|
345
|
+
function getInstrument() {
|
|
346
|
+
return {
|
|
347
|
+
'Instrument': {
|
|
348
|
+
'Symbol': 'ac,',
|
|
349
|
+
'SymbolSfx': 'non',
|
|
350
|
+
'SecurityID': 'Pellentesque',
|
|
351
|
+
'SecurityIDSource': 'B',
|
|
352
|
+
'Product': 2
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function getInstrumentNestedGroup() {
|
|
357
|
+
return {
|
|
358
|
+
'Instrument': {
|
|
359
|
+
'Symbol': 'ac,',
|
|
360
|
+
'SymbolSfx': 'non',
|
|
361
|
+
'SecurityID': 'Pellentesque',
|
|
362
|
+
'SecurityIDSource': 'B',
|
|
363
|
+
'SecAltIDGrp': {
|
|
364
|
+
'NoSecurityAltID': [
|
|
365
|
+
{
|
|
366
|
+
'SecurityAltID': 'lorem',
|
|
367
|
+
'SecurityAltIDSource': 'consequat'
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
'SecurityAltID': 'sapien',
|
|
371
|
+
'SecurityAltIDSource': 'tempor'
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
'Product': 2
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
test('encode component', () => {
|
|
380
|
+
expect(er).toBeTruthy();
|
|
381
|
+
const e = getInstrument();
|
|
382
|
+
expect(toFix(e, er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|460=2|');
|
|
383
|
+
});
|
|
384
|
+
test('encode component nested group', () => {
|
|
385
|
+
expect(er).toBeTruthy();
|
|
386
|
+
const e = getInstrumentNestedGroup();
|
|
387
|
+
expect(toFix(e, er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|454=2|455=lorem|456=consequat|455=sapien|456=tempor|460=2|');
|
|
388
|
+
});
|
|
389
|
+
test('encode group missing delimiter', () => {
|
|
390
|
+
expect(er).toBeTruthy();
|
|
391
|
+
const e = getInstrumentNestedGroup();
|
|
392
|
+
delete e.Instrument.SecAltIDGrp.NoSecurityAltID[0]['SecurityAltID'];
|
|
393
|
+
function run() {
|
|
394
|
+
toFix(e, er);
|
|
395
|
+
}
|
|
396
|
+
expect(run).toThrow(/group instance [1] inconsisent delimeter 456 expected tag 455/);
|
|
397
|
+
});
|
|
398
|
+
test('encode group not an array of', () => {
|
|
399
|
+
expect(er).toBeTruthy();
|
|
400
|
+
const e = {
|
|
401
|
+
'Instrument': {
|
|
402
|
+
'Symbol': 'ac,',
|
|
403
|
+
'SymbolSfx': 'non',
|
|
404
|
+
'SecurityID': 'Pellentesque',
|
|
405
|
+
'SecurityIDSource': 'B',
|
|
406
|
+
'SecAltIDGrp': {
|
|
407
|
+
'NoSecurityAltID': {
|
|
408
|
+
elements: []
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
'Product': 2
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
function run() {
|
|
415
|
+
toFix(e, er);
|
|
416
|
+
}
|
|
417
|
+
expect(run).toThrow(/expected array instance for group NoSecurityAltID/);
|
|
418
|
+
});
|
|
419
|
+
function getCompID(securityType) {
|
|
420
|
+
switch (securityType) {
|
|
421
|
+
case quickfix_1.SecurityType.CommonStock: {
|
|
422
|
+
return 'DepA';
|
|
423
|
+
}
|
|
424
|
+
case quickfix_1.SecurityType.CorporateBond: {
|
|
425
|
+
return 'DepB';
|
|
426
|
+
}
|
|
427
|
+
case quickfix_1.SecurityType.ConvertibleBond: {
|
|
428
|
+
return 'DepC';
|
|
429
|
+
}
|
|
430
|
+
default:
|
|
431
|
+
return 'DepD';
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function createOrder(id, symbol, securityType, side, qty, price) {
|
|
435
|
+
return {
|
|
436
|
+
StandardHeader: {
|
|
437
|
+
DeliverToCompID: getCompID(securityType)
|
|
438
|
+
},
|
|
439
|
+
ClOrdID: `Cli${id}`,
|
|
440
|
+
Account: 'MyAcc',
|
|
441
|
+
Side: side,
|
|
442
|
+
Price: price,
|
|
443
|
+
OrdType: quickfix_1.OrdType.Limit,
|
|
444
|
+
OrderQtyData: {
|
|
445
|
+
OrderQty: qty
|
|
446
|
+
},
|
|
447
|
+
Instrument: {
|
|
448
|
+
SecurityType: securityType,
|
|
449
|
+
Symbol: symbol,
|
|
450
|
+
SecurityID: '459200101',
|
|
451
|
+
SecurityIDSource: quickfix_1.SecurityIDSource.IsinNumber
|
|
452
|
+
},
|
|
453
|
+
TimeInForce: quickfix_1.TimeInForce.Day
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
test('encode custom header 1 - expect DeliverToCompID DepA', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
457
|
+
const type = quickfix_1.SecurityType.CommonStock;
|
|
458
|
+
const o1 = createOrder(1, 'MS', type, quickfix_1.Side.Buy, 100, 1000.0);
|
|
459
|
+
const nosd = definitions.message.get('NewOrderSingle');
|
|
460
|
+
const fix = toFixMessage(o1, nosd);
|
|
461
|
+
expect(fix).toBeTruthy();
|
|
462
|
+
const res = yield toParse(fix);
|
|
463
|
+
const tag = res.view.getTyped('DeliverToCompID');
|
|
464
|
+
expect(tag).toEqual('DepA');
|
|
465
|
+
expect(res.event).toEqual('msg');
|
|
466
|
+
expect(res.msgType).toEqual(__1.MsgType.NewOrderSingle);
|
|
467
|
+
const parsed = res.view.toObject();
|
|
468
|
+
expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepA');
|
|
469
|
+
}));
|
|
470
|
+
test('encode custom header 2 - expect DeliverToCompID DepC', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
471
|
+
const type = quickfix_1.SecurityType.ConvertibleBond;
|
|
472
|
+
const o1 = createOrder(1, 'MSCb', type, quickfix_1.Side.Buy, 100, 1000.0);
|
|
473
|
+
const nosd = definitions.message.get('NewOrderSingle');
|
|
474
|
+
const fix = toFixMessage(o1, nosd);
|
|
475
|
+
expect(fix).toBeTruthy();
|
|
476
|
+
const res = yield toParse(fix);
|
|
477
|
+
const tag = res.view.getTyped('DeliverToCompID');
|
|
478
|
+
expect(tag).toEqual('DepC');
|
|
479
|
+
expect(res.event).toEqual('msg');
|
|
480
|
+
expect(res.msgType).toEqual(__1.MsgType.NewOrderSingle);
|
|
481
|
+
const parsed = res.view.toObject();
|
|
482
|
+
expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepC');
|
|
483
|
+
}));
|
|
484
|
+
test('encode custom header - include MsgSeqNum (for resends we do not want to overwrite)', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
485
|
+
const type = quickfix_1.SecurityType.ConvertibleBond;
|
|
486
|
+
const seqNum = 10;
|
|
487
|
+
const o1 = createOrder(1, 'MSCb', type, quickfix_1.Side.Buy, 100, 1000.0);
|
|
488
|
+
o1.StandardHeader.MsgSeqNum = seqNum;
|
|
489
|
+
o1.StandardHeader.PossDupFlag = true;
|
|
490
|
+
const nosd = definitions.message.get('NewOrderSingle');
|
|
491
|
+
expect(nosd).toBeTruthy();
|
|
492
|
+
const fix = toFixMessage(o1, nosd);
|
|
493
|
+
expect(fix).toBeTruthy();
|
|
494
|
+
const res = yield toParse(fix);
|
|
495
|
+
expect(res.event).toEqual('msg');
|
|
496
|
+
expect(res.msgType).toEqual(__1.MsgType.NewOrderSingle);
|
|
497
|
+
const parsed = res.view.toObject();
|
|
498
|
+
const h = parsed.StandardHeader;
|
|
499
|
+
expect(h.DeliverToCompID).toEqual('DepC');
|
|
500
|
+
expect(h.MsgSeqNum).toEqual(seqNum);
|
|
501
|
+
expect(h.BeginString).toEqual('FIX4.4');
|
|
502
|
+
expect(h.PossDupFlag).toEqual(true);
|
|
503
|
+
expect(h.MsgType).toEqual(__1.MsgType.NewOrderSingle);
|
|
504
|
+
}));
|
|
505
|
+
//# sourceMappingURL=ascii-encoder.test.js.map
|