jspurefix 2.2.1 → 3.0.0
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 +30 -0
- package/README.md +297 -249
- package/data/session/test-http-initiator.json +2 -2
- package/dist/buffer/ascii/ascii-chars.js.map +1 -1
- package/dist/buffer/ascii/ascii-encoder.js +9 -5
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser-state.d.ts +2 -2
- package/dist/buffer/ascii/ascii-parser-state.js +1 -1
- package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser.d.ts +2 -2
- package/dist/buffer/ascii/ascii-parser.js +17 -11
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.d.ts +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.js +11 -3
- package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +3 -3
- package/dist/buffer/ascii/ascii-view.js +18 -0
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/ascii/itime-formatter.d.ts +12 -12
- package/dist/buffer/ascii/itime-formatter.js.map +1 -1
- package/dist/buffer/ascii/time-formatter.d.ts +6 -6
- package/dist/buffer/ascii/time-formatter.js.map +1 -1
- package/dist/buffer/elastic-buffer.d.ts +1 -1
- package/dist/buffer/elastic-buffer.js +2 -2
- package/dist/buffer/elastic-buffer.js.map +1 -1
- package/dist/buffer/encode-proxy.js +1 -1
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/encoder-state.d.ts +2 -2
- package/dist/buffer/encoder-state.js +4 -1
- package/dist/buffer/encoder-state.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.js +4 -2
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-parser.js +61 -39
- package/dist/buffer/fixml/fixml-parser.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.js +3 -3
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/fixml/populated-attributes.js.map +1 -1
- package/dist/buffer/msg-encoder.js +2 -1
- package/dist/buffer/msg-encoder.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +9 -9
- package/dist/buffer/msg-view.js +58 -25
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/buffer/segment/segment-description.d.ts +4 -4
- package/dist/buffer/segment/segment-description.js +7 -5
- package/dist/buffer/segment/segment-description.js.map +1 -1
- package/dist/buffer/segment/segment-summary.js +2 -1
- package/dist/buffer/segment/segment-summary.js.map +1 -1
- package/dist/buffer/structure.d.ts +1 -1
- package/dist/buffer/structure.js +1 -2
- package/dist/buffer/structure.js.map +1 -1
- package/dist/buffer/time-format-template.js.map +1 -1
- package/dist/collections/collection.d.ts +3 -7
- package/dist/collections/collection.js.map +1 -1
- package/dist/collections/dictionary.d.ts +1 -1
- package/dist/collections/dictionary.js +2 -1
- package/dist/collections/dictionary.js.map +1 -1
- package/dist/config/empty-log-factory.js.map +1 -1
- package/dist/config/get-js-fx-logger.d.ts +1 -3
- package/dist/config/get-js-fx-logger.js.map +1 -1
- package/dist/config/js-fix-config.d.ts +3 -3
- package/dist/config/js-fix-config.js.map +1 -1
- package/dist/config/js-fix-logger.d.ts +5 -5
- package/dist/config/js-fix-logger.js.map +1 -1
- package/dist/config/js-fix-winston-log-factory.d.ts +1 -1
- package/dist/config/js-fix-winston-log-factory.js.map +1 -1
- package/dist/config/winston-logger.js +7 -7
- package/dist/config/winston-logger.js.map +1 -1
- package/dist/dict-parser.js +27 -21
- package/dist/dict-parser.js.map +1 -1
- package/dist/dictionary/compiler/compiler-settings.js.map +1 -1
- package/dist/dictionary/compiler/compiler-type.js.map +1 -1
- package/dist/dictionary/compiler/enum-compiler.d.ts +2 -2
- package/dist/dictionary/compiler/enum-compiler.js +7 -10
- package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
- package/dist/dictionary/compiler/msg-compiler.js +9 -10
- package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
- package/dist/dictionary/compiler/standard-snippet.d.ts +1 -1
- package/dist/dictionary/compiler/standard-snippet.js +11 -10
- package/dist/dictionary/compiler/standard-snippet.js.map +1 -1
- package/dist/dictionary/contained/contained-component-field.d.ts +2 -2
- package/dist/dictionary/contained/contained-component-field.js +1 -1
- package/dist/dictionary/contained/contained-component-field.js.map +1 -1
- package/dist/dictionary/contained/contained-field-dispatcher.d.ts +3 -9
- package/dist/dictionary/contained/contained-field-dispatcher.js.map +1 -1
- package/dist/dictionary/contained/contained-field-set.d.ts +4 -4
- package/dist/dictionary/contained/contained-field-set.js +1 -1
- package/dist/dictionary/contained/contained-field-set.js.map +1 -1
- package/dist/dictionary/contained/contained-field.d.ts +1 -0
- package/dist/dictionary/contained/contained-field.js +3 -0
- package/dist/dictionary/contained/contained-field.js.map +1 -1
- package/dist/dictionary/contained/contained-group-field.d.ts +2 -2
- package/dist/dictionary/contained/contained-group-field.js +1 -1
- package/dist/dictionary/contained/contained-group-field.js.map +1 -1
- package/dist/dictionary/contained/contained-simple-field.d.ts +2 -2
- package/dist/dictionary/contained/contained-simple-field.js +1 -1
- package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
- package/dist/dictionary/contained/field-dispatcher.d.ts +3 -9
- package/dist/dictionary/contained/field-dispatcher.js.map +1 -1
- package/dist/dictionary/contained/fields-dispatch.js +0 -1
- package/dist/dictionary/contained/fields-dispatch.js.map +1 -1
- package/dist/dictionary/definition/component-field-definition.d.ts +3 -3
- package/dist/dictionary/definition/component-field-definition.js +1 -1
- package/dist/dictionary/definition/component-field-definition.js.map +1 -1
- package/dist/dictionary/definition/fix-definitions.d.ts +3 -3
- package/dist/dictionary/definition/fix-definitions.js +3 -2
- package/dist/dictionary/definition/fix-definitions.js.map +1 -1
- package/dist/dictionary/definition/group-field-definition.d.ts +4 -4
- package/dist/dictionary/definition/group-field-definition.js +1 -1
- package/dist/dictionary/definition/group-field-definition.js.map +1 -1
- package/dist/dictionary/definition/message-definition.d.ts +2 -2
- package/dist/dictionary/definition/message-definition.js.map +1 -1
- package/dist/dictionary/definition/simple-field-definition.d.ts +4 -4
- package/dist/dictionary/definition/simple-field-definition.js +3 -2
- package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
- package/dist/dictionary/dict-primitive.d.ts +1 -1
- package/dist/dictionary/dict-primitive.js.map +1 -1
- package/dist/dictionary/field-enum.js.map +1 -1
- package/dist/dictionary/fix-versions.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +20 -18
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository.js +24 -16
- 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 +24 -15
- 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 +5 -5
- 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.d.ts +1 -1
- package/dist/dictionary/parser/fixml/include-graph.js +58 -48
- 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 +34 -23
- package/dist/dictionary/parser/fixml/xsd-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-definition-parser.js +0 -2
- package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-set-parser.js +3 -2
- package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/message-parser.js +10 -5
- package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/node-parser.js +14 -8
- package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/parse-context.d.ts +5 -5
- package/dist/dictionary/parser/quickfix/parse-context.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +22 -19
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/dictionary/set-reduce.js.map +1 -1
- package/dist/dictionary/type-dispatcher.d.ts +3 -9
- package/dist/dictionary/type-dispatcher.js.map +1 -1
- package/dist/dictionary/version-util.js +8 -8
- package/dist/dictionary/version-util.js.map +1 -1
- package/dist/jsfix-cmd.d.ts +3 -1
- package/dist/jsfix-cmd.js +134 -99
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/runtime/make-config.js +34 -14
- package/dist/runtime/make-config.js.map +1 -1
- package/dist/runtime/session-container.d.ts +3 -2
- package/dist/runtime/session-container.js +36 -16
- package/dist/runtime/session-container.js.map +1 -1
- package/dist/runtime/session-launcher.d.ts +10 -6
- package/dist/runtime/session-launcher.js +80 -43
- package/dist/runtime/session-launcher.js.map +1 -1
- package/dist/sample/http/oms/app.js +37 -7
- package/dist/sample/http/oms/app.js.map +1 -1
- package/dist/sample/http/oms/http-client.js +4 -2
- package/dist/sample/http/oms/http-client.js.map +1 -1
- package/dist/sample/http/oms/http-server.js +7 -1
- package/dist/sample/http/oms/http-server.js.map +1 -1
- package/dist/sample/http/oms/oms-factory.js +4 -3
- package/dist/sample/http/oms/oms-factory.js.map +1 -1
- package/dist/sample/tcp/qf-md/app.js +3 -3
- package/dist/sample/tcp/qf-md/app.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-client.js +2 -1
- package/dist/sample/tcp/qf-md/md-client.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-factory.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-server.d.ts +1 -1
- package/dist/sample/tcp/qf-md/md-server.js +2 -1
- package/dist/sample/tcp/qf-md/md-server.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/app.js +29 -16
- package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +9 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +51 -2
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +2 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +4 -3
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -1
- package/dist/sample/tcp/skeleton/app.js.map +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.js +7 -4
- package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/app-launcher.js +3 -3
- package/dist/sample/tcp/trade-capture/app-launcher.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-client.d.ts +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-client.js +2 -1
- package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-server.js +7 -2
- package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-factory.js.map +1 -1
- package/dist/store/fix-msg-ascii-store-resend.js +18 -7
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-memory-store.d.ts +3 -3
- package/dist/store/fix-msg-memory-store.js +93 -69
- package/dist/store/fix-msg-memory-store.js.map +1 -1
- package/dist/store/fix-msg-store-record.d.ts +6 -6
- package/dist/store/fix-msg-store-record.js +2 -1
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/store/fix-msg-store-state.js.map +1 -1
- package/dist/store/fix-msg-store.d.ts +7 -7
- package/dist/store/fix-msg-store.js.map +1 -1
- package/dist/test/ascii/ascii-encoder.test.js +93 -63
- package/dist/test/ascii/ascii-encoder.test.js.map +1 -1
- package/dist/test/ascii/ascii-parser.test.js +28 -24
- package/dist/test/ascii/ascii-parser.test.js.map +1 -1
- package/dist/test/ascii/ascii-segment.test.js +16 -11
- package/dist/test/ascii/ascii-segment.test.js.map +1 -1
- package/dist/test/ascii/ascii-store-replay.test.js +1 -1
- package/dist/test/ascii/ascii-store-replay.test.js.map +1 -1
- package/dist/test/ascii/ascii-tag-pos.test.js +7 -3
- package/dist/test/ascii/ascii-tag-pos.test.js.map +1 -1
- package/dist/test/ascii/execution-report.test.js +80 -72
- package/dist/test/ascii/execution-report.test.js.map +1 -1
- package/dist/test/ascii/fix-log-replay.test.js +1 -1
- package/dist/test/ascii/fix-log-replay.test.js.map +1 -1
- package/dist/test/ascii/fix-repo-dict.test.js +58 -55
- package/dist/test/ascii/fix-repo-dict.test.js.map +1 -1
- package/dist/test/ascii/includes.test.js +1 -1
- package/dist/test/ascii/includes.test.js.map +1 -1
- package/dist/test/ascii/logon.test.js +3 -3
- package/dist/test/ascii/logon.test.js.map +1 -1
- package/dist/test/ascii/memory-store.test.js +3 -3
- package/dist/test/ascii/memory-store.test.js.map +1 -1
- package/dist/test/ascii/qf-full-msg.test.js +19 -16
- package/dist/test/ascii/qf-full-msg.test.js.map +1 -1
- package/dist/test/ascii/repo-full-ascii-msg.test.js +11 -11
- package/dist/test/ascii/repo-full-ascii-msg.test.js.map +1 -1
- package/dist/test/ascii/session-state.test.js.map +1 -1
- package/dist/test/ascii/session.test.js +59 -42
- package/dist/test/ascii/session.test.js.map +1 -1
- package/dist/test/ascii/view-decode.test.js +30 -22
- package/dist/test/ascii/view-decode.test.js.map +1 -1
- package/dist/test/encode-proxy.test.js +29 -29
- package/dist/test/encode-proxy.test.js.map +1 -1
- package/dist/test/env/experiment.js +5 -5
- package/dist/test/env/experiment.js.map +1 -1
- package/dist/test/env/parsing-result.d.ts +3 -3
- package/dist/test/env/parsing-result.js.map +1 -1
- package/dist/test/env/setup.d.ts +2 -2
- package/dist/test/env/setup.js +13 -11
- package/dist/test/env/setup.js.map +1 -1
- package/dist/test/env/skeleton-runner.d.ts +1 -1
- package/dist/test/env/skeleton-runner.js +16 -16
- package/dist/test/env/skeleton-runner.js.map +1 -1
- package/dist/test/env/test-recovery.d.ts +3 -3
- package/dist/test/env/test-recovery.js +1 -1
- package/dist/test/env/test-recovery.js.map +1 -1
- package/dist/test/env/to-views.d.ts +1 -1
- package/dist/test/env/to-views.js +2 -2
- package/dist/test/env/to-views.js.map +1 -1
- package/dist/test/fixml/fixml-alloc-parse.test.js +32 -15
- package/dist/test/fixml/fixml-alloc-parse.test.js.map +1 -1
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js +2 -2
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js.map +1 -1
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js +2 -1
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js.map +1 -1
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js +19 -12
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js.map +1 -1
- package/dist/test/fixml/repo-full-fixml-msg.test.js +2 -2
- package/dist/test/fixml/repo-full-fixml-msg.test.js.map +1 -1
- package/dist/transport/ascii/ascii-msg-transmitter.d.ts +1 -1
- package/dist/transport/ascii/ascii-msg-transmitter.js +18 -8
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.d.ts +3 -3
- package/dist/transport/ascii/ascii-session-msg-factory.js +4 -2
- 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 +34 -16
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/duplex/http-duplex.js +10 -8
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/dist/transport/duplex/string-duplex.js +2 -2
- package/dist/transport/duplex/string-duplex.js.map +1 -1
- package/dist/transport/factory/msg-transport.js +21 -10
- package/dist/transport/factory/msg-transport.js.map +1 -1
- package/dist/transport/fix-acceptor.d.ts +3 -3
- package/dist/transport/fix-acceptor.js.map +1 -1
- package/dist/transport/fix-entity.d.ts +1 -1
- package/dist/transport/fix-entity.js.map +1 -1
- 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.d.ts +1 -1
- package/dist/transport/fixml/fixml-msg-transmitter.js +4 -2
- package/dist/transport/fixml/fixml-msg-transmitter.js.map +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.d.ts +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -1
- package/dist/transport/fixml/fixml-session.js +7 -3
- package/dist/transport/fixml/fixml-session.js.map +1 -1
- package/dist/transport/http/html-options.d.ts +2 -2
- package/dist/transport/http/html-options.js.map +1 -1
- package/dist/transport/http/html-route.js.map +1 -1
- package/dist/transport/http/http-acceptor-listener.js +27 -23
- package/dist/transport/http/http-acceptor-listener.js.map +1 -1
- package/dist/transport/http/http-acceptor.d.ts +2 -2
- package/dist/transport/http/http-acceptor.js +52 -41
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/http/http-adapter.d.ts +3 -3
- package/dist/transport/http/http-adapter.js.map +1 -1
- package/dist/transport/http/http-initiator.js +35 -23
- package/dist/transport/http/http-initiator.js.map +1 -1
- package/dist/transport/http/http-json-sample-adapter.d.ts +4 -4
- package/dist/transport/http/http-json-sample-adapter.js +16 -11
- package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
- package/dist/transport/http/http-transaction.js.map +1 -1
- package/dist/transport/http/http-transport-description.js.map +1 -1
- package/dist/transport/msg-application.js.map +1 -1
- package/dist/transport/msg-transmitter.d.ts +1 -1
- package/dist/transport/msg-transmitter.js +2 -2
- package/dist/transport/msg-transmitter.js.map +1 -1
- package/dist/transport/session/a-session-msg-factory.d.ts +3 -5
- package/dist/transport/session/a-session-msg-factory.js.map +1 -1
- package/dist/transport/session/fix-session-state.d.ts +8 -5
- package/dist/transport/session/fix-session-state.js +21 -16
- package/dist/transport/session/fix-session-state.js.map +1 -1
- package/dist/transport/session/fix-session.d.ts +19 -6
- package/dist/transport/session/fix-session.js +197 -110
- package/dist/transport/session/fix-session.js.map +1 -1
- package/dist/transport/session/make-fix-session.d.ts +1 -3
- package/dist/transport/session/make-fix-session.js.map +1 -1
- package/dist/transport/session/session-description.d.ts +1 -1
- package/dist/transport/session/session-description.js.map +1 -1
- package/dist/transport/session/session-msg-factory.d.ts +9 -9
- package/dist/transport/session/session-msg-factory.js.map +1 -1
- package/dist/transport/tcp/recovering-tcp-initiator.d.ts +4 -2
- package/dist/transport/tcp/recovering-tcp-initiator.js +62 -30
- package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -1
- package/dist/transport/tcp/tcp-acceptor-listener.js +28 -25
- package/dist/transport/tcp/tcp-acceptor-listener.js.map +1 -1
- package/dist/transport/tcp/tcp-acceptor.d.ts +2 -2
- package/dist/transport/tcp/tcp-acceptor.js +23 -15
- package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator-connector.js +39 -30
- package/dist/transport/tcp/tcp-initiator-connector.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator.d.ts +1 -1
- package/dist/transport/tcp/tcp-initiator.js +130 -104
- package/dist/transport/tcp/tcp-initiator.js.map +1 -1
- package/dist/transport/tcp/tcp-transport-description.js.map +1 -1
- package/dist/transport/tcp/tls-options-factory.d.ts +3 -3
- package/dist/transport/tcp/tls-options-factory.js +10 -3
- package/dist/transport/tcp/tls-options-factory.js.map +1 -1
- package/dist/transport/tcp/tls-options.d.ts +6 -2
- package/dist/transport/tcp/tls-options.js.map +1 -1
- package/dist/util/json-helper.js +2 -1
- package/dist/util/json-helper.js.map +1 -1
- package/dist/util/message-generator.d.ts +1 -1
- package/dist/util/message-generator.js +1 -1
- package/dist/util/message-generator.js.map +1 -1
- package/package.json +53 -48
- package/src/buffer/ascii/ascii-chars.ts +0 -1
- package/src/buffer/ascii/ascii-encoder.ts +18 -16
- package/src/buffer/ascii/ascii-parser-state.ts +4 -4
- package/src/buffer/ascii/ascii-parser.ts +16 -13
- package/src/buffer/ascii/ascii-segment-parser.ts +16 -15
- package/src/buffer/ascii/ascii-view.ts +22 -14
- package/src/buffer/ascii/itime-formatter.ts +12 -12
- package/src/buffer/ascii/time-formatter.ts +11 -12
- package/src/buffer/elastic-buffer.ts +5 -6
- package/src/buffer/encode-proxy.ts +6 -5
- package/src/buffer/encoder-state.ts +7 -3
- package/src/buffer/fixml/fixml-encoder.ts +10 -10
- package/src/buffer/fixml/fixml-parser.ts +80 -60
- package/src/buffer/fixml/fixml-view.ts +6 -7
- package/src/buffer/fixml/populated-attributes.ts +1 -1
- package/src/buffer/msg-encoder.ts +2 -1
- package/src/buffer/msg-view.ts +73 -53
- package/src/buffer/segment/segment-description.ts +13 -13
- package/src/buffer/segment/segment-summary.ts +3 -2
- package/src/buffer/structure.ts +6 -6
- package/src/buffer/time-format-template.ts +1 -1
- package/src/collections/collection.ts +2 -6
- package/src/collections/dictionary.ts +4 -5
- package/src/config/empty-log-factory.ts +1 -0
- package/src/config/get-js-fx-logger.ts +1 -2
- package/src/config/js-fix-config.ts +6 -6
- package/src/config/js-fix-logger.ts +14 -9
- package/src/config/js-fix-winston-log-factory.ts +2 -1
- package/src/config/winston-logger.ts +9 -7
- package/src/dictionary/compiler/compiler-settings.ts +5 -5
- package/src/dictionary/compiler/compiler-type.ts +1 -1
- package/src/dictionary/compiler/enum-compiler.ts +14 -16
- package/src/dictionary/compiler/msg-compiler.ts +15 -17
- package/src/dictionary/compiler/standard-snippet.ts +28 -27
- package/src/dictionary/contained/contained-component-field.ts +5 -4
- package/src/dictionary/contained/contained-field-dispatcher.ts +3 -3
- package/src/dictionary/contained/contained-field-set.ts +21 -21
- package/src/dictionary/contained/contained-field.ts +4 -1
- package/src/dictionary/contained/contained-group-field.ts +4 -4
- package/src/dictionary/contained/contained-simple-field.ts +5 -5
- package/src/dictionary/contained/field-dispatcher.ts +3 -3
- package/src/dictionary/contained/fields-dispatch.ts +0 -1
- package/src/dictionary/definition/component-field-definition.ts +4 -4
- package/src/dictionary/definition/fix-definitions.ts +8 -8
- package/src/dictionary/definition/group-field-definition.ts +5 -5
- package/src/dictionary/definition/message-definition.ts +4 -4
- package/src/dictionary/definition/simple-field-definition.ts +9 -9
- package/src/dictionary/dict-primitive.ts +2 -2
- package/src/dictionary/field-enum.ts +3 -2
- package/src/dictionary/fix-versions.ts +10 -10
- package/src/dictionary/parser/fix-repository/repository-xml-parser.ts +7 -8
- package/src/dictionary/parser/fix-repository/repository.ts +38 -30
- package/src/dictionary/parser/fixml/components-parser.ts +57 -51
- package/src/dictionary/parser/fixml/fields-parser.ts +9 -10
- package/src/dictionary/parser/fixml/fix-xsd-parser.ts +2 -3
- package/src/dictionary/parser/fixml/include-graph.ts +26 -21
- package/src/dictionary/parser/fixml/xsd-parser.ts +5 -5
- package/src/dictionary/parser/quickfix/field-definition-parser.ts +3 -5
- package/src/dictionary/parser/quickfix/field-set-parser.ts +2 -2
- package/src/dictionary/parser/quickfix/message-parser.ts +9 -6
- package/src/dictionary/parser/quickfix/node-parser.ts +20 -18
- package/src/dictionary/parser/quickfix/parse-context.ts +4 -4
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +13 -15
- package/src/dictionary/set-reduce.ts +4 -3
- package/src/dictionary/type-dispatcher.ts +3 -3
- package/src/dictionary/version-util.ts +8 -8
- package/src/jsfix-cmd.ts +82 -58
- package/src/runtime/make-config.ts +15 -10
- package/src/runtime/session-container.ts +26 -18
- package/src/runtime/session-launcher.ts +58 -30
- package/src/sample/http/oms/app.ts +24 -7
- package/src/sample/http/oms/http-client.ts +3 -3
- package/src/sample/http/oms/http-server.ts +7 -1
- package/src/sample/http/oms/oms-factory.ts +3 -3
- package/src/sample/tcp/qf-md/app.ts +3 -3
- package/src/sample/tcp/qf-md/md-client.ts +1 -1
- package/src/sample/tcp/qf-md/md-factory.ts +3 -2
- package/src/sample/tcp/qf-md/md-server.ts +2 -2
- package/src/sample/tcp/recovering-skeleton/app.ts +37 -20
- package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +66 -4
- package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +2 -2
- package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +4 -4
- package/src/sample/tcp/skeleton/app.ts +1 -1
- package/src/sample/tcp/skeleton/skeleton-session.ts +7 -7
- package/src/sample/tcp/tls-trade-capture/app.ts +1 -1
- package/src/sample/tcp/trade-capture/app-launcher.ts +4 -4
- package/src/sample/tcp/trade-capture/trade-capture-client.ts +7 -5
- package/src/sample/tcp/trade-capture/trade-capture-server.ts +10 -5
- package/src/sample/tcp/trade-capture/trade-factory.ts +1 -1
- package/src/store/fix-msg-ascii-store-resend.ts +5 -6
- package/src/store/fix-msg-memory-store.ts +22 -21
- package/src/store/fix-msg-store-record.ts +8 -8
- package/src/store/fix-msg-store-state.ts +2 -2
- package/src/store/fix-msg-store.ts +7 -7
- package/src/transport/ascii/ascii-msg-transmitter.ts +20 -14
- package/src/transport/ascii/ascii-session-msg-factory.ts +5 -6
- package/src/transport/ascii/ascii-session.ts +40 -29
- package/src/transport/duplex/http-duplex.ts +11 -9
- package/src/transport/duplex/string-duplex.ts +4 -5
- package/src/transport/factory/msg-transport.ts +5 -6
- package/src/transport/fix-acceptor.ts +2 -2
- package/src/transport/fix-entity.ts +1 -1
- package/src/transport/fix-initiator.ts +1 -1
- package/src/transport/fixml/fixml-msg-transmitter.ts +4 -3
- package/src/transport/fixml/fixml-session-msg-factory.ts +1 -2
- package/src/transport/fixml/fixml-session.ts +7 -6
- package/src/transport/http/html-options.ts +5 -5
- package/src/transport/http/html-route.ts +1 -1
- package/src/transport/http/http-acceptor-listener.ts +6 -4
- package/src/transport/http/http-acceptor.ts +36 -34
- package/src/transport/http/http-adapter.ts +3 -3
- package/src/transport/http/http-initiator.ts +22 -16
- package/src/transport/http/http-json-sample-adapter.ts +17 -16
- package/src/transport/http/http-transaction.ts +1 -1
- package/src/transport/http/http-transport-description.ts +1 -1
- package/src/transport/msg-application.ts +4 -4
- package/src/transport/msg-transmitter.ts +5 -5
- package/src/transport/session/a-session-msg-factory.ts +2 -3
- package/src/transport/session/fix-session-state.ts +24 -18
- package/src/transport/session/fix-session.ts +169 -96
- package/src/transport/session/make-fix-session.ts +1 -2
- package/src/transport/session/session-description.ts +2 -2
- package/src/transport/session/session-msg-factory.ts +9 -9
- package/src/transport/tcp/recovering-tcp-initiator.ts +39 -21
- package/src/transport/tcp/tcp-acceptor-listener.ts +4 -3
- package/src/transport/tcp/tcp-acceptor.ts +23 -22
- package/src/transport/tcp/tcp-initiator-connector.ts +16 -10
- package/src/transport/tcp/tcp-initiator.ts +57 -46
- package/src/transport/tcp/tcp-transport-description.ts +1 -1
- package/src/transport/tcp/tls-options-factory.ts +21 -8
- package/src/transport/tcp/tls-options.ts +11 -7
- package/src/util/json-helper.ts +6 -5
- package/src/util/message-generator.ts +6 -7
- package/tsconfig.json +2 -0
- package/.eslintrc.js +0 -6
- package/dist/buffer/ascii-chars.d.ts +0 -22
- package/dist/buffer/ascii-chars.js +0 -29
- package/dist/buffer/ascii-chars.js.map +0 -1
- package/dist/buffer/segment-description.d.ts +0 -33
- package/dist/buffer/segment-description.js +0 -80
- package/dist/buffer/segment-description.js.map +0 -1
- package/dist/buffer/segment-summary.d.ts +0 -13
- package/dist/buffer/segment-summary.js +0 -20
- package/dist/buffer/segment-summary.js.map +0 -1
- package/dist/buffer/tag-pos.d.ts +0 -12
- package/dist/buffer/tag-pos.js +0 -55
- package/dist/buffer/tag-pos.js.map +0 -1
- package/dist/buffer/tags.d.ts +0 -32
- package/dist/buffer/tags.js +0 -135
- package/dist/buffer/tags.js.map +0 -1
- package/dist/dictionary/fields-dispatch.d.ts +0 -13
- 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/test/ascii-encoder.test.d.ts +0 -1
- package/dist/test/ascii-encoder.test.js +0 -529
- 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 +0 -142
- 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 +0 -107
- package/dist/test/ascii-segment.test.js.map +0 -1
- package/dist/test/ascii-store-replay.test.d.ts +0 -1
- package/dist/test/ascii-store-replay.test.js +0 -121
- 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 +0 -105
- 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 +0 -490
- 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 +0 -45
- 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 +0 -127
- 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 +0 -160
- 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 +0 -60
- 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 +0 -33
- 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 +0 -96
- 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 +0 -42
- package/dist/test/includes.test.js.map +0 -1
- package/dist/test/logon.test.d.ts +0 -1
- package/dist/test/logon.test.js +0 -93
- 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 +0 -75
- 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 +0 -76
- 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 +0 -82
- 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 +0 -136
- 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 +0 -74
- 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 +0 -412
- 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 +0 -78
- package/dist/test/time-formatter.test.js.map +0 -1
- package/dist/test/to-views.d.ts +0 -11
- package/dist/test/to-views.js +0 -55
- 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 +0 -208
- package/dist/test/view-decode.test.js.map +0 -1
- package/dist/transport/a-session-msg-factory.d.ts +0 -23
- package/dist/transport/a-session-msg-factory.js +0 -58
- 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.d.ts +0 -15
- package/dist/transport/fix-msg-factory.js +0 -3
- package/dist/transport/fix-msg-factory.js.map +0 -1
- package/dist/transport/fix-session-state-args.d.ts +0 -8
- package/dist/transport/fix-session-state-args.js +0 -3
- package/dist/transport/fix-session-state-args.js.map +0 -1
- package/dist/transport/fix-session-state.d.ts +0 -32
- package/dist/transport/fix-session-state.js +0 -133
- package/dist/transport/fix-session-state.js.map +0 -1
- package/dist/transport/fix-session.d.ts +0 -50
- package/dist/transport/fix-session.js +0 -290
- 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-fix-session.d.ts +0 -5
- package/dist/transport/make-fix-session.js +0 -3
- package/dist/transport/make-fix-session.js.map +0 -1
- package/dist/transport/make-fixl-session.d.ts +0 -5
- package/dist/transport/make-fixl-session.js +0 -3
- package/dist/transport/make-fixl-session.js.map +0 -1
- package/dist/transport/msg-transport.d.ts +0 -14
- 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 +0 -3
- package/dist/transport/session-description.js.map +0 -1
- package/dist/transport/session-msg-factory.d.ts +0 -6
- package/dist/transport/session-msg-factory.js +0 -13
- package/dist/transport/session-msg-factory.js.map +0 -1
- package/dist/transport/session-state.d.ts +0 -25
- package/dist/transport/session-state.js +0 -30
- package/dist/transport/session-state.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/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/tslint.json +0 -3
|
@@ -6,7 +6,6 @@ import { FixSession } from '../session/fix-session'
|
|
|
6
6
|
import { SessionState } from '../session/session-state'
|
|
7
7
|
|
|
8
8
|
export abstract class FixmlSession extends FixSession {
|
|
9
|
-
|
|
10
9
|
protected constructor (public readonly config: IJsFixConfig) {
|
|
11
10
|
super(config)
|
|
12
11
|
this.requestLogoutType = 'UserReq'
|
|
@@ -15,7 +14,6 @@ export abstract class FixmlSession extends FixSession {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
protected onMsg (msgType: string, view: MsgView): void {
|
|
18
|
-
|
|
19
17
|
switch (msgType) {
|
|
20
18
|
case 'UserReq':
|
|
21
19
|
case 'UserRsp': {
|
|
@@ -66,16 +64,19 @@ export abstract class FixmlSession extends FixSession {
|
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
private peerLogon (view: MsgView) {
|
|
67
|
+
private peerLogon (view: MsgView): void {
|
|
70
68
|
const logger = this.sessionLogger
|
|
71
69
|
const state = this.sessionState
|
|
72
70
|
state.state = SessionState.InitiationLogonReceived
|
|
73
71
|
state.peerCompId = view.getTyped(MsgTag.SenderCompID)
|
|
74
72
|
if (this.acceptor) {
|
|
75
|
-
const reqId: string = view.getString('UserReqID')
|
|
76
|
-
|
|
73
|
+
const reqId: string = view.getString('UserReqID') ?? 'req'
|
|
74
|
+
const o = this?.config?.factory?.logon(reqId, true)
|
|
75
|
+
if (o) {
|
|
76
|
+
this.send('UserRsp', o)
|
|
77
|
+
}
|
|
77
78
|
}
|
|
78
|
-
logger.info(
|
|
79
|
+
logger.info('system ready, inform app')
|
|
79
80
|
this.onReady(view)
|
|
80
81
|
}
|
|
81
82
|
}
|
|
@@ -12,8 +12,9 @@ export class HttpAcceptorListener extends FixEntity {
|
|
|
12
12
|
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {
|
|
13
13
|
super(config)
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
async start (): Promise<any> {
|
|
17
|
+
return new Promise<any>(async (resolve, reject) => {
|
|
17
18
|
const logger = this.config.logFactory.logger('acceptor')
|
|
18
19
|
const sessionContainer = this.config.sessionContainer
|
|
19
20
|
if (!sessionContainer.isRegistered(DITokens.FixSession)) {
|
|
@@ -24,15 +25,16 @@ export class HttpAcceptorListener extends FixEntity {
|
|
|
24
25
|
acceptor.on('transport', (t: MsgTransport) => {
|
|
25
26
|
logger.info(`creates new transport using DI token ${DITokens.FixSession}.`)
|
|
26
27
|
const acceptorSession = sessionContainer.resolve<FixSession>(DITokens.FixSession)
|
|
28
|
+
this.emit('session', acceptorSession, t)
|
|
27
29
|
acceptorSession.run(t).then(() => {
|
|
28
30
|
logger.info('ends')
|
|
29
31
|
acceptor.close(() => {
|
|
30
32
|
logger.info('acceptor closed.')
|
|
31
|
-
|
|
33
|
+
resolve(true)
|
|
32
34
|
})
|
|
33
35
|
}).catch((e: Error) => {
|
|
34
36
|
logger.error(e)
|
|
35
|
-
logger.info(e
|
|
37
|
+
logger.info(e?.stack ?? '')
|
|
36
38
|
reject(e)
|
|
37
39
|
})
|
|
38
40
|
})
|
|
@@ -14,16 +14,16 @@ import { DITokens } from '../../runtime/di-tokens'
|
|
|
14
14
|
|
|
15
15
|
@injectable()
|
|
16
16
|
export class HttpAcceptor extends FixAcceptor {
|
|
17
|
-
private app: express.Express = express()
|
|
17
|
+
private readonly app: express.Express = express()
|
|
18
18
|
private server: http.Server
|
|
19
19
|
private readonly logger: IJsFixLogger
|
|
20
20
|
private readonly router: express.Router
|
|
21
21
|
private nextId: number = 0
|
|
22
|
-
private keys: Dictionary<MsgTransport> = new Dictionary()
|
|
22
|
+
private readonly keys: Dictionary<MsgTransport> = new Dictionary()
|
|
23
23
|
|
|
24
24
|
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {
|
|
25
|
-
super(config
|
|
26
|
-
this.logger = config.logFactory.logger(`${config
|
|
25
|
+
super(config?.description?.application ?? null)
|
|
26
|
+
this.logger = config.logFactory.logger(`${config?.description?.application?.name}:HttpAcceptor`)
|
|
27
27
|
this.logger.info('creating http server')
|
|
28
28
|
this.router = express.Router()
|
|
29
29
|
this.router.use(bodyParser.json())
|
|
@@ -33,21 +33,21 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
33
33
|
|
|
34
34
|
public listen (): void {
|
|
35
35
|
const app = this.config.description.application
|
|
36
|
-
const port = app
|
|
36
|
+
const port = app?.http?.port ?? 0
|
|
37
37
|
const logger = this.logger
|
|
38
38
|
logger.info(`start to listen ${port}`)
|
|
39
39
|
this.server = this.app.listen(port, () => {
|
|
40
|
-
logger.info(`app listening at http://localhost:${port}${app
|
|
40
|
+
logger.info(`app listening at http://localhost:${port}${app?.http?.uri}`)
|
|
41
41
|
})
|
|
42
|
-
this.server.on('error', (
|
|
42
|
+
this.server.on('error', (err: Error) => {
|
|
43
43
|
logger.error(err)
|
|
44
44
|
this.emit('error', err)
|
|
45
|
-
})
|
|
45
|
+
})
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
public close (callback?: (err?: Error) => void): void {
|
|
49
49
|
const app = this.config.description.application
|
|
50
|
-
const port = app
|
|
50
|
+
const port = app?.http?.port
|
|
51
51
|
this.logger.info(`close listener on port ${port}`)
|
|
52
52
|
this.server.close(callback)
|
|
53
53
|
}
|
|
@@ -69,36 +69,36 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
69
69
|
this.logger.info(`transport ${tid} ends total transports = ${keys.length}`)
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
private respond (duplex: FixDuplex,
|
|
73
|
-
return new Promise<any>((
|
|
74
|
-
|
|
72
|
+
private async respond (duplex: FixDuplex, response: express.Response, token: string | null = null): Promise<any> {
|
|
73
|
+
return new Promise<any>((resolve, reject) => {
|
|
74
|
+
response.setHeader('Content-Type', 'application/json')
|
|
75
75
|
const timer = setTimeout(() => {
|
|
76
|
-
const businessReject =
|
|
76
|
+
const businessReject = '<FIXML><BizMsgRej BizRejRsn="4" Txt="no response from application"/></FIXML>'
|
|
77
77
|
const b = Buffer.from(businessReject, 'utf-8')
|
|
78
78
|
duplex.writable.removeListener('data', transmit)
|
|
79
|
-
|
|
79
|
+
response.send(b)
|
|
80
80
|
reject(new Error('no response'))
|
|
81
81
|
}, 5000)
|
|
82
82
|
|
|
83
|
-
const transmit = (d: Buffer) => {
|
|
83
|
+
const transmit = (d: Buffer): void => {
|
|
84
84
|
this.logger.info('responding to request')
|
|
85
85
|
clearTimeout(timer)
|
|
86
86
|
if (token) {
|
|
87
|
-
|
|
87
|
+
response.setHeader('authorization', token)
|
|
88
88
|
}
|
|
89
89
|
duplex.writable.removeListener('data', transmit)
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
response.send(d)
|
|
91
|
+
resolve(true)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
duplex.writable.on('data', transmit)
|
|
95
95
|
})
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
private async logon (req: express.Request, res: express.Response) {
|
|
98
|
+
private async logon (req: express.Request, res: express.Response): Promise<void> {
|
|
99
99
|
const body: IFixmlRequest = req.body
|
|
100
100
|
const id = this.nextId++
|
|
101
|
-
this.logger.info(JSON.stringify(body, null,4))
|
|
101
|
+
this.logger.info(JSON.stringify(body, null, 4))
|
|
102
102
|
// check hand back session key
|
|
103
103
|
const d = new StringDuplex()
|
|
104
104
|
const transport = new MsgTransport(id, this.config, d)
|
|
@@ -111,28 +111,30 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
111
111
|
d.readable.push(body.fixml)
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
private async logout (req: express.Request, res: express.Response) {
|
|
114
|
+
private async logout (req: express.Request, res: express.Response): Promise<void> {
|
|
115
115
|
const headers = req.headers
|
|
116
116
|
const body: IFixmlRequest = req.body
|
|
117
|
-
const t: MsgTransport = this.keys.get(headers
|
|
117
|
+
const t: MsgTransport | null = this.keys.get(headers?.authorization ?? '')
|
|
118
118
|
if (t) {
|
|
119
119
|
const token = req.headers.authorization
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
if (token) {
|
|
121
|
+
this.harvestTransport(token, t.id)
|
|
122
|
+
const d = t.duplex
|
|
123
|
+
this.respond(d, res, token).then(() => {
|
|
124
|
+
this.logger.info('responded to logout')
|
|
125
|
+
t.end()
|
|
126
|
+
}).catch((e: Error) => {
|
|
127
|
+
this.logger.error(e)
|
|
128
|
+
})
|
|
129
|
+
d.readable.push(body.fixml)
|
|
130
|
+
}
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
private subscribe (): void {
|
|
133
135
|
const router = this.router
|
|
134
136
|
const app = this.config.description.application
|
|
135
|
-
const root = app
|
|
137
|
+
const root = app?.http?.uri
|
|
136
138
|
const authorise = `${root}authorise`
|
|
137
139
|
const query = `${root}query`
|
|
138
140
|
this.logger.info(`uri: authorise ${authorise}, query ${query}`)
|
|
@@ -149,9 +151,9 @@ export class HttpAcceptor extends FixAcceptor {
|
|
|
149
151
|
router.get(query, async (req: express.Request, res: express.Response) => {
|
|
150
152
|
const headers = req.headers
|
|
151
153
|
const body: IFixmlRequest = req.body
|
|
152
|
-
const t: MsgTransport = this.keys.get(headers.authorization)
|
|
154
|
+
const t: MsgTransport | null = this.keys.get(headers.authorization ?? '') ?? null
|
|
153
155
|
if (!t) {
|
|
154
|
-
this.logger.info(
|
|
156
|
+
this.logger.info('received request with no token')
|
|
155
157
|
res.send({
|
|
156
158
|
error: 'no key with query'
|
|
157
159
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IHtmlOptions } from './html-options'
|
|
2
2
|
|
|
3
3
|
export interface IHttpAdapter {
|
|
4
|
-
getOptions (data: Buffer)
|
|
5
|
-
beginMessage (msgType: string)
|
|
6
|
-
endMessage (m: any)
|
|
4
|
+
getOptions: (data: Buffer) => IHtmlOptions | null
|
|
5
|
+
beginMessage: (msgType: string) => void
|
|
6
|
+
endMessage: (m: any) => Buffer
|
|
7
7
|
}
|
|
@@ -14,16 +14,16 @@ export class HttpInitiator extends FixEntity {
|
|
|
14
14
|
this.logger = config.logFactory.logger('initiator')
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
start (): Promise<any> {
|
|
18
|
-
return this.connect(this.config)
|
|
17
|
+
async start (): Promise<any> {
|
|
18
|
+
return await this.connect(this.config)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
// the adapter will be provided on config
|
|
22
|
-
connect (config: IJsFixConfig): Promise<any> {
|
|
23
|
-
return new Promise<any>(async (
|
|
24
|
-
const adapter = config
|
|
21
|
+
// the adapter will be provided on config
|
|
22
|
+
async connect (config: IJsFixConfig): Promise<any> {
|
|
23
|
+
return await new Promise<any>(async (resolve, reject) => {
|
|
24
|
+
const adapter = config?.description?.application?.http?.adapter
|
|
25
25
|
if (!adapter) {
|
|
26
|
-
reject('http initiator needs config.description.application.http.adapter')
|
|
26
|
+
reject(new Error('http initiator needs config.description.application.http.adapter'))
|
|
27
27
|
}
|
|
28
28
|
const sessionContainer = this.config.sessionContainer
|
|
29
29
|
if (!sessionContainer.isRegistered(DITokens.FixSession)) {
|
|
@@ -32,15 +32,21 @@ export class HttpInitiator extends FixEntity {
|
|
|
32
32
|
this.logger.info(`create session with DI Token ${DITokens.FixSession}`)
|
|
33
33
|
const initiatorSession = sessionContainer.resolve<FixSession>(DITokens.FixSession)
|
|
34
34
|
this.logger.info('connecting ...')
|
|
35
|
-
const initiatorTransport: MsgTransport
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
this.logger.
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
const initiatorTransport: MsgTransport | null = adapter
|
|
36
|
+
? new MsgTransport(0, config, new HttpDuplex(adapter))
|
|
37
|
+
: null
|
|
38
|
+
if (!initiatorTransport) {
|
|
39
|
+
reject(new Error('no initiatorTransport for http'))
|
|
40
|
+
} else {
|
|
41
|
+
this.logger.info('... connected, run session')
|
|
42
|
+
initiatorSession.run(initiatorTransport).then(() => {
|
|
43
|
+
this.logger.info('ends')
|
|
44
|
+
resolve(true)
|
|
45
|
+
}).catch((e: Error) => {
|
|
46
|
+
this.logger.error(e)
|
|
47
|
+
reject(e)
|
|
48
|
+
})
|
|
49
|
+
}
|
|
44
50
|
})
|
|
45
51
|
}
|
|
46
52
|
}
|
|
@@ -9,14 +9,14 @@ import { DITokens } from '../../runtime/di-tokens'
|
|
|
9
9
|
|
|
10
10
|
@injectable()
|
|
11
11
|
export class HttpJsonSampleAdapter implements IHttpAdapter {
|
|
12
|
-
private logger: IJsFixLogger
|
|
13
|
-
private queue: HttpTransaction[] = []
|
|
14
|
-
private token: string = null
|
|
15
|
-
private routes: Dictionary<IHtmlRoute> = new Dictionary()
|
|
12
|
+
private readonly logger: IJsFixLogger
|
|
13
|
+
private readonly queue: HttpTransaction[] = []
|
|
14
|
+
private token: string | null = null
|
|
15
|
+
private readonly routes: Dictionary<IHtmlRoute> = new Dictionary()
|
|
16
16
|
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {
|
|
17
17
|
this.logger = config.logFactory.logger('http.adapter')
|
|
18
18
|
const routes = this.routes
|
|
19
|
-
const options = config
|
|
19
|
+
const options = config?.description?.application?.http?.options
|
|
20
20
|
if (!options) {
|
|
21
21
|
return
|
|
22
22
|
}
|
|
@@ -26,17 +26,18 @@ export class HttpJsonSampleAdapter implements IHttpAdapter {
|
|
|
26
26
|
this.logger.info(`instance created routes ${routes.count()}`)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
public getOptions (data: Buffer): IHtmlOptions {
|
|
29
|
+
public getOptions (data: Buffer): IHtmlOptions | null {
|
|
30
30
|
const q = this.queue
|
|
31
31
|
if (q.length === 0) {
|
|
32
32
|
return null
|
|
33
33
|
}
|
|
34
|
-
const next: HttpTransaction = q.shift()
|
|
34
|
+
const next: HttpTransaction | null = q.shift() ?? null
|
|
35
|
+
if (next == null) return null
|
|
35
36
|
const options = next.options
|
|
36
|
-
options.
|
|
37
|
+
options.data = {
|
|
37
38
|
fixml: data.toString()
|
|
38
39
|
}
|
|
39
|
-
this.logger.info(`${next.msgType}: ${next.options.method} ${next.options.
|
|
40
|
+
this.logger.info(`${next.msgType}: ${next.options.method} ${next.options.url} ${data.length}`)
|
|
40
41
|
return options
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -47,19 +48,19 @@ export class HttpJsonSampleAdapter implements IHttpAdapter {
|
|
|
47
48
|
this.token = headers.authorization
|
|
48
49
|
this.logger.info(`receive token ${this.token}`)
|
|
49
50
|
}
|
|
50
|
-
return m.
|
|
51
|
+
return m.data
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
beginMessage (msgType: string): void {
|
|
54
55
|
// build options based on type
|
|
55
56
|
const routes = this.routes
|
|
56
|
-
const route = routes.get(msgType)
|
|
57
|
+
const route = routes.get(msgType) ?? routes.get('default')
|
|
57
58
|
const options = {
|
|
58
|
-
method: route
|
|
59
|
-
|
|
60
|
-
json: route
|
|
61
|
-
resolveWithFullResponse: route
|
|
62
|
-
headers: route
|
|
59
|
+
method: route?.value.method,
|
|
60
|
+
url: route?.value.url,
|
|
61
|
+
json: route?.value.json,
|
|
62
|
+
resolveWithFullResponse: route?.value.resolveWithFullResponse,
|
|
63
|
+
headers: route?.value.headers
|
|
63
64
|
} as IHtmlOptions
|
|
64
65
|
const headers = options.headers
|
|
65
66
|
if (headers) {
|
|
@@ -3,11 +3,11 @@ import { IHttpTransportDescription } from './http/http-transport-description'
|
|
|
3
3
|
|
|
4
4
|
export interface IMsgApplication {
|
|
5
5
|
readonly name: string
|
|
6
|
-
readonly type: string
|
|
6
|
+
readonly type: string
|
|
7
7
|
readonly resilient: boolean
|
|
8
8
|
readonly reconnectSeconds: number
|
|
9
|
-
readonly tcp?: ITcpTransportDescription
|
|
10
|
-
readonly http?: IHttpTransportDescription
|
|
11
|
-
readonly protocol: string
|
|
9
|
+
readonly tcp?: ITcpTransportDescription
|
|
10
|
+
readonly http?: IHttpTransportDescription
|
|
11
|
+
readonly protocol: string
|
|
12
12
|
readonly dictionary: string
|
|
13
13
|
}
|
|
@@ -11,8 +11,8 @@ export abstract class MsgTransmitter extends events.EventEmitter {
|
|
|
11
11
|
public encoder: MsgEncoder
|
|
12
12
|
|
|
13
13
|
protected constructor (public readonly buffer: ElasticBuffer,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
public readonly definitions: FixDefinitions,
|
|
15
|
+
public readonly session: ISessionDescription) {
|
|
16
16
|
super()
|
|
17
17
|
this.encodeStream = this.encoderStream()
|
|
18
18
|
this.encodeStream.on('error', (e: Error) => {
|
|
@@ -28,7 +28,7 @@ export abstract class MsgTransmitter extends events.EventEmitter {
|
|
|
28
28
|
this.encodeStream.write(new MsgPayload(msgType, obj))
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
public abstract encodeMessage (msgType: string, obj: ILooseObject):
|
|
31
|
+
public abstract encodeMessage (msgType: string, obj: ILooseObject): any
|
|
32
32
|
|
|
33
33
|
// read fix messages from one side, encode buffers on other ready to pipe
|
|
34
34
|
// to output stream, say a socket
|
|
@@ -41,11 +41,11 @@ export abstract class MsgTransmitter extends events.EventEmitter {
|
|
|
41
41
|
try {
|
|
42
42
|
const msgType = payload.msgType
|
|
43
43
|
transmitter.encoder.reset()
|
|
44
|
-
transmitter.encodeMessage(msgType, payload.obj)
|
|
44
|
+
const state = transmitter.encodeMessage(msgType, payload.obj)
|
|
45
45
|
payload.encoded = transmitter.encoder.trim()
|
|
46
46
|
this.push(payload.encoded)
|
|
47
47
|
const encodedTxt = transmitter.buffer.toString()
|
|
48
|
-
transmitter.emit('encoded', msgType, encodedTxt)
|
|
48
|
+
transmitter.emit('encoded', msgType, encodedTxt, state)
|
|
49
49
|
done()
|
|
50
50
|
} catch (e) {
|
|
51
51
|
done(e)
|
|
@@ -13,12 +13,11 @@ import {
|
|
|
13
13
|
ITestRequest
|
|
14
14
|
} from '../../types/FIX4.4/repo'
|
|
15
15
|
|
|
16
|
-
export
|
|
17
|
-
}
|
|
16
|
+
export type ObjectMutator = (description: ISessionDescription, type: string, o: ILooseObject) => ILooseObject
|
|
18
17
|
|
|
19
18
|
export abstract class ASessionMsgFactory implements ISessionMsgFactory {
|
|
20
19
|
public isAscii: boolean
|
|
21
|
-
constructor (public readonly description: ISessionDescription, public mutator: ObjectMutator = null) {
|
|
20
|
+
protected constructor (public readonly description: ISessionDescription, public mutator: ObjectMutator | null = null) {
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
public reject (msgType: string, seqNo: number, msg: string, reason: number): ILooseObject {
|
|
@@ -3,14 +3,15 @@ import moment = require('moment')
|
|
|
3
3
|
import { TickAction } from '../tick-action'
|
|
4
4
|
import { IFixSessionStateArgs } from './fix-session-state-args'
|
|
5
5
|
import { SessionState } from './session-state'
|
|
6
|
+
import { ILooseObject } from '../../collections/collection'
|
|
6
7
|
|
|
7
8
|
export class FixSessionState {
|
|
8
9
|
public nextTickAction: TickAction = TickAction.Nothing
|
|
9
10
|
|
|
10
|
-
public lastReceivedAt: Date = null
|
|
11
|
-
public LastSentAt: Date = null
|
|
12
|
-
public lastTestRequestAt: Date = null
|
|
13
|
-
public logoutSentAt: Date = null
|
|
11
|
+
public lastReceivedAt: Date | null = null
|
|
12
|
+
public LastSentAt: Date | null = null
|
|
13
|
+
public lastTestRequestAt: Date | null = null
|
|
14
|
+
public logoutSentAt: Date | null = null
|
|
14
15
|
public now: Date = new Date()
|
|
15
16
|
public compId: string = ''
|
|
16
17
|
public peerCompId: string = ''
|
|
@@ -24,8 +25,9 @@ export class FixSessionState {
|
|
|
24
25
|
private secondsSinceLogoutSent: number = -1
|
|
25
26
|
private secondsSinceSent: number = -1
|
|
26
27
|
private secondsSinceReceive: number = -1
|
|
28
|
+
public lastHeader: ILooseObject | null = null
|
|
27
29
|
|
|
28
|
-
public reset (
|
|
30
|
+
public reset (lastPeerMsgSeqNum: number = 0): void {
|
|
29
31
|
this.lastReceivedAt = null
|
|
30
32
|
this.LastSentAt = null
|
|
31
33
|
this.lastTestRequestAt = null
|
|
@@ -35,16 +37,17 @@ export class FixSessionState {
|
|
|
35
37
|
this.peerHeartBeatSecs = 0
|
|
36
38
|
this.logoutSentAt = null
|
|
37
39
|
this.nextTickAction = TickAction.Nothing
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
40
|
+
this.lastPeerMsgSeqNum = lastPeerMsgSeqNum
|
|
41
|
+
this.lastHeader = null
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
public constructor ({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
public constructor ({
|
|
45
|
+
heartBeat,
|
|
46
|
+
state = SessionState.Idle,
|
|
47
|
+
waitLogoutConfirmSeconds = 5,
|
|
48
|
+
stopSeconds = 2,
|
|
49
|
+
lastPeerMsgSeqNum = 0
|
|
50
|
+
}: IFixSessionStateArgs) {
|
|
48
51
|
this.heartBeat = heartBeat
|
|
49
52
|
this.state = state
|
|
50
53
|
this.waitLogoutConfirmSeconds = waitLogoutConfirmSeconds
|
|
@@ -52,15 +55,18 @@ export class FixSessionState {
|
|
|
52
55
|
this.lastPeerMsgSeqNum = lastPeerMsgSeqNum
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
private static dateAsString (d: Date) {
|
|
58
|
+
private static dateAsString (d: Date | null): string {
|
|
56
59
|
if (!d) {
|
|
57
60
|
return 'null'
|
|
58
61
|
}
|
|
59
62
|
return moment(d).format('HH:mm:ss.SSS')
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
public
|
|
65
|
+
public lastSentSeqNum (): number {
|
|
66
|
+
return this?.lastHeader?.MsgSeqNum ?? 0
|
|
67
|
+
}
|
|
63
68
|
|
|
69
|
+
public toString (): string {
|
|
64
70
|
const buffer = new ElasticBuffer(1024)
|
|
65
71
|
|
|
66
72
|
buffer.writeString(`compId = ${this.compId}, `)
|
|
@@ -79,6 +85,7 @@ export class FixSessionState {
|
|
|
79
85
|
buffer.writeString(`peerHeartBeatSecs = ${this.peerHeartBeatSecs}, `)
|
|
80
86
|
buffer.writeString(`peerCompId = ${this.peerCompId}, `)
|
|
81
87
|
buffer.writeString(`lastPeerMsgSeqNum = ${this.lastPeerMsgSeqNum}, `)
|
|
88
|
+
buffer.writeString(`LastSentSeqNum = ${this.lastSentSeqNum()}, `)
|
|
82
89
|
buffer.writeString(`secondsSinceLogoutSent = ${this.secondsSinceLogoutSent}, `)
|
|
83
90
|
buffer.writeString(`secondsSinceSent = ${this.secondsSinceSent}, `)
|
|
84
91
|
buffer.writeString(`secondsSinceReceive = ${this.secondsSinceReceive}`)
|
|
@@ -91,7 +98,6 @@ export class FixSessionState {
|
|
|
91
98
|
this.calcState()
|
|
92
99
|
|
|
93
100
|
switch (this.state) {
|
|
94
|
-
|
|
95
101
|
case SessionState.PeerLogonRejected: {
|
|
96
102
|
if (this.secondsSinceSent >= this.stopSeconds) {
|
|
97
103
|
this.nextTickAction = TickAction.Stop
|
|
@@ -154,7 +160,7 @@ export class FixSessionState {
|
|
|
154
160
|
const time = this.now.getTime()
|
|
155
161
|
this.nextTickAction = TickAction.Nothing
|
|
156
162
|
this.secondsSinceLogoutSent = this.logoutSentAt ? (time - this.logoutSentAt.getTime()) / 1000 : -1
|
|
157
|
-
this.secondsSinceSent = (time - this.LastSentAt.getTime()) / 1000
|
|
158
|
-
this.secondsSinceReceive = (time - this.lastReceivedAt.getTime()) / 1000
|
|
163
|
+
this.secondsSinceSent = this.LastSentAt != null ? (time - this.LastSentAt.getTime()) / 1000 : 0
|
|
164
|
+
this.secondsSinceReceive = this.lastReceivedAt != null ? (time - this.lastReceivedAt.getTime()) / 1000 : 0
|
|
159
165
|
}
|
|
160
166
|
}
|