jspurefix 1.3.0 → 1.4.1
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/README.md +5 -2
- package/data/session/genkey.ps1 +179 -0
- package/dist/buffer/ascii/ascii-encoder.d.ts +1 -1
- package/dist/buffer/ascii/ascii-encoder.js +42 -30
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +2 -2
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/ascii/time-formatter.js.map +1 -1
- package/dist/buffer/elastic-buffer.js +1 -1
- package/dist/buffer/elastic-buffer.js.map +1 -1
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.js +1 -1
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.d.ts +2 -0
- package/dist/buffer/fixml/fixml-view.js +3 -0
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +2 -0
- package/dist/buffer/msg-view.js +2 -2
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/dict-parser.js +9 -9
- package/dist/dict-parser.js.map +1 -1
- package/dist/dictionary/compiler/msg-compiler.js +2 -2
- package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js +1 -1
- package/dist/dictionary/parser/fix-repository/repository-xml-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/jsfix-cmd.js +3 -3
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/sample/http/oms/app.js +2 -2
- package/dist/sample/http/oms/app.js.map +1 -1
- package/dist/sample/launcher.js +2 -2
- package/dist/sample/launcher.js.map +1 -1
- package/dist/sample/tcp/qf-md/app.js +2 -2
- package/dist/sample/tcp/qf-md/app.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-2.d.ts +2 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js +3 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-2.js.map +1 -0
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +1 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
- package/dist/sample/tcp/skeleton/app.js +2 -2
- package/dist/sample/tcp/skeleton/app.js.map +1 -1
- package/dist/sample/tcp/skeleton/skeleton-session.d.ts +5 -1
- package/dist/sample/tcp/skeleton/skeleton-session.js +21 -2
- package/dist/sample/tcp/skeleton/skeleton-session.js.map +1 -1
- package/dist/sample/tcp/tls-trade-capture/app.js +2 -2
- package/dist/sample/tcp/tls-trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/app.js +2 -2
- package/dist/sample/tcp/trade-capture/app.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-client.d.ts +1 -0
- package/dist/sample/tcp/trade-capture/trade-capture-client.js +7 -3
- package/dist/sample/tcp/trade-capture/trade-capture-client.js.map +1 -1
- package/dist/store/fix-msg-ascii-store-recovery.d.ts +12 -0
- package/dist/store/fix-msg-ascii-store-recovery.js +60 -0
- package/dist/store/fix-msg-ascii-store-recovery.js.map +1 -0
- package/dist/store/fix-msg-ascii-store-replay.d.ts +13 -0
- package/dist/store/fix-msg-ascii-store-replay.js +60 -0
- package/dist/store/fix-msg-ascii-store-replay.js.map +1 -0
- package/dist/store/fix-msg-ascii-store-resend.js +3 -2
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/store/fix-replay-record.d.ts +12 -0
- package/dist/store/fix-replay-record.js +12 -0
- package/dist/store/fix-replay-record.js.map +1 -0
- package/dist/store/fix-resend-record.d.ts +12 -0
- package/dist/store/fix-resend-record.js +12 -0
- package/dist/store/fix-resend-record.js.map +1 -0
- package/dist/store/replay-record.d.ts +6 -0
- package/dist/store/replay-record.js +3 -0
- package/dist/store/replay-record.js.map +1 -0
- package/dist/store/store-replay-record.d.ts +12 -0
- package/dist/store/store-replay-record.js +12 -0
- package/dist/store/store-replay-record.js.map +1 -0
- package/dist/tcp/tls-options.d.ts +5 -0
- package/dist/tcp/tls-options.js +45 -0
- package/dist/tcp/tls-options.js.map +1 -0
- package/dist/test/ascii-encode.test.d.ts +1 -0
- package/dist/test/ascii-encode.test.js +416 -0
- package/dist/test/ascii-encode.test.js.map +1 -0
- package/dist/test/ascii-encoder.test.js +2 -2
- package/dist/test/ascii-encoder.test.js.map +1 -1
- package/dist/test/ascii-parser.test.js +9 -7
- package/dist/test/ascii-parser.test.js.map +1 -1
- package/dist/test/ascii-segment.test.js +7 -6
- package/dist/test/ascii-segment.test.js.map +1 -1
- package/dist/test/ascii-store-recovery.test.d.ts +1 -0
- package/dist/test/ascii-store-recovery.test.js +50 -0
- package/dist/test/ascii-store-recovery.test.js.map +1 -0
- package/dist/test/ascii-store-replay.test.js +2 -2
- package/dist/test/ascii-store-replay.test.js.map +1 -1
- package/dist/test/ascii-tag-pos.test.js +2 -2
- package/dist/test/ascii-tag-pos.test.js.map +1 -1
- package/dist/test/encode-proxy.test.js +1 -1
- package/dist/test/encode-proxy.test.js.map +1 -1
- package/dist/test/execution-report.test.js +2 -2
- package/dist/test/execution-report.test.js.map +1 -1
- package/dist/test/fix-log-replay.test.js +2 -2
- package/dist/test/fix-log-replay.test.js.map +1 -1
- package/dist/test/fix-repo-dict.test.js +1 -1
- package/dist/test/fix-repo-dict.test.js.map +1 -1
- package/dist/test/logon.test.js +2 -2
- package/dist/test/logon.test.js.map +1 -1
- package/dist/test/memory-store.test.js +2 -2
- package/dist/test/memory-store.test.js.map +1 -1
- package/dist/test/qf-full-msg.test.js +14 -13
- package/dist/test/qf-full-msg.test.js.map +1 -1
- package/dist/test/repo-full-ascii-msg.test.js +10 -9
- package/dist/test/repo-full-ascii-msg.test.js.map +1 -1
- package/dist/test/repo-full-fixml-msg.test.js +15 -15
- package/dist/test/repo-full-fixml-msg.test.js.map +1 -1
- package/dist/test/session.test.js +262 -143
- package/dist/test/session.test.js.map +1 -1
- package/dist/test/to-views.js +1 -1
- package/dist/test/to-views.js.map +1 -1
- package/dist/test/view-decode.test.js +2 -2
- package/dist/test/view-decode.test.js.map +1 -1
- package/dist/transport/ascii/ascii-msg-transmitter.js +6 -3
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session.d.ts +8 -0
- package/dist/transport/ascii/ascii-session.js +67 -19
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/duplex/http-duplex.js +2 -2
- package/dist/transport/duplex/http-duplex.js.map +1 -1
- package/dist/transport/fix-session-state.js +4 -1
- package/dist/transport/fix-session-state.js.map +1 -1
- package/dist/transport/fix-session.d.ts +6 -0
- package/dist/transport/fix-session.js +91 -38
- package/dist/transport/fix-session.js.map +1 -1
- package/dist/transport/http/http-acceptor.js +8 -7
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/make-config.js +1 -1
- package/dist/transport/make-config.js.map +1 -1
- package/dist/transport/session-msg-factory.d.ts +24 -2
- package/dist/transport/session-msg-factory.js +143 -3
- package/dist/transport/session-msg-factory.js.map +1 -1
- package/dist/transport/tcp/recovering-initiator.d.ts +17 -0
- package/dist/transport/tcp/recovering-initiator.js +30 -0
- package/dist/transport/tcp/recovering-initiator.js.map +1 -0
- package/dist/transport/tcp/recovering_initiator.d.ts +12 -0
- package/dist/transport/tcp/recovering_initiator.js +25 -0
- package/dist/transport/tcp/recovering_initiator.js.map +1 -0
- package/dist/transport/tcp/resilient-initiator.d.ts +12 -0
- package/dist/transport/tcp/resilient-initiator.js +41 -0
- package/dist/transport/tcp/resilient-initiator.js.map +1 -0
- package/dist/transport/tcp/tcp-acceptor.d.ts +7 -0
- package/dist/transport/tcp/tcp-acceptor.js +57 -38
- package/dist/transport/tcp/tcp-acceptor.js.map +1 -1
- package/dist/transport/tcp/tcp-initiator.d.ts +2 -0
- package/dist/transport/tcp/tcp-initiator.js +59 -32
- package/dist/transport/tcp/tcp-initiator.js.map +1 -1
- package/dist/types/FIX4.4/quickfix/set/header.d.ts +31 -0
- package/dist/types/FIX4.4/quickfix/set/header.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/header.js.map +1 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.d.ts +6 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.js +3 -0
- package/dist/types/FIX4.4/quickfix/set/trailer.js.map +1 -0
- package/dist/util/buffer-helper.js +1 -1
- package/dist/util/buffer-helper.js.map +1 -1
- package/dist/util/json-helper.js +2 -2
- package/dist/util/json-helper.js.map +1 -1
- package/dist/util/message-generator.js +1 -1
- package/dist/util/message-generator.js.map +1 -1
- package/package.json +16 -15
- package/script/genkey.ps1 +179 -179
- package/src/buffer/ascii/ascii-encoder.ts +71 -33
- package/src/buffer/ascii/ascii-view.ts +2 -2
- package/src/buffer/ascii/time-formatter.ts +2 -2
- package/src/buffer/encode-proxy.ts +2 -2
- package/src/buffer/fixml/fixml-view.ts +5 -0
- package/src/buffer/msg-view.ts +3 -0
- package/src/sample/tcp/skeleton/skeleton-session.ts +24 -2
- package/src/sample/tcp/trade-capture/trade-capture-client.ts +8 -3
- package/src/store/fix-msg-ascii-store-resend.ts +3 -2
- package/src/store/fix-msg-store-record.ts +1 -0
- package/src/transport/ascii/ascii-msg-transmitter.ts +6 -3
- package/src/transport/ascii/ascii-session.ts +75 -19
- package/src/transport/duplex/http-duplex.ts +2 -2
- package/src/transport/fix-session-state.ts +4 -1
- package/src/transport/fix-session.ts +98 -37
- package/src/transport/http/http-acceptor.ts +7 -6
- package/src/transport/tcp/tcp-acceptor.ts +59 -35
- package/src/transport/tcp/tcp-initiator.ts +63 -38
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-repo-dict.test.js","sourceRoot":"","sources":["../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C,CAAA;IACpC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,+BAAkB,CAAC,SAAS,CAAC,CAAA;IAChE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACpD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,+BAAkB,CAAC,MAAM,CAAC,CAAA;IAC7D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAC/C,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,+BAAkB,CAAC,SAAS,CAAC,CAAA;IAChE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACvD,CAAC,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ContainedFieldType, FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription } from '../transport'\r\nimport { getDefinitions } from '../util'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/test-initiator.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n}, 45000)\r\n\r\n/*\r\n<Field added=\"FIX.2.7\">\r\n\t\t<Tag>1</Tag>\r\n\t\t<Name>Account</Name>\r\n\t\t<Type>String</Type>\r\n\t\t<AbbrName>Acct</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Account mnemonic as agreed between buy and sell sides, e.g. broker and institution or investor/intermediary and fund manager.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 1', () => {\r\n const simple = definitions.simple.get('1')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(1)\r\n expect(simple.name).toEqual('Account')\r\n expect(simple.type.toLowerCase()).toEqual('string')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>15</Tag>\r\n\t\t<Name>Currency</Name>\r\n\t\t<Type>Currency</Type>\r\n\t\t<AbbrName>Ccy</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Identifies currency used for price. Absence of this field is interpreted as the default for the security. It is recommended that systems provide the currency value whenever possible. See \"Appendix 6-A: Valid Currency Codes\" for information on obtaining valid values.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 15', () => {\r\n const simple = definitions.simple.get('15')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(15)\r\n expect(simple.name).toEqual('Currency')\r\n expect(simple.type.toLowerCase()).toEqual('string') // maps to string\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>35</Tag>\r\n\t\t<Name>MsgType</Name>\r\n\t\t<Type>String</Type>\r\n\t\t<AbbrName>MsgTyp</AbbrName>\r\n\t\t<NotReqXML>1</NotReqXML>\r\n\t\t<Description>Defines message type ALWAYS THIRD FIELD IN MESSAGE. (Always unencrypted)\r\nNote: A \"U\" as the first character in the MsgType field (i.e. U, U2, etc) indicates that the message format is privately defined between the sender and receiver.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 35', () => {\r\n const simple = definitions.simple.get('35')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(35)\r\n expect(simple.name).toEqual('MsgType')\r\n expect(simple.type.toLowerCase()).toEqual('string')\r\n expect(simple.enums).toBeTruthy()\r\n expect(simple.enums.get('ZZZ')).toBeUndefined()\r\n expect(simple.enums.get('0').val).toEqual('Heartbeat')\r\n expect(simple.enums.get('8').val).toEqual('ExecutionReport')\r\n expect(simple.enums.get('AE').val).toEqual('TradeCaptureReport')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>54</Tag>\r\n\t\t<Name>Side</Name>\r\n\t\t<Type>char</Type>\r\n\t\t<AbbrName>Side</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Side of order</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 54', () => {\r\n const simple = definitions.simple.get('54')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(54)\r\n expect(simple.name).toEqual('Side')\r\n expect(simple.type.toLowerCase()).toEqual('char')\r\n expect(simple.enums).toBeTruthy()\r\n expect(simple.enums.get('1').val).toEqual('Buy')\r\n expect(simple.enums.get('2').val).toEqual('Sell')\r\n expect(simple.enums.get('3').val).toEqual('BuyMinus')\r\n expect(simple.enums.get('8').val).toEqual('Cross')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>99</Tag>\r\n\t\t<Name>StopPx</Name>\r\n\t\t<Type>Price</Type>\r\n\t\t<AbbrName>StopPx</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Price per unit of quantity (e.g. per share)</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 99', () => {\r\n const simple = definitions.simple.get('99')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(99)\r\n expect(simple.name).toEqual('StopPx')\r\n expect(simple.type.toLowerCase()).toEqual('float') // maps to float\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.3.0\">\r\n\t\t<Tag>113</Tag>\r\n\t\t<Name>ReportToExch</Name>\r\n\t\t<Type>Boolean</Type>\r\n\t\t<AbbrName>RptToExch</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Identifies party of trade responsible for exchange reporting.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 113', () => {\r\n const simple = definitions.simple.get('113')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(113)\r\n expect(simple.name).toEqual('ReportToExch')\r\n expect(simple.type.toLowerCase()).toEqual('boolean')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.4.0\">\r\n\t\t<Tag>119</Tag>\r\n\t\t<Name>SettlCurrAmt</Name>\r\n\t\t<Type>Amt</Type>\r\n\t\t<AbbrName>SettlCurrAmt</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Total amount due expressed in settlement currency (includes the effect of the forex transaction)</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 119', () => {\r\n const simple = definitions.simple.get('119')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(119)\r\n expect(simple.name).toEqual('SettlCurrAmt')\r\n expect(simple.type.toLowerCase()).toEqual('float') // maps to float\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.4.0\">\r\n\t\t<Tag>135</Tag>\r\n\t\t<Name>OfferSize</Name>\r\n\t\t<Type>Qty</Type>\r\n\t\t<AbbrName>OfrSz</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Quantity of offer\r\n(Prior to FIX 4.2 this field was of type int)</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 135', () => {\r\n const simple = definitions.simple.get('135')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(135)\r\n expect(simple.name).toEqual('OfferSize')\r\n expect(simple.type.toLowerCase()).toEqual('float') // maps to float\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.4.1\">\r\n\t\t<Tag>168</Tag>\r\n\t\t<Name>EffectiveTime</Name>\r\n\t\t<Type>UTCTimestamp</Type>\r\n\t\t<AbbrName>EfctvTm</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Time the details within the message should take effect (always expressed in UTC (Universal Time Coordinated, also known as \"GMT\")</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 168', () => {\r\n const simple = definitions.simple.get('168')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(168)\r\n expect(simple.name).toEqual('EffectiveTime')\r\n expect(simple.type.toLowerCase()).toEqual('utctimestamp')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>95</Tag>\r\n\t\t<Name>RawDataLength</Name>\r\n\t\t<Type>Length</Type>\r\n\t\t<AssociatedDataTag>96</AssociatedDataTag>\r\n\t\t<AbbrName>RawDataLength</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Number of bytes in raw data field.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 95', () => {\r\n const simple = definitions.simple.get('95')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(95)\r\n expect(simple.name).toEqual('RawDataLength')\r\n expect(simple.type.toLowerCase()).toEqual('int')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>96</Tag>\r\n\t\t<Name>RawData</Name>\r\n\t\t<Type>data</Type>\r\n\t\t<AbbrName>RawData</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Unformatted raw data, can include bitmaps, word processor documents, etc.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 96', () => {\r\n const simple = definitions.simple.get('96')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(96)\r\n expect(simple.name).toEqual('RawData')\r\n expect(simple.type.toLowerCase()).toEqual('data')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>100</Tag>\r\n\t\t<Name>ExDestination</Name>\r\n\t\t<Type>Exchange</Type>\r\n\t\t<AbbrName>ExDest</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Execution destination as defined by institution when order is entered.\r\nValid values:\r\nSee \"Appendix 6-C\"</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 100', () => {\r\n const simple = definitions.simple.get('100')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(100)\r\n expect(simple.name).toEqual('ExDestination')\r\n expect(simple.type.toLowerCase()).toEqual('string')\r\n})\r\n\r\ntest('message check TestRequest', () => {\r\n const msg = definitions.message.get('TestRequest')\r\n expect(msg).toBeTruthy()\r\n expect(msg.msgType).toEqual('1')\r\n expect(msg.fields.length).toEqual(3)\r\n expect(msg.fields[0].type).toEqual(ContainedFieldType.Component)\r\n expect(msg.fields[0].name).toEqual('StandardHeader')\r\n expect(msg.fields[1].type).toEqual(ContainedFieldType.Simple)\r\n expect(msg.fields[1].name).toEqual('TestReqID')\r\n expect(msg.fields[2].type).toEqual(ContainedFieldType.Component)\r\n expect(msg.fields[2].name).toEqual('StandardTrailer')\r\n})\r\n"]}
|
|
1
|
+
{"version":3,"file":"fix-repo-dict.test.js","sourceRoot":"","sources":["../../src/test/fix-repo-dict.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,8CAAkE;AAElE,kCAAwC;AAExC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAE/B,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,kBAAkB,GAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC,CAAA;IACvG,WAAW,GAAG,MAAM,qBAAc,CAAC,kBAAkB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;AAC/E,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAaT,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC7B,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC1C,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AA;IAChE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACvD,CAAC,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ContainedFieldType, FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription } from '../transport'\r\nimport { getDefinitions } from '../util'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/test-initiator.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n}, 45000)\r\n\r\n/*\r\n<Field added=\"FIX.2.7\">\r\n\t\t<Tag>1</Tag>\r\n\t\t<Name>Account</Name>\r\n\t\t<Type>String</Type>\r\n\t\t<AbbrName>Acct</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Account mnemonic as agreed between buy and sell sides, e.g. broker and institution or investor/intermediary and fund manager.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 1', () => {\r\n const simple = definitions.simple.get('1')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(1)\r\n expect(simple.name).toEqual('Account')\r\n expect(simple.type.toLowerCase()).toEqual('string')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>15</Tag>\r\n\t\t<Name>Currency</Name>\r\n\t\t<Type>Currency</Type>\r\n\t\t<AbbrName>Ccy</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Identifies currency used for price. Absence of this field is interpreted as the default for the security. It is recommended that systems provide the currency value whenever possible. See \"Appendix 6-A: Valid Currency Codes\" for information on obtaining valid values.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 15', () => {\r\n const simple = definitions.simple.get('15')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(15)\r\n expect(simple.name).toEqual('Currency')\r\n expect(simple.type.toLowerCase()).toEqual('string') // maps to string\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>35</Tag>\r\n\t\t<Name>MsgType</Name>\r\n\t\t<Type>String</Type>\r\n\t\t<AbbrName>MsgTyp</AbbrName>\r\n\t\t<NotReqXML>1</NotReqXML>\r\n\t\t<Description>Defines message type ALWAYS THIRD FIELD IN MESSAGE. (Always unencrypted)\r\nNote: A \"U\" as the first character in the MsgType field (i.e. U, U2, etc) indicates that the message format is privately defined between the sender and receiver.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 35', () => {\r\n const simple = definitions.simple.get('35')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(35)\r\n expect(simple.name).toEqual('MsgType')\r\n expect(simple.type.toLowerCase()).toEqual('string')\r\n expect(simple.enums).toBeTruthy()\r\n expect(simple.enums.get('ZZZ')).toBeUndefined()\r\n expect(simple.enums.get('0').val).toEqual('Heartbeat')\r\n expect(simple.enums.get('8').val).toEqual('ExecutionReport')\r\n expect(simple.enums.get('AE').val).toEqual('TradeCaptureReport')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>54</Tag>\r\n\t\t<Name>Side</Name>\r\n\t\t<Type>char</Type>\r\n\t\t<AbbrName>Side</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Side of order</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 54', () => {\r\n const simple = definitions.simple.get('54')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(54)\r\n expect(simple.name).toEqual('Side')\r\n expect(simple.type.toLowerCase()).toEqual('char')\r\n expect(simple.enums).toBeTruthy()\r\n expect(simple.enums.get('1').val).toEqual('Buy')\r\n expect(simple.enums.get('2').val).toEqual('Sell')\r\n expect(simple.enums.get('3').val).toEqual('BuyMinus')\r\n expect(simple.enums.get('8').val).toEqual('Cross')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>99</Tag>\r\n\t\t<Name>StopPx</Name>\r\n\t\t<Type>Price</Type>\r\n\t\t<AbbrName>StopPx</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Price per unit of quantity (e.g. per share)</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 99', () => {\r\n const simple = definitions.simple.get('99')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(99)\r\n expect(simple.name).toEqual('StopPx')\r\n expect(simple.type.toLowerCase()).toEqual('float') // maps to float\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.3.0\">\r\n\t\t<Tag>113</Tag>\r\n\t\t<Name>ReportToExch</Name>\r\n\t\t<Type>Boolean</Type>\r\n\t\t<AbbrName>RptToExch</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Identifies party of trade responsible for exchange reporting.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 113', () => {\r\n const simple = definitions.simple.get('113')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(113)\r\n expect(simple.name).toEqual('ReportToExch')\r\n expect(simple.type.toLowerCase()).toEqual('boolean')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.4.0\">\r\n\t\t<Tag>119</Tag>\r\n\t\t<Name>SettlCurrAmt</Name>\r\n\t\t<Type>Amt</Type>\r\n\t\t<AbbrName>SettlCurrAmt</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Total amount due expressed in settlement currency (includes the effect of the forex transaction)</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 119', () => {\r\n const simple = definitions.simple.get('119')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(119)\r\n expect(simple.name).toEqual('SettlCurrAmt')\r\n expect(simple.type.toLowerCase()).toEqual('float') // maps to float\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.4.0\">\r\n\t\t<Tag>135</Tag>\r\n\t\t<Name>OfferSize</Name>\r\n\t\t<Type>Qty</Type>\r\n\t\t<AbbrName>OfrSz</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Quantity of offer\r\n(Prior to FIX 4.2 this field was of type int)</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 135', () => {\r\n const simple = definitions.simple.get('135')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(135)\r\n expect(simple.name).toEqual('OfferSize')\r\n expect(simple.type.toLowerCase()).toEqual('float') // maps to float\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.4.1\">\r\n\t\t<Tag>168</Tag>\r\n\t\t<Name>EffectiveTime</Name>\r\n\t\t<Type>UTCTimestamp</Type>\r\n\t\t<AbbrName>EfctvTm</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Time the details within the message should take effect (always expressed in UTC (Universal Time Coordinated, also known as \"GMT\")</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 168', () => {\r\n const simple = definitions.simple.get('168')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(168)\r\n expect(simple.name).toEqual('EffectiveTime')\r\n expect(simple.type.toLowerCase()).toEqual('utctimestamp')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>95</Tag>\r\n\t\t<Name>RawDataLength</Name>\r\n\t\t<Type>Length</Type>\r\n\t\t<AssociatedDataTag>96</AssociatedDataTag>\r\n\t\t<AbbrName>RawDataLength</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Number of bytes in raw data field.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 95', () => {\r\n const simple = definitions.simple.get('95')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(95)\r\n expect(simple.name).toEqual('RawDataLength')\r\n expect(simple.type.toLowerCase()).toEqual('int')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>96</Tag>\r\n\t\t<Name>RawData</Name>\r\n\t\t<Type>data</Type>\r\n\t\t<AbbrName>RawData</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Unformatted raw data, can include bitmaps, word processor documents, etc.</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 96', () => {\r\n const simple = definitions.simple.get('96')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(96)\r\n expect(simple.name).toEqual('RawData')\r\n expect(simple.type.toLowerCase()).toEqual('data')\r\n})\r\n\r\n/*\r\n\t<Field added=\"FIX.2.7\">\r\n\t\t<Tag>100</Tag>\r\n\t\t<Name>ExDestination</Name>\r\n\t\t<Type>Exchange</Type>\r\n\t\t<AbbrName>ExDest</AbbrName>\r\n\t\t<NotReqXML>0</NotReqXML>\r\n\t\t<Description>Execution destination as defined by institution when order is entered.\r\nValid values:\r\nSee \"Appendix 6-C\"</Description>\r\n\t</Field>\r\n */\r\n\r\ntest('field check tag 100', () => {\r\n const simple = definitions.simple.get('100')\r\n expect(simple).toBeTruthy()\r\n expect(simple.tag).toEqual(100)\r\n expect(simple.name).toEqual('ExDestination')\r\n expect(simple.type.toLowerCase()).toEqual('string')\r\n})\r\n\r\ntest('message check TestRequest', () => {\r\n const msg = definitions.message.get('TestRequest')\r\n expect(msg).toBeTruthy()\r\n expect(msg.msgType).toEqual('1')\r\n expect(msg.fields.length).toEqual(3)\r\n expect(msg.fields[0].type).toEqual(ContainedFieldType.Component)\r\n expect(msg.fields[0].name).toEqual('StandardHeader')\r\n expect(msg.fields[1].type).toEqual(ContainedFieldType.Simple)\r\n expect(msg.fields[1].name).toEqual('TestReqID')\r\n expect(msg.fields[2].type).toEqual(ContainedFieldType.Component)\r\n expect(msg.fields[2].name).toEqual('StandardTrailer')\r\n})\r\n"]}
|
package/dist/test/logon.test.js
CHANGED
|
@@ -45,10 +45,10 @@ const asStrings = [
|
|
|
45
45
|
];
|
|
46
46
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
47
|
const sessionDescription = require(path.join(root, 'session/qf-fix44.json'));
|
|
48
|
-
definitions = yield
|
|
48
|
+
definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
|
|
49
49
|
const config = new config_1.JsFixConfig(null, definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
50
50
|
session = new transport_1.AsciiMsgTransmitter(config);
|
|
51
|
-
views = yield
|
|
51
|
+
views = yield util_1.replayFixFile(definitions, sessionDescription, path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'), buffer_1.AsciiChars.Pipe);
|
|
52
52
|
if (views && views.length > 0) {
|
|
53
53
|
structure = views[0].structure;
|
|
54
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logon.test.js","sourceRoot":"","sources":["../../src/test/logon.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAA2F;AAG3F,4CAAuE;AACvE,kCAAuD;AACvD,sCAAuC;AAEvC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,OAA4B,CAAA;AAChC,IAAI,KAAgB,CAAA;AACpB,IAAI,SAAoB,CAAA;AAExB,MAAM,SAAS,GAAa;IAC1B,QAAQ;IACR,SAAS;IACT,GAAG;IACH,WAAW;IACX,WAAW;IACX,GAAG;IACH,OAAO;IACP,uBAAuB;IACvB,GAAG;IACH,OAAO;IACP,IAAI;IACJ,sBAAsB;IACtB,GAAG;IACH,MAAM;IACN,IAAI;IACJ,GAAG;IACH,OAAO;IACP,GAAG;IACH,GAAG;IACH,KAAK;IACL,aAAa;IACb,IAAI;CACL,CAAA;AAED,SAAS,CAAC,GAAS,EAAE;IACnB,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C,YAAY,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1C,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACnD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IACxB,MAAM,aAAa,GAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;IACvD,MAAM,CAAC,aAAa,CAAC,CAAC,UAAU,EAAE,CAAA;IAClC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IACrD,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC;YACE,YAAY,EAAE,GAAG;YACjB,UAAU,EAAE,OAAO;SACpB;KAAC,CAAC,CAAA;AACP,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC7B,MAAM,IAAI,GAAY,KAAK,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,OAAO,GAAa,IAAI,CAAC,UAAU,EAAE,CAAA;IAC3C,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACpC,CAAC,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { SegmentDescription, SegmentType, Structure, AsciiChars, MsgView } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, AsciiMsgTransmitter } from '../transport'\r\nimport { replayFixFile, getDefinitions } from '../util'\r\nimport { JsFixConfig } from '../config'\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\n\r\nconst asStrings: string[] = [\r\n 'FIX4.4',\r\n '0000208',\r\n 'A',\r\n 'sender-10',\r\n 'target-20',\r\n '1',\r\n 'sub-a',\r\n '20180610-10:39:01.621',\r\n '2',\r\n '62441',\r\n '20',\r\n 'VgfoSqo56NqSVI1fLdlI',\r\n 'Y',\r\n '4886',\r\n '20',\r\n '1',\r\n 'ipsum',\r\n 'R',\r\n 'N',\r\n 'sit',\r\n 'consectetur',\r\n '49'\r\n]\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 views = await replayFixFile(definitions, sessionDescription, path.join(root, 'examples/FIX.4.4/quickfix/logon/fix.txt'), AsciiChars.Pipe)\r\n if (views && views.length > 0) {\r\n structure = views[0].structure\r\n }\r\n}, 45000)\r\n\r\ntest('expect a structure from fix msg', () => {\r\n expect(structure).toBeTruthy()\r\n})\r\n\r\ntest('Logon structure', () => {\r\n const logon: SegmentDescription = structure.layout.Logon\r\n expect(logon).toBeTruthy()\r\n expect(logon.type).toEqual(SegmentType.Msg)\r\n expect(logon.startPosition).toEqual(0)\r\n expect(logon.startTag).toEqual(8)\r\n expect(logon.endPosition).toEqual(21)\r\n expect(logon.endTag).toEqual(10)\r\n})\r\n\r\ntest('Logon MsgTypes', () => {\r\n const msgTypes: SegmentDescription = structure.layout.NoMsgTypes\r\n expect(msgTypes).toBeTruthy()\r\n expect(msgTypes.type).toEqual(SegmentType.Group)\r\n expect(msgTypes.delimiterTag).toEqual(372)\r\n expect(msgTypes.delimiterPositions.length).toEqual(1)\r\n expect(msgTypes.delimiterPositions).toEqual([16])\r\n})\r\n\r\ntest('Logon Object', () => {\r\n const logonAsObject: ILooseObject = views[0].toObject()\r\n expect(logonAsObject).toBeTruthy()\r\n expect(logonAsObject.Username).toEqual('sit')\r\n expect(logonAsObject.Password).toEqual('consectetur')\r\n expect(logonAsObject.NoMsgTypes).toEqual([\r\n {\r\n MsgDirection: 'R',\r\n RefMsgType: 'ipsum'\r\n }])\r\n})\r\n\r\ntest('values as strings', () => {\r\n const view: MsgView = views[0]\r\n const strings: string[] = view.getStrings()\r\n expect(strings).toEqual(asStrings)\r\n})\r\n"]}
|
|
@@ -24,8 +24,8 @@ let records;
|
|
|
24
24
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
25
|
const sessionDescription = require(path.join(root, 'session/test-initiator.json'));
|
|
26
26
|
expected = require(path.join(root, 'examples/FIX.4.4/fix.json'));
|
|
27
|
-
definitions = yield
|
|
28
|
-
views = yield
|
|
27
|
+
definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
|
|
28
|
+
views = yield util_1.replayFixFile(definitions, sessionDescription, path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'), buffer_1.AsciiChars.Pipe);
|
|
29
29
|
const config = new config_1.JsFixConfig(null, definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
30
30
|
store = new store_1.FixMsgMemoryStore('test', config);
|
|
31
31
|
records = views.reduce((agg, v) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-store.test.js","sourceRoot":"","sources":["../../src/test/memory-store.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,sCAA0D;AAG1D,kCAAuD;AACvD,oCAA6E;AAC7E,oCAAiC;AACjC,sCAAuC;AAEvC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,IAAI,WAA2B,CAAA;AAC/B,IAAI,KAAgB,CAAA;AACpB,IAAI,QAAsB,CAAA;AAC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AAC,cAAc,CAAC,CAAC,CAAC,CAAA;IAC5C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAChC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AACtD,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 { ILooseObject } from '../collections/collection'\r\nimport { getDefinitions, replayFixFile } from '../util'\r\nimport { FixMsgMemoryStore, FixMsgStoreRecord, IFixMsgStore } from '../store'\r\nimport { MsgTag } from '../types'\r\nimport { JsFixConfig } from '../config'\r\n\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet views: MsgView[]\r\nlet expected: ILooseObject\r\nlet store: IFixMsgStore\r\nlet records: FixMsgStoreRecord[]\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/test-initiator.json'))\r\n expected = require(path.join(root, 'examples/FIX.4.4/fix.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n views = await replayFixFile(definitions, sessionDescription, path.join(root, 'examples/FIX.4.4/jsfix.test_client.txt'), AsciiChars.Pipe)\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n store = new FixMsgMemoryStore('test', config)\r\n records = views.reduce((agg: FixMsgStoreRecord[], v: AsciiView) => {\r\n if (v.getString(MsgTag.SenderCompID) === 'accept-tls-comp') {\r\n agg.push(v.toMsgStoreRecord())\r\n }\r\n return agg\r\n }, [])\r\n const toWrite = records.map(r => store.put(r))\r\n await Promise.all(toWrite)\r\n}, 45000)\r\n\r\ntest('expect 15 messages in log', () => {\r\n expect(views.length).toEqual(15)\r\n})\r\n\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('check messages loaded into store', async () => {\r\n const state = await store.getState()\r\n expect(state.lastSeq).toEqual(10)\r\n expect(state.length).toEqual(9)\r\n})\r\n\r\ntest('fetch sequence number from store', async () => {\r\n const res1 = await store.exists(1)\r\n expect(res1).toBeFalsy()\r\n for (let seq = 2; seq <= 10; ++seq) {\r\n const res = await store.exists(seq)\r\n expect(res).toBeTruthy()\r\n const get = await store.get(seq)\r\n expect(get).toBeTruthy()\r\n }\r\n})\r\n\r\ntest('fetch from seqNum to inferred as end ', async () => {\r\n const range1 = await store.getSeqNumRange(5) // to the end\r\n expect(range1.length).toEqual(6)\r\n expect(range1[0].seqNum).toEqual(5)\r\n expect(range1[range1.length - 1].seqNum).toEqual(10)\r\n})\r\n\r\ntest('fetch from seqNum to = start', async () => {\r\n const range1 = await store.getSeqNumRange(5, 5)\r\n expect(range1.length).toEqual(1)\r\n expect(range1[0].seqNum).toEqual(5)\r\n})\r\n\r\ntest('fetch start from seqNum not in store', async () => {\r\n const range1 = await store.getSeqNumRange(1)\r\n expect(range1.length).toEqual(9)\r\n expect(range1[0].seqNum).toEqual(2)\r\n expect(range1[range1.length - 1].seqNum).toEqual(10)\r\n})\r\n"]}
|
|
@@ -15,13 +15,14 @@ const util_1 = require("../util");
|
|
|
15
15
|
const transport_1 = require("../transport");
|
|
16
16
|
const config_1 = require("../config");
|
|
17
17
|
const ascii_1 = require("../transport/ascii/");
|
|
18
|
+
const __1 = require("..");
|
|
18
19
|
let definitions;
|
|
19
20
|
let jsonHelper;
|
|
20
21
|
let config;
|
|
21
|
-
const root = path.join(__dirname, '../../data');
|
|
22
|
+
const root = path.join(__dirname, '../../data/examples/FIX.4.4/quickfix');
|
|
22
23
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const sessionDescription = require(path.join(root, 'session/qf-fix44.json'));
|
|
24
|
-
definitions = yield
|
|
24
|
+
const sessionDescription = require(path.join(root, '../../../session/qf-fix44.json'));
|
|
25
|
+
definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
|
|
25
26
|
jsonHelper = new util_1.JsonHelper(definitions);
|
|
26
27
|
config = new config_1.JsFixConfig(new ascii_1.AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
27
28
|
}), 45000);
|
|
@@ -44,32 +45,32 @@ function testEncodeDecode(msgType, msg) {
|
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
test('test logon JSON => object => fix => object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
const msgType =
|
|
48
|
-
const file = path.join(root, '
|
|
48
|
+
const msgType = __1.MsgType.Logon;
|
|
49
|
+
const file = path.join(root, 'logon/object.json');
|
|
49
50
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
50
51
|
yield expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg);
|
|
51
52
|
}), 1000);
|
|
52
53
|
test('test execution report JSON => object => fix => object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
const msgType =
|
|
54
|
-
const file = path.join(root, '
|
|
54
|
+
const msgType = __1.MsgType.ExecutionReport;
|
|
55
|
+
const file = path.join(root, 'execution-report/object.json');
|
|
55
56
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
56
57
|
yield expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg);
|
|
57
58
|
}), 2000);
|
|
58
59
|
test('test order cxl reject JSON => object => fix => object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
const msgType =
|
|
60
|
-
const file = path.join(root, '
|
|
60
|
+
const msgType = __1.MsgType.OrderCancelReject;
|
|
61
|
+
const file = path.join(root, 'order-cancel-reject/object.json');
|
|
61
62
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
62
63
|
yield expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg);
|
|
63
64
|
}), 1000);
|
|
64
65
|
test('test quote request JSON => object => fix => object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
-
const msgType =
|
|
66
|
-
const file = path.join(root, '
|
|
66
|
+
const msgType = __1.MsgType.QuoteRequest;
|
|
67
|
+
const file = path.join(root, 'quote-request/object.json');
|
|
67
68
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
68
69
|
yield expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg);
|
|
69
70
|
}), 1000);
|
|
70
71
|
test('test md request JSON => object => fix => object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
-
const msgType =
|
|
72
|
-
const file = path.join(root, '
|
|
72
|
+
const msgType = __1.MsgType.MarketDataSnapshotFullRefresh;
|
|
73
|
+
const file = path.join(root, 'md-data-snapshot/object.json');
|
|
73
74
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
74
75
|
yield expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg);
|
|
75
76
|
}), 1000);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qf-full-msg.test.js","sourceRoot":"","sources":["../../src/test/qf-full-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAA8D;AAG9D,kCAAoD;AACpD,4CAAuE;AACvE,sCAAuC;AACvC,+CAA4D;
|
|
1
|
+
{"version":3,"file":"qf-full-msg.test.js","sourceRoot":"","sources":["../../src/test/qf-full-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sC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AAI,EAAE,iCAAiC,CAAC,CAAA;IACvE,MAAM,GAAG,GAAiB,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,oDAAoD,EAAE,GAAS,EAAE;IACpE,MAAM,OAAO,GAAW,WAAO,CAAC,YAAY,CAAA;IAC5C,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAA;IACjE,MAAM,GAAG,GAAiB,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,iDAAiD,EAAE,GAAS,EAAE;IACjE,MAAM,OAAO,GAAW,WAAO,CAAC,6BAA6B,CAAA;IAC7D,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,8BAA8B,CAAC,CAAA;IACpE,MAAM,GAAG,GAAiB,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { AsciiParser, AsciiView, AsciiChars } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { JsonHelper, getDefinitions } from '../util'\r\nimport { ISessionDescription, AsciiMsgTransmitter } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { AsciiSessionMsgFactory } from '../transport/ascii/'\r\nimport { MsgType } from '..'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet config: JsFixConfig\r\nconst root: string = path.join(__dirname, '../../data/examples/FIX.4.4/quickfix')\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 jsonHelper = new JsonHelper(definitions)\r\n config = new JsFixConfig(new AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, AsciiChars.Pipe)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (msgType: string, msg: ILooseObject): Promise<ILooseObject> {\r\n // encode to FIX format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n let session: AsciiMsgTransmitter = new AsciiMsgTransmitter(config)\r\n const parser: AsciiParser = new AsciiParser(definitions, session.encodeStream, AsciiChars.Pipe)\r\n parser.on('msg', (msgType: string, view: AsciiView) => {\r\n const o = view.toObject()\r\n delete o.StandardHeader\r\n delete o.StandardTrailer\r\n resolve(o)\r\n })\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n session.send(msgType, msg)\r\n })\r\n}\r\n\r\ntest('test logon JSON => object => fix => object', async () => {\r\n const msgType: string = MsgType.Logon\r\n const file: string = path.join(root, 'logon/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n await expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg)\r\n}, 1000)\r\n\r\ntest('test execution report JSON => object => fix => object', async () => {\r\n const msgType: string = MsgType.ExecutionReport\r\n const file: string = path.join(root, 'execution-report/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n await expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg)\r\n}, 2000)\r\n\r\ntest('test order cxl reject JSON => object => fix => object', async () => {\r\n const msgType: string = MsgType.OrderCancelReject\r\n const file: string = path.join(root, 'order-cancel-reject/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n await expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg)\r\n}, 1000)\r\n\r\ntest('test quote request JSON => object => fix => object', async () => {\r\n const msgType: string = MsgType.QuoteRequest\r\n const file: string = path.join(root, 'quote-request/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n await expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg)\r\n}, 1000)\r\n\r\ntest('test md request JSON => object => fix => object', async () => {\r\n const msgType: string = MsgType.MarketDataSnapshotFullRefresh\r\n const file: string = path.join(root, 'md-data-snapshot/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n await expect(testEncodeDecode(msgType, msg)).resolves.toEqual(msg)\r\n}, 1000)\r\n"]}
|
|
@@ -15,13 +15,14 @@ const util_1 = require("../util");
|
|
|
15
15
|
const transport_1 = require("../transport");
|
|
16
16
|
const config_1 = require("../config");
|
|
17
17
|
const ascii_1 = require("../transport/ascii");
|
|
18
|
+
const __1 = require("..");
|
|
18
19
|
let definitions;
|
|
19
20
|
let jsonHelper;
|
|
20
21
|
let session;
|
|
21
|
-
const root = path.join(__dirname, '../../data');
|
|
22
|
+
const root = path.join(__dirname, '../../data/examples/FIX.4.4/repo/');
|
|
22
23
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const sessionDescription = require(path.join(root, 'session/test-initiator.json'));
|
|
24
|
-
definitions = yield
|
|
24
|
+
const sessionDescription = require(path.join(root, '../../../session/test-initiator.json'));
|
|
25
|
+
definitions = yield util_1.getDefinitions(sessionDescription.application.dictionary);
|
|
25
26
|
jsonHelper = new util_1.JsonHelper(definitions);
|
|
26
27
|
const config = new config_1.JsFixConfig(new ascii_1.AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, buffer_1.AsciiChars.Pipe);
|
|
27
28
|
session = new transport_1.AsciiMsgTransmitter(config);
|
|
@@ -59,22 +60,22 @@ test('check 3 digit checksum format', () => __awaiter(void 0, void 0, void 0, fu
|
|
|
59
60
|
expect(cs.CheckSum).toEqual('100');
|
|
60
61
|
}));
|
|
61
62
|
test('AE object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
const msgType =
|
|
63
|
-
const file = path.join(root, '
|
|
63
|
+
const msgType = __1.MsgType.TradeCaptureReport;
|
|
64
|
+
const file = path.join(root, 'trade-capture/object.json');
|
|
64
65
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
65
66
|
const o = yield testEncodeDecode(msgType, msg);
|
|
66
67
|
expect(o).toEqual(msg);
|
|
67
68
|
}), 1000);
|
|
68
69
|
test('d object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
-
const msgType =
|
|
70
|
-
const file = path.join(root, '
|
|
70
|
+
const msgType = __1.MsgType.SecurityDefinition;
|
|
71
|
+
const file = path.join(root, 'security-definition/object.json');
|
|
71
72
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
72
73
|
const o = yield testEncodeDecode(msgType, msg);
|
|
73
74
|
expect(o).toEqual(msg);
|
|
74
75
|
}), 1000);
|
|
75
76
|
test('D object to ascii fix to object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
|
-
const msgType =
|
|
77
|
-
const file = path.join(root, '
|
|
77
|
+
const msgType = __1.MsgType.NewOrderSingle;
|
|
78
|
+
const file = path.join(root, 'new-order-single/object.json');
|
|
78
79
|
const msg = jsonHelper.fromJson(file, msgType);
|
|
79
80
|
const o = yield testEncodeDecode(msgType, msg);
|
|
80
81
|
expect(o).toEqual(msg);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-full-ascii-msg.test.js","sourceRoot":"","sources":["../../src/test/repo-full-ascii-msg.test.ts"],"names":[],"mappings":";;;;;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C,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAE5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { AsciiParser, AsciiView, AsciiChars } from '../buffer'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { JsonHelper, getDefinitions } from '../util'\r\nimport { ISessionDescription, AsciiMsgTransmitter } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { AsciiSessionMsgFactory } from '../transport/ascii'\r\nimport { MsgType } from '..'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet session: AsciiMsgTransmitter\r\nconst root: string = path.join(__dirname, '../../data/examples/FIX.4.4/repo/')\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, '../../../session/test-initiator.json'))\r\n definitions = await getDefinitions(sessionDescription.application.dictionary)\r\n jsonHelper = new JsonHelper(definitions)\r\n const config = new JsFixConfig(new AsciiSessionMsgFactory(sessionDescription), definitions, sessionDescription, AsciiChars.Pipe)\r\n session = new AsciiMsgTransmitter(config)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (msgType: string, msg: ILooseObject): Promise<ILooseObject> {\r\n // encode to FIX format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const parser: AsciiParser = new AsciiParser(definitions, session.encodeStream, AsciiChars.Pipe)\r\n parser.on('msg', (msgType: string, view: AsciiView) => {\r\n const o = view.toObject()\r\n delete o['StandardHeader']\r\n delete o['StandardTrailer']\r\n resolve(o)\r\n })\r\n parser.on('error', (e: Error) => {\r\n reject(e)\r\n })\r\n // encode the message\r\n session.send(msgType, msg)\r\n })\r\n}\r\n\r\ntest('check 1 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(1)\r\n expect(cs.CheckSum).toEqual('001')\r\n})\r\n\r\ntest('check 2 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(10)\r\n expect(cs.CheckSum).toEqual('010')\r\n})\r\n\r\ntest('check 3 digit checksum format', async () => {\r\n const factory = session.config.factory\r\n const cs = factory.trailer(100)\r\n expect(cs.CheckSum).toEqual('100')\r\n})\r\n\r\ntest('AE object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.TradeCaptureReport\r\n const file: string = path.join(root, 'trade-capture/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n\r\ntest('d object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.SecurityDefinition\r\n const file: string = path.join(root, 'security-definition/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n\r\ntest('D object to ascii fix to object', async () => {\r\n const msgType: string = MsgType.NewOrderSingle\r\n const file: string = path.join(root, 'new-order-single/object.json')\r\n const msg: ILooseObject = jsonHelper.fromJson(file, msgType)\r\n const o: ILooseObject = await testEncodeDecode(msgType, msg)\r\n\r\n expect(o).toEqual(msg)\r\n}, 1000)\r\n"]}
|
|
@@ -17,10 +17,10 @@ const util_1 = require("../util");
|
|
|
17
17
|
let definitions;
|
|
18
18
|
let jsonHelper;
|
|
19
19
|
let sessionDescription;
|
|
20
|
-
const root = path.join(__dirname, '../../data');
|
|
20
|
+
const root = path.join(__dirname, '../../data/examples/FIXML');
|
|
21
21
|
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
sessionDescription = require(path.join(root, 'session/test-initiator.json'));
|
|
23
|
-
definitions = yield
|
|
22
|
+
sessionDescription = require(path.join(root, '../../session/test-initiator.json'));
|
|
23
|
+
definitions = yield util_1.getDefinitions('repofixml');
|
|
24
24
|
jsonHelper = new util_1.JsonHelper(definitions);
|
|
25
25
|
}), 45000);
|
|
26
26
|
function testEncodeDecode(asObj, msgType) {
|
|
@@ -51,84 +51,84 @@ function testEncodeDecode(asObj, msgType) {
|
|
|
51
51
|
}
|
|
52
52
|
test('MktDataFull settle fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
53
|
const msgType = 'MktDataFull';
|
|
54
|
-
const file = path.join(root, '
|
|
54
|
+
const file = path.join(root, 'cme/md/settle');
|
|
55
55
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
56
56
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
57
57
|
expect(o).toEqual(asObj);
|
|
58
58
|
}), 1000);
|
|
59
59
|
test('AllocInstrctn fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
60
|
const msgType = 'AllocInstrctn';
|
|
61
|
-
const file = path.join(root, '
|
|
61
|
+
const file = path.join(root, 'cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/');
|
|
62
62
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
63
63
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
64
64
|
expect(o).toEqual(asObj);
|
|
65
65
|
}), 1000);
|
|
66
66
|
test('AllocRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
67
|
const msgType = 'AllocRpt';
|
|
68
|
-
const file = path.join(root, '
|
|
68
|
+
const file = path.join(root, 'cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/');
|
|
69
69
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
70
70
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
71
71
|
expect(o).toEqual(asObj);
|
|
72
72
|
}), 1000);
|
|
73
73
|
test('TrdCaptRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
74
|
const msgType = 'TrdCaptRpt';
|
|
75
|
-
const file = path.join(root, '
|
|
75
|
+
const file = path.join(root, 'cme/tc/Delivery Fixed Commodity Swap');
|
|
76
76
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
77
77
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
78
78
|
expect(o).toEqual(asObj);
|
|
79
79
|
}), 1000);
|
|
80
80
|
test('MktDataFull fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
81
|
const msgType = 'MktDataFull';
|
|
82
|
-
const file = path.join(root, '
|
|
82
|
+
const file = path.join(root, 'cme/md/futures');
|
|
83
83
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
84
84
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
85
85
|
expect(o).toEqual(asObj);
|
|
86
86
|
}), 1000);
|
|
87
87
|
test('UserReq logon fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
88
|
const msgType = 'UserReq';
|
|
89
|
-
const file = path.join(root, '
|
|
89
|
+
const file = path.join(root, 'cme/ur/logon');
|
|
90
90
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
91
91
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
92
92
|
expect(o).toEqual(asObj);
|
|
93
93
|
}), 1000);
|
|
94
94
|
test('UserReq logoff fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
95
|
const msgType = 'UserReq';
|
|
96
|
-
const file = path.join(root, '
|
|
96
|
+
const file = path.join(root, 'cme/ur/logoff');
|
|
97
97
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
98
98
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
99
99
|
expect(o).toEqual(asObj);
|
|
100
100
|
}), 1000);
|
|
101
101
|
test('TrdCaptRpt 2 fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
102
|
const msgType = 'TrdCaptRpt';
|
|
103
|
-
const file = path.join(root, '
|
|
103
|
+
const file = path.join(root, 'cme/tc/Initial Single Side Submission');
|
|
104
104
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
105
105
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
106
106
|
expect(o).toEqual(asObj);
|
|
107
107
|
}), 1000);
|
|
108
108
|
test('TrdCaptRpt 3 fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
109
|
const msgType = 'TrdCaptRpt';
|
|
110
|
-
const file = path.join(root, '
|
|
110
|
+
const file = path.join(root, 'cme/tc/Accepted Unmatched');
|
|
111
111
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
112
112
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
113
113
|
expect(o).toEqual(asObj);
|
|
114
114
|
}), 1000);
|
|
115
115
|
test('TrdCaptRptReq fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
116
|
const msgType = 'TrdCaptRptReq';
|
|
117
|
-
const file = path.join(root, '
|
|
117
|
+
const file = path.join(root, 'cme/tc/Trading Firm Continued Subscription');
|
|
118
118
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
119
119
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
120
120
|
expect(o).toEqual(asObj);
|
|
121
121
|
}), 1000);
|
|
122
122
|
test('Order fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
123
|
const msgType = 'Order';
|
|
124
|
-
const file = path.join(root, '
|
|
124
|
+
const file = path.join(root, 'om/nso');
|
|
125
125
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
126
126
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
127
127
|
expect(o).toEqual(asObj);
|
|
128
128
|
}), 1000);
|
|
129
129
|
test('ExecRpt fixml object', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
130
|
const msgType = 'ExecRpt';
|
|
131
|
-
const file = path.join(root, '
|
|
131
|
+
const file = path.join(root, 'om/er');
|
|
132
132
|
const asObj = jsonHelper.fromJson(`${file}/object.json`, msgType);
|
|
133
133
|
const o = yield testEncodeDecode(asObj, msgType);
|
|
134
134
|
expect(o).toEqual(asObj);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-full-fixml-msg.test.js","sourceRoot":"","sources":["../../src/test/repo-full-fixml-msg.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAG5B,4CAAgE;AAChE,sCAAuC;AACvC,sCAAoG;AACpG,kCAAoD;AAEpD,IAAI,WAA2B,CAAA;AAC/B,IAAI,UAAsB,CAAA;AAC1B,IAAI,kBAAuC,CAAA;AAC3C,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;AAEvD,SAAS,CAAC,GAAS,EAAE;IACnB,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC,CAAA;IAC5E,WAAW,GAAG,MAAM,IAAA,qBAAc,EAAC,WAAW,CAAC,CAAA;IAC/C,UAAU,GAAG,IAAI,iBAAU,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,SAAe,gBAAgB,CAAE,KAAmB,EAAE,OAAe;;QAEnE,OAAO,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,EAAE,GAAG,IAAI,qBAAY,CAAC,IAAI,sBAAa,EAAE,EAAE,WAAW,CAAC,CAAA;YAC7D,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;YACzB,MAAM,KAAK,GAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAA;YAC1C,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAU,CAAC,IAAI,C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CAAC,GAAG,IAAI,cAAc,EAAE,OAAO,CAAC,CAAA;IAC/E,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,oBAAoB,EAAE,GAAS,EAAE;IACpC,MAAM,OAAO,GAAW,OAAO,CAAA;IAC/B,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,uBAAuB,CAAC,CAAA;IAC5D,MAAM,KAAK,GAAiB,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,cAAc,EAAE,OAAO,CAAC,CAAA;IAC/E,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,sBAAsB,EAAE,GAAS,EAAE;IACtC,MAAM,OAAO,GAAW,SAAS,CAAA;IACjC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,sBAAsB,CAAC,CAAA;IAC3D,MAAM,KAAK,GAAiB,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,cAAc,EAAE,OAAO,CAAC,CAAA;IAC/E,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, StringDuplex } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { MsgView, ElasticBuffer, MsgParser, AsciiChars, FixmlEncoder, FiXmlParser } from '../buffer'\r\nimport { getDefinitions, JsonHelper } from '../util'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet sessionDescription: ISessionDescription\r\nconst root: string = path.join(__dirname, '../../data')\r\n\r\nbeforeAll(async () => {\r\n sessionDescription = require(path.join(root, 'session/test-initiator.json'))\r\n definitions = await getDefinitions('repofixml')\r\n jsonHelper = new JsonHelper(definitions)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (asObj: ILooseObject, msgType: string): Promise<ILooseObject> {\r\n // encode to FIXML format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(asObj, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const xmlParser: MsgParser = new FiXmlParser(config, new StringDuplex(fixml).readable)\r\n if (asObj.Batch) {\r\n xmlParser.on('batch', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n } else {\r\n xmlParser.on('msg', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n }\r\n\r\n xmlParser.on('error', (e) => {\r\n reject(e)\r\n })\r\n })\r\n}\r\n\r\ntest('MktDataFull settle fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'examples/FIXML/cme/md/settle')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocInstrctn fixml object', async () => {\r\n const msgType: string = 'AllocInstrctn'\r\n const file: string = path.join(root,'examples/FIXML/cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocRpt fixml object', async () => {\r\n const msgType: string = 'AllocRpt'\r\n const file: string = path.join(root,'examples/FIXML/cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'examples/FIXML/cme/tc/Delivery Fixed Commodity Swap')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('MktDataFull fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'examples/FIXML/cme/md/futures')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logon fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'examples/FIXML/cme/ur/logon')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logoff fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'examples/FIXML/cme/ur/logoff')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 2 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'examples/FIXML/cme/tc/Initial Single Side Submission')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 3 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'examples/FIXML/cme/tc/Accepted Unmatched')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRptReq fixml object', async () => {\r\n const msgType: string = 'TrdCaptRptReq'\r\n const file: string = path.join(root,'examples/FIXML/cme/tc/Trading Firm Continued Subscription')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('Order fixml object', async () => {\r\n const msgType: string = 'Order'\r\n const file: string = path.join(root,'examples/FIXML/om/nso')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('ExecRpt fixml object', async () => {\r\n const msgType: string = 'ExecRpt'\r\n const file: string = path.join(root,'examples/FIXML/om/er')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n"]}
|
|
1
|
+
{"version":3,"file":"repo-full-fixml-msg.test.js","sour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,CAAC,CAAA;AAER,IAAI,CAAC,oBAAoB,EAAE,GAAS,EAAE;IACpC,MAAM,OAAO,GAAW,OAAO,CAAA;IAC/B,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,QAAQ,CAAC,CAAA;IAC7C,MAAM,KAAK,GAAiB,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,cAAc,EAAE,OAAO,CAAC,CAAA;IAC/E,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;AAER,IAAI,CAAC,sBAAsB,EAAE,GAAS,EAAE;IACtC,MAAM,OAAO,GAAW,SAAS,CAAA;IACjC,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,OAAO,CAAC,CAAA;IAC5C,MAAM,KAAK,GAAiB,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,cAAc,EAAE,OAAO,CAAC,CAAA;IAC/E,MAAM,CAAC,GAAiB,MAAM,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import * as path from 'path'\r\nimport { ILooseObject } from '../collections/collection'\r\nimport { FixDefinitions } from '../dictionary'\r\nimport { ISessionDescription, StringDuplex } from '../transport'\r\nimport { JsFixConfig } from '../config'\r\nimport { MsgView, ElasticBuffer, MsgParser, AsciiChars, FixmlEncoder, FiXmlParser } from '../buffer'\r\nimport { getDefinitions, JsonHelper } from '../util'\r\n\r\nlet definitions: FixDefinitions\r\nlet jsonHelper: JsonHelper\r\nlet sessionDescription: ISessionDescription\r\nconst root: string = path.join(__dirname, '../../data/examples/FIXML')\r\n\r\nbeforeAll(async () => {\r\n sessionDescription = require(path.join(root, '../../session/test-initiator.json'))\r\n definitions = await getDefinitions('repofixml')\r\n jsonHelper = new JsonHelper(definitions)\r\n}, 45000)\r\n\r\nasync function testEncodeDecode (asObj: ILooseObject, msgType: string): Promise<ILooseObject> {\r\n // encode to FIXML format from provided object.\r\n return new Promise(async (resolve, reject) => {\r\n const fe = new FixmlEncoder(new ElasticBuffer(), definitions)\r\n fe.encode(asObj, msgType)\r\n const fixml: string = fe.buffer.toString()\r\n const config = new JsFixConfig(null, definitions, sessionDescription, AsciiChars.Pipe)\r\n const xmlParser: MsgParser = new FiXmlParser(config, new StringDuplex(fixml).readable)\r\n if (asObj.Batch) {\r\n xmlParser.on('batch', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n } else {\r\n xmlParser.on('msg', (msgType: string, v: MsgView) => {\r\n const o: ILooseObject = v.toObject()\r\n resolve(o)\r\n })\r\n }\r\n\r\n xmlParser.on('error', (e) => {\r\n reject(e)\r\n })\r\n })\r\n}\r\n\r\ntest('MktDataFull settle fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'cme/md/settle')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocInstrctn fixml object', async () => {\r\n const msgType: string = 'AllocInstrctn'\r\n const file: string = path.join(root,'cme/alloc/Claiming Firm Requests Sub-allocation with Allocation Instructions/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('AllocRpt fixml object', async () => {\r\n const msgType: string = 'AllocRpt'\r\n const file: string = path.join(root,'cme/alloc/Clearing System Notifies Allocation to the Claiming Firm - Cross-Exchange/')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Delivery Fixed Commodity Swap')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('MktDataFull fixml object', async () => {\r\n const msgType: string = 'MktDataFull'\r\n const file: string = path.join(root,'cme/md/futures')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logon fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'cme/ur/logon')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('UserReq logoff fixml object', async () => {\r\n const msgType: string = 'UserReq'\r\n const file: string = path.join(root,'cme/ur/logoff')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 2 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Initial Single Side Submission')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRpt 3 fixml object', async () => {\r\n const msgType: string = 'TrdCaptRpt'\r\n const file: string = path.join(root,'cme/tc/Accepted Unmatched')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('TrdCaptRptReq fixml object', async () => {\r\n const msgType: string = 'TrdCaptRptReq'\r\n const file: string = path.join(root,'cme/tc/Trading Firm Continued Subscription')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('Order fixml object', async () => {\r\n const msgType: string = 'Order'\r\n const file: string = path.join(root,'om/nso')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n\r\ntest('ExecRpt fixml object', async () => {\r\n const msgType: string = 'ExecRpt'\r\n const file: string = path.join(root,'om/er')\r\n const asObj: ILooseObject = jsonHelper.fromJson(`${file}/object.json`, msgType)\r\n const o: ILooseObject = await testEncodeDecode(asObj, msgType)\r\n expect(o).toEqual(asObj)\r\n}, 1000)\r\n"]}
|