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
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IJsFixConfig } from '../../config'
|
|
2
|
+
import { FixInitiator } from '../fix-initiator'
|
|
3
|
+
import { TcpInitiator } from './tcp-initiator'
|
|
4
|
+
import { MsgTransport } from '../factory'
|
|
5
|
+
import { FixSession } from '../session/fix-session'
|
|
6
|
+
import { inject, injectable } from 'tsyringe'
|
|
7
|
+
import { DITokens } from '../../runtime/di-tokens'
|
|
8
|
+
import { FixEntity } from '../fix-entity'
|
|
9
|
+
|
|
10
|
+
@injectable()
|
|
11
|
+
export class TcpInitiatorConnector extends FixEntity {
|
|
12
|
+
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {
|
|
13
|
+
super(config)
|
|
14
|
+
}
|
|
15
|
+
start (reconnectTimeout: number = 0): Promise<any> {
|
|
16
|
+
return new Promise<any>(async (accept, reject) => {
|
|
17
|
+
const logger = this.config.logFactory.logger('initiator')
|
|
18
|
+
const sessionContainer = this.config.sessionContainer
|
|
19
|
+
if (!sessionContainer.isRegistered(DITokens.FixSession)) {
|
|
20
|
+
reject(new Error(`application must register a DI token '${DITokens.FixSession}' - see src/sample`))
|
|
21
|
+
}
|
|
22
|
+
logger.info(`create session with DI Token ${DITokens.FixSession}`)
|
|
23
|
+
const initiatorSession = sessionContainer.resolve<FixSession>(DITokens.FixSession)
|
|
24
|
+
let connecting: boolean = true
|
|
25
|
+
while (connecting) {
|
|
26
|
+
try {
|
|
27
|
+
await this.connect(initiatorSession)
|
|
28
|
+
logger.info('session has ended')
|
|
29
|
+
connecting = false
|
|
30
|
+
accept(true)
|
|
31
|
+
} catch (e) {
|
|
32
|
+
if (!reconnectTimeout) {
|
|
33
|
+
connecting = false
|
|
34
|
+
reject(e)
|
|
35
|
+
} else {
|
|
36
|
+
logger.info(`waiting ${reconnectTimeout} to reconnect following error`)
|
|
37
|
+
await this.delay(reconnectTimeout)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
delay (p: number): Promise<any> {
|
|
45
|
+
return new Promise<any>((accept) => {
|
|
46
|
+
if (!p) {
|
|
47
|
+
accept(true)
|
|
48
|
+
}
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
accept(true)
|
|
51
|
+
}, p)
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
connect (initiatorSession: FixSession): Promise<any> {
|
|
56
|
+
return new Promise<any>(async (accept, reject) => {
|
|
57
|
+
const logger = this.config.logFactory.logger('initiator')
|
|
58
|
+
const initiator: FixInitiator = this.config.sessionContainer.resolve<FixInitiator>(TcpInitiator)
|
|
59
|
+
logger.info('connecting ...')
|
|
60
|
+
const initiatorTransport: MsgTransport = await initiator.connect(22)
|
|
61
|
+
logger.info('... connected, run session')
|
|
62
|
+
initiatorSession.run(initiatorTransport).then(() => {
|
|
63
|
+
logger.info('ends')
|
|
64
|
+
accept(true)
|
|
65
|
+
}).catch((e: Error) => {
|
|
66
|
+
logger.error(e)
|
|
67
|
+
reject(e)
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import { FixInitiator } from '../fix-initiator'
|
|
3
|
-
import { MsgTransport } from '../
|
|
3
|
+
import { MsgTransport } from '../factory'
|
|
4
4
|
|
|
5
5
|
import { IJsFixConfig, IJsFixLogger } from '../../config'
|
|
6
6
|
import { TcpDuplex, FixDuplex } from '../duplex'
|
|
7
7
|
|
|
8
8
|
import * as util from 'util'
|
|
9
9
|
import { connect as tlsConnect, ConnectionOptions, TLSSocket } from 'tls'
|
|
10
|
-
import { getTlsConnectionOptions } from './tls-options'
|
|
11
10
|
import { createConnection } from 'net'
|
|
12
11
|
import Timeout = NodeJS.Timeout
|
|
12
|
+
import { TlsOptionsFactory } from './tls-options-factory'
|
|
13
|
+
import { inject, injectable } from 'tsyringe'
|
|
14
|
+
import { DITokens } from '../../runtime/di-tokens'
|
|
15
|
+
import { ITcpTransportDescription } from './tcp-transport-description'
|
|
13
16
|
|
|
14
17
|
export enum InitiatorState {
|
|
15
18
|
Idle = 1,
|
|
@@ -18,6 +21,7 @@ export enum InitiatorState {
|
|
|
18
21
|
Stopped = 4
|
|
19
22
|
}
|
|
20
23
|
|
|
24
|
+
@injectable()
|
|
21
25
|
export class TcpInitiator extends FixInitiator {
|
|
22
26
|
public tcp: ITcpTransportDescription
|
|
23
27
|
public state: InitiatorState = InitiatorState.Idle
|
|
@@ -25,7 +29,7 @@ export class TcpInitiator extends FixInitiator {
|
|
|
25
29
|
private duplex: FixDuplex
|
|
26
30
|
private th: Timeout = null
|
|
27
31
|
|
|
28
|
-
constructor (public readonly jsFixConfig: IJsFixConfig) {
|
|
32
|
+
constructor (@inject(DITokens.IJsFixConfig) public readonly jsFixConfig: IJsFixConfig) {
|
|
29
33
|
super(jsFixConfig.description.application)
|
|
30
34
|
this.logger = jsFixConfig.logFactory.logger(`${this.application.name}:TcpInitiator`)
|
|
31
35
|
if (!this.application) {
|
|
@@ -104,7 +108,7 @@ export class TcpInitiator extends FixInitiator {
|
|
|
104
108
|
return new Promise<TcpDuplex>((resolve, reject) => {
|
|
105
109
|
let tlsSocket: TLSSocket = null
|
|
106
110
|
const tcp = this.tcp
|
|
107
|
-
const connectionOptions: ConnectionOptions = getTlsConnectionOptions(tcp)
|
|
111
|
+
const connectionOptions: ConnectionOptions = TlsOptionsFactory.getTlsConnectionOptions(tcp)
|
|
108
112
|
if (connectionOptions) {
|
|
109
113
|
try {
|
|
110
114
|
tlsSocket = tlsConnect(connectionOptions, () => {
|
|
@@ -135,7 +139,7 @@ export class TcpInitiator extends FixInitiator {
|
|
|
135
139
|
private tryConnect (): Promise < MsgTransport > {
|
|
136
140
|
return new Promise<MsgTransport>((resolve, reject) => {
|
|
137
141
|
const tcp = this.tcp
|
|
138
|
-
const connectionOptions: ConnectionOptions = getTlsConnectionOptions(tcp)
|
|
142
|
+
const connectionOptions: ConnectionOptions = TlsOptionsFactory.getTlsConnectionOptions(tcp)
|
|
139
143
|
const connector = connectionOptions ? this.tlsDuplex() : this.unsecureDuplex()
|
|
140
144
|
this.logger.info(`tryConnect ${tcp.host}:${tcp.port}`)
|
|
141
145
|
connector.then(duplex => {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ConnectionOptions, TlsOptions } from 'tls'
|
|
2
|
+
import { ITlsOptions } from './tls-options'
|
|
3
|
+
import { ITcpTransportDescription } from './tcp-transport-description'
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const fs = require('fs')
|
|
6
|
+
|
|
7
|
+
export class TlsOptionsFactory {
|
|
8
|
+
static read (filePath: string) {
|
|
9
|
+
const root: string = path.join(__dirname, '../../../')
|
|
10
|
+
const fullPath = path.join(root, filePath)
|
|
11
|
+
return fs.readFileSync(fullPath,
|
|
12
|
+
{
|
|
13
|
+
encoding: 'utf8', flag: 'r'
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static getTlsOptions (tls: ITlsOptions): TlsOptions {
|
|
18
|
+
let tlsOptions: TlsOptions = null
|
|
19
|
+
if (tls && tls.key) {
|
|
20
|
+
tlsOptions = {
|
|
21
|
+
key: TlsOptionsFactory.read(tls.key),
|
|
22
|
+
cert: TlsOptionsFactory.read(tls.cert),
|
|
23
|
+
requestCert: tls.requestCert,
|
|
24
|
+
rejectUnauthorized: tls.rejectUnauthorized
|
|
25
|
+
} as TlsOptions
|
|
26
|
+
if (tls.ca && tls.ca.length > 0) {
|
|
27
|
+
tlsOptions.ca = tls.ca.map(i => TlsOptionsFactory.read(i))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return tlsOptions
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static getTlsConnectionOptions (tcp: ITcpTransportDescription): ConnectionOptions {
|
|
34
|
+
let connectionOptions: ConnectionOptions = null
|
|
35
|
+
const tls = tcp.tls
|
|
36
|
+
if (tls && tls.key) {
|
|
37
|
+
connectionOptions = {
|
|
38
|
+
port: tcp.port,
|
|
39
|
+
host: tcp.host,
|
|
40
|
+
key: TlsOptionsFactory.read(tcp.tls.key),
|
|
41
|
+
cert: TlsOptionsFactory.read(tcp.tls.cert)
|
|
42
|
+
} as ConnectionOptions
|
|
43
|
+
if (tcp.tls.ca && tcp.tls.ca.length > 0) {
|
|
44
|
+
connectionOptions.ca = tcp.tls.ca.map(i => TlsOptionsFactory.read(i))
|
|
45
|
+
}
|
|
46
|
+
if (tcp.tls.timeout) {
|
|
47
|
+
connectionOptions.timeout = tcp.tls.timeout
|
|
48
|
+
}
|
|
49
|
+
if (tcp.tls.sessionTimeout) {
|
|
50
|
+
connectionOptions.sessionTimeout = tcp.tls.sessionTimeout
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return connectionOptions
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,52 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
encoding: 'utf8', flag: 'r'
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function getTlsOptions (tls: ITlsOptions): TlsOptions {
|
|
16
|
-
let tlsOptions: TlsOptions = null
|
|
17
|
-
if (tls && tls.key) {
|
|
18
|
-
tlsOptions = {
|
|
19
|
-
key: read(tls.key),
|
|
20
|
-
cert: read(tls.cert),
|
|
21
|
-
requestCert: tls.requestCert,
|
|
22
|
-
rejectUnauthorized: tls.rejectUnauthorized
|
|
23
|
-
} as TlsOptions
|
|
24
|
-
if (tls.ca && tls.ca.length > 0) {
|
|
25
|
-
tlsOptions.ca = tls.ca.map(i => read(i))
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return tlsOptions
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function getTlsConnectionOptions (tcp: ITcpTransportDescription): ConnectionOptions {
|
|
32
|
-
let connectionOptions: ConnectionOptions = null
|
|
33
|
-
const tls = tcp.tls
|
|
34
|
-
if (tls && tls.key) {
|
|
35
|
-
connectionOptions = {
|
|
36
|
-
port: tcp.port,
|
|
37
|
-
host: tcp.host,
|
|
38
|
-
key: read(tcp.tls.key),
|
|
39
|
-
cert: read(tcp.tls.cert)
|
|
40
|
-
} as ConnectionOptions
|
|
41
|
-
if (tcp.tls.ca && tcp.tls.ca.length > 0) {
|
|
42
|
-
connectionOptions.ca = tcp.tls.ca.map(i => read(i))
|
|
43
|
-
}
|
|
44
|
-
if (tcp.tls.timeout) {
|
|
45
|
-
connectionOptions.timeout = tcp.tls.timeout
|
|
46
|
-
}
|
|
47
|
-
if (tcp.tls.sessionTimeout) {
|
|
48
|
-
connectionOptions.sessionTimeout = tcp.tls.sessionTimeout
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return connectionOptions
|
|
1
|
+
export interface ITlsOptions {
|
|
2
|
+
readonly key: string,
|
|
3
|
+
readonly cert: string,
|
|
4
|
+
readonly ca?: string[],
|
|
5
|
+
readonly timeout?: number,
|
|
6
|
+
readonly sessionTimeout?: number,
|
|
7
|
+
readonly enableTrace?: boolean,
|
|
8
|
+
readonly requestCert?: boolean,
|
|
9
|
+
readonly rejectUnauthorized?: boolean
|
|
52
10
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FixParser } from '../dictionary'
|
|
2
|
+
import { FixDefinitions } from '../dictionary/definition'
|
|
3
|
+
import { GetJsFixLogger, makeEmptyLogger } from '../config'
|
|
4
|
+
import * as path from 'path'
|
|
5
|
+
import * as fs from 'fs'
|
|
6
|
+
import { FixXsdParser, QuickFixXmlFileParser, RepositoryXmlParser } from '../dictionary/parser'
|
|
7
|
+
import { IDictionaryPath } from './dictionary-path'
|
|
8
|
+
|
|
9
|
+
const root: string = path.join(__dirname, '../../')
|
|
10
|
+
|
|
11
|
+
export class DefinitionFactory {
|
|
12
|
+
|
|
13
|
+
getDictPath (p: string): IDictionaryPath {
|
|
14
|
+
const dictionary = require(path.join(root, 'data/dictionary.json'))
|
|
15
|
+
return dictionary[p]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async getDefinitions (path: string, getLogger: GetJsFixLogger = makeEmptyLogger): Promise<FixDefinitions> {
|
|
19
|
+
const dp: IDictionaryPath = this.getDictPath(path)
|
|
20
|
+
if (dp) {
|
|
21
|
+
path = dp.dict
|
|
22
|
+
}
|
|
23
|
+
path = this.norm(path)
|
|
24
|
+
const parser = this.getParser(path, getLogger)
|
|
25
|
+
return parser.parse()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getParser (path: string, getLogger: GetJsFixLogger): FixParser {
|
|
29
|
+
let parser: FixParser
|
|
30
|
+
if (fs.lstatSync(path).isDirectory() && path.indexOf('fixml') >= 0) {
|
|
31
|
+
parser = new FixXsdParser(path, getLogger)
|
|
32
|
+
} else if (fs.lstatSync(path).isDirectory()) {
|
|
33
|
+
parser = new RepositoryXmlParser(path, getLogger)
|
|
34
|
+
} else {
|
|
35
|
+
parser = new QuickFixXmlFileParser(path, getLogger)
|
|
36
|
+
}
|
|
37
|
+
return parser
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
norm (p: string): string {
|
|
41
|
+
let f: string = p
|
|
42
|
+
if (!path.isAbsolute(p)) {
|
|
43
|
+
f = path.join(root, f)
|
|
44
|
+
}
|
|
45
|
+
return f
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/util/index.ts
CHANGED
package/src/util/json-helper.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import { TagType } from '../buffer'
|
|
2
1
|
import { ILooseObject } from '../collections/collection'
|
|
3
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ContainedSimpleField,
|
|
4
|
+
ContainedFieldSet,
|
|
5
|
+
ContainedGroupField,
|
|
6
|
+
ContainedComponentField,
|
|
7
|
+
FieldsDispatch
|
|
8
|
+
} from '../dictionary/contained'
|
|
9
|
+
import { FixDefinitions, MessageDefinition } from '../dictionary/definition'
|
|
10
|
+
|
|
4
11
|
import moment = require('moment')
|
|
12
|
+
import { IFieldDispatcher } from '../dictionary/contained/field-dispatcher'
|
|
13
|
+
import { TagType } from '../buffer/tag/tag-type'
|
|
5
14
|
|
|
6
15
|
export class JsonHelper {
|
|
16
|
+
dispatcher: FieldsDispatch = new FieldsDispatch()
|
|
7
17
|
constructor (public readonly definitions: FixDefinitions) {
|
|
8
18
|
}
|
|
9
19
|
|
|
@@ -89,8 +99,8 @@ export class JsonHelper {
|
|
|
89
99
|
component: (cf: ContainedComponentField) => this.patchComponent(object, cf)
|
|
90
100
|
}
|
|
91
101
|
|
|
92
|
-
dispatchFields(set.localAttribute, dispatcher)
|
|
93
|
-
dispatchFields(set.fields, dispatcher)
|
|
102
|
+
this.dispatcher.dispatchFields(set.localAttribute, dispatcher)
|
|
103
|
+
this.dispatcher.dispatchFields(set.fields, dispatcher)
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
private patchComponent (object: ILooseObject, cf: ContainedComponentField) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { TagType } from '../buffer'
|
|
2
1
|
import { ILooseObject } from '../collections/collection'
|
|
3
|
-
import { ContainedComponentField, ContainedGroupField, ContainedFieldSet, ContainedSimpleField
|
|
2
|
+
import { ContainedComponentField, ContainedGroupField, ContainedFieldSet, ContainedSimpleField } from '../dictionary/contained'
|
|
3
|
+
import { FixDefinitions, MessageDefinition, SimpleFieldDefinition } from '../dictionary/definition'
|
|
4
|
+
import { SetReduce } from '../dictionary'
|
|
5
|
+
import { TagType } from '../buffer/tag/tag-type'
|
|
4
6
|
|
|
5
7
|
export class MessageGenerator {
|
|
6
8
|
private word: number = 0
|
|
@@ -62,7 +64,8 @@ export class MessageGenerator {
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
private toObject (set: ContainedFieldSet, density: number, repeatGroups: boolean): ILooseObject {
|
|
65
|
-
|
|
67
|
+
const reducer = new SetReduce<ILooseObject>()
|
|
68
|
+
return reducer.reduce(set, {
|
|
66
69
|
simple: (a: ILooseObject, sf: ContainedSimpleField) => {
|
|
67
70
|
const tag: number = sf.definition.tag
|
|
68
71
|
let include = tag === set.firstSimple.definition.tag || this.length > 0 || Math.random() <= density
|
package/src/util/replay.ts
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { MsgView } from '../buffer'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { FileDuplex } from '../transport'
|
|
3
|
+
import { IJsFixConfig } from '../config'
|
|
4
|
+
import { MsgTransport } from '../transport/factory'
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
export class FileReplayer {
|
|
7
|
+
constructor (public readonly config: IJsFixConfig) {
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
replayFixFile (replayFile: string): Promise<MsgView[]> {
|
|
11
|
+
return new Promise<MsgView[]>((accept, reject) => {
|
|
12
|
+
try {
|
|
13
|
+
const arr: MsgView[] = []
|
|
14
|
+
const transport: MsgTransport = new MsgTransport(1, this.config, new FileDuplex(replayFile))
|
|
15
|
+
transport.receiver.on('msg', (msgType: string, m: MsgView) => {
|
|
16
|
+
// note must clone if a view is to be saved after this call
|
|
17
|
+
arr.push(m.clone())
|
|
18
|
+
})
|
|
19
|
+
transport.receiver.on('end', () => {
|
|
20
|
+
accept(arr)
|
|
21
|
+
})
|
|
22
|
+
transport.receiver.on('error', (e) => {
|
|
23
|
+
reject(e)
|
|
24
|
+
})
|
|
25
|
+
} catch (e) {
|
|
26
|
+
reject(e)
|
|
27
|
+
}
|
|
23
28
|
})
|
|
24
|
-
}
|
|
29
|
+
}
|
|
25
30
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-chars.js","sourceRoot":"","sources":["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AAW,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC/B,cAAG,GAAW,GAAG,CAAA","sourcesContent":["export abstract class AsciiChars {\r\n\r\n public static readonly Minus: number = '-'.charCodeAt(0)\r\n public static readonly Equal: number = '='.charCodeAt(0)\r\n public static readonly ForwardSlash: number = '/'.charCodeAt(0)\r\n public static readonly Plus: number = '+'.charCodeAt(0)\r\n public static readonly Tab: number = '\\t'.charCodeAt(0)\r\n public static readonly Colon: number = ':'.charCodeAt(0)\r\n public static readonly Hyphen: number = '-'.charCodeAt(0)\r\n public static readonly Pipe: number = '|'.charCodeAt(0)\r\n public static readonly Carat: number = '^'.charCodeAt(0)\r\n public static readonly N: number = 'N'.charCodeAt(0)\r\n public static readonly Y: number = 'Y'.charCodeAt(0)\r\n public static readonly Zero: number = '0'.charCodeAt(0)\r\n public static readonly Nine: number = '9'.charCodeAt(0)\r\n public static readonly Dot: number = '.'.charCodeAt(0)\r\n public static readonly Eq: number = '='.charCodeAt(0)\r\n public static readonly Dq: number = '\"'.charCodeAt(0)\r\n public static readonly Space: number = ' '.charCodeAt(0)\r\n public static readonly Cr: number = '\\n'.charCodeAt(0)\r\n public static readonly Soh: number = 0x1\r\n\r\n public static firstChar (s: string): number {\r\n return s.charCodeAt(0)\r\n }\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-description.js","sourceRoot":"","sources":["../../src/buffer/segment-description.ts"],"names":[],"mappings":";;;AACA,8CAAuF;AAEvF,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,uDAAa,CAAA;IACb,+CAAS,CAAA;IACT,2CAAO,CAAA;IACP,2CAAO,CAAA;IACP,+CAAS,CAAA;IACT,mDAAW,CAAA;AACf,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB;AAED,MAAa,kBAAkB;IAS7B,YACoB,IAAY,EACZ,QAAgB,EAChB,GAAsB,EACtB,aAAqB,EACZ,KAAa,EACb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,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AA5ED,gDA4EC","sourcesContent":["import { INumericKeyed } from '../collections/collection'\r\nimport { ContainedField, ContainedFieldSet, GroupFieldDefinition } from '../dictionary'\r\n\r\nexport enum SegmentType {\r\n Component = 0,\r\n Group = 1,\r\n Msg = 2,\r\n Gap = 3,\r\n Batch = 4,\r\n Unknown = 5\r\n}\r\n\r\nexport class SegmentDescription {\r\n public index: number\r\n public endTag: number = 0\r\n public endPosition: number = 0\r\n public delimiterTag: number = 0\r\n public delimiterPositions: number[]\r\n public currentField: ContainedField\r\n public containedDelimiterPositions: INumericKeyed<boolean>\r\n\r\n constructor (\r\n public name: string,\r\n public startTag: number,\r\n public set: ContainedFieldSet,\r\n public startPosition: number,\r\n public readonly depth: number,\r\n public readonly type: SegmentType) {\r\n }\r\n\r\n public contains (segment: SegmentDescription): boolean {\r\n return segment.startPosition >= this.startPosition && segment.endPosition <= this.endPosition\r\n }\r\n\r\n public getInstance (instance: number): SegmentDescription {\r\n const delimiters: number[] = this.delimiterPositions\r\n if (!delimiters) {\r\n return null\r\n }\r\n if (instance < 0 || instance >= delimiters.length) {\r\n return null\r\n }\r\n const start: number = delimiters[instance]\r\n const end: number = instance < delimiters.length - 1 ?\r\n delimiters[instance + 1] - 1 :\r\n this.endPosition\r\n const name = this.type === SegmentType.Batch ? this.set.abbreviation : this.name\r\n const d: SegmentDescription = new SegmentDescription(name, this.startTag, this.set, start, this.depth, this.type)\r\n d.endPosition = end\r\n d.endTag = this.endTag\r\n return d\r\n }\r\n\r\n public startGroup (tag: number): void {\r\n this.delimiterTag = tag\r\n this.delimiterPositions = []\r\n this.containedDelimiterPositions = {}\r\n }\r\n\r\n public addDelimiterPosition (position: number): boolean {\r\n if (this.containedDelimiterPositions[position]) {\r\n return false\r\n }\r\n this.delimiterPositions[this.delimiterPositions.length] = position\r\n this.containedDelimiterPositions[position] = true\r\n return true\r\n }\r\n\r\n public setCurrentField (tag: number): void {\r\n this.currentField = this.set.localTag[tag] || this.set.tagToField[tag]\r\n }\r\n\r\n public groupAddDelimiter (tag: number, position: number): boolean {\r\n let delimiter: boolean = false\r\n if (this.set instanceof GroupFieldDefinition) {\r\n if (this.delimiterTag && tag === this.delimiterTag) {\r\n delimiter = this.addDelimiterPosition(position)\r\n }\r\n }\r\n return delimiter\r\n }\r\n\r\n public end (i: number, pos: number, endTag: number): void {\r\n this.index = i\r\n this.currentField = null\r\n this.endPosition = pos\r\n this.endTag = endTag\r\n }\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segment-summary.js","sourceRoot":"","sources":["../../src/buffer/segment-summary.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IACzB,YACkB,IAAY,EACZ,KAAa,EACb,QAAgB,EAChB,aAAqB,EACrB,MAAc,EACd,WAAmB,EACnB,YAAoB,EACpB,kBAA4B;QAP5B,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAQ;QACb,aAAQ,GAAR,QAAQ,CAAQ;QAChB,kBAAa,GAAb,aAAa,CAAQ;QACrB,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAQ;QACnB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,uBAAkB,GAAlB,kBAAkB,CAAU;IAC9C,CAAC;IACM,MAAM,CAAC,eAAe,CAAE,CAAqB;QAClD,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,aAAa,EAClE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAA;IAC9E,CAAC;CACF;AAfD,wCAeC","sourcesContent":["import { SegmentDescription } from './segment-description'\r\n\r\nexport class SegmentSummary {\r\n constructor (\r\n public readonly name: string,\r\n public readonly depth: number,\r\n public readonly startTag: number,\r\n public readonly startPosition: number,\r\n public readonly endTag: number,\r\n public readonly endPosition: number,\r\n public readonly delimiterTag: number,\r\n public readonly delimiterPositions: number[]) {\r\n }\r\n public static fromDescription (d: SegmentDescription): SegmentSummary {\r\n return new SegmentSummary(d.set.name, d.depth, d.startTag, d.startPosition,\r\n d.endTag, d.endPosition, d.delimiterTag, d.delimiterPositions || [])\r\n }\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tag-pos.js","sourceRoot":"","sources":["../../src/buffer/tag-pos.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACjB,YAAoB,QAAgB,EAAS,GAAW,EAAS,KAAa,EAAS,GAAW;QAA9E,aAAQ,GAAR,QAAQ,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;IAClG,CAAC;IAEM,MAAM,CAAC,OAAO,CAAE,GAAW,EAAE,GAAW;QAC7C,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE;YACrB,OAAO,CAAC,CAAC,CAAA;SACV;QACD,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE;YACrB,OAAO,CAAC,CAAA;SACT;QACD,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE;YAClD,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,K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C,GAAG,CAAC,CAAA;IAClE,CAAC;CACF;AAhDD,wBAgDC","sourcesContent":["export class TagPos {\r\n constructor (public position: number, public tag: number, public start: number, public len: number) {\r\n }\r\n\r\n public static compare (lhs: TagPos, rhs: TagPos): number {\r\n if (lhs.tag < rhs.tag) {\r\n return -1\r\n }\r\n if (lhs.tag > rhs.tag) {\r\n return 1\r\n }\r\n if (lhs.tag === rhs.tag && lhs.start === rhs.start) {\r\n return 0\r\n }\r\n return ((lhs.start < rhs.start) ? -1 : ((lhs.start > rhs.start) ? 1 : 0))\r\n }\r\n\r\n public static binarySearch (ar: TagPos[], tag: number): 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 cmp: number = tag - (ar[k].tag)\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 assign (position: number, tag: number, start: number, len: number): void {\r\n this.position = position\r\n this.tag = tag\r\n this.start = start\r\n this.len = len\r\n }\r\n\r\n public toString (): string {\r\n return `[${this.position}] = ${this.tag} (${this.start}..${this.start + this.len})`\r\n }\r\n\r\n public clone (): TagPos {\r\n return new TagPos(this.position, this.tag, this.start, this.len)\r\n }\r\n}\r\n"]}
|
package/dist/buffer/tags.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/buffer/tags.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAClC,oCAAiC;AAEjC,IAAY,OAYX;AAZD,WAAY,OAAO;IACf,yCAAU,CAAA;IACV,mCAAO,CAAA;IACP,uCAAS,CAAA;IACT,2CAAW,CAAA;IACX,qDAAgB,CAAA;IAChB,mDAAe,CAAA;IACf,mDAAe,CAAA;IACf,+CAAa,CAAA;IACb,2CAAW,CAAA;IACX,0CAAW,CAAA;IACX,4CAAY,CAAA;AAChB,CAAC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ictionary'\r\nimport { TagPos } from './tag-pos'\r\nimport { MsgTag } from '../types'\r\n\r\nexport enum TagType {\r\n String = 1,\r\n Int = 2,\r\n Float = 3,\r\n Boolean = 4,\r\n UtcTimestamp = 5,\r\n UtcDateOnly = 6,\r\n UtcTimeOnly = 7,\r\n LocalDate = 8,\r\n RawData = 9,\r\n Length = 10,\r\n Unknown = 11\r\n}\r\n\r\nexport class Tags {\r\n public static readonly BeginString: number = MsgTag.BeginString\r\n public static readonly BodyLengthTag: number = MsgTag.BodyLength\r\n public static readonly CheckSumTag: number = MsgTag.CheckSum\r\n public static readonly MsgTag: number = MsgTag.MsgType\r\n\r\n public tagPos: TagPos[] = new Array(this.startingLength)\r\n public nextTagPos: number = 0\r\n\r\n constructor (public readonly definitions: FixDefinitions, public readonly startingLength: number = 30 * 1000) {\r\n }\r\n\r\n public static toJSType (simple: ContainedSimpleField): string {\r\n switch (simple.definition.tagType) {\r\n case TagType.String:\r\n return 'string'\r\n\r\n case TagType.Int:\r\n case TagType.Float:\r\n case TagType.Length:\r\n return 'number'\r\n\r\n case TagType.RawData:\r\n return 'Buffer'\r\n\r\n case TagType.Boolean:\r\n return 'boolean'\r\n\r\n case TagType.UtcTimestamp:\r\n case TagType.UtcDateOnly:\r\n case TagType.UtcTimeOnly:\r\n case TagType.LocalDate:\r\n return 'Date'\r\n\r\n default:\r\n return 'string'\r\n }\r\n }\r\n\r\n public static toType (type: string): TagType {\r\n type = type || 'string'\r\n switch (type.toLowerCase()) {\r\n case 'currency':\r\n case 'string':\r\n case 'char': {\r\n return TagType.String\r\n }\r\n\r\n case 'int':\r\n case 'numingroup':\r\n case 'seqnum': {\r\n return TagType.Int\r\n }\r\n\r\n case 'qty':\r\n case 'percentage':\r\n case 'amt':\r\n case 'price':\r\n case 'priceoffset':\r\n case 'float': {\r\n return TagType.Float\r\n }\r\n\r\n case 'length': {\r\n return TagType.Length\r\n }\r\n\r\n case 'boolean': {\r\n return TagType.Boolean\r\n }\r\n\r\n case 'utctimestamp': {\r\n return TagType.UtcTimestamp\r\n }\r\n\r\n case 'localmktdate': {\r\n return TagType.LocalDate\r\n }\r\n\r\n case 'utcdateonly': {\r\n return TagType.UtcDateOnly\r\n }\r\n\r\n case 'utctimeonly': {\r\n return TagType.UtcTimeOnly\r\n }\r\n\r\n case 'data': {\r\n return TagType.RawData\r\n }\r\n\r\n default: {\r\n return TagType.String\r\n }\r\n }\r\n }\r\n\r\n public clone (): Tags {\r\n const next: number = this.nextTagPos\r\n const cloned: Tags = new Tags(this.definitions, next)\r\n cloned.nextTagPos = next\r\n for (let i = 0; i < next; ++i) {\r\n cloned.tagPos[i] = this.tagPos[i].clone()\r\n }\r\n return cloned\r\n }\r\n\r\n public reset (): void {\r\n this.nextTagPos = 0\r\n }\r\n\r\n public store (start: number, len: number, tag: number): void {\r\n const tagPtr: number = this.nextTagPos\r\n if (tagPtr === this.tagPos.length) {\r\n this.expand()\r\n }\r\n const tp: TagPos = this.tagPos[tagPtr]\r\n if (tp) {\r\n tp.assign(tagPtr, tag, start, len)\r\n } else {\r\n this.tagPos[tagPtr] = new TagPos(tagPtr, tag, start, len)\r\n }\r\n this.nextTagPos++\r\n }\r\n\r\n private expand (): void {\r\n const size = this.tagPos.length * 2\r\n const tagPos = new Array(size)\r\n for (let i = 0; i < this.tagPos.length; ++i) {\r\n tagPos[i] = this.tagPos[i]\r\n }\r\n this.tagPos = tagPos\r\n }\r\n}\r\n"]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dispatchFields = void 0;
|
|
4
|
-
const contained_1 = require("./contained");
|
|
5
|
-
function dispatchField(field, dispatcher) {
|
|
6
|
-
switch (field.type) {
|
|
7
|
-
case contained_1.ContainedFieldType.Group: {
|
|
8
|
-
if (dispatcher.group) {
|
|
9
|
-
dispatcher.group(field);
|
|
10
|
-
}
|
|
11
|
-
break;
|
|
12
|
-
}
|
|
13
|
-
case contained_1.ContainedFieldType.Simple: {
|
|
14
|
-
if (dispatcher.simple) {
|
|
15
|
-
try {
|
|
16
|
-
dispatcher.simple(field);
|
|
17
|
-
}
|
|
18
|
-
catch (ex) {
|
|
19
|
-
let x = 0;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
case contained_1.ContainedFieldType.Component: {
|
|
25
|
-
if (dispatcher.component) {
|
|
26
|
-
dispatcher.component(field);
|
|
27
|
-
}
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
default:
|
|
31
|
-
throw new Error(`unknown type ${field.type}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function dispatchFields(fields, dispatcher) {
|
|
35
|
-
fields.forEach((field) => {
|
|
36
|
-
dispatchField(field, dispatcher);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
exports.dispatchFields = dispatchFields;
|
|
40
|
-
//# sourceMappingURL=fields-dispatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields-dispatch.js","sourceRoot":"","sources":["../../src/dictionary/fields-dispatch.ts"],"names":[],"mappings":";;;AAAA,2CAAoI;AAQpI,SAAS,aAAa,CAAE,KAAqB,EAAE,UAA4B;IACzE,QAAQ,KAAK,CAAC,IAAI,EAAE;QAClB,KAAK,8BAAkB,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,UAAU,CAAC,KAAK,EAAE;gBACpB,UAAU,CAAC,KAAK,CAAC,KAA4B,CAAC,CAAA;aAC/C;YACD,MAAK;SACN;QAED,KAAK,8BAAkB,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAI,UAAU,CAAC,MAAM,EAAE;gBACrB,IAAI;oBACF,UAAU,CAAC,MAAM,CAAC,KAA6B,CAAC,CAAA;iBACjD;gBAAC,OAAO,EAAE,EAAE;oBACX,IAAI,CAAC,GAAG,CAAC,CAAA;iBACV;aACF;YACD,MAAK;SACN;QAED,KAAK,8BAAkB,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,UAAU,CAAC,SAAS,EAAE;gBACxB,UAAU,CAAC,SAAS,CAAC,KAAgC,CAAC,CAAA;aACvD;YACD,MAAK;SACN;QAED;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;KAChD;AACH,CAAC;AAED,SAAgB,cAAc,CAAE,MAAwB,EAAE,UAA4B;IACpF,MAAM,CAAC,OAAO,CAAC,CAAC,KAAqB,EAAE,EAAE;QACvC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC;AAJD,wCAIC","sourcesContent":["import { ContainedField, ContainedFieldType, ContainedGroupField, ContainedSimpleField, ContainedComponentField } from './contained'\r\n\r\nexport interface IFieldDispatcher {\r\n group?: { (field: ContainedGroupField): void }\r\n simple?: { (field: ContainedSimpleField): void }\r\n component?: { (field: ContainedComponentField): void }\r\n}\r\n\r\nfunction dispatchField (field: ContainedField, dispatcher: IFieldDispatcher): void {\r\n switch (field.type) {\r\n case ContainedFieldType.Group: {\r\n if (dispatcher.group) {\r\n dispatcher.group(field as ContainedGroupField)\r\n }\r\n break\r\n }\r\n\r\n case ContainedFieldType.Simple: {\r\n if (dispatcher.simple) {\r\n try {\r\n dispatcher.simple(field as ContainedSimpleField)\r\n } catch (ex) {\r\n let x = 0\r\n }\r\n }\r\n break\r\n }\r\n\r\n case ContainedFieldType.Component: {\r\n if (dispatcher.component) {\r\n dispatcher.component(field as ContainedComponentField)\r\n }\r\n break\r\n }\r\n\r\n default:\r\n throw new Error(`unknown type ${field.type}`)\r\n }\r\n}\r\n\r\nexport function dispatchFields (fields: ContainedField[], dispatcher: IFieldDispatcher): void {\r\n fields.forEach((field: ContainedField) => {\r\n dispatchField(field, dispatcher)\r\n })\r\n}\r\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IJsFixConfig, IJsFixLogger } from '../config';
|
|
2
|
-
export declare abstract class Launcher {
|
|
3
|
-
readonly initiatorConfig: string;
|
|
4
|
-
readonly acceptorConfig: string;
|
|
5
|
-
protected readonly logger: IJsFixLogger;
|
|
6
|
-
protected constructor(initiatorConfig: string, acceptorConfig: string);
|
|
7
|
-
protected abstract getInitiator(config: IJsFixConfig): Promise<any>;
|
|
8
|
-
protected abstract getAcceptor(config: IJsFixConfig): Promise<any>;
|
|
9
|
-
run(): Promise<any>;
|
|
10
|
-
private makeSessionFactory;
|
|
11
|
-
private setup;
|
|
12
|
-
}
|
package/dist/sample/launcher.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Launcher = void 0;
|
|
13
|
-
const path = require("path");
|
|
14
|
-
const config_1 = require("../config");
|
|
15
|
-
const transport_1 = require("../transport");
|
|
16
|
-
const ascii_1 = require("../transport/ascii");
|
|
17
|
-
const fixml_1 = require("../transport/fixml");
|
|
18
|
-
const root = '../../';
|
|
19
|
-
const logFactory = new config_1.JsFixWinstonLogFactory(config_1.WinstonLogger.consoleOptions('info'));
|
|
20
|
-
class Launcher {
|
|
21
|
-
constructor(initiatorConfig, acceptorConfig) {
|
|
22
|
-
this.initiatorConfig = initiatorConfig;
|
|
23
|
-
this.acceptorConfig = acceptorConfig;
|
|
24
|
-
this.logger = logFactory.logger('launcher');
|
|
25
|
-
}
|
|
26
|
-
run() {
|
|
27
|
-
return new Promise((accept, reject) => {
|
|
28
|
-
const logger = this.logger;
|
|
29
|
-
logger.info('launching ..');
|
|
30
|
-
this.setup().then(() => {
|
|
31
|
-
logger.info('.. done');
|
|
32
|
-
accept(true);
|
|
33
|
-
}).catch((e) => {
|
|
34
|
-
logger.error(e);
|
|
35
|
-
reject(e);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
makeSessionFactory(description) {
|
|
40
|
-
const fixml = description.application.protocol !== 'ascii';
|
|
41
|
-
const factory = fixml ?
|
|
42
|
-
new fixml_1.FixmlSessionMsgFactory(description) :
|
|
43
|
-
new ascii_1.AsciiSessionMsgFactory(description);
|
|
44
|
-
return factory;
|
|
45
|
-
}
|
|
46
|
-
setup() {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const clientDescription = require(path.join(root, this.initiatorConfig));
|
|
49
|
-
const serverDescription = require(path.join(root, this.acceptorConfig));
|
|
50
|
-
this.logger.info(`launching [protocol ${clientDescription.application.protocol}] ...`);
|
|
51
|
-
const clientConfig = yield transport_1.makeConfig(clientDescription, logFactory, this.makeSessionFactory(clientDescription));
|
|
52
|
-
const serverConfig = yield transport_1.makeConfig(serverDescription, logFactory, this.makeSessionFactory(serverDescription));
|
|
53
|
-
this.logger.info('create acceptor');
|
|
54
|
-
const server = this.getAcceptor(serverConfig);
|
|
55
|
-
this.logger.info('create initiator');
|
|
56
|
-
const client = this.getInitiator(clientConfig);
|
|
57
|
-
this.logger.info('launching ....');
|
|
58
|
-
return Promise.all([server, client]);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.Launcher = Launcher;
|
|
63
|
-
//# sourceMappingURL=launcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file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CAAC,WAAW,CAAC,CAAA;QACzC,OAAO,OAAO,CAAA;IAChB,CAAC;IAEa,KAAK;;YACjB,MAAM,iBAAiB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;YAC7F,MAAM,iBAAiB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAA;YAC5F,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,iBAAiB,CAAC,WAAW,CAAC,QAAQ,OAAO,CAAC,CAAA;YACtF,MAAM,YAAY,GAAG,MACrB,sBAAU,CAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAA;YACrF,MAAM,YAAY,GAAG,MACrB,sBAAU,CAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAA;YACrF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;YAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;YACpC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAA;YAC9C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAClC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;QACtC,CAAC;KAAA;CACF;AA9CD,4BA8CC","sourcesContent":["import * as path from 'path'\r\nimport { WinstonLogger, IJsFixConfig, JsFixWinstonLogFactory, IJsFixLogger } from '../config'\r\nimport { makeConfig, ISessionDescription, ISessionMsgFactory } from '../transport'\r\nimport { AsciiSessionMsgFactory } from '../transport/ascii'\r\nimport { FixmlSessionMsgFactory } from '../transport/fixml'\r\n\r\nconst root = '../../'\r\nconst logFactory = new JsFixWinstonLogFactory(WinstonLogger.consoleOptions('info'))\r\n\r\nexport abstract class Launcher {\r\n protected readonly logger: IJsFixLogger\r\n protected constructor (public readonly initiatorConfig: string, public readonly acceptorConfig: string) {\r\n this.logger = logFactory.logger('launcher')\r\n }\r\n\r\n protected abstract getInitiator (config: IJsFixConfig): Promise<any>\r\n protected abstract getAcceptor (config: IJsFixConfig): Promise<any>\r\n\r\n public run () {\r\n return new Promise<any>((accept, reject) => {\r\n const logger = this.logger\r\n logger.info('launching ..')\r\n this.setup().then(() => {\r\n logger.info('.. done')\r\n accept(true)\r\n }).catch((e: Error) => {\r\n logger.error(e)\r\n reject(e)\r\n })\r\n })\r\n }\r\n\r\n private makeSessionFactory (description: ISessionDescription): ISessionMsgFactory {\r\n const fixml = description.application.protocol !== 'ascii'\r\n const factory = fixml ?\r\n new FixmlSessionMsgFactory(description) :\r\n new AsciiSessionMsgFactory(description)\r\n return factory\r\n }\r\n\r\n private async setup () {\r\n const clientDescription: ISessionDescription = require(path.join(root, this.initiatorConfig))\r\n const serverDescription: ISessionDescription = require(path.join(root, this.acceptorConfig))\r\n this.logger.info(`launching [protocol ${clientDescription.application.protocol}] ...`)\r\n const clientConfig = await\r\n makeConfig(clientDescription, logFactory, this.makeSessionFactory(clientDescription))\r\n const serverConfig = await\r\n makeConfig(serverDescription, logFactory, this.makeSessionFactory(serverDescription))\r\n this.logger.info('create acceptor')\r\n const server = this.getAcceptor(serverConfig)\r\n this.logger.info('create initiator')\r\n const client = this.getInitiator(clientConfig)\r\n this.logger.info('launching ....')\r\n return Promise.all([server, client])\r\n }\r\n}\r\n"]}
|