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
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const path = require("path");
|
|
13
|
-
const buffer_1 = require("../buffer");
|
|
14
|
-
const util_1 = require("../util");
|
|
15
|
-
const config_1 = require("../config");
|
|
16
|
-
const ascii_1 = require("../transport/ascii");
|
|
17
|
-
const __1 = require("..");
|
|
18
|
-
let definitions;
|
|
19
|
-
let jsonHelper;
|
|
20
|
-
let session;
|
|
21
|
-
const root = path.join(__dirname, '../../data/examples/FIX.4.4/repo/');
|
|
22
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const sessionDescription = require(path.join(root, '../../../session/test-initiator.json'));
|
|
24
|
-
definitions = yield (0, util_1.getDefinitions)(sessionDescription.application.dictionary);
|
|
25
|
-
jsonHelper = new util_1.JsonHelper(definitions);
|
|
26
|
-
const config = new config_1.JsFixConfig(new ascii_1.AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
27
|
-
session = new ascii_1.AsciiMsgTransmitter(config);
|
|
28
|
-
}), 45000);
|
|
29
|
-
function testEncodeDecode(msgType, msg) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const parser = new buffer_1.AsciiParser(definitions, session.encodeStream, buffer_1.AsciiChars.Pipe);
|
|
33
|
-
parser.on('msg', (msgType, view) => {
|
|
34
|
-
const o = view.toObject();
|
|
35
|
-
delete o['StandardHeader'];
|
|
36
|
-
delete o['StandardTrailer'];
|
|
37
|
-
resolve(o);
|
|
38
|
-
});
|
|
39
|
-
parser.on('error', (e) => {
|
|
40
|
-
reject(e);
|
|
41
|
-
});
|
|
42
|
-
session.send(msgType, msg);
|
|
43
|
-
}));
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
test('check 1 digit checksum format', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
const factory = session.config.factory;
|
|
48
|
-
const cs = factory.trailer(1);
|
|
49
|
-
expect(cs.CheckSum).toEqual('001');
|
|
50
|
-
}));
|
|
51
|
-
test('check 2 digit checksum format', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
-
const factory = session.config.factory;
|
|
53
|
-
const cs = factory.trailer(10);
|
|
54
|
-
expect(cs.CheckSum).toEqual('010');
|
|
55
|
-
}));
|
|
56
|
-
test('check 3 digit checksum format', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
const factory = session.config.factory;
|
|
58
|
-
const cs = factory.trailer(100);
|
|
59
|
-
expect(cs.CheckSum).toEqual('100');
|
|
60
|
-
}));
|
|
61
|
-
test('AE object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
const msgType = __1.MsgType.TradeCaptureReport;
|
|
63
|
-
const file = path.join(root, 'trade-capture/object.json');
|
|
64
|
-
const msg = jsonHelper.fromJson(file, msgType);
|
|
65
|
-
const o = yield testEncodeDecode(msgType, msg);
|
|
66
|
-
expect(o).toEqual(msg);
|
|
67
|
-
}), 1000);
|
|
68
|
-
test('d object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
-
const msgType = __1.MsgType.SecurityDefinition;
|
|
70
|
-
const file = path.join(root, 'security-definition/object.json');
|
|
71
|
-
const msg = jsonHelper.fromJson(file, msgType);
|
|
72
|
-
const o = yield testEncodeDecode(msgType, msg);
|
|
73
|
-
expect(o).toEqual(msg);
|
|
74
|
-
}), 1000);
|
|
75
|
-
test('D object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
|
-
const msgType = __1.MsgType.NewOrderSingle;
|
|
77
|
-
const file = path.join(root, 'new-order-single/object.json');
|
|
78
|
-
const msg = jsonHelper.fromJson(file, msgType);
|
|
79
|
-
const o = yield testEncodeDecode(msgType, msg);
|
|
80
|
-
expect(o).toEqual(msg);
|
|
81
|
-
}), 1000);
|
|
82
|
-
//# sourceMappingURL=repo-full-ascii-msg.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repo-full-ascii-msg.test.js","sourceRoot":"","sources":["../../src/test/repo-full-ascii-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAA8D;AAG9D,kCAAoD;AAEpD,sCAAuC;AACvC,8CAAgF;AAChF,0BAA4B;AAE5B,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,IAAI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C,CAAA;IAC5D,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAE5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,iCAAiC,EAAE,GAAS,EAAE;IACjD,MAAM,OAAO,GAAW,WAAO,CAAC,kBAAkB,CAAA;IAClD,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAA;IACvE,MAAM,GAAG,GAAiB,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAE5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,iCAAiC,EAAE,GAAS,EAAE;IACjD,MAAM,OAAO,GAAW,WAAO,CAAC,cAAc,CAAA;IAC9C,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,8BAA8B,CAAC,CAAA;IACpE,MAAM,GAAG,GAAiB,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAE5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { AsciiParser, AsciiView, AsciiChars } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { JsonHelper, getDefinitions } from '../util'\r\nimport { ISessionDescription } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { AsciiMsgTransmitter, AsciiSessionMsgFactory } from '../transport/ascii'\r\nimport { MsgType } from '..'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet session: AsciiMsgTransmitter\r\nconst root: string = path.join(__dirname, '../../data/examples/FIX.4.4/repo/')\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, '../../../session/test-initiator.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n jsonHelper = new JsonHelper(definitions)\r\n const config = new JsFixConfig(new AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (msgType: string, msg: ILooseObject): Promise<ILooseObject> {\r\n // encode to FIX format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const parser: AsciiParser = new AsciiParser(definitions, session.encodeStream, AsciiChars.Pipe)\r\n parser.on('msg', (msgType: string, view: AsciiView) => {\r\n const o = view.toObject()\r\n delete o['StandardHeader']\r\n delete o['StandardTrailer']\r\n resolve(o)\r\n })\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n // encode the message\r\n session.send(msgType, msg)\r\n })\r\n}\r\n\r\ntest('check 1 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(1)\r\n expect(cs.CheckSum).toEqual('001')\r\n})\r\n\r\ntest('check 2 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(10)\r\n expect(cs.CheckSum).toEqual('010')\r\n})\r\n\r\ntest('check 3 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(100)\r\n expect(cs.CheckSum).toEqual('100')\r\n})\r\n\r\ntest('AE object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.TradeCaptureReport\r\n const file: string = path.join(root, 'trade-capture/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n\r\ntest('d object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.SecurityDefinition\r\n const file: string = path.join(root, 'security-definition/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n\r\ntest('D object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.NewOrderSingle\r\n const file: string = path.join(root, 'new-order-single/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const path = require("path");
|
|
13
|
-
const transport_1 = require("../transport");
|
|
14
|
-
const config_1 = require("../config");
|
|
15
|
-
const buffer_1 = require("../buffer");
|
|
16
|
-
const util_1 = require("../util");
|
|
17
|
-
let definitions;
|
|
18
|
-
let jsonHelper;
|
|
19
|
-
let sessionDescription;
|
|
20
|
-
const root = path.join(__dirname, '../../data/examples/FIXML');
|
|
21
|
-
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
sessionDescription = require(path.join(root, '../../session/test-initiator.json'));
|
|
23
|
-
definitions = yield (0, util_1.getDefinitions)('repofixml');
|
|
24
|
-
jsonHelper = new util_1.JsonHelper(definitions);
|
|
25
|
-
}), 45000);
|
|
26
|
-
function testEncodeDecode(asObj, msgType) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const fe = new buffer_1.FixmlEncoder(new buffer_1.ElasticBuffer(), definitions);
|
|
30
|
-
fe.encode(asObj, msgType);
|
|
31
|
-
const fixml = fe.buffer.toString();
|
|
32
|
-
const config = new config_1.JsFixConfig(null, definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
33
|
-
const xmlParser = new buffer_1.FiXmlParser(config, new transport_1.StringDuplex(fixml).readable);
|
|
34
|
-
if (asObj.Batch) {
|
|
35
|
-
xmlParser.on('batch', (msgType, v) => {
|
|
36
|
-
const o = v.toObject();
|
|
37
|
-
resolve(o);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
xmlParser.on('msg', (msgType, v) => {
|
|
42
|
-
const o = v.toObject();
|
|
43
|
-
resolve(o);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
xmlParser.on('error', (e) => {
|
|
47
|
-
reject(e);
|
|
48
|
-
});
|
|
49
|
-
}));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
test('MktDataFull settle fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
const msgType = 'MktDataFull';
|
|
54
|
-
const file = path.join(root, 'cme/md/settle');
|
|
55
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
56
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
57
|
-
expect(o).toEqual(asObj);
|
|
58
|
-
}), 1000);
|
|
59
|
-
test('AllocInstrctn fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
-
const msgType = 'AllocInstrctn';
|
|
61
|
-
const file = path.join(root, 'cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/');
|
|
62
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
63
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
64
|
-
expect(o).toEqual(asObj);
|
|
65
|
-
}), 1000);
|
|
66
|
-
test('AllocRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
-
const msgType = 'AllocRpt';
|
|
68
|
-
const file = path.join(root, 'cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/');
|
|
69
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
70
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
71
|
-
expect(o).toEqual(asObj);
|
|
72
|
-
}), 1000);
|
|
73
|
-
test('TrdCaptRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
-
const msgType = 'TrdCaptRpt';
|
|
75
|
-
const file = path.join(root, 'cme/tc/Delivery Fixed Commodity Swap');
|
|
76
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
77
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
78
|
-
expect(o).toEqual(asObj);
|
|
79
|
-
}), 1000);
|
|
80
|
-
test('MktDataFull fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
const msgType = 'MktDataFull';
|
|
82
|
-
const file = path.join(root, 'cme/md/futures');
|
|
83
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
84
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
85
|
-
expect(o).toEqual(asObj);
|
|
86
|
-
}), 1000);
|
|
87
|
-
test('UserReq logon fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
-
const msgType = 'UserReq';
|
|
89
|
-
const file = path.join(root, 'cme/ur/logon');
|
|
90
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
91
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
92
|
-
expect(o).toEqual(asObj);
|
|
93
|
-
}), 1000);
|
|
94
|
-
test('UserReq logoff fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
|
-
const msgType = 'UserReq';
|
|
96
|
-
const file = path.join(root, 'cme/ur/logoff');
|
|
97
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
98
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
99
|
-
expect(o).toEqual(asObj);
|
|
100
|
-
}), 1000);
|
|
101
|
-
test('TrdCaptRpt 2 fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
-
const msgType = 'TrdCaptRpt';
|
|
103
|
-
const file = path.join(root, 'cme/tc/Initial Single Side Submission');
|
|
104
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
105
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
106
|
-
expect(o).toEqual(asObj);
|
|
107
|
-
}), 1000);
|
|
108
|
-
test('TrdCaptRpt 3 fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
-
const msgType = 'TrdCaptRpt';
|
|
110
|
-
const file = path.join(root, 'cme/tc/Accepted Unmatched');
|
|
111
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
112
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
113
|
-
expect(o).toEqual(asObj);
|
|
114
|
-
}), 1000);
|
|
115
|
-
test('TrdCaptRptReq fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
|
-
const msgType = 'TrdCaptRptReq';
|
|
117
|
-
const file = path.join(root, 'cme/tc/Trading Firm Continued Subscription');
|
|
118
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
119
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
120
|
-
expect(o).toEqual(asObj);
|
|
121
|
-
}), 1000);
|
|
122
|
-
test('Order fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
-
const msgType = 'Order';
|
|
124
|
-
const file = path.join(root, 'om/nso');
|
|
125
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
126
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
127
|
-
expect(o).toEqual(asObj);
|
|
128
|
-
}), 1000);
|
|
129
|
-
test('ExecRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
-
const msgType = 'ExecRpt';
|
|
131
|
-
const file = path.join(root, 'om/er');
|
|
132
|
-
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
133
|
-
const o = yield testEncodeDecode(asObj, msgType);
|
|
134
|
-
expect(o).toEqual(asObj);
|
|
135
|
-
}), 1000);
|
|
136
|
-
//# sourceMappingURL=repo-full-fixml-msg.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repo-full-fixml-msg.test.js","sourceRoot":"","sources":["../../src/test/repo-full-fixml-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAG5B,4CAAgE;AAChE,sCAAuC;AACvC,sCAAoG;AACpG,kCAAoD;AAEpD,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,IAAI,kBAAuC,CAAA;AAC3C,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAA;AAEtE,SAAS,CAAC,GAAS,EAAE;IACnB,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC,CAAA;IAClF,WA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AAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,sBAAsB,EAAE,GAAS,EAAE;IACtC,MAAM,OAAO,GAAW,SAAS,CAAA;IACjC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,OAAO,CAAC,CAAA;IAC5C,MAAM,KAAK,GAAiB,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,cAAc,EAAE,OAAO,CAAC,CAAA;IAC/E,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, StringDuplex } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { MsgView, ElasticBuffer, MsgParser, AsciiChars, FixmlEncoder, FiXmlParser } from '../buffer'\r\nimport { getDefinitions, JsonHelper } from '../util'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet sessionDescription: ISessionDescription\r\nconst root: string = path.join(__dirname, '../../data/examples/FIXML')\r\n\r\nbeforeAll(async () => {\r\n sessionDescription = require(path.join(root, '../../session/test-initiator.json'))\r\n definitions = await getDefinitions('repofixml')\r\n jsonHelper = new JsonHelper(definitions)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (asObj: ILooseObject, msgType: string): Promise<ILooseObject> {\r\n // encode to FIXML format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(asObj, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const xmlParser: MsgParser = new FiXmlParser(config, new StringDuplex(fixml).readable)\r\n if (asObj.Batch) {\r\n xmlParser.on('batch', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n } else {\r\n xmlParser.on('msg', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n }\r\n\r\n xmlParser.on('error', (e) => {\r\n reject(e)\r\n })\r\n })\r\n}\r\n\r\ntest('MktDataFull settle fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'cme/md/settle')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocInstrctn fixml object', async () => {\r\n const msgType: string = 'AllocInstrctn'\r\n const file: string = path.join(root,'cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocRpt fixml object', async () => {\r\n const msgType: string = 'AllocRpt'\r\n const file: string = path.join(root,'cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Delivery Fixed Commodity Swap')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('MktDataFull fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'cme/md/futures')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logon fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'cme/ur/logon')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logoff fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'cme/ur/logoff')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 2 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Initial Single Side Submission')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 3 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Accepted Unmatched')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRptReq fixml object', async () => {\r\n const msgType: string = 'TrdCaptRptReq'\r\n const file: string = path.join(root,'cme/tc/Trading Firm Continued Subscription')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('Order fixml object', async () => {\r\n const msgType: string = 'Order'\r\n const file: string = path.join(root,'om/nso')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('ExecRpt fixml object', async () => {\r\n const msgType: string = 'ExecRpt'\r\n const file: string = path.join(root,'om/er')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const transport_1 = require("../transport");
|
|
13
|
-
const fix_session_state_1 = require("../transport/fix-session-state");
|
|
14
|
-
const tick_action_1 = require("../transport/tick-action");
|
|
15
|
-
let state;
|
|
16
|
-
let now;
|
|
17
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
state = new fix_session_state_1.FixSessionState({ heartBeat: 30 });
|
|
19
|
-
state.state = transport_1.SessionState.InitiationLogonResponse;
|
|
20
|
-
now = new Date(2018, 0, 1, 20, 0, 0, 0);
|
|
21
|
-
state.LastSentAt = now;
|
|
22
|
-
state.lastReceivedAt = now;
|
|
23
|
-
state.peerHeartBeatSecs = 30;
|
|
24
|
-
state.lastPeerMsgSeqNum = 1;
|
|
25
|
-
}));
|
|
26
|
-
test('do nothing', () => {
|
|
27
|
-
const action = state.calcAction(now);
|
|
28
|
-
expect(action).toEqual(tick_action_1.TickAction.Nothing);
|
|
29
|
-
});
|
|
30
|
-
test('heartbeat', () => {
|
|
31
|
-
const next = new Date(now.getTime() + 31 * 1000);
|
|
32
|
-
state.lastReceivedAt = next;
|
|
33
|
-
const action = state.calcAction(next);
|
|
34
|
-
expect(state.timeToDie()).toEqual(false);
|
|
35
|
-
expect(state.timeToHeartbeat()).toEqual(true);
|
|
36
|
-
expect(state.timeToTerminate()).toEqual(false);
|
|
37
|
-
expect(state.timeToTestRequest()).toEqual(false);
|
|
38
|
-
expect(action).toEqual(tick_action_1.TickAction.Heartbeat);
|
|
39
|
-
});
|
|
40
|
-
test('testrequest', () => {
|
|
41
|
-
const next = new Date(now.getTime() + 51 * 1000);
|
|
42
|
-
state.LastSentAt = next;
|
|
43
|
-
const action = state.calcAction(next);
|
|
44
|
-
expect(state.timeToDie()).toEqual(false);
|
|
45
|
-
expect(state.timeToHeartbeat()).toEqual(false);
|
|
46
|
-
expect(state.timeToTerminate()).toEqual(false);
|
|
47
|
-
expect(state.timeToTestRequest()).toEqual(true);
|
|
48
|
-
expect(action).toEqual(tick_action_1.TickAction.TestRequest);
|
|
49
|
-
});
|
|
50
|
-
test('testrequest - no response', () => {
|
|
51
|
-
const next = new Date(now.getTime() + 55 * 2 * 1000);
|
|
52
|
-
state.LastSentAt = next;
|
|
53
|
-
state.lastTestRequestAt = now;
|
|
54
|
-
const action = state.calcAction(next);
|
|
55
|
-
expect(state.timeToDie()).toEqual(false);
|
|
56
|
-
expect(state.timeToHeartbeat()).toEqual(false);
|
|
57
|
-
expect(state.timeToTerminate()).toEqual(true);
|
|
58
|
-
expect(state.timeToTestRequest()).toEqual(true);
|
|
59
|
-
expect(action).toEqual(tick_action_1.TickAction.TerminateOnError);
|
|
60
|
-
});
|
|
61
|
-
test('time to die - no logout response', () => {
|
|
62
|
-
const next = new Date(now.getTime() + 20 * 1000);
|
|
63
|
-
state.state = transport_1.SessionState.WaitingLogoutConfirm;
|
|
64
|
-
state.LastSentAt = now;
|
|
65
|
-
state.lastReceivedAt = now;
|
|
66
|
-
state.logoutSentAt = now;
|
|
67
|
-
const action = state.calcAction(next);
|
|
68
|
-
expect(state.timeToDie()).toEqual(true);
|
|
69
|
-
expect(state.timeToHeartbeat()).toEqual(false);
|
|
70
|
-
expect(state.timeToTerminate()).toEqual(false);
|
|
71
|
-
expect(state.timeToTestRequest()).toEqual(false);
|
|
72
|
-
expect(action).toEqual(tick_action_1.TickAction.Stop);
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=session-state.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-state.test.js","sourceRoot":"","sources":["../../src/test/session-state.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4CAA2C;AAC3C,sEAAgE;AAChE,0DAAqD;AAErD,IAAI,KAAsB,CAAA;AAC1B,IAAI,GAAS,CAAA;AAEb,UAAU,CAAC,GAAS,EAAE;IACpB,KAAK,GAAG,IAAI,mCAAe,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAA;IAC9C,KAAK,CAAC,KAAK,GAAG,wBAAY,CAAC,uBAAuB,CAAA;IAClD,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACvC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAA;IACtB,KAAK,CAAC,cAAc,GAAG,GAAG,CAAA;IAC1B,KAAK,CAAC,iBAAiB,GAAG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AAA;AAEF,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC5C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;IAChD,KAAK,CAAC,KAAK,GAAG,wBAAY,CAAC,oBAAoB,CAAA;IAC/C,KAAK,CAAC,UAAU,GAAG,GAAG,CAAA;IACtB,KAAK,CAAC,cAAc,GAAG,GAAG,CAAA;IAC1B,KAAK,CAAC,YAAY,GAAG,GAAG,CAAA;IACxB,MAAM,MAAM,GAAe,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAEjD,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAEhD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,wBAAU,CAAC,IAAI,CAAC,CAAA;AACzC,CAAC,CAAC,CAAA","sourcesContent":["import { SessionState } from '../transport'\r\nimport { FixSessionState } from '../transport/fix-session-state'\r\nimport { TickAction } from '../transport/tick-action'\r\n\r\nlet state: FixSessionState\r\nlet now: Date\r\n\r\nbeforeEach(async () => {\r\n state = new FixSessionState({ heartBeat: 30 })\r\n state.state = SessionState.InitiationLogonResponse\r\n now = new Date(2018, 0, 1, 20, 0, 0, 0)\r\n state.LastSentAt = now\r\n state.lastReceivedAt = now\r\n state.peerHeartBeatSecs = 30\r\n state.lastPeerMsgSeqNum = 1\r\n})\r\n\r\ntest('do nothing', () => {\r\n const action: TickAction = state.calcAction(now)\r\n expect(action).toEqual(TickAction.Nothing)\r\n})\r\n\r\ntest('heartbeat', () => {\r\n const next = new Date(now.getTime() + 31 * 1000)\r\n state.lastReceivedAt = next\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(false)\r\n expect(state.timeToHeartbeat()).toEqual(true)\r\n expect(state.timeToTerminate()).toEqual(false)\r\n expect(state.timeToTestRequest()).toEqual(false)\r\n\r\n expect(action).toEqual(TickAction.Heartbeat)\r\n})\r\n\r\ntest('testrequest', () => {\r\n const next = new Date(now.getTime() + 51 * 1000)\r\n state.LastSentAt = next\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(false)\r\n expect(state.timeToHeartbeat()).toEqual(false)\r\n expect(state.timeToTerminate()).toEqual(false)\r\n expect(state.timeToTestRequest()).toEqual(true)\r\n\r\n expect(action).toEqual(TickAction.TestRequest)\r\n})\r\n\r\ntest('testrequest - no response', () => {\r\n const next = new Date(now.getTime() + 55 * 2 * 1000)\r\n state.LastSentAt = next\r\n state.lastTestRequestAt = now\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(false)\r\n expect(state.timeToHeartbeat()).toEqual(false)\r\n expect(state.timeToTerminate()).toEqual(true)\r\n expect(state.timeToTestRequest()).toEqual(true)\r\n\r\n expect(action).toEqual(TickAction.TerminateOnError)\r\n})\r\n\r\ntest('time to die - no logout response', () => {\r\n const next = new Date(now.getTime() + 20 * 1000)\r\n state.state = SessionState.WaitingLogoutConfirm\r\n state.LastSentAt = now\r\n state.lastReceivedAt = now\r\n state.logoutSentAt = now\r\n const action: TickAction = state.calcAction(next)\r\n\r\n expect(state.timeToDie()).toEqual(true)\r\n expect(state.timeToHeartbeat()).toEqual(false)\r\n expect(state.timeToTerminate()).toEqual(false)\r\n expect(state.timeToTestRequest()).toEqual(false)\r\n\r\n expect(action).toEqual(TickAction.Stop)\r\n})\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|