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,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FixmlSessionMsgFactory = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
const FIXML50SP2_1 = require("../types/FIXML50SP2");
|
|
7
|
-
class FixmlSessionMsgFactory extends _1.ASessionMsgFactory {
|
|
8
|
-
constructor(description, mutator = null) {
|
|
9
|
-
super(description, mutator);
|
|
10
|
-
this.description = description;
|
|
11
|
-
}
|
|
12
|
-
logon(userRequestId = '', isResponse = false) {
|
|
13
|
-
return this.fixmlLogon(userRequestId, isResponse);
|
|
14
|
-
}
|
|
15
|
-
logout(msgType, text) {
|
|
16
|
-
return this.fixmlLogout(msgType, msgType !== 'UserReq');
|
|
17
|
-
}
|
|
18
|
-
header(msgType, seqNum = 0, time = new Date(), overrideData) {
|
|
19
|
-
const description = this.description;
|
|
20
|
-
const o = {
|
|
21
|
-
SenderCompID: description.SenderCompId,
|
|
22
|
-
TargetCompID: description.TargetCompID,
|
|
23
|
-
SenderSubID: description.SenderSubID,
|
|
24
|
-
TargetSubID: description.TargetSubID
|
|
25
|
-
};
|
|
26
|
-
return this.mutate(o, 'StandardHeader');
|
|
27
|
-
}
|
|
28
|
-
fixmlLogon(userRequestId, isResponse) {
|
|
29
|
-
const description = this.description;
|
|
30
|
-
if (!isResponse) {
|
|
31
|
-
const o = {
|
|
32
|
-
Username: description.Username,
|
|
33
|
-
Password: description.Password,
|
|
34
|
-
UserRequestID: userRequestId,
|
|
35
|
-
UserRequestType: FIXML50SP2_1.UserRequestType.LogOnUser
|
|
36
|
-
};
|
|
37
|
-
return this.mutate(o, types_1.MsgType.Logon);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
const o = {
|
|
41
|
-
Username: description.Username,
|
|
42
|
-
UserRequestID: userRequestId,
|
|
43
|
-
UserStatus: FIXML50SP2_1.UserStatus.LoggedIn
|
|
44
|
-
};
|
|
45
|
-
return this.mutate(o, types_1.MsgType.Logon);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
fixmlLogout(userRequestId, isResponse) {
|
|
49
|
-
if (!isResponse) {
|
|
50
|
-
const o = {
|
|
51
|
-
Username: this.description.Username,
|
|
52
|
-
UserRequestID: userRequestId,
|
|
53
|
-
UserRequestType: FIXML50SP2_1.UserRequestType.LogOffUser
|
|
54
|
-
};
|
|
55
|
-
return this.mutate(o, types_1.MsgType.Logout);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
const o = {
|
|
59
|
-
Username: this.description.Username,
|
|
60
|
-
UserRequestID: userRequestId,
|
|
61
|
-
UserStatus: FIXML50SP2_1.UserStatus.NotLoggedIn
|
|
62
|
-
};
|
|
63
|
-
return this.mutate(o, types_1.MsgType.Logout);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.FixmlSessionMsgFactory = FixmlSessionMsgFactory;
|
|
68
|
-
//# sourceMappingURL=fixml-session-msg-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixml-session-msg-factory.js","sourceRoot":"","sources":["../../src/transport/fixml-session-msg-factory.ts"],"names":[],"mappings":";;;AAEA,oCAAkC;AAClC,wBAAqD;AAErD,oDAM4B;AAE5B,MAAa,sBAAuB,SAAQ,qBAAkB;IAE5D,YAAsB,WAAgC,EAAE,UAAyB,IAAI;QACnF,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;QADP,gBAAW,GAAX,WAAW,CAAqB;IAEtD,CAAC;IAEM,KAAK,CAAE,gBAAwB,EAAE,EAAE,aAAsB,KAAK;QACnE,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;IACnD,CAAC;IAEM,MAAM,CAAE,OAAe,EAAE,IAAY;QAC1C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,CAAC,CAAA;IACzD,CAAC;IAEM,MAAM,CAAE,OAAe,EAAE,SAAiB,CAAC,EAAE,OAAa,IAAI,IAAI,EAAE,EAAE,YAAuC;QAClH,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;QACpC,MAAM,CAAC,GAAoB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CAAC,WAAW,CAAC,QAAQ;gBACnC,aAAa,EAAE,aAAa;gBAC5B,UAAU,EAAE,uBAAU,CAAC,WAAW;aAClB,CAAA;YAClB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,eAAO,CAAC,MAAM,CAAC,CAAA;SACtC;IACH,CAAC;CACF;AA9DD,wDA8DC","sourcesContent":["import { ISessionDescription } from './session-description'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { MsgType } from '../types'\r\nimport { ASessionMsgFactory, ObjectMutator } from '.'\r\n\r\nimport {\r\n IStandardHeader,\r\n IUserRequest,\r\n IUserResponse,\r\n UserRequestType,\r\n UserStatus\r\n} from '../types/FIXML50SP2'\r\n\r\nexport class FixmlSessionMsgFactory extends ASessionMsgFactory {\r\n\r\n constructor (readonly description: ISessionDescription, mutator: ObjectMutator = null) {\r\n super(description, mutator)\r\n }\r\n\r\n public logon (userRequestId: string = '', isResponse: boolean = false): ILooseObject {\r\n return this.fixmlLogon(userRequestId, isResponse)\r\n }\r\n\r\n public logout (msgType: string, text: string): ILooseObject {\r\n return this.fixmlLogout(msgType, msgType !== 'UserReq')\r\n }\r\n\r\n public header (msgType: string, seqNum: number = 0, time: Date = new Date(), overrideData?: Partial<IStandardHeader>): ILooseObject {\r\n const description = this.description\r\n const o: IStandardHeader = {\r\n SenderCompID: description.SenderCompId,\r\n TargetCompID: description.TargetCompID,\r\n SenderSubID: description.SenderSubID,\r\n TargetSubID: description.TargetSubID\r\n } as IStandardHeader\r\n return this.mutate(o, 'StandardHeader')\r\n }\r\n\r\n private fixmlLogon (userRequestId: string, isResponse: boolean): ILooseObject {\r\n const description = this.description\r\n if (!isResponse) {\r\n const o: IUserRequest = {\r\n Username: description.Username,\r\n Password: description.Password,\r\n UserRequestID: userRequestId,\r\n UserRequestType: UserRequestType.LogOnUser\r\n } as IUserRequest\r\n return this.mutate(o, MsgType.Logon)\r\n } else {\r\n const o: IUserResponse = {\r\n Username: description.Username,\r\n UserRequestID: userRequestId,\r\n UserStatus: UserStatus.LoggedIn\r\n } as IUserResponse\r\n return this.mutate(o, MsgType.Logon)\r\n }\r\n }\r\n\r\n private fixmlLogout (userRequestId: string, isResponse: boolean): ILooseObject {\r\n if (!isResponse) {\r\n const o: IUserRequest = {\r\n Username: this.description.Username,\r\n UserRequestID: userRequestId,\r\n UserRequestType: UserRequestType.LogOffUser\r\n } as IUserRequest\r\n return this.mutate(o, MsgType.Logout)\r\n } else {\r\n const o: IUserResponse = {\r\n Username: this.description.Username,\r\n UserRequestID: userRequestId,\r\n UserStatus: UserStatus.NotLoggedIn\r\n } as IUserResponse\r\n return this.mutate(o, MsgType.Logout)\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ISessionDescription } from './session-description';
|
|
2
|
-
import { ISessionMsgFactory } from './fix-msg-factory';
|
|
3
|
-
import { IJsFixConfig, JsFixLoggerFactory } from '../config';
|
|
4
|
-
export declare function makeConfig(description: ISessionDescription, logFactory: JsFixLoggerFactory, msgFactory: ISessionMsgFactory): Promise<IJsFixConfig>;
|
|
@@ -1,31 +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.makeConfig = void 0;
|
|
13
|
-
const buffer_1 = require("../buffer");
|
|
14
|
-
const config_1 = require("../config");
|
|
15
|
-
const util_1 = require("../util");
|
|
16
|
-
function makeConfig(description, logFactory, msgFactory) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
return new Promise((accept, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
try {
|
|
20
|
-
const definitions = yield util_1.getDefinitions(description.application.dictionary, (t) => logFactory.logger(`${description.application.type}.${t}`));
|
|
21
|
-
const config = new config_1.JsFixConfig(msgFactory, definitions, description, buffer_1.AsciiChars.Soh, logFactory);
|
|
22
|
-
accept(config);
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
reject(e);
|
|
26
|
-
}
|
|
27
|
-
}));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.makeConfig = makeConfig;
|
|
31
|
-
//# sourceMappingURL=make-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"make-config.js","sourceRoot":"","sources":["../../src/transport/make-config.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAsC;AAGtC,sCAAyE;AAEzE,kCAAwC;AAExC,SAAsB,UAAU,CAAE,WAAgC,EAAE,UAA8B,EAAE,UAA8B;;QAChI,OAAO,IAAI,OAAO,CAAe,CAAO,MAAM,EAAE,MAAM,EAAE,EAAE;YACxD,IAAI;gBACF,MAAM,WAAW,GAAmB,MAAM,qBAAc,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,EACzF,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC3E,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;gBAChG,MAAM,CAAC,MAAM,CAAC,CAAA;aACf;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAA;aACV;QACH,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CAAA;AAXD,gCAWC","sourcesContent":["import { AsciiChars } from '../buffer'\r\nimport { ISessionDescription } from './session-description'\r\nimport { ISessionMsgFactory } from './fix-msg-factory'\r\nimport { IJsFixConfig, JsFixConfig, JsFixLoggerFactory } from '../config'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { getDefinitions } from '../util'\r\n\r\nexport async function makeConfig (description: ISessionDescription, logFactory: JsFixLoggerFactory, msgFactory: ISessionMsgFactory): Promise<IJsFixConfig> {\r\n return new Promise<IJsFixConfig>(async (accept, reject) => {\r\n try {\r\n const definitions: FixDefinitions = await getDefinitions(description.application.dictionary,\r\n (t: string) => logFactory.logger(`${description.application.type}.${t}`))\r\n const config = new JsFixConfig(msgFactory, definitions, description, AsciiChars.Soh, logFactory)\r\n accept(config)\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"make-fixl-session.js","sourceRoot":"","sources":["../../src/transport/make-fixl-session.ts"],"names":[],"mappings":"","sourcesContent":["import { IJsFixConfig } from '../config'\r\nimport { FixSession } from './fix-session'\r\n\r\nexport interface MakeFixSession { (config: IJsFixConfig): FixSession\r\n}\r\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MsgTransport = void 0;
|
|
4
|
-
const buffer_1 = require("../buffer");
|
|
5
|
-
const ascii_1 = require("./ascii");
|
|
6
|
-
const fixml_1 = require("./fixml");
|
|
7
|
-
class MsgTransport {
|
|
8
|
-
constructor(id, config, duplex) {
|
|
9
|
-
this.id = id;
|
|
10
|
-
this.config = config;
|
|
11
|
-
this.duplex = duplex;
|
|
12
|
-
const delimiter = config.delimiter;
|
|
13
|
-
if (!delimiter) {
|
|
14
|
-
throw new Error(`no delimiter char given.`);
|
|
15
|
-
}
|
|
16
|
-
const logDelimiter = config.logDelimiter || buffer_1.AsciiChars.Pipe;
|
|
17
|
-
const description = config.description;
|
|
18
|
-
const definitions = config.definitions;
|
|
19
|
-
const protocol = description.application.protocol;
|
|
20
|
-
switch (protocol) {
|
|
21
|
-
case 'ascii': {
|
|
22
|
-
this.transmitter = new ascii_1.AsciiMsgTransmitter(config);
|
|
23
|
-
this.receiver = new buffer_1.AsciiParser(definitions, duplex.readable, delimiter, logDelimiter);
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
case 'fixml': {
|
|
27
|
-
this.transmitter = new fixml_1.FixmlMsgTransmitter(config);
|
|
28
|
-
this.receiver = new buffer_1.FiXmlParser(config, duplex.readable);
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
default: {
|
|
32
|
-
throw new Error(`session Protocol must ascii or fixml. got ${protocol}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (duplex.writable) {
|
|
36
|
-
this.transmitter.encodeStream.pipe(duplex.writable);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
end() {
|
|
40
|
-
this.duplex.end();
|
|
41
|
-
}
|
|
42
|
-
wait() {
|
|
43
|
-
return new Promise((resolve, reject) => {
|
|
44
|
-
this.receiver.on('end', () => {
|
|
45
|
-
resolve(this.id);
|
|
46
|
-
});
|
|
47
|
-
this.receiver.on('error', (e) => {
|
|
48
|
-
reject(e);
|
|
49
|
-
});
|
|
50
|
-
this.transmitter.on('error', (e) => {
|
|
51
|
-
reject(e);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.MsgTransport = MsgTransport;
|
|
57
|
-
//# sourceMappingURL=msg-transport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"msg-transport.js","sourceRoot":"","sources":["../../src/transport/msg-transport.ts"],"names":[],"m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AAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;SACpD;IACH,CAAC;IAEM,GAAG;QACR,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAA;IACnB,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBAC3B,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YAClB,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC9B,MAAM,CAAC,CAAC,CAAC,CAAA;YACX,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACjC,MAAM,CAAC,CAAC,CAAC,CAAA;YACX,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA3DD,oCA2DC","sourcesContent":["import { AsciiParser, FiXmlParser, MsgParser, AsciiChars } from '../buffer'\r\nimport { AsciiMsgTransmitter } from './ascii'\r\nimport { MsgTransmitter } from './msg-transmitter'\r\nimport { FixmlMsgTransmitter } from './fixml'\r\nimport { FixDuplex } from './duplex'\r\nimport { IJsFixConfig } from '../config'\r\n\r\nexport class MsgTransport {\r\n public readonly transmitter: MsgTransmitter\r\n public readonly receiver: MsgParser\r\n\r\n constructor (public readonly id: number,\r\n public readonly config: IJsFixConfig,\r\n public readonly duplex: FixDuplex) {\r\n\r\n const delimiter = config.delimiter\r\n if (!delimiter) {\r\n throw new Error(`no delimiter char given.`)\r\n }\r\n const logDelimiter = config.logDelimiter || AsciiChars.Pipe\r\n const description = config.description\r\n const definitions = config.definitions\r\n const protocol = description.application.protocol\r\n switch (protocol) {\r\n case 'ascii': {\r\n // let parser replace delimiter with Pipe so fix log does not require\r\n // expensive replace\r\n this.transmitter = new AsciiMsgTransmitter(config)\r\n this.receiver = new AsciiParser(definitions, duplex.readable, delimiter, logDelimiter)\r\n break\r\n }\r\n\r\n case 'fixml': {\r\n this.transmitter = new FixmlMsgTransmitter(config)\r\n this.receiver = new FiXmlParser(config, duplex.readable)\r\n break\r\n }\r\n\r\n default: {\r\n throw new Error(`session Protocol must ascii or fixml. got ${protocol}`)\r\n }\r\n }\r\n\r\n // pipe the encoder to say a socket.\r\n if (duplex.writable) {\r\n this.transmitter.encodeStream.pipe(duplex.writable)\r\n }\r\n }\r\n\r\n public end (): void {\r\n this.duplex.end()\r\n }\r\n\r\n public wait (): Promise<any> {\r\n return new Promise<any>((resolve, reject) => {\r\n this.receiver.on('end', () => {\r\n resolve(this.id)\r\n })\r\n this.receiver.on('error', (e) => {\r\n reject(e)\r\n })\r\n this.transmitter.on('error', (e) => {\r\n reject(e)\r\n })\r\n })\r\n }\r\n}\r\n"]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export interface ITlsOptions {
|
|
3
|
-
readonly key: string;
|
|
4
|
-
readonly cert: string;
|
|
5
|
-
readonly ca?: string[];
|
|
6
|
-
readonly timeout?: number;
|
|
7
|
-
readonly sessionTimeout?: number;
|
|
8
|
-
readonly enableTrace?: boolean;
|
|
9
|
-
readonly requestCert?: boolean;
|
|
10
|
-
readonly rejectUnauthorized?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ITcpTransportDescription {
|
|
13
|
-
readonly port: number;
|
|
14
|
-
readonly host: string;
|
|
15
|
-
readonly tls?: ITlsOptions;
|
|
16
|
-
}
|
|
17
|
-
export interface IHttpAdapter {
|
|
18
|
-
getOptions(data: Buffer): IHtmlOptions;
|
|
19
|
-
beginMessage(msgType: string): void;
|
|
20
|
-
endMessage(m: any): Buffer;
|
|
21
|
-
}
|
|
22
|
-
export interface IHtmlOptions {
|
|
23
|
-
method: string;
|
|
24
|
-
uri: string;
|
|
25
|
-
json: boolean;
|
|
26
|
-
body: any;
|
|
27
|
-
headers: any;
|
|
28
|
-
resolveWithFullResponse: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface IHtmlRoute {
|
|
31
|
-
name: string;
|
|
32
|
-
value: IHtmlOptions;
|
|
33
|
-
}
|
|
34
|
-
export interface IHttpTransportDescription {
|
|
35
|
-
readonly port: number;
|
|
36
|
-
readonly uri: string;
|
|
37
|
-
readonly options: IHtmlRoute[];
|
|
38
|
-
adapter: IHttpAdapter;
|
|
39
|
-
}
|
|
40
|
-
export interface IMsgApplication {
|
|
41
|
-
readonly name: string;
|
|
42
|
-
readonly type: string;
|
|
43
|
-
readonly reconnectSeconds: number;
|
|
44
|
-
readonly tcp?: ITcpTransportDescription;
|
|
45
|
-
readonly http?: IHttpTransportDescription;
|
|
46
|
-
readonly protocol: string;
|
|
47
|
-
readonly dictionary: string;
|
|
48
|
-
}
|
|
49
|
-
export interface ISessionDescription {
|
|
50
|
-
readonly application?: IMsgApplication;
|
|
51
|
-
readonly Name: string;
|
|
52
|
-
readonly Username: string;
|
|
53
|
-
readonly Password: string;
|
|
54
|
-
HeartBtInt: number;
|
|
55
|
-
readonly SenderCompId: string;
|
|
56
|
-
readonly TargetCompID: string;
|
|
57
|
-
readonly ResetSeqNumFlag: boolean;
|
|
58
|
-
readonly LastSentSeqNum?: number;
|
|
59
|
-
readonly LastReceivedSeqNum?: number;
|
|
60
|
-
readonly SenderSubID: string;
|
|
61
|
-
readonly TargetSubID: string;
|
|
62
|
-
readonly BeginString: string;
|
|
63
|
-
readonly BodyLengthChars?: number;
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-description.js","sourceRoot":"","sources":["../../src/transport/session-description.ts"],"names":[],"mappings":"","sourcesContent":["export interface ITlsOptions {\r\n readonly key: string,\r\n readonly cert: string,\r\n readonly ca?: string[],\r\n readonly timeout?: number,\r\n readonly sessionTimeout?: number,\r\n readonly enableTrace?: boolean,\r\n readonly requestCert?: boolean,\r\n readonly rejectUnauthorized?: boolean\r\n}\r\n\r\nexport interface ITcpTransportDescription {\r\n readonly port: number\r\n readonly host: string,\r\n readonly tls?: ITlsOptions\r\n}\r\n\r\nexport interface IHttpAdapter {\r\n getOptions (data: Buffer): IHtmlOptions\r\n beginMessage (msgType: string): void\r\n endMessage (m: any): Buffer\r\n}\r\n\r\nexport interface IHtmlOptions {\r\n method: string,\r\n uri: string,\r\n json: boolean,\r\n body: any,\r\n headers: any,\r\n resolveWithFullResponse: boolean\r\n}\r\n\r\nexport interface IHtmlRoute {\r\n name: string,\r\n value: IHtmlOptions\r\n}\r\n\r\nexport interface IHttpTransportDescription {\r\n readonly port: number\r\n readonly uri: string,\r\n readonly options: IHtmlRoute[]\r\n adapter: IHttpAdapter\r\n}\r\n\r\nexport interface IMsgApplication {\r\n readonly name: string\r\n readonly type: string,\r\n readonly reconnectSeconds: number\r\n readonly tcp?: ITcpTransportDescription,\r\n readonly http?: IHttpTransportDescription,\r\n readonly protocol: string,\r\n readonly dictionary: string\r\n}\r\n\r\nexport interface ISessionDescription {\r\n readonly application?: IMsgApplication\r\n readonly Name: string\r\n readonly Username: string\r\n readonly Password: string\r\n HeartBtInt: number\r\n readonly SenderCompId: string\r\n readonly TargetCompID: string\r\n readonly ResetSeqNumFlag: boolean\r\n readonly LastSentSeqNum?: number\r\n readonly LastReceivedSeqNum?: number\r\n readonly SenderSubID: string\r\n readonly TargetSubID: string\r\n readonly BeginString: string\r\n readonly BodyLengthChars?: number,\r\n}\r\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ISessionMsgFactory } from './fix-msg-factory';
|
|
2
|
-
import { ISessionDescription } from './session-description';
|
|
3
|
-
import { ILooseObject } from '../collections/collection';
|
|
4
|
-
import { IStandardHeader } from '../types/FIX4.4/repo';
|
|
5
|
-
export interface ObjectMutator {
|
|
6
|
-
(description: ISessionDescription, type: string, o: ILooseObject): ILooseObject;
|
|
7
|
-
}
|
|
8
|
-
export declare class SessionMsgFactory implements ISessionMsgFactory {
|
|
9
|
-
readonly description: ISessionDescription;
|
|
10
|
-
mutator: ObjectMutator;
|
|
11
|
-
isAscii: boolean;
|
|
12
|
-
constructor(description: ISessionDescription, mutator?: ObjectMutator);
|
|
13
|
-
reject(msgType: string, seqNo: number, msg: string, reason: number): ILooseObject;
|
|
14
|
-
logon(userRequestId?: string, isResponse?: boolean): ILooseObject;
|
|
15
|
-
logout(msgType: string, text: string): ILooseObject;
|
|
16
|
-
testRequest(reqId?: string): ILooseObject;
|
|
17
|
-
heartbeat(testReqId: string): ILooseObject;
|
|
18
|
-
resendRequest(from: number, to: number): ILooseObject;
|
|
19
|
-
sequenceReset(newSeqNo: number, gapFill?: boolean): ILooseObject;
|
|
20
|
-
header(msgType: string, seqNum?: number, time?: Date, overrideData?: Partial<IStandardHeader>): ILooseObject;
|
|
21
|
-
trailer(checksum: number): ILooseObject;
|
|
22
|
-
private asciiLogon;
|
|
23
|
-
private asciiLogout;
|
|
24
|
-
private fixmlLogon;
|
|
25
|
-
private fixmlLogout;
|
|
26
|
-
protected asciiHeader(msgType: string, seqNum: number, time: Date, overrideData?: Partial<IStandardHeader>): ILooseObject;
|
|
27
|
-
private fixmlHeader;
|
|
28
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionMsgFactory = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const repo_1 = require("../types/FIX4.4/repo");
|
|
6
|
-
const FIXML50SP2_1 = require("../types/FIXML50SP2");
|
|
7
|
-
class SessionMsgFactory {
|
|
8
|
-
constructor(description, mutator = null) {
|
|
9
|
-
this.description = description;
|
|
10
|
-
this.mutator = mutator;
|
|
11
|
-
this.isAscii = description.application.protocol === 'ascii';
|
|
12
|
-
}
|
|
13
|
-
reject(msgType, seqNo, msg, reason) {
|
|
14
|
-
const o = {
|
|
15
|
-
RefMsgType: msgType,
|
|
16
|
-
SessionRejectReason: reason,
|
|
17
|
-
RefSeqNum: seqNo,
|
|
18
|
-
Text: msg
|
|
19
|
-
};
|
|
20
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Reject, o) : o;
|
|
21
|
-
}
|
|
22
|
-
logon(userRequestId = '', isResponse = false) {
|
|
23
|
-
if (this.isAscii) {
|
|
24
|
-
return this.asciiLogon();
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return this.fixmlLogon(userRequestId, isResponse);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
logout(msgType, text) {
|
|
31
|
-
if (this.isAscii) {
|
|
32
|
-
return this.asciiLogout(text);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return this.fixmlLogout(text, msgType !== 'UserReq');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
testRequest(reqId = `ping-${new Date().toUTCString()}`) {
|
|
39
|
-
const o = {
|
|
40
|
-
TestReqID: reqId
|
|
41
|
-
};
|
|
42
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.TestRequest, o) : o;
|
|
43
|
-
}
|
|
44
|
-
heartbeat(testReqId) {
|
|
45
|
-
const o = {
|
|
46
|
-
TestReqID: testReqId
|
|
47
|
-
};
|
|
48
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Heartbeat, o) : o;
|
|
49
|
-
}
|
|
50
|
-
resendRequest(from, to) {
|
|
51
|
-
const o = {
|
|
52
|
-
BeginSeqNo: from,
|
|
53
|
-
EndSeqNo: to
|
|
54
|
-
};
|
|
55
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.ResendRequest, o) : o;
|
|
56
|
-
}
|
|
57
|
-
sequenceReset(newSeqNo, gapFill) {
|
|
58
|
-
const o = {
|
|
59
|
-
GapFillFlag: gapFill === true,
|
|
60
|
-
NewSeqNo: newSeqNo
|
|
61
|
-
};
|
|
62
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.SequenceReset, o) : o;
|
|
63
|
-
}
|
|
64
|
-
header(msgType, seqNum = 0, time = new Date(), overrideData) {
|
|
65
|
-
if (this.isAscii) {
|
|
66
|
-
return this.asciiHeader(msgType, seqNum, time, overrideData);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return this.fixmlHeader();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
trailer(checksum) {
|
|
73
|
-
const s = checksum.toString();
|
|
74
|
-
const padded = s.padStart(3, '0');
|
|
75
|
-
return {
|
|
76
|
-
CheckSum: padded
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
asciiLogon() {
|
|
80
|
-
const description = this.description;
|
|
81
|
-
const o = {
|
|
82
|
-
Username: description.Username,
|
|
83
|
-
Password: description.Password,
|
|
84
|
-
HeartBtInt: description.HeartBtInt,
|
|
85
|
-
ResetSeqNumFlag: description.ResetSeqNumFlag,
|
|
86
|
-
EncryptMethod: repo_1.EncryptMethod.None
|
|
87
|
-
};
|
|
88
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logon, o) : o;
|
|
89
|
-
}
|
|
90
|
-
asciiLogout(text) {
|
|
91
|
-
const o = {
|
|
92
|
-
Text: text
|
|
93
|
-
};
|
|
94
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logout, o) : o;
|
|
95
|
-
}
|
|
96
|
-
fixmlLogon(userRequestId, isResponse) {
|
|
97
|
-
const description = this.description;
|
|
98
|
-
if (!isResponse) {
|
|
99
|
-
const o = {
|
|
100
|
-
Username: description.Username,
|
|
101
|
-
Password: description.Password,
|
|
102
|
-
UserRequestID: userRequestId,
|
|
103
|
-
UserRequestType: FIXML50SP2_1.UserRequestType.LogOnUser
|
|
104
|
-
};
|
|
105
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logon, o) : o;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
const o = {
|
|
109
|
-
Username: description.Username,
|
|
110
|
-
UserRequestID: userRequestId,
|
|
111
|
-
UserStatus: FIXML50SP2_1.UserStatus.LoggedIn
|
|
112
|
-
};
|
|
113
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logon, o) : o;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
fixmlLogout(userRequestId, isResponse) {
|
|
117
|
-
if (!isResponse) {
|
|
118
|
-
const o = {
|
|
119
|
-
Username: this.description.Username,
|
|
120
|
-
UserRequestID: userRequestId,
|
|
121
|
-
UserRequestType: FIXML50SP2_1.UserRequestType.LogOffUser
|
|
122
|
-
};
|
|
123
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logon, o) : o;
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
const o = {
|
|
127
|
-
Username: this.description.Username,
|
|
128
|
-
UserRequestID: userRequestId,
|
|
129
|
-
UserStatus: FIXML50SP2_1.UserStatus.NotLoggedIn
|
|
130
|
-
};
|
|
131
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logon, o) : o;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
asciiHeader(msgType, seqNum, time, overrideData) {
|
|
135
|
-
const description = this.description;
|
|
136
|
-
const bodyLength = Math.max(4, description.BodyLengthChars || 7);
|
|
137
|
-
const placeHolder = Math.pow(10, bodyLength - 1) + 1;
|
|
138
|
-
const o = Object.assign({ BeginString: description.BeginString, BodyLength: placeHolder, MsgType: msgType, SenderCompID: description.SenderCompId, MsgSeqNum: seqNum, SendingTime: time, TargetCompID: description.TargetCompID, TargetSubID: description.TargetSubID }, overrideData);
|
|
139
|
-
return this.mutator ? this.mutator(description, 'StandardHeader', o) : o;
|
|
140
|
-
}
|
|
141
|
-
fixmlHeader() {
|
|
142
|
-
const description = this.description;
|
|
143
|
-
const o = {
|
|
144
|
-
SenderCompID: description.SenderCompId,
|
|
145
|
-
TargetCompID: description.TargetCompID,
|
|
146
|
-
SenderSubID: description.SenderSubID,
|
|
147
|
-
TargetSubID: description.TargetSubID
|
|
148
|
-
};
|
|
149
|
-
return this.mutator ? this.mutator(this.description, types_1.MsgType.Logon, o) : o;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
exports.SessionMsgFactory = SessionMsgFactory;
|
|
153
|
-
//# sourceMappingURL=session-msg-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-msg-factory.js","sourceRoot":"","sources":["../../src/transport/session-msg-factory.ts"],"names":[],"mappings":";;;AAGA,oCAAkC;AAElC,+CAW6B;AAE7B,oDAM4B;AAO5B,MAAa,iBAAiB;IAI5B,YAA6B,WAAgC,EAAS,UAAyB,IAAI;QAAtE,gBAAW,GAAX,WAAW,CAAqB;QAAS,YAAO,GAAP,OAAO,CAAsB;QACjG,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,QAAQ,KAAK,OAAO,CAAA;IAC7D,CAAC;IAEM,MAAM,CAAE,OAAe,EAAE,KAAa,EAAE,GAAW,EAAE,MAAc;QACxE,MAAM,CAAC,GAAY;YACjB,UAAU,EAAE,OAAO;YACnB,mBAAmB,EAAE,MAAM;YAC3B,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,GAAG;SACC,CAAA;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,eAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7E,CAAC;IAEM,KAAK,CAAE,gBAAwB,EAAE,EAAE,aAAsB,KAAK;QACnE,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAA;SACzB;aAAM;YACL,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;SAClD;IACH,CAAC;IAEM,MAAM,CAAE,OAAe,EAAE,IAAY;QAC1C,IAAI,IAAI,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pC,MAAM,CAAC,GAAyB;YAC9B,YAAY,EAAE,WAAW,CAAC,YAAY;YACtC,YAAY,EAAE,WAAW,CAAC,YAAY;YACtC,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,WAAW,EAAE,WAAW,CAAC,WAAW;SACb,CAAA;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,eAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5E,CAAC;CACF;AArKD,8CAqKC","sourcesContent":["import { ISessionMsgFactory } from './fix-msg-factory'\r\nimport { ISessionDescription } from './session-description'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { MsgType } from '../types'\r\n\r\nimport {\r\n EncryptMethod,\r\n IHeartbeat,\r\n ILogon,\r\n ILogout,\r\n IReject,\r\n IResendRequest,\r\n ISequenceReset,\r\n IStandardHeader,\r\n IStandardTrailer,\r\n ITestRequest\r\n} from '../types/FIX4.4/repo'\r\n\r\nimport {\r\n IStandardHeader as IStandardHeaderFixml,\r\n IUserRequest,\r\n IUserResponse,\r\n UserRequestType,\r\n UserStatus\r\n} from '../types/FIXML50SP2'\r\n\r\nexport interface ObjectMutator { (description: ISessionDescription, type: string, o: ILooseObject): ILooseObject\r\n}\r\n\r\n\r\n\r\nexport class SessionMsgFactory implements ISessionMsgFactory {\r\n\r\n public isAscii: boolean\r\n\r\n constructor (public readonly description: ISessionDescription, public mutator: ObjectMutator = null) {\r\n this.isAscii = description.application.protocol === 'ascii'\r\n }\r\n\r\n public reject (msgType: string, seqNo: number, msg: string, reason: number): ILooseObject {\r\n const o: IReject = {\r\n RefMsgType: msgType,\r\n SessionRejectReason: reason,\r\n RefSeqNum: seqNo,\r\n Text: msg\r\n } as IReject\r\n return this.mutator ? this.mutator(this.description, MsgType.Reject, o) : o\r\n }\r\n\r\n public logon (userRequestId: string = '', isResponse: boolean = false): ILooseObject {\r\n if (this.isAscii) {\r\n return this.asciiLogon()\r\n } else {\r\n return this.fixmlLogon(userRequestId, isResponse)\r\n }\r\n }\r\n\r\n public logout (msgType: string, text: string): ILooseObject {\r\n if (this.isAscii) {\r\n return this.asciiLogout(text)\r\n } else {\r\n return this.fixmlLogout(text, msgType !== 'UserReq')\r\n }\r\n }\r\n\r\n public testRequest (reqId: string = `ping-${new Date().toUTCString()}`): ILooseObject {\r\n const o: ITestRequest = {\r\n TestReqID: reqId\r\n } as ITestRequest\r\n return this.mutator ? this.mutator(this.description, MsgType.TestRequest, o) : o\r\n }\r\n\r\n public heartbeat (testReqId: string): ILooseObject {\r\n const o: IHeartbeat = {\r\n TestReqID: testReqId\r\n } as IHeartbeat\r\n return this.mutator ? this.mutator(this.description, MsgType.Heartbeat, o) : o\r\n }\r\n\r\n public resendRequest (from: number, to: number): ILooseObject {\r\n const o: IResendRequest = {\r\n BeginSeqNo: from,\r\n EndSeqNo: to\r\n } as IResendRequest\r\n return this.mutator ? this.mutator(this.description, MsgType.ResendRequest, o) : o\r\n }\r\n\r\n public sequenceReset (newSeqNo: number, gapFill?: boolean): ILooseObject {\r\n const o: ISequenceReset = {\r\n GapFillFlag: gapFill === true,\r\n NewSeqNo: newSeqNo\r\n } as ISequenceReset\r\n return this.mutator ? this.mutator(this.description, MsgType.SequenceReset, o) : o\r\n }\r\n\r\n public header (msgType: string, seqNum: number = 0, time: Date = new Date(), overrideData?: Partial<IStandardHeader>): ILooseObject {\r\n if (this.isAscii) {\r\n return this.asciiHeader(msgType, seqNum, time, overrideData)\r\n } else {\r\n return this.fixmlHeader()\r\n }\r\n }\r\n\r\n public trailer (checksum: number): ILooseObject {\r\n const s = checksum.toString()\r\n const padded = s.padStart(3, '0')\r\n return {\r\n CheckSum: padded\r\n } as IStandardTrailer\r\n }\r\n\r\n private asciiLogon (): ILooseObject {\r\n const description = this.description\r\n const o: ILogon = {\r\n Username: description.Username,\r\n Password: description.Password,\r\n HeartBtInt: description.HeartBtInt,\r\n ResetSeqNumFlag: description.ResetSeqNumFlag,\r\n EncryptMethod: EncryptMethod.None\r\n } as ILogon\r\n return this.mutator ? this.mutator(this.description, MsgType.Logon, o) : o\r\n }\r\n\r\n private asciiLogout (text: string): ILooseObject {\r\n const o: ILogout = {\r\n Text: text\r\n } as ILogout\r\n return this.mutator ? this.mutator(this.description, MsgType.Logout, o) : o\r\n }\r\n\r\n private fixmlLogon (userRequestId: string, isResponse: boolean): ILooseObject {\r\n const description = this.description\r\n if (!isResponse) {\r\n const o: IUserRequest = {\r\n Username: description.Username,\r\n Password: description.Password,\r\n UserRequestID: userRequestId,\r\n UserRequestType: UserRequestType.LogOnUser\r\n } as IUserRequest\r\n return this.mutator ? this.mutator(this.description, MsgType.Logon, o) : o\r\n } else {\r\n const o: IUserResponse = {\r\n Username: description.Username,\r\n UserRequestID: userRequestId,\r\n UserStatus: UserStatus.LoggedIn\r\n } as IUserResponse\r\n return this.mutator ? this.mutator(this.description, MsgType.Logon, o) : o\r\n }\r\n }\r\n\r\n private fixmlLogout (userRequestId: string, isResponse: boolean): ILooseObject {\r\n if (!isResponse) {\r\n const o: IUserRequest = {\r\n Username: this.description.Username,\r\n UserRequestID: userRequestId,\r\n UserRequestType: UserRequestType.LogOffUser\r\n } as IUserRequest\r\n return this.mutator ? this.mutator(this.description, MsgType.Logon, o) : o\r\n } else {\r\n const o: IUserResponse = {\r\n Username: this.description.Username,\r\n UserRequestID: userRequestId,\r\n UserStatus: UserStatus.NotLoggedIn\r\n } as IUserResponse\r\n return this.mutator ? this.mutator(this.description, MsgType.Logon, o) : o\r\n }\r\n }\r\n\r\n protected asciiHeader (msgType: string, seqNum: number, time: Date, overrideData?: Partial<IStandardHeader>): ILooseObject {\r\n const description = this.description\r\n const bodyLength: number = Math.max(4, description.BodyLengthChars || 7)\r\n const placeHolder = Math.pow(10, bodyLength - 1) + 1\r\n const o: IStandardHeader = {\r\n BeginString: description.BeginString,\r\n BodyLength: placeHolder,\r\n MsgType: msgType,\r\n SenderCompID: description.SenderCompId,\r\n MsgSeqNum: seqNum,\r\n SendingTime: time,\r\n TargetCompID: description.TargetCompID,\r\n TargetSubID: description.TargetSubID,\r\n ...overrideData\r\n }\r\n return this.mutator ? this.mutator(description, 'StandardHeader', o) : o\r\n }\r\n\r\n private fixmlHeader (): ILooseObject {\r\n const description = this.description\r\n const o: IStandardHeaderFixml = {\r\n SenderCompID: description.SenderCompId,\r\n TargetCompID: description.TargetCompID,\r\n SenderSubID: description.SenderSubID,\r\n TargetSubID: description.TargetSubID\r\n } as IStandardHeaderFixml\r\n return this.mutator ? this.mutator(this.description, MsgType.Logon, o) : o\r\n } \r\n}\r\n"]}
|
|
@@ -1,40 +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.acceptor = void 0;
|
|
13
|
-
const tcp_acceptor_1 = require("./tcp-acceptor");
|
|
14
|
-
function acceptor(config, sessionFactory) {
|
|
15
|
-
return new Promise((accept, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const logger = config.logFactory.logger('acceptor');
|
|
17
|
-
logger.info('starting.');
|
|
18
|
-
const acceptor = new tcp_acceptor_1.TcpAcceptor(config);
|
|
19
|
-
acceptor.on('transport', (t) => {
|
|
20
|
-
logger.info('creates new transport.');
|
|
21
|
-
const acceptorSession = sessionFactory(config);
|
|
22
|
-
acceptorSession.run(t).then(() => {
|
|
23
|
-
logger.info('ends');
|
|
24
|
-
acceptor.close(() => {
|
|
25
|
-
logger.info('acceptor closed.');
|
|
26
|
-
accept(true);
|
|
27
|
-
});
|
|
28
|
-
}).catch((e) => {
|
|
29
|
-
logger.info(`error in session - close listener ${e.message}`);
|
|
30
|
-
acceptor.close(() => {
|
|
31
|
-
logger.info('acceptor closed.');
|
|
32
|
-
reject(e);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
acceptor.listen();
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
exports.acceptor = acceptor;
|
|
40
|
-
//# sourceMappingURL=acceptor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acceptor.js","sourceRoot":"","sources":["../../../src/transport/tcp/acceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,iDAA4C;AAI5C,SAAgB,QAAQ,CAAE,MAAoB,EAAE,cAA8B;IAC5E,OAAO,IAAI,OAAO,CAAM,CAAO,MAAM,EAAE,MAAM,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QACnD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACxB,MAAM,QAAQ,GAAgB,IAAI,0BAAW,CAAC,MAAM,CAAC,CAAA;QACrD,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAe,EAAE,EAAE;YAC3C,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;YACrC,MAAM,eAAe,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;YAC9C,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC/B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACnB,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE;oBAClB,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;oBAC/B,MAAM,CAAC,IAAI,CAAC,CAAA;gBACd,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;gBACpB,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;gBAC7D,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE;oBAClB,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;oBAC/B,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,QAAQ,CAAC,MAAM,EAAE,CAAA;IACnB,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC;AAxBD,4BAwBC","sourcesContent":["import { IJsFixConfig } from '../../config'\r\nimport { FixAcceptor } from '../fix-acceptor'\r\nimport { TcpAcceptor } from './tcp-acceptor'\r\nimport { MsgTransport } from '../msg-transport'\r\nimport { MakeFixSession } from '../make-fixl-session'\r\n\r\nexport function acceptor (config: IJsFixConfig, sessionFactory: MakeFixSession): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n const logger = config.logFactory.logger('acceptor')\r\n logger.info('starting.')\r\n const acceptor: FixAcceptor = new TcpAcceptor(config)\r\n acceptor.on('transport', (t: MsgTransport) => {\r\n logger.info('creates new transport.')\r\n const acceptorSession = sessionFactory(config)\r\n acceptorSession.run(t).then(() => {\r\n logger.info('ends')\r\n acceptor.close(() => {\r\n logger.info('acceptor closed.')\r\n accept(true)\r\n })\r\n }).catch((e: Error) => {\r\n logger.info(`error in session - close listener ${e.message}`)\r\n acceptor.close(() => {\r\n logger.info('acceptor closed.')\r\n reject(e)\r\n })\r\n })\r\n })\r\n acceptor.listen()\r\n })\r\n}\r\n"]}
|
|
@@ -1,67 +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.initiator = void 0;
|
|
13
|
-
const tcp_initiator_1 = require("./tcp-initiator");
|
|
14
|
-
function initiator(config, sessionFactory, reconnectTimeout = 0) {
|
|
15
|
-
return new Promise((accept, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const logger = config.logFactory.logger('initiator');
|
|
17
|
-
logger.info('create session');
|
|
18
|
-
const initiatorSession = sessionFactory(config);
|
|
19
|
-
let connecting = true;
|
|
20
|
-
while (connecting) {
|
|
21
|
-
try {
|
|
22
|
-
yield once(config, initiatorSession);
|
|
23
|
-
logger.info('session has ended');
|
|
24
|
-
connecting = false;
|
|
25
|
-
accept(true);
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
if (!reconnectTimeout) {
|
|
29
|
-
connecting = false;
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
logger.info(`waiting ${reconnectTimeout} to reconnect following error`);
|
|
34
|
-
yield delay(reconnectTimeout);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
exports.initiator = initiator;
|
|
41
|
-
function delay(p) {
|
|
42
|
-
return new Promise((accept) => {
|
|
43
|
-
if (!p) {
|
|
44
|
-
accept(true);
|
|
45
|
-
}
|
|
46
|
-
setTimeout(() => {
|
|
47
|
-
accept(true);
|
|
48
|
-
}, p);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function once(config, initiatorSession) {
|
|
52
|
-
return new Promise((accept, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const logger = config.logFactory.logger('initiator');
|
|
54
|
-
const initiator = new tcp_initiator_1.TcpInitiator(config);
|
|
55
|
-
logger.info('connecting ...');
|
|
56
|
-
const initiatorTransport = yield initiator.connect(22);
|
|
57
|
-
logger.info('... connected, run session');
|
|
58
|
-
initiatorSession.run(initiatorTransport).then(() => {
|
|
59
|
-
logger.info('ends');
|
|
60
|
-
accept(true);
|
|
61
|
-
}).catch((e) => {
|
|
62
|
-
logger.error(e);
|
|
63
|
-
reject(e);
|
|
64
|
-
});
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=initiator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initiator.js","sourceRoot":"","sources":["../../../src/transport/tcp/initiator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mDAA8C;AAK9C,SAAgB,SAAS,CAAE,MAAoB,EAAE,cAA8B,EAAE,mBAA2B,CAAC;IAC3G,OAAO,IAAI,OAAO,CAAM,CAAO,MAAM,EAAE,MAAM,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QACpD,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC7B,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;QAC/C,IAAI,UAAU,GAAY,IAAI,CAAA;QAC9B,OAAO,UAAU,EAAE;YACjB,IAAI;gBACF,MAAM,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAA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C,GAAG,EAAE;YACjD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACnB,MAAM,CAAC,IAAI,CAAC,CAAA;QACd,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;YACpB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACf,MAAM,CAAC,CAAC,CAAC,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { IJsFixConfig } from '../../config'\r\nimport { FixInitiator } from '../fix-initiator'\r\nimport { TcpInitiator } from './tcp-initiator'\r\nimport { MsgTransport } from '../msg-transport'\r\nimport { MakeFixSession } from '../make-fixl-session'\r\nimport { FixSession } from '../fix-session'\r\n\r\nexport function initiator (config: IJsFixConfig, sessionFactory: MakeFixSession, reconnectTimeout: number = 0): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n const logger = config.logFactory.logger('initiator')\r\n logger.info('create session')\r\n const initiatorSession = sessionFactory(config)\r\n let connecting: boolean = true\r\n while (connecting) {\r\n try {\r\n await once(config, initiatorSession)\r\n logger.info('session has ended')\r\n connecting = false\r\n accept(true)\r\n } catch (e) {\r\n if (!reconnectTimeout) {\r\n connecting = false\r\n reject(e)\r\n } else {\r\n logger.info(`waiting ${reconnectTimeout} to reconnect following error`)\r\n await delay(reconnectTimeout)\r\n }\r\n }\r\n }\r\n })\r\n}\r\n\r\nfunction delay (p: number): Promise<any> {\r\n return new Promise<any>((accept) => {\r\n if (!p) {\r\n accept(true)\r\n }\r\n setTimeout(() => {\r\n accept(true)\r\n }, p)\r\n })\r\n}\r\n\r\nfunction once (config: IJsFixConfig, initiatorSession: FixSession): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n const logger = config.logFactory.logger('initiator')\r\n const initiator: FixInitiator = new TcpInitiator(config)\r\n logger.info('connecting ...')\r\n const initiatorTransport: MsgTransport = await initiator.connect(22)\r\n logger.info('... connected, run session')\r\n initiatorSession.run(initiatorTransport).then(() => {\r\n logger.info('ends')\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"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ITcpTransportDescription } from '../session-description';
|
|
3
|
-
import { IJsFixConfig } from '../../config';
|
|
4
|
-
import { InitiatorState } from './tcp-initiator';
|
|
5
|
-
import { MakeFixSession } from '../make-fixl-session';
|
|
6
|
-
import { FixSession } from '../fix-session';
|
|
7
|
-
import * as events from 'events';
|
|
8
|
-
export declare class RecoveringInitiator extends events.EventEmitter {
|
|
9
|
-
readonly jsFixConfig: IJsFixConfig;
|
|
10
|
-
readonly sessionFactory: MakeFixSession;
|
|
11
|
-
tcp: ITcpTransportDescription;
|
|
12
|
-
session: FixSession;
|
|
13
|
-
state: InitiatorState;
|
|
14
|
-
private readonly logger;
|
|
15
|
-
private application;
|
|
16
|
-
constructor(jsFixConfig: IJsFixConfig, sessionFactory: MakeFixSession);
|
|
17
|
-
}
|