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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jspurefix",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "pure node js fix engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -24,57 +24,58 @@
|
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"circular": "madge --circular --extensions js dist && madge --circular --extensions ts src",
|
|
27
|
-
"test": "jest",
|
|
27
|
+
"test": "jest --maxWorkers=1 --coverage",
|
|
28
28
|
"build": "tsc",
|
|
29
29
|
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
30
|
-
"cmd": "
|
|
31
|
-
"repo44": "
|
|
32
|
-
"repo44-unit": "
|
|
33
|
-
"repo44-script": "
|
|
34
|
-
"repo44-replay": "
|
|
35
|
-
"repo44-repscr": "
|
|
36
|
-
"repo44-bench": "
|
|
37
|
-
"
|
|
38
|
-
"repo44-bench-
|
|
39
|
-
"repo44-bench-
|
|
40
|
-
"repo44-bench-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"tcp-
|
|
46
|
-
"tcp-
|
|
47
|
-
"tcp-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
30
|
+
"cmd": "node dist/jsfix-cmd",
|
|
31
|
+
"repo44": "node dist/jsfix-cmd --dict=repo44",
|
|
32
|
+
"repo44-unit": "node dist/jsfix-cmd --dict=repo44 --generate --density=0.8 --unit --delimiter=\"|\" --session=data/session/test-initiator.json",
|
|
33
|
+
"repo44-script": "node dist/jsfix-cmd --dict=repo44 --generate --density=0.8 --script --delimiter=\"|\" --session=data/session/test-initiator.json",
|
|
34
|
+
"repo44-replay": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --stats--delimiter=\"|\" --objects",
|
|
35
|
+
"repo44-repscr": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --stats--delimiter=\"|\" --stats",
|
|
36
|
+
"repo44-bench": "node dist/jsfix-cmd --dict=repo44 --benchmark --delimiter=\"|\"",
|
|
37
|
+
"qf44-bench-er": "node dist/jsfix-cmd --dict=qf44 --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt --benchmark --delimiter=\"|\" --repeats=80000",
|
|
38
|
+
"repo44-bench-er": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/execution-report/fix.txt --benchmark --delimiter=\"|\" --repeats=125000",
|
|
39
|
+
"repo44-bench-tc": "node dist/jsfix-cmd jsfix-cmd ---dict=repo44 --fix=data/examples/FIX.4.4/repo/trade-capture/fix.txt --benchmark --delimiter=\"|\" --repeats=30000",
|
|
40
|
+
"repo44-bench-sd": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/security-definition/fix.txt --benchmark --delimiter=\"|\" --repeats=150000",
|
|
41
|
+
"repo44-bench-lo": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/repo/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
|
|
42
|
+
"qf-bench-lo": "node dist/jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/quickfix/logon/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
|
|
43
|
+
"qf-bench-hb": "node dist/jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/quickfix/heartbeat/fix.txt --benchmark --delimiter=\"|\" --repeats=250000",
|
|
44
|
+
"fixml": "node dist/jsfix-cmd --dict=repofixml",
|
|
45
|
+
"tcp-qf-md": "node dist/sample/tcp/qf-md/app",
|
|
46
|
+
"tcp-tls-tc": "node dist/sample/tcp/tls-trade-capture/app",
|
|
47
|
+
"tcp-tc": "node dist/sample/tcp/trade-capture/app",
|
|
48
|
+
"tcp-rec-sk": "node dist/sample/tcp/recovering-skeleton/app",
|
|
49
|
+
"tcp-sk": "node dist/sample/tcp/skeleton/app",
|
|
50
|
+
"http-oms": "node dist/sample/http/oms/app",
|
|
51
|
+
"repo40-compile": "node dist/jsfix-cmd \"--dict=repo40\" \"--compile\"",
|
|
52
|
+
"repo41-compile": "node dist/jsfix-cmd \"--dict=repo41\" \"--compile\"",
|
|
53
|
+
"repo42-compile": "node dist/jsfix-cmd \"--dict=repo42\" \"--compile\"",
|
|
54
|
+
"repo43-compile": "node dist/jsfix-cmd \"--dict=repo43\" \"--compile\"",
|
|
55
|
+
"repo44-compile": "node dist/jsfix-cmd \"--dict=repo44\" \"--compile\"",
|
|
56
|
+
"repo50-compile": "node dist/jsfix-cmd \"--dict=repo50\" \"--compile\"",
|
|
57
|
+
"repo50sp1-compile": "node dist/jsfix-cmd \"--dict=repo50sp1\" \"--compile\"",
|
|
58
|
+
"repo50sp2-compile": "node dist/jsfix-cmd \"--dict=repo50sp2\" \"--compile\"",
|
|
59
|
+
"repofixml-compile": "node dist/jsfix-cmd \"--dict=repofixml\" \"--compile\"",
|
|
60
|
+
"qf44-compile": "node dist/jsfix-cmd \"--dict=qf44\" \"--compile\"",
|
|
61
|
+
"qf43-compile": "node dist/jsfix-cmd \"--dict=qf43\" \"--compile\"",
|
|
62
|
+
"qf42-compile": "node dist/jsfix-cmd \"--dict=qf42\" \"--compile\"",
|
|
61
63
|
"unzip-repo": "cd data && node ../src/util/unzip fix_repo.zip",
|
|
62
|
-
"fixml-test-print": "
|
|
63
|
-
"fix-test-print": "
|
|
64
|
+
"fixml-test-print": "node dist/jsfix-cmd --session=data/session/test-http-initiator.json --fix=data/examples/fixml/jsfix.test_http-client.txt --objects",
|
|
65
|
+
"fix-test-print": "node dist/jsfix-cmd --dict=repo44 --fix=data/examples/FIX.4.4/jsfix.test_client.txt --objects --delimiter=\"|\""
|
|
64
66
|
},
|
|
65
67
|
"author": "",
|
|
66
68
|
"license": "MIT",
|
|
67
69
|
"dependencies": {
|
|
68
70
|
"align-text": "^1.0.2",
|
|
71
|
+
"axios": "^1.2.2",
|
|
69
72
|
"express": "^4.18.2",
|
|
70
73
|
"lodash": "^4.17.21",
|
|
71
|
-
"mathjs": "^11.
|
|
74
|
+
"mathjs": "^11.5.0",
|
|
72
75
|
"minimist": "^1.2.7",
|
|
73
76
|
"moment": "^2.29.4",
|
|
74
77
|
"node-fs-extra": "^0.8.2",
|
|
75
78
|
"reflect-metadata": "^0.1.13",
|
|
76
|
-
"request": "^2.88.2",
|
|
77
|
-
"request-promise-native": "^1.0.9",
|
|
78
79
|
"sax": "^1.2.4",
|
|
79
80
|
"tsyringe": "^4.7.0",
|
|
80
81
|
"uuid": "^9.0.0",
|
|
@@ -83,23 +84,27 @@
|
|
|
83
84
|
"yauzl": "^2.10.0"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
|
-
"@types/express": "^4.17.
|
|
87
|
-
"@types/express-serve-static-core": "^4.17.
|
|
88
|
-
"@types/jest": "^29.
|
|
89
|
-
"@types/lodash": "^4.14.
|
|
87
|
+
"@types/express": "^4.17.15",
|
|
88
|
+
"@types/express-serve-static-core": "^4.17.32",
|
|
89
|
+
"@types/jest": "^29.2.5",
|
|
90
|
+
"@types/lodash": "^4.14.191",
|
|
90
91
|
"@types/mathjs": "^9.4.1",
|
|
91
92
|
"@types/minimist": "^1.2.2",
|
|
92
|
-
"@types/node": "^18.11.
|
|
93
|
+
"@types/node": "^18.11.18",
|
|
93
94
|
"@types/request-promise-native": "^1.0.18",
|
|
94
95
|
"@types/sax": "^1.2.4",
|
|
95
|
-
"@types/uuid": "^
|
|
96
|
+
"@types/uuid": "^9.0.0",
|
|
96
97
|
"@types/winston": "^2.4.4",
|
|
97
|
-
"
|
|
98
|
+
"@typescript-eslint/eslint-plugin-tslint": "^5.47.1",
|
|
99
|
+
"eslint": "^8.31.0",
|
|
100
|
+
"eslint-config-standard-with-typescript": "^24.0.0",
|
|
101
|
+
"eslint-plugin-jquery": "^1.5.1",
|
|
102
|
+
"eslint-plugin-jsdoc": "^39.6.4",
|
|
103
|
+
"eslint-plugin-node": "^11.1.0",
|
|
104
|
+
"jest": "^29.3.1",
|
|
98
105
|
"madge": "^5.0.1",
|
|
99
106
|
"standard": "^17.0.0",
|
|
100
107
|
"ts-jest": "^29.0.3",
|
|
101
|
-
"
|
|
102
|
-
"tslint-config-standard": "^9.0.0",
|
|
103
|
-
"typescript": "^4.8.4"
|
|
108
|
+
"typescript": "^4.9.4"
|
|
104
109
|
}
|
|
105
110
|
}
|
|
@@ -14,17 +14,16 @@ import { Tags } from '../tag/tags'
|
|
|
14
14
|
import { TagType } from '../tag/tag-type'
|
|
15
15
|
|
|
16
16
|
export class AsciiEncoder extends MsgEncoder {
|
|
17
|
-
|
|
18
17
|
public bodyLengthPos: number
|
|
19
18
|
public msgTypePos: number
|
|
20
19
|
public tags: Tags
|
|
21
20
|
public checkGroups: boolean = true
|
|
22
21
|
|
|
23
22
|
constructor (public readonly buffer: ElasticBuffer,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
public readonly definitions: FixDefinitions,
|
|
24
|
+
public readonly timeFormatter: ITimeFormatter = new TimeFormatter(buffer),
|
|
25
|
+
public readonly delimiter: number = AsciiChars.Soh,
|
|
26
|
+
public readonly logDelimiter: number = AsciiChars.Pipe) {
|
|
28
27
|
super(definitions)
|
|
29
28
|
this.tags = new Tags(definitions)
|
|
30
29
|
}
|
|
@@ -87,7 +86,7 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
87
86
|
const keys: string[] = Object.keys(o)
|
|
88
87
|
let j: number = 0
|
|
89
88
|
const fields: ContainedField[] = keys.reduce((a: ContainedField[], current: string) => {
|
|
90
|
-
const field: ContainedField = set.localNameToField.get(current)
|
|
89
|
+
const field: ContainedField | null = set.localNameToField.get(current)
|
|
91
90
|
if (field) {
|
|
92
91
|
a[j++] = field
|
|
93
92
|
}
|
|
@@ -98,7 +97,8 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
private encodeInstances (o: ILooseObject, gf: ContainedGroupField): void {
|
|
101
|
-
const noOfField: SimpleFieldDefinition = gf.definition.noOfField
|
|
100
|
+
const noOfField: SimpleFieldDefinition | null = gf.definition.noOfField
|
|
101
|
+
if (!noOfField) return
|
|
102
102
|
const instances: ILooseObject[] = o[gf.name] || o[noOfField.name]
|
|
103
103
|
|
|
104
104
|
const buffer = this.buffer
|
|
@@ -167,7 +167,6 @@ export class AsciiEncoder extends MsgEncoder {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
switch (tagType) {
|
|
170
|
-
|
|
171
170
|
case TagType.RawData: {
|
|
172
171
|
// may need to first write raw message length (see below)
|
|
173
172
|
break
|
|
@@ -262,7 +261,7 @@ class GroupValidator {
|
|
|
262
261
|
public readonly test: AsciiEncodeSetSummary = new AsciiEncodeSetSummary()) {
|
|
263
262
|
}
|
|
264
263
|
|
|
265
|
-
getSummary (field: number) {
|
|
264
|
+
getSummary (field: number): AsciiEncodeSetSummary {
|
|
266
265
|
return field === 0 ? this.first : this.test
|
|
267
266
|
}
|
|
268
267
|
|
|
@@ -270,31 +269,34 @@ class GroupValidator {
|
|
|
270
269
|
const first = this.first
|
|
271
270
|
const test = this.test
|
|
272
271
|
if (field === 0 && first.empty()) {
|
|
273
|
-
throw new Error(`first group instance has no
|
|
272
|
+
throw new Error(`first group instance has no delimiter present ${this.gf.name}`)
|
|
274
273
|
}
|
|
275
274
|
if (field > 0 && test.empty()) {
|
|
276
|
-
throw new Error(`group instance [${field}] has no
|
|
275
|
+
throw new Error(`group instance [${field}] has no delimiter present ${this.gf.name}`)
|
|
277
276
|
}
|
|
278
277
|
if (field > 0) {
|
|
279
|
-
const firstTag = first.firstSimple
|
|
280
|
-
const tag = test.firstSimple
|
|
278
|
+
const firstTag = first.firstSimple?.definition.tag
|
|
279
|
+
const tag = test.firstSimple?.definition.tag
|
|
281
280
|
if (firstTag !== tag) {
|
|
282
|
-
|
|
281
|
+
const msg = `group instance [${field}] inconsistent delimiter ${tag} expected tag ${firstTag}`
|
|
282
|
+
throw new Error(msg)
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
class AsciiEncodeSetSummary {
|
|
289
|
-
constructor (public firstSimple: ContainedSimpleField = null,
|
|
290
|
-
public lastSimple: ContainedSimpleField = null,
|
|
289
|
+
constructor (public firstSimple: ContainedSimpleField | null = null,
|
|
290
|
+
public lastSimple: ContainedSimpleField | null = null,
|
|
291
291
|
public count: number = 0) {
|
|
292
292
|
}
|
|
293
|
+
|
|
293
294
|
public reset (): void {
|
|
294
295
|
this.firstSimple = null
|
|
295
296
|
this.lastSimple = null
|
|
296
297
|
this.count = 0
|
|
297
298
|
}
|
|
299
|
+
|
|
298
300
|
public empty (): boolean {
|
|
299
301
|
return this.firstSimple === null || this.count === 0
|
|
300
302
|
}
|
|
@@ -7,7 +7,7 @@ import { DITokens } from '../../runtime/di-tokens'
|
|
|
7
7
|
|
|
8
8
|
@injectable()
|
|
9
9
|
export class AsciiParserState {
|
|
10
|
-
public message: MessageDefinition
|
|
10
|
+
public message: MessageDefinition | null
|
|
11
11
|
public locations: Tags
|
|
12
12
|
public parseState: ParseState
|
|
13
13
|
public bodyLen: number
|
|
@@ -19,12 +19,12 @@ export class AsciiParserState {
|
|
|
19
19
|
public currentTag: number
|
|
20
20
|
public rawDataLen: number
|
|
21
21
|
public rawDataRead: number
|
|
22
|
-
public msgType: string
|
|
22
|
+
public msgType: string | null
|
|
23
23
|
|
|
24
24
|
constructor (@inject(DITokens.ParseBuffer) public readonly elasticBuffer: ElasticBuffer) {
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
public beginTag (pos: number) {
|
|
27
|
+
public beginTag (pos: number): void {
|
|
28
28
|
this.parseState = ParseState.ParsingTag
|
|
29
29
|
this.tagStartPos = pos
|
|
30
30
|
this.equalPos = this.valueEndPos = -1
|
|
@@ -54,7 +54,7 @@ export class AsciiParserState {
|
|
|
54
54
|
|
|
55
55
|
public checkRawTag (): void {
|
|
56
56
|
const msg = this.message
|
|
57
|
-
if (!msg
|
|
57
|
+
if (!msg?.containsRaw) {
|
|
58
58
|
// optimisation as will never hit raw data
|
|
59
59
|
this.parseState = ParseState.ParsingValue
|
|
60
60
|
return
|
|
@@ -28,12 +28,12 @@ export class AsciiParser extends MsgParser {
|
|
|
28
28
|
// want to keep one slice of memory and constantly reuse it
|
|
29
29
|
|
|
30
30
|
constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
@inject(DITokens.readStream) public readonly readStream: Readable | null,
|
|
32
|
+
@inject(DITokens.ParseBuffer) protected readonly receivingBuffer: ElasticBuffer) {
|
|
33
33
|
super()
|
|
34
34
|
|
|
35
|
-
this.delimiter = config.delimiter
|
|
36
|
-
this.writeDelimiter = config.logDelimiter
|
|
35
|
+
this.delimiter = config.delimiter ?? AsciiChars.Soh
|
|
36
|
+
this.writeDelimiter = config.logDelimiter ?? AsciiChars.Pipe
|
|
37
37
|
const definitions = config.definitions
|
|
38
38
|
this.id = AsciiParser.nextId++
|
|
39
39
|
this.segmentParser = config.sessionContainer.resolve<AsciiSegmentParser>(AsciiSegmentParser)
|
|
@@ -65,13 +65,13 @@ export class AsciiParser extends MsgParser {
|
|
|
65
65
|
})
|
|
66
66
|
|
|
67
67
|
// receive from say a socket or file and pipe to parser which discovers messages
|
|
68
|
-
stream
|
|
68
|
+
stream?.pipe(receiver).on('finish', () => {
|
|
69
69
|
this.emit('done')
|
|
70
70
|
})
|
|
71
|
-
stream
|
|
71
|
+
stream?.on('error', (e) => {
|
|
72
72
|
this.emit('error', e)
|
|
73
73
|
})
|
|
74
|
-
stream
|
|
74
|
+
stream?.on('end', () => {
|
|
75
75
|
this.emit('end')
|
|
76
76
|
})
|
|
77
77
|
}
|
|
@@ -86,7 +86,7 @@ export class AsciiParser extends MsgParser {
|
|
|
86
86
|
state.beginMessage()
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
public parseText (text: string) {
|
|
89
|
+
public parseText (text: string): void {
|
|
90
90
|
const buff = Buffer.from(text)
|
|
91
91
|
this.parse(buff, buff.length)
|
|
92
92
|
}
|
|
@@ -103,11 +103,10 @@ export class AsciiParser extends MsgParser {
|
|
|
103
103
|
let readPtr: number = 0
|
|
104
104
|
|
|
105
105
|
while (readPtr < end) {
|
|
106
|
-
|
|
106
|
+
const charAtPos: number = readBuffer[readPtr]
|
|
107
107
|
|
|
108
108
|
const writePtr = receivingBuffer.saveChar(charAtPos) - 1
|
|
109
109
|
switch (state.parseState) {
|
|
110
|
-
|
|
111
110
|
case ParseState.MsgComplete: {
|
|
112
111
|
this.msg(writePtr)
|
|
113
112
|
continue
|
|
@@ -157,7 +156,8 @@ export class AsciiParser extends MsgParser {
|
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
default: {
|
|
160
|
-
|
|
159
|
+
const st = state.parseState
|
|
160
|
+
throw new Error(`fix parser in unknown state ${st}`)
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
readPtr++
|
|
@@ -171,15 +171,18 @@ export class AsciiParser extends MsgParser {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
private getView (ptr: number): MsgView {
|
|
174
|
+
private getView (ptr: number): MsgView | null {
|
|
175
175
|
const state = this.state
|
|
176
176
|
const locations = state.locations
|
|
177
177
|
const source = this.receivingBuffer
|
|
178
178
|
const delimiter = this.delimiter
|
|
179
179
|
const replace = this.writeDelimiter
|
|
180
|
+
const msgType = state.msgType ?? null
|
|
181
|
+
if (!msgType) return null
|
|
180
182
|
if (state.message) {
|
|
181
|
-
const structure: Structure = this.segmentParser.parse(
|
|
183
|
+
const structure: Structure | null = this.segmentParser.parse(msgType, locations,
|
|
182
184
|
locations.nextTagPos - 1)
|
|
185
|
+
if (!structure) return null
|
|
183
186
|
return new AsciiView(structure.msg(),
|
|
184
187
|
source,
|
|
185
188
|
structure,
|
|
@@ -20,14 +20,13 @@ import { SegmentType } from '../segment/segment-type'
|
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class AsciiSegmentParser {
|
|
23
|
-
|
|
24
23
|
constructor (@inject(DITokens.Definitions) public readonly definitions: FixDefinitions) {
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
public parse (msgType: string, tags: Tags, last: number): Structure {
|
|
26
|
+
public parse (msgType: string, tags: Tags, last: number): Structure | null {
|
|
28
27
|
// completed segments in that they are fully parsed
|
|
29
28
|
const segments: SegmentDescription[] = []
|
|
30
|
-
const msgDefinition: MessageDefinition = this.definitions.message.get(msgType)
|
|
29
|
+
const msgDefinition: MessageDefinition | null = this.definitions.message.get(msgType)
|
|
31
30
|
if (!msgDefinition) {
|
|
32
31
|
return null
|
|
33
32
|
}
|
|
@@ -41,11 +40,12 @@ export class AsciiSegmentParser {
|
|
|
41
40
|
// having finished one segments keep unwinding until tag matches further up stack
|
|
42
41
|
function unwind (tag: number): void {
|
|
43
42
|
while (structureStack.length > 1) {
|
|
44
|
-
const done
|
|
43
|
+
const done = structureStack.pop()
|
|
44
|
+
if (!done) continue
|
|
45
45
|
done.end(segments.length, currentTagPosition - 1, tags.tagPos[currentTagPosition - 1].tag)
|
|
46
46
|
segments.push(done)
|
|
47
47
|
peek = structureStack[structureStack.length - 1]
|
|
48
|
-
if (peek.set
|
|
48
|
+
if (peek.set?.containedTag[tag]) {
|
|
49
49
|
// unwound to point this tag lives in this set.
|
|
50
50
|
break
|
|
51
51
|
}
|
|
@@ -56,10 +56,10 @@ export class AsciiSegmentParser {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
function examine (tag: number): SegmentDescription {
|
|
60
|
-
let structure: SegmentDescription = null
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
function examine (tag: number): SegmentDescription | null {
|
|
60
|
+
let structure: SegmentDescription | null = null
|
|
61
|
+
const type = peek.currentField?.type
|
|
62
|
+
switch (type) {
|
|
63
63
|
case ContainedFieldType.Simple: {
|
|
64
64
|
const sf: ContainedSimpleField = peek.currentField as ContainedSimpleField
|
|
65
65
|
if (sf.definition.tag === tag) {
|
|
@@ -71,14 +71,14 @@ export class AsciiSegmentParser {
|
|
|
71
71
|
case ContainedFieldType.Component: {
|
|
72
72
|
const cf: ContainedComponentField = peek.currentField as ContainedComponentField
|
|
73
73
|
structure = new SegmentDescription(cf.name, tag, cf.definition,
|
|
74
|
-
|
|
74
|
+
currentTagPosition, structureStack.length, SegmentType.Component)
|
|
75
75
|
break
|
|
76
76
|
}
|
|
77
77
|
// for a group also need to know where all delimiters are positioned
|
|
78
78
|
case ContainedFieldType.Group: {
|
|
79
79
|
const gf: ContainedComponentField = peek.currentField as ContainedGroupField
|
|
80
80
|
structure = new SegmentDescription(gf.name, tag, gf.definition,
|
|
81
|
-
|
|
81
|
+
currentTagPosition, structureStack.length, SegmentType.Group)
|
|
82
82
|
currentTagPosition = currentTagPosition + 1
|
|
83
83
|
structure.startGroup(tags.tagPos[currentTagPosition].tag)
|
|
84
84
|
break
|
|
@@ -96,8 +96,8 @@ export class AsciiSegmentParser {
|
|
|
96
96
|
if (tag === peek.delimiterTag) {
|
|
97
97
|
peek.addDelimiterPosition(currentTagPosition)
|
|
98
98
|
} else if (structureStack.length > 1) {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
// if a group is represented by a repeated component, then the tag representing delimiter
|
|
100
|
+
// needs to be added further up stack to group itself.
|
|
101
101
|
delimiter = structureStack[structureStack.length - 2].groupAddDelimiter(tag, currentTagPosition)
|
|
102
102
|
}
|
|
103
103
|
return delimiter
|
|
@@ -116,7 +116,7 @@ export class AsciiSegmentParser {
|
|
|
116
116
|
const tag: number = tags.tagPos[currentTagPosition].tag
|
|
117
117
|
peek = structureStack[structureStack.length - 1]
|
|
118
118
|
peek.setCurrentField(tag)
|
|
119
|
-
if (!peek.set
|
|
119
|
+
if (!peek.set?.containedTag[tag] || groupDelimiter(tag)) {
|
|
120
120
|
// unravelled all way back to root hence this is not recognised
|
|
121
121
|
const unknown = peek.type === SegmentType.Msg
|
|
122
122
|
if (unknown) {
|
|
@@ -137,7 +137,8 @@ export class AsciiSegmentParser {
|
|
|
137
137
|
function clean (): void {
|
|
138
138
|
// any remainder components can be closed.
|
|
139
139
|
while (structureStack.length > 0) {
|
|
140
|
-
const done
|
|
140
|
+
const done = structureStack.pop()
|
|
141
|
+
if (!done) continue
|
|
141
142
|
done.end(segments.length, currentTagPosition - 1, tags.tagPos[currentTagPosition - 1].tag)
|
|
142
143
|
segments[segments.length] = done
|
|
143
144
|
}
|
|
@@ -12,12 +12,11 @@ import { TagType } from '../tag/tag-type'
|
|
|
12
12
|
export class AsciiView extends MsgView {
|
|
13
13
|
private readonly timeFormatter: ITimeFormatter = new TimeFormatter(this.buffer)
|
|
14
14
|
constructor (public readonly segment: SegmentDescription,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
public readonly buffer: ElasticBuffer,
|
|
16
|
+
public readonly structure: Structure | null,
|
|
17
|
+
public readonly ptr: number,
|
|
18
|
+
public readonly delimiter: number,
|
|
19
|
+
public readonly writeDelimiter: number) {
|
|
21
20
|
super(segment, structure)
|
|
22
21
|
}
|
|
23
22
|
|
|
@@ -35,6 +34,7 @@ export class AsciiView extends MsgView {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
private replaceDelimiter (viewBuffer: Buffer, replaceDelimiter?: number): void {
|
|
37
|
+
if (this.structure == null) return
|
|
38
38
|
const delimiter = replaceDelimiter ?? this.delimiter
|
|
39
39
|
if (delimiter !== this.writeDelimiter) {
|
|
40
40
|
const structure = this.structure
|
|
@@ -55,6 +55,7 @@ export class AsciiView extends MsgView {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
public checksum (): number {
|
|
58
|
+
if (this.structure == null) return -1
|
|
58
59
|
const t = this.getPosition(MsgTag.CheckSum)
|
|
59
60
|
const structure = this.structure
|
|
60
61
|
const prev = structure.tags.tagPos[t - 1]
|
|
@@ -127,7 +128,8 @@ export class AsciiView extends MsgView {
|
|
|
127
128
|
this.writeDelimiter)
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
protected stringAtPosition (position: number): string {
|
|
131
|
+
protected stringAtPosition (position: number): string | null {
|
|
132
|
+
if (this.structure == null) return null
|
|
131
133
|
const tags = this.structure.tags
|
|
132
134
|
if (position < 0 || position >= tags.nextTagPos) {
|
|
133
135
|
return null
|
|
@@ -136,12 +138,14 @@ export class AsciiView extends MsgView {
|
|
|
136
138
|
return this.buffer.getString(tag.start, tag.start + tag.len)
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
private getBuffer (position: number): Buffer {
|
|
141
|
+
private getBuffer (position: number): Buffer | null {
|
|
142
|
+
if (this.structure == null) return null
|
|
140
143
|
const tag: TagPos = this.structure.tags.tagPos[position]
|
|
141
144
|
return this.buffer.getBuffer(tag.start, tag.start + tag.len)
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
private getNumber (position: number, isFloat: boolean = false): number {
|
|
147
|
+
private getNumber (position: number, isFloat: boolean = false): number | null {
|
|
148
|
+
if (this.structure == null) return null
|
|
145
149
|
const buffer = this.buffer
|
|
146
150
|
const tag: TagPos = this.structure.tags.tagPos[position]
|
|
147
151
|
if (isFloat) {
|
|
@@ -151,7 +155,8 @@ export class AsciiView extends MsgView {
|
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
|
|
154
|
-
private getTime (tag: number, useUtc: boolean): Date {
|
|
158
|
+
private getTime (tag: number, useUtc: boolean): Date | null {
|
|
159
|
+
if (this.structure == null) return null
|
|
155
160
|
const formatter = this.timeFormatter
|
|
156
161
|
const position: number = this.getPosition(tag)
|
|
157
162
|
const tagPos: TagPos = this.structure.tags.tagPos[position]
|
|
@@ -165,7 +170,8 @@ export class AsciiView extends MsgView {
|
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
|
|
168
|
-
private getDate (tag: number, useUtc: boolean): Date {
|
|
173
|
+
private getDate (tag: number, useUtc: boolean): Date | null {
|
|
174
|
+
if (this.structure == null) return null
|
|
169
175
|
const formatter = this.timeFormatter
|
|
170
176
|
const position: number = this.getPosition(tag)
|
|
171
177
|
if (position < 0) {
|
|
@@ -183,14 +189,15 @@ export class AsciiView extends MsgView {
|
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
191
|
|
|
186
|
-
private getDateTime (tag: number, useUtc: boolean): Date {
|
|
192
|
+
private getDateTime (tag: number, useUtc: boolean): Date | null {
|
|
193
|
+
if (this.structure == null) return null
|
|
187
194
|
const position: number = this.getPosition(tag)
|
|
188
195
|
const tagPos: TagPos = this.structure.tags.tagPos[position]
|
|
189
196
|
const formatter = this.timeFormatter
|
|
190
197
|
if (position < 0) {
|
|
191
198
|
return null
|
|
192
199
|
}
|
|
193
|
-
|
|
200
|
+
// (SendingTime) = 20150417-01:00:08.201
|
|
194
201
|
if (tagPos.len < 8) {
|
|
195
202
|
return null
|
|
196
203
|
}
|
|
@@ -202,7 +209,8 @@ export class AsciiView extends MsgView {
|
|
|
202
209
|
}
|
|
203
210
|
}
|
|
204
211
|
|
|
205
|
-
private getBoolean (tag: number): boolean {
|
|
212
|
+
private getBoolean (tag: number): boolean | null {
|
|
213
|
+
if (this.structure == null) return null
|
|
206
214
|
const position: number = this.getPosition(tag)
|
|
207
215
|
if (position < 0) {
|
|
208
216
|
return null
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export interface ITimeFormatter {
|
|
2
|
-
writeLocalDate (v: Date)
|
|
3
|
-
writeUtcDate (v: Date)
|
|
2
|
+
writeLocalDate: (v: Date) => void
|
|
3
|
+
writeUtcDate: (v: Date) => void
|
|
4
4
|
|
|
5
|
-
writeLocalTimestamp (v: Date)
|
|
6
|
-
writeUtcTimestamp (v: Date)
|
|
5
|
+
writeLocalTimestamp: (v: Date) => void
|
|
6
|
+
writeUtcTimestamp: (v: Date) => void
|
|
7
7
|
|
|
8
|
-
writeLocalTime (v: Date)
|
|
9
|
-
writeUtcTime (v: Date)
|
|
8
|
+
writeLocalTime: (v: Date) => void
|
|
9
|
+
writeUtcTime: (v: Date) => void
|
|
10
10
|
|
|
11
|
-
getLocalDate (start: number)
|
|
12
|
-
getUtcDate (start: number)
|
|
11
|
+
getLocalDate: (start: number) => Date | null
|
|
12
|
+
getUtcDate: (start: number) => Date | null
|
|
13
13
|
|
|
14
|
-
getLocalTime (start: number)
|
|
15
|
-
getUtcTime (start: number)
|
|
14
|
+
getLocalTime: (start: number) => Date | null
|
|
15
|
+
getUtcTime: (start: number) => Date | null
|
|
16
16
|
|
|
17
|
-
getLocalTimestamp (start: number, end: number)
|
|
18
|
-
getUtcTimestamp (start: number, end: number)
|
|
17
|
+
getLocalTimestamp: (start: number, end: number) => Date | null
|
|
18
|
+
getUtcTimestamp: (start: number, end: number) => Date | null
|
|
19
19
|
}
|