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
|
@@ -11,21 +11,21 @@ import { DITokens } from '../../runtime/di-tokens'
|
|
|
11
11
|
@injectable()
|
|
12
12
|
export class TcpAcceptor extends FixAcceptor {
|
|
13
13
|
private server: Server
|
|
14
|
-
private logger: IJsFixLogger
|
|
14
|
+
private readonly logger: IJsFixLogger
|
|
15
15
|
private nextId: number = 0
|
|
16
16
|
|
|
17
17
|
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {
|
|
18
|
-
super(config.description.application)
|
|
19
|
-
this.logger = config.logFactory.logger(`${config.description.application
|
|
20
|
-
const tlsOptions: TlsOptions = this.tlsOptions()
|
|
18
|
+
super(config.description.application ?? null)
|
|
19
|
+
this.logger = config.logFactory.logger(`${config.description.application?.name}:TcpAcceptor`)
|
|
20
|
+
const tlsOptions: TlsOptions | null = this.tlsOptions()
|
|
21
21
|
if (tlsOptions) {
|
|
22
22
|
this.tlsServer()
|
|
23
23
|
} else {
|
|
24
24
|
this.unsecureServer()
|
|
25
25
|
}
|
|
26
|
-
this.server.on('error', (
|
|
26
|
+
this.server.on('error', (err: Error) => {
|
|
27
27
|
throw err
|
|
28
|
-
})
|
|
28
|
+
})
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
getId (): number {
|
|
@@ -36,12 +36,13 @@ export class TcpAcceptor extends FixAcceptor {
|
|
|
36
36
|
tlsServer (): void {
|
|
37
37
|
try {
|
|
38
38
|
const config: IJsFixConfig = this.config
|
|
39
|
-
const tcp = this.config.description.application
|
|
40
|
-
const tlsOptions: TlsOptions = TlsOptionsFactory.getTlsOptions(tcp.tls)
|
|
41
|
-
this.logger.info(
|
|
39
|
+
const tcp = this.config.description.application?.tcp
|
|
40
|
+
const tlsOptions: TlsOptions | null = tcp?.tls ? TlsOptionsFactory.getTlsOptions(tcp.tls) : null
|
|
41
|
+
this.logger.info('create tls server')
|
|
42
|
+
if (!tlsOptions) return
|
|
42
43
|
this.server = tlsCreateServer(tlsOptions, (tlsSocket: TLSSocket) => {
|
|
43
|
-
if (tcp
|
|
44
|
-
this.logger.info(
|
|
44
|
+
if (tcp?.tls?.enableTrace) {
|
|
45
|
+
this.logger.info('enabling tls session trace')
|
|
45
46
|
tlsSocket.enableTrace()
|
|
46
47
|
}
|
|
47
48
|
if (tlsSocket.authorized) {
|
|
@@ -50,7 +51,7 @@ export class TcpAcceptor extends FixAcceptor {
|
|
|
50
51
|
this.logger.info(`tls creates session ${id} ${tlsSocket.authorized}`)
|
|
51
52
|
this.onSocket(id, tlsSocket, config)
|
|
52
53
|
} else {
|
|
53
|
-
this.logger.info(
|
|
54
|
+
this.logger.info('no transport created on tls with no authorized connection')
|
|
54
55
|
}
|
|
55
56
|
})
|
|
56
57
|
} catch (e) {
|
|
@@ -59,10 +60,10 @@ export class TcpAcceptor extends FixAcceptor {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
unsecureServer () {
|
|
63
|
+
unsecureServer (): void {
|
|
63
64
|
try {
|
|
64
65
|
const config = this.config
|
|
65
|
-
this.logger.info(
|
|
66
|
+
this.logger.info('create unsecured server')
|
|
66
67
|
this.server = netCreateServer((socket: Socket) => {
|
|
67
68
|
const id: number = this.getId()
|
|
68
69
|
this.logger.info(`net creates session ${id}`)
|
|
@@ -75,12 +76,12 @@ export class TcpAcceptor extends FixAcceptor {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
tlsOptions (): TlsOptions {
|
|
79
|
-
const tcp = this.config.description.application
|
|
80
|
-
return TlsOptionsFactory.getTlsOptions(tcp
|
|
79
|
+
tlsOptions (): TlsOptions | null {
|
|
80
|
+
const tcp = this.config.description.application?.tcp
|
|
81
|
+
return tcp?.tls ? TlsOptionsFactory.getTlsOptions(tcp?.tls) : null
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
private onSocket (id: number, socket: Socket, config: IJsFixConfig) {
|
|
84
|
+
private onSocket (id: number, socket: Socket, config: IJsFixConfig): void {
|
|
84
85
|
const transport: MsgTransport = new MsgTransport(id, config, new TcpDuplex(socket))
|
|
85
86
|
this.saveTransport(id, transport)
|
|
86
87
|
transport.receiver.on('end', () => {
|
|
@@ -93,7 +94,7 @@ export class TcpAcceptor extends FixAcceptor {
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
public listen (): void {
|
|
96
|
-
const port = this.config.description.application
|
|
97
|
+
const port = this.config.description.application?.tcp?.port
|
|
97
98
|
this.logger.info(`start to listen ${port}`)
|
|
98
99
|
this.server.on('connection', () => {
|
|
99
100
|
this.logger.info('insecure connection established')
|
|
@@ -105,19 +106,19 @@ export class TcpAcceptor extends FixAcceptor {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
public close (callback?: (err?: Error) => void): void {
|
|
108
|
-
const port = this.config.description.application
|
|
109
|
+
const port = this.config.description.application?.tcp?.port ?? -1
|
|
109
110
|
this.logger.info(`close listener on port ${port}`)
|
|
110
111
|
this.server.close(callback)
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
private saveTransport (tid: number, transport: MsgTransport) {
|
|
114
|
+
private saveTransport (tid: number, transport: MsgTransport): void {
|
|
114
115
|
this.transports[tid] = transport
|
|
115
116
|
const keys: string[] = Object.keys(this.transports)
|
|
116
117
|
this.logger.info(`new transport id = ${tid} created total transports = ${keys.length}`)
|
|
117
118
|
this.emit('transport', transport)
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
private harvestTransport (tid: number) {
|
|
121
|
+
private harvestTransport (tid: number): void {
|
|
121
122
|
delete this.transports[tid]
|
|
122
123
|
const keys: string[] = Object.keys(this.transports)
|
|
123
124
|
this.logger.info(`transport ${tid} ends total transports = ${keys.length}`)
|
|
@@ -12,8 +12,10 @@ export class TcpInitiatorConnector extends FixEntity {
|
|
|
12
12
|
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {
|
|
13
13
|
super(config)
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
async start (reconnectTimeout: number = 0): Promise<any> {
|
|
17
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
18
|
+
return await new Promise<any>(async (resolve, reject) => {
|
|
17
19
|
const logger = this.config.logFactory.logger('initiator')
|
|
18
20
|
const sessionContainer = this.config.sessionContainer
|
|
19
21
|
if (!sessionContainer.isRegistered(DITokens.FixSession)) {
|
|
@@ -27,7 +29,7 @@ export class TcpInitiatorConnector extends FixEntity {
|
|
|
27
29
|
await this.connect(initiatorSession)
|
|
28
30
|
logger.info('session has ended')
|
|
29
31
|
connecting = false
|
|
30
|
-
|
|
32
|
+
resolve(true)
|
|
31
33
|
} catch (e) {
|
|
32
34
|
if (!reconnectTimeout) {
|
|
33
35
|
connecting = false
|
|
@@ -41,14 +43,18 @@ export class TcpInitiatorConnector extends FixEntity {
|
|
|
41
43
|
})
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
delay (p: number): Promise<any> {
|
|
45
|
-
return new Promise<any>((
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
async delay (p: number): Promise<any> {
|
|
47
|
+
return await new Promise<any>((resolve, reject) => {
|
|
48
|
+
try {
|
|
49
|
+
if (!p) {
|
|
50
|
+
resolve(true)
|
|
51
|
+
}
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
resolve(true)
|
|
54
|
+
}, p)
|
|
55
|
+
} catch (e) {
|
|
56
|
+
reject(e)
|
|
48
57
|
}
|
|
49
|
-
setTimeout(() => {
|
|
50
|
-
accept(true)
|
|
51
|
-
}, p)
|
|
52
58
|
})
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -23,21 +23,22 @@ export enum InitiatorState {
|
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
25
25
|
export class TcpInitiator extends FixInitiator {
|
|
26
|
-
public tcp: ITcpTransportDescription
|
|
26
|
+
public tcp: ITcpTransportDescription | null
|
|
27
27
|
public state: InitiatorState = InitiatorState.Idle
|
|
28
28
|
private readonly logger: IJsFixLogger
|
|
29
29
|
private duplex: FixDuplex
|
|
30
|
-
private th: Timeout = null
|
|
30
|
+
private th: Timeout | null = null
|
|
31
31
|
|
|
32
32
|
constructor (@inject(DITokens.IJsFixConfig) public readonly jsFixConfig: IJsFixConfig) {
|
|
33
|
-
super(jsFixConfig.description.application)
|
|
34
|
-
|
|
33
|
+
super(jsFixConfig.description.application ?? null)
|
|
34
|
+
const name = this.application?.name ?? 'initiator'
|
|
35
|
+
this.logger = jsFixConfig.logFactory.logger(`${name}:TcpInitiator`)
|
|
35
36
|
if (!this.application) {
|
|
36
|
-
throw new Error(
|
|
37
|
+
throw new Error('no application in session description.')
|
|
37
38
|
}
|
|
38
|
-
this.tcp = this.application.tcp
|
|
39
|
+
this.tcp = this.application.tcp ?? null
|
|
39
40
|
if (!this.tcp) {
|
|
40
|
-
throw new Error(
|
|
41
|
+
throw new Error('no tcp in session description need tcp { host: hostname, port: port }')
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -59,15 +60,15 @@ export class TcpInitiator extends FixInitiator {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
public connect (timeoutSeconds: number): Promise<MsgTransport> {
|
|
63
|
-
return new Promise<MsgTransport>(async (resolve, reject) => {
|
|
63
|
+
public async connect (timeoutSeconds: number): Promise<MsgTransport> {
|
|
64
|
+
return await new Promise<MsgTransport>(async (resolve, reject) => {
|
|
64
65
|
switch (this.state) {
|
|
65
66
|
case InitiatorState.Idle: {
|
|
66
67
|
this.state = InitiatorState.Connecting
|
|
67
68
|
this.logger.info(`connecting with timeout ${timeoutSeconds}`)
|
|
68
69
|
this.tryConnect()
|
|
69
70
|
.then((t: MsgTransport) => resolve(t))
|
|
70
|
-
.catch((
|
|
71
|
+
.catch((_: Error) => {
|
|
71
72
|
this.repeatConnect(timeoutSeconds)
|
|
72
73
|
.then((t: MsgTransport) => resolve(t))
|
|
73
74
|
.catch((e: Error) => reject(e))
|
|
@@ -75,29 +76,36 @@ export class TcpInitiator extends FixInitiator {
|
|
|
75
76
|
break
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
default:
|
|
79
|
-
const e: Error = new Error(
|
|
79
|
+
default: {
|
|
80
|
+
const e: Error = new Error('connect not valid from non idle state')
|
|
80
81
|
this.logger.warning(`rejecting from state ${this.state}`)
|
|
81
82
|
reject(e)
|
|
83
|
+
}
|
|
82
84
|
}
|
|
83
85
|
})
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
private unsecureDuplex (): Promise<TcpDuplex> {
|
|
88
|
+
private async unsecureDuplex (): Promise<TcpDuplex> {
|
|
87
89
|
const tcp = this.tcp
|
|
88
|
-
return new Promise<TcpDuplex>((resolve, reject) => {
|
|
90
|
+
return await new Promise<TcpDuplex>((resolve, reject) => {
|
|
89
91
|
try {
|
|
90
|
-
this.logger.info(
|
|
91
|
-
const socket =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
this.logger.info('unsecureDuplex try to connect to endPoint')
|
|
93
|
+
const socket = tcp
|
|
94
|
+
? createConnection(tcp, () => {
|
|
95
|
+
try {
|
|
96
|
+
this.logger.info('net.createConnection cb, resolving')
|
|
97
|
+
if (socket) {
|
|
98
|
+
const tcpDuplex = new TcpDuplex(socket)
|
|
99
|
+
resolve(tcpDuplex)
|
|
100
|
+
} else {
|
|
101
|
+
reject(new Error('no socket in tcp initiator'))
|
|
102
|
+
}
|
|
103
|
+
} catch (e) {
|
|
104
|
+
reject(e)
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
: null
|
|
108
|
+
socket?.on('error', (err) => {
|
|
101
109
|
reject(err)
|
|
102
110
|
})
|
|
103
111
|
} catch (e) {
|
|
@@ -106,14 +114,15 @@ export class TcpInitiator extends FixInitiator {
|
|
|
106
114
|
})
|
|
107
115
|
}
|
|
108
116
|
|
|
109
|
-
private tlsDuplex (): Promise
|
|
110
|
-
return new Promise<TcpDuplex>((resolve, reject) => {
|
|
111
|
-
let tlsSocket: TLSSocket = null
|
|
117
|
+
private async tlsDuplex (): Promise<TcpDuplex > {
|
|
118
|
+
return await new Promise<TcpDuplex>((resolve, reject) => {
|
|
119
|
+
let tlsSocket: TLSSocket | null = null
|
|
112
120
|
const tcp = this.tcp
|
|
113
|
-
const connectionOptions: ConnectionOptions = TlsOptionsFactory.getTlsConnectionOptions(tcp)
|
|
121
|
+
const connectionOptions: ConnectionOptions | null = tcp ? TlsOptionsFactory.getTlsConnectionOptions(tcp) : null
|
|
114
122
|
if (connectionOptions) {
|
|
115
123
|
try {
|
|
116
124
|
tlsSocket = tlsConnect(connectionOptions, () => {
|
|
125
|
+
if (!tlsSocket) return null
|
|
117
126
|
this.logger.info(`client connected ${tlsSocket.authorized ? 'authorized' : 'unauthorized'}`)
|
|
118
127
|
if (!tlsSocket.authorized) {
|
|
119
128
|
const error = tlsSocket.authorizationError
|
|
@@ -123,11 +132,11 @@ export class TcpInitiator extends FixInitiator {
|
|
|
123
132
|
} else {
|
|
124
133
|
tlsSocket.setEncoding('utf8')
|
|
125
134
|
const tlsDuplex = new TcpDuplex(tlsSocket)
|
|
126
|
-
if (tcp
|
|
127
|
-
this.logger.info(
|
|
135
|
+
if (tcp?.tls?.enableTrace) {
|
|
136
|
+
this.logger.info('enabling tls session trace')
|
|
128
137
|
tlsSocket.enableTrace()
|
|
129
138
|
}
|
|
130
|
-
this.logger.info(
|
|
139
|
+
this.logger.info('tlsDuplex resolving')
|
|
131
140
|
resolve(tlsDuplex)
|
|
132
141
|
}
|
|
133
142
|
})
|
|
@@ -141,12 +150,12 @@ export class TcpInitiator extends FixInitiator {
|
|
|
141
150
|
})
|
|
142
151
|
}
|
|
143
152
|
|
|
144
|
-
private tryConnect (): Promise < MsgTransport > {
|
|
145
|
-
return new Promise<MsgTransport>((resolve, reject) => {
|
|
153
|
+
private async tryConnect (): Promise < MsgTransport > {
|
|
154
|
+
return await new Promise<MsgTransport>((resolve, reject) => {
|
|
146
155
|
const tcp = this.tcp
|
|
147
|
-
const connectionOptions: ConnectionOptions = TlsOptionsFactory.getTlsConnectionOptions(tcp)
|
|
156
|
+
const connectionOptions: ConnectionOptions | null = tcp ? TlsOptionsFactory.getTlsConnectionOptions(tcp) : null
|
|
148
157
|
const connector = connectionOptions ? this.tlsDuplex() : this.unsecureDuplex()
|
|
149
|
-
this.logger.info(`tryConnect ${tcp
|
|
158
|
+
this.logger.info(`tryConnect ${tcp?.host}:${tcp?.port}`)
|
|
150
159
|
connector.then(duplex => {
|
|
151
160
|
this.duplex = duplex
|
|
152
161
|
resolve(new MsgTransport(0, this.jsFixConfig, duplex))
|
|
@@ -156,20 +165,22 @@ export class TcpInitiator extends FixInitiator {
|
|
|
156
165
|
})
|
|
157
166
|
}
|
|
158
167
|
|
|
159
|
-
public clearTimer () {
|
|
160
|
-
if (this
|
|
168
|
+
public clearTimer (): void {
|
|
169
|
+
if (this.th) {
|
|
161
170
|
clearInterval(this.th)
|
|
162
171
|
this.th = null
|
|
163
172
|
}
|
|
164
173
|
}
|
|
165
174
|
|
|
166
|
-
private repeatConnect (timeoutSeconds: number): Promise < MsgTransport > {
|
|
167
|
-
return new Promise<MsgTransport>(async (resolve, reject) => {
|
|
175
|
+
private async repeatConnect (timeoutSeconds: number): Promise < MsgTransport > {
|
|
176
|
+
return await new Promise<MsgTransport>(async (resolve, reject) => {
|
|
168
177
|
const application = this.application
|
|
169
178
|
const promisify = util.promisify
|
|
170
179
|
const timeoutPromise = promisify(setTimeout)
|
|
180
|
+
const reconnectSeconds = application?.reconnectSeconds ?? 5
|
|
171
181
|
let retries = 0
|
|
172
182
|
let lastError: Error
|
|
183
|
+
const name = application?.name ?? 'initiator'
|
|
173
184
|
this.th = setInterval(() => {
|
|
174
185
|
++retries
|
|
175
186
|
this.tryConnect()
|
|
@@ -177,15 +188,15 @@ export class TcpInitiator extends FixInitiator {
|
|
|
177
188
|
this.state = InitiatorState.Connected
|
|
178
189
|
this.clearTimer()
|
|
179
190
|
resolve(t)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
},
|
|
191
|
+
}).catch((e: Error) => {
|
|
192
|
+
lastError = e
|
|
193
|
+
this.logger.info(`${name}: retries ${retries} ${e.message}`)
|
|
194
|
+
})
|
|
195
|
+
}, reconnectSeconds * 1000)
|
|
185
196
|
timeoutPromise(timeoutSeconds * 1000).then(() => {
|
|
186
197
|
this.clearTimer()
|
|
187
198
|
this.state = InitiatorState.Stopped
|
|
188
|
-
const e = lastError ?? new Error(`${
|
|
199
|
+
const e = lastError ?? new Error(`${name}: timeout of ${timeoutSeconds} whilst connecting`)
|
|
189
200
|
reject(e)
|
|
190
201
|
}).catch(e => {
|
|
191
202
|
reject(e)
|
|
@@ -5,7 +5,7 @@ const path = require('path')
|
|
|
5
5
|
const fs = require('fs')
|
|
6
6
|
|
|
7
7
|
export class TlsOptionsFactory {
|
|
8
|
-
static read (filePath: string) {
|
|
8
|
+
static read (filePath: string): string {
|
|
9
9
|
const root: string = path.join(__dirname, '../../../')
|
|
10
10
|
const fullPath = path.join(root, filePath)
|
|
11
11
|
return fs.readFileSync(fullPath,
|
|
@@ -14,8 +14,8 @@ export class TlsOptionsFactory {
|
|
|
14
14
|
})
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
static getTlsOptions (tls: ITlsOptions): TlsOptions {
|
|
18
|
-
let tlsOptions: TlsOptions = null
|
|
17
|
+
static getTlsOptions (tls: ITlsOptions): TlsOptions | null {
|
|
18
|
+
let tlsOptions: TlsOptions | null = null
|
|
19
19
|
if (tls) {
|
|
20
20
|
tlsOptions = {
|
|
21
21
|
requestCert: tls.requestCert,
|
|
@@ -24,18 +24,25 @@ export class TlsOptionsFactory {
|
|
|
24
24
|
|
|
25
25
|
if (tls.key) {
|
|
26
26
|
tlsOptions.key = TlsOptionsFactory.read(tls.key)
|
|
27
|
-
tlsOptions.cert = TlsOptionsFactory.read(tls
|
|
27
|
+
tlsOptions.cert = tls?.cert ? TlsOptionsFactory.read(tls?.cert) : undefined
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
if (tls.ca && tls.ca.length > 0) {
|
|
31
31
|
tlsOptions.ca = tls.ca.map(i => TlsOptionsFactory.read(i))
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
if (tls.nodeTlsServerOptions) {
|
|
35
|
+
tlsOptions = {
|
|
36
|
+
...tlsOptions,
|
|
37
|
+
...tls.nodeTlsServerOptions
|
|
38
|
+
}
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
return tlsOptions
|
|
35
42
|
}
|
|
36
43
|
|
|
37
|
-
static getTlsConnectionOptions (tcp: ITcpTransportDescription): ConnectionOptions {
|
|
38
|
-
let connectionOptions: ConnectionOptions = null
|
|
44
|
+
static getTlsConnectionOptions (tcp: ITcpTransportDescription): ConnectionOptions | null {
|
|
45
|
+
let connectionOptions: ConnectionOptions | null = null
|
|
39
46
|
const tls = tcp.tls
|
|
40
47
|
if (tls) {
|
|
41
48
|
connectionOptions = {
|
|
@@ -43,8 +50,8 @@ export class TlsOptionsFactory {
|
|
|
43
50
|
host: tcp.host
|
|
44
51
|
} as ConnectionOptions
|
|
45
52
|
if (tls.key) {
|
|
46
|
-
connectionOptions.key = TlsOptionsFactory.read(tcp.tls
|
|
47
|
-
connectionOptions.cert = TlsOptionsFactory.read(tcp
|
|
53
|
+
connectionOptions.key = TlsOptionsFactory.read(tcp.tls?.key ?? '')
|
|
54
|
+
connectionOptions.cert = tcp.tls?.cert ? TlsOptionsFactory.read(tcp?.tls?.cert) : undefined
|
|
48
55
|
}
|
|
49
56
|
if (tcp.tls.ca && tcp.tls.ca.length > 0) {
|
|
50
57
|
connectionOptions.ca = tcp.tls.ca.map(i => TlsOptionsFactory.read(i))
|
|
@@ -55,6 +62,12 @@ export class TlsOptionsFactory {
|
|
|
55
62
|
if (tcp.tls.sessionTimeout) {
|
|
56
63
|
connectionOptions.sessionTimeout = tcp.tls.sessionTimeout
|
|
57
64
|
}
|
|
65
|
+
if (tls.nodeTlsConnectionOptions) {
|
|
66
|
+
connectionOptions = {
|
|
67
|
+
...connectionOptions,
|
|
68
|
+
...tls.nodeTlsConnectionOptions
|
|
69
|
+
}
|
|
70
|
+
}
|
|
58
71
|
}
|
|
59
72
|
return connectionOptions
|
|
60
73
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { ConnectionOptions, TlsOptions } from 'tls'
|
|
2
|
+
|
|
1
3
|
export interface ITlsOptions {
|
|
2
|
-
readonly key
|
|
3
|
-
readonly cert
|
|
4
|
-
readonly ca?: string[]
|
|
5
|
-
readonly timeout?: number
|
|
6
|
-
readonly sessionTimeout?: number
|
|
7
|
-
readonly enableTrace?: boolean
|
|
8
|
-
readonly requestCert?: boolean
|
|
4
|
+
readonly key?: string
|
|
5
|
+
readonly cert?: string
|
|
6
|
+
readonly ca?: string[]
|
|
7
|
+
readonly timeout?: number
|
|
8
|
+
readonly sessionTimeout?: number
|
|
9
|
+
readonly enableTrace?: boolean
|
|
10
|
+
readonly requestCert?: boolean
|
|
9
11
|
readonly rejectUnauthorized?: boolean
|
|
12
|
+
readonly nodeTlsConnectionOptions?: ConnectionOptions
|
|
13
|
+
readonly nodeTlsServerOptions?: TlsOptions
|
|
10
14
|
}
|
package/src/util/json-helper.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class JsonHelper {
|
|
|
17
17
|
constructor (public readonly definitions: FixDefinitions) {
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
private static patchSimple (object: ILooseObject, field: ContainedSimpleField) {
|
|
20
|
+
private static patchSimple (object: ILooseObject, field: ContainedSimpleField): void {
|
|
21
21
|
let name: string = field.definition.name
|
|
22
22
|
let v: any = object[name]
|
|
23
23
|
if (v == null) {
|
|
@@ -35,11 +35,12 @@ export class JsonHelper {
|
|
|
35
35
|
break
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
case TagType.UtcTimestamp:
|
|
38
|
+
case TagType.UtcTimestamp: {
|
|
39
39
|
const m = moment(v)
|
|
40
40
|
const d = m.toDate()
|
|
41
41
|
object[name] = d
|
|
42
42
|
break
|
|
43
|
+
}
|
|
43
44
|
|
|
44
45
|
case TagType.UtcDateOnly: {
|
|
45
46
|
const m = moment(v)
|
|
@@ -74,7 +75,7 @@ export class JsonHelper {
|
|
|
74
75
|
|
|
75
76
|
public fromJson (fileName: string, msgType: string): ILooseObject {
|
|
76
77
|
const msg: ILooseObject = require(fileName)
|
|
77
|
-
const def: MessageDefinition = this.definitions.message.get(msgType)
|
|
78
|
+
const def: MessageDefinition | null = this.definitions.message.get(msgType)
|
|
78
79
|
if (!def) {
|
|
79
80
|
return msg
|
|
80
81
|
}
|
|
@@ -103,14 +104,14 @@ export class JsonHelper {
|
|
|
103
104
|
this.dispatcher.dispatchFields(set.fields, dispatcher)
|
|
104
105
|
}
|
|
105
106
|
|
|
106
|
-
private patchComponent (object: ILooseObject, cf: ContainedComponentField) {
|
|
107
|
+
private patchComponent (object: ILooseObject, cf: ContainedComponentField): void {
|
|
107
108
|
const c = object[cf.name] || object[cf.definition.name]
|
|
108
109
|
if (c) {
|
|
109
110
|
this.patchJsonFields(cf.definition, c)
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
private patchGroup (object: ILooseObject, gf: ContainedGroupField) {
|
|
114
|
+
private patchGroup (object: ILooseObject, gf: ContainedGroupField): void {
|
|
114
115
|
const arr: ILooseObject[] = object[gf.definition.name] || object[gf.name]
|
|
115
116
|
if (arr) {
|
|
116
117
|
arr.forEach((o) => {
|
|
@@ -11,7 +11,7 @@ export class MessageGenerator {
|
|
|
11
11
|
constructor (public readonly words: string[], public readonly definitions: FixDefinitions) {
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
public static getRandomEnum (field: SimpleFieldDefinition) {
|
|
14
|
+
public static getRandomEnum (field: SimpleFieldDefinition): any {
|
|
15
15
|
const tagType: TagType = field.tagType
|
|
16
16
|
const keys: string[] = field.enums.keys()
|
|
17
17
|
const choice: string = keys[Math.floor(Math.random() * keys.length)]
|
|
@@ -56,7 +56,7 @@ export class MessageGenerator {
|
|
|
56
56
|
}
|
|
57
57
|
density = Math.max(0.2, density)
|
|
58
58
|
density = Math.min(1.0, density)
|
|
59
|
-
const def: MessageDefinition = this.definitions.message.get(msgType)
|
|
59
|
+
const def: MessageDefinition | null = this.definitions.message.get(msgType)
|
|
60
60
|
if (!def) {
|
|
61
61
|
throw new Error(`definitions do not contain type ${msgType}`)
|
|
62
62
|
}
|
|
@@ -68,7 +68,7 @@ export class MessageGenerator {
|
|
|
68
68
|
return reducer.reduce(set, {
|
|
69
69
|
simple: (a: ILooseObject, sf: ContainedSimpleField) => {
|
|
70
70
|
const tag: number = sf.definition.tag
|
|
71
|
-
|
|
71
|
+
const include = tag === set.firstSimple.definition.tag || this.length > 0 || Math.random() <= density
|
|
72
72
|
if (include) {
|
|
73
73
|
const val: any = sf.definition.isEnum() ? MessageGenerator.getRandomEnum(sf.definition) : this.createSimple(sf)
|
|
74
74
|
if (val != null) {
|
|
@@ -97,7 +97,6 @@ export class MessageGenerator {
|
|
|
97
97
|
private createSimple (field: ContainedSimpleField): any {
|
|
98
98
|
const tagType: TagType = field.definition.tagType
|
|
99
99
|
switch (tagType) {
|
|
100
|
-
|
|
101
100
|
case TagType.String: {
|
|
102
101
|
return this.nextString()
|
|
103
102
|
}
|
|
@@ -131,21 +130,21 @@ export class MessageGenerator {
|
|
|
131
130
|
this.length = 0
|
|
132
131
|
const now: Date = new Date()
|
|
133
132
|
return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()
|
|
134
|
-
|
|
133
|
+
, 0, 0, 0, 0))
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
case TagType.UtcTimeOnly: {
|
|
138
137
|
this.length = 0
|
|
139
138
|
const s: Date = new Date()
|
|
140
139
|
return new Date(Date.UTC(0, 0, 0, s.getUTCHours(), s.getUTCMinutes(),
|
|
141
|
-
|
|
140
|
+
s.getUTCSeconds(), s.getUTCMilliseconds()))
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
case TagType.UtcTimestamp: {
|
|
145
144
|
this.length = 0
|
|
146
145
|
const now: Date = new Date()
|
|
147
146
|
return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(),
|
|
148
|
-
|
|
147
|
+
now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()))
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
case TagType.LocalDate: {
|
package/tsconfig.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"rootDir": "src",
|
|
3
4
|
"experimentalDecorators": true,
|
|
4
5
|
"emitDecoratorMetadata": true,
|
|
5
6
|
"target": "es6",
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
"sourceMap": true,
|
|
12
13
|
"inlineSources": true,
|
|
13
14
|
"pretty": true,
|
|
15
|
+
"strictNullChecks": true,
|
|
14
16
|
"outDir": "./dist"
|
|
15
17
|
},
|
|
16
18
|
"compileOnSave": true,
|
package/.eslintrc.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare abstract class AsciiChars {
|
|
2
|
-
static readonly Minus: number;
|
|
3
|
-
static readonly Equal: number;
|
|
4
|
-
static readonly ForwardSlash: number;
|
|
5
|
-
static readonly Plus: number;
|
|
6
|
-
static readonly Tab: number;
|
|
7
|
-
static readonly Colon: number;
|
|
8
|
-
static readonly Hyphen: number;
|
|
9
|
-
static readonly Pipe: number;
|
|
10
|
-
static readonly Carat: number;
|
|
11
|
-
static readonly N: number;
|
|
12
|
-
static readonly Y: number;
|
|
13
|
-
static readonly Zero: number;
|
|
14
|
-
static readonly Nine: number;
|
|
15
|
-
static readonly Dot: number;
|
|
16
|
-
static readonly Eq: number;
|
|
17
|
-
static readonly Dq: number;
|
|
18
|
-
static readonly Space: number;
|
|
19
|
-
static readonly Cr: number;
|
|
20
|
-
static readonly Soh: number;
|
|
21
|
-
static firstChar(s: string): number;
|
|
22
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsciiChars = void 0;
|
|
4
|
-
class AsciiChars {
|
|
5
|
-
static firstChar(s) {
|
|
6
|
-
return s.charCodeAt(0);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.AsciiChars = AsciiChars;
|
|
10
|
-
AsciiChars.Minus = '-'.charCodeAt(0);
|
|
11
|
-
AsciiChars.Equal = '='.charCodeAt(0);
|
|
12
|
-
AsciiChars.ForwardSlash = '/'.charCodeAt(0);
|
|
13
|
-
AsciiChars.Plus = '+'.charCodeAt(0);
|
|
14
|
-
AsciiChars.Tab = '\t'.charCodeAt(0);
|
|
15
|
-
AsciiChars.Colon = ':'.charCodeAt(0);
|
|
16
|
-
AsciiChars.Hyphen = '-'.charCodeAt(0);
|
|
17
|
-
AsciiChars.Pipe = '|'.charCodeAt(0);
|
|
18
|
-
AsciiChars.Carat = '^'.charCodeAt(0);
|
|
19
|
-
AsciiChars.N = 'N'.charCodeAt(0);
|
|
20
|
-
AsciiChars.Y = 'Y'.charCodeAt(0);
|
|
21
|
-
AsciiChars.Zero = '0'.charCodeAt(0);
|
|
22
|
-
AsciiChars.Nine = '9'.charCodeAt(0);
|
|
23
|
-
AsciiChars.Dot = '.'.charCodeAt(0);
|
|
24
|
-
AsciiChars.Eq = '='.charCodeAt(0);
|
|
25
|
-
AsciiChars.Dq = '"'.charCodeAt(0);
|
|
26
|
-
AsciiChars.Space = ' '.charCodeAt(0);
|
|
27
|
-
AsciiChars.Cr = '\n'.charCodeAt(0);
|
|
28
|
-
AsciiChars.Soh = 0x1;
|
|
29
|
-
//# sourceMappingURL=ascii-chars.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-chars.js","sourceRoot":"","sources":["../../src/buffer/ascii-chars.ts"],"names":[],"mappings":";;;AAAA,MAAsB,UAAU;IAsBvB,MAAM,CAAC,SAAS,CAAE,CAAS;QAChC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;;AAxBH,gCAyBC;AAvBwB,gBAAK,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACjC,gBAAK,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACjC,uBAAY,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACxC,eAAI,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAChC,cAAG,GAAW,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAChC,gBAAK,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACjC,iBAAM,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAClC,eAAI,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAChC,gBAAK,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACjC,YAAC,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC7B,YAAC,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC7B,eAAI,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAChC,eAAI,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAChC,cAAG,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC/B,aAAE,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC9B,aAAE,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC9B,gBAAK,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACjC,aAAE,GAAW,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAC/B,cAAG,GAAW,GAAG,CAAA","sourcesContent":["export abstract class AsciiChars {\r\n\r\n public static readonly Minus: number = '-'.charCodeAt(0)\r\n public static readonly Equal: number = '='.charCodeAt(0)\r\n public static readonly ForwardSlash: number = '/'.charCodeAt(0)\r\n public static readonly Plus: number = '+'.charCodeAt(0)\r\n public static readonly Tab: number = '\\t'.charCodeAt(0)\r\n public static readonly Colon: number = ':'.charCodeAt(0)\r\n public static readonly Hyphen: number = '-'.charCodeAt(0)\r\n public static readonly Pipe: number = '|'.charCodeAt(0)\r\n public static readonly Carat: number = '^'.charCodeAt(0)\r\n public static readonly N: number = 'N'.charCodeAt(0)\r\n public static readonly Y: number = 'Y'.charCodeAt(0)\r\n public static readonly Zero: number = '0'.charCodeAt(0)\r\n public static readonly Nine: number = '9'.charCodeAt(0)\r\n public static readonly Dot: number = '.'.charCodeAt(0)\r\n public static readonly Eq: number = '='.charCodeAt(0)\r\n public static readonly Dq: number = '\"'.charCodeAt(0)\r\n public static readonly Space: number = ' '.charCodeAt(0)\r\n public static readonly Cr: number = '\\n'.charCodeAt(0)\r\n public static readonly Soh: number = 0x1\r\n\r\n public static firstChar (s: string): number {\r\n return s.charCodeAt(0)\r\n }\r\n}\r\n"]}
|