jspurefix 1.4.1 → 2.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/appveyor.yml +3 -0
- package/data/session/certs/ca/ca.crt +33 -0
- package/data/session/certs/ca/ca.key +54 -0
- package/data/session/certs/client/client.crt +31 -0
- package/data/session/certs/client/client.key +51 -0
- package/data/session/certs/server/server.crt +31 -0
- package/data/session/certs/server/server.key +51 -0
- package/dist/a-session-msg-factory.d.ts +0 -0
- package/dist/a-session-msg-factory.js +1 -0
- package/dist/a-session-msg-factory.js.map +1 -0
- package/dist/ascii-encoder.test.d.ts +0 -0
- package/dist/ascii-encoder.test.js +1 -0
- package/dist/ascii-encoder.test.js.map +1 -0
- package/dist/ascii-parser.test.d.ts +0 -0
- package/dist/ascii-parser.test.js +1 -0
- package/dist/ascii-parser.test.js.map +1 -0
- package/dist/ascii-segment.test.d.ts +0 -0
- package/dist/ascii-segment.test.js +1 -0
- package/dist/ascii-segment.test.js.map +1 -0
- package/dist/ascii-store-replay.test.d.ts +0 -0
- package/dist/ascii-store-replay.test.js +1 -0
- package/dist/ascii-store-replay.test.js.map +1 -0
- package/dist/ascii-tag-pos.test.d.ts +0 -0
- package/dist/ascii-tag-pos.test.js +1 -0
- package/dist/ascii-tag-pos.test.js.map +1 -0
- package/dist/buffer/{ascii-chars.d.ts → ascii/ascii-chars.d.ts} +0 -0
- package/dist/buffer/{ascii-chars.js → ascii/ascii-chars.js} +0 -0
- package/dist/buffer/ascii/ascii-chars.js.map +1 -0
- package/dist/buffer/ascii/ascii-encoder.d.ts +4 -2
- package/dist/buffer/ascii/ascii-encoder.js +54 -32
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser-state.d.ts +3 -10
- package/dist/buffer/ascii/ascii-parser-state.js +37 -25
- package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser.d.ts +7 -7
- package/dist/buffer/ascii/ascii-parser.js +50 -24
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.d.ts +2 -2
- package/dist/buffer/ascii/ascii-segment-parser.js +34 -13
- package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +2 -4
- package/dist/buffer/ascii/ascii-view.js +11 -15
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/ascii/index.d.ts +1 -0
- package/dist/buffer/ascii/index.js +1 -0
- package/dist/buffer/ascii/index.js.map +1 -1
- package/dist/buffer/ascii/parse-state.d.ts +8 -0
- package/dist/buffer/ascii/parse-state.js +13 -0
- package/dist/buffer/ascii/parse-state.js.map +1 -0
- package/dist/buffer/ascii/time-formatter.js +1 -1
- package/dist/buffer/ascii/time-formatter.js.map +1 -1
- package/dist/buffer/elastic-buffer.js +29 -8
- package/dist/buffer/elastic-buffer.js.map +1 -1
- package/dist/buffer/encode-proxy.d.ts +1 -1
- package/dist/buffer/encode-proxy.js +16 -17
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.d.ts +2 -1
- package/dist/buffer/fixml/fixml-encoder.js +43 -20
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-parser.js +47 -24
- package/dist/buffer/fixml/fixml-parser.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.d.ts +2 -4
- package/dist/buffer/fixml/fixml-view.js +13 -16
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/fixml/populated-attributes.d.ts +5 -0
- package/dist/buffer/fixml/populated-attributes.js +3 -0
- package/dist/buffer/fixml/populated-attributes.js.map +1 -0
- package/dist/buffer/index.d.ts +4 -8
- package/dist/buffer/index.js +4 -8
- package/dist/buffer/index.js.map +1 -1
- package/dist/buffer/msg-encoder.d.ts +2 -1
- package/dist/buffer/msg-encoder.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +3 -5
- package/dist/buffer/msg-view.js +8 -5
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/buffer/segment/segment-description.d.ts +26 -0
- package/dist/buffer/segment/segment-description.js +72 -0
- package/dist/buffer/segment/segment-description.js.map +1 -0
- package/dist/buffer/segment/segment-summary.d.ts +13 -0
- package/dist/buffer/segment/segment-summary.js +20 -0
- package/dist/buffer/segment/segment-summary.js.map +1 -0
- package/dist/buffer/segment/segment-type.d.ts +8 -0
- package/dist/buffer/segment/segment-type.js +13 -0
- package/dist/buffer/segment/segment-type.js.map +1 -0
- package/dist/buffer/segment-description.d.ts +2 -9
- package/dist/buffer/segment-description.js +5 -13
- package/dist/buffer/segment-description.js.map +1 -1
- package/dist/buffer/segment-type.d.ts +8 -0
- package/dist/buffer/segment-type.js +13 -0
- package/dist/buffer/segment-type.js.map +1 -0
- package/dist/buffer/structure.d.ts +3 -3
- package/dist/buffer/structure.js +1 -1
- package/dist/buffer/structure.js.map +1 -1
- package/dist/buffer/tag/tag-pos.d.ts +12 -0
- package/dist/buffer/tag/tag-pos.js +55 -0
- package/dist/buffer/tag/tag-pos.js.map +1 -0
- package/dist/buffer/tag/tag-type.d.ts +13 -0
- package/dist/buffer/tag/tag-type.js +18 -0
- package/dist/buffer/tag/tag-type.js.map +1 -0
- package/dist/buffer/tag/tags.d.ts +21 -0
- package/dist/buffer/tag/tags.js +122 -0
- package/dist/buffer/tag/tags.js.map +1 -0
- package/dist/buffer/tag-type.d.ts +13 -0
- package/dist/buffer/tag-type.js +18 -0
- package/dist/buffer/tag-type.js.map +1 -0
- package/dist/buffer/tags.d.ts +3 -14
- package/dist/buffer/tags.js +23 -36
- package/dist/buffer/tags.js.map +1 -1
- package/dist/config/get-js-fx-logger.d.ts +4 -0
- package/dist/{transport/make-fixl-session.js → config/get-js-fx-logger.js} +1 -1
- package/dist/config/get-js-fx-logger.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/js-fix-config.d.ts +4 -1
- package/dist/config/js-fix-config.js +3 -3
- package/dist/config/js-fix-config.js.map +1 -1
- package/dist/config/js-fix-logger.d.ts +0 -3
- package/dist/config/js-fix-logger.js.map +1 -1
- package/dist/dict-parser.js +28 -23
- package/dist/dict-parser.js.map +1 -1
- package/dist/dictionary/compiler/compiler-type.js +7 -7
- package/dist/dictionary/compiler/compiler-type.js.map +1 -1
- package/dist/dictionary/compiler/enum-compiler.d.ts +1 -0
- package/dist/dictionary/compiler/enum-compiler.js +11 -1
- package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
- package/dist/dictionary/compiler/msg-compiler.js +8 -6
- package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
- package/dist/dictionary/contained/contained-component-field.js +2 -1
- package/dist/dictionary/contained/contained-component-field.js.map +1 -1
- package/dist/dictionary/contained/contained-field-dispatch.d.ts +1 -14
- package/dist/dictionary/contained/contained-field-dispatch.js +4 -4
- package/dist/dictionary/contained/contained-field-dispatch.js.map +1 -1
- package/dist/dictionary/contained/contained-field-dispatcher.d.ts +14 -0
- package/dist/dictionary/contained/contained-field-dispatcher.js +3 -0
- package/dist/dictionary/contained/contained-field-dispatcher.js.map +1 -0
- package/dist/dictionary/contained/contained-field-set.d.ts +1 -1
- package/dist/dictionary/contained/contained-field-set.js +12 -11
- package/dist/dictionary/contained/contained-field-set.js.map +1 -1
- package/dist/dictionary/contained/contained-field-type.d.ts +5 -0
- package/dist/dictionary/contained/contained-field-type.js +10 -0
- package/dist/dictionary/contained/contained-field-type.js.map +1 -0
- package/dist/dictionary/contained/contained-field.d.ts +1 -5
- package/dist/dictionary/contained/contained-field.js +1 -7
- package/dist/dictionary/contained/contained-field.js.map +1 -1
- package/dist/dictionary/contained/contained-group-field.js +2 -1
- package/dist/dictionary/contained/contained-group-field.js.map +1 -1
- package/dist/dictionary/contained/contained-simple-field.js +2 -1
- package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
- package/dist/dictionary/{fields-dispatch.d.ts → contained/field-dispatcher.d.ts} +3 -2
- package/dist/dictionary/contained/field-dispatcher.js +3 -0
- package/dist/dictionary/contained/field-dispatcher.js.map +1 -0
- package/dist/dictionary/contained/fields-dispatch.d.ts +6 -0
- package/dist/dictionary/contained/fields-dispatch.js +42 -0
- package/dist/dictionary/contained/fields-dispatch.js.map +1 -0
- package/dist/dictionary/contained/index.d.ts +2 -0
- package/dist/dictionary/contained/index.js +2 -0
- package/dist/dictionary/contained/index.js.map +1 -1
- package/dist/dictionary/contained-set-type.d.ts +5 -0
- package/dist/dictionary/contained-set-type.js +10 -0
- package/dist/dictionary/contained-set-type.js.map +1 -0
- package/dist/dictionary/definition/component-field-definition.js +2 -2
- package/dist/dictionary/definition/component-field-definition.js.map +1 -1
- package/dist/dictionary/definition/fix-definitions.d.ts +2 -1
- package/dist/dictionary/definition/fix-definitions.js.map +1 -1
- package/dist/dictionary/definition/group-field-definition.js +2 -2
- package/dist/dictionary/definition/group-field-definition.js.map +1 -1
- package/dist/dictionary/definition/index.d.ts +0 -1
- package/dist/dictionary/definition/index.js +0 -1
- package/dist/dictionary/definition/index.js.map +1 -1
- package/dist/dictionary/definition/message-definition.js +2 -2
- package/dist/dictionary/definition/message-definition.js.map +1 -1
- package/dist/dictionary/definition/simple-field-definition.d.ts +1 -1
- package/dist/dictionary/definition/simple-field-definition.js +5 -4
- package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
- package/dist/dictionary/dict-primitive.d.ts +0 -11
- package/dist/dictionary/dict-primitive.js +0 -7
- package/dist/dictionary/dict-primitive.js.map +1 -1
- package/dist/dictionary/fix-definition-source.d.ts +6 -0
- package/dist/dictionary/fix-definition-source.js +11 -0
- package/dist/dictionary/fix-definition-source.js.map +1 -0
- package/dist/dictionary/fix-versions.d.ts +0 -9
- package/dist/dictionary/fix-versions.js +1 -39
- package/dist/dictionary/fix-versions.js.map +1 -1
- package/dist/dictionary/index.d.ts +1 -5
- package/dist/dictionary/index.js +1 -5
- package/dist/dictionary/index.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/abbreviations-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/abbreviations-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/abbreviations-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/base-parser.d.ts +2 -4
- package/dist/dictionary/parser/fix-repository/base-parser.js +1 -2
- package/dist/dictionary/parser/fix-repository/base-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/components-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/components-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/components-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/data-types-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/data-types-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/data-types-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/enums-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/enums-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/enums-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/fields-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/fields-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/fields-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/messages-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/messages-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/messages-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/msg-contents-parser.d.ts +1 -3
- package/dist/dictionary/parser/fix-repository/msg-contents-parser.js +2 -3
- package/dist/dictionary/parser/fix-repository/msg-contents-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository-abbreviation.d.ts +5 -0
- package/dist/dictionary/parser/fix-repository/repository-abbreviation.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-abbreviation.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-component.d.ts +10 -0
- package/dist/dictionary/parser/fix-repository/repository-component.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-component.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-data-type.d.ts +6 -0
- package/dist/dictionary/parser/fix-repository/repository-data-type.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-data-type.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-enum.d.ts +7 -0
- package/dist/dictionary/parser/fix-repository/repository-enum.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-enum.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-field.d.ts +11 -0
- package/dist/dictionary/parser/fix-repository/repository-field.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-field.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-message.d.ts +11 -0
- package/dist/dictionary/parser/fix-repository/repository-message.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-message.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-msg-content.d.ts +9 -0
- package/dist/dictionary/parser/fix-repository/repository-msg-content.js +3 -0
- package/dist/dictionary/parser/fix-repository/repository-msg-content.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-msg.d.ts +0 -0
- package/dist/dictionary/parser/fix-repository/repository-msg.js +1 -0
- package/dist/dictionary/parser/fix-repository/repository-msg.js.map +1 -0
- package/dist/dictionary/parser/fix-repository/repository-type.d.ts +0 -53
- package/dist/dictionary/parser/fix-repository/repository-type.js +0 -2
- package/dist/dictionary/parser/fix-repository/repository-type.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +10 -10
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository.d.ts +12 -1
- package/dist/dictionary/parser/fix-repository/repository.js +50 -28
- package/dist/dictionary/parser/fix-repository/repository.js.map +1 -1
- package/dist/dictionary/parser/fixml/components-parser.d.ts +1 -1
- package/dist/dictionary/parser/fixml/components-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/fields-parser.d.ts +1 -1
- package/dist/dictionary/parser/fixml/fields-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/fix-xsd-parser.js +3 -2
- package/dist/dictionary/parser/fixml/fix-xsd-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/include-graph.js.map +1 -1
- package/dist/dictionary/parser/fixml/xsd-parser.d.ts +1 -1
- package/dist/dictionary/parser/fixml/xsd-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-definition-parser.d.ts +4 -4
- package/dist/dictionary/parser/quickfix/field-definition-parser.js +3 -3
- package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-set-parser.d.ts +4 -4
- package/dist/dictionary/parser/quickfix/field-set-parser.js +3 -3
- package/dist/dictionary/parser/quickfix/field-set-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/message-parser.d.ts +4 -4
- package/dist/dictionary/parser/quickfix/message-parser.js +3 -3
- package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/node-parser.d.ts +4 -5
- package/dist/dictionary/parser/quickfix/node-parser.js +4 -4
- package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/parse-state.d.ts +8 -0
- package/dist/dictionary/parser/quickfix/parse-state.js +13 -0
- package/dist/dictionary/parser/quickfix/parse-state.js.map +1 -0
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.d.ts +1 -9
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +28 -35
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/dictionary/sax-node.d.ts +6 -0
- package/dist/{types/FIX4.4/quickfix/set/header.js → dictionary/sax-node.js} +1 -1
- package/dist/dictionary/sax-node.js.map +1 -0
- package/dist/dictionary/set-reduce.d.ts +5 -12
- package/dist/dictionary/set-reduce.js +28 -26
- package/dist/dictionary/set-reduce.js.map +1 -1
- package/dist/dictionary/type-dispatcher.d.ts +12 -0
- package/dist/dictionary/type-dispatcher.js +3 -0
- package/dist/dictionary/type-dispatcher.js.map +1 -0
- package/dist/dictionary/version-util.d.ts +4 -0
- package/dist/dictionary/version-util.js +36 -0
- package/dist/dictionary/version-util.js.map +1 -0
- package/dist/execution-report.test.d.ts +0 -0
- package/dist/execution-report.test.js +1 -0
- package/dist/execution-report.test.js.map +1 -0
- package/dist/experiment.d.ts +0 -0
- package/dist/experiment.js +1 -0
- package/dist/experiment.js.map +1 -0
- package/dist/fix-repo-dict.test.d.ts +0 -0
- package/dist/fix-repo-dict.test.js +1 -0
- package/dist/fix-repo-dict.test.js.map +1 -0
- package/dist/fix-session-state-args.d.ts +0 -0
- package/dist/fix-session-state-args.js +1 -0
- package/dist/fix-session-state-args.js.map +1 -0
- package/dist/fix-session-state.d.ts +0 -0
- package/dist/fix-session-state.js +1 -0
- package/dist/fix-session-state.js.map +1 -0
- package/dist/fix-session.d.ts +0 -0
- package/dist/fix-session.js +1 -0
- package/dist/fix-session.js.map +1 -0
- package/dist/fix.txt +1 -0
- package/dist/fixml-alloc-parse.test.d.ts +0 -0
- package/dist/fixml-alloc-parse.test.js +1 -0
- package/dist/fixml-alloc-parse.test.js.map +1 -0
- package/dist/fixml-mkt-data-fut-parse.test.d.ts +0 -0
- package/dist/fixml-mkt-data-fut-parse.test.js +1 -0
- package/dist/fixml-mkt-data-fut-parse.test.js.map +1 -0
- package/dist/fixml-mkt-data-settle-parse.test.d.ts +0 -0
- package/dist/fixml-mkt-data-settle-parse.test.js +1 -0
- package/dist/fixml-mkt-data-settle-parse.test.js.map +1 -0
- package/dist/fixml-tc-bi-lateral-parse.test.d.ts +0 -0
- package/dist/fixml-tc-bi-lateral-parse.test.js +1 -0
- package/dist/fixml-tc-bi-lateral-parse.test.js.map +1 -0
- package/dist/includes.test.d.ts +0 -0
- package/dist/includes.test.js +1 -0
- package/dist/includes.test.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsfix-cmd.d.ts +5 -0
- package/dist/jsfix-cmd.js +28 -21
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/launcher.d.ts +0 -0
- package/dist/launcher.js +1 -0
- package/dist/launcher.js.map +1 -0
- package/dist/logon.test.d.ts +0 -0
- package/dist/logon.test.js +1 -0
- package/dist/logon.test.js.map +1 -0
- package/dist/make-fix-session.d.ts +0 -0
- package/dist/make-fix-session.js +1 -0
- package/dist/make-fix-session.js.map +1 -0
- package/dist/memory-store.test.d.ts +0 -0
- package/dist/memory-store.test.js +1 -0
- package/dist/memory-store.test.js.map +1 -0
- package/dist/object.json +691 -0
- package/dist/qf-full-msg.test.d.ts +0 -0
- package/dist/qf-full-msg.test.js +1 -0
- package/dist/qf-full-msg.test.js.map +1 -0
- package/dist/repo-full-ascii-msg.test.d.ts +0 -0
- package/dist/repo-full-ascii-msg.test.js +1 -0
- package/dist/repo-full-ascii-msg.test.js.map +1 -0
- package/dist/runtime/DITokens.d.ts +20 -0
- package/dist/runtime/DITokens.js +25 -0
- package/dist/runtime/DITokens.js.map +1 -0
- package/dist/runtime/app-launcher.d.ts +27 -0
- package/dist/runtime/app-launcher.js +131 -0
- package/dist/runtime/app-launcher.js.map +1 -0
- package/dist/runtime/di-tokens.d.ts +28 -0
- package/dist/runtime/di-tokens.js +33 -0
- package/dist/runtime/di-tokens.js.map +1 -0
- package/dist/runtime/engine-factory.d.ts +4 -0
- package/dist/runtime/engine-factory.js +3 -0
- package/dist/runtime/engine-factory.js.map +1 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +18 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/launcher.d.ts +29 -0
- package/dist/runtime/launcher.js +131 -0
- package/dist/runtime/launcher.js.map +1 -0
- package/dist/runtime/make-config.d.ts +11 -0
- package/dist/runtime/make-config.js +57 -0
- package/dist/runtime/make-config.js.map +1 -0
- package/dist/runtime/session-container.d.ts +16 -0
- package/dist/runtime/session-container.js +168 -0
- package/dist/runtime/session-container.js.map +1 -0
- package/dist/runtime/session-launcher.d.ts +26 -0
- package/dist/runtime/session-launcher.js +131 -0
- package/dist/runtime/session-launcher.js.map +1 -0
- package/dist/sample/http/oms/app.d.ts +1 -1
- package/dist/sample/http/oms/app.js +16 -14
- package/dist/sample/http/oms/app.js.map +1 -1
- package/dist/sample/http/oms/http-client.js +22 -2
- package/dist/sample/http/oms/http-client.js.map +1 -1
- package/dist/sample/http/oms/http-server.js +21 -2
- package/dist/sample/http/oms/http-server.js.map +1 -1
- package/dist/sample/launcher.d.ts +21 -4
- package/dist/sample/launcher.js +87 -19
- package/dist/sample/launcher.js.map +1 -1
- package/dist/sample/tcp/qf-md/app.d.ts +1 -1
- package/dist/sample/tcp/qf-md/app.js +11 -11
- package/dist/sample/tcp/qf-md/app.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-client.js +21 -2
- package/dist/sample/tcp/qf-md/md-client.js.map +1 -1
- package/dist/sample/tcp/qf-md/md-server.js +20 -2
- package/dist/sample/tcp/qf-md/md-server.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/app.d.ts +1 -1
- package/dist/sample/tcp/recovering-skeleton/app.js +36 -16
- package/dist/sample/tcp/recovering-skeleton/app.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.d.ts +3 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +30 -8
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.d.ts +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js +22 -3
- package/dist/sample/tcp/recovering-skeleton/skeleton-client.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js +21 -2
- package/dist/sample/tcp/recovering-skeleton/skeleton-server.js.map +1 -1
- package/dist/sample/tcp/skeleton/app.d.ts +1 -1
- package/dist/sample/tcp/skeleton/app.js +8 -13
- package/dist/sample/tcp/skeleton/app.js.map +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.d.ts +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.js +26 -4
- package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.d.ts +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js +4 -24
- package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/app-launcher.d.ts +6 -0
- package/dist/sample/tcp/trade-capture/app-launcher.js +21 -0
- package/dist/sample/tcp/trade-capture/app-launcher.js.map +1 -0
- package/dist/sample/tcp/trade-capture/app-launher.d.ts +0 -0
- package/dist/sample/tcp/trade-capture/app-launher.js +1 -0
- package/dist/sample/tcp/trade-capture/app-launher.js.map +1 -0
- package/dist/sample/tcp/trade-capture/app.d.ts +1 -1
- package/dist/sample/tcp/trade-capture/app.js +4 -21
- package/dist/sample/tcp/trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/jsfix.test_client.txt +11 -0
- package/dist/sample/tcp/trade-capture/jsfix.test_server.txt +10 -0
- package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-server.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-factory.js +7 -1
- package/dist/sample/tcp/trade-capture/trade-factory.js.map +1 -1
- package/dist/segment-description.d.ts +0 -0
- package/dist/segment-description.js +1 -0
- package/dist/segment-description.js.map +1 -0
- package/dist/segment-summary.d.ts +0 -0
- package/dist/segment-summary.js +1 -0
- package/dist/segment-summary.js.map +1 -0
- package/dist/segment-type.d.ts +0 -0
- package/dist/segment-type.js +1 -0
- package/dist/segment-type.js.map +1 -0
- package/dist/session-description.d.ts +0 -0
- package/dist/session-description.js +1 -0
- package/dist/session-description.js.map +1 -0
- package/dist/session-msg-factory.d.ts +0 -0
- package/dist/session-msg-factory.js +1 -0
- package/dist/session-msg-factory.js.map +1 -0
- package/dist/session-state.d.ts +0 -0
- package/dist/session-state.js +1 -0
- package/dist/session-state.js.map +1 -0
- package/dist/session-state.test.d.ts +0 -0
- package/dist/session-state.test.js +1 -0
- package/dist/session-state.test.js.map +1 -0
- package/dist/session.test.d.ts +0 -0
- package/dist/session.test.js +1 -0
- package/dist/session.test.js.map +1 -0
- package/dist/setup.d.ts +0 -0
- package/dist/setup.js +1 -0
- package/dist/setup.js.map +1 -0
- package/dist/skeleton-runner.d.ts +0 -0
- package/dist/skeleton-runner.js +1 -0
- package/dist/skeleton-runner.js.map +1 -0
- package/dist/store/fix-msg-ascii-store-resend.d.ts +1 -1
- package/dist/store/fix-msg-ascii-store-resend.js +2 -1
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-memory-store.d.ts +1 -1
- package/dist/store/fix-msg-memory-store.js.map +1 -1
- package/dist/store/fix-msg-store-record.d.ts +2 -0
- package/dist/store/fix-msg-store-record.js +4 -0
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/store/fix-msg-store-state.d.ts +6 -0
- package/dist/store/fix-msg-store-state.js +3 -0
- package/dist/store/fix-msg-store-state.js.map +1 -0
- package/dist/store/fix-msg-store.d.ts +1 -6
- package/dist/store/fix-msg-store.js.map +1 -1
- package/dist/structure.json +631 -0
- package/dist/tag-pos.d.ts +0 -0
- package/dist/tag-pos.js +1 -0
- package/dist/tag-pos.js.map +1 -0
- package/dist/tag-type.d.ts +0 -0
- package/dist/tag-type.js +1 -0
- package/dist/tag-type.js.map +1 -0
- package/dist/tags.d.ts +0 -0
- package/dist/tags.js +1 -0
- package/dist/tags.js.map +1 -0
- package/dist/test/ascii/ascii-encoder.test.d.ts +1 -0
- package/dist/test/{ascii-encode.test.js → ascii/ascii-encoder.test.js} +140 -49
- package/dist/test/ascii/ascii-encoder.test.js.map +1 -0
- package/dist/test/ascii/ascii-parser.test.d.ts +1 -0
- package/dist/test/ascii/ascii-parser.test.js +123 -0
- package/dist/test/ascii/ascii-parser.test.js.map +1 -0
- package/dist/test/ascii/ascii-segment.test.d.ts +1 -0
- package/dist/test/ascii/ascii-segment.test.js +86 -0
- package/dist/test/ascii/ascii-segment.test.js.map +1 -0
- package/dist/test/ascii/ascii-store-replay.test.d.ts +1 -0
- package/dist/test/ascii/ascii-store-replay.test.js +92 -0
- package/dist/test/ascii/ascii-store-replay.test.js.map +1 -0
- package/dist/test/ascii/ascii-tag-pos.test.d.ts +1 -0
- package/dist/test/ascii/ascii-tag-pos.test.js +105 -0
- package/dist/test/ascii/ascii-tag-pos.test.js.map +1 -0
- package/dist/test/ascii/execution-report.test.d.ts +1 -0
- package/dist/test/ascii/execution-report.test.js +489 -0
- package/dist/test/ascii/execution-report.test.js.map +1 -0
- package/dist/test/ascii/fix-log-replay.test.d.ts +1 -0
- package/dist/test/ascii/fix-log-replay.test.js +47 -0
- package/dist/test/ascii/fix-log-replay.test.js.map +1 -0
- package/dist/test/ascii/fix-repo-dict.test.d.ts +1 -0
- package/dist/test/ascii/fix-repo-dict.test.js +128 -0
- package/dist/test/ascii/fix-repo-dict.test.js.map +1 -0
- package/dist/test/ascii/includes.test.d.ts +1 -0
- package/dist/test/ascii/includes.test.js +43 -0
- package/dist/test/ascii/includes.test.js.map +1 -0
- package/dist/test/ascii/logon.test.d.ts +1 -0
- package/dist/test/ascii/logon.test.js +91 -0
- package/dist/test/ascii/logon.test.js.map +1 -0
- package/dist/test/ascii/memory-store.test.d.ts +1 -0
- package/dist/test/ascii/memory-store.test.js +75 -0
- package/dist/test/ascii/memory-store.test.js.map +1 -0
- package/dist/test/ascii/qf-full-msg.test.d.ts +1 -0
- package/dist/test/ascii/qf-full-msg.test.js +81 -0
- package/dist/test/ascii/qf-full-msg.test.js.map +1 -0
- package/dist/test/ascii/repo-full-ascii-msg.test.d.ts +1 -0
- package/dist/test/ascii/repo-full-ascii-msg.test.js +87 -0
- package/dist/test/ascii/repo-full-ascii-msg.test.js.map +1 -0
- package/dist/test/ascii/session-state.test.d.ts +1 -0
- package/dist/test/ascii/session-state.test.js +73 -0
- package/dist/test/ascii/session-state.test.js.map +1 -0
- package/dist/test/ascii/session.test.d.ts +1 -0
- package/dist/test/ascii/session.test.js +280 -0
- package/dist/test/ascii/session.test.js.map +1 -0
- package/dist/test/ascii/time-formatter.test.d.ts +1 -0
- package/dist/test/ascii/time-formatter.test.js +80 -0
- package/dist/test/ascii/time-formatter.test.js.map +1 -0
- package/dist/test/ascii/view-decode.test.d.ts +1 -0
- package/dist/test/ascii/view-decode.test.js +183 -0
- package/dist/test/ascii/view-decode.test.js.map +1 -0
- package/dist/test/ascii-encoder.test.d.ts +1 -1
- package/dist/test/ascii-encoder.test.js +51 -48
- package/dist/test/ascii-encoder.test.js.map +1 -1
- package/dist/test/ascii-parser.test.d.ts +1 -1
- package/dist/test/ascii-parser.test.js +26 -45
- package/dist/test/ascii-parser.test.js.map +1 -1
- package/dist/test/ascii-segment.test.d.ts +1 -1
- package/dist/test/ascii-segment.test.js +13 -34
- package/dist/test/ascii-segment.test.js.map +1 -1
- package/dist/test/ascii-store-replay.test.d.ts +1 -1
- package/dist/test/ascii-store-replay.test.js +12 -41
- package/dist/test/ascii-store-replay.test.js.map +1 -1
- package/dist/test/ascii-tag-pos.test.d.ts +1 -1
- package/dist/test/ascii-tag-pos.test.js +8 -8
- package/dist/test/ascii-tag-pos.test.js.map +1 -1
- package/dist/test/elastic-buffer.test.d.ts +1 -1
- package/dist/test/elastic-buffer.test.js +3 -1
- package/dist/test/elastic-buffer.test.js.map +1 -1
- package/dist/test/encode-proxy.test.d.ts +1 -1
- package/dist/test/encode-proxy.test.js +9 -9
- package/dist/test/encode-proxy.test.js.map +1 -1
- package/dist/test/env/experiment.d.ts +23 -0
- package/dist/test/env/experiment.js +33 -0
- package/dist/test/env/experiment.js.map +1 -0
- package/dist/test/env/parsing-result.d.ts +10 -0
- package/dist/test/env/parsing-result.js +14 -0
- package/dist/test/env/parsing-result.js.map +1 -0
- package/dist/test/env/setup.d.ts +39 -0
- package/dist/test/env/setup.js +98 -0
- package/dist/test/env/setup.js.map +1 -0
- package/dist/test/env/skeleton-runner.d.ts +15 -0
- package/dist/test/env/skeleton-runner.js +108 -0
- package/dist/test/env/skeleton-runner.js.map +1 -0
- package/dist/test/env/test-recovery.d.ts +13 -0
- package/dist/test/env/test-recovery.js +41 -0
- package/dist/test/env/test-recovery.js.map +1 -0
- package/dist/test/env/to-views.d.ts +11 -0
- package/dist/test/env/to-views.js +56 -0
- package/dist/test/env/to-views.js.map +1 -0
- package/dist/test/execution-report.test.d.ts +1 -1
- package/dist/test/execution-report.test.js +53 -49
- package/dist/test/execution-report.test.js.map +1 -1
- package/dist/test/experiment.d.ts +23 -0
- package/dist/test/experiment.js +33 -0
- package/dist/test/experiment.js.map +1 -0
- package/dist/test/expieriment.d.ts +23 -0
- package/dist/test/expieriment.js +33 -0
- package/dist/test/expieriment.js.map +1 -0
- package/dist/test/fix-log-replay.test.d.ts +1 -1
- package/dist/test/fix-log-replay.test.js +7 -5
- package/dist/test/fix-log-replay.test.js.map +1 -1
- package/dist/test/fix-repo-dict.test.d.ts +1 -1
- package/dist/test/fix-repo-dict.test.js +6 -5
- package/dist/test/fix-repo-dict.test.js.map +1 -1
- package/dist/test/fixml/fixml-alloc-parse.test.d.ts +1 -0
- package/dist/test/fixml/fixml-alloc-parse.test.js +161 -0
- package/dist/test/fixml/fixml-alloc-parse.test.js.map +1 -0
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.d.ts +1 -0
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js +61 -0
- package/dist/test/fixml/fixml-mkt-data-fut-parse.test.js.map +1 -0
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.d.ts +1 -0
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js +34 -0
- package/dist/test/fixml/fixml-mkt-data-settle-parse.test.js.map +1 -0
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.d.ts +1 -0
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js +97 -0
- package/dist/test/fixml/fixml-tc-bi-lateral-parse.test.js.map +1 -0
- package/dist/test/fixml/repo-full-fixml-msg.test.d.ts +1 -0
- package/dist/test/fixml/repo-full-fixml-msg.test.js +143 -0
- package/dist/test/fixml/repo-full-fixml-msg.test.js.map +1 -0
- package/dist/test/fixml-alloc-parse.test.d.ts +1 -1
- package/dist/test/fixml-alloc-parse.test.js +2 -1
- package/dist/test/fixml-alloc-parse.test.js.map +1 -1
- package/dist/test/fixml-mkt-data-fut-parse.test.d.ts +1 -1
- package/dist/test/fixml-mkt-data-fut-parse.test.js +2 -1
- package/dist/test/fixml-mkt-data-fut-parse.test.js.map +1 -1
- package/dist/test/fixml-mkt-data-settle-parse.test.d.ts +1 -1
- package/dist/test/fixml-mkt-data-settle-parse.test.js +2 -1
- package/dist/test/fixml-mkt-data-settle-parse.test.js.map +1 -1
- package/dist/test/fixml-tc-bi-lateral-parse.test.d.ts +1 -1
- package/dist/test/fixml-tc-bi-lateral-parse.test.js +2 -1
- package/dist/test/fixml-tc-bi-lateral-parse.test.js.map +1 -1
- package/dist/test/includes.test.d.ts +1 -1
- package/dist/test/includes.test.js +1 -0
- package/dist/test/includes.test.js.map +1 -1
- package/dist/test/logon.test.d.ts +1 -1
- package/dist/test/logon.test.js +11 -11
- package/dist/test/logon.test.js.map +1 -1
- package/dist/test/memory-store.test.d.ts +1 -1
- package/dist/test/memory-store.test.js +11 -8
- package/dist/test/memory-store.test.js.map +1 -1
- package/dist/test/qf-full-msg.test.d.ts +1 -1
- package/dist/test/qf-full-msg.test.js +13 -9
- package/dist/test/qf-full-msg.test.js.map +1 -1
- package/dist/test/repo-full-ascii-msg.test.d.ts +1 -1
- package/dist/test/repo-full-ascii-msg.test.js +14 -10
- package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
- package/dist/test/repo-full-fixml-msg.test.d.ts +1 -1
- package/dist/test/repo-full-fixml-msg.test.js +7 -4
- package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
- package/dist/test/session-state.test.d.ts +1 -1
- package/dist/test/session-state.test.js +1 -0
- package/dist/test/session-state.test.js.map +1 -1
- package/dist/test/session.test.d.ts +1 -1
- package/dist/test/session.test.js +13 -144
- package/dist/test/session.test.js.map +1 -1
- package/dist/test/setup.d.ts +45 -0
- package/dist/test/setup.js +102 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/test/skeleton-runner.d.ts +15 -0
- package/dist/test/skeleton-runner.js +108 -0
- package/dist/test/skeleton-runner.js.map +1 -0
- package/dist/test/time-formatter.test.d.ts +1 -1
- package/dist/test/time-formatter.test.js +3 -1
- package/dist/test/time-formatter.test.js.map +1 -1
- package/dist/test/to-views.d.ts +1 -1
- package/dist/test/to-views.js +5 -4
- package/dist/test/to-views.js.map +1 -1
- package/dist/test/view-decode.test.d.ts +1 -1
- package/dist/test/view-decode.test.js +9 -34
- package/dist/test/view-decode.test.js.map +1 -1
- package/dist/time-formatter.test.d.ts +0 -0
- package/dist/time-formatter.test.js +1 -0
- package/dist/time-formatter.test.js.map +1 -0
- package/dist/to-views.d.ts +0 -0
- package/dist/to-views.js +1 -0
- package/dist/to-views.js.map +1 -0
- package/dist/token.txt +248 -0
- package/dist/transport/FixEntity.d.ts +8 -0
- package/dist/transport/FixEntity.js +12 -0
- package/dist/transport/FixEntity.js.map +1 -0
- package/dist/transport/a-session-msg-factory.d.ts +2 -2
- package/dist/transport/a-session-msg-factory.js.map +1 -1
- package/dist/transport/ascii/ascii-msg-transmitter.js +25 -6
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.d.ts +2 -2
- package/dist/transport/ascii/ascii-session-msg-factory.js +1 -1
- package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -1
- package/dist/transport/ascii/ascii-session.d.ts +1 -1
- package/dist/transport/ascii/ascii-session.js +26 -23
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/ascii/index.d.ts +0 -1
- package/dist/transport/ascii/index.js +0 -1
- package/dist/transport/ascii/index.js.map +1 -1
- package/dist/transport/duplex/http-duplex.d.ts +1 -1
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/dist/transport/duplex/tcp-duplex.js +22 -2
- package/dist/transport/duplex/tcp-duplex.js.map +1 -1
- package/dist/transport/factory/index.d.ts +1 -0
- package/dist/transport/factory/index.js +14 -0
- package/dist/transport/factory/index.js.map +1 -0
- package/dist/transport/{msg-transport.d.ts → factory/msg-transport.d.ts} +4 -4
- package/dist/transport/factory/msg-transport.js +61 -0
- package/dist/transport/factory/msg-transport.js.map +1 -0
- package/dist/transport/fix-acceptor.d.ts +2 -2
- package/dist/transport/fix-acceptor.js.map +1 -1
- package/dist/transport/fix-entity.d.ts +8 -0
- package/dist/transport/fix-entity.js +12 -0
- package/dist/transport/fix-entity.js.map +1 -0
- package/dist/transport/fix-initiator.d.ts +2 -2
- package/dist/transport/fix-initiator.js.map +1 -1
- package/dist/transport/fix-msg-factory.d.ts +1 -1
- package/dist/transport/fix-msg-factory.js.map +1 -1
- package/dist/transport/fix-session-state-args.d.ts +8 -0
- package/dist/transport/fix-session-state-args.js +3 -0
- package/dist/transport/fix-session-state-args.js.map +1 -0
- package/dist/transport/fix-session-state.d.ts +3 -41
- package/dist/transport/fix-session-state.js +21 -54
- package/dist/transport/fix-session-state.js.map +1 -1
- package/dist/transport/fix-session.d.ts +3 -2
- package/dist/transport/fix-session.js +44 -42
- package/dist/transport/fix-session.js.map +1 -1
- package/dist/transport/fixml/fixml-msg-transmitter.js +23 -5
- package/dist/transport/fixml/fixml-msg-transmitter.js.map +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.d.ts +2 -2
- package/dist/transport/fixml/fixml-session-msg-factory.js +1 -1
- package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -1
- package/dist/transport/fixml/fixml-session.d.ts +1 -1
- package/dist/transport/fixml/fixml-session.js +3 -3
- package/dist/transport/fixml/fixml-session.js.map +1 -1
- package/dist/transport/fixml/index.d.ts +0 -2
- package/dist/transport/fixml/index.js +0 -2
- package/dist/transport/fixml/index.js.map +1 -1
- package/dist/transport/http/html-options.d.ts +8 -0
- package/dist/{store/replay-record.js → transport/http/html-options.js} +1 -1
- package/dist/transport/http/html-options.js.map +1 -0
- package/dist/transport/http/html-route.d.ts +5 -0
- package/dist/{types/FIX4.4/quickfix/set/trailer.js → transport/http/html-route.js} +1 -1
- package/dist/transport/http/html-route.js.map +1 -0
- package/dist/transport/http/http-acceptor-listener.d.ts +7 -0
- package/dist/transport/http/http-acceptor-listener.js +68 -0
- package/dist/transport/http/http-acceptor-listener.js.map +1 -0
- package/dist/transport/http/http-acceptor.js +24 -5
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/http/http-adapter.d.ts +7 -0
- package/dist/transport/http/http-adapter.js +3 -0
- package/dist/transport/http/http-adapter.js.map +1 -0
- package/dist/transport/http/http-initiator.d.ts +9 -3
- package/dist/transport/http/http-initiator.js +57 -26
- package/dist/transport/http/http-initiator.js.map +1 -1
- package/dist/transport/http/http-json-sample-adapter.d.ts +2 -1
- package/dist/transport/http/http-json-sample-adapter.js +21 -2
- package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
- package/dist/transport/http/http-transaction.d.ts +1 -1
- package/dist/transport/http/http-transaction.js.map +1 -1
- package/dist/transport/http/http-transport-description.d.ts +8 -0
- package/dist/transport/http/http-transport-description.js +3 -0
- package/dist/transport/http/http-transport-description.js.map +1 -0
- package/dist/transport/http/index.d.ts +1 -0
- package/dist/transport/http/index.js +1 -0
- package/dist/transport/http/index.js.map +1 -1
- package/dist/transport/index.d.ts +11 -10
- package/dist/transport/index.js +11 -10
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/{make-fixl-session.d.ts → make-fix-session.d.ts} +0 -0
- package/dist/transport/make-fix-session.js +3 -0
- package/dist/transport/make-fix-session.js.map +1 -0
- package/dist/transport/msg-application.d.ts +12 -0
- package/dist/transport/msg-application.js +3 -0
- package/dist/transport/msg-application.js.map +1 -0
- package/dist/transport/msg-transmitter.d.ts +5 -5
- package/dist/transport/msg-transmitter.js +2 -3
- package/dist/transport/msg-transmitter.js.map +1 -1
- package/dist/transport/session/a-session-msg-factory.d.ts +23 -0
- package/dist/transport/session/a-session-msg-factory.js +58 -0
- package/dist/transport/session/a-session-msg-factory.js.map +1 -0
- package/dist/transport/session/fix-session-state-args.d.ts +8 -0
- package/dist/transport/session/fix-session-state-args.js +3 -0
- package/dist/transport/session/fix-session-state-args.js.map +1 -0
- package/dist/transport/session/fix-session-state.d.ts +32 -0
- package/dist/transport/session/fix-session-state.js +133 -0
- package/dist/transport/session/fix-session-state.js.map +1 -0
- package/dist/transport/session/fix-session.d.ts +50 -0
- package/dist/transport/session/fix-session.js +291 -0
- package/dist/transport/session/fix-session.js.map +1 -0
- package/dist/transport/session/make-fix-session.d.ts +5 -0
- package/dist/transport/session/make-fix-session.js +3 -0
- package/dist/transport/session/make-fix-session.js.map +1 -0
- package/dist/transport/session/session-description.d.ts +17 -0
- package/dist/transport/session/session-description.js +3 -0
- package/dist/transport/session/session-description.js.map +1 -0
- package/dist/transport/session/session-msg-factory.d.ts +15 -0
- package/dist/transport/session/session-msg-factory.js +3 -0
- package/dist/transport/session/session-msg-factory.js.map +1 -0
- package/dist/transport/session/session-state.d.ts +25 -0
- package/dist/transport/session/session-state.js +30 -0
- package/dist/transport/session/session-state.js.map +1 -0
- package/dist/transport/session-description.d.ts +1 -48
- package/dist/transport/session-description.js.map +1 -1
- package/dist/transport/session-msg-factory.d.ts +7 -20
- package/dist/transport/session-msg-factory.js +0 -150
- package/dist/transport/session-msg-factory.js.map +1 -1
- package/dist/transport/session-state.d.ts +25 -0
- package/dist/transport/session-state.js +30 -0
- package/dist/transport/session-state.js.map +1 -0
- package/dist/transport/tcp/index.d.ts +3 -2
- package/dist/transport/tcp/index.js +3 -2
- package/dist/transport/tcp/index.js.map +1 -1
- package/dist/transport/tcp/recovering-tcp-initiator.d.ts +7 -9
- package/dist/transport/tcp/recovering-tcp-initiator.js +41 -16
- package/dist/transport/tcp/recovering-tcp-initiator.js.map +1 -1
- package/dist/transport/tcp/tcp-acceptor-listener.d.ts +7 -0
- package/dist/transport/tcp/tcp-acceptor-listener.js +70 -0
- package/dist/transport/tcp/tcp-acceptor-listener.js.map +1 -0
- package/dist/transport/tcp/tcp-acceptor.js +29 -12
- package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator-connector.d.ts +10 -0
- package/dist/transport/tcp/tcp-initiator-connector.js +97 -0
- package/dist/transport/tcp/tcp-initiator-connector.js.map +1 -0
- package/dist/transport/tcp/tcp-initiator.d.ts +2 -2
- package/dist/transport/tcp/tcp-initiator.js +28 -9
- package/dist/transport/tcp/tcp-initiator.js.map +1 -1
- package/dist/transport/tcp/tcp-transport-description.d.ts +6 -0
- package/dist/transport/tcp/tcp-transport-description.js +3 -0
- package/dist/transport/tcp/tcp-transport-description.js.map +1 -0
- package/dist/transport/tcp/tls-options-factory.d.ts +9 -0
- package/dist/transport/tcp/tls-options-factory.js +53 -0
- package/dist/transport/tcp/tls-options-factory.js.map +1 -0
- package/dist/transport/tcp/tls-options.d.ts +10 -5
- package/dist/transport/tcp/tls-options.js +0 -49
- package/dist/transport/tcp/tls-options.js.map +1 -1
- package/dist/transport/tick-action.d.ts +8 -0
- package/dist/transport/tick-action.js +13 -0
- package/dist/transport/tick-action.js.map +1 -0
- package/dist/util/buffer-helper.js +1 -1
- package/dist/util/buffer-helper.js.map +1 -1
- package/dist/util/definition-factory.d.ts +10 -0
- package/dist/util/definition-factory.js +56 -0
- package/dist/util/definition-factory.js.map +1 -0
- package/dist/util/dictionary-path.d.ts +4 -0
- package/dist/util/dictionary-path.js +3 -0
- package/dist/util/dictionary-path.js.map +1 -0
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.js +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/json-helper.d.ts +3 -1
- package/dist/util/json-helper.js +13 -12
- package/dist/util/json-helper.js.map +1 -1
- package/dist/util/message-generator.d.ts +1 -1
- package/dist/util/message-generator.js +16 -15
- package/dist/util/message-generator.js.map +1 -1
- package/dist/util/replay.d.ts +6 -3
- package/dist/util/replay.js +24 -26
- package/dist/util/replay.js.map +1 -1
- package/package.json +15 -10
- package/script/build.cmd +1 -0
- package/script/build.sh +1 -0
- package/script/test.cmd +3 -0
- package/src/buffer/{ascii-chars.ts → ascii/ascii-chars.ts} +0 -0
- package/src/buffer/ascii/ascii-encoder.ts +9 -6
- package/src/buffer/ascii/ascii-parser-state.ts +7 -12
- package/src/buffer/ascii/ascii-parser.ts +23 -16
- package/src/buffer/ascii/ascii-segment-parser.ts +14 -8
- package/src/buffer/ascii/ascii-view.ts +4 -9
- package/src/buffer/ascii/index.ts +1 -0
- package/src/buffer/ascii/parse-state.ts +8 -0
- package/src/buffer/ascii/time-formatter.ts +1 -1
- package/src/buffer/elastic-buffer.ts +7 -2
- package/src/buffer/encode-proxy.ts +9 -4
- package/src/buffer/fixml/fixml-encoder.ts +15 -11
- package/src/buffer/fixml/fixml-parser.ts +16 -6
- package/src/buffer/fixml/fixml-view.ts +4 -9
- package/src/buffer/fixml/populated-attributes.ts +6 -0
- package/src/buffer/index.ts +4 -8
- package/src/buffer/msg-encoder.ts +2 -1
- package/src/buffer/msg-view.ts +13 -9
- package/src/buffer/{segment-description.ts → segment/segment-description.ts} +4 -11
- package/src/buffer/{segment-summary.ts → segment/segment-summary.ts} +0 -0
- package/src/buffer/segment/segment-type.ts +8 -0
- package/src/buffer/structure.ts +3 -3
- package/src/buffer/{tag-pos.ts → tag/tag-pos.ts} +0 -0
- package/src/buffer/tag/tag-type.ts +13 -0
- package/src/buffer/{tags.ts → tag/tags.ts} +4 -16
- package/src/config/get-js-fx-logger.ts +4 -0
- package/src/config/index.ts +1 -0
- package/src/config/js-fix-config.ts +5 -2
- package/src/config/js-fix-logger.ts +0 -3
- package/src/dictionary/compiler/compiler-type.ts +3 -3
- package/src/dictionary/compiler/enum-compiler.ts +12 -1
- package/src/dictionary/compiler/msg-compiler.ts +8 -7
- package/src/dictionary/contained/contained-component-field.ts +2 -1
- package/src/dictionary/contained/contained-field-dispatch.ts +3 -7
- package/src/dictionary/contained/contained-field-dispatcher.ts +9 -0
- package/src/dictionary/contained/contained-field-set.ts +5 -3
- package/src/dictionary/contained/contained-field-type.ts +5 -0
- package/src/dictionary/contained/contained-field.ts +1 -6
- package/src/dictionary/contained/contained-group-field.ts +2 -1
- package/src/dictionary/contained/contained-simple-field.ts +2 -1
- package/src/dictionary/contained/field-dispatcher.ts +9 -0
- package/src/dictionary/contained/fields-dispatch.ts +46 -0
- package/src/dictionary/contained/index.ts +2 -0
- package/src/dictionary/contained-set-type.ts +5 -0
- package/src/dictionary/definition/component-field-definition.ts +1 -1
- package/src/dictionary/definition/fix-definitions.ts +2 -1
- package/src/dictionary/definition/group-field-definition.ts +1 -1
- package/src/dictionary/definition/index.ts +0 -1
- package/src/dictionary/definition/message-definition.ts +1 -1
- package/src/dictionary/definition/simple-field-definition.ts +3 -1
- package/src/dictionary/dict-primitive.ts +0 -13
- package/src/dictionary/fix-definition-source.ts +6 -0
- package/src/dictionary/fix-versions.ts +0 -32
- package/src/dictionary/index.ts +1 -5
- package/src/dictionary/parser/fix-repository/abbreviations-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/base-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/components-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/data-types-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/enums-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/fields-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/messages-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/msg-contents-parser.ts +2 -3
- package/src/dictionary/parser/fix-repository/repository-abbreviation.ts +6 -0
- package/src/dictionary/parser/fix-repository/repository-component.ts +11 -0
- package/src/dictionary/parser/fix-repository/repository-data-type.ts +7 -0
- package/src/dictionary/parser/fix-repository/repository-enum.ts +8 -0
- package/src/dictionary/parser/fix-repository/repository-field.ts +12 -0
- package/src/dictionary/parser/fix-repository/repository-message.ts +12 -0
- package/src/dictionary/parser/fix-repository/repository-msg-content.ts +10 -0
- package/src/dictionary/parser/fix-repository/repository-type.ts +0 -59
- package/src/dictionary/parser/fix-repository/repository-xml-parser.ts +10 -9
- package/src/dictionary/parser/fix-repository/repository.ts +69 -38
- package/src/dictionary/parser/fixml/components-parser.ts +6 -3
- package/src/dictionary/parser/fixml/fields-parser.ts +1 -1
- package/src/dictionary/parser/fixml/fix-xsd-parser.ts +2 -1
- package/src/dictionary/parser/fixml/include-graph.ts +2 -1
- package/src/dictionary/parser/fixml/xsd-parser.ts +2 -1
- package/src/dictionary/parser/quickfix/field-definition-parser.ts +4 -5
- package/src/dictionary/parser/quickfix/field-set-parser.ts +4 -5
- package/src/dictionary/parser/quickfix/message-parser.ts +4 -5
- package/src/dictionary/parser/quickfix/node-parser.ts +3 -6
- package/src/dictionary/parser/quickfix/parse-state.ts +8 -0
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +9 -15
- package/src/dictionary/sax-node.ts +7 -0
- package/src/dictionary/set-reduce.ts +30 -31
- package/src/dictionary/type-dispatcher.ts +7 -0
- package/src/dictionary/version-util.ts +25 -0
- package/src/index.ts +1 -0
- package/src/jsfix-cmd.ts +31 -16
- package/src/runtime/di-tokens.ts +48 -0
- package/src/runtime/engine-factory.ts +5 -0
- package/src/runtime/index.ts +5 -0
- package/src/runtime/make-config.ts +35 -0
- package/src/runtime/session-container.ts +180 -0
- package/src/runtime/session-launcher.ts +127 -0
- package/src/sample/http/oms/app.ts +20 -14
- package/src/sample/http/oms/http-client.ts +5 -2
- package/src/sample/http/oms/http-server.ts +5 -1
- package/src/sample/tcp/qf-md/app.ts +12 -12
- package/src/sample/tcp/qf-md/md-client.ts +4 -1
- package/src/sample/tcp/qf-md/md-server.ts +3 -1
- package/src/sample/tcp/recovering-skeleton/app.ts +37 -15
- package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +16 -9
- package/src/sample/tcp/recovering-skeleton/skeleton-client.ts +4 -2
- package/src/sample/tcp/recovering-skeleton/skeleton-server.ts +4 -2
- package/src/sample/tcp/skeleton/app.ts +10 -15
- package/src/sample/tcp/skeleton/skeleton-session.ts +8 -4
- package/src/sample/tcp/tls-trade-capture/app.ts +8 -31
- package/src/sample/tcp/trade-capture/app-launcher.ts +22 -0
- package/src/sample/tcp/trade-capture/app.ts +3 -26
- package/src/sample/tcp/trade-capture/trade-capture-client.ts +2 -1
- package/src/sample/tcp/trade-capture/trade-capture-server.ts +2 -1
- package/src/sample/tcp/trade-capture/trade-factory.ts +7 -1
- package/src/store/fix-msg-ascii-store-resend.ts +3 -2
- package/src/store/fix-msg-memory-store.ts +1 -1
- package/src/store/fix-msg-store-record.ts +6 -0
- package/src/store/fix-msg-store-state.ts +6 -0
- package/src/store/fix-msg-store.ts +1 -7
- package/src/transport/ascii/ascii-msg-transmitter.ts +9 -5
- package/src/transport/ascii/ascii-session-msg-factory.ts +2 -2
- package/src/transport/ascii/ascii-session.ts +9 -6
- package/src/transport/ascii/index.ts +0 -1
- package/src/transport/duplex/http-duplex.ts +1 -1
- package/src/transport/duplex/tcp-duplex.ts +4 -1
- package/src/transport/factory/index.ts +1 -0
- package/src/transport/factory/msg-transport.ts +55 -0
- package/src/transport/fix-acceptor.ts +2 -2
- package/src/transport/fix-entity.ts +9 -0
- package/src/transport/fix-initiator.ts +2 -2
- package/src/transport/fixml/fixml-msg-transmitter.ts +8 -4
- package/src/transport/fixml/fixml-session-msg-factory.ts +2 -2
- package/src/transport/fixml/fixml-session.ts +2 -2
- package/src/transport/fixml/index.ts +0 -2
- package/src/transport/http/html-options.ts +8 -0
- package/src/transport/http/html-route.ts +6 -0
- package/src/transport/http/http-acceptor-listener.ts +42 -0
- package/src/transport/http/http-acceptor.ts +5 -2
- package/src/transport/http/http-adapter.ts +7 -0
- package/src/transport/http/http-initiator.ts +40 -25
- package/src/transport/http/http-json-sample-adapter.ts +7 -2
- package/src/transport/http/http-transaction.ts +1 -1
- package/src/transport/http/http-transport-description.ts +9 -0
- package/src/transport/http/index.ts +1 -0
- package/src/transport/index.ts +11 -10
- package/src/transport/msg-application.ts +13 -0
- package/src/transport/msg-transmitter.ts +5 -5
- package/src/transport/{a-session-msg-factory.ts → session/a-session-msg-factory.ts} +4 -4
- package/src/transport/session/fix-session-state-args.ts +9 -0
- package/src/transport/{fix-session-state.ts → session/fix-session-state.ts} +4 -44
- package/src/transport/{fix-session.ts → session/fix-session.ts} +10 -7
- package/src/transport/{make-fixl-session.ts → session/make-fix-session.ts} +1 -1
- package/src/transport/session/session-description.ts +18 -0
- package/src/transport/{fix-msg-factory.ts → session/session-msg-factory.ts} +2 -2
- package/src/transport/session/session-state.ts +25 -0
- package/src/transport/tcp/index.ts +3 -2
- package/src/transport/tcp/recovering-tcp-initiator.ts +24 -13
- package/src/transport/tcp/tcp-acceptor-listener.ts +45 -0
- package/src/transport/tcp/tcp-acceptor.ts +11 -10
- package/src/transport/tcp/tcp-initiator-connector.ts +71 -0
- package/src/transport/tcp/tcp-initiator.ts +10 -6
- package/src/transport/tcp/tcp-transport-description.ts +7 -0
- package/src/transport/tcp/tls-options-factory.ts +55 -0
- package/src/transport/tcp/tls-options.ts +9 -51
- package/src/transport/tick-action.ts +8 -0
- package/src/util/definition-factory.ts +47 -0
- package/src/util/dictionary-path.ts +4 -0
- package/src/util/index.ts +1 -1
- package/src/util/json-helper.ts +14 -4
- package/src/util/message-generator.ts +6 -3
- package/src/util/replay.ts +26 -21
- package/tsconfig.json +2 -0
- package/dist/buffer/ascii-chars.js.map +0 -1
- package/dist/dictionary/fields-dispatch.js +0 -40
- package/dist/dictionary/fields-dispatch.js.map +0 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +0 -2
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js +0 -3
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +0 -1
- package/dist/store/fix-msg-ascii-store-recovery.d.ts +0 -12
- package/dist/store/fix-msg-ascii-store-recovery.js +0 -60
- package/dist/store/fix-msg-ascii-store-recovery.js.map +0 -1
- package/dist/store/fix-msg-ascii-store-replay.d.ts +0 -13
- package/dist/store/fix-msg-ascii-store-replay.js +0 -60
- package/dist/store/fix-msg-ascii-store-replay.js.map +0 -1
- package/dist/store/fix-replay-record.d.ts +0 -12
- package/dist/store/fix-replay-record.js +0 -12
- package/dist/store/fix-replay-record.js.map +0 -1
- package/dist/store/fix-resend-record.d.ts +0 -12
- package/dist/store/fix-resend-record.js +0 -12
- package/dist/store/fix-resend-record.js.map +0 -1
- package/dist/store/replay-record.d.ts +0 -6
- package/dist/store/replay-record.js.map +0 -1
- package/dist/store/store-replay-record.d.ts +0 -12
- package/dist/store/store-replay-record.js +0 -12
- package/dist/store/store-replay-record.js.map +0 -1
- package/dist/tcp/tls-options.d.ts +0 -5
- package/dist/tcp/tls-options.js +0 -45
- package/dist/tcp/tls-options.js.map +0 -1
- package/dist/test/ascii-encode.test.d.ts +0 -1
- package/dist/test/ascii-encode.test.js.map +0 -1
- package/dist/test/ascii-store-recovery.test.d.ts +0 -1
- package/dist/test/ascii-store-recovery.test.js +0 -50
- package/dist/test/ascii-store-recovery.test.js.map +0 -1
- package/dist/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/fixml/acceptor.d.ts +0 -3
- package/dist/transport/fixml/acceptor.js +0 -38
- package/dist/transport/fixml/acceptor.js.map +0 -1
- package/dist/transport/fixml-session-msg-factory.d.ts +0 -13
- package/dist/transport/fixml-session-msg-factory.js +0 -68
- package/dist/transport/fixml-session-msg-factory.js.map +0 -1
- package/dist/transport/make-config.d.ts +0 -4
- package/dist/transport/make-config.js +0 -31
- package/dist/transport/make-config.js.map +0 -1
- package/dist/transport/make-fixl-session.js.map +0 -1
- package/dist/transport/msg-transport.js +0 -57
- package/dist/transport/msg-transport.js.map +0 -1
- package/dist/transport/tcp/acceptor.d.ts +0 -3
- package/dist/transport/tcp/acceptor.js +0 -40
- package/dist/transport/tcp/acceptor.js.map +0 -1
- package/dist/transport/tcp/initiator.d.ts +0 -3
- package/dist/transport/tcp/initiator.js +0 -67
- package/dist/transport/tcp/initiator.js.map +0 -1
- package/dist/transport/tcp/recovering-initiator.d.ts +0 -17
- package/dist/transport/tcp/recovering-initiator.js +0 -30
- package/dist/transport/tcp/recovering-initiator.js.map +0 -1
- package/dist/transport/tcp/recovering_initiator.d.ts +0 -12
- package/dist/transport/tcp/recovering_initiator.js +0 -25
- package/dist/transport/tcp/recovering_initiator.js.map +0 -1
- package/dist/transport/tcp/resilient-initiator.d.ts +0 -12
- package/dist/transport/tcp/resilient-initiator.js +0 -41
- package/dist/transport/tcp/resilient-initiator.js.map +0 -1
- package/dist/types/FIX4.4/quickfix/set/header.d.ts +0 -31
- package/dist/types/FIX4.4/quickfix/set/header.js.map +0 -1
- package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +0 -6
- package/dist/types/FIX4.4/quickfix/set/trailer.js.map +0 -1
- package/dist/util/dictionary-definitions.d.ts +0 -8
- package/dist/util/dictionary-definitions.js +0 -51
- package/dist/util/dictionary-definitions.js.map +0 -1
- package/src/dictionary/fields-dispatch.ts +0 -45
- package/src/sample/launcher.ts +0 -56
- package/src/transport/fixml/acceptor.ts +0 -29
- package/src/transport/make-config.ts +0 -19
- package/src/transport/msg-transport.ts +0 -67
- package/src/transport/session-description.ts +0 -70
- package/src/transport/tcp/acceptor.ts +0 -31
- package/src/transport/tcp/initiator.ts +0 -59
- package/src/util/dictionary-definitions.ts +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ISessionDescription } from '
|
|
1
|
+
import { ISessionDescription } from '../session/session-description';
|
|
2
2
|
import { ILooseObject } from '../../collections/collection';
|
|
3
|
-
import { ASessionMsgFactory, ObjectMutator } from '../a-session-msg-factory';
|
|
3
|
+
import { ASessionMsgFactory, ObjectMutator } from '../session/a-session-msg-factory';
|
|
4
4
|
import { IStandardHeader } from '../../types/FIXML50SP2';
|
|
5
5
|
export declare class FixmlSessionMsgFactory extends ASessionMsgFactory {
|
|
6
6
|
readonly description: ISessionDescription;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FixmlSessionMsgFactory = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
|
-
const a_session_msg_factory_1 = require("../a-session-msg-factory");
|
|
5
|
+
const a_session_msg_factory_1 = require("../session/a-session-msg-factory");
|
|
6
6
|
const FIXML50SP2_1 = require("../../types/FIXML50SP2");
|
|
7
7
|
class FixmlSessionMsgFactory extends a_session_msg_factory_1.ASessionMsgFactory {
|
|
8
8
|
constructor(description, mutator = null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixml-session-msg-factory.js","sourceRoot":"","sources":["../../../src/transport/fixml/fixml-session-msg-factory.ts"],"names":[],"mappings":";;;AAEA,uCAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"fixml-session-msg-factory.js","sourceRoot":"","sources":["../../../src/transport/fixml/fixml-session-msg-factory.ts"],"names":[],"mappings":";;;AAEA,uCAAqC;AACrC,4EAAoF;AAEpF,uDAM+B;AAE/B,MAAa,sBAAuB,SAAQ,0CAAkB;IAE5D,YAAsB,WAAgC,EAAE,UAAyB,IAAI;QACnF,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;QADP,gBAAW,GAAX,WAAW,CAAqB;IAEtD,CAAC;IAEM,KAAK,CAAE,gBAAwB,EAAE,EAAE,aAAsB,KAAK;QACnE,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;IACnD,CAAC;IAEM,MAAM,CAA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gBACtB,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ;gBACnC,aAAa,EAAE,aAAa;gBAC5B,eAAe,EAAE,4BAAe,CAAC,UAAU;aAC5B,CAAA;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,eAAO,CAAC,MAAM,CAAC,CAAA;SACtC;aAAM;YACL,MAAM,CAAC,GAAkB;gBACvB,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ;gBACnC,aAAa,EAAE,aAAa;gBAC5B,UAAU,EAAE,uBAAU,CAAC,WAAW;aAClB,CAAA;YAClB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,eAAO,CAAC,MAAM,CAAC,CAAA;SACtC;IACH,CAAC;CACF;AA9DD,wDA8DC","sourcesContent":["import { ISessionDescription } from '../session/session-description'\r\nimport { ILooseObject } from '../../collections/collection'\r\nimport { MsgType } from '../../types'\r\nimport { ASessionMsgFactory, ObjectMutator } from '../session/a-session-msg-factory'\r\n\r\nimport {\r\n IStandardHeader,\r\n IUserRequest,\r\n IUserResponse,\r\n UserRequestType,\r\n UserStatus\r\n} from '../../types/FIXML50SP2'\r\n\r\nexport class FixmlSessionMsgFactory extends ASessionMsgFactory {\r\n\r\n constructor (readonly description: ISessionDescription, mutator: ObjectMutator = null) {\r\n super(description, mutator)\r\n }\r\n\r\n public logon (userRequestId: string = '', isResponse: boolean = false): ILooseObject {\r\n return this.fixmlLogon(userRequestId, isResponse)\r\n }\r\n\r\n public logout (msgType: string, text: string): ILooseObject {\r\n return this.fixmlLogout(msgType, msgType !== 'UserReq')\r\n }\r\n\r\n public header (msgType: string, seqNum: number = 0, time: Date = new Date(), overrideData?: Partial<IStandardHeader>): ILooseObject {\r\n const description = this.description\r\n const o: IStandardHeader = {\r\n SenderCompID: description.SenderCompId,\r\n TargetCompID: description.TargetCompID,\r\n SenderSubID: description.SenderSubID,\r\n TargetSubID: description.TargetSubID\r\n } as IStandardHeader\r\n return this.mutate(o, 'StandardHeader')\r\n }\r\n\r\n private fixmlLogon (userRequestId: string, isResponse: boolean): ILooseObject {\r\n const description = this.description\r\n if (!isResponse) {\r\n const o: IUserRequest = {\r\n Username: description.Username,\r\n Password: description.Password,\r\n UserRequestID: userRequestId,\r\n UserRequestType: UserRequestType.LogOnUser\r\n } as IUserRequest\r\n return this.mutate(o, MsgType.Logon)\r\n } else {\r\n const o: IUserResponse = {\r\n Username: description.Username,\r\n UserRequestID: userRequestId,\r\n UserStatus: UserStatus.LoggedIn\r\n } as IUserResponse\r\n return this.mutate(o, MsgType.Logon)\r\n }\r\n }\r\n\r\n private fixmlLogout (userRequestId: string, isResponse: boolean): ILooseObject {\r\n if (!isResponse) {\r\n const o: IUserRequest = {\r\n Username: this.description.Username,\r\n UserRequestID: userRequestId,\r\n UserRequestType: UserRequestType.LogOffUser\r\n } as IUserRequest\r\n return this.mutate(o, MsgType.Logout)\r\n } else {\r\n const o: IUserResponse = {\r\n Username: this.description.Username,\r\n UserRequestID: userRequestId,\r\n UserStatus: UserStatus.NotLoggedIn\r\n } as IUserResponse\r\n return this.mutate(o, MsgType.Logout)\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MsgView } from '../../buffer';
|
|
2
2
|
import { IJsFixConfig } from '../../config';
|
|
3
|
-
import { FixSession } from '../fix-session';
|
|
3
|
+
import { FixSession } from '../session/fix-session';
|
|
4
4
|
export declare abstract class FixmlSession extends FixSession {
|
|
5
5
|
readonly config: IJsFixConfig;
|
|
6
6
|
protected constructor(config: IJsFixConfig);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FixmlSession = void 0;
|
|
4
|
-
const fix_session_state_1 = require("../fix-session-state");
|
|
5
4
|
const FIXML50SP2_1 = require("../../types/FIXML50SP2");
|
|
6
5
|
const types_1 = require("../../types");
|
|
7
|
-
const fix_session_1 = require("../fix-session");
|
|
6
|
+
const fix_session_1 = require("../session/fix-session");
|
|
7
|
+
const session_state_1 = require("../session/session-state");
|
|
8
8
|
class FixmlSession extends fix_session_1.FixSession {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
@@ -61,7 +61,7 @@ class FixmlSession extends fix_session_1.FixSession {
|
|
|
61
61
|
peerLogon(view) {
|
|
62
62
|
const logger = this.sessionLogger;
|
|
63
63
|
const state = this.sessionState;
|
|
64
|
-
state.state =
|
|
64
|
+
state.state = session_state_1.SessionState.InitiationLogonReceived;
|
|
65
65
|
state.peerCompId = view.getTyped(types_1.MsgTag.SenderCompID);
|
|
66
66
|
if (this.acceptor) {
|
|
67
67
|
const reqId = view.getString('UserReqID');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixml-session.js","sourceRoot":"","sources":["../../../src/transport/fixml/fixml-session.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fixml-session.js","sourceRoot":"","sources":["../../../src/transport/fixml/fixml-session.ts"],"names":[],"mappings":";;;AAEA,uDAAoE;AACpE,uCAAoC;AACpC,wDAAmD;AACnD,4DAAuD;AAEvD,MAAsB,YAAa,SAAQ,wBAAU;IAEnD,YAAuC,MAAoB;QACzD,KAAK,CAAC,MAAM,CAAC,CAAA;QADwB,WAAM,GAAN,MAAM,CAAc;QAEzD,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAA;QAClC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAA;QACjC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAA;IACpC,CAAC;IAES,KAAK,CAAE,OAAe,EAAE,IAAa;QAE7C,QAAQ,OAAO,EAAE;YACf,KAAK,SAAS,CAAC;YACf,KAAK,SAAS,CAAC,CAAC;gBACd,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;gBAChC,MAAK;aACN;YAED,OAAO,CAAC,CAAC;gBACP,IAAI,CAAC,eA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,SAAS,CAAC,WAAW,CAAC,CAAA;YACjD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;SAC7D;QACD,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;QACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC;CACF;AAzED,oCAyEC","sourcesContent":["import { MsgView } from '../../buffer'\r\nimport { IJsFixConfig } from '../../config'\r\nimport { UserRequestType, UserStatus } from '../../types/FIXML50SP2'\r\nimport { MsgTag } from '../../types'\r\nimport { FixSession } from '../session/fix-session'\r\nimport { SessionState } from '../session/session-state'\r\n\r\nexport abstract class FixmlSession extends FixSession {\r\n\r\n protected constructor (public readonly config: IJsFixConfig) {\r\n super(config)\r\n this.requestLogoutType = 'UserReq'\r\n this.requestLogonType = 'UserReq'\r\n this.respondLogoutType = 'UserRsp'\r\n }\r\n\r\n protected onMsg (msgType: string, view: MsgView): void {\r\n\r\n switch (msgType) {\r\n case 'UserReq':\r\n case 'UserRsp': {\r\n this.onSessionMsg(msgType, view)\r\n break\r\n }\r\n\r\n default: {\r\n this.checkForwardMsg(msgType, view)\r\n break\r\n }\r\n }\r\n }\r\n\r\n protected onSessionMsg (msgType: string, view: MsgView): void {\r\n switch (msgType) {\r\n case 'UserReq': {\r\n const reqType: number = view.getTyped('UserReqTyp')\r\n switch (reqType) {\r\n case UserRequestType.LogOnUser: {\r\n this.peerLogon(view)\r\n break\r\n }\r\n\r\n case UserRequestType.LogOffUser: {\r\n this.peerLogout(view)\r\n break\r\n }\r\n }\r\n break\r\n }\r\n\r\n case 'UserRsp': {\r\n const userStatus: number = view.getTyped('UserStatus')\r\n switch (userStatus) {\r\n case UserStatus.LoggedIn: {\r\n this.peerLogon(view)\r\n break\r\n }\r\n\r\n case UserStatus.NotLoggedIn: {\r\n this.peerLogout(view)\r\n break\r\n }\r\n }\r\n break\r\n }\r\n }\r\n }\r\n\r\n private peerLogon (view: MsgView) {\r\n const logger = this.sessionLogger\r\n const state = this.sessionState\r\n state.state = SessionState.InitiationLogonReceived\r\n state.peerCompId = view.getTyped(MsgTag.SenderCompID)\r\n if (this.acceptor) {\r\n const reqId: string = view.getString('UserReqID')\r\n this.send('UserRsp', this.config.factory.logon(reqId, true))\r\n }\r\n logger.info(`system ready, inform app`)\r\n this.onReady(view)\r\n }\r\n}\r\n"]}
|
|
@@ -10,9 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./acceptor"), exports);
|
|
14
13
|
__exportStar(require("./fixml-request"), exports);
|
|
15
14
|
__exportStar(require("./fixml-session"), exports);
|
|
16
|
-
__exportStar(require("./fixml-msg-transmitter"), exports);
|
|
17
15
|
__exportStar(require("./fixml-session-msg-factory"), exports);
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/fixml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/fixml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA+B;AAC/B,kDAA+B;AAC/B,8DAA2C","sourcesContent":["export * from './fixml-request'\r\nexport * from './fixml-session'\r\nexport * from './fixml-session-msg-factory'\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-options.js","sourceRoot":"","sources":["../../../src/transport/http/html-options.ts"],"names":[],"mappings":"","sourcesContent":["export interface IHtmlOptions {\r\n method: string,\r\n uri: string,\r\n json: boolean,\r\n body: any,\r\n headers: any,\r\n resolveWithFullResponse: boolean\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-route.js","sourceRoot":"","sources":["../../../src/transport/http/html-route.ts"],"names":[],"mappings":"","sourcesContent":["import { IHtmlOptions } from './html-options'\r\n\r\nexport interface IHtmlRoute {\r\n name: string,\r\n value: IHtmlOptions\r\n}\r\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.HttpAcceptorListener = void 0;
|
|
25
|
+
const http_acceptor_1 = require("./http-acceptor");
|
|
26
|
+
const tsyringe_1 = require("tsyringe");
|
|
27
|
+
const di_tokens_1 = require("../../runtime/di-tokens");
|
|
28
|
+
const fix_entity_1 = require("../fix-entity");
|
|
29
|
+
let HttpAcceptorListener = class HttpAcceptorListener extends fix_entity_1.FixEntity {
|
|
30
|
+
constructor(config) {
|
|
31
|
+
super(config);
|
|
32
|
+
this.config = config;
|
|
33
|
+
}
|
|
34
|
+
start() {
|
|
35
|
+
return new Promise((accept, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const logger = this.config.logFactory.logger('acceptor');
|
|
37
|
+
const sessionContainer = this.config.sessionContainer;
|
|
38
|
+
if (!sessionContainer.isRegistered(di_tokens_1.DITokens.FixSession)) {
|
|
39
|
+
reject(new Error(`application must register a DI token '${di_tokens_1.DITokens.FixSession}' - see src/sample`));
|
|
40
|
+
}
|
|
41
|
+
logger.info('starting.');
|
|
42
|
+
const acceptor = new http_acceptor_1.HttpAcceptor(this.config);
|
|
43
|
+
acceptor.on('transport', (t) => {
|
|
44
|
+
logger.info(`creates new transport using DI token ${di_tokens_1.DITokens.FixSession}.`);
|
|
45
|
+
const acceptorSession = sessionContainer.resolve(di_tokens_1.DITokens.FixSession);
|
|
46
|
+
acceptorSession.run(t).then(() => {
|
|
47
|
+
logger.info('ends');
|
|
48
|
+
acceptor.close(() => {
|
|
49
|
+
logger.info('acceptor closed.');
|
|
50
|
+
accept(true);
|
|
51
|
+
});
|
|
52
|
+
}).catch((e) => {
|
|
53
|
+
logger.error(e);
|
|
54
|
+
logger.info(e.stack);
|
|
55
|
+
reject(e);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
acceptor.listen();
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
HttpAcceptorListener = __decorate([
|
|
63
|
+
(0, tsyringe_1.injectable)(),
|
|
64
|
+
__param(0, (0, tsyringe_1.inject)(di_tokens_1.DITokens.IJsFixConfig)),
|
|
65
|
+
__metadata("design:paramtypes", [Object])
|
|
66
|
+
], HttpAcceptorListener);
|
|
67
|
+
exports.HttpAcceptorListener = HttpAcceptorListener;
|
|
68
|
+
//# sourceMappingURL=http-acceptor-listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-acceptor-listener.js","sourceRoot":"","sources":["../../../src/transport/http/http-acceptor-listener.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,mDAA8C;AAE9C,uCAA6C;AAC7C,uDAAkD;AAElD,8CAAyC;AAGzC,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,sBAAS;IACjD,YAA4D,MAAoB;QAC9E,KAAK,CAAC,MAAM,CAAC,CAAA;QAD6C,WAAM,GAAN,MAAM,CAAc;IAEhF,CAAC;IACD,KAAK;QACH,OAAO,IAAI,OAAO,CAAM,CAAO,MAAM,EAAE,MAAM,EAAE,EAAE;YAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YACxD,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAA;YACrD,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,oBAAQ,CAAC,UAAU,CAAC,EAAE;gBACvD,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,oBAAQ,CAAC,UAAU,oBAAoB,CAAC,CAAC,CAAA;aACpG;YACD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YACxB,MAAM,QAAQ,GAAgB,IAAI,4BAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC3D,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAe,EAAE,EAAE;gBAC3C,MAAM,CAAC,IAAI,CAAC,wCAAwC,oBAAQ,CAAC,UAAU,GAAG,CAAC,CAAA;gBAC3E,MAAM,eAAe,GAAG,gBAAgB,CAAC,OAAO,CAAa,oBAAQ,CAAC,UAAU,CAAC,CAAA;gBACjF,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;oBAC/B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;oBACnB,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE;wBAClB,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;wBAC/B,MAAM,CAAC,IAAI,CAAC,CAAA;oBACd,CAAC,CAAC,CAAA;gBACJ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;oBACpB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;oBACf,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;oBACpB,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;YACF,QAAQ,CAAC,MAAM,EAAE,CAAA;QACnB,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA/BY,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAEG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GADhC,oBAAoB,CA+BhC;AA/BY,oDAAoB","sourcesContent":["import { IJsFixConfig } from '../../config'\r\nimport { FixAcceptor } from '../fix-acceptor'\r\nimport { HttpAcceptor } from './http-acceptor'\r\nimport { MsgTransport } from '../factory'\r\nimport { inject, injectable } from 'tsyringe'\r\nimport { DITokens } from '../../runtime/di-tokens'\r\nimport { FixSession } from '../session/fix-session'\r\nimport { FixEntity } from '../fix-entity'\r\n\r\n@injectable()\r\nexport class HttpAcceptorListener extends FixEntity {\r\n constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {\r\n super(config)\r\n }\r\n start (): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n const logger = this.config.logFactory.logger('acceptor')\r\n const sessionContainer = this.config.sessionContainer\r\n if (!sessionContainer.isRegistered(DITokens.FixSession)) {\r\n reject(new Error(`application must register a DI token '${DITokens.FixSession}' - see src/sample`))\r\n }\r\n logger.info('starting.')\r\n const acceptor: FixAcceptor = new HttpAcceptor(this.config)\r\n acceptor.on('transport', (t: MsgTransport) => {\r\n logger.info(`creates new transport using DI token ${DITokens.FixSession}.`)\r\n const acceptorSession = sessionContainer.resolve<FixSession>(DITokens.FixSession)\r\n acceptorSession.run(t).then(() => {\r\n logger.info('ends')\r\n acceptor.close(() => {\r\n logger.info('acceptor closed.')\r\n accept(true)\r\n })\r\n }).catch((e: Error) => {\r\n logger.error(e)\r\n logger.info(e.stack)\r\n reject(e)\r\n })\r\n })\r\n acceptor.listen()\r\n })\r\n }\r\n}\r\n"]}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
2
14
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
15
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
16
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,14 +22,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
22
|
};
|
|
11
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
24
|
exports.HttpAcceptor = void 0;
|
|
13
|
-
const
|
|
25
|
+
const factory_1 = require("../factory");
|
|
14
26
|
const fix_acceptor_1 = require("../fix-acceptor");
|
|
15
27
|
const duplex_1 = require("../duplex");
|
|
16
28
|
const collections_1 = require("../../collections");
|
|
17
29
|
const express = require("express");
|
|
18
30
|
const bodyParser = require("body-parser");
|
|
19
31
|
const uuid_1 = require("uuid");
|
|
20
|
-
|
|
32
|
+
const tsyringe_1 = require("tsyringe");
|
|
33
|
+
const di_tokens_1 = require("../../runtime/di-tokens");
|
|
34
|
+
let HttpAcceptor = class HttpAcceptor extends fix_acceptor_1.FixAcceptor {
|
|
21
35
|
constructor(config) {
|
|
22
36
|
super(config.description.application);
|
|
23
37
|
this.config = config;
|
|
@@ -53,7 +67,7 @@ class HttpAcceptor extends fix_acceptor_1.FixAcceptor {
|
|
|
53
67
|
saveTransport(tid, transport) {
|
|
54
68
|
this.transports[tid] = transport;
|
|
55
69
|
const keys = Object.keys(this.transports);
|
|
56
|
-
const a = uuid_1.v4();
|
|
70
|
+
const a = (0, uuid_1.v4)();
|
|
57
71
|
this.keys.addUpdate(a, transport);
|
|
58
72
|
this.logger.info(`new transport id = ${tid} token = ${a} created total transports = ${keys.length}`);
|
|
59
73
|
this.emit('transport', transport);
|
|
@@ -94,7 +108,7 @@ class HttpAcceptor extends fix_acceptor_1.FixAcceptor {
|
|
|
94
108
|
const id = this.nextId++;
|
|
95
109
|
this.logger.info(JSON.stringify(body, null, 4));
|
|
96
110
|
const d = new duplex_1.StringDuplex();
|
|
97
|
-
const transport = new
|
|
111
|
+
const transport = new factory_1.MsgTransport(id, this.config, d);
|
|
98
112
|
const token = this.saveTransport(id, transport);
|
|
99
113
|
this.respond(d, res, token).then(() => {
|
|
100
114
|
this.logger.info('responded to logon');
|
|
@@ -161,6 +175,11 @@ class HttpAcceptor extends fix_acceptor_1.FixAcceptor {
|
|
|
161
175
|
}
|
|
162
176
|
}));
|
|
163
177
|
}
|
|
164
|
-
}
|
|
178
|
+
};
|
|
179
|
+
HttpAcceptor = __decorate([
|
|
180
|
+
(0, tsyringe_1.injectable)(),
|
|
181
|
+
__param(0, (0, tsyringe_1.inject)(di_tokens_1.DITokens.IJsFixConfig)),
|
|
182
|
+
__metadata("design:paramtypes", [Object])
|
|
183
|
+
], HttpAcceptor);
|
|
165
184
|
exports.HttpAcceptor = HttpAcceptor;
|
|
166
185
|
//# sourceMappingURL=http-acceptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-acceptor.js","sourceRoot":"","sources":["../../../src/transport/http/http-acceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+C;AAC/C,kDAA6C;AAG7C,sCAAmD;AACnD,mDAA8C;AAE9C,mCAAkC;AAClC,0CAAyC;AAEzC,+BAAmC;AAEnC,MAAa,YAAa,SAAQ,0BAAW;IAQ3C,YAA6B,MAAoB;QAC/C,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;QADV,WAAM,GAAN,MAAM,CAAc;QAPzC,QAAG,GAAoB,OAAO,EAAE,CAAA;QAIhC,WAAM,GAAW,CAAC,CAAA;QAClB,SAAI,GAA6B,IAAI,wBAAU,EAAE,CAAA;QAIvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC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,OAAO,CAAC,aAAa,CAAC,CAAA;YAC5D,IAAI,CAAC,CAAC,EAAE;gBACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAA;gBAClD,GAAG,CAAC,IAAI,CAAC;oBACP,KAAK,EAAE,mBAAmB;iBAC3B,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAA;gBAClB,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;oBAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,GAAG,EAAE,CAAC,CAAA;gBAC7C,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;oBACX,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACb,CAAC,CAAC,CAAA;gBACF,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aAC5B;QACH,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CACF;AAzJD,oCAyJC","sourcesContent":["import { MsgTransport } from '../msg-transport'\r\nimport { FixAcceptor } from '../fix-acceptor'\r\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\r\nimport { IFixmlRequest } from '../fixml'\r\nimport { StringDuplex, FixDuplex } from '../duplex'\r\nimport { Dictionary } from '../../collections'\r\n\r\nimport * as express from 'express'\r\nimport * as bodyParser from 'body-parser'\r\nimport * as http from 'http'\r\nimport { v4 as uuidv4 } from 'uuid'\r\n\r\nexport class HttpAcceptor extends FixAcceptor {\r\n private app: express.Express = express()\r\n private server: http.Server\r\n private readonly logger: IJsFixLogger\r\n private readonly router: express.Router\r\n private nextId: number = 0\r\n private keys: Dictionary<MsgTransport> = new Dictionary()\r\n\r\n constructor (public readonly config: IJsFixConfig) {\r\n super(config.description.application)\r\n this.logger = config.logFactory.logger(`${config.description.application.name}:HttpAcceptor`)\r\n this.logger.info('creating http server')\r\n this.router = express.Router()\r\n this.router.use(bodyParser.json())\r\n this.subscribe()\r\n this.app.use('/', this.router)\r\n }\r\n\r\n public listen (): void {\r\n const app = this.config.description.application\r\n const port = app.http.port\r\n const logger = this.logger\r\n logger.info(`start to listen ${port}`)\r\n this.server = this.app.listen(port, () => {\r\n logger.info(`app listening at http://localhost:${port}${app.http.uri}`)\r\n })\r\n this.server.on('error', ((err: Error) => {\r\n logger.error(err)\r\n this.emit('error', err)\r\n }))\r\n }\r\n\r\n public close (callback?: (err?: Error) => void): void {\r\n const app = this.config.description.application\r\n const port = app.http.port\r\n this.logger.info(`close listener on port ${port}`)\r\n this.server.close(callback)\r\n }\r\n\r\n private saveTransport (tid: number, transport: MsgTransport): string {\r\n this.transports[tid] = transport\r\n const keys: string[] = Object.keys(this.transports)\r\n const a = uuidv4()\r\n this.keys.addUpdate(a, transport)\r\n this.logger.info(`new transport id = ${tid} token = ${a} created total transports = ${keys.length}`)\r\n this.emit('transport', transport)\r\n return a\r\n }\r\n\r\n private harvestTransport (token: string, tid: number): void {\r\n delete this.transports[tid]\r\n this.keys.remove(token)\r\n const keys: string[] = Object.keys(this.transports)\r\n this.logger.info(`transport ${tid} ends total transports = ${keys.length}`)\r\n }\r\n\r\n private respond (duplex: FixDuplex, res: express.Response, token: string = null): Promise<any> {\r\n return new Promise<any>((accept, reject) => {\r\n res.setHeader('Content-Type', 'application/json')\r\n const timer = setTimeout(() => {\r\n const businessReject = `<FIXML><BizMsgRej BizRejRsn=\"4\" Txt=\"no response from application\"/></FIXML>`\r\n const b = Buffer.from(businessReject, 'utf-8')\r\n duplex.writable.removeListener('data', transmit)\r\n res.send(b)\r\n reject(new Error('no response'))\r\n }, 5000)\r\n\r\n const transmit = (d: Buffer) => {\r\n this.logger.info('responding to request')\r\n clearTimeout(timer)\r\n if (token) {\r\n res.setHeader('authorization', token)\r\n }\r\n duplex.writable.removeListener('data', transmit)\r\n res.send(d)\r\n accept(true)\r\n }\r\n\r\n duplex.writable.on('data', transmit)\r\n })\r\n }\r\n\r\n private async logon (req: express.Request, res: express.Response) {\r\n const body: IFixmlRequest = req.body\r\n const id = this.nextId++\r\n this.logger.info(JSON.stringify(body, null,4))\r\n // check hand back session key\r\n const d = new StringDuplex()\r\n const transport = new MsgTransport(id, this.config, d)\r\n const token = this.saveTransport(id, transport)\r\n this.respond(d, res, token).then(() => {\r\n this.logger.info('responded to logon')\r\n }).catch((e: Error) => {\r\n this.logger.error(e)\r\n })\r\n d.readable.push(body.fixml)\r\n }\r\n\r\n private async logout (req: express.Request, res: express.Response) {\r\n const headers = req.headers\r\n const body: IFixmlRequest = req.body\r\n const t: MsgTransport = this.keys.get(headers.authorization)\r\n if (t) {\r\n const token = req.headers.authorization\r\n this.harvestTransport(token, t.id)\r\n const d = t.duplex\r\n this.respond(d, res, token).then(() => {\r\n this.logger.info('responded to logout')\r\n t.end()\r\n }).catch((e: Error) => {\r\n this.logger.error(e)\r\n })\r\n d.readable.push(body.fixml)\r\n }\r\n }\r\n\r\n private subscribe (): void {\r\n const router = this.router\r\n const app = this.config.description.application\r\n const root = app.http.uri\r\n const authorise = `${root}authorise`\r\n const query = `${root}query`\r\n this.logger.info(`uri: authorise ${authorise}, query ${query}`)\r\n router.post(authorise, async (req: express.Request, res: express.Response) => {\r\n if (!req.headers.authorization) {\r\n this.logger.info('logon')\r\n await this.logon(req, res)\r\n } else {\r\n this.logger.info('logout')\r\n await this.logout(req, res)\r\n }\r\n })\r\n\r\n router.get(query, async (req: express.Request, res: express.Response) => {\r\n const headers = req.headers\r\n const body: IFixmlRequest = req.body\r\n const t: MsgTransport = this.keys.get(headers.authorization)\r\n if (!t) {\r\n this.logger.info(`received request with no token`)\r\n res.send({\r\n error: 'no key with query'\r\n })\r\n } else {\r\n const d = t.duplex\r\n this.respond(d, res).then(() => {\r\n this.logger.info(`responded to ${req.url}`)\r\n }).catch(e => {\r\n res.send(e)\r\n })\r\n d.readable.push(body.fixml)\r\n }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AC,CAAA;gBACF,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aAC5B;QACH,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAzJY,YAAY;IADxB,IAAA,qBAAU,GAAE;IASG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GARhC,YAAY,CAyJxB;AAzJY,oCAAY","sourcesContent":["import { MsgTransport } from '../factory'\r\nimport { FixAcceptor } from '../fix-acceptor'\r\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\r\nimport { IFixmlRequest } from '../fixml'\r\nimport { StringDuplex, FixDuplex } from '../duplex'\r\nimport { Dictionary } from '../../collections'\r\n\r\nimport * as express from 'express'\r\nimport * as bodyParser from 'body-parser'\r\nimport * as http from 'http'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { inject, injectable } from 'tsyringe'\r\nimport { DITokens } from '../../runtime/di-tokens'\r\n\r\n@injectable()\r\nexport class HttpAcceptor extends FixAcceptor {\r\n private app: express.Express = express()\r\n private server: http.Server\r\n private readonly logger: IJsFixLogger\r\n private readonly router: express.Router\r\n private nextId: number = 0\r\n private keys: Dictionary<MsgTransport> = new Dictionary()\r\n\r\n constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {\r\n super(config.description.application)\r\n this.logger = config.logFactory.logger(`${config.description.application.name}:HttpAcceptor`)\r\n this.logger.info('creating http server')\r\n this.router = express.Router()\r\n this.router.use(bodyParser.json())\r\n this.subscribe()\r\n this.app.use('/', this.router)\r\n }\r\n\r\n public listen (): void {\r\n const app = this.config.description.application\r\n const port = app.http.port\r\n const logger = this.logger\r\n logger.info(`start to listen ${port}`)\r\n this.server = this.app.listen(port, () => {\r\n logger.info(`app listening at http://localhost:${port}${app.http.uri}`)\r\n })\r\n this.server.on('error', ((err: Error) => {\r\n logger.error(err)\r\n this.emit('error', err)\r\n }))\r\n }\r\n\r\n public close (callback?: (err?: Error) => void): void {\r\n const app = this.config.description.application\r\n const port = app.http.port\r\n this.logger.info(`close listener on port ${port}`)\r\n this.server.close(callback)\r\n }\r\n\r\n private saveTransport (tid: number, transport: MsgTransport): string {\r\n this.transports[tid] = transport\r\n const keys: string[] = Object.keys(this.transports)\r\n const a = uuidv4()\r\n this.keys.addUpdate(a, transport)\r\n this.logger.info(`new transport id = ${tid} token = ${a} created total transports = ${keys.length}`)\r\n this.emit('transport', transport)\r\n return a\r\n }\r\n\r\n private harvestTransport (token: string, tid: number): void {\r\n delete this.transports[tid]\r\n this.keys.remove(token)\r\n const keys: string[] = Object.keys(this.transports)\r\n this.logger.info(`transport ${tid} ends total transports = ${keys.length}`)\r\n }\r\n\r\n private respond (duplex: FixDuplex, res: express.Response, token: string = null): Promise<any> {\r\n return new Promise<any>((accept, reject) => {\r\n res.setHeader('Content-Type', 'application/json')\r\n const timer = setTimeout(() => {\r\n const businessReject = `<FIXML><BizMsgRej BizRejRsn=\"4\" Txt=\"no response from application\"/></FIXML>`\r\n const b = Buffer.from(businessReject, 'utf-8')\r\n duplex.writable.removeListener('data', transmit)\r\n res.send(b)\r\n reject(new Error('no response'))\r\n }, 5000)\r\n\r\n const transmit = (d: Buffer) => {\r\n this.logger.info('responding to request')\r\n clearTimeout(timer)\r\n if (token) {\r\n res.setHeader('authorization', token)\r\n }\r\n duplex.writable.removeListener('data', transmit)\r\n res.send(d)\r\n accept(true)\r\n }\r\n\r\n duplex.writable.on('data', transmit)\r\n })\r\n }\r\n\r\n private async logon (req: express.Request, res: express.Response) {\r\n const body: IFixmlRequest = req.body\r\n const id = this.nextId++\r\n this.logger.info(JSON.stringify(body, null,4))\r\n // check hand back session key\r\n const d = new StringDuplex()\r\n const transport = new MsgTransport(id, this.config, d)\r\n const token = this.saveTransport(id, transport)\r\n this.respond(d, res, token).then(() => {\r\n this.logger.info('responded to logon')\r\n }).catch((e: Error) => {\r\n this.logger.error(e)\r\n })\r\n d.readable.push(body.fixml)\r\n }\r\n\r\n private async logout (req: express.Request, res: express.Response) {\r\n const headers = req.headers\r\n const body: IFixmlRequest = req.body\r\n const t: MsgTransport = this.keys.get(headers.authorization)\r\n if (t) {\r\n const token = req.headers.authorization\r\n this.harvestTransport(token, t.id)\r\n const d = t.duplex\r\n this.respond(d, res, token).then(() => {\r\n this.logger.info('responded to logout')\r\n t.end()\r\n }).catch((e: Error) => {\r\n this.logger.error(e)\r\n })\r\n d.readable.push(body.fixml)\r\n }\r\n }\r\n\r\n private subscribe (): void {\r\n const router = this.router\r\n const app = this.config.description.application\r\n const root = app.http.uri\r\n const authorise = `${root}authorise`\r\n const query = `${root}query`\r\n this.logger.info(`uri: authorise ${authorise}, query ${query}`)\r\n router.post(authorise, async (req: express.Request, res: express.Response) => {\r\n if (!req.headers.authorization) {\r\n this.logger.info('logon')\r\n await this.logon(req, res)\r\n } else {\r\n this.logger.info('logout')\r\n await this.logout(req, res)\r\n }\r\n })\r\n\r\n router.get(query, async (req: express.Request, res: express.Response) => {\r\n const headers = req.headers\r\n const body: IFixmlRequest = req.body\r\n const t: MsgTransport = this.keys.get(headers.authorization)\r\n if (!t) {\r\n this.logger.info(`received request with no token`)\r\n res.send({\r\n error: 'no key with query'\r\n })\r\n } else {\r\n const d = t.duplex\r\n this.respond(d, res).then(() => {\r\n this.logger.info(`responded to ${req.url}`)\r\n }).catch(e => {\r\n res.send(e)\r\n })\r\n d.readable.push(body.fixml)\r\n }\r\n })\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-adapter.js","sourceRoot":"","sources":["../../../src/transport/http/http-adapter.ts"],"names":[],"mappings":"","sourcesContent":["import { IHtmlOptions } from './html-options'\r\n\r\nexport interface IHttpAdapter {\r\n getOptions (data: Buffer): IHtmlOptions\r\n beginMessage (msgType: string): void\r\n endMessage (m: any): Buffer\r\n}\r\n"]}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { IJsFixConfig } from '../../config';
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
1
|
+
import { IJsFixConfig, IJsFixLogger } from '../../config';
|
|
2
|
+
import { FixEntity } from '../fix-entity';
|
|
3
|
+
export declare class HttpInitiator extends FixEntity {
|
|
4
|
+
readonly config: IJsFixConfig;
|
|
5
|
+
logger: IJsFixLogger;
|
|
6
|
+
constructor(config: IJsFixConfig);
|
|
7
|
+
start(): Promise<any>;
|
|
8
|
+
connect(config: IJsFixConfig): Promise<any>;
|
|
9
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
2
14
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
15
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
16
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -9,31 +21,50 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
21
|
});
|
|
10
22
|
};
|
|
11
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
24
|
+
exports.HttpInitiator = void 0;
|
|
25
|
+
const factory_1 = require("../factory");
|
|
14
26
|
const duplex_1 = require("../duplex");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
const tsyringe_1 = require("tsyringe");
|
|
28
|
+
const di_tokens_1 = require("../../runtime/di-tokens");
|
|
29
|
+
const fix_entity_1 = require("../fix-entity");
|
|
30
|
+
let HttpInitiator = class HttpInitiator extends fix_entity_1.FixEntity {
|
|
31
|
+
constructor(config) {
|
|
32
|
+
super(config);
|
|
33
|
+
this.config = config;
|
|
34
|
+
this.logger = config.logFactory.logger('initiator');
|
|
35
|
+
}
|
|
36
|
+
start() {
|
|
37
|
+
return this.connect(this.config);
|
|
38
|
+
}
|
|
39
|
+
connect(config) {
|
|
40
|
+
return new Promise((accept, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const adapter = config.description.application.http.adapter;
|
|
42
|
+
if (!adapter) {
|
|
43
|
+
reject('http initiator needs config.description.application.http.adapter');
|
|
44
|
+
}
|
|
45
|
+
const sessionContainer = this.config.sessionContainer;
|
|
46
|
+
if (!sessionContainer.isRegistered(di_tokens_1.DITokens.FixSession)) {
|
|
47
|
+
reject(new Error(`application must register a DI token '${di_tokens_1.DITokens.FixSession}' - see src/sample`));
|
|
48
|
+
}
|
|
49
|
+
this.logger.info(`create session with DI Token ${di_tokens_1.DITokens.FixSession}`);
|
|
50
|
+
const initiatorSession = sessionContainer.resolve(di_tokens_1.DITokens.FixSession);
|
|
51
|
+
this.logger.info('connecting ...');
|
|
52
|
+
const initiatorTransport = new factory_1.MsgTransport(0, config, new duplex_1.HttpDuplex(adapter));
|
|
53
|
+
this.logger.info('... connected, run session');
|
|
54
|
+
initiatorSession.run(initiatorTransport).then(() => {
|
|
55
|
+
this.logger.info('ends');
|
|
56
|
+
accept(true);
|
|
57
|
+
}).catch((e) => {
|
|
58
|
+
this.logger.error(e);
|
|
59
|
+
reject(e);
|
|
60
|
+
});
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
HttpInitiator = __decorate([
|
|
65
|
+
(0, tsyringe_1.injectable)(),
|
|
66
|
+
__param(0, (0, tsyringe_1.inject)(di_tokens_1.DITokens.IJsFixConfig)),
|
|
67
|
+
__metadata("design:paramtypes", [Object])
|
|
68
|
+
], HttpInitiator);
|
|
69
|
+
exports.HttpInitiator = HttpInitiator;
|
|
39
70
|
//# sourceMappingURL=http-initiator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-initiator.js","sourceRoot":"","sources":["../../../src/transport/http/http-initiator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-initiator.js","sourceRoot":"","sources":["../../../src/transport/http/http-initiator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAyC;AACzC,sCAAsC;AAEtC,uCAA6C;AAC7C,uDAAkD;AAClD,8CAAyC;AAGzC,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,sBAAS;IAE1C,YAA4D,MAAoB;QAC9E,KAAK,CAAC,MAAM,CAAC,CAAA;QAD6C,WAAM,GAAN,MAAM,CAAc;QAE9E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;IACrD,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;IAGD,OAAO,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;YACX,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AApCY,aAAa;IADzB,IAAA,qBAAU,GAAE;IAGG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GAFhC,aAAa,CAoCzB;AApCY,sCAAa","sourcesContent":["import { IJsFixConfig, IJsFixLogger } from '../../config'\r\nimport { MsgTransport } from '../factory'\r\nimport { HttpDuplex } from '../duplex'\r\nimport { FixSession } from '../session/fix-session'\r\nimport { inject, injectable } from 'tsyringe'\r\nimport { DITokens } from '../../runtime/di-tokens'\r\nimport { FixEntity } from '../fix-entity'\r\n\r\n@injectable()\r\nexport class HttpInitiator extends FixEntity {\r\n logger: IJsFixLogger\r\n constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {\r\n super(config)\r\n this.logger = config.logFactory.logger('initiator')\r\n }\r\n\r\n start (): Promise<any> {\r\n return this.connect(this.config)\r\n }\r\n\r\n// the adapter will be provided on config\r\n connect (config: IJsFixConfig): Promise<any> {\r\n return new Promise<any>(async (accept, reject) => {\r\n const adapter = config.description.application.http.adapter\r\n if (!adapter) {\r\n reject('http initiator needs config.description.application.http.adapter')\r\n }\r\n const sessionContainer = this.config.sessionContainer\r\n if (!sessionContainer.isRegistered(DITokens.FixSession)) {\r\n reject(new Error(`application must register a DI token '${DITokens.FixSession}' - see src/sample`))\r\n }\r\n this.logger.info(`create session with DI Token ${DITokens.FixSession}`)\r\n const initiatorSession = sessionContainer.resolve<FixSession>(DITokens.FixSession)\r\n this.logger.info('connecting ...')\r\n const initiatorTransport: MsgTransport = new MsgTransport(0, config, new HttpDuplex(adapter))\r\n this.logger.info('... connected, run session')\r\n initiatorSession.run(initiatorTransport).then(() => {\r\n this.logger.info('ends')\r\n accept(true)\r\n }).catch((e: Error) => {\r\n this.logger.error(e)\r\n reject(e)\r\n })\r\n })\r\n }\r\n}\r\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IJsFixConfig } from '../../config';
|
|
3
|
-
import {
|
|
3
|
+
import { IHttpAdapter } from './http-adapter';
|
|
4
|
+
import { IHtmlOptions } from './html-options';
|
|
4
5
|
export declare class HttpJsonSampleAdapter implements IHttpAdapter {
|
|
5
6
|
readonly config: IJsFixConfig;
|
|
6
7
|
private logger;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.HttpJsonSampleAdapter = void 0;
|
|
4
16
|
const http_transaction_1 = require("./http-transaction");
|
|
5
17
|
const collections_1 = require("../../collections");
|
|
6
|
-
|
|
18
|
+
const tsyringe_1 = require("tsyringe");
|
|
19
|
+
const di_tokens_1 = require("../../runtime/di-tokens");
|
|
20
|
+
let HttpJsonSampleAdapter = class HttpJsonSampleAdapter {
|
|
7
21
|
constructor(config) {
|
|
8
22
|
this.config = config;
|
|
9
23
|
this.queue = [];
|
|
@@ -62,6 +76,11 @@ class HttpJsonSampleAdapter {
|
|
|
62
76
|
}
|
|
63
77
|
this.queue.push(new http_transaction_1.HttpTransaction(msgType, options));
|
|
64
78
|
}
|
|
65
|
-
}
|
|
79
|
+
};
|
|
80
|
+
HttpJsonSampleAdapter = __decorate([
|
|
81
|
+
(0, tsyringe_1.injectable)(),
|
|
82
|
+
__param(0, (0, tsyringe_1.inject)(di_tokens_1.DITokens.IJsFixConfig)),
|
|
83
|
+
__metadata("design:paramtypes", [Object])
|
|
84
|
+
], HttpJsonSampleAdapter);
|
|
66
85
|
exports.HttpJsonSampleAdapter = HttpJsonSampleAdapter;
|
|
67
86
|
//# sourceMappingURL=http-json-sample-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-json-sample-adapter.js","sourceRoot":"","sources":["../../../src/transport/http/http-json-sample-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-json-sample-adapter.js","sourceRoot":"","sources":["../../../src/transport/http/http-json-sample-adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,yDAAoD;AACpD,mDAA8C;AAI9C,uCAA6C;AAC7C,uDAAkD;AAGlD,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAKhC,YAA4D,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;QAHxE,UAAK,GAAsB,EAAE,CAAA;QAC7B,UAAK,GAAW,IAAI,CAAA;QACpB,WAAM,GAA2B,IAAI,wBAAU,EAAE,CAAA;QAEvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAA;QAC3D,IAAI,CAAC,OAAO,EAAE;YACZ,OAAM;SACP;QACD,OAAO,CAAC,OAAO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I,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QAC1D,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;YAC1B,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG;YACpB,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;YACtB,uBAAuB,EAAE,KAAK,CAAC,KAAK,CAAC,uBAAuB;YAC5D,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO;SACb,CAAA;QACjB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC/B,IAAI,OAAO,EAAE;YACX,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAA;aACnC;iBAAM,IAAI,OAAO,KAAK,SAAS,EAAE;gBAChC,OAAO,OAAO,CAAC,aAAa,CAAA;aAC7B;SACF;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,kCAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AA/DY,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAMG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GALhC,qBAAqB,CA+DjC;AA/DY,sDAAqB","sourcesContent":["import { IJsFixConfig, IJsFixLogger } from '../../config'\r\nimport { HttpTransaction } from './http-transaction'\r\nimport { Dictionary } from '../../collections'\r\nimport { IHttpAdapter } from './http-adapter'\r\nimport { IHtmlRoute } from './html-route'\r\nimport { IHtmlOptions } from './html-options'\r\nimport { inject, injectable } from 'tsyringe'\r\nimport { DITokens } from '../../runtime/di-tokens'\r\n\r\n@injectable()\r\nexport class HttpJsonSampleAdapter implements IHttpAdapter {\r\n private logger: IJsFixLogger\r\n private queue: HttpTransaction[] = []\r\n private token: string = null\r\n private routes: Dictionary<IHtmlRoute> = new Dictionary()\r\n constructor (@inject(DITokens.IJsFixConfig) public readonly config: IJsFixConfig) {\r\n this.logger = config.logFactory.logger('http.adapter')\r\n const routes = this.routes\r\n const options = config.description.application.http.options\r\n if (!options) {\r\n return\r\n }\r\n options.forEach((o: IHtmlRoute) => {\r\n routes.addUpdate(o.name, o)\r\n })\r\n this.logger.info(`instance created routes ${routes.count()}`)\r\n }\r\n\r\n public getOptions (data: Buffer): IHtmlOptions {\r\n const q = this.queue\r\n if (q.length === 0) {\r\n return null\r\n }\r\n const next: HttpTransaction = q.shift()\r\n const options = next.options\r\n options.body = {\r\n fixml: data.toString()\r\n }\r\n this.logger.info(`${next.msgType}: ${next.options.method} ${next.options.uri} ${data.length}`)\r\n return options\r\n }\r\n\r\n endMessage (m: any): Buffer {\r\n // grab token if not yet received\r\n if (!this.token) {\r\n const headers = m.headers\r\n this.token = headers.authorization\r\n this.logger.info(`receive token ${this.token}`)\r\n }\r\n return m.body\r\n }\r\n\r\n beginMessage (msgType: string): void {\r\n // build options based on type\r\n const routes = this.routes\r\n const route = routes.get(msgType) || routes.get('default')\r\n const options = {\r\n method: route.value.method,\r\n uri: route.value.uri,\r\n json: route.value.json,\r\n resolveWithFullResponse: route.value.resolveWithFullResponse,\r\n headers: route.value.headers\r\n } as IHtmlOptions\r\n const headers = options.headers\r\n if (headers) {\r\n if (this.token) {\r\n headers.authorization = this.token\r\n } else if (msgType === 'UserReq') {\r\n delete headers.authorization\r\n }\r\n }\r\n this.queue.push(new HttpTransaction(msgType, options))\r\n }\r\n}\r\n"]}
|