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
|
@@ -9,45 +9,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
13
|
-
const transport_1 = require("../transport");
|
|
12
|
+
require("reflect-metadata");
|
|
14
13
|
const util_1 = require("../util");
|
|
15
|
-
const path = require("path");
|
|
16
14
|
const __1 = require("..");
|
|
15
|
+
const setup_1 = require("./env/setup");
|
|
17
16
|
let definitions;
|
|
18
17
|
let jsonHelper;
|
|
19
|
-
const root = path.join(__dirname, '../../data');
|
|
20
18
|
const logon = '8=FIX4.4|9=0000208|35=A|49=sender-10|56=target-20|34=1|57=sub-a|52=20180610-10:39:01.621|98=2|108=62441|95=20|96=VgfoSqo56NqSVI1fLdlI|141=Y|789=4886|383=20|384=1|372=ipsum|385=R|464=N|553=sit|554=consectetur|10=49|';
|
|
19
|
+
let config;
|
|
20
|
+
let setup = null;
|
|
21
21
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
setup = new setup_1.Setup();
|
|
23
|
+
yield setup.init();
|
|
24
|
+
definitions = setup.definitions;
|
|
24
25
|
jsonHelper = new util_1.JsonHelper(definitions);
|
|
26
|
+
config = setup.clientConfig;
|
|
25
27
|
}), 45000);
|
|
26
|
-
class ParsingResult {
|
|
27
|
-
constructor(event, msgType, view, contents, parser) {
|
|
28
|
-
this.event = event;
|
|
29
|
-
this.msgType = msgType;
|
|
30
|
-
this.view = view;
|
|
31
|
-
this.contents = contents;
|
|
32
|
-
this.parser = parser;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function toParse(text, chunks = false) {
|
|
36
|
-
return new Promise((resolve, reject) => {
|
|
37
|
-
const parser = new buffer_1.AsciiParser(definitions, new transport_1.StringDuplex(text, chunks).readable, buffer_1.AsciiChars.Pipe);
|
|
38
|
-
parser.on('error', (e) => {
|
|
39
|
-
reject(e);
|
|
40
|
-
});
|
|
41
|
-
parser.on('msg', (msgType, view) => {
|
|
42
|
-
resolve(new ParsingResult('msg', msgType, view.clone(), parser.state.elasticBuffer.toString(), parser));
|
|
43
|
-
});
|
|
44
|
-
parser.on('done', () => {
|
|
45
|
-
resolve(new ParsingResult('done', null, null, parser.state.elasticBuffer.toString(), parser));
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
28
|
test('0 gaps', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
-
const res = yield
|
|
29
|
+
const res = yield setup.client.parseText(logon);
|
|
51
30
|
expect(res.event).toEqual('msg');
|
|
52
31
|
expect(res.msgType).toEqual(__1.MsgType.Logon);
|
|
53
32
|
const unknowns = res.view.structure.layout['.undefined'];
|
|
@@ -59,7 +38,7 @@ test('0 gaps', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
59
38
|
}));
|
|
60
39
|
test('1 gap', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
40
|
const gap = logon.replace('108=62441|', '108=62441|9999=im not here');
|
|
62
|
-
const res = yield
|
|
41
|
+
const res = yield setup.client.parseText(gap);
|
|
63
42
|
expect(res.event).toEqual('msg');
|
|
64
43
|
expect(res.msgType).toEqual(__1.MsgType.Logon);
|
|
65
44
|
const unknown = res.view.structure.layout['.undefined'];
|
|
@@ -73,7 +52,7 @@ test('1 gap', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
73
52
|
}));
|
|
74
53
|
test('1 gap next to 1 gap', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
54
|
const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|');
|
|
76
|
-
const res = yield
|
|
55
|
+
const res = yield setup.client.parseText(gap);
|
|
77
56
|
expect(res.event).toEqual('msg');
|
|
78
57
|
expect(res.msgType).toEqual(__1.MsgType.Logon);
|
|
79
58
|
const unknowns = res.view.structure.layout['.undefined'];
|
|
@@ -90,7 +69,7 @@ test('1 gap next to 1 gap', () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
90
69
|
}));
|
|
91
70
|
test('1 gap undefined msg', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
92
71
|
const gap = logon.replace('108=62441|', '108=62441|9999=im not here');
|
|
93
|
-
const res = yield
|
|
72
|
+
const res = yield setup.client.parseText(gap);
|
|
94
73
|
expect(res.event).toEqual('msg');
|
|
95
74
|
expect(res.msgType).toEqual(__1.MsgType.Logon);
|
|
96
75
|
expect(res.view.getUndefined()).toBeTruthy();
|
|
@@ -98,7 +77,7 @@ test('1 gap undefined msg', () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
98
77
|
}));
|
|
99
78
|
test('2 gap undefined msg', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
79
|
const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|');
|
|
101
|
-
const res = yield
|
|
80
|
+
const res = yield setup.client.parseText(gap);
|
|
102
81
|
expect(res.event).toEqual('msg');
|
|
103
82
|
expect(res.msgType).toEqual(__1.MsgType.Logon);
|
|
104
83
|
expect(res.view.getUndefined()).toBeTruthy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-segment.test.js","sourceRoot":"","sources":["../../src/test/ascii-segment.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ascii-segment.test.js","sourceRoot":"","sources":["../../src/test/ascii-segment.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAKzB,kCAAoC;AACpC,0BAA0C;AAC1C,uCAAmC;AAGnC,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,MAAM,KAAK,GAAW,wNAAwN,CAAA;AAC9O,IAAI,MAAoB,CAAA;AAExB,IAAI,KAAK,GAAU,IAAI,CAAA;AACvB,SAAS,CAAC,GAAS,EAAE;IACnB,KAAK,GAAG,IAAI,aAAK,EAAE,CAAA;IACnB,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAClB,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAC/B,UAAU,GAAG,IAAI,iBAAU,CAAC,W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AAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACpE,CAAC,CAAA,CAAC,CAAA;AAEF,IAAI,CAAC,qBAAqB,EAAE,GAAS,EAAE;IACrC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAA;IACjE,MAAM,GAAG,GAAkB,MAAM,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC5D,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAO,CAAC,KAAK,CAAC,CAAA;IAC1C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE,CAAA;IAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACrE,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { SegmentDescription } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\nimport { ILogon } from '../types/FIX4.4/repo'\r\nimport { JsonHelper } from '../util'\r\nimport { IJsFixConfig, MsgType } from '..'\r\nimport { Setup } from './env/setup'\r\nimport { ParsingResult } from './env/parsing-result'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nconst logon: string = '8=FIX4.4|9=0000208|35=A|49=sender-10|56=target-20|34=1|57=sub-a|52=20180610-10:39:01.621|98=2|108=62441|95=20|96=VgfoSqo56NqSVI1fLdlI|141=Y|789=4886|383=20|384=1|372=ipsum|385=R|464=N|553=sit|554=consectetur|10=49|'\r\nlet config: IJsFixConfig\r\n\r\nlet setup: Setup = null\r\nbeforeAll(async () => {\r\n setup = new Setup()\r\n await setup.init()\r\n definitions = setup.definitions\r\n jsonHelper = new JsonHelper(definitions)\r\n config = setup.clientConfig\r\n}, 45000)\r\n\r\ntest('0 gaps', async () => {\r\n const res: ParsingResult = await setup.client.parseText(logon)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknowns: SegmentDescription[] = res.view.structure.layout['.undefined']\r\n expect(unknowns).toBeFalsy()\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|9999=im not here')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknown: SegmentDescription = res.view.structure.layout['.undefined']\r\n expect(unknown).toBeTruthy()\r\n expect(unknown.startTag).toEqual(9999)\r\n expect(unknown.startPosition).toEqual(10)\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap next to 1 gap', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n const unknowns: SegmentDescription[] = res.view.structure.layout['.undefined']\r\n expect(unknowns).toBeTruthy()\r\n expect(Array.isArray(unknowns)).toEqual(true)\r\n expect(unknowns[0].startTag).toEqual(1)\r\n expect(unknowns[0].startPosition).toEqual(10)\r\n expect(unknowns[1].startTag).toEqual(2)\r\n expect(unknowns[1].startPosition).toEqual(11)\r\n const o: ILogon = res.view.toObject()\r\n expect(o).toBeTruthy()\r\n expect(o.Password).toEqual('consectetur')\r\n expect(o.Username).toEqual('sit')\r\n})\r\n\r\ntest('1 gap undefined msg', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|9999=im not here')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n expect(res.view.getUndefined()).toBeTruthy()\r\n expect(res.view.undefinedForMsg()).toEqual('undefined tag = 9999')\r\n})\r\n\r\ntest('2 gap undefined msg', async () => {\r\n const gap = logon.replace('108=62441|', '108=62441|1=gap|2=gap|')\r\n const res: ParsingResult = await setup.client.parseText(gap)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.Logon)\r\n expect(res.view.getUndefined()).toBeTruthy()\r\n expect(res.view.undefinedForMsg()).toEqual('undefined tags = 1, 2')\r\n})\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -9,54 +9,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
require("reflect-metadata");
|
|
12
13
|
const path = require("path");
|
|
13
|
-
const buffer_1 = require("../buffer");
|
|
14
|
-
const util_1 = require("../util");
|
|
15
|
-
const store_1 = require("../store");
|
|
16
14
|
const types_1 = require("../types");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
15
|
+
const setup_1 = require("./env/setup");
|
|
16
|
+
const test_recovery_1 = require("./env/test-recovery");
|
|
19
17
|
const root = path.join(__dirname, '../../data');
|
|
20
18
|
let definitions;
|
|
21
|
-
class TestRecovery {
|
|
22
|
-
constructor(views, config) {
|
|
23
|
-
this.views = views;
|
|
24
|
-
this.config = config;
|
|
25
|
-
const id = config.description.SenderCompId;
|
|
26
|
-
this.store = new store_1.FixMsgMemoryStore(`test-${id}`, config);
|
|
27
|
-
this.records = this.getRecords(id);
|
|
28
|
-
this.recovery = new store_1.FixMsgAsciiStoreResend(this.store, config);
|
|
29
|
-
}
|
|
30
|
-
populate() {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const records = this.records;
|
|
33
|
-
const toWrite = records.map(r => this.store.put(r));
|
|
34
|
-
yield Promise.all(toWrite);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
getRecords(comp) {
|
|
38
|
-
return this.views.reduce((agg, v) => {
|
|
39
|
-
if (v.getString(types_1.MsgTag.SenderCompID) === comp) {
|
|
40
|
-
agg.push(v.toMsgStoreRecord());
|
|
41
|
-
}
|
|
42
|
-
return agg;
|
|
43
|
-
}, []);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
19
|
let server;
|
|
47
20
|
let client;
|
|
21
|
+
let setup = null;
|
|
48
22
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const views = yield util_1.replayFixFile(definitions, serverDescription, path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'), delimiter);
|
|
58
|
-
server = new TestRecovery(views, serverConfig);
|
|
59
|
-
client = new TestRecovery(views, clientConfig);
|
|
23
|
+
setup = new setup_1.Setup('session/test-initiator-tls.json', 'session/test-acceptor-tls.json');
|
|
24
|
+
yield setup.init();
|
|
25
|
+
definitions = setup.definitions;
|
|
26
|
+
const serverConfig = setup.serverConfig;
|
|
27
|
+
const clientConfig = setup.clientConfig;
|
|
28
|
+
const views = yield setup.server.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'));
|
|
29
|
+
server = new test_recovery_1.TestRecovery(views, serverConfig);
|
|
30
|
+
client = new test_recovery_1.TestRecovery(views, clientConfig);
|
|
60
31
|
yield server.populate();
|
|
61
32
|
yield client.populate();
|
|
62
33
|
}), 45000);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-store-replay.test.js","s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I,CAAC,4CAA4C,EAAE,GAAS,EAAE;IAC5D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACzD,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;IACxB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7B,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9B,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { AsciiChars, AsciiView, MsgView } from '../buffer'\r\nimport { ISessionDescription } from '../transport'\r\nimport { getDefinitions, replayFixFile } from '../util'\r\nimport {\r\n FixMsgAsciiStoreResend,\r\n FixMsgMemoryStore,\r\n FixMsgStoreRecord,\r\n IFixMsgStore,\r\n IFixMsgStoreRecord\r\n} from '../store'\r\nimport { MsgTag, MsgType } from '../types'\r\nimport { JsFixConfig } from '../config'\r\nimport { ISequenceReset } from '../types/FIX4.4/repo'\r\nimport { AsciiSessionMsgFactory } from '../transport/ascii'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\n\r\nclass TestRecovery {\r\n public readonly store: IFixMsgStore\r\n public readonly records: FixMsgStoreRecord[]\r\n public readonly recovery: FixMsgAsciiStoreResend\r\n\r\n constructor (public readonly views: MsgView[], public readonly config: JsFixConfig) {\r\n const id = config.description.SenderCompId\r\n\r\n this.store = new FixMsgMemoryStore(`test-${id}`, config)\r\n this.records = this.getRecords(id)\r\n this.recovery = new FixMsgAsciiStoreResend(this.store, config)\r\n }\r\n\r\n async populate () {\r\n const records = this.records\r\n const toWrite = records.map(r => this.store.put(r))\r\n await Promise.all(toWrite)\r\n }\r\n\r\n getRecords (comp: string) {\r\n return this.views.reduce((agg: FixMsgStoreRecord[], v: AsciiView) => {\r\n if (v.getString(MsgTag.SenderCompID) === comp) {\r\n agg.push(v.toMsgStoreRecord())\r\n }\r\n return agg\r\n }, [])\r\n }\r\n}\r\n\r\nlet server: TestRecovery\r\nlet client: TestRecovery\r\n\r\nbeforeAll(async () => {\r\n const delimiter = AsciiChars.Pipe\r\n const serverDescription: ISessionDescription = require(path.join(root, 'session/test-acceptor-tls.json'))\r\n const clientDescription: ISessionDescription = require(path.join(root, 'session/test-initiator-tls.json'))\r\n const serverFactory = new AsciiSessionMsgFactory(serverDescription)\r\n const clientFactory = new AsciiSessionMsgFactory(clientDescription)\r\n definitions = await getDefinitions(serverDescription.application.dictionary)\r\n const serverConfig = new JsFixConfig(serverFactory, definitions, serverDescription, delimiter)\r\n const clientConfig = new JsFixConfig(clientFactory, definitions, clientDescription, delimiter)\r\n const views = await replayFixFile(definitions, serverDescription, path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'), delimiter)\r\n server = new TestRecovery(views, serverConfig)\r\n client = new TestRecovery(views, clientConfig)\r\n await server.populate()\r\n await client.populate()\r\n}, 45000)\r\n\r\ntest('expect 15 messages in log', () => {\r\n expect(server.views.length).toEqual(15)\r\n expect(client.views.length).toEqual(15)\r\n})\r\n\r\n/*\r\nclient: (all client messages)\r\n8=FIX4.4|9=000124|35=AD|49=init-tls-comp|56=accept-tls-comp|34=2|57=fix|52=20210307-16:16:44.388|568=all-trades|569=0|263=1|580=1|75=20210307|10=187|\r\n8=FIX4.4|9=000112|35=0|49=init-tls-comp|56=accept-tls-comp|34=3|57=fix|52=20210307-16:17:14.431|112=Sun, 07 Mar 2021 16:17:14 GMT|10=220|\r\n8=FIX4.4|9=000109|35=5|49=init-tls-comp|56=accept-tls-comp|34=4|57=fix|52=20210307-16:17:16.397|58=test_client initiate logout|10=191|\r\n */\r\n\r\n/*\r\nserver: (application only)\r\n\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=2|57=fix|52=20210307-16:16:44.429|568=all-trades|569=0|749=0|750=0|10=142|\r\n8=FIX4.4|9=000209|35=AE|49=accept-tls-comp|56=init-tls-comp|34=3|57=fix|52=20210307-16:16:44.430|571=100000|487=0|856=0|828=0|17=600000|39=2|570=N|55=Platinum|48=Platinum.INC|32=172|31=7.36|75=20210307|60=20210307-16:16:44.430|10=043|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=4|57=fix|52=20210307-16:16:44.431|571=100001|487=0|856=0|828=0|17=600001|39=2|570=N|55=Gold|48=Gold.INC|32=175|31=83.67|75=20210307|60=20210307-16:16:44.430|10=219|\r\n8=FIX4.4|9=000210|35=AE|49=accept-tls-comp|56=init-tls-comp|34=5|57=fix|52=20210307-16:16:44.432|571=100002|487=0|856=0|828=0|17=600002|39=2|570=N|55=Platinum|48=Platinum.INC|32=146|31=41.79|75=20210307|60=20210307-16:16:44.430|10=097|\r\n8=FIX4.4|9=000211|35=AE|49=accept-tls-comp|56=init-tls-comp|34=6|57=fix|52=20210307-16:16:44.432|571=100003|487=0|856=0|828=0|17=600003|39=2|570=N|55=Magnesium|48=Magnesium.INC|32=156|31=8.02|75=20210307|60=20210307-16:16:44.430|10=227|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=7|57=fix|52=20210307-16:16:44.432|571=100004|487=0|856=0|828=0|17=600004|39=2|570=N|55=Gold|48=Gold.INC|32=136|31=32.13|75=20210307|60=20210307-16:16:44.430|10=211|\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=8|57=fix|52=20210307-16:16:44.433|568=all-trades|569=0|749=0|750=1|10=144|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=9|57=fix|52=20210307-16:16:59.449|571=100005|487=0|856=0|828=0|17=600005|39=2|570=N|55=Gold|48=Gold.INC|32=166|31=53.91|75=20210307|60=20210307-16:16:59.449|10=001|\r\n8=FIX4.4|9=000206|35=AE|49=accept-tls-comp|56=init-tls-comp|34=10|57=fix|52=20210307-16:17:14.477|571=100006|487=0|856=0|828=0|17=600006|39=2|570=N|55=Silver|48=Silver.INC|32=105|31=61.2|75=20210307|60=20210307-16:17:14.477|10=191|\r\n */\r\n\r\ntest('server store states',async () => {\r\n const s1 = await server.recovery.store.getState()\r\n expect(s1.length).toEqual(9)\r\n})\r\n\r\ntest('client store states',async () => {\r\n const s1 = await client.recovery.store.getState()\r\n expect(s1.length).toEqual(1)\r\n})\r\n\r\ntest('server replay request from seq=1 to seq=10', async () => {\r\n const vec = await server.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(10)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n for (let i = 2; i <= 6; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n\r\n expect(vec[7].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[7].seqNum).toEqual(8)\r\n\r\n for (let i = 8; i < 10; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n})\r\n\r\ntest('client replay request from seq=1 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(3)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequest)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n checkSeqReset(vec[2], 3, 11)\r\n})\r\n\r\nfunction checkSeqReset (rec: IFixMsgStoreRecord, from: number, to: number) {\r\n const reset: ISequenceReset = rec.obj as ISequenceReset\r\n expect(rec.msgType).toEqual(MsgType.SequenceReset)\r\n expect(rec.obj).toBeTruthy()\r\n expect(rec.seqNum).toEqual(to)\r\n expect(reset.GapFillFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgType).toEqual(MsgType.SequenceReset)\r\n expect(reset.StandardHeader.PossDupFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgSeqNum).toEqual(from)\r\n}\r\n\r\n// expect to gap fill entire request - and move expected seqNo to 11\r\n// which will be the next message sent\r\ntest('client replay request from seq=4 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(4, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(1)\r\n checkSeqReset(vec[0], 4, 11)\r\n})\r\n"]}
|
|
1
|
+
{"version":3,"file":"ascii-store-replay.test.js","sourceRoot":"","sources":["../../src/test/ascii-store-replay.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,6BAA4B;AAM5B,oCAAkC;AAGlC,uCAAmC;AACnC,uDAAkD;AAElD,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAE/B,IAAI,MAAoB,CAAA;AACxB,IAAI,MAAoB,CAAA;AACxB,IAAI,KAAK,GAAU,IAAI,CAAA;AAEvB,SAAS,CAAC,GAAS,EAAE;IACnB,KAAK,GAAG,IAAI,aAAK,CAAC,iCAAiC,EAAE,gCAAgC,CAAC,CAAA;IACtF,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAClB,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,MA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CAAC,CAAA;IAC9B,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,CAAA;IACtC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAO,CAAC,aAAa,CAAC,CAAA;IACnE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,CAAA;IACrD,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACtD,CAAC;AAID,IAAI,CAAC,4CAA4C,EAAE,GAAS,EAAE;IAC5D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACzD,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;IACxB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7B,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9B,CAAC,CAAA,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\n\r\nimport {\r\n IFixMsgStoreRecord\r\n} from '../store'\r\nimport { MsgType } from '../types'\r\nimport { ISequenceReset } from '../types/FIX4.4/repo'\r\n\r\nimport { Setup } from './env/setup'\r\nimport { TestRecovery } from './env/test-recovery'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\n\r\nlet server: TestRecovery\r\nlet client: TestRecovery\r\nlet setup: Setup = null\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup('session/test-initiator-tls.json', 'session/test-acceptor-tls.json')\r\n await setup.init()\r\n definitions = setup.definitions\r\n const serverConfig = setup.serverConfig\r\n const clientConfig = setup.clientConfig\r\n const views = await setup.server.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'))\r\n server = new TestRecovery(views, serverConfig)\r\n client = new TestRecovery(views, clientConfig)\r\n await server.populate()\r\n await client.populate()\r\n}, 45000)\r\n\r\ntest('expect 15 messages in log', () => {\r\n expect(server.views.length).toEqual(15)\r\n expect(client.views.length).toEqual(15)\r\n})\r\n\r\n/*\r\nclient: (all client messages)\r\n8=FIX4.4|9=000124|35=AD|49=init-tls-comp|56=accept-tls-comp|34=2|57=fix|52=20210307-16:16:44.388|568=all-trades|569=0|263=1|580=1|75=20210307|10=187|\r\n8=FIX4.4|9=000112|35=0|49=init-tls-comp|56=accept-tls-comp|34=3|57=fix|52=20210307-16:17:14.431|112=Sun, 07 Mar 2021 16:17:14 GMT|10=220|\r\n8=FIX4.4|9=000109|35=5|49=init-tls-comp|56=accept-tls-comp|34=4|57=fix|52=20210307-16:17:16.397|58=test_client initiate logout|10=191|\r\n */\r\n\r\n/*\r\nserver: (application only)\r\n\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=2|57=fix|52=20210307-16:16:44.429|568=all-trades|569=0|749=0|750=0|10=142|\r\n8=FIX4.4|9=000209|35=AE|49=accept-tls-comp|56=init-tls-comp|34=3|57=fix|52=20210307-16:16:44.430|571=100000|487=0|856=0|828=0|17=600000|39=2|570=N|55=Platinum|48=Platinum.INC|32=172|31=7.36|75=20210307|60=20210307-16:16:44.430|10=043|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=4|57=fix|52=20210307-16:16:44.431|571=100001|487=0|856=0|828=0|17=600001|39=2|570=N|55=Gold|48=Gold.INC|32=175|31=83.67|75=20210307|60=20210307-16:16:44.430|10=219|\r\n8=FIX4.4|9=000210|35=AE|49=accept-tls-comp|56=init-tls-comp|34=5|57=fix|52=20210307-16:16:44.432|571=100002|487=0|856=0|828=0|17=600002|39=2|570=N|55=Platinum|48=Platinum.INC|32=146|31=41.79|75=20210307|60=20210307-16:16:44.430|10=097|\r\n8=FIX4.4|9=000211|35=AE|49=accept-tls-comp|56=init-tls-comp|34=6|57=fix|52=20210307-16:16:44.432|571=100003|487=0|856=0|828=0|17=600003|39=2|570=N|55=Magnesium|48=Magnesium.INC|32=156|31=8.02|75=20210307|60=20210307-16:16:44.430|10=227|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=7|57=fix|52=20210307-16:16:44.432|571=100004|487=0|856=0|828=0|17=600004|39=2|570=N|55=Gold|48=Gold.INC|32=136|31=32.13|75=20210307|60=20210307-16:16:44.430|10=211|\r\n8=FIX4.4|9=000112|35=AQ|49=accept-tls-comp|56=init-tls-comp|34=8|57=fix|52=20210307-16:16:44.433|568=all-trades|569=0|749=0|750=1|10=144|\r\n8=FIX4.4|9=000202|35=AE|49=accept-tls-comp|56=init-tls-comp|34=9|57=fix|52=20210307-16:16:59.449|571=100005|487=0|856=0|828=0|17=600005|39=2|570=N|55=Gold|48=Gold.INC|32=166|31=53.91|75=20210307|60=20210307-16:16:59.449|10=001|\r\n8=FIX4.4|9=000206|35=AE|49=accept-tls-comp|56=init-tls-comp|34=10|57=fix|52=20210307-16:17:14.477|571=100006|487=0|856=0|828=0|17=600006|39=2|570=N|55=Silver|48=Silver.INC|32=105|31=61.2|75=20210307|60=20210307-16:17:14.477|10=191|\r\n */\r\n\r\ntest('server store states',async () => {\r\n const s1 = await server.recovery.store.getState()\r\n expect(s1.length).toEqual(9)\r\n})\r\n\r\ntest('client store states',async () => {\r\n const s1 = await client.recovery.store.getState()\r\n expect(s1.length).toEqual(1)\r\n})\r\n\r\ntest('server replay request from seq=1 to seq=10', async () => {\r\n const vec = await server.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(10)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n for (let i = 2; i <= 6; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n\r\n expect(vec[7].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[7].seqNum).toEqual(8)\r\n\r\n for (let i = 8; i < 10; ++i) {\r\n expect(vec[i].msgType).toEqual(MsgType.TradeCaptureReport)\r\n expect(vec[i].seqNum).toEqual(i + 1)\r\n }\r\n})\r\n\r\ntest('client replay request from seq=1 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(1, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(3)\r\n\r\n checkSeqReset(vec[0], 1, 2)\r\n\r\n expect(vec[1].msgType).toEqual(MsgType.TradeCaptureReportRequest)\r\n expect(vec[1].seqNum).toEqual(2)\r\n\r\n checkSeqReset(vec[2], 3, 11)\r\n})\r\n\r\nfunction checkSeqReset (rec: IFixMsgStoreRecord, from: number, to: number) {\r\n const reset: ISequenceReset = rec.obj as ISequenceReset\r\n expect(rec.msgType).toEqual(MsgType.SequenceReset)\r\n expect(rec.obj).toBeTruthy()\r\n expect(rec.seqNum).toEqual(to)\r\n expect(reset.GapFillFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgType).toEqual(MsgType.SequenceReset)\r\n expect(reset.StandardHeader.PossDupFlag).toBeTruthy()\r\n expect(reset.StandardHeader.MsgSeqNum).toEqual(from)\r\n}\r\n\r\n// expect to gap fill entire request - and move expected seqNo to 11\r\n// which will be the next message sent\r\ntest('client replay request from seq=4 to seq=10', async () => {\r\n const vec = await client.recovery.getResendRequest(4, 10)\r\n expect(vec).toBeTruthy()\r\n expect(Array.isArray(vec))\r\n expect(vec.length).toEqual(1)\r\n checkSeqReset(vec[0], 4, 11)\r\n})\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -9,11 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
require("reflect-metadata");
|
|
12
13
|
const path = require("path");
|
|
13
14
|
const buffer_1 = require("../buffer");
|
|
14
|
-
const
|
|
15
|
-
const config_1 = require("../config");
|
|
16
|
-
const util_1 = require("../util");
|
|
15
|
+
const setup_1 = require("./env/setup");
|
|
17
16
|
const root = path.join(__dirname, '../../data');
|
|
18
17
|
let definitions;
|
|
19
18
|
let session;
|
|
@@ -57,12 +56,13 @@ const unsortedLogon = [
|
|
|
57
56
|
new buffer_1.TagPos(19, 553, 188, 3),
|
|
58
57
|
new buffer_1.TagPos(20, 554, 196, 11)
|
|
59
58
|
];
|
|
59
|
+
let setup = null;
|
|
60
60
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
session =
|
|
65
|
-
views = yield
|
|
61
|
+
setup = new setup_1.Setup('session/test-initiator.json');
|
|
62
|
+
yield setup.init();
|
|
63
|
+
definitions = setup.clientConfig.definitions;
|
|
64
|
+
session = setup.client.transmitter;
|
|
65
|
+
views = yield setup.client.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'));
|
|
66
66
|
if (views && views.length > 0) {
|
|
67
67
|
structure = views[0].structure;
|
|
68
68
|
tp = views[0].structure.tags.tagPos.slice(0, views[0].segment.endPosition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-tag-pos.test.js","sourceRoot":"","sources":["../../src/test/ascii-tag-pos.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC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AC,CAAA;AACrD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,CAAA;IACpD,MAAM,CAAC,eAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC7D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,CAAA;IACpD,MAAM,CAAC,eAAM,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,CAAA;IAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { MsgView, TagPos, Structure } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\nimport { AsciiMsgTransmitter } from '../transport/ascii/ascii-msg-transmitter'\r\nimport { Setup } from './env/setup'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet views: MsgView[]\r\nlet structure: Structure\r\nlet tp: TagPos[]\r\n\r\nconst testTags: TagPos[] = [\r\n new TagPos(0, 120, 0, 1), // 3\r\n new TagPos(1, 50, 1, 1), // 0\r\n new TagPos(2, 50, 2, 1), // 1\r\n new TagPos(3, 120, 3, 1), // 4\r\n new TagPos(4, 100, 4, 1) // 2\r\n]\r\n\r\nconst expected: TagPos[] = [\r\n new TagPos(1, 50, 1, 1), // 0\r\n new TagPos(2, 50, 2, 1), // 1\r\n new TagPos(4, 100, 4, 1), // 2\r\n new TagPos(0, 120, 0, 1), // 3\r\n new TagPos(3, 120, 3, 1) // 4\r\n]\r\n\r\nconst unsortedLogon = [\r\n new TagPos(0, 8, 2, 6),\r\n new TagPos(1, 9, 11, 7),\r\n new TagPos(2, 35, 22, 1),\r\n new TagPos(3, 49, 27, 9),\r\n new TagPos(4, 56, 40, 9),\r\n new TagPos(5, 34, 53, 1),\r\n new TagPos(6, 57, 58, 5),\r\n new TagPos(7, 52, 67, 21),\r\n new TagPos(8, 98, 92, 1),\r\n new TagPos(9, 108, 98, 5),\r\n new TagPos(10, 95, 107, 2),\r\n new TagPos(11, 96, 113, 20),\r\n new TagPos(12, 141, 138, 1),\r\n new TagPos(13, 789, 144, 4),\r\n new TagPos(14, 383, 153, 2),\r\n new TagPos(15, 384, 160, 1),\r\n new TagPos(16, 372, 166, 5),\r\n new TagPos(17, 385, 176, 1),\r\n new TagPos(18, 464, 182, 1),\r\n new TagPos(19, 553, 188, 3),\r\n new TagPos(20, 554, 196, 11)\r\n]\r\n\r\nlet setup: Setup = null\r\nbeforeAll(async () => {\r\n setup = new Setup('session/test-initiator.json')\r\n await setup.init()\r\n definitions = setup.clientConfig.definitions\r\n session = setup.client.transmitter as AsciiMsgTransmitter\r\n views = await setup.client.replayer.replayFixFile(path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'))\r\n if (views && views.length > 0) {\r\n structure = views[0].structure\r\n tp = views[0].structure.tags.tagPos.slice(0, views[0].segment.endPosition)\r\n }\r\n}, 45000)\r\n\r\ntest('logon tags parsed fully', () => {\r\n expect(tp).toEqual(unsortedLogon)\r\n})\r\n\r\ntest('expect tags to sort in tag first order', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n const sortedTags = sorted.map(e => e.tag)\r\n expect(sortedTags).toEqual([50, 50, 100, 120, 120])\r\n})\r\n\r\ntest('expect tags to sort in tag then start order', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(sorted[0].tag).toEqual(sorted[1].tag)\r\n expect(sorted[0].start < sorted[1].start).toEqual(true)\r\n})\r\n\r\ntest('expect start to carry with its tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(sorted).toEqual(expected)\r\n})\r\n\r\ntest('binary search on sorted', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 100)).toEqual(2)\r\n})\r\n\r\ntest('binary search for non existing tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 1000) < 0).toEqual(true)\r\n})\r\n\r\ntest('binary search duplicate tag', () => {\r\n const sorted = testTags.slice().sort(TagPos.compare)\r\n expect(TagPos.binarySearch(sorted, 50) <= 1).toEqual(true)\r\n})\r\n\r\ntest('check logon', () => {\r\n const sorted = tp.slice().sort(TagPos.compare)\r\n expect(sorted[0].tag).toEqual(8)\r\n expect(sorted[sorted.length - 1].tag).toEqual(789)\r\n})\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
3
4
|
const buffer_1 = require("../buffer");
|
|
5
|
+
const ascii_1 = require("../buffer/ascii");
|
|
4
6
|
test('1 char in buffer length 1', () => {
|
|
5
7
|
const buffer = new buffer_1.ElasticBuffer(1);
|
|
6
|
-
buffer.writeChar(
|
|
8
|
+
buffer.writeChar(ascii_1.AsciiChars.Dot);
|
|
7
9
|
expect(buffer.getPos()).toEqual(1);
|
|
8
10
|
expect(buffer.toString()).toEqual('.');
|
|
9
11
|
expect(buffer.currentSize()).toEqual(1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elastic-buffer.test.js","sourceRoot":"","sources":["../../src/test/elastic-buffer.test.ts"],"names":[],"mappings":";;AAAA,sCAAqD;AAErD,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,SAAS,CAAC,mBAAU,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACtC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACzC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;IAClB,MAAM,CAAC,GAAW,eAAe,CAAA;IACjC,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IACrB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACpC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAA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AAC,CAAA;AACrD,CAAC,CAAC,CAAA","sourcesContent":["import { ElasticBuffer, AsciiChars } from '../buffer'\r\n\r\ntest('1 char in buffer length 1', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeChar(AsciiChars.Dot)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('.')\r\n expect(buffer.currentSize()).toEqual(1)\r\n})\r\n\r\ntest('string', () => {\r\n const s: string = 'fixing up fix'\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(16)\r\n})\r\n\r\ntest('whole number', () => {\r\n const n: number = 12345\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize() === 10)\r\n})\r\n\r\ntest('-ve number', () => {\r\n const n: number = -2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('+ve number with explicit sign', () => {\r\n const n: number = 2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n}`)\r\n const asString = buffer.toString()\r\n expect(asString).toEqual('+2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n})\r\n\r\ntest('floating point', () => {\r\n const n: number = 12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('floating point 1 dp', () => {\r\n const n: number = 12345678.9\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345678.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('-ve floating point', () => {\r\n const n: number = -12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(buffer.toString()).toEqual('-12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('floating point many dp', () => {\r\n const n: number = 0.123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('simple floating point 3.90', () => {\r\n const n: number = 3.90\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('3.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 35.77', () => {\r\n const n: number = 35.77\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('35.77')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 0.058457', () => {\r\n const n: number = 0.058457\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.058457')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point -0.06445', () => {\r\n const n: number = -0.06445\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.06445')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('whole number as floating point', () => {\r\n const n: number = 123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString.toString()).toEqual('123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('tiny floating point', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(14)\r\n expect(asString).toEqual('0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny -ve floating point', () => {\r\n const n: number = -0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny +ve floating point with sign', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n.toFixed(12)}`)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('+0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('boolean true', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(true)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('Y')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(true)\r\n})\r\n\r\ntest('boolean false', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(false)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('N')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(false)\r\n})\r\n\r\ntest('write buffer', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s: string = 'fixing up fix'\r\n const b = Buffer.from(s)\r\n buffer.writeBuffer(b)\r\n expect(buffer.getPos()).toEqual(b.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize() === 16)\r\n const fetched: Buffer = buffer.getBuffer(0, b.length)\r\n expect(fetched).toEqual(b)\r\n})\r\n\r\ntest('buffer shrinks', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s = '.'.repeat(60 * 1024)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(65536)\r\n expect(buffer.reset()).toBe(true)\r\n expect(buffer.getPos()).toEqual(0)\r\n expect(buffer.currentSize() < 60 * 1024).toBe(true)\r\n})\r\n"]}
|
|
1
|
+
{"version":3,"file":"elastic-buffer.test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AM,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;IACnC,MAAM,OAAO,GAAW,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IACrD,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC5B,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,IAAI,sBAAa,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IAC/B,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IACrB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACpC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { ElasticBuffer } from '../buffer'\r\nimport { AsciiChars } from '../buffer/ascii'\r\n\r\ntest('1 char in buffer length 1', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeChar(AsciiChars.Dot)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('.')\r\n expect(buffer.currentSize()).toEqual(1)\r\n})\r\n\r\ntest('string', () => {\r\n const s: string = 'fixing up fix'\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(16)\r\n})\r\n\r\ntest('whole number', () => {\r\n const n: number = 12345\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize() === 10)\r\n})\r\n\r\ntest('-ve number', () => {\r\n const n: number = -2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeWholeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('+ve number with explicit sign', () => {\r\n const n: number = 2468\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n}`)\r\n const asString = buffer.toString()\r\n expect(asString).toEqual('+2468')\r\n expect(buffer.getWholeNumber(0, asString.length - 1)).toEqual(n)\r\n})\r\n\r\ntest('floating point', () => {\r\n const n: number = 12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('floating point 1 dp', () => {\r\n const n: number = 12345678.9\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('12345678.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('-ve floating point', () => {\r\n const n: number = -12345.6789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(buffer.toString()).toEqual('-12345.6789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('floating point many dp', () => {\r\n const n: number = 0.123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('simple floating point 3.90', () => {\r\n const n: number = 3.90\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('3.9')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 35.77', () => {\r\n const n: number = 35.77\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('35.77')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point 0.058457', () => {\r\n const n: number = 0.058457\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('0.058457')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('simple floating point -0.06445', () => {\r\n const n: number = -0.06445\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.06445')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('whole number as floating point', () => {\r\n const n: number = 123456789\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString.toString()).toEqual('123456789')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(10)\r\n})\r\n\r\ntest('tiny floating point', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(14)\r\n expect(asString).toEqual('0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny -ve floating point', () => {\r\n const n: number = -0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeNumber(n)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('-0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('tiny +ve floating point with sign', () => {\r\n const n: number = 0.000000000001\r\n const buffer = new ElasticBuffer(10)\r\n buffer.writeString(`+${n.toFixed(12)}`)\r\n const asString = buffer.toString()\r\n expect(buffer.getPos()).toEqual(asString.length)\r\n expect(asString).toEqual('+0.000000000001')\r\n expect(buffer.getFloat(0, asString.length - 1)).toEqual(n)\r\n expect(buffer.currentSize()).toEqual(20)\r\n})\r\n\r\ntest('boolean true', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(true)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('Y')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(true)\r\n})\r\n\r\ntest('boolean false', () => {\r\n const buffer = new ElasticBuffer(1)\r\n buffer.writeBoolean(false)\r\n expect(buffer.getPos()).toEqual(1)\r\n expect(buffer.toString()).toEqual('N')\r\n expect(buffer.currentSize()).toEqual(1)\r\n expect(buffer.getBoolean(0)).toBe(false)\r\n})\r\n\r\ntest('write buffer', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s: string = 'fixing up fix'\r\n const b = Buffer.from(s)\r\n buffer.writeBuffer(b)\r\n expect(buffer.getPos()).toEqual(b.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize() === 16)\r\n const fetched: Buffer = buffer.getBuffer(0, b.length)\r\n expect(fetched).toEqual(b)\r\n})\r\n\r\ntest('buffer shrinks', () => {\r\n const buffer = new ElasticBuffer(1)\r\n const s = '.'.repeat(60 * 1024)\r\n buffer.writeString(s)\r\n expect(buffer.getPos()).toEqual(s.length)\r\n expect(buffer.toString()).toEqual(s)\r\n expect(buffer.currentSize()).toEqual(65536)\r\n expect(buffer.reset()).toBe(true)\r\n expect(buffer.getPos()).toEqual(0)\r\n expect(buffer.currentSize() < 60 * 1024).toBe(true)\r\n})\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -9,20 +9,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
12
|
+
require("reflect-metadata");
|
|
13
13
|
const buffer_1 = require("../buffer");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const util_1 = require("../util");
|
|
17
|
-
const root = path.join(__dirname, '../../data');
|
|
14
|
+
const ascii_msg_transmitter_1 = require("../transport/ascii/ascii-msg-transmitter");
|
|
15
|
+
const setup_1 = require("./env/setup");
|
|
18
16
|
let definitions;
|
|
19
17
|
let session;
|
|
20
18
|
let proxyFactory;
|
|
19
|
+
let setup = null;
|
|
21
20
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
setup = new setup_1.Setup('session/qf-fix44.json', 'session/qf-fix44.json');
|
|
22
|
+
yield setup.init();
|
|
23
|
+
definitions = setup.definitions;
|
|
24
|
+
const config = setup.clientConfig;
|
|
25
|
+
session = new ascii_msg_transmitter_1.AsciiMsgTransmitter(config);
|
|
26
26
|
proxyFactory = new buffer_1.EncodeProxy(definitions);
|
|
27
27
|
}), 45000);
|
|
28
28
|
test('check wrapper will reject unknown field', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode-proxy.test.js","sourceRoot":"","sources":["../../src/test/encode-proxy.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAAmD;AAGnD,4CAAuE;AACvE,sCAAuC;AACvC,kCAAwC;AACxC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,YAAyB,CAAA;AAE7B,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,kBAAkB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAA;IACjG,WAAW,GAAG,MAAM,qBAAc,CAAC,kBAAkB,CAAC,WAAW,CAA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B,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,QAAQ;wBACtB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,SAAS;wBACvB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,CAAC;qBACpB;iBACF;aACF;SACF;KACF,CAAA;AACH,CAAC","sourcesContent":["import * as path from 'path'\r\nimport { EncodeProxy, AsciiChars } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { ISessionDescription, AsciiMsgTransmitter } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { getDefinitions } from '../util'\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet proxyFactory: EncodeProxy\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/qf-fix44.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n proxyFactory = new EncodeProxy(definitions)\r\n}, 45000)\r\n\r\ntest('check wrapper will reject unknown field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Unknown = 999\r\n }\r\n expect(run).toThrow(/no field named Unknown/)\r\n})\r\n\r\ntest('check wrapper will accept known field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.OrderID = 'ipsum'\r\n }\r\n run()\r\n expect(proxy.OrderID).toEqual('ipsum')\r\n})\r\n\r\ntest('check wrapper rejects unknown enum value', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '23'\r\n }\r\n expect(run).toThrow(/enum field SettlType does not support \"23\"/)\r\n})\r\n\r\ntest('check wrapper will accept known enum field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '1'\r\n }\r\n run()\r\n expect(proxy.SettlType).toEqual('1')\r\n})\r\n\r\ntest('check wrapper rejects Date field when not given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = \"I'm not a good date\"\r\n }\r\n expect(run).toThrow(/expects Date but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Date field when given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = new Date()\r\n }\r\n run()\r\n expect(proxy.SettlDate).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects boolean field when not given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = \"I'm not a good boolean\"\r\n }\r\n expect(run).toThrow(/expects boolean but receives/)\r\n})\r\n\r\ntest('check wrapper will accept boolean field when given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = true\r\n }\r\n run()\r\n expect(proxy.LastRptRequested).toEqual(true)\r\n})\r\n\r\ntest('check wrapper rejects Buffer field when not given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = \"I'm not a Buffer, don't accept me!\"\r\n }\r\n expect(run).toThrow(/expects Buffer but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Buffer field when given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = new Buffer('I am a buffer.', 'utf8')\r\n }\r\n run()\r\n expect(proxy.EncodedText).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects string field when not given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = 123\r\n }\r\n expect(run).toThrow(/expects string but receives/)\r\n})\r\n\r\ntest('check wrapper will accept string field when given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = \"I'm a great string\"\r\n }\r\n run()\r\n expect(proxy.ClOrdID).toEqual(\"I'm a great string\")\r\n})\r\n\r\ntest('check wrapper rejects number field when not given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = \"I'm no number\"\r\n }\r\n expect(run).toThrow(/expects number but receives/)\r\n})\r\n\r\ntest('check wrapper will accept number field when given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = 12234\r\n }\r\n run()\r\n expect(proxy.GrossTradeAmt).toEqual(12234)\r\n})\r\n\r\ntest('check wrapper rejects non object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = 'I should be an object, but I am sadly not'\r\n }\r\n expect(run).toThrow(/is a component but/)\r\n})\r\n\r\ntest('check wrapper accepts object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when assigned component wraps so it can be checked.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.YieldData.GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n proxy.YieldData.YieldCalcDate = new Date()\r\n // accept this\r\n expect(proxy.YieldData).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when given populated component.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n ClOrdID: \"I don't belong here.\"\r\n }\r\n }\r\n // reject this\r\n expect(run).toThrow(/no field named ClOrdID/)\r\n})\r\n\r\ntest('check wrapper accepts number for group field and wraps n elements', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: 2\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n expect(Array.isArray(proxy.Parties.NoPartyIDs)).toEqual(true)\r\n expect(proxy.Parties.NoPartyIDs.length).toEqual(2)\r\n // now assign a field, this should also be wrapped\r\n proxy.Parties.NoPartyIDs[0].PartyID = 'hello'\r\n expect(proxy.Parties.NoPartyIDs[0].PartyID).toBeTruthy()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\ntest('check wrapper accepts array of objects in group component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: getParties()\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return [\r\n {\r\n 'PartyID': 'magna.',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'et',\r\n 'PartySubIDType': 22\r\n },\r\n {\r\n 'PartySubID': 'leo,',\r\n 'PartySubIDType': 10\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'iaculis',\r\n 'PartyIDSource': 'F',\r\n 'PartyRole': 2,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'Nullam',\r\n 'PartySubIDType': 12\r\n },\r\n {\r\n 'PartySubID': 'lectus,',\r\n 'PartySubIDType': 13\r\n },\r\n {\r\n 'PartySubID': 'eget',\r\n 'PartySubIDType': 18\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'vitae,',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 5,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'ac',\r\n 'PartySubIDType': 6\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"encode-proxy.test.js","sourceRoot":"","sources":["../../src/test/encode-prox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AAS,UAAU;IACjB,OAAO;QACL;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,EAAE;YACf,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,QAAQ;wBACtB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,SAAS;wBACvB,gBAAgB,EAAE,EAAE;qBACrB;oBACD;wBACE,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,EAAE;qBACrB;iBACF;aACF;SACF;QACD;YACE,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,GAAG;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE;gBACZ,eAAe,EAAE;oBACf;wBACE,YAAY,EAAE,IAAI;wBAClB,gBAAgB,EAAE,CAAC;qBACpB;iBACF;aACF;SACF;KACF,CAAA;AACH,CAAC","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport { EncodeProxy } from '../buffer'\r\nimport { FixDefinitions } from '../dictionary/definition'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { AsciiMsgTransmitter } from '../transport/ascii/ascii-msg-transmitter'\r\nimport { Setup } from './env/setup'\r\n\r\nlet definitions: FixDefinitions\r\nlet session: AsciiMsgTransmitter\r\nlet proxyFactory: EncodeProxy\r\nlet setup: Setup = null\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup('session/qf-fix44.json', 'session/qf-fix44.json')\r\n await setup.init()\r\n definitions = setup.definitions\r\n const config = setup.clientConfig\r\n session = new AsciiMsgTransmitter(config)\r\n proxyFactory = new EncodeProxy(definitions)\r\n}, 45000)\r\n\r\ntest('check wrapper will reject unknown field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Unknown = 999\r\n }\r\n expect(run).toThrow(/no field named Unknown/)\r\n})\r\n\r\ntest('check wrapper will accept known field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.OrderID = 'ipsum'\r\n }\r\n run()\r\n expect(proxy.OrderID).toEqual('ipsum')\r\n})\r\n\r\ntest('check wrapper rejects unknown enum value', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '23'\r\n }\r\n expect(run).toThrow(/enum field SettlType does not support \"23\"/)\r\n})\r\n\r\ntest('check wrapper will accept known enum field', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlType = '1'\r\n }\r\n run()\r\n expect(proxy.SettlType).toEqual('1')\r\n})\r\n\r\ntest('check wrapper rejects Date field when not given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = \"I'm not a good date\"\r\n }\r\n expect(run).toThrow(/expects Date but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Date field when given Date', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.SettlDate = new Date()\r\n }\r\n run()\r\n expect(proxy.SettlDate).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects boolean field when not given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = \"I'm not a good boolean\"\r\n }\r\n expect(run).toThrow(/expects boolean but receives/)\r\n})\r\n\r\ntest('check wrapper will accept boolean field when given boolean', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.LastRptRequested = true\r\n }\r\n run()\r\n expect(proxy.LastRptRequested).toEqual(true)\r\n})\r\n\r\ntest('check wrapper rejects Buffer field when not given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = \"I'm not a Buffer, don't accept me!\"\r\n }\r\n expect(run).toThrow(/expects Buffer but receives/)\r\n})\r\n\r\ntest('check wrapper will accept Buffer field when given Buffer', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.EncodedText = new Buffer('I am a buffer.', 'utf8')\r\n }\r\n run()\r\n expect(proxy.EncodedText).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper rejects string field when not given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = 123\r\n }\r\n expect(run).toThrow(/expects string but receives/)\r\n})\r\n\r\ntest('check wrapper will accept string field when given string', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.ClOrdID = \"I'm a great string\"\r\n }\r\n run()\r\n expect(proxy.ClOrdID).toEqual(\"I'm a great string\")\r\n})\r\n\r\ntest('check wrapper rejects number field when not given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = \"I'm no number\"\r\n }\r\n expect(run).toThrow(/expects number but receives/)\r\n})\r\n\r\ntest('check wrapper will accept number field when given number', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.GrossTradeAmt = 12234\r\n }\r\n run()\r\n expect(proxy.GrossTradeAmt).toEqual(12234)\r\n})\r\n\r\ntest('check wrapper rejects non object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = 'I should be an object, but I am sadly not'\r\n }\r\n expect(run).toThrow(/is a component but/)\r\n})\r\n\r\ntest('check wrapper accepts object field when assigning component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when assigned component wraps so it can be checked.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.YieldData.GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n proxy.YieldData.YieldCalcDate = new Date()\r\n // accept this\r\n expect(proxy.YieldData).toBeTruthy()\r\n})\r\n\r\ntest('check wrapper when given populated component.', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.YieldData = {\r\n ClOrdID: \"I don't belong here.\"\r\n }\r\n }\r\n // reject this\r\n expect(run).toThrow(/no field named ClOrdID/)\r\n})\r\n\r\ntest('check wrapper accepts number for group field and wraps n elements', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: 2\r\n }\r\n }\r\n run()\r\n expect(proxy.Parties).toBeTruthy()\r\n expect(Array.isArray(proxy.Parties.NoPartyIDs)).toEqual(true)\r\n expect(proxy.Parties.NoPartyIDs.length).toEqual(2)\r\n // now assign a field, this should also be wrapped\r\n proxy.Parties.NoPartyIDs[0].PartyID = 'hello'\r\n expect(proxy.Parties.NoPartyIDs[0].PartyID).toBeTruthy()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\ntest('check wrapper accepts array of objects in group component', () => {\r\n const proxy: ILooseObject = proxyFactory.wrap('ExecutionReport')\r\n expect(proxy).toBeTruthy()\r\n function run (): void {\r\n proxy.Parties = {\r\n NoPartyIDs: getParties()\r\n }\r\n }\r\n run()\r\n function run2 (): void {\r\n proxy.Parties.NoPartyIDs[0].GrossTradeAmt = 999\r\n }\r\n // reject this\r\n expect(run2).toThrow(/no field named GrossTradeAmt/)\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return [\r\n {\r\n 'PartyID': 'magna.',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 28,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'et',\r\n 'PartySubIDType': 22\r\n },\r\n {\r\n 'PartySubID': 'leo,',\r\n 'PartySubIDType': 10\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'iaculis',\r\n 'PartyIDSource': 'F',\r\n 'PartyRole': 2,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'Nullam',\r\n 'PartySubIDType': 12\r\n },\r\n {\r\n 'PartySubID': 'lectus,',\r\n 'PartySubIDType': 13\r\n },\r\n {\r\n 'PartySubID': 'eget',\r\n 'PartySubIDType': 18\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n 'PartyID': 'vitae,',\r\n 'PartyIDSource': '9',\r\n 'PartyRole': 5,\r\n 'PtysSubGrp': {\r\n 'NoPartySubIDs': [\r\n {\r\n 'PartySubID': 'ac',\r\n 'PartySubIDType': 6\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}\r\n"]}
|