jspurefix 1.4.1 → 2.0.3
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/.eslintrc.js +6 -0
- package/appveyor.yml +4 -0
- package/dist/buffer/{ascii-chars.d.ts → ascii/ascii-chars.d.ts} +0 -0
- package/dist/buffer/{ascii-chars.js → ascii/ascii-chars.js} +0 -0
- package/dist/buffer/ascii/ascii-chars.js.map +1 -0
- package/dist/buffer/ascii/ascii-encoder.d.ts +4 -2
- package/dist/buffer/ascii/ascii-encoder.js +54 -32
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser-state.d.ts +3 -10
- package/dist/buffer/ascii/ascii-parser-state.js +37 -25
- package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser.d.ts +7 -7
- package/dist/buffer/ascii/ascii-parser.js +50 -24
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.d.ts +2 -2
- package/dist/buffer/ascii/ascii-segment-parser.js +34 -13
- package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +2 -4
- package/dist/buffer/ascii/ascii-view.js +11 -15
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/ascii/index.d.ts +1 -0
- package/dist/buffer/ascii/index.js +1 -0
- package/dist/buffer/ascii/index.js.map +1 -1
- package/dist/buffer/ascii/parse-state.d.ts +8 -0
- package/dist/buffer/ascii/parse-state.js +13 -0
- package/dist/buffer/ascii/parse-state.js.map +1 -0
- package/dist/buffer/ascii/time-formatter.js +1 -1
- package/dist/buffer/ascii/time-formatter.js.map +1 -1
- package/dist/buffer/elastic-buffer.js +29 -8
- package/dist/buffer/elastic-buffer.js.map +1 -1
- package/dist/buffer/encode-proxy.d.ts +1 -1
- package/dist/buffer/encode-proxy.js +16 -17
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.d.ts +2 -1
- package/dist/buffer/fixml/fixml-encoder.js +43 -20
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-parser.js +47 -24
- package/dist/buffer/fixml/fixml-parser.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.d.ts +2 -4
- package/dist/buffer/fixml/fixml-view.js +13 -16
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/fixml/populated-attributes.d.ts +5 -0
- package/dist/buffer/fixml/populated-attributes.js +3 -0
- package/dist/buffer/fixml/populated-attributes.js.map +1 -0
- package/dist/buffer/index.d.ts +4 -8
- package/dist/buffer/index.js +4 -8
- package/dist/buffer/index.js.map +1 -1
- package/dist/buffer/msg-encoder.d.ts +2 -1
- package/dist/buffer/msg-encoder.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +3 -5
- package/dist/buffer/msg-view.js +8 -5
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/buffer/{segment-description.d.ts → segment/segment-description.d.ts} +3 -10
- package/dist/buffer/{segment-description.js → segment/segment-description.js} +5 -13
- package/dist/buffer/segment/segment-description.js.map +1 -0
- package/dist/buffer/{segment-summary.d.ts → segment/segment-summary.d.ts} +0 -0
- package/dist/buffer/{segment-summary.js → segment/segment-summary.js} +0 -0
- package/dist/buffer/segment/segment-summary.js.map +1 -0
- package/dist/buffer/segment/segment-type.d.ts +8 -0
- package/dist/buffer/segment/segment-type.js +13 -0
- package/dist/buffer/segment/segment-type.js.map +1 -0
- package/dist/buffer/structure.d.ts +3 -3
- package/dist/buffer/structure.js +1 -1
- package/dist/buffer/structure.js.map +1 -1
- package/dist/buffer/{tag-pos.d.ts → tag/tag-pos.d.ts} +0 -0
- package/dist/buffer/{tag-pos.js → tag/tag-pos.js} +0 -0
- package/dist/buffer/tag/tag-pos.js.map +1 -0
- package/dist/buffer/tag/tag-type.d.ts +13 -0
- package/dist/buffer/tag/tag-type.js +18 -0
- package/dist/buffer/tag/tag-type.js.map +1 -0
- package/dist/buffer/{tags.d.ts → tag/tags.d.ts} +3 -14
- package/dist/buffer/{tags.js → tag/tags.js} +24 -37
- package/dist/buffer/tag/tags.js.map +1 -0
- package/dist/config/get-js-fx-logger.d.ts +4 -0
- package/dist/config/get-js-fx-logger.js +3 -0
- package/dist/config/get-js-fx-logger.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/js-fix-config.d.ts +4 -1
- package/dist/config/js-fix-config.js +3 -3
- package/dist/config/js-fix-config.js.map +1 -1
- package/dist/config/js-fix-logger.d.ts +0 -3
- package/dist/config/js-fix-logger.js.map +1 -1
- package/dist/dict-parser.js +28 -23
- package/dist/dict-parser.js.map +1 -1
- package/dist/dictionary/compiler/compiler-type.js +7 -7
- package/dist/dictionary/compiler/compiler-type.js.map +1 -1
- package/dist/dictionary/compiler/enum-compiler.d.ts +1 -0
- package/dist/dictionary/compiler/enum-compiler.js +11 -1
- package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
- package/dist/dictionary/compiler/msg-compiler.js +8 -6
- package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
- package/dist/dictionary/contained/contained-component-field.js +2 -1
- package/dist/dictionary/contained/contained-component-field.js.map +1 -1
- package/dist/dictionary/contained/contained-field-dispatch.d.ts +1 -14
- package/dist/dictionary/contained/contained-field-dispatch.js +4 -4
- package/dist/dictionary/contained/contained-field-dispatch.js.map +1 -1
- package/dist/dictionary/contained/contained-field-dispatcher.d.ts +14 -0
- package/dist/dictionary/contained/contained-field-dispatcher.js +3 -0
- package/dist/dictionary/contained/contained-field-dispatcher.js.map +1 -0
- package/dist/dictionary/contained/contained-field-set.d.ts +1 -1
- package/dist/dictionary/contained/contained-field-set.js +12 -11
- package/dist/dictionary/contained/contained-field-set.js.map +1 -1
- package/dist/dictionary/contained/contained-field-type.d.ts +5 -0
- package/dist/dictionary/contained/contained-field-type.js +10 -0
- package/dist/dictionary/contained/contained-field-type.js.map +1 -0
- package/dist/dictionary/contained/contained-field.d.ts +1 -5
- package/dist/dictionary/contained/contained-field.js +1 -7
- package/dist/dictionary/contained/contained-field.js.map +1 -1
- package/dist/dictionary/contained/contained-group-field.js +2 -1
- package/dist/dictionary/contained/contained-group-field.js.map +1 -1
- package/dist/dictionary/contained/contained-simple-field.js +2 -1
- package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
- package/dist/dictionary/{fields-dispatch.d.ts → contained/field-dispatcher.d.ts} +3 -2
- package/dist/dictionary/contained/field-dispatcher.js +3 -0
- package/dist/dictionary/contained/field-dispatcher.js.map +1 -0
- package/dist/dictionary/contained/fields-dispatch.d.ts +6 -0
- package/dist/dictionary/contained/fields-dispatch.js +42 -0
- package/dist/dictionary/contained/fields-dispatch.js.map +1 -0
- package/dist/dictionary/contained/index.d.ts +2 -0
- package/dist/dictionary/contained/index.js +2 -0
- package/dist/dictionary/contained/index.js.map +1 -1
- package/dist/dictionary/contained-set-type.d.ts +5 -0
- package/dist/dictionary/contained-set-type.js +10 -0
- package/dist/dictionary/contained-set-type.js.map +1 -0
- package/dist/dictionary/definition/component-field-definition.js +2 -2
- package/dist/dictionary/definition/component-field-definition.js.map +1 -1
- package/dist/dictionary/definition/fix-definitions.d.ts +2 -1
- package/dist/dictionary/definition/fix-definitions.js.map +1 -1
- package/dist/dictionary/definition/group-field-definition.js +2 -2
- package/dist/dictionary/definition/group-field-definition.js.map +1 -1
- package/dist/dictionary/definition/index.d.ts +0 -1
- package/dist/dictionary/definition/index.js +0 -1
- package/dist/dictionary/definition/index.js.map +1 -1
- package/dist/dictionary/definition/message-definition.js +2 -2
- package/dist/dictionary/definition/message-definition.js.map +1 -1
- package/dist/dictionary/definition/simple-field-definition.d.ts +1 -1
- package/dist/dictionary/definition/simple-field-definition.js +5 -4
- package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
- package/dist/dictionary/dict-primitive.d.ts +0 -11
- package/dist/dictionary/dict-primitive.js +0 -7
- package/dist/dictionary/dict-primitive.js.map +1 -1
- package/dist/dictionary/fix-definition-source.d.ts +6 -0
- package/dist/dictionary/fix-definition-source.js +11 -0
- package/dist/dictionary/fix-definition-source.js.map +1 -0
- package/dist/dictionary/fix-versions.d.ts +0 -9
- package/dist/dictionary/fix-versions.js +1 -39
- package/dist/dictionary/fix-versions.js.map +1 -1
- package/dist/dictionary/index.d.ts +1 -5
- package/dist/dictionary/index.js +1 -5
- package/dist/dictionary/index.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/abbreviations-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/abbreviations-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/abbreviations-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/base-parser.d.ts +2 -4
- package/dist/dictionary/parser/fix-repository/base-parser.js +1 -2
- package/dist/dictionary/parser/fix-repository/base-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/components-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/components-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/components-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/data-types-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/data-types-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/data-types-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/enums-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/enums-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/enums-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/fields-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/fields-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/fields-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/messages-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/messages-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/messages-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/msg-contents-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/msg-contents-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/msg-contents-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository-abbreviation.d.ts +5 -0
- package/dist/dictionary/parser/fix-repository/repository-abbreviation.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-abbreviation.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-component.d.ts +10 -0
- package/dist/dictionary/parser/fix-repository/repository-component.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-component.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-data-type.d.ts +6 -0
- package/dist/dictionary/parser/fix-repository/repository-data-type.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-data-type.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-enum.d.ts +7 -0
- package/dist/{transport/fix-msg-factory.js → dictionary/parser/fix-repository/repository-enum.js} +1 -1
- package/dist/dictionary/parser/fix-repository/repository-enum.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-field.d.ts +11 -0
- package/dist/dictionary/parser/fix-repository/repository-field.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-field.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-message.d.ts +11 -0
- package/dist/{transport/make-fixl-session.js → dictionary/parser/fix-repository/repository-message.js} +1 -1
- package/dist/dictionary/parser/fix-repository/repository-message.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-msg-content.d.ts +9 -0
- package/dist/dictionary/parser/fix-repository/repository-msg-content.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-msg-content.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-type.d.ts +0 -53
- package/dist/dictionary/parser/fix-repository/repository-type.js +0 -2
- package/dist/dictionary/parser/fix-repository/repository-type.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +10 -10
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository.d.ts +12 -1
- package/dist/dictionary/parser/fix-repository/repository.js +50 -28
- package/dist/dictionary/parser/fix-repository/repository.js.map +1 -1
- package/dist/dictionary/parser/fixml/components-parser.d.ts +1 -1
- package/dist/dictionary/parser/fixml/components-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/fields-parser.d.ts +1 -1
- package/dist/dictionary/parser/fixml/fields-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/fix-xsd-parser.js +3 -2
- package/dist/dictionary/parser/fixml/fix-xsd-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/include-graph.js.map +1 -1
- package/dist/dictionary/parser/fixml/xsd-parser.d.ts +1 -1
- package/dist/dictionary/parser/fixml/xsd-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-definition-parser.d.ts +4 -4
- package/dist/dictionary/parser/quickfix/field-definition-parser.js +3 -3
- package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-set-parser.d.ts +4 -4
- package/dist/dictionary/parser/quickfix/field-set-parser.js +3 -3
- package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/message-parser.d.ts +4 -4
- package/dist/dictionary/parser/quickfix/message-parser.js +3 -3
- package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/node-parser.d.ts +4 -5
- package/dist/dictionary/parser/quickfix/node-parser.js +4 -4
- package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/parse-state.d.ts +8 -0
- package/dist/dictionary/parser/quickfix/parse-state.js +13 -0
- package/dist/dictionary/parser/quickfix/parse-state.js.map +1 -0
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -9
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +28 -35
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/dictionary/sax-node.d.ts +6 -0
- package/dist/{types/FIX4.4/quickfix/set/trailer.js → dictionary/sax-node.js} +1 -1
- package/dist/dictionary/sax-node.js.map +1 -0
- package/dist/dictionary/set-reduce.d.ts +5 -12
- package/dist/dictionary/set-reduce.js +28 -26
- package/dist/dictionary/set-reduce.js.map +1 -1
- package/dist/dictionary/type-dispatcher.d.ts +12 -0
- package/dist/dictionary/type-dispatcher.js +3 -0
- package/dist/dictionary/type-dispatcher.js.map +1 -0
- package/dist/dictionary/version-util.d.ts +4 -0
- package/dist/dictionary/version-util.js +36 -0
- package/dist/dictionary/version-util.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsfix-cmd.d.ts +5 -0
- package/dist/jsfix-cmd.js +28 -21
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/runtime/di-tokens.d.ts +28 -0
- package/dist/runtime/di-tokens.js +33 -0
- package/dist/runtime/di-tokens.js.map +1 -0
- package/dist/runtime/engine-factory.d.ts +4 -0
- package/dist/runtime/engine-factory.js +3 -0
- package/dist/runtime/engine-factory.js.map +1 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +18 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/make-config.d.ts +11 -0
- package/dist/runtime/make-config.js +57 -0
- package/dist/runtime/make-config.js.map +1 -0
- package/dist/runtime/session-container.d.ts +16 -0
- package/dist/runtime/session-container.js +168 -0
- package/dist/runtime/session-container.js.map +1 -0
- package/dist/runtime/session-launcher.d.ts +27 -0
- package/dist/runtime/session-launcher.js +131 -0
- package/dist/runtime/session-launcher.js.map +1 -0
- package/dist/sample/http/oms/app.d.ts +1 -1
- package/dist/sample/http/oms/app.js +16 -14
- package/dist/sample/http/oms/app.js.map +1 -1
- package/dist/sample/http/oms/http-client.js +22 -2
- package/dist/sample/http/oms/http-client.js.map +1 -1
- package/dist/sample/http/oms/http-server.js +21 -2
- package/dist/sample/http/oms/http-server.js.map +1 -1
- package/dist/sample/tcp/qf-md/app.d.ts +1 -1
- package/dist/sample/tcp/qf-md/app.js +11 -11
- package/dist/sample/tcp/qf-md/app.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-client.js +21 -2
- package/dist/sample/tcp/qf-md/md-client.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-server.js +20 -2
- package/dist/sample/tcp/qf-md/md-server.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -1
- package/dist/sample/tcp/recovering-skeleton/app.js +36 -16
- package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +3 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +30 -8
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +22 -3
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +21 -2
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -1
- package/dist/sample/tcp/skeleton/app.d.ts +1 -1
- package/dist/sample/tcp/skeleton/app.js +8 -13
- package/dist/sample/tcp/skeleton/app.js.map +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.d.ts +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.js +26 -4
- package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.d.ts +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js +4 -24
- package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/app-launcher.d.ts +6 -0
- package/dist/sample/tcp/trade-capture/app-launcher.js +21 -0
- package/dist/sample/tcp/trade-capture/app-launcher.js.map +1 -0
- package/dist/sample/tcp/trade-capture/app.d.ts +1 -1
- package/dist/sample/tcp/trade-capture/app.js +4 -21
- package/dist/sample/tcp/trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-factory.js +7 -1
- package/dist/sample/tcp/trade-capture/trade-factory.js.map +1 -1
- package/dist/store/fix-msg-ascii-store-resend.d.ts +1 -1
- package/dist/store/fix-msg-ascii-store-resend.js +2 -1
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-memory-store.d.ts +1 -1
- package/dist/store/fix-msg-memory-store.js.map +1 -1
- package/dist/store/fix-msg-store-record.d.ts +2 -0
- package/dist/store/fix-msg-store-record.js +4 -0
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/store/fix-msg-store-state.d.ts +6 -0
- package/dist/store/fix-msg-store-state.js +3 -0
- package/dist/store/fix-msg-store-state.js.map +1 -0
- package/dist/store/fix-msg-store.d.ts +1 -6
- package/dist/store/fix-msg-store.js.map +1 -1
- package/dist/test/ascii/ascii-encoder.test.d.ts +1 -0
- package/dist/test/{ascii-encoder.test.js → ascii/ascii-encoder.test.js} +57 -55
- package/dist/test/ascii/ascii-encoder.test.js.map +1 -0
- package/dist/test/ascii/ascii-parser.test.d.ts +1 -0
- package/dist/test/{ascii-parser.test.js → ascii/ascii-parser.test.js} +33 -52
- package/dist/test/ascii/ascii-parser.test.js.map +1 -0
- package/dist/test/ascii/ascii-segment.test.d.ts +1 -0
- package/dist/test/{ascii-segment.test.js → ascii/ascii-segment.test.js} +20 -41
- package/dist/test/ascii/ascii-segment.test.js.map +1 -0
- package/dist/test/ascii/ascii-store-replay.test.d.ts +1 -0
- package/dist/test/{ascii-store-replay.test.js → ascii/ascii-store-replay.test.js} +14 -43
- package/dist/test/ascii/ascii-store-replay.test.js.map +1 -0
- package/dist/test/ascii/ascii-tag-pos.test.d.ts +1 -0
- package/dist/test/{ascii-tag-pos.test.js → ascii/ascii-tag-pos.test.js} +10 -10
- package/dist/test/ascii/ascii-tag-pos.test.js.map +1 -0
- package/dist/test/ascii/execution-report.test.d.ts +1 -0
- package/dist/test/{execution-report.test.js → ascii/execution-report.test.js} +51 -52
- package/dist/test/ascii/execution-report.test.js.map +1 -0
- package/dist/test/ascii/fix-log-replay.test.d.ts +1 -0
- package/dist/test/{fix-log-replay.test.js → ascii/fix-log-replay.test.js} +8 -6
- package/dist/test/ascii/fix-log-replay.test.js.map +1 -0
- package/dist/test/ascii/fix-repo-dict.test.d.ts +1 -0
- package/dist/test/{fix-repo-dict.test.js → ascii/fix-repo-dict.test.js} +8 -7
- package/dist/test/ascii/fix-repo-dict.test.js.map +1 -0
- package/dist/test/ascii/includes.test.d.ts +1 -0
- package/dist/test/{includes.test.js → ascii/includes.test.js} +3 -2
- package/dist/test/ascii/includes.test.js.map +1 -0
- package/dist/test/ascii/logon.test.d.ts +1 -0
- package/dist/test/{logon.test.js → ascii/logon.test.js} +11 -13
- package/dist/test/ascii/logon.test.js.map +1 -0
- package/dist/test/ascii/memory-store.test.d.ts +1 -0
- package/dist/test/{memory-store.test.js → ascii/memory-store.test.js} +12 -12
- package/dist/test/ascii/memory-store.test.js.map +1 -0
- package/dist/test/ascii/qf-full-msg.test.d.ts +1 -0
- package/dist/test/{qf-full-msg.test.js → ascii/qf-full-msg.test.js} +21 -17
- package/dist/test/ascii/qf-full-msg.test.js.map +1 -0
- package/dist/test/ascii/repo-full-ascii-msg.test.d.ts +1 -0
- package/dist/test/{repo-full-ascii-msg.test.js → ascii/repo-full-ascii-msg.test.js} +20 -16
- package/dist/test/ascii/repo-full-ascii-msg.test.js.map +1 -0
- package/dist/test/ascii/session-state.test.d.ts +1 -0
- package/dist/test/{session-state.test.js → ascii/session-state.test.js} +2 -1
- package/dist/test/ascii/session-state.test.js.map +1 -0
- package/dist/test/ascii/session.test.d.ts +1 -0
- package/dist/test/{session.test.js → ascii/session.test.js} +14 -145
- package/dist/test/ascii/session.test.js.map +1 -0
- package/dist/test/ascii/time-formatter.test.d.ts +1 -0
- package/dist/test/{time-formatter.test.js → ascii/time-formatter.test.js} +4 -2
- package/dist/test/ascii/time-formatter.test.js.map +1 -0
- package/dist/test/ascii/view-decode.test.d.ts +1 -0
- package/dist/test/{view-decode.test.js → ascii/view-decode.test.js} +11 -36
- package/dist/test/ascii/view-decode.test.js.map +1 -0
- package/dist/test/elastic-buffer.test.d.ts +1 -1
- package/dist/test/elastic-buffer.test.js +3 -1
- package/dist/test/elastic-buffer.test.js.map +1 -1
- package/dist/test/encode-proxy.test.d.ts +1 -1
- package/dist/test/encode-proxy.test.js +9 -9
- package/dist/test/encode-proxy.test.js.map +1 -1
- package/dist/test/env/experiment.d.ts +23 -0
- package/dist/test/env/experiment.js +33 -0
- package/dist/test/env/experiment.js.map +1 -0
- package/dist/test/env/parsing-result.d.ts +10 -0
- package/dist/test/env/parsing-result.js +14 -0
- package/dist/test/env/parsing-result.js.map +1 -0
- package/dist/test/env/setup.d.ts +39 -0
- package/dist/test/env/setup.js +98 -0
- package/dist/test/env/setup.js.map +1 -0
- package/dist/test/env/skeleton-runner.d.ts +15 -0
- package/dist/test/env/skeleton-runner.js +108 -0
- package/dist/test/env/skeleton-runner.js.map +1 -0
- package/dist/test/env/test-recovery.d.ts +13 -0
- package/dist/test/env/test-recovery.js +41 -0
- package/dist/test/env/test-recovery.js.map +1 -0
- package/dist/test/{to-views.d.ts → env/to-views.d.ts} +2 -2
- package/dist/test/{to-views.js → env/to-views.js} +8 -7
- package/dist/test/env/to-views.js.map +1 -0
- package/dist/test/fixml/fixml-alloc-parse.test.d.ts +1 -0
- package/dist/test/{fixml-alloc-parse.test.js → fixml/fixml-alloc-parse.test.js} +2 -1
- package/dist/test/fixml/fixml-alloc-parse.test.js.map +1 -0
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.d.ts +1 -0
- package/dist/test/{fixml-mkt-data-fut-parse.test.js → fixml/fixml-mkt-data-fut-parse.test.js} +2 -1
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js.map +1 -0
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.d.ts +1 -0
- package/dist/test/{fixml-mkt-data-settle-parse.test.js → fixml/fixml-mkt-data-settle-parse.test.js} +2 -1
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js.map +1 -0
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.d.ts +1 -0
- package/dist/test/{fixml-tc-bi-lateral-parse.test.js → fixml/fixml-tc-bi-lateral-parse.test.js} +2 -1
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js.map +1 -0
- package/dist/test/fixml/repo-full-fixml-msg.test.d.ts +1 -0
- package/dist/test/{repo-full-fixml-msg.test.js → fixml/repo-full-fixml-msg.test.js} +17 -10
- package/dist/test/fixml/repo-full-fixml-msg.test.js.map +1 -0
- package/dist/transport/ascii/ascii-msg-transmitter.js +25 -6
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.d.ts +2 -2
- package/dist/transport/ascii/ascii-session-msg-factory.js +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -1
- package/dist/transport/ascii/ascii-session.d.ts +1 -1
- package/dist/transport/ascii/ascii-session.js +26 -23
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/ascii/index.d.ts +0 -1
- package/dist/transport/ascii/index.js +0 -1
- package/dist/transport/ascii/index.js.map +1 -1
- package/dist/transport/duplex/http-duplex.d.ts +1 -1
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/dist/transport/duplex/tcp-duplex.js +22 -2
- package/dist/transport/duplex/tcp-duplex.js.map +1 -1
- package/dist/transport/factory/index.d.ts +1 -0
- package/dist/transport/factory/index.js +14 -0
- package/dist/transport/factory/index.js.map +1 -0
- package/dist/transport/{msg-transport.d.ts → factory/msg-transport.d.ts} +4 -4
- package/dist/transport/factory/msg-transport.js +61 -0
- package/dist/transport/factory/msg-transport.js.map +1 -0
- package/dist/transport/fix-acceptor.d.ts +2 -2
- package/dist/transport/fix-acceptor.js.map +1 -1
- package/dist/transport/fix-entity.d.ts +8 -0
- package/dist/transport/fix-entity.js +12 -0
- package/dist/transport/fix-entity.js.map +1 -0
- package/dist/transport/fix-initiator.d.ts +2 -2
- package/dist/transport/fix-initiator.js.map +1 -1
- package/dist/transport/fixml/fixml-msg-transmitter.js +23 -5
- package/dist/transport/fixml/fixml-msg-transmitter.js.map +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.d.ts +2 -2
- package/dist/transport/fixml/fixml-session-msg-factory.js +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -1
- package/dist/transport/fixml/fixml-session.d.ts +1 -1
- package/dist/transport/fixml/fixml-session.js +3 -3
- package/dist/transport/fixml/fixml-session.js.map +1 -1
- package/dist/transport/fixml/index.d.ts +0 -2
- package/dist/transport/fixml/index.js +0 -2
- package/dist/transport/fixml/index.js.map +1 -1
- package/dist/transport/http/html-options.d.ts +8 -0
- package/dist/{store/replay-record.js → transport/http/html-options.js} +1 -1
- package/dist/transport/http/html-options.js.map +1 -0
- package/dist/transport/http/html-route.d.ts +5 -0
- package/dist/{types/FIX4.4/quickfix/set/header.js → transport/http/html-route.js} +1 -1
- package/dist/transport/http/html-route.js.map +1 -0
- package/dist/transport/http/http-acceptor-listener.d.ts +7 -0
- package/dist/transport/http/http-acceptor-listener.js +68 -0
- package/dist/transport/http/http-acceptor-listener.js.map +1 -0
- package/dist/transport/http/http-acceptor.js +24 -5
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/http/http-adapter.d.ts +7 -0
- package/dist/transport/http/http-adapter.js +3 -0
- package/dist/transport/http/http-adapter.js.map +1 -0
- package/dist/transport/http/http-initiator.d.ts +9 -3
- package/dist/transport/http/http-initiator.js +57 -26
- package/dist/transport/http/http-initiator.js.map +1 -1
- package/dist/transport/http/http-json-sample-adapter.d.ts +2 -1
- package/dist/transport/http/http-json-sample-adapter.js +21 -2
- package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
- package/dist/transport/http/http-transaction.d.ts +1 -1
- package/dist/transport/http/http-transaction.js.map +1 -1
- package/dist/transport/http/http-transport-description.d.ts +8 -0
- package/dist/transport/http/http-transport-description.js +3 -0
- package/dist/transport/http/http-transport-description.js.map +1 -0
- package/dist/transport/http/index.d.ts +1 -0
- package/dist/transport/http/index.js +1 -0
- package/dist/transport/http/index.js.map +1 -1
- package/dist/transport/index.d.ts +11 -10
- package/dist/transport/index.js +11 -10
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/msg-application.d.ts +12 -0
- package/dist/transport/msg-application.js +3 -0
- package/dist/transport/msg-application.js.map +1 -0
- package/dist/transport/msg-transmitter.d.ts +5 -5
- package/dist/transport/msg-transmitter.js +2 -3
- package/dist/transport/msg-transmitter.js.map +1 -1
- package/dist/transport/{a-session-msg-factory.d.ts → session/a-session-msg-factory.d.ts} +3 -3
- package/dist/transport/{a-session-msg-factory.js → session/a-session-msg-factory.js} +1 -1
- package/dist/transport/session/a-session-msg-factory.js.map +1 -0
- package/dist/transport/session/fix-session-state-args.d.ts +8 -0
- package/dist/transport/session/fix-session-state-args.js +3 -0
- package/dist/transport/session/fix-session-state-args.js.map +1 -0
- package/dist/transport/session/fix-session-state.d.ts +32 -0
- package/dist/transport/{fix-session-state.js → session/fix-session-state.js} +22 -55
- package/dist/transport/session/fix-session-state.js.map +1 -0
- package/dist/transport/{fix-session.d.ts → session/fix-session.d.ts} +6 -5
- package/dist/transport/{fix-session.js → session/fix-session.js} +45 -43
- package/dist/transport/session/fix-session.js.map +1 -0
- package/dist/transport/{make-fixl-session.d.ts → session/make-fix-session.d.ts} +1 -1
- package/dist/transport/session/make-fix-session.js +3 -0
- package/dist/transport/session/make-fix-session.js.map +1 -0
- package/dist/transport/session/session-description.d.ts +17 -0
- package/dist/transport/{session-description.js → session/session-description.js} +0 -0
- package/dist/transport/session/session-description.js.map +1 -0
- package/dist/transport/{fix-msg-factory.d.ts → session/session-msg-factory.d.ts} +2 -2
- package/dist/transport/session/session-msg-factory.js +3 -0
- package/dist/transport/session/session-msg-factory.js.map +1 -0
- package/dist/transport/session/session-state.d.ts +25 -0
- package/dist/transport/session/session-state.js +30 -0
- package/dist/transport/session/session-state.js.map +1 -0
- package/dist/transport/tcp/index.d.ts +3 -2
- package/dist/transport/tcp/index.js +3 -2
- package/dist/transport/tcp/index.js.map +1 -1
- package/dist/transport/tcp/recovering-tcp-initiator.d.ts +7 -9
- package/dist/transport/tcp/recovering-tcp-initiator.js +41 -16
- package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -1
- package/dist/transport/tcp/tcp-acceptor-listener.d.ts +7 -0
- package/dist/transport/tcp/tcp-acceptor-listener.js +70 -0
- package/dist/transport/tcp/tcp-acceptor-listener.js.map +1 -0
- package/dist/transport/tcp/tcp-acceptor.js +29 -12
- package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator-connector.d.ts +10 -0
- package/dist/transport/tcp/tcp-initiator-connector.js +97 -0
- package/dist/transport/tcp/tcp-initiator-connector.js.map +1 -0
- package/dist/transport/tcp/tcp-initiator.d.ts +2 -2
- package/dist/transport/tcp/tcp-initiator.js +28 -9
- package/dist/transport/tcp/tcp-initiator.js.map +1 -1
- package/dist/transport/tcp/tcp-transport-description.d.ts +6 -0
- package/dist/transport/tcp/tcp-transport-description.js +3 -0
- package/dist/transport/tcp/tcp-transport-description.js.map +1 -0
- package/dist/transport/tcp/tls-options-factory.d.ts +9 -0
- package/dist/transport/tcp/tls-options-factory.js +53 -0
- package/dist/transport/tcp/tls-options-factory.js.map +1 -0
- package/dist/transport/tcp/tls-options.d.ts +10 -5
- package/dist/transport/tcp/tls-options.js +0 -49
- package/dist/transport/tcp/tls-options.js.map +1 -1
- package/dist/transport/tick-action.d.ts +8 -0
- package/dist/transport/tick-action.js +13 -0
- package/dist/transport/tick-action.js.map +1 -0
- package/dist/util/buffer-helper.js +1 -1
- package/dist/util/buffer-helper.js.map +1 -1
- package/dist/util/definition-factory.d.ts +10 -0
- package/dist/util/definition-factory.js +56 -0
- package/dist/util/definition-factory.js.map +1 -0
- package/dist/util/dictionary-path.d.ts +4 -0
- package/dist/util/dictionary-path.js +3 -0
- package/dist/util/dictionary-path.js.map +1 -0
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.js +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/json-helper.d.ts +3 -1
- package/dist/util/json-helper.js +13 -12
- package/dist/util/json-helper.js.map +1 -1
- package/dist/util/message-generator.d.ts +1 -1
- package/dist/util/message-generator.js +16 -15
- package/dist/util/message-generator.js.map +1 -1
- package/dist/util/replay.d.ts +6 -3
- package/dist/util/replay.js +24 -26
- package/dist/util/replay.js.map +1 -1
- package/package.json +18 -13
- package/script/build.cmd +1 -0
- package/script/build.sh +1 -0
- package/script/test.cmd +3 -0
- package/src/buffer/{ascii-chars.ts → ascii/ascii-chars.ts} +0 -0
- package/src/buffer/ascii/ascii-encoder.ts +9 -6
- package/src/buffer/ascii/ascii-parser-state.ts +7 -12
- package/src/buffer/ascii/ascii-parser.ts +23 -16
- package/src/buffer/ascii/ascii-segment-parser.ts +14 -8
- package/src/buffer/ascii/ascii-view.ts +4 -9
- package/src/buffer/ascii/index.ts +1 -0
- package/src/buffer/ascii/parse-state.ts +8 -0
- package/src/buffer/ascii/time-formatter.ts +1 -1
- package/src/buffer/elastic-buffer.ts +7 -2
- package/src/buffer/encode-proxy.ts +9 -4
- package/src/buffer/fixml/fixml-encoder.ts +15 -11
- package/src/buffer/fixml/fixml-parser.ts +16 -6
- package/src/buffer/fixml/fixml-view.ts +4 -9
- package/src/buffer/fixml/populated-attributes.ts +6 -0
- package/src/buffer/index.ts +4 -8
- package/src/buffer/msg-encoder.ts +2 -1
- package/src/buffer/msg-view.ts +13 -9
- package/src/buffer/{segment-description.ts → segment/segment-description.ts} +4 -11
- package/src/buffer/{segment-summary.ts → segment/segment-summary.ts} +0 -0
- package/src/buffer/segment/segment-type.ts +8 -0
- package/src/buffer/structure.ts +3 -3
- package/src/buffer/{tag-pos.ts → tag/tag-pos.ts} +0 -0
- package/src/buffer/tag/tag-type.ts +13 -0
- package/src/buffer/{tags.ts → tag/tags.ts} +4 -16
- package/src/config/get-js-fx-logger.ts +4 -0
- package/src/config/index.ts +1 -0
- package/src/config/js-fix-config.ts +5 -2
- package/src/config/js-fix-logger.ts +0 -3
- package/src/dictionary/compiler/compiler-type.ts +3 -3
- package/src/dictionary/compiler/enum-compiler.ts +12 -1
- package/src/dictionary/compiler/msg-compiler.ts +8 -7
- package/src/dictionary/contained/contained-component-field.ts +2 -1
- package/src/dictionary/contained/contained-field-dispatch.ts +3 -7
- package/src/dictionary/contained/contained-field-dispatcher.ts +9 -0
- package/src/dictionary/contained/contained-field-set.ts +5 -3
- package/src/dictionary/contained/contained-field-type.ts +5 -0
- package/src/dictionary/contained/contained-field.ts +1 -6
- package/src/dictionary/contained/contained-group-field.ts +2 -1
- package/src/dictionary/contained/contained-simple-field.ts +2 -1
- package/src/dictionary/contained/field-dispatcher.ts +9 -0
- package/src/dictionary/contained/fields-dispatch.ts +46 -0
- package/src/dictionary/contained/index.ts +2 -0
- package/src/dictionary/contained-set-type.ts +5 -0
- package/src/dictionary/definition/component-field-definition.ts +1 -1
- package/src/dictionary/definition/fix-definitions.ts +2 -1
- package/src/dictionary/definition/group-field-definition.ts +1 -1
- package/src/dictionary/definition/index.ts +0 -1
- package/src/dictionary/definition/message-definition.ts +1 -1
- package/src/dictionary/definition/simple-field-definition.ts +3 -1
- package/src/dictionary/dict-primitive.ts +0 -13
- package/src/dictionary/fix-definition-source.ts +6 -0
- package/src/dictionary/fix-versions.ts +0 -32
- package/src/dictionary/index.ts +1 -5
- package/src/dictionary/parser/fix-repository/abbreviations-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/base-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/components-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/data-types-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/enums-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/fields-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/messages-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/msg-contents-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/repository-abbreviation.ts +6 -0
- package/src/dictionary/parser/fix-repository/repository-component.ts +11 -0
- package/src/dictionary/parser/fix-repository/repository-data-type.ts +7 -0
- package/src/dictionary/parser/fix-repository/repository-enum.ts +8 -0
- package/src/dictionary/parser/fix-repository/repository-field.ts +12 -0
- package/src/dictionary/parser/fix-repository/repository-message.ts +12 -0
- package/src/dictionary/parser/fix-repository/repository-msg-content.ts +10 -0
- package/src/dictionary/parser/fix-repository/repository-type.ts +0 -59
- package/src/dictionary/parser/fix-repository/repository-xml-parser.ts +10 -9
- package/src/dictionary/parser/fix-repository/repository.ts +69 -38
- package/src/dictionary/parser/fixml/components-parser.ts +6 -3
- package/src/dictionary/parser/fixml/fields-parser.ts +1 -1
- package/src/dictionary/parser/fixml/fix-xsd-parser.ts +2 -1
- package/src/dictionary/parser/fixml/include-graph.ts +2 -1
- package/src/dictionary/parser/fixml/xsd-parser.ts +2 -1
- package/src/dictionary/parser/quickfix/field-definition-parser.ts +4 -5
- package/src/dictionary/parser/quickfix/field-set-parser.ts +4 -5
- package/src/dictionary/parser/quickfix/message-parser.ts +4 -5
- package/src/dictionary/parser/quickfix/node-parser.ts +3 -6
- package/src/dictionary/parser/quickfix/parse-state.ts +8 -0
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +9 -15
- package/src/dictionary/sax-node.ts +7 -0
- package/src/dictionary/set-reduce.ts +30 -31
- package/src/dictionary/type-dispatcher.ts +7 -0
- package/src/dictionary/version-util.ts +25 -0
- package/src/index.ts +1 -0
- package/src/jsfix-cmd.ts +31 -16
- package/src/runtime/di-tokens.ts +48 -0
- package/src/runtime/engine-factory.ts +5 -0
- package/src/runtime/index.ts +5 -0
- package/src/runtime/make-config.ts +35 -0
- package/src/runtime/session-container.ts +180 -0
- package/src/runtime/session-launcher.ts +127 -0
- package/src/sample/http/oms/app.ts +20 -14
- package/src/sample/http/oms/http-client.ts +5 -2
- package/src/sample/http/oms/http-server.ts +5 -1
- package/src/sample/tcp/qf-md/app.ts +12 -12
- package/src/sample/tcp/qf-md/md-client.ts +4 -1
- package/src/sample/tcp/qf-md/md-server.ts +3 -1
- package/src/sample/tcp/recovering-skeleton/app.ts +37 -15
- package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +16 -9
- package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +4 -2
- package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +4 -2
- package/src/sample/tcp/skeleton/app.ts +10 -15
- package/src/sample/tcp/skeleton/skeleton-session.ts +8 -4
- package/src/sample/tcp/tls-trade-capture/app.ts +8 -31
- package/src/sample/tcp/trade-capture/app-launcher.ts +22 -0
- package/src/sample/tcp/trade-capture/app.ts +3 -26
- package/src/sample/tcp/trade-capture/trade-capture-client.ts +2 -1
- package/src/sample/tcp/trade-capture/trade-capture-server.ts +2 -1
- package/src/sample/tcp/trade-capture/trade-factory.ts +7 -1
- package/src/store/fix-msg-ascii-store-resend.ts +3 -2
- package/src/store/fix-msg-memory-store.ts +1 -1
- package/src/store/fix-msg-store-record.ts +6 -0
- package/src/store/fix-msg-store-state.ts +6 -0
- package/src/store/fix-msg-store.ts +1 -7
- package/src/transport/ascii/ascii-msg-transmitter.ts +9 -5
- package/src/transport/ascii/ascii-session-msg-factory.ts +2 -2
- package/src/transport/ascii/ascii-session.ts +9 -6
- package/src/transport/ascii/index.ts +0 -1
- package/src/transport/duplex/http-duplex.ts +1 -1
- package/src/transport/duplex/tcp-duplex.ts +4 -1
- package/src/transport/factory/index.ts +1 -0
- package/src/transport/factory/msg-transport.ts +55 -0
- package/src/transport/fix-acceptor.ts +2 -2
- package/src/transport/fix-entity.ts +9 -0
- package/src/transport/fix-initiator.ts +2 -2
- package/src/transport/fixml/fixml-msg-transmitter.ts +8 -4
- package/src/transport/fixml/fixml-session-msg-factory.ts +2 -2
- package/src/transport/fixml/fixml-session.ts +2 -2
- package/src/transport/fixml/index.ts +0 -2
- package/src/transport/http/html-options.ts +8 -0
- package/src/transport/http/html-route.ts +6 -0
- package/src/transport/http/http-acceptor-listener.ts +42 -0
- package/src/transport/http/http-acceptor.ts +5 -2
- package/src/transport/http/http-adapter.ts +7 -0
- package/src/transport/http/http-initiator.ts +40 -25
- package/src/transport/http/http-json-sample-adapter.ts +7 -2
- package/src/transport/http/http-transaction.ts +1 -1
- package/src/transport/http/http-transport-description.ts +9 -0
- package/src/transport/http/index.ts +1 -0
- package/src/transport/index.ts +11 -10
- package/src/transport/msg-application.ts +13 -0
- package/src/transport/msg-transmitter.ts +5 -5
- package/src/transport/{a-session-msg-factory.ts → session/a-session-msg-factory.ts} +4 -4
- package/src/transport/session/fix-session-state-args.ts +9 -0
- package/src/transport/{fix-session-state.ts → session/fix-session-state.ts} +4 -44
- package/src/transport/{fix-session.ts → session/fix-session.ts} +10 -7
- package/src/transport/{make-fixl-session.ts → session/make-fix-session.ts} +1 -1
- package/src/transport/session/session-description.ts +18 -0
- package/src/transport/{fix-msg-factory.ts → session/session-msg-factory.ts} +2 -2
- package/src/transport/session/session-state.ts +25 -0
- package/src/transport/tcp/index.ts +3 -2
- package/src/transport/tcp/recovering-tcp-initiator.ts +24 -13
- package/src/transport/tcp/tcp-acceptor-listener.ts +45 -0
- package/src/transport/tcp/tcp-acceptor.ts +11 -10
- package/src/transport/tcp/tcp-initiator-connector.ts +71 -0
- package/src/transport/tcp/tcp-initiator.ts +10 -6
- package/src/transport/tcp/tcp-transport-description.ts +7 -0
- package/src/transport/tcp/tls-options-factory.ts +55 -0
- package/src/transport/tcp/tls-options.ts +9 -51
- package/src/transport/tick-action.ts +8 -0
- package/src/util/definition-factory.ts +47 -0
- package/src/util/dictionary-path.ts +4 -0
- package/src/util/index.ts +1 -1
- package/src/util/json-helper.ts +14 -4
- package/src/util/message-generator.ts +6 -3
- package/src/util/replay.ts +26 -21
- package/tsconfig.json +2 -0
- package/dist/buffer/ascii-chars.js.map +0 -1
- package/dist/buffer/segment-description.js.map +0 -1
- package/dist/buffer/segment-summary.js.map +0 -1
- package/dist/buffer/tag-pos.js.map +0 -1
- package/dist/buffer/tags.js.map +0 -1
- package/dist/dictionary/fields-dispatch.js +0 -40
- package/dist/dictionary/fields-dispatch.js.map +0 -1
- package/dist/sample/launcher.d.ts +0 -12
- package/dist/sample/launcher.js +0 -63
- package/dist/sample/launcher.js.map +0 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +0 -2
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js +0 -3
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +0 -1
- package/dist/store/fix-msg-ascii-store-recovery.d.ts +0 -12
- package/dist/store/fix-msg-ascii-store-recovery.js +0 -60
- package/dist/store/fix-msg-ascii-store-recovery.js.map +0 -1
- package/dist/store/fix-msg-ascii-store-replay.d.ts +0 -13
- package/dist/store/fix-msg-ascii-store-replay.js +0 -60
- package/dist/store/fix-msg-ascii-store-replay.js.map +0 -1
- package/dist/store/fix-replay-record.d.ts +0 -12
- package/dist/store/fix-replay-record.js +0 -12
- package/dist/store/fix-replay-record.js.map +0 -1
- package/dist/store/fix-resend-record.d.ts +0 -12
- package/dist/store/fix-resend-record.js +0 -12
- package/dist/store/fix-resend-record.js.map +0 -1
- package/dist/store/replay-record.d.ts +0 -6
- package/dist/store/replay-record.js.map +0 -1
- package/dist/store/store-replay-record.d.ts +0 -12
- package/dist/store/store-replay-record.js +0 -12
- package/dist/store/store-replay-record.js.map +0 -1
- package/dist/tcp/tls-options.d.ts +0 -5
- package/dist/tcp/tls-options.js +0 -45
- package/dist/tcp/tls-options.js.map +0 -1
- package/dist/test/ascii-encode.test.d.ts +0 -1
- package/dist/test/ascii-encode.test.js +0 -416
- package/dist/test/ascii-encode.test.js.map +0 -1
- package/dist/test/ascii-encoder.test.d.ts +0 -1
- package/dist/test/ascii-encoder.test.js.map +0 -1
- package/dist/test/ascii-parser.test.d.ts +0 -1
- package/dist/test/ascii-parser.test.js.map +0 -1
- package/dist/test/ascii-segment.test.d.ts +0 -1
- package/dist/test/ascii-segment.test.js.map +0 -1
- package/dist/test/ascii-store-recovery.test.d.ts +0 -1
- package/dist/test/ascii-store-recovery.test.js +0 -50
- package/dist/test/ascii-store-recovery.test.js.map +0 -1
- package/dist/test/ascii-store-replay.test.d.ts +0 -1
- package/dist/test/ascii-store-replay.test.js.map +0 -1
- package/dist/test/ascii-tag-pos.test.d.ts +0 -1
- package/dist/test/ascii-tag-pos.test.js.map +0 -1
- package/dist/test/execution-report.test.d.ts +0 -1
- package/dist/test/execution-report.test.js.map +0 -1
- package/dist/test/fix-log-replay.test.d.ts +0 -1
- package/dist/test/fix-log-replay.test.js.map +0 -1
- package/dist/test/fix-repo-dict.test.d.ts +0 -1
- package/dist/test/fix-repo-dict.test.js.map +0 -1
- package/dist/test/fixml-alloc-parse.test.d.ts +0 -1
- package/dist/test/fixml-alloc-parse.test.js.map +0 -1
- package/dist/test/fixml-mkt-data-fut-parse.test.d.ts +0 -1
- package/dist/test/fixml-mkt-data-fut-parse.test.js.map +0 -1
- package/dist/test/fixml-mkt-data-settle-parse.test.d.ts +0 -1
- package/dist/test/fixml-mkt-data-settle-parse.test.js.map +0 -1
- package/dist/test/fixml-tc-bi-lateral-parse.test.d.ts +0 -1
- package/dist/test/fixml-tc-bi-lateral-parse.test.js.map +0 -1
- package/dist/test/includes.test.d.ts +0 -1
- package/dist/test/includes.test.js.map +0 -1
- package/dist/test/logon.test.d.ts +0 -1
- package/dist/test/logon.test.js.map +0 -1
- package/dist/test/memory-store.test.d.ts +0 -1
- package/dist/test/memory-store.test.js.map +0 -1
- package/dist/test/qf-full-msg.test.d.ts +0 -1
- package/dist/test/qf-full-msg.test.js.map +0 -1
- package/dist/test/repo-full-ascii-msg.test.d.ts +0 -1
- package/dist/test/repo-full-ascii-msg.test.js.map +0 -1
- package/dist/test/repo-full-fixml-msg.test.d.ts +0 -1
- package/dist/test/repo-full-fixml-msg.test.js.map +0 -1
- package/dist/test/session-state.test.d.ts +0 -1
- package/dist/test/session-state.test.js.map +0 -1
- package/dist/test/session.test.d.ts +0 -1
- package/dist/test/session.test.js.map +0 -1
- package/dist/test/time-formatter.test.d.ts +0 -1
- package/dist/test/time-formatter.test.js.map +0 -1
- package/dist/test/to-views.js.map +0 -1
- package/dist/test/view-decode.test.d.ts +0 -1
- package/dist/test/view-decode.test.js.map +0 -1
- package/dist/transport/a-session-msg-factory.js.map +0 -1
- package/dist/transport/ascii-session-msg-factory.d.ts +0 -16
- package/dist/transport/ascii-session-msg-factory.js +0 -47
- package/dist/transport/ascii-session-msg-factory.js.map +0 -1
- package/dist/transport/fix-msg-factory.js.map +0 -1
- package/dist/transport/fix-session-state.d.ts +0 -70
- package/dist/transport/fix-session-state.js.map +0 -1
- package/dist/transport/fix-session.js.map +0 -1
- package/dist/transport/fixml/acceptor.d.ts +0 -3
- package/dist/transport/fixml/acceptor.js +0 -38
- package/dist/transport/fixml/acceptor.js.map +0 -1
- package/dist/transport/fixml-session-msg-factory.d.ts +0 -13
- package/dist/transport/fixml-session-msg-factory.js +0 -68
- package/dist/transport/fixml-session-msg-factory.js.map +0 -1
- package/dist/transport/make-config.d.ts +0 -4
- package/dist/transport/make-config.js +0 -31
- package/dist/transport/make-config.js.map +0 -1
- package/dist/transport/make-fixl-session.js.map +0 -1
- package/dist/transport/msg-transport.js +0 -57
- package/dist/transport/msg-transport.js.map +0 -1
- package/dist/transport/session-description.d.ts +0 -64
- package/dist/transport/session-description.js.map +0 -1
- package/dist/transport/session-msg-factory.d.ts +0 -28
- package/dist/transport/session-msg-factory.js +0 -153
- package/dist/transport/session-msg-factory.js.map +0 -1
- package/dist/transport/tcp/acceptor.d.ts +0 -3
- package/dist/transport/tcp/acceptor.js +0 -40
- package/dist/transport/tcp/acceptor.js.map +0 -1
- package/dist/transport/tcp/initiator.d.ts +0 -3
- package/dist/transport/tcp/initiator.js +0 -67
- package/dist/transport/tcp/initiator.js.map +0 -1
- package/dist/transport/tcp/recovering-initiator.d.ts +0 -17
- package/dist/transport/tcp/recovering-initiator.js +0 -30
- package/dist/transport/tcp/recovering-initiator.js.map +0 -1
- package/dist/transport/tcp/recovering_initiator.d.ts +0 -12
- package/dist/transport/tcp/recovering_initiator.js +0 -25
- package/dist/transport/tcp/recovering_initiator.js.map +0 -1
- package/dist/transport/tcp/resilient-initiator.d.ts +0 -12
- package/dist/transport/tcp/resilient-initiator.js +0 -41
- package/dist/transport/tcp/resilient-initiator.js.map +0 -1
- package/dist/types/FIX4.4/quickfix/set/header.d.ts +0 -31
- package/dist/types/FIX4.4/quickfix/set/header.js.map +0 -1
- package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +0 -6
- package/dist/types/FIX4.4/quickfix/set/trailer.js.map +0 -1
- package/dist/util/dictionary-definitions.d.ts +0 -8
- package/dist/util/dictionary-definitions.js +0 -51
- package/dist/util/dictionary-definitions.js.map +0 -1
- package/src/dictionary/fields-dispatch.ts +0 -45
- package/src/sample/launcher.ts +0 -56
- package/src/transport/fixml/acceptor.ts +0 -29
- package/src/transport/make-config.ts +0 -19
- package/src/transport/msg-transport.ts +0 -67
- package/src/transport/session-description.ts +0 -70
- package/src/transport/tcp/acceptor.ts +0 -31
- package/src/transport/tcp/initiator.ts +0 -59
- package/src/util/dictionary-definitions.ts +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trade-factory.js","sourceRoot":"","sources":["../../../../src/sample/tcp/trade-capture/trade-factory.ts"],"names":[],"mappings":";;;AAAA,qDAWmC;AAEnC,0DAAgE;AAEhE,MAAa,YAAY;IAAzB;QACU,gBAAW,GAAW,MAAM,CAAA;QAC5B,eAAU,GAAW,MAAM,CAAA;QAClB,eAAU,GACzB;YACE,MAAM;YACN,QAAQ;YACR,UAAU;YACV,WAAW;YACX,OAAO;SACR,CAAA;
|
|
1
|
+
{"version":3,"file":"trade-factory.js","sourceRoot":"","sources":["../../../../src/sample/tcp/trade-capture/trade-factory.ts"],"names":[],"mappings":";;;AAAA,qDAWmC;AAEnC,0DAAgE;AAEhE,MAAa,YAAY;IAAzB;QACU,gBAAW,GAAW,MAAM,CAAA;QAC5B,eAAU,GAAW,MAAM,CAAA;QAClB,eAAU,GACzB;YACE,MAAM;YACN,QAAQ;YACR,UAAU;YACV,WAAW;YACX,OAAO;SACR,CAAA;IA2EL,CAAC;IAzEQ,MAAM,CAAC,4BAA4B,CAAE,GAA+B,EAAE,MAA0B;QAErG,OAAO;YACL,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACtC,kBAAkB,EAAE,MAAM;YAC1B,kBAAkB,EAAE,yBAAkB,CAAC,UAAU;SACjB,CAAA;IACpC,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAE,SAAiB,EAAE,SAAe;QACzE,MAAM,EAAE,GAAG,SAAS,CAAA;QACpB,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;QACxC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;QAC5B,OAAO;YACL,cAAc,EAAE,YAAY;YAC5B,gBAAgB,EAAE,uBAAgB,CAAC,SAAS;YAC5C,uBAAuB,EAAE,8BAAuB,CAAC,kBAAkB;YACnE,WAAW,EAAE;gBACX;oBACE,YAAY,EAAE,EAAE;iBACjB;gBACD;oBACE,YAAY,EAAE,EAAE;iBACjB;aACF;SAC4B,CAAA;IACjC,CAAC;IAEO,MAAM,CAAC,YAAY,CAAE,GAAW,EAAE,GAAW;QACnD,GAAG,GA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,EAAE,sBAAe,CAAC,MAAM;YACvC,OAAO,EAAE,cAAO,CAAC,YAAY;YAC7B,YAAY,EAAE,IAAI,IAAI,EAAE;YACxB,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;YACzB,kBAAkB,EAAE,KAAK;YACzB,SAAS,EAAE,gBAAS,CAAC,MAAM;YAC3B,UAAU,EAAE;gBACV,UAAU,EAAE,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM;gBAC3C,MAAM,EAAE,GAAG,UAAU,CAAC,UAAU,CAAC,EAAE;aACpC;YACD,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,OAAO,EAAE,GAAG;YACZ,MAAM,EAAE,KAAK;SAES,CAAA;IAC1B,CAAC;CACF;AArFD,oCAqFC","sourcesContent":["import {\r\n OrdStatus,\r\n SubscriptionRequestType,\r\n TradeReportType,\r\n TradeRequestResult,\r\n TradeRequestStatus,\r\n TradeRequestType,\r\n TrdType,\r\n ITradeCaptureReportRequestAck,\r\n ITradeCaptureReport,\r\n ITradeCaptureReportRequest\r\n} from '../../../types/FIX4.4/repo'\r\n\r\nimport { TradeReportTransType } from '../../../types/FIXML50SP2'\r\n\r\nexport class TradeFactory {\r\n private nextTradeId: number = 100000\r\n private nextExecId: number = 600000\r\n private readonly securities: string[] =\r\n [\r\n 'Gold',\r\n 'Silver',\r\n 'Platinum',\r\n 'Magnesium',\r\n 'Steel'\r\n ]\r\n\r\n public static tradeCaptureReportRequestAck (tcr: ITradeCaptureReportRequest, status: TradeRequestStatus): ITradeCaptureReportRequestAck {\r\n // send back an ack.\r\n return {\r\n TradeRequestID: tcr.TradeRequestID,\r\n TradeRequestType: tcr.TradeRequestType,\r\n TradeRequestStatus: status,\r\n TradeRequestResult: TradeRequestResult.Successful\r\n } as ITradeCaptureReportRequestAck\r\n }\r\n\r\n public static tradeCaptureReportRequest (requestId: string, tradeDate: Date): ITradeCaptureReportRequest {\r\n const d0 = tradeDate\r\n const d1 = new Date(tradeDate.getTime())\r\n d1.setDate(d1.getDate() + 1)\r\n return {\r\n TradeRequestID: 'all-trades',\r\n TradeRequestType: TradeRequestType.AllTrades,\r\n SubscriptionRequestType: SubscriptionRequestType.SnapshotAndUpdates,\r\n TrdCapDtGrp: [\r\n {\r\n TransactTime: d0\r\n },\r\n {\r\n TransactTime: d1\r\n }\r\n ]\r\n } as ITradeCaptureReportRequest\r\n }\r\n\r\n private static getRandomInt (min: number, max: number) {\r\n min = Math.ceil(min)\r\n max = Math.floor(max)\r\n return Math.floor(Math.random() * (max - min)) + min\r\n }\r\n\r\n public batchOfTradeCaptureReport (toMake?: number): ITradeCaptureReport[] {\r\n if (!toMake) {\r\n toMake = TradeFactory.getRandomInt(4, 8)\r\n }\r\n const arr: ITradeCaptureReport[] = []\r\n for (let i: number = 0; i < toMake; ++i) {\r\n const tc: ITradeCaptureReport = this.singleTradeCaptureReport()\r\n arr.push(tc)\r\n }\r\n return arr\r\n }\r\n\r\n public singleTradeCaptureReport (): ITradeCaptureReport {\r\n const tradeReportId = this.nextTradeId++\r\n const qty: number = TradeFactory.getRandomInt(100, 200)\r\n const price: number = Math.round(Math.random() * 100 * 100) / 100\r\n const instrument: number = TradeFactory.getRandomInt(0, this.securities.length - 1)\r\n const securities = this.securities\r\n const execId = this.nextExecId++\r\n return {\r\n TradeReportID: tradeReportId.toString(),\r\n TradeReportTransType: TradeReportTransType.New,\r\n TradeReportType: TradeReportType.Submit,\r\n TrdType: TrdType.RegularTrade,\r\n TransactTime: new Date(),\r\n ExecID: execId.toString(),\r\n PreviouslyReported: false,\r\n OrdStatus: OrdStatus.Filled,\r\n Instrument: {\r\n SecurityID: `${securities[instrument]}.INC`,\r\n Symbol: `${securities[instrument]}`\r\n },\r\n TradeDate: new Date(),\r\n LastQty: qty,\r\n LastPx: price\r\n\r\n } as ITradeCaptureReport\r\n }\r\n}\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IFixMsgStore } from './fix-msg-store';
|
|
2
2
|
import { IFixMsgStoreRecord } from './fix-msg-store-record';
|
|
3
3
|
import { IJsFixConfig } from '../config';
|
|
4
|
-
import { AsciiParser } from '../buffer';
|
|
4
|
+
import { AsciiParser } from '../buffer/ascii';
|
|
5
5
|
export declare class FixMsgAsciiStoreResend {
|
|
6
6
|
readonly store: IFixMsgStore;
|
|
7
7
|
readonly config: IJsFixConfig;
|
|
@@ -4,11 +4,12 @@ exports.FixMsgAsciiStoreResend = void 0;
|
|
|
4
4
|
const fix_msg_store_record_1 = require("./fix-msg-store-record");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
const buffer_1 = require("../buffer");
|
|
7
|
+
const ascii_1 = require("../buffer/ascii");
|
|
7
8
|
class FixMsgAsciiStoreResend {
|
|
8
9
|
constructor(store, config) {
|
|
9
10
|
this.store = store;
|
|
10
11
|
this.config = config;
|
|
11
|
-
this.parser = new
|
|
12
|
+
this.parser = new ascii_1.AsciiParser(this.config, null, new buffer_1.ElasticBuffer(160 * 1024));
|
|
12
13
|
}
|
|
13
14
|
getResendRequest(startSeq, endSeq) {
|
|
14
15
|
return new Promise((resolve, reject) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-msg-ascii-store-resend.js","sourceRoot":"","sources":["../../src/store/fix-msg-ascii-store-resend.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAE9E,oCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"fix-msg-ascii-store-resend.js","sourceRoot":"","sources":["../../src/store/fix-msg-ascii-store-resend.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAE9E,oCAAkC;AAClC,sCAAkD;AAClD,2CAA6C;AAG7C,MAAa,sBAAsB;IAEjC,YAA6B,KAAmB,EAAkB,MAAoB;QAAzD,UAAK,GAAL,KAAK,CAAc;QAAkB,WAAM,GAAN,MAAM,CAAc;QACpF,IAAI,CAAC,MAAM,GAAG,IAAI,mBAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,sBAAa,C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,GAAG,MAAM,CAAA;QACzB,OAAO,IAAI,wCAAiB,CAC1B,eAAO,CAAC,aAAa,EACrB,IAAI,IAAI,EAAE,EACV,MAAM,EACN,OAAO,EACP,IAAI,CAAC,CAAA;IACT,CAAC;CACF;AA/ED,wDA+EC","sourcesContent":["import { IFixMsgStore } from './fix-msg-store'\r\nimport { FixMsgStoreRecord, IFixMsgStoreRecord } from './fix-msg-store-record'\r\nimport { IJsFixConfig } from '../config'\r\nimport { MsgType } from '../types'\r\nimport { ElasticBuffer, MsgView } from '../buffer'\r\nimport { AsciiParser } from '../buffer/ascii'\r\nimport { ISequenceReset, IStandardHeader } from '../types/FIX4.4/repo'\r\n\r\nexport class FixMsgAsciiStoreResend {\r\n parser: AsciiParser\r\n constructor (public readonly store: IFixMsgStore, public readonly config: IJsFixConfig) {\r\n this.parser = new AsciiParser(this.config, null, new ElasticBuffer(160 * 1024))\r\n }\r\n\r\n public getResendRequest (startSeq: number, endSeq: number): Promise<IFixMsgStoreRecord[]> {\r\n\r\n // need to cover request from start to end where any missing numbers are\r\n // included as gaps to allow vector of messages to be sent by the session\r\n // on a request\r\n\r\n return new Promise((resolve, reject) => {\r\n this.store.getSeqNumRange(startSeq, endSeq).then(res => {\r\n resolve(this.inflateRange(startSeq, endSeq, res))\r\n }).catch(e => {\r\n reject(e)\r\n })\r\n })\r\n }\r\n\r\n private inflateRange (startSeq: number, endSeq: number, input: IFixMsgStoreRecord[]): IFixMsgStoreRecord[] {\r\n const toResend: IFixMsgStoreRecord[] = []\r\n let expected = startSeq\r\n for (let i = 0; i < input.length; ++i) {\r\n const record = input[i].clone()\r\n const seqNum = record.seqNum\r\n const toGap = seqNum - expected\r\n if (toGap > 0) {\r\n this.gap(expected, seqNum, toResend)\r\n }\r\n expected = seqNum + 1\r\n if (record.encoded) {\r\n this.inflate(record)\r\n }\r\n toResend.push(record)\r\n }\r\n if (endSeq - expected > 0) {\r\n this.gap(expected, endSeq + 1, toResend)\r\n }\r\n return toResend\r\n }\r\n\r\n public gap (beginGap: number, seqNum: number, arr: IFixMsgStoreRecord[]) {\r\n if (beginGap > 0) {\r\n arr.push(this.sequenceResetGap(beginGap, seqNum))\r\n }\r\n }\r\n\r\n // if records were sent as encoded text then inflate back to object\r\n // so can be resent or examined\r\n\r\n public inflate (record: IFixMsgStoreRecord): void {\r\n if (record.obj) return\r\n if (!record.encoded) return\r\n const parser = this.parser\r\n parser.on('error', (e: Error) => {\r\n record.obj = null\r\n })\r\n parser.on('msg', (view: MsgView) => {\r\n record.obj = view.toObject()\r\n })\r\n // inline parse\r\n parser.parseText(record.encoded)\r\n }\r\n\r\n public sequenceResetGap (startGap: number, newSeq: number): IFixMsgStoreRecord {\r\n const factory = this.config.factory\r\n const gapFill: ISequenceReset = factory.sequenceReset(newSeq, true) as ISequenceReset\r\n gapFill.StandardHeader = factory.header(MsgType.SequenceReset, startGap) as IStandardHeader\r\n gapFill.StandardHeader.PossDupFlag = true\r\n gapFill.NewSeqNo = newSeq\r\n return new FixMsgStoreRecord(\r\n MsgType.SequenceReset,\r\n new Date(),\r\n newSeq,\r\n gapFill,\r\n null)\r\n }\r\n}\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IFixMsgStore } from './fix-msg-store';
|
|
2
2
|
import { IJsFixConfig, IJsFixLogger } from '../config';
|
|
3
3
|
import { IFixMsgStoreRecord } from './fix-msg-store-record';
|
|
4
|
-
import { IFixMsgStoreState } from '
|
|
4
|
+
import { IFixMsgStoreState } from './fix-msg-store-state';
|
|
5
5
|
export declare class FixMsgMemoryStore implements IFixMsgStore {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly config: IJsFixConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-msg-memory-store.js","sourceRoot":"","sources":["../../src/store/fix-msg-memory-store.ts"],"names":[],"mappings":";;;AAGA,gDAA2C;AAC3C,oCAAkC;AAGlC,MAAa,iBAAiB;IAe5B,YAAoC,EAAU,EAAkB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CAAC,CAAA;gBACjD,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAA;aACpB;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAA;aACV;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAnKD,8CAmKC","sourcesContent":["import { IFixMsgStore } from './fix-msg-store'\r\nimport { IJsFixConfig, IJsFixLogger } from '../config'\r\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\r\nimport { Dictionary } from '../collections'\r\nimport { MsgType } from '../types'\r\nimport { IFixMsgStoreState } from '.'\r\n\r\nexport class FixMsgMemoryStore implements IFixMsgStore {\r\n protected readonly logger: IJsFixLogger\r\n public heartbeat: boolean = true\r\n private sortedBySeqNum: IFixMsgStoreRecord[] = []\r\n private excluded: Dictionary<boolean> = new Dictionary<boolean>()\r\n public length: number = 0\r\n private sessionMessages: string[] = [\r\n MsgType.Logon,\r\n MsgType.Logout,\r\n MsgType.ResendRequest,\r\n MsgType.Heartbeat,\r\n MsgType.TestRequest,\r\n MsgType.SequenceReset\r\n ]\r\n\r\n public constructor (public readonly id: string, public readonly config: IJsFixConfig) {\r\n this.logger = config.logFactory.logger(`${this.id}:FixMsgMemoryStore`)\r\n this.setExcMsgType([])\r\n }\r\n\r\n public static search (ar: IFixMsgStoreRecord[], target?: number, isDate?: boolean): number {\r\n let m: number = 0\r\n let n: number = ar.length - 1\r\n while (m <= n) {\r\n const k: number = (n + m) >> 1\r\n const check: number = isDate ? ar[k].timestamp.getDate() : ar[k].seqNum\r\n const cmp: number = target - check\r\n if (cmp > 0) {\r\n m = k + 1\r\n } else if (cmp < 0) {\r\n n = k - 1\r\n } else {\r\n return k\r\n }\r\n }\r\n return -m - 1\r\n }\r\n\r\n public getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]> {\r\n return new Promise((resolve, reject: any) => {\r\n const data = this.sortedBySeqNum\r\n if (data === null) reject(new Error('no store'))\r\n const required = data.filter(x => x.msgType === msgType)\r\n resolve(required)\r\n })\r\n }\r\n\r\n private getIndex (seq: number): number {\r\n const arr = this.sortedBySeqNum\r\n let index = FixMsgMemoryStore.search(arr, seq)\r\n if (index < 0) {\r\n index = -(index + 1)\r\n }\r\n return index\r\n }\r\n\r\n private bounded (fromIdx: number, toIdx: number) {\r\n const arr = this.sortedBySeqNum\r\n return fromIdx >= 0 && fromIdx <= arr.length && toIdx >= fromIdx && toIdx <= arr.length\r\n }\r\n\r\n public get (from: number): Promise<IFixMsgStoreRecord> {\r\n return new Promise((resolve, reject) => {\r\n this.getSeqNumRange(from, from).then(res => {\r\n if (res.length > 0) {\r\n const record = res[0].clone()\r\n resolve(record)\r\n } else {\r\n reject(new Error(`${from} not in store`))\r\n }\r\n }).catch(e => {\r\n reject(e)\r\n })\r\n })\r\n }\r\n\r\n public getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]> {\r\n return new Promise((resolve, reject) => {\r\n const arr = this.sortedBySeqNum\r\n if (from < 0) reject(new Error(`illegal from ${from}`))\r\n if (to < 0) reject(new Error(`illegal to ${to}`))\r\n let fromIdx = this.getIndex(from)\r\n const toEnd = to === 0 || isNaN(to)\r\n let toIdx = toEnd ? arr.length - 1 : this.getIndex(to)\r\n if (this.bounded(fromIdx, toIdx)) {\r\n resolve(arr.slice(fromIdx, toIdx + 1))\r\n } else {\r\n reject(new Error(`incorrect bounds from=${from}, fromIdx=${fromIdx}, to=${to}, toIdx=${toIdx}, length=${arr.length}`))\r\n }\r\n })\r\n }\r\n\r\n private buildState (): IFixMsgStoreState {\r\n const arr = this.sortedBySeqNum\r\n return {\r\n firstSeq: arr.length > 0 ? arr[0].seqNum : 0,\r\n lastSeq: arr.length > 0 ? arr[arr.length - 1].seqNum : 0,\r\n id: this.id,\r\n length: arr.length\r\n } as IFixMsgStoreState\r\n }\r\n\r\n public getState (): Promise<IFixMsgStoreState> {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public clear (): Promise<IFixMsgStoreState> {\r\n this.sortedBySeqNum = []\r\n return new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState> {\r\n return new Promise((resolve, reject) => {\r\n if (this.excluded.containsKey(record.msgType)) {\r\n resolve(this.buildState())\r\n } else {\r\n const arr = this.sortedBySeqNum\r\n const idx = FixMsgMemoryStore.search(arr, record.seqNum)\r\n if (idx >= 0) { // seen this before\r\n reject(new Error(`this seqNum ${record.seqNum} already in store`))\r\n }\r\n arr.splice(-idx, 0, record)\r\n this.length = arr.length\r\n resolve(this.buildState())\r\n }\r\n })\r\n }\r\n\r\n public setExcMsgType (exclude: string[]): void {\r\n this.excluded.clear()\r\n this.excludeRange(this.sessionMessages)\r\n this.excludeRange(exclude)\r\n }\r\n\r\n private excludeRange (exclude: string[]): void {\r\n exclude.forEach(s => {\r\n this.excluded.add(s, true)\r\n })\r\n }\r\n\r\n exists (seqNum: number): Promise<boolean> {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n const arr = this.sortedBySeqNum\r\n let index = FixMsgMemoryStore.search(arr, seqNum)\r\n resolve(index >= 0)\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"fix-msg-memory-store.js","sourceRoot":"","sources":["../../src/store/fix-msg-memory-store.ts"],"names":[],"mappings":";;;AAGA,gDAA2C;AAC3C,oCAAkC;AAGlC,MAAa,iBAAiB;IAe5B,YAAoC,EAAU,EAAkB,MAAoB;QAAhD,OAAE,GAAF,EAAE,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAc;QAb7E,cAAS,GAAY,IAAI,CAAA;QACxB,mBAAc,GAAyB,EAAE,CAAA;QACzC,aAAQ,GAAwB,IAAI,wBAAU,EAAW,CAAA;QAC1D,WAAM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ent":["import { IFixMsgStore } from './fix-msg-store'\r\nimport { IJsFixConfig, IJsFixLogger } from '../config'\r\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\r\nimport { Dictionary } from '../collections'\r\nimport { MsgType } from '../types'\r\nimport { IFixMsgStoreState } from './fix-msg-store-state'\r\n\r\nexport class FixMsgMemoryStore implements IFixMsgStore {\r\n protected readonly logger: IJsFixLogger\r\n public heartbeat: boolean = true\r\n private sortedBySeqNum: IFixMsgStoreRecord[] = []\r\n private excluded: Dictionary<boolean> = new Dictionary<boolean>()\r\n public length: number = 0\r\n private sessionMessages: string[] = [\r\n MsgType.Logon,\r\n MsgType.Logout,\r\n MsgType.ResendRequest,\r\n MsgType.Heartbeat,\r\n MsgType.TestRequest,\r\n MsgType.SequenceReset\r\n ]\r\n\r\n public constructor (public readonly id: string, public readonly config: IJsFixConfig) {\r\n this.logger = config.logFactory.logger(`${this.id}:FixMsgMemoryStore`)\r\n this.setExcMsgType([])\r\n }\r\n\r\n public static search (ar: IFixMsgStoreRecord[], target?: number, isDate?: boolean): number {\r\n let m: number = 0\r\n let n: number = ar.length - 1\r\n while (m <= n) {\r\n const k: number = (n + m) >> 1\r\n const check: number = isDate ? ar[k].timestamp.getDate() : ar[k].seqNum\r\n const cmp: number = target - check\r\n if (cmp > 0) {\r\n m = k + 1\r\n } else if (cmp < 0) {\r\n n = k - 1\r\n } else {\r\n return k\r\n }\r\n }\r\n return -m - 1\r\n }\r\n\r\n public getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]> {\r\n return new Promise((resolve, reject: any) => {\r\n const data = this.sortedBySeqNum\r\n if (data === null) reject(new Error('no store'))\r\n const required = data.filter(x => x.msgType === msgType)\r\n resolve(required)\r\n })\r\n }\r\n\r\n private getIndex (seq: number): number {\r\n const arr = this.sortedBySeqNum\r\n let index = FixMsgMemoryStore.search(arr, seq)\r\n if (index < 0) {\r\n index = -(index + 1)\r\n }\r\n return index\r\n }\r\n\r\n private bounded (fromIdx: number, toIdx: number) {\r\n const arr = this.sortedBySeqNum\r\n return fromIdx >= 0 && fromIdx <= arr.length && toIdx >= fromIdx && toIdx <= arr.length\r\n }\r\n\r\n public get (from: number): Promise<IFixMsgStoreRecord> {\r\n return new Promise((resolve, reject) => {\r\n this.getSeqNumRange(from, from).then(res => {\r\n if (res.length > 0) {\r\n const record = res[0].clone()\r\n resolve(record)\r\n } else {\r\n reject(new Error(`${from} not in store`))\r\n }\r\n }).catch(e => {\r\n reject(e)\r\n })\r\n })\r\n }\r\n\r\n public getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]> {\r\n return new Promise((resolve, reject) => {\r\n const arr = this.sortedBySeqNum\r\n if (from < 0) reject(new Error(`illegal from ${from}`))\r\n if (to < 0) reject(new Error(`illegal to ${to}`))\r\n let fromIdx = this.getIndex(from)\r\n const toEnd = to === 0 || isNaN(to)\r\n let toIdx = toEnd ? arr.length - 1 : this.getIndex(to)\r\n if (this.bounded(fromIdx, toIdx)) {\r\n resolve(arr.slice(fromIdx, toIdx + 1))\r\n } else {\r\n reject(new Error(`incorrect bounds from=${from}, fromIdx=${fromIdx}, to=${to}, toIdx=${toIdx}, length=${arr.length}`))\r\n }\r\n })\r\n }\r\n\r\n private buildState (): IFixMsgStoreState {\r\n const arr = this.sortedBySeqNum\r\n return {\r\n firstSeq: arr.length > 0 ? arr[0].seqNum : 0,\r\n lastSeq: arr.length > 0 ? arr[arr.length - 1].seqNum : 0,\r\n id: this.id,\r\n length: arr.length\r\n } as IFixMsgStoreState\r\n }\r\n\r\n public getState (): Promise<IFixMsgStoreState> {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public clear (): Promise<IFixMsgStoreState> {\r\n this.sortedBySeqNum = []\r\n return new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState> {\r\n return new Promise((resolve, reject) => {\r\n if (this.excluded.containsKey(record.msgType)) {\r\n resolve(this.buildState())\r\n } else {\r\n const arr = this.sortedBySeqNum\r\n const idx = FixMsgMemoryStore.search(arr, record.seqNum)\r\n if (idx >= 0) { // seen this before\r\n reject(new Error(`this seqNum ${record.seqNum} already in store`))\r\n }\r\n arr.splice(-idx, 0, record)\r\n this.length = arr.length\r\n resolve(this.buildState())\r\n }\r\n })\r\n }\r\n\r\n public setExcMsgType (exclude: string[]): void {\r\n this.excluded.clear()\r\n this.excludeRange(this.sessionMessages)\r\n this.excludeRange(exclude)\r\n }\r\n\r\n private excludeRange (exclude: string[]): void {\r\n exclude.forEach(s => {\r\n this.excluded.add(s, true)\r\n })\r\n }\r\n\r\n exists (seqNum: number): Promise<boolean> {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n const arr = this.sortedBySeqNum\r\n let index = FixMsgMemoryStore.search(arr, seqNum)\r\n resolve(index >= 0)\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n}\r\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ILooseObject } from '../collections/collection';
|
|
2
|
+
import { MsgView } from '../buffer';
|
|
2
3
|
export interface IFixMsgStoreRecord {
|
|
3
4
|
readonly msgType: string;
|
|
4
5
|
readonly timestamp: Date;
|
|
@@ -14,5 +15,6 @@ export declare class FixMsgStoreRecord implements IFixMsgStoreRecord {
|
|
|
14
15
|
obj?: ILooseObject;
|
|
15
16
|
readonly encoded?: string;
|
|
16
17
|
constructor(msgType: string, timestamp: Date, seqNum: number, obj?: ILooseObject, encoded?: string);
|
|
18
|
+
static toMsgStoreRecord(v: MsgView): IFixMsgStoreRecord;
|
|
17
19
|
clone(): IFixMsgStoreRecord;
|
|
18
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FixMsgStoreRecord = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
4
5
|
class FixMsgStoreRecord {
|
|
5
6
|
constructor(msgType, timestamp, seqNum, obj, encoded) {
|
|
6
7
|
this.msgType = msgType;
|
|
@@ -9,6 +10,9 @@ class FixMsgStoreRecord {
|
|
|
9
10
|
this.obj = obj;
|
|
10
11
|
this.encoded = encoded;
|
|
11
12
|
}
|
|
13
|
+
static toMsgStoreRecord(v) {
|
|
14
|
+
return new FixMsgStoreRecord(v.getString(types_1.MsgTag.MsgType), v.getTyped(types_1.MsgTag.SendingTime), v.getTyped(types_1.MsgTag.MsgSeqNum), v.toObject());
|
|
15
|
+
}
|
|
12
16
|
clone() {
|
|
13
17
|
return new FixMsgStoreRecord(this.msgType, this.timestamp, this.seqNum, this.obj, this.encoded);
|
|
14
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-msg-store-record.js","sourceRoot":"","sources":["../../src/store/fix-msg-store-record.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fix-msg-store-record.js","sourceRoot":"","sources":["../../src/store/fix-msg-store-record.ts"],"names":[],"mappings":";;;AAEA,oCAAiC;AAWjC,MAAa,iBAAiB;IAC5B,YAA6B,OAAe,EACf,SAAe,EACf,MAAc,EACvB,GAAkB,EACT,OAAgB;QAJhB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAM;QACf,WAAM,GAAN,MAAM,CAAQ;QACvB,QAAG,GAAH,GAAG,CAAe;QACT,YAAO,GAAP,OAAO,CAAS;IAC7C,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAE,CAAU;QACjC,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,cAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;IACvI,CAAC;IAED,KAAK;QACH,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACjG,CAAC;CACF;AAfD,8CAeC","sourcesContent":["import { ILooseObject } from '../collections/collection'\r\nimport { MsgView } from '../buffer'\r\nimport { MsgTag } from '../types'\r\n\r\nexport interface IFixMsgStoreRecord {\r\n readonly msgType: string\r\n readonly timestamp: Date\r\n readonly seqNum: number\r\n obj?: ILooseObject\r\n readonly encoded?: string\r\n clone (): IFixMsgStoreRecord\r\n}\r\n\r\nexport class FixMsgStoreRecord implements IFixMsgStoreRecord {\r\n constructor (public readonly msgType: string,\r\n public readonly timestamp: Date,\r\n public readonly seqNum: number,\r\n public obj?: ILooseObject,\r\n public readonly encoded?: string) {\r\n }\r\n\r\n static toMsgStoreRecord (v: MsgView): IFixMsgStoreRecord {\r\n return new FixMsgStoreRecord(v.getString(MsgTag.MsgType), v.getTyped(MsgTag.SendingTime), v.getTyped(MsgTag.MsgSeqNum), v.toObject())\r\n }\r\n\r\n clone (): IFixMsgStoreRecord {\r\n return new FixMsgStoreRecord(this.msgType, this.timestamp, this.seqNum, this.obj, this.encoded)\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-msg-store-state.js","sourceRoot":"","sources":["../../src/store/fix-msg-store-state.ts"],"names":[],"mappings":"","sourcesContent":["export interface IFixMsgStoreState {\r\n readonly length: number,\r\n readonly firstSeq: number,\r\n readonly lastSeq: number\r\n readonly id: string\r\n}\r\n"]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { IFixMsgStoreRecord } from './fix-msg-store-record';
|
|
2
|
-
|
|
3
|
-
readonly length: number;
|
|
4
|
-
readonly firstSeq: number;
|
|
5
|
-
readonly lastSeq: number;
|
|
6
|
-
readonly id: string;
|
|
7
|
-
}
|
|
2
|
+
import { IFixMsgStoreState } from './fix-msg-store-state';
|
|
8
3
|
export interface IFixMsgStore {
|
|
9
4
|
clear(): Promise<IFixMsgStoreState>;
|
|
10
5
|
getState(): Promise<IFixMsgStoreState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-msg-store.js","sourceRoot":"","sources":["../../src/store/fix-msg-store.ts"],"names":[],"mappings":"","sourcesContent":["/*\r\n a message store that represents a single entity which can be queried for recovery\r\n */\r\n\r\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\r\
|
|
1
|
+
{"version":3,"file":"fix-msg-store.js","sourceRoot":"","sources":["../../src/store/fix-msg-store.ts"],"names":[],"mappings":"","sourcesContent":["/*\r\n a message store that represents a single entity which can be queried for recovery\r\n */\r\n\r\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\r\nimport { IFixMsgStoreState } from './fix-msg-store-state'\r\n\r\nexport interface IFixMsgStore {\r\n clear (): Promise<IFixMsgStoreState>\r\n getState (): Promise<IFixMsgStoreState>\r\n put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState>\r\n get (seq: number): Promise<IFixMsgStoreRecord>\r\n exists (seq: number): Promise<boolean>\r\n // if to = 0, then to the end of sequence\r\n getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]>\r\n getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]>\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -9,15 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
13
|
-
const buffer_1 = require("
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const __1 = require("..");
|
|
19
|
-
const ascii_1 = require("../transport/ascii");
|
|
20
|
-
const root = path.join(__dirname, '../../data');
|
|
12
|
+
require("reflect-metadata");
|
|
13
|
+
const buffer_1 = require("../../buffer");
|
|
14
|
+
const ascii_1 = require("../../buffer/ascii");
|
|
15
|
+
const quickfix_1 = require("../../types/FIX4.4/quickfix");
|
|
16
|
+
const index_1 = require("../../index");
|
|
17
|
+
const setup_1 = require("../env/setup");
|
|
21
18
|
let definitions;
|
|
22
19
|
let session;
|
|
23
20
|
let encoder;
|
|
@@ -27,12 +24,17 @@ const localDate = new Date(2018, 6, 25);
|
|
|
27
24
|
const utcTimeStamp = new Date(Date.UTC(2018, 5, 10, 16, 35, 0, 246));
|
|
28
25
|
const utcDate = new Date(Date.UTC(2018, 5, 10, 0, 0, 0, 0));
|
|
29
26
|
const utcTime = new Date(Date.UTC(2018, 0, 1, 16, 35, 0, 246));
|
|
27
|
+
let setup;
|
|
28
|
+
let buffer;
|
|
30
29
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
setup = new setup_1.Setup('session/qf-fix44.json', null);
|
|
31
|
+
yield setup.init();
|
|
32
|
+
definitions = setup.definitions;
|
|
33
|
+
const config = setup.clientConfig;
|
|
34
|
+
definitions = config.definitions;
|
|
35
|
+
session = setup.client.transmitter;
|
|
36
|
+
buffer = setup.client.txBuffer;
|
|
37
|
+
encoder = session.encoder;
|
|
36
38
|
nos = definitions.message.get('NewOrderSingle');
|
|
37
39
|
er = definitions.message.get('ExecutionReport');
|
|
38
40
|
}), 45000);
|
|
@@ -54,36 +56,13 @@ function toFixMessage(o, msg) {
|
|
|
54
56
|
session.encodeMessage(msg.msgType, o);
|
|
55
57
|
return session.buffer.toString();
|
|
56
58
|
}
|
|
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
59
|
test('encode heartbeat', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
60
|
const factory = session.config.factory;
|
|
82
61
|
const hb = factory.heartbeat('test01');
|
|
83
62
|
const hbd = definitions.message.get('Heartbeat');
|
|
84
63
|
const fix = toFixMessage(hb, hbd);
|
|
85
64
|
expect(fix).toBeTruthy();
|
|
86
|
-
const res = yield
|
|
65
|
+
const res = yield setup.client.parseText(fix);
|
|
87
66
|
expect(res.event).toEqual('msg');
|
|
88
67
|
expect(res.msgType).toEqual('0');
|
|
89
68
|
const len = res.view.getTyped(buffer_1.Tags.BodyLengthTag);
|
|
@@ -208,6 +187,31 @@ test('encode UTCTIMEONLY MDEntryTime', () => {
|
|
|
208
187
|
const fix = toFix(grp, mdGrp);
|
|
209
188
|
expect(fix).toEqual('268=1|269=0|273=16:35:00.246|');
|
|
210
189
|
});
|
|
190
|
+
function getTCR1() {
|
|
191
|
+
const d0 = new Date(Date.UTC(2018, 11, 1, 0, 0, 0));
|
|
192
|
+
const d1 = new Date(Date.UTC(2018, 11, 2, 0, 0, 0));
|
|
193
|
+
return {
|
|
194
|
+
TradeRequestID: 'all-trades',
|
|
195
|
+
TradeRequestType: quickfix_1.TradeRequestType.AllTrades,
|
|
196
|
+
SubscriptionRequestType: quickfix_1.SubscriptionRequestType.SnapshotPlusUpdates,
|
|
197
|
+
TrdCapDtGrp: {
|
|
198
|
+
NoDates: [
|
|
199
|
+
{
|
|
200
|
+
TransactTime: d0
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
TransactTime: d1
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
test('encode TradeCaptureReportRequest with TransactTime', () => {
|
|
210
|
+
const tcr = getTCR1();
|
|
211
|
+
const d = definitions.message.get('TradeCaptureReportRequest');
|
|
212
|
+
const fix = toFix(tcr, d);
|
|
213
|
+
expect(fix).toEqual('568=all-trades|569=0|263=1|580=2|60=20181201-00:00:00.000|60=20181202-00:00:00.000|');
|
|
214
|
+
});
|
|
211
215
|
test('encode BOOLEAN (true) ReportToExch', () => {
|
|
212
216
|
expect(er).toBeTruthy();
|
|
213
217
|
const e = {};
|
|
@@ -279,7 +283,7 @@ function getParties() {
|
|
|
279
283
|
}
|
|
280
284
|
};
|
|
281
285
|
}
|
|
282
|
-
function
|
|
286
|
+
function getPartiesNoPartyID() {
|
|
283
287
|
return {
|
|
284
288
|
'Parties': {
|
|
285
289
|
'NoPartyIDs': [
|
|
@@ -299,27 +303,25 @@ test('encode repeated group of simple repository Parties', () => {
|
|
|
299
303
|
});
|
|
300
304
|
test('use a carat as log delimiter', () => {
|
|
301
305
|
expect(er).toBeTruthy();
|
|
302
|
-
const caratEncoder = new
|
|
306
|
+
const caratEncoder = new ascii_1.AsciiEncoder(session.buffer, definitions, new ascii_1.TimeFormatter(session.buffer), ascii_1.AsciiChars.Soh, ascii_1.AsciiChars.Carat);
|
|
303
307
|
const e = getParties();
|
|
304
308
|
const fix = toFix(e, er, caratEncoder);
|
|
305
309
|
expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^');
|
|
306
310
|
});
|
|
307
311
|
test('use a carat as log delimiter with Soh in buffer to show encoding still works', () => {
|
|
308
312
|
expect(er).toBeTruthy();
|
|
309
|
-
const caratEncoder = new
|
|
313
|
+
const caratEncoder = new ascii_1.AsciiEncoder(session.buffer, definitions, new ascii_1.TimeFormatter(session.buffer), ascii_1.AsciiChars.Soh, ascii_1.AsciiChars.Carat);
|
|
310
314
|
const e = getParties();
|
|
311
315
|
const fix = toFix(e, er, caratEncoder);
|
|
312
316
|
expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^');
|
|
313
317
|
const trimmed = caratEncoder.trim().toString();
|
|
314
318
|
expect(trimmed).toEqual('453=2448=magna.447=9452=28448=iaculis447=F452=2');
|
|
315
319
|
});
|
|
316
|
-
test('encode repeated group with no
|
|
320
|
+
test('encode repeated group with no PartyID - should encode', () => {
|
|
317
321
|
expect(er).toBeTruthy();
|
|
318
|
-
const e =
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
expect(run).toThrow(/no delimiter/);
|
|
322
|
+
const e = getPartiesNoPartyID();
|
|
323
|
+
const fix = toFix(e, er);
|
|
324
|
+
expect(fix).toEqual('453=1|447=9|452=28|');
|
|
323
325
|
});
|
|
324
326
|
test('encode repeated group with no array - should throw', () => {
|
|
325
327
|
expect(er).toBeTruthy();
|
|
@@ -393,7 +395,7 @@ test('encode group missing delimiter', () => {
|
|
|
393
395
|
function run() {
|
|
394
396
|
toFix(e, er);
|
|
395
397
|
}
|
|
396
|
-
expect(run).toThrow(/group instance [1] inconsisent delimeter
|
|
398
|
+
expect(run).toThrow(/group instance \[1] inconsisent delimeter 455 expected tag 456/);
|
|
397
399
|
});
|
|
398
400
|
test('encode group not an array of', () => {
|
|
399
401
|
expect(er).toBeTruthy();
|
|
@@ -459,11 +461,11 @@ test('encode custom header 1 - expect DeliverToCompID DepA', () => __awaiter(voi
|
|
|
459
461
|
const nosd = definitions.message.get('NewOrderSingle');
|
|
460
462
|
const fix = toFixMessage(o1, nosd);
|
|
461
463
|
expect(fix).toBeTruthy();
|
|
462
|
-
const res = yield
|
|
464
|
+
const res = yield setup.client.parseText(fix);
|
|
463
465
|
const tag = res.view.getTyped('DeliverToCompID');
|
|
464
466
|
expect(tag).toEqual('DepA');
|
|
465
467
|
expect(res.event).toEqual('msg');
|
|
466
|
-
expect(res.msgType).toEqual(
|
|
468
|
+
expect(res.msgType).toEqual(index_1.MsgType.NewOrderSingle);
|
|
467
469
|
const parsed = res.view.toObject();
|
|
468
470
|
expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepA');
|
|
469
471
|
}));
|
|
@@ -473,11 +475,11 @@ test('encode custom header 2 - expect DeliverToCompID DepC', () => __awaiter(voi
|
|
|
473
475
|
const nosd = definitions.message.get('NewOrderSingle');
|
|
474
476
|
const fix = toFixMessage(o1, nosd);
|
|
475
477
|
expect(fix).toBeTruthy();
|
|
476
|
-
const res = yield
|
|
478
|
+
const res = yield setup.client.parseText(fix);
|
|
477
479
|
const tag = res.view.getTyped('DeliverToCompID');
|
|
478
480
|
expect(tag).toEqual('DepC');
|
|
479
481
|
expect(res.event).toEqual('msg');
|
|
480
|
-
expect(res.msgType).toEqual(
|
|
482
|
+
expect(res.msgType).toEqual(index_1.MsgType.NewOrderSingle);
|
|
481
483
|
const parsed = res.view.toObject();
|
|
482
484
|
expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepC');
|
|
483
485
|
}));
|
|
@@ -491,15 +493,15 @@ test('encode custom header - include MsgSeqNum (for resends we do not want to ov
|
|
|
491
493
|
expect(nosd).toBeTruthy();
|
|
492
494
|
const fix = toFixMessage(o1, nosd);
|
|
493
495
|
expect(fix).toBeTruthy();
|
|
494
|
-
const res = yield
|
|
496
|
+
const res = yield setup.client.parseText(fix);
|
|
495
497
|
expect(res.event).toEqual('msg');
|
|
496
|
-
expect(res.msgType).toEqual(
|
|
498
|
+
expect(res.msgType).toEqual(index_1.MsgType.NewOrderSingle);
|
|
497
499
|
const parsed = res.view.toObject();
|
|
498
500
|
const h = parsed.StandardHeader;
|
|
499
501
|
expect(h.DeliverToCompID).toEqual('DepC');
|
|
500
502
|
expect(h.MsgSeqNum).toEqual(seqNum);
|
|
501
503
|
expect(h.BeginString).toEqual('FIX4.4');
|
|
502
504
|
expect(h.PossDupFlag).toEqual(true);
|
|
503
|
-
expect(h.MsgType).toEqual(
|
|
505
|
+
expect(h.MsgType).toEqual(index_1.MsgType.NewOrderSingle);
|
|
504
506
|
}));
|
|
505
507
|
//# sourceMappingURL=ascii-encoder.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ascii-encoder.test.js","sourceRoot":"","sources":["../../../src/test/ascii/ascii-encoder.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAGzB,yCAAkD;AAClD,8CAA4E;AAE5E,0DAcoC;AACpC,uCAAqC;AAGrC,wCAAoC;AAGpC,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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,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACnC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACvC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAO,CAAC,cAAc,CAAC,CAAA;AACnD,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { ComponentFieldDefinition, FixDefinitions, MessageDefinition } from '../../dictionary/definition'\r\nimport { ElasticBuffer, Tags } from '../../buffer'\r\nimport { AsciiChars, AsciiEncoder, TimeFormatter } from '../../buffer/ascii'\r\nimport { ILooseObject } from '../../collections/collection'\r\nimport {\r\n IInstrument,\r\n INewOrderSingle,\r\n IOrderQtyData,\r\n IStandardHeader,\r\n ITradeCaptureReportRequest,\r\n ITrdCapDtGrpNoDates,\r\n OrdType,\r\n SecurityIDSource,\r\n SecurityType,\r\n Side,\r\n SubscriptionRequestType,\r\n TimeInForce,\r\n TradeRequestType\r\n} from '../../types/FIX4.4/quickfix'\r\nimport { MsgType } from '../../index'\r\nimport { ContainedFieldSet } from '../../dictionary/contained'\r\nimport { AsciiMsgTransmitter } from '../../transport/ascii/ascii-msg-transmitter'\r\nimport { Setup } from '../env/setup'\r\nimport { ParsingResult } from '../env/parsing-result'\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\nlet setup: Setup\r\nlet buffer: ElasticBuffer\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup('session/qf-fix44.json', null)\r\n await setup.init()\r\n definitions = setup.definitions\r\n const config = setup.clientConfig\r\n definitions = config.definitions\r\n session = setup.client.transmitter as AsciiMsgTransmitter\r\n buffer = setup.client.txBuffer\r\n encoder = session.encoder as AsciiEncoder\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\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 setup.client.parseText(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('should not encode empty string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = ''\r\n const fix: string = toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('should not 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\nfunction getTCR1 (): ITradeCaptureReportRequest {\r\n const d0 = new Date(Date.UTC(2018, 11, 1, 0, 0, 0))\r\n const d1 = new Date(Date.UTC(2018, 11, 2, 0, 0, 0))\r\n return {\r\n TradeRequestID: 'all-trades',\r\n TradeRequestType: TradeRequestType.AllTrades,\r\n SubscriptionRequestType: SubscriptionRequestType.SnapshotPlusUpdates,\r\n TrdCapDtGrp: {\r\n NoDates: [\r\n {\r\n TransactTime: d0\r\n },\r\n {\r\n TransactTime: d1\r\n }\r\n ] as ITrdCapDtGrpNoDates[]\r\n }\r\n } as ITradeCaptureReportRequest\r\n}\r\n\r\ntest('encode TradeCaptureReportRequest with TransactTime', () => {\r\n const tcr = getTCR1()\r\n const d = definitions.message.get('TradeCaptureReportRequest')\r\n const fix: string = toFix(tcr, d)\r\n expect(fix).toEqual('568=all-trades|569=0|263=1|580=2|60=20181201-00:00:00.000|60=20181202-00:00:00.000|')\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 getPartiesNoPartyID (): 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 PartyID - should encode', () => {\r\n expect(er).toBeTruthy()\r\n const e: ILooseObject = getPartiesNoPartyID()\r\n const fix: string = toFix(e, er)\r\n expect(fix).toEqual('453=1|447=9|452=28|')\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 \\[1] inconsisent delimeter 455 expected tag 456/)\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\r\nfunction getCompID (securityType: SecurityType): string {\r\n switch (securityType) {\r\n case SecurityType.CommonStock: {\r\n return 'DepA'\r\n }\r\n\r\n case SecurityType.CorporateBond: {\r\n return 'DepB'\r\n }\r\n\r\n case SecurityType.ConvertibleBond: {\r\n return 'DepC'\r\n }\r\n\r\n default:\r\n return 'DepD'\r\n }\r\n}\r\n\r\nfunction createOrder (id: number, symbol: string, securityType: SecurityType, side: Side, qty: number, price: number): INewOrderSingle {\r\n return {\r\n StandardHeader: {\r\n DeliverToCompID: getCompID(securityType)\r\n } as IStandardHeader,\r\n ClOrdID: `Cli${id}`,\r\n Account: 'MyAcc',\r\n Side: side,\r\n Price: price,\r\n OrdType: OrdType.Limit,\r\n OrderQtyData: {\r\n OrderQty: qty\r\n } as IOrderQtyData,\r\n Instrument: {\r\n SecurityType: securityType,\r\n Symbol: symbol,\r\n SecurityID: '459200101',\r\n SecurityIDSource: SecurityIDSource.IsinNumber\r\n } as IInstrument,\r\n TimeInForce: TimeInForce.Day\r\n } as INewOrderSingle\r\n}\r\n\r\ntest('encode custom header 1 - expect DeliverToCompID DepA', async () => {\r\n const type = SecurityType.CommonStock\r\n const o1 = createOrder(1, 'MS', type, Side.Buy, 100, 1000.0)\r\n const nosd = definitions.message.get('NewOrderSingle')\r\n const fix = toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await setup.client.parseText(fix)\r\n const tag = res.view.getTyped('DeliverToCompID')\r\n expect(tag).toEqual('DepA')\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view.toObject()\r\n expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepA')\r\n})\r\n\r\ntest('encode custom header 2 - expect DeliverToCompID DepC', async () => {\r\n const type = SecurityType.ConvertibleBond\r\n const o1 = createOrder(1, 'MSCb', type, Side.Buy, 100, 1000.0)\r\n const nosd = definitions.message.get('NewOrderSingle')\r\n const fix = toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await setup.client.parseText(fix)\r\n const tag = res.view.getTyped('DeliverToCompID')\r\n expect(tag).toEqual('DepC')\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view.toObject()\r\n expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepC')\r\n})\r\n\r\ntest('encode custom header - include MsgSeqNum (for resends we do not want to overwrite)', async () => {\r\n const type = SecurityType.ConvertibleBond\r\n const seqNum: number = 10\r\n const o1 = createOrder(1, 'MSCb', type, Side.Buy, 100, 1000.0)\r\n o1.StandardHeader.MsgSeqNum = seqNum\r\n o1.StandardHeader.PossDupFlag = true\r\n const nosd = definitions.message.get('NewOrderSingle')\r\n expect(nosd).toBeTruthy()\r\n const fix = toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await setup.client.parseText(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view.toObject()\r\n const h: IStandardHeader = parsed.StandardHeader\r\n expect(h.DeliverToCompID).toEqual('DepC')\r\n expect(h.MsgSeqNum).toEqual(seqNum)\r\n expect(h.BeginString).toEqual('FIX4.4')\r\n expect(h.PossDupFlag).toEqual(true)\r\n expect(h.MsgType).toEqual(MsgType.NewOrderSingle)\r\n})\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'reflect-metadata';
|