jspurefix 3.4.0 → 4.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 +1 -1
- package/dist/buffer/ascii/ascii-encoder.d.ts +2 -2
- package/dist/buffer/ascii/ascii-encoder.js +1 -1
- package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser-state.d.ts +3 -2
- package/dist/buffer/ascii/ascii-parser-state.js +1 -2
- package/dist/buffer/ascii/ascii-parser-state.js.map +1 -1
- package/dist/buffer/ascii/ascii-parser.d.ts +1 -1
- package/dist/buffer/ascii/ascii-parser.js +5 -4
- package/dist/buffer/ascii/ascii-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
- package/dist/buffer/ascii/ascii-view.d.ts +4 -3
- package/dist/buffer/ascii/ascii-view.js +8 -5
- package/dist/buffer/ascii/ascii-view.js.map +1 -1
- package/dist/buffer/encode-proxy.js +1 -1
- package/dist/buffer/encode-proxy.js.map +1 -1
- package/dist/buffer/fixml/fixml-encoder.d.ts +2 -2
- package/dist/buffer/fixml/fixml-encoder.js +1 -1
- package/dist/buffer/fixml/fixml-encoder.js.map +1 -1
- package/dist/buffer/fixml/fixml-parser.js +2 -2
- package/dist/buffer/fixml/fixml-parser.js.map +1 -1
- package/dist/buffer/fixml/fixml-view.d.ts +3 -2
- package/dist/buffer/fixml/fixml-view.js +5 -4
- package/dist/buffer/fixml/fixml-view.js.map +1 -1
- package/dist/buffer/msg-encoder.d.ts +2 -2
- package/dist/buffer/msg-encoder.js.map +1 -1
- package/dist/buffer/msg-view.d.ts +8 -6
- package/dist/buffer/msg-view.js +10 -8
- package/dist/buffer/msg-view.js.map +1 -1
- package/dist/buffer/segment/segment-description.d.ts +3 -3
- package/dist/buffer/segment/segment-description.js.map +1 -1
- package/dist/buffer/tag/tags.d.ts +2 -5
- package/dist/buffer/tag/tags.js +4 -5
- package/dist/buffer/tag/tags.js.map +1 -1
- package/dist/collections/collection.d.ts +0 -1
- package/dist/collections/collection.js.map +1 -1
- package/dist/collections/index.d.ts +0 -1
- package/dist/collections/index.js +0 -17
- package/dist/collections/index.js.map +1 -1
- package/dist/config/js-fix-config.d.ts +2 -1
- package/dist/config/js-fix-config.js +3 -3
- package/dist/config/js-fix-config.js.map +1 -1
- package/dist/dictionary/compiler/compiler-type.d.ts +3 -3
- package/dist/dictionary/compiler/compiler-type.js.map +1 -1
- package/dist/dictionary/compiler/enum-compiler.js +2 -2
- package/dist/dictionary/compiler/enum-compiler.js.map +1 -1
- package/dist/dictionary/compiler/msg-compiler.d.ts +1 -2
- package/dist/dictionary/compiler/msg-compiler.js +6 -7
- package/dist/dictionary/compiler/msg-compiler.js.map +1 -1
- package/dist/dictionary/contained/contained-component-field.d.ts +1 -1
- package/dist/dictionary/contained/contained-component-field.js.map +1 -1
- package/dist/dictionary/contained/contained-field-set.d.ts +9 -20
- package/dist/dictionary/contained/contained-field-set.js +16 -149
- package/dist/dictionary/contained/contained-field-set.js.map +1 -1
- package/dist/dictionary/contained/contained-group-field.d.ts +1 -1
- package/dist/dictionary/contained/contained-group-field.js.map +1 -1
- package/dist/dictionary/contained/contained-set-builder.d.ts +15 -0
- package/dist/dictionary/contained/contained-set-builder.js +142 -0
- package/dist/dictionary/contained/contained-set-builder.js.map +1 -0
- package/dist/dictionary/contained/contained-set.d.ts +32 -0
- package/dist/{types/FIX.5.0SP2/quickfix/xm_lnon_fix.js → dictionary/contained/contained-set.js} +1 -1
- package/dist/dictionary/contained/contained-set.js.map +1 -0
- package/dist/dictionary/contained/contained-simple-field.d.ts +1 -1
- package/dist/dictionary/contained/contained-simple-field.js.map +1 -1
- package/dist/dictionary/contained/index.d.ts +4 -1
- package/dist/dictionary/contained/index.js +4 -1
- package/dist/dictionary/contained/index.js.map +1 -1
- package/dist/dictionary/definition/category-simple-set.d.ts +1 -2
- package/dist/dictionary/definition/category-simple-set.js +1 -2
- package/dist/dictionary/definition/category-simple-set.js.map +1 -1
- package/dist/dictionary/definition/component-field-definition.d.ts +1 -1
- 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 +8 -9
- package/dist/dictionary/definition/fix-definitions.js +22 -20
- package/dist/dictionary/definition/fix-definitions.js.map +1 -1
- package/dist/dictionary/definition/group-field-definition.d.ts +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/message-definition.d.ts +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 +2 -3
- package/dist/dictionary/definition/simple-field-definition.js +6 -7
- package/dist/dictionary/definition/simple-field-definition.js.map +1 -1
- package/dist/dictionary/parser/fix-repository/repository.js +20 -20
- package/dist/dictionary/parser/fix-repository/repository.js.map +1 -1
- package/dist/dictionary/parser/fixml/components-parser.js +18 -16
- package/dist/dictionary/parser/fixml/components-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/fields-parser.js +2 -3
- package/dist/dictionary/parser/fixml/fields-parser.js.map +1 -1
- package/dist/dictionary/parser/fixml/include-graph.js +8 -9
- package/dist/dictionary/parser/fixml/include-graph.js.map +1 -1
- package/dist/dictionary/parser/quickfix/field-definition-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/message-parser.js +2 -1
- package/dist/dictionary/parser/quickfix/message-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/node-parser.js +3 -2
- package/dist/dictionary/parser/quickfix/node-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/parse-context.d.ts +3 -3
- package/dist/dictionary/parser/quickfix/parse-context.js.map +1 -1
- package/dist/dictionary/parser/quickfix/parse-progress.d.ts +1 -2
- package/dist/dictionary/parser/quickfix/parse-progress.js +2 -3
- package/dist/dictionary/parser/quickfix/parse-progress.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-builder.js +4 -5
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-builder.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js +6 -6
- package/dist/dictionary/parser/quickfix/quick-fix-xml-file-parser.js.map +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-formatter.d.ts +1 -1
- package/dist/dictionary/parser/quickfix/quick-fix-xml-formatter.js.map +1 -1
- package/dist/dictionary/set-reduce.d.ts +2 -2
- package/dist/dictionary/set-reduce.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/jsfix-cmd.js +4 -5
- package/dist/jsfix-cmd.js.map +1 -1
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js +7 -8
- package/dist/sample/tcp/recovering-skeleton/respawn-acceptor.js.map +1 -1
- package/dist/sample/tcp/trade-capture/trade-capture-client.js +3 -4
- 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/store/fix-msg-ascii-store-resend.d.ts +4 -3
- package/dist/store/fix-msg-ascii-store-resend.js +21 -5
- package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
- package/dist/store/fix-msg-memory-store.js +3 -4
- package/dist/store/fix-msg-memory-store.js.map +1 -1
- package/dist/store/fix-msg-store-record.js.map +1 -1
- package/dist/test/ascii/ascii-encoder.test.js.map +1 -1
- package/dist/test/ascii/ascii-store-replay.test.js +14 -1
- package/dist/test/ascii/ascii-store-replay.test.js.map +1 -1
- package/dist/test/ascii/fix-log-replay.test.js.map +1 -1
- package/dist/test/ascii/fix-repo-dict.test.js.map +1 -1
- package/dist/test/ascii/qf-50sp0-dict.test.js +7 -7
- package/dist/test/ascii/qf-50sp0-dict.test.js.map +1 -1
- package/dist/test/ascii/qf-50sp2-dict.test.js +5 -2
- package/dist/test/ascii/qf-50sp2-dict.test.js.map +1 -1
- package/dist/test/ascii/session.test.js +64 -15
- package/dist/test/ascii/session.test.js.map +1 -1
- package/dist/test/env/encoder-test.d.ts +3 -3
- package/dist/test/env/encoder-test.js.map +1 -1
- package/dist/test/env/set-constraint-helper.d.ts +4 -4
- package/dist/test/env/set-constraint-helper.js.map +1 -1
- package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
- package/dist/transport/ascii/ascii-session.js +5 -2
- package/dist/transport/ascii/ascii-session.js.map +1 -1
- package/dist/transport/fixml/fixml-session.js.map +1 -1
- package/dist/transport/http/http-acceptor.js +3 -4
- package/dist/transport/http/http-acceptor.js.map +1 -1
- package/dist/transport/http/http-json-sample-adapter.js +3 -4
- package/dist/transport/http/http-json-sample-adapter.js.map +1 -1
- package/dist/transport/session/dynamic-session-manager.d.ts +8 -0
- package/dist/transport/session/dynamic-session-manager.js +15 -0
- package/dist/transport/session/dynamic-session-manager.js.map +1 -0
- package/dist/transport/session/session-description.d.ts +9 -7
- package/dist/transport/session/session-description.js.map +1 -1
- package/dist/util/json-helper.d.ts +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 +21 -21
- package/src/buffer/ascii/ascii-encoder.ts +7 -7
- package/src/buffer/ascii/ascii-parser-state.ts +4 -4
- package/src/buffer/ascii/ascii-parser.ts +6 -5
- package/src/buffer/ascii/ascii-segment-parser.ts +2 -2
- package/src/buffer/ascii/ascii-view.ts +9 -7
- package/src/buffer/encode-proxy.ts +9 -9
- package/src/buffer/fixml/fixml-encoder.ts +14 -10
- package/src/buffer/fixml/fixml-parser.ts +5 -5
- package/src/buffer/fixml/fixml-view.ts +5 -5
- package/src/buffer/msg-encoder.ts +3 -3
- package/src/buffer/msg-view.ts +18 -18
- package/src/buffer/segment/segment-description.ts +2 -2
- package/src/buffer/tag/tags.ts +4 -6
- package/src/collections/collection.ts +0 -1
- package/src/collections/index.ts +1 -1
- package/src/config/js-fix-config.ts +3 -2
- package/src/dictionary/compiler/compiler-type.ts +8 -2
- package/src/dictionary/compiler/enum-compiler.ts +2 -2
- package/src/dictionary/compiler/msg-compiler.ts +11 -12
- package/src/dictionary/contained/contained-component-field.ts +1 -1
- package/src/dictionary/contained/contained-field-set.ts +21 -176
- package/src/dictionary/contained/contained-group-field.ts +1 -1
- package/src/dictionary/contained/contained-set-builder.ts +164 -0
- package/src/dictionary/contained/contained-set.ts +83 -0
- package/src/dictionary/contained/contained-simple-field.ts +1 -1
- package/src/dictionary/contained/index.ts +4 -1
- package/src/dictionary/definition/category-simple-set.ts +1 -2
- package/src/dictionary/definition/component-field-definition.ts +1 -1
- package/src/dictionary/definition/fix-definitions.ts +28 -26
- package/src/dictionary/definition/group-field-definition.ts +1 -1
- package/src/dictionary/definition/message-definition.ts +6 -6
- package/src/dictionary/definition/simple-field-definition.ts +9 -10
- package/src/dictionary/parser/fix-repository/repository.ts +47 -40
- package/src/dictionary/parser/fixml/components-parser.ts +41 -38
- package/src/dictionary/parser/fixml/fields-parser.ts +3 -4
- package/src/dictionary/parser/fixml/include-graph.ts +13 -14
- package/src/dictionary/parser/quickfix/field-definition-parser.ts +5 -5
- package/src/dictionary/parser/quickfix/message-parser.ts +7 -5
- package/src/dictionary/parser/quickfix/node-parser.ts +13 -6
- package/src/dictionary/parser/quickfix/parse-context.ts +2 -2
- package/src/dictionary/parser/quickfix/parse-progress.ts +2 -3
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-builder.ts +4 -5
- package/src/dictionary/parser/quickfix/quick-fix-xml-file-parser.ts +10 -12
- package/src/dictionary/parser/quickfix/quick-fix-xml-formatter.ts +1 -1
- package/src/dictionary/set-reduce.ts +3 -3
- package/src/index.ts +0 -1
- package/src/jsfix-cmd.ts +5 -6
- package/src/sample/tcp/recovering-skeleton/respawn-acceptor.ts +7 -8
- package/src/sample/tcp/trade-capture/trade-capture-client.ts +4 -5
- package/src/sample/tcp/trade-capture/trade-capture-server.ts +1 -1
- package/src/store/fix-msg-ascii-store-resend.ts +64 -8
- package/src/store/fix-msg-memory-store.ts +3 -4
- package/src/store/fix-msg-store-record.ts +1 -1
- package/src/transport/ascii/ascii-msg-transmitter.ts +6 -6
- package/src/transport/ascii/ascii-session.ts +11 -7
- package/src/transport/fixml/fixml-session.ts +3 -3
- package/src/transport/http/http-acceptor.ts +4 -5
- package/src/transport/http/http-json-sample-adapter.ts +3 -4
- package/src/transport/session/dynamic-session-manager.ts +16 -0
- package/src/transport/session/session-description.ts +10 -7
- package/src/util/json-helper.ts +3 -3
- package/src/util/message-generator.ts +4 -4
- package/dist/collections/dictionary.d.ts +0 -15
- package/dist/collections/dictionary.js +0 -57
- package/dist/collections/dictionary.js.map +0 -1
- package/dist/types/FIX.5.0SP2/quickfix/execution_acknowledgement.d.ts +0 -31
- package/dist/types/FIX.5.0SP2/quickfix/execution_acknowledgement.js +0 -3
- package/dist/types/FIX.5.0SP2/quickfix/execution_acknowledgement.js.map +0 -1
- package/dist/types/FIX.5.0SP2/quickfix/mass_quote_acknowledgement.d.ts +0 -26
- package/dist/types/FIX.5.0SP2/quickfix/mass_quote_acknowledgement.js +0 -3
- package/dist/types/FIX.5.0SP2/quickfix/mass_quote_acknowledgement.js.map +0 -1
- package/dist/types/FIX.5.0SP2/quickfix/set/hop_grp.d.ts +0 -5
- package/dist/types/FIX.5.0SP2/quickfix/set/hop_grp.js +0 -3
- package/dist/types/FIX.5.0SP2/quickfix/set/hop_grp.js.map +0 -1
- package/dist/types/FIX.5.0SP2/quickfix/set/msg_type_grp.d.ts +0 -8
- package/dist/types/FIX.5.0SP2/quickfix/set/msg_type_grp.js +0 -3
- package/dist/types/FIX.5.0SP2/quickfix/set/msg_type_grp.js.map +0 -1
- package/dist/types/FIX.5.0SP2/quickfix/set/not_affected_orders_grp.d.ts +0 -4
- package/dist/types/FIX.5.0SP2/quickfix/set/not_affected_orders_grp.js +0 -3
- package/dist/types/FIX.5.0SP2/quickfix/set/not_affected_orders_grp.js.map +0 -1
- package/dist/types/FIX.5.0SP2/quickfix/xm_lnon_fix.d.ts +0 -6
- package/dist/types/FIX.5.0SP2/quickfix/xm_lnon_fix.js.map +0 -1
- package/src/collections/dictionary.ts +0 -62
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FixMsgMemoryStore = void 0;
|
|
13
|
-
const collections_1 = require("../collections");
|
|
14
13
|
const types_1 = require("../types");
|
|
15
14
|
class FixMsgMemoryStore {
|
|
16
15
|
constructor(id, config) {
|
|
@@ -18,7 +17,7 @@ class FixMsgMemoryStore {
|
|
|
18
17
|
this.config = config;
|
|
19
18
|
this.heartbeat = true;
|
|
20
19
|
this.sortedBySeqNum = [];
|
|
21
|
-
this.excluded = new
|
|
20
|
+
this.excluded = new Map();
|
|
22
21
|
this.length = 0;
|
|
23
22
|
this.sessionMessages = [
|
|
24
23
|
types_1.MsgType.Logon,
|
|
@@ -148,7 +147,7 @@ class FixMsgMemoryStore {
|
|
|
148
147
|
put(record) {
|
|
149
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
149
|
return yield new Promise((resolve, reject) => {
|
|
151
|
-
if (this.excluded.
|
|
150
|
+
if (this.excluded.has(record.msgType)) {
|
|
152
151
|
resolve(this.buildState());
|
|
153
152
|
}
|
|
154
153
|
else {
|
|
@@ -171,7 +170,7 @@ class FixMsgMemoryStore {
|
|
|
171
170
|
}
|
|
172
171
|
excludeRange(exclude) {
|
|
173
172
|
exclude.forEach(s => {
|
|
174
|
-
this.excluded.
|
|
173
|
+
this.excluded.set(s, true);
|
|
175
174
|
});
|
|
176
175
|
}
|
|
177
176
|
exists(seqNum) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-msg-memory-store.js","sourceRoot":"","sources":["../../src/store/fix-msg-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AAI,CAAC,eAAe,CAAC,CAAA;QACvC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;IAEO,YAAY,CAAE,OAAiB;QACrC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAClB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;IAEK,MAAM,CAAE,MAAc;;YAC1B,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC3C,IAAI,CAAC;oBACH,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAA;oBAC/B,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;oBACnD,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAA;gBACrB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;CACF;AApKD,8CAoKC","sourcesContent":["import { IFixMsgStore } from './fix-msg-store'\r\nimport { IJsFixConfig, IJsFixLogger } from '../config'\r\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\r\nimport { Dictionary } from '../collections'\r\nimport { MsgType } from '../types'\r\nimport { IFixMsgStoreState } from './fix-msg-store-state'\r\n\r\nexport class FixMsgMemoryStore implements IFixMsgStore {\r\n protected readonly logger: IJsFixLogger\r\n public heartbeat: boolean = true\r\n private sortedBySeqNum: IFixMsgStoreRecord[] = []\r\n private readonly excluded: Dictionary<boolean> = new Dictionary<boolean>()\r\n public length: number = 0\r\n private readonly sessionMessages: string[] = [\r\n MsgType.Logon,\r\n MsgType.Logout,\r\n MsgType.ResendRequest,\r\n MsgType.Heartbeat,\r\n MsgType.TestRequest,\r\n MsgType.SequenceReset\r\n ]\r\n\r\n public constructor (public readonly id: string, public readonly config: IJsFixConfig) {\r\n this.logger = config.logFactory.logger(`${this.id}:FixMsgMemoryStore`)\r\n this.setExcMsgType([])\r\n }\r\n\r\n public static search (ar: IFixMsgStoreRecord[], target: number, isDate?: boolean): number {\r\n let m: number = 0\r\n let n: number = ar.length - 1\r\n while (m <= n) {\r\n const k: number = (n + m) >> 1\r\n const check: number = isDate ? ar[k].timestamp.getDate() : ar[k].seqNum\r\n const cmp: number = target - check\r\n if (cmp > 0) {\r\n m = k + 1\r\n } else if (cmp < 0) {\r\n n = k - 1\r\n } else {\r\n return k\r\n }\r\n }\r\n return -m - 1\r\n }\r\n\r\n public async getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]> {\r\n return await new Promise((resolve, reject: any) => {\r\n const data = this.sortedBySeqNum\r\n if (data === null) reject(new Error('no store'))\r\n const required = data.filter(x => x.msgType === msgType)\r\n resolve(required)\r\n })\r\n }\r\n\r\n private getIndex (seq: number): number {\r\n const arr = this.sortedBySeqNum\r\n let index = FixMsgMemoryStore.search(arr, seq)\r\n if (index < 0) {\r\n index = -(index + 1)\r\n }\r\n return index\r\n }\r\n\r\n private bounded (fromIdx: number, toIdx: number): boolean {\r\n const arr = this.sortedBySeqNum\r\n return fromIdx >= 0 && fromIdx <= arr.length && toIdx >= fromIdx && toIdx <= arr.length\r\n }\r\n\r\n public async get (from: number): Promise<IFixMsgStoreRecord> {\r\n return await new Promise((resolve, reject) => {\r\n this.getSeqNumRange(from, from).then(res => {\r\n if (res.length > 0) {\r\n const record = res[0].clone()\r\n resolve(record)\r\n } else {\r\n reject(new Error(`${from} not in store`))\r\n }\r\n }).catch(e => {\r\n reject(e)\r\n })\r\n })\r\n }\r\n\r\n public async getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]> {\r\n return await new Promise((resolve, reject) => {\r\n to = to ?? 0\r\n const arr = this.sortedBySeqNum\r\n if (from < 0) reject(new Error(`illegal from ${from}`))\r\n if (to < 0) reject(new Error(`illegal to ${to}`))\r\n const fromIdx = this.getIndex(from)\r\n const toEnd = to === 0 || isNaN(to)\r\n const toIdx = toEnd ? arr.length - 1 : this.getIndex(to)\r\n if (this.bounded(fromIdx, toIdx)) {\r\n resolve(arr.slice(fromIdx, toIdx + 1))\r\n } else {\r\n reject(new Error(`incorrect bounds from=${from}, fromIdx=${fromIdx}, to=${to}, toIdx=${toIdx}, length=${arr.length}`))\r\n }\r\n })\r\n }\r\n\r\n private buildState (): IFixMsgStoreState {\r\n const arr = this.sortedBySeqNum\r\n return {\r\n firstSeq: arr.length > 0 ? arr[0].seqNum : 0,\r\n lastSeq: arr.length > 0 ? arr[arr.length - 1].seqNum : 0,\r\n id: this.id,\r\n length: arr.length\r\n } as IFixMsgStoreState\r\n }\r\n\r\n public async getState (): Promise<IFixMsgStoreState> {\r\n return await new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public async clear (): Promise<IFixMsgStoreState> {\r\n this.sortedBySeqNum = []\r\n return await new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public async put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState> {\r\n return await new Promise((resolve, reject) => {\r\n if (this.excluded.containsKey(record.msgType)) {\r\n resolve(this.buildState())\r\n } else {\r\n const arr = this.sortedBySeqNum\r\n const idx = FixMsgMemoryStore.search(arr, record.seqNum)\r\n if (idx >= 0) { // seen this before\r\n reject(new Error(`this seqNum ${record.seqNum} already in store`))\r\n }\r\n arr.splice(-idx, 0, record)\r\n this.length = arr.length\r\n resolve(this.buildState())\r\n }\r\n })\r\n }\r\n\r\n public setExcMsgType (exclude: string[]): void {\r\n this.excluded.clear()\r\n this.excludeRange(this.sessionMessages)\r\n this.excludeRange(exclude)\r\n }\r\n\r\n private excludeRange (exclude: string[]): void {\r\n exclude.forEach(s => {\r\n this.excluded.add(s, true)\r\n })\r\n }\r\n\r\n async exists (seqNum: number): Promise<boolean> {\r\n return await new Promise((resolve, reject) => {\r\n try {\r\n const arr = this.sortedBySeqNum\r\n const index = FixMsgMemoryStore.search(arr, seqNum)\r\n resolve(index >= 0)\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"fix-msg-memory-store.js","sourceRoot":"","sources":["../../src/store/fix-msg-memory-store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,oCAAkC;AAGlC,MAAa,iBAAiB;IAe5B,YAAoC,EAAU,EAAkB,MAAoB;QAAhD,OAAE,GAAF,EAAE,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAc;QAb7E,cAAS,GAAY,IAAI,CAAA;QACxB,mBAAc,GAAyB,EAAE,CAAA;QAChC,aAAQ,GAAyB,IAAI,GAAG,EAAmB,CAAA;QACrE,WAAM,GAAW,CAAC,CAAA;QACR,oBAAe,GAAa;YAC3C,eAAO,CAAC,KAAK;YACb,eAAO,CAAC,MAAM;YACd,eAAO,CAAC,aAAa;YACrB,eAAO,CAAC,SAAS;YACjB,eAAO,CAAC,WAAW;YACnB,eAAO,CAAC,aAAa;SACtB,CAAA;QAGC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,oBAAoB,CAAC,CAAA;QACtE,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;IACxB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAE,EAAwB,EAAE,MAAc,EAAE,MAAgB;QAC9E,IAAI,CAAC,GAAW,CAAC,CAAA;QACjB,IAAI,CAAC,GAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA;QAC7B,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACd,MAAM,CAAC,GAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;YAC9B,MAA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;oBAC3B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;oBACxB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;IAEM,aAAa,CAAE,OAAiB;QACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;QACrB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACvC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;IAEO,YAAY,CAAE,OAAiB;QACrC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAClB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;IAEK,MAAM,CAAE,MAAc;;YAC1B,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC3C,IAAI,CAAC;oBACH,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAA;oBAC/B,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;oBACnD,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAA;gBACrB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;CACF;AApKD,8CAoKC","sourcesContent":["import { IFixMsgStore } from './fix-msg-store'\r\nimport { IJsFixConfig, IJsFixLogger } from '../config'\r\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\r\nimport { MsgType } from '../types'\r\nimport { IFixMsgStoreState } from './fix-msg-store-state'\r\n\r\nexport class FixMsgMemoryStore implements IFixMsgStore {\r\n protected readonly logger: IJsFixLogger\r\n public heartbeat: boolean = true\r\n private sortedBySeqNum: IFixMsgStoreRecord[] = []\r\n private readonly excluded: Map<string, boolean> = new Map<string, boolean>()\r\n public length: number = 0\r\n private readonly sessionMessages: string[] = [\r\n MsgType.Logon,\r\n MsgType.Logout,\r\n MsgType.ResendRequest,\r\n MsgType.Heartbeat,\r\n MsgType.TestRequest,\r\n MsgType.SequenceReset\r\n ]\r\n\r\n public constructor (public readonly id: string, public readonly config: IJsFixConfig) {\r\n this.logger = config.logFactory.logger(`${this.id}:FixMsgMemoryStore`)\r\n this.setExcMsgType([])\r\n }\r\n\r\n public static search (ar: IFixMsgStoreRecord[], target: number, isDate?: boolean): number {\r\n let m: number = 0\r\n let n: number = ar.length - 1\r\n while (m <= n) {\r\n const k: number = (n + m) >> 1\r\n const check: number = isDate ? ar[k].timestamp.getDate() : ar[k].seqNum\r\n const cmp: number = target - check\r\n if (cmp > 0) {\r\n m = k + 1\r\n } else if (cmp < 0) {\r\n n = k - 1\r\n } else {\r\n return k\r\n }\r\n }\r\n return -m - 1\r\n }\r\n\r\n public async getMsgType (msgType: string): Promise<IFixMsgStoreRecord[]> {\r\n return await new Promise((resolve, reject: any) => {\r\n const data = this.sortedBySeqNum\r\n if (data === null) reject(new Error('no store'))\r\n const required = data.filter(x => x.msgType === msgType)\r\n resolve(required)\r\n })\r\n }\r\n\r\n private getIndex (seq: number): number {\r\n const arr = this.sortedBySeqNum\r\n let index = FixMsgMemoryStore.search(arr, seq)\r\n if (index < 0) {\r\n index = -(index + 1)\r\n }\r\n return index\r\n }\r\n\r\n private bounded (fromIdx: number, toIdx: number): boolean {\r\n const arr = this.sortedBySeqNum\r\n return fromIdx >= 0 && fromIdx <= arr.length && toIdx >= fromIdx && toIdx <= arr.length\r\n }\r\n\r\n public async get (from: number): Promise<IFixMsgStoreRecord> {\r\n return await new Promise((resolve, reject) => {\r\n this.getSeqNumRange(from, from).then(res => {\r\n if (res.length > 0) {\r\n const record = res[0].clone()\r\n resolve(record)\r\n } else {\r\n reject(new Error(`${from} not in store`))\r\n }\r\n }).catch(e => {\r\n reject(e)\r\n })\r\n })\r\n }\r\n\r\n public async getSeqNumRange (from: number, to?: number): Promise<IFixMsgStoreRecord[]> {\r\n return await new Promise((resolve, reject) => {\r\n to = to ?? 0\r\n const arr = this.sortedBySeqNum\r\n if (from < 0) reject(new Error(`illegal from ${from}`))\r\n if (to < 0) reject(new Error(`illegal to ${to}`))\r\n const fromIdx = this.getIndex(from)\r\n const toEnd = to === 0 || isNaN(to)\r\n const toIdx = toEnd ? arr.length - 1 : this.getIndex(to)\r\n if (this.bounded(fromIdx, toIdx)) {\r\n resolve(arr.slice(fromIdx, toIdx + 1))\r\n } else {\r\n reject(new Error(`incorrect bounds from=${from}, fromIdx=${fromIdx}, to=${to}, toIdx=${toIdx}, length=${arr.length}`))\r\n }\r\n })\r\n }\r\n\r\n private buildState (): IFixMsgStoreState {\r\n const arr = this.sortedBySeqNum\r\n return {\r\n firstSeq: arr.length > 0 ? arr[0].seqNum : 0,\r\n lastSeq: arr.length > 0 ? arr[arr.length - 1].seqNum : 0,\r\n id: this.id,\r\n length: arr.length\r\n } as IFixMsgStoreState\r\n }\r\n\r\n public async getState (): Promise<IFixMsgStoreState> {\r\n return await new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public async clear (): Promise<IFixMsgStoreState> {\r\n this.sortedBySeqNum = []\r\n return await new Promise((resolve, reject) => {\r\n try {\r\n resolve(this.buildState())\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n\r\n public async put (record: IFixMsgStoreRecord): Promise<IFixMsgStoreState> {\r\n return await new Promise((resolve, reject) => {\r\n if (this.excluded.has(record.msgType)) {\r\n resolve(this.buildState())\r\n } else {\r\n const arr = this.sortedBySeqNum\r\n const idx = FixMsgMemoryStore.search(arr, record.seqNum)\r\n if (idx >= 0) { // seen this before\r\n reject(new Error(`this seqNum ${record.seqNum} already in store`))\r\n }\r\n arr.splice(-idx, 0, record)\r\n this.length = arr.length\r\n resolve(this.buildState())\r\n }\r\n })\r\n }\r\n\r\n public setExcMsgType (exclude: string[]): void {\r\n this.excluded.clear()\r\n this.excludeRange(this.sessionMessages)\r\n this.excludeRange(exclude)\r\n }\r\n\r\n private excludeRange (exclude: string[]): void {\r\n exclude.forEach(s => {\r\n this.excluded.set(s, true)\r\n })\r\n }\r\n\r\n async exists (seqNum: number): Promise<boolean> {\r\n return await new Promise((resolve, reject) => {\r\n try {\r\n const arr = this.sortedBySeqNum\r\n const index = FixMsgMemoryStore.search(arr, seqNum)\r\n resolve(index >= 0)\r\n } catch (e) {\r\n reject(e)\r\n }\r\n })\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-msg-store-record.js","sourceRoot":"","sources":["../../src/store/fix-msg-store-record.ts"],"names":[],"mappings":";;;AAEA,oCAAiC;AAWjC,MAAa,iBAAiB;IAC5B,YAA6B,OAAe,EAC1B,SAAe,EACf,MAAc,EACvB,GAAkB,EACT,OAAuB;QAJZ,YAAO,GAAP,OAAO,CAAQ;QAC1B,cAAS,GAAT,SAAS,CAAM;QACf,WAAM,GAAN,MAAM,CAAQ;QACvB,QAAG,GAAH,GAAG,CAAe;QACT,YAAO,GAAP,OAAO,CAAgB;IACzC,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAE,CAAU;;QACjC,OAAO,IAAI,iBAAiB,CAAC,MAAA,CAAC,CAAC,SAAS,CAAC,cAAM,CAAC,OAAO,CAAC,mCAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAM,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"fix-msg-store-record.js","sourceRoot":"","sources":["../../src/store/fix-msg-store-record.ts"],"names":[],"mappings":";;;AAEA,oCAAiC;AAWjC,MAAa,iBAAiB;IAC5B,YAA6B,OAAe,EAC1B,SAAe,EACf,MAAc,EACvB,GAAkB,EACT,OAAuB;QAJZ,YAAO,GAAP,OAAO,CAAQ;QAC1B,cAAS,GAAT,SAAS,CAAM;QACf,WAAM,GAAN,MAAM,CAAQ;QACvB,QAAG,GAAH,GAAG,CAAe;QACT,YAAO,GAAP,OAAO,CAAgB;IACzC,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAE,CAAU;;QACjC,OAAO,IAAI,iBAAiB,CAAC,MAAA,CAAC,CAAC,SAAS,CAAC,cAAM,CAAC,OAAO,CAAC,mCAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAM,CAAC,WAAW,CAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAM,CAAC,SAAS,CAAW,EAAE,CAAC,CAAC,QAAQ,EAAkB,CAAC,CAAA;IAC/K,CAAC;IAED,KAAK;QACH,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACjG,CAAC;CACF;AAfD,8CAeC","sourcesContent":["import { ILooseObject } from '../collections/collection'\r\nimport { MsgView } from '../buffer'\r\nimport { MsgTag } from '../types'\r\n\r\nexport interface IFixMsgStoreRecord {\r\n readonly msgType: string\r\n readonly timestamp: Date\r\n readonly seqNum: number\r\n obj?: ILooseObject | null\r\n readonly encoded?: string | null\r\n clone: () => IFixMsgStoreRecord\r\n}\r\n\r\nexport class FixMsgStoreRecord implements IFixMsgStoreRecord {\r\n constructor (public readonly msgType: string,\r\n public readonly timestamp: Date,\r\n public readonly seqNum: number,\r\n public obj?: ILooseObject,\r\n public readonly encoded?: string | null) {\r\n }\r\n\r\n static toMsgStoreRecord (v: MsgView): IFixMsgStoreRecord {\r\n return new FixMsgStoreRecord(v.getString(MsgTag.MsgType) ?? '', v.getTyped(MsgTag.SendingTime) as Date, v.getTyped(MsgTag.MsgSeqNum) as number, v.toObject() as ILooseObject)\r\n }\r\n\r\n clone (): IFixMsgStoreRecord {\r\n return new FixMsgStoreRecord(this.msgType, this.timestamp, this.seqNum, this.obj, this.encoded)\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-encoder.test.js","sourceRoot":"","sources":["../../../src/test/ascii/ascii-encoder.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAGzB,yCAAmC;AACnC,8CAA4E;AAE5E,0DAcoC;AACpC,uCAAqC;AAErC,sDAAiD;AAEjD,MAAM,aAAa,GAAgB,IAAI,0BAAW,EAAE,CAAA;AAEpD,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,aAAa,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;AACnD,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAChC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;AACxC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,kBAAkB,EAAE,GAAS,EAAE;;IAClC,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAA;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAA;IACtC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAM;IACpB,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAC9D,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;IACxB,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,GAAG,GAAG,aAAa,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAC/C,MAAM,CA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 'reflect-metadata'\r\n\r\nimport { ComponentFieldDefinition } from '../../dictionary/definition'\r\nimport { Tags } from '../../buffer'\r\nimport { AsciiChars, AsciiEncoder, TimeFormatter } from '../../buffer/ascii'\r\nimport { ILooseObject } from '../../collections/collection'\r\nimport {\r\n IInstrument,\r\n INewOrderSingle,\r\n IOrderQtyData,\r\n IStandardHeader,\r\n ITradeCaptureReportRequest,\r\n ITrdCapDtGrpNoDates,\r\n OrdType,\r\n SecurityIDSource,\r\n SecurityType,\r\n Side,\r\n SubscriptionRequestType,\r\n TimeInForce,\r\n TradeRequestType\r\n} from '../../types/FIX4.4/quickfix'\r\nimport { MsgType } from '../../index'\r\nimport { ParsingResult } from '../env/parsing-result'\r\nimport { EncoderTest } from '../env/encoder-test'\r\n\r\nconst encoderTester: EncoderTest = new EncoderTest()\r\n\r\nbeforeAll(async () => {\r\n await encoderTester.init('session/qf-fix44.json')\r\n}, 45000)\r\n\r\ntest('expect a definition ', () => {\r\n expect(encoderTester.nos).toBeTruthy()\r\n})\r\n\r\ntest('encode heartbeat', async () => {\r\n const session = encoderTester.session\r\n const factory = session.config.factory\r\n expect(factory).toBeTruthy()\r\n if (!factory) return\r\n const hb = factory.heartbeat('test01')\r\n const hbd = encoderTester.definitions.message.get('Heartbeat')\r\n expect(hbd).toBeTruthy()\r\n if (!hbd) return\r\n const fix = encoderTester.toFixMessage(hb, hbd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await encoderTester.setup.client.parseText(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual('0')\r\n const len = res.view?.getTyped(Tags.BodyLengthTag)\r\n const expected = fix.length - '8=FIX.4.4|9=0000081|'.length - '10=159|'.length\r\n expect(len).toEqual(expected)\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n PossDupFlag: true\r\n }\r\n }\r\n const hb = encoderTester.definitions.message.get('Heartbeat')\r\n const fix: string = hb ? encoderTester.toFixMessage(no, hb) : ''\r\n expect(fix).toMatch('43=Y|')\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n MsgSeqNum: 9999\r\n }\r\n }\r\n const hb = encoderTester.definitions.message.get('Heartbeat')\r\n const fix: string = hb ? encoderTester.toFixMessage(no, hb) : ''\r\n expect(fix).toMatch('34=9999|')\r\n})\r\n\r\ntest('encode string ClOrdID ', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = 'Order-a'\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('11=Order-a|')\r\n})\r\n\r\ntest('should not encode empty string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = ''\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('should not encode null string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = null\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('encode +ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 100\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=100|')\r\n})\r\n\r\ntest('encode -ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -100\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=-100|')\r\n})\r\n\r\ntest('encode +ve numeric (double 8dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=123.12345678|')\r\n})\r\n\r\ntest('encode +ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678901234\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode -ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -123.12345678901234\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=-123.12345678901234|')\r\n})\r\n\r\ntest('encode +ve string Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = '123.12345678901234'\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode LocalDate TradeDate ', () => {\r\n const no: ILooseObject = {}\r\n no.TradeDate = encoderTester.localDate\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('75=20180725|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime ', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = encoderTester.utcTimeStamp\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('126=20180610-16:35:00.246|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime - check padding', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 1))\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('126=20180101-00:00:00.001|')\r\n})\r\n\r\ntest('encode UTCDATEONLY MDEntryDate', () => {\r\n const mdGrp: ComponentFieldDefinition | null = encoderTester.definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n if (!mdGrp) return\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryDate: encoderTester.utcDate\r\n }\r\n ]\r\n }\r\n const fix: string = encoderTester.toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|272=20180610|')\r\n})\r\n\r\ntest('encode UTCTIMEONLY MDEntryTime', () => {\r\n const mdGrp: ComponentFieldDefinition | null = encoderTester.definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryTime: encoderTester.utcTime\r\n }\r\n ]\r\n }\r\n if (!mdGrp) return\r\n const fix: string = encoderTester.toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|273=16:35:00.246|')\r\n})\r\n\r\nfunction getTCR1 (): ITradeCaptureReportRequest {\r\n const d0 = new Date(Date.UTC(2018, 11, 1, 0, 0, 0))\r\n const d1 = new Date(Date.UTC(2018, 11, 2, 0, 0, 0))\r\n return {\r\n TradeRequestID: 'all-trades',\r\n TradeRequestType: TradeRequestType.AllTrades,\r\n SubscriptionRequestType: SubscriptionRequestType.SnapshotPlusUpdates,\r\n TrdCapDtGrp: {\r\n NoDates: [\r\n {\r\n TransactTime: d0\r\n },\r\n {\r\n TransactTime: d1\r\n }\r\n ] as ITrdCapDtGrpNoDates[]\r\n }\r\n } as ITradeCaptureReportRequest\r\n}\r\n\r\ntest('encode TradeCaptureReportRequest with TransactTime', () => {\r\n const tcr = getTCR1()\r\n const d = encoderTester.definitions.message.get('TradeCaptureReportRequest')\r\n if (!d) return\r\n const fix: string = encoderTester.toFix(tcr, d)\r\n expect(fix).toEqual('568=all-trades|569=0|263=1|580=2|60=20181201-00:00:00.000|60=20181202-00:00:00.000|')\r\n})\r\n\r\ntest('encode BOOLEAN (true) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = true\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (truthy) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 1\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (string) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 'TRUE'\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (false) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = false\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode BOOLEAN (falsy) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 0\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode RawData EncodedText', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const toEncode: string = 'this is fix'\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('354=11|355=this is fix|')\r\n})\r\n\r\ntest('encode empty RawData EncodedText', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const toEncode: string = ''\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('354=0|355=|')\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return {\r\n Parties: {\r\n NoPartyIDs: [\r\n {\r\n PartyID: 'magna.',\r\n PartyIDSource: '9',\r\n PartyRole: 28\r\n },\r\n {\r\n PartyID: 'iaculis',\r\n PartyIDSource: 'F',\r\n PartyRole: 2\r\n }]\r\n }\r\n }\r\n}\r\n\r\nfunction getPartiesNoPartyID (): ILooseObject {\r\n return {\r\n Parties: {\r\n NoPartyIDs: [\r\n {\r\n // missing PartyID\r\n PartyIDSource: '9',\r\n PartyRole: 28\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n\r\ntest('encode repeated group of simple repository Parties', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getParties()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('453=2|448=magna.|447=9|452=28|448=iaculis|447=F|452=2|')\r\n})\r\n\r\ntest('use a carat as log delimiter', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const caratEncoder = new AsciiEncoder(encoderTester.session.buffer, encoderTester.definitions, new TimeFormatter(encoderTester.session.buffer), AsciiChars.Soh, AsciiChars.Carat)\r\n const e: ILooseObject = getParties()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er, caratEncoder)\r\n expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^')\r\n})\r\n\r\ntest('use a carat as log delimiter with Soh in buffer to show encoding still works', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const caratEncoder = new AsciiEncoder(encoderTester.session.buffer, encoderTester.definitions, new TimeFormatter(encoderTester.session.buffer), AsciiChars.Soh, AsciiChars.Carat)\r\n const e: ILooseObject = getParties()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er, caratEncoder)\r\n expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^')\r\n const trimmed = caratEncoder.trim().toString()\r\n expect(trimmed).toEqual('453=2\u0001448=magna.\u0001447=9\u0001452=28\u0001448=iaculis\u0001447=F\u0001452=2\u0001')\r\n})\r\n\r\ntest('encode repeated group with no PartyID - should encode', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getPartiesNoPartyID()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('453=1|447=9|452=28|')\r\n})\r\n\r\ntest('encode repeated group with no array - should throw', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {\r\n Parties: {\r\n NoPartyIDs: 'should be an array'\r\n }\r\n }\r\n function run (): void {\r\n encoderTester.toFix(e, encoderTester.er)\r\n }\r\n expect(run).toThrow(/expected array/)\r\n})\r\n\r\ntest('encode repeated group with empty array', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {\r\n Parties: {\r\n NoPartyIDs: []\r\n }\r\n }\r\n expect(encoderTester.toFix(e, encoderTester.er)).toEqual('453=0|')\r\n})\r\n\r\nfunction getInstrument (): ILooseObject {\r\n return {\r\n Instrument: {\r\n Symbol: 'ac,',\r\n SymbolSfx: 'non',\r\n SecurityID: 'Pellentesque',\r\n SecurityIDSource: 'B',\r\n Product: 2\r\n }\r\n }\r\n}\r\n\r\nfunction getInstrumentNestedGroup (): ILooseObject {\r\n return {\r\n Instrument: {\r\n Symbol: 'ac,',\r\n SymbolSfx: 'non',\r\n SecurityID: 'Pellentesque',\r\n SecurityIDSource: 'B',\r\n SecAltIDGrp: {\r\n NoSecurityAltID: [\r\n {\r\n SecurityAltID: 'lorem',\r\n SecurityAltIDSource: 'consequat'\r\n },\r\n {\r\n SecurityAltID: 'sapien',\r\n SecurityAltIDSource: 'tempor'\r\n }\r\n ]\r\n },\r\n Product: 2\r\n }\r\n }\r\n}\r\n\r\ntest('encode component', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getInstrument()\r\n expect(encoderTester.toFix(e, encoderTester.er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|460=2|')\r\n})\r\n\r\ntest('encode component nested group', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n expect(encoderTester.toFix(e, encoderTester.er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|454=2|455=lorem|456=consequat|455=sapien|456=tempor|460=2|')\r\n})\r\n\r\ntest('encode group missing delimiter', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n delete e.Instrument.SecAltIDGrp.NoSecurityAltID[0].SecurityAltID\r\n function run (): void {\r\n encoderTester.toFix(e, encoderTester.er)\r\n }\r\n expect(run).toThrow(/group instance \\[1] inconsistent delimiter 455 expected tag 456/)\r\n})\r\n\r\ntest('encode group not an array of', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {\r\n Instrument: {\r\n Symbol: 'ac,',\r\n SymbolSfx: 'non',\r\n SecurityID: 'Pellentesque',\r\n SecurityIDSource: 'B',\r\n SecAltIDGrp: {\r\n NoSecurityAltID: {\r\n elements: []\r\n }\r\n },\r\n Product: 2\r\n }\r\n }\r\n function run (): void {\r\n encoderTester.toFix(e, encoderTester.er)\r\n }\r\n expect(run).toThrow(/expected array instance for group NoSecurityAltID/)\r\n})\r\n\r\nfunction getCompID (securityType: SecurityType): string {\r\n switch (securityType) {\r\n case SecurityType.CommonStock: {\r\n return 'DepA'\r\n }\r\n\r\n case SecurityType.CorporateBond: {\r\n return 'DepB'\r\n }\r\n\r\n case SecurityType.ConvertibleBond: {\r\n return 'DepC'\r\n }\r\n\r\n default:\r\n return 'DepD'\r\n }\r\n}\r\n\r\nfunction createOrder (id: number, symbol: string, securityType: SecurityType, side: Side, qty: number, price: number): INewOrderSingle {\r\n return {\r\n StandardHeader: {\r\n DeliverToCompID: getCompID(securityType)\r\n } as IStandardHeader,\r\n ClOrdID: `Cli${id}`,\r\n Account: 'MyAcc',\r\n Side: side,\r\n Price: price,\r\n OrdType: OrdType.Limit,\r\n OrderQtyData: {\r\n OrderQty: qty\r\n } as IOrderQtyData,\r\n Instrument: {\r\n SecurityType: securityType,\r\n Symbol: symbol,\r\n SecurityID: '459200101',\r\n SecurityIDSource: SecurityIDSource.IsinNumber\r\n } as IInstrument,\r\n TimeInForce: TimeInForce.Day\r\n } as INewOrderSingle\r\n}\r\n\r\nasync function getNewOrderSingle (o1: INewOrderSingle): Promise<any> {\r\n const nosd = encoderTester.definitions.message.get('NewOrderSingle')\r\n expect(nosd).toBeTruthy()\r\n if (!nosd) return\r\n const fix = encoderTester.toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await encoderTester.setup.client.parseText(fix)\r\n const tag = res.view?.getTyped('DeliverToCompID')\r\n return { res, tag }\r\n}\r\n\r\ntest('encode custom header 1 - expect DeliverToCompID DepA', async () => {\r\n const type = SecurityType.CommonStock\r\n const o1 = createOrder(1, 'MS', type, Side.Buy, 100, 1000.0)\r\n const { res, tag } = await getNewOrderSingle(o1)\r\n expect(tag).toEqual('DepA')\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view?.toObject()\r\n expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepA')\r\n})\r\n\r\ntest('encode custom header 2 - expect DeliverToCompID DepC', async () => {\r\n const type = SecurityType.ConvertibleBond\r\n const o1 = createOrder(1, 'MSCb', type, Side.Buy, 100, 1000.0)\r\n const { res, tag } = await getNewOrderSingle(o1)\r\n expect(tag).toEqual('DepC')\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view?.toObject()\r\n expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepC')\r\n})\r\n\r\ntest('encode custom header - include MsgSeqNum (for resends we do not want to overwrite)', async () => {\r\n const type = SecurityType.ConvertibleBond\r\n const seqNum: number = 10\r\n const o1 = createOrder(1, 'MSCb', type, Side.Buy, 100, 1000.0)\r\n o1.StandardHeader.MsgSeqNum = seqNum\r\n o1.StandardHeader.PossDupFlag = true\r\n const nosd = encoderTester.definitions.message.get('NewOrderSingle')\r\n expect(nosd).toBeTruthy()\r\n if (!nosd) return\r\n const fix = encoderTester.toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await encoderTester.setup.client.parseText(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view?.toObject() as INewOrderSingle\r\n const h: IStandardHeader = parsed.StandardHeader\r\n expect(h.DeliverToCompID).toEqual('DepC')\r\n expect(h.MsgSeqNum).toEqual(seqNum)\r\n expect(h.BeginString).toEqual('FIX.4.4')\r\n expect(h.PossDupFlag).toEqual(true)\r\n expect(h.MsgType).toEqual(MsgType.NewOrderSingle)\r\n})\r\n"]}
|
|
1
|
+
{"version":3,"file":"ascii-encoder.test.js","sourceRoot":"","sources":["../../../src/test/ascii/ascii-encoder.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAGzB,yCAAmC;AACnC,8CAA4E;AAE5E,0DAcoC;AACpC,uCAAqC;AAErC,sDAAiD;AAEjD,MAAM,aAAa,GAAgB,IAAI,0BAAW,EAAE,CAAA;AAEpD,SAAS,CAAC,GAAS,EAAE;IACnB,MAAM,aAAa,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;AACnD,CAAC,CAAA,EAAE,KAAK,CAAC,CAAA;AAET,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAChC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;AACxC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,kBAAkB,EAAE,GAAS,EAAE;;IAClC,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAA;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAA;IACtC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAM;IACpB,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAC9D,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAA;IACxB,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,GAAG,GAAG,aAAa,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,E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entFieldDefinition } from '../../dictionary/definition'\r\nimport { Tags } from '../../buffer'\r\nimport { AsciiChars, AsciiEncoder, TimeFormatter } from '../../buffer/ascii'\r\nimport { ILooseObject } from '../../collections/collection'\r\nimport {\r\n IInstrument,\r\n INewOrderSingle,\r\n IOrderQtyData,\r\n IStandardHeader,\r\n ITradeCaptureReportRequest,\r\n ITrdCapDtGrpNoDates,\r\n OrdType,\r\n SecurityIDSource,\r\n SecurityType,\r\n Side,\r\n SubscriptionRequestType,\r\n TimeInForce,\r\n TradeRequestType\r\n} from '../../types/FIX4.4/quickfix'\r\nimport { MsgType } from '../../index'\r\nimport { ParsingResult } from '../env/parsing-result'\r\nimport { EncoderTest } from '../env/encoder-test'\r\n\r\nconst encoderTester: EncoderTest = new EncoderTest()\r\n\r\nbeforeAll(async () => {\r\n await encoderTester.init('session/qf-fix44.json')\r\n}, 45000)\r\n\r\ntest('expect a definition ', () => {\r\n expect(encoderTester.nos).toBeTruthy()\r\n})\r\n\r\ntest('encode heartbeat', async () => {\r\n const session = encoderTester.session\r\n const factory = session.config.factory\r\n expect(factory).toBeTruthy()\r\n if (!factory) return\r\n const hb = factory.heartbeat('test01')\r\n const hbd = encoderTester.definitions.message.get('Heartbeat')\r\n expect(hbd).toBeTruthy()\r\n if (!hbd) return\r\n const fix = encoderTester.toFixMessage(hb, hbd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await encoderTester.setup.client.parseText(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual('0')\r\n const len = res.view?.getTyped(Tags.BodyLengthTag)\r\n const expected = fix.length - '8=FIX.4.4|9=0000081|'.length - '10=159|'.length\r\n expect(len).toEqual(expected)\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n PossDupFlag: true\r\n }\r\n }\r\n const hb = encoderTester.definitions.message.get('Heartbeat')\r\n const fix: string = hb ? encoderTester.toFixMessage(no, hb) : ''\r\n expect(fix).toMatch('43=Y|')\r\n})\r\n\r\ntest('encode custom header PossDupFlag', () => {\r\n const no: ILooseObject = {\r\n StandardHeader: {\r\n MsgSeqNum: 9999\r\n }\r\n }\r\n const hb = encoderTester.definitions.message.get('Heartbeat')\r\n const fix: string = hb ? encoderTester.toFixMessage(no, hb) : ''\r\n expect(fix).toMatch('34=9999|')\r\n})\r\n\r\ntest('encode string ClOrdID ', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = 'Order-a'\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('11=Order-a|')\r\n})\r\n\r\ntest('should not encode empty string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = ''\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('should not encode null string', () => {\r\n const no: ILooseObject = {}\r\n no.ClOrdID = null\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('')\r\n})\r\n\r\ntest('encode +ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 100\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=100|')\r\n})\r\n\r\ntest('encode -ve numeric (int) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -100\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=-100|')\r\n})\r\n\r\ntest('encode +ve numeric (double 8dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=123.12345678|')\r\n})\r\n\r\ntest('encode +ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = 123.12345678901234\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode -ve numeric (double 14dp) Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = -123.12345678901234\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=-123.12345678901234|')\r\n})\r\n\r\ntest('encode +ve string Price ', () => {\r\n const no: ILooseObject = {}\r\n no.Price = '123.12345678901234'\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('44=123.12345678901234|')\r\n})\r\n\r\ntest('encode LocalDate TradeDate ', () => {\r\n const no: ILooseObject = {}\r\n no.TradeDate = encoderTester.localDate\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('75=20180725|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime ', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = encoderTester.utcTimeStamp\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('126=20180610-16:35:00.246|')\r\n})\r\n\r\ntest('encode UTCTIMESTAMP ExpireTime - check padding', () => {\r\n const no: ILooseObject = {}\r\n no.ExpireTime = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 1))\r\n const fix: string = encoderTester.toFix(no)\r\n expect(fix).toEqual('126=20180101-00:00:00.001|')\r\n})\r\n\r\ntest('encode UTCDATEONLY MDEntryDate', () => {\r\n const mdGrp: ComponentFieldDefinition | undefined = encoderTester.definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n if (!mdGrp) return\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryDate: encoderTester.utcDate\r\n }\r\n ]\r\n }\r\n const fix: string = encoderTester.toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|272=20180610|')\r\n})\r\n\r\ntest('encode UTCTIMEONLY MDEntryTime', () => {\r\n const mdGrp: ComponentFieldDefinition | undefined = encoderTester.definitions.component.get('MDFullGrp')\r\n expect(mdGrp).toBeTruthy()\r\n const grp: ILooseObject = {\r\n NoMDEntries: [\r\n {\r\n MDEntryType: '0',\r\n MDEntryTime: encoderTester.utcTime\r\n }\r\n ]\r\n }\r\n if (!mdGrp) return\r\n const fix: string = encoderTester.toFix(grp, mdGrp)\r\n expect(fix).toEqual('268=1|269=0|273=16:35:00.246|')\r\n})\r\n\r\nfunction getTCR1 (): ITradeCaptureReportRequest {\r\n const d0 = new Date(Date.UTC(2018, 11, 1, 0, 0, 0))\r\n const d1 = new Date(Date.UTC(2018, 11, 2, 0, 0, 0))\r\n return {\r\n TradeRequestID: 'all-trades',\r\n TradeRequestType: TradeRequestType.AllTrades,\r\n SubscriptionRequestType: SubscriptionRequestType.SnapshotPlusUpdates,\r\n TrdCapDtGrp: {\r\n NoDates: [\r\n {\r\n TransactTime: d0\r\n },\r\n {\r\n TransactTime: d1\r\n }\r\n ] as ITrdCapDtGrpNoDates[]\r\n }\r\n } as ITradeCaptureReportRequest\r\n}\r\n\r\ntest('encode TradeCaptureReportRequest with TransactTime', () => {\r\n const tcr = getTCR1()\r\n const d = encoderTester.definitions.message.get('TradeCaptureReportRequest')\r\n if (!d) return\r\n const fix: string = encoderTester.toFix(tcr, d)\r\n expect(fix).toEqual('568=all-trades|569=0|263=1|580=2|60=20181201-00:00:00.000|60=20181202-00:00:00.000|')\r\n})\r\n\r\ntest('encode BOOLEAN (true) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = true\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (truthy) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 1\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (string) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 'TRUE'\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=Y|')\r\n})\r\n\r\ntest('encode BOOLEAN (false) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = false\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode BOOLEAN (falsy) ReportToExch', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {}\r\n e.ReportToExch = 0\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('113=N|')\r\n})\r\n\r\ntest('encode RawData EncodedText', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const toEncode: string = 'this is fix'\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('354=11|355=this is fix|')\r\n})\r\n\r\ntest('encode empty RawData EncodedText', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const toEncode: string = ''\r\n const e: ILooseObject = {\r\n EncodedText: Buffer.alloc(toEncode.length, toEncode, 'utf8')\r\n }\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('354=0|355=|')\r\n})\r\n\r\nfunction getParties (): ILooseObject {\r\n return {\r\n Parties: {\r\n NoPartyIDs: [\r\n {\r\n PartyID: 'magna.',\r\n PartyIDSource: '9',\r\n PartyRole: 28\r\n },\r\n {\r\n PartyID: 'iaculis',\r\n PartyIDSource: 'F',\r\n PartyRole: 2\r\n }]\r\n }\r\n }\r\n}\r\n\r\nfunction getPartiesNoPartyID (): ILooseObject {\r\n return {\r\n Parties: {\r\n NoPartyIDs: [\r\n {\r\n // missing PartyID\r\n PartyIDSource: '9',\r\n PartyRole: 28\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n\r\ntest('encode repeated group of simple repository Parties', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getParties()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('453=2|448=magna.|447=9|452=28|448=iaculis|447=F|452=2|')\r\n})\r\n\r\ntest('use a carat as log delimiter', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const caratEncoder = new AsciiEncoder(encoderTester.session.buffer, encoderTester.definitions, new TimeFormatter(encoderTester.session.buffer), AsciiChars.Soh, AsciiChars.Carat)\r\n const e: ILooseObject = getParties()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er, caratEncoder)\r\n expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^')\r\n})\r\n\r\ntest('use a carat as log delimiter with Soh in buffer to show encoding still works', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const caratEncoder = new AsciiEncoder(encoderTester.session.buffer, encoderTester.definitions, new TimeFormatter(encoderTester.session.buffer), AsciiChars.Soh, AsciiChars.Carat)\r\n const e: ILooseObject = getParties()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er, caratEncoder)\r\n expect(fix).toEqual('453=2^448=magna.^447=9^452=28^448=iaculis^447=F^452=2^')\r\n const trimmed = caratEncoder.trim().toString()\r\n expect(trimmed).toEqual('453=2\u0001448=magna.\u0001447=9\u0001452=28\u0001448=iaculis\u0001447=F\u0001452=2\u0001')\r\n})\r\n\r\ntest('encode repeated group with no PartyID - should encode', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getPartiesNoPartyID()\r\n const fix: string = encoderTester.toFix(e, encoderTester.er)\r\n expect(fix).toEqual('453=1|447=9|452=28|')\r\n})\r\n\r\ntest('encode repeated group with no array - should throw', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {\r\n Parties: {\r\n NoPartyIDs: 'should be an array'\r\n }\r\n }\r\n function run (): void {\r\n encoderTester.toFix(e, encoderTester.er)\r\n }\r\n expect(run).toThrow(/expected array/)\r\n})\r\n\r\ntest('encode repeated group with empty array', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {\r\n Parties: {\r\n NoPartyIDs: []\r\n }\r\n }\r\n expect(encoderTester.toFix(e, encoderTester.er)).toEqual('453=0|')\r\n})\r\n\r\nfunction getInstrument (): ILooseObject {\r\n return {\r\n Instrument: {\r\n Symbol: 'ac,',\r\n SymbolSfx: 'non',\r\n SecurityID: 'Pellentesque',\r\n SecurityIDSource: 'B',\r\n Product: 2\r\n }\r\n }\r\n}\r\n\r\nfunction getInstrumentNestedGroup (): ILooseObject {\r\n return {\r\n Instrument: {\r\n Symbol: 'ac,',\r\n SymbolSfx: 'non',\r\n SecurityID: 'Pellentesque',\r\n SecurityIDSource: 'B',\r\n SecAltIDGrp: {\r\n NoSecurityAltID: [\r\n {\r\n SecurityAltID: 'lorem',\r\n SecurityAltIDSource: 'consequat'\r\n },\r\n {\r\n SecurityAltID: 'sapien',\r\n SecurityAltIDSource: 'tempor'\r\n }\r\n ]\r\n },\r\n Product: 2\r\n }\r\n }\r\n}\r\n\r\ntest('encode component', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getInstrument()\r\n expect(encoderTester.toFix(e, encoderTester.er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|460=2|')\r\n})\r\n\r\ntest('encode component nested group', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n expect(encoderTester.toFix(e, encoderTester.er)).toEqual('55=ac,|65=non|48=Pellentesque|22=B|454=2|455=lorem|456=consequat|455=sapien|456=tempor|460=2|')\r\n})\r\n\r\ntest('encode group missing delimiter', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = getInstrumentNestedGroup()\r\n delete e.Instrument.SecAltIDGrp.NoSecurityAltID[0].SecurityAltID\r\n function run (): void {\r\n encoderTester.toFix(e, encoderTester.er)\r\n }\r\n expect(run).toThrow(/group instance \\[1] inconsistent delimiter 455 expected tag 456/)\r\n})\r\n\r\ntest('encode group not an array of', () => {\r\n expect(encoderTester.er).toBeTruthy()\r\n const e: ILooseObject = {\r\n Instrument: {\r\n Symbol: 'ac,',\r\n SymbolSfx: 'non',\r\n SecurityID: 'Pellentesque',\r\n SecurityIDSource: 'B',\r\n SecAltIDGrp: {\r\n NoSecurityAltID: {\r\n elements: []\r\n }\r\n },\r\n Product: 2\r\n }\r\n }\r\n function run (): void {\r\n encoderTester.toFix(e, encoderTester.er)\r\n }\r\n expect(run).toThrow(/expected array instance for group NoSecurityAltID/)\r\n})\r\n\r\nfunction getCompID (securityType: SecurityType): string {\r\n switch (securityType) {\r\n case SecurityType.CommonStock: {\r\n return 'DepA'\r\n }\r\n\r\n case SecurityType.CorporateBond: {\r\n return 'DepB'\r\n }\r\n\r\n case SecurityType.ConvertibleBond: {\r\n return 'DepC'\r\n }\r\n\r\n default:\r\n return 'DepD'\r\n }\r\n}\r\n\r\nfunction createOrder (id: number, symbol: string, securityType: SecurityType, side: Side, qty: number, price: number): INewOrderSingle {\r\n return {\r\n StandardHeader: {\r\n DeliverToCompID: getCompID(securityType)\r\n } as IStandardHeader,\r\n ClOrdID: `Cli${id}`,\r\n Account: 'MyAcc',\r\n Side: side,\r\n Price: price,\r\n OrdType: OrdType.Limit,\r\n OrderQtyData: {\r\n OrderQty: qty\r\n } as IOrderQtyData,\r\n Instrument: {\r\n SecurityType: securityType,\r\n Symbol: symbol,\r\n SecurityID: '459200101',\r\n SecurityIDSource: SecurityIDSource.IsinNumber\r\n } as IInstrument,\r\n TimeInForce: TimeInForce.Day\r\n } as INewOrderSingle\r\n}\r\n\r\nasync function getNewOrderSingle (o1: INewOrderSingle): Promise<any> {\r\n const nosd = encoderTester.definitions.message.get('NewOrderSingle')\r\n expect(nosd).toBeTruthy()\r\n if (!nosd) return\r\n const fix = encoderTester.toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await encoderTester.setup.client.parseText(fix)\r\n const tag = res.view?.getTyped('DeliverToCompID')\r\n return { res, tag }\r\n}\r\n\r\ntest('encode custom header 1 - expect DeliverToCompID DepA', async () => {\r\n const type = SecurityType.CommonStock\r\n const o1 = createOrder(1, 'MS', type, Side.Buy, 100, 1000.0)\r\n const { res, tag } = await getNewOrderSingle(o1)\r\n expect(tag).toEqual('DepA')\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view?.toObject()\r\n expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepA')\r\n})\r\n\r\ntest('encode custom header 2 - expect DeliverToCompID DepC', async () => {\r\n const type = SecurityType.ConvertibleBond\r\n const o1 = createOrder(1, 'MSCb', type, Side.Buy, 100, 1000.0)\r\n const { res, tag } = await getNewOrderSingle(o1)\r\n expect(tag).toEqual('DepC')\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view?.toObject()\r\n expect(parsed.StandardHeader.DeliverToCompID).toEqual('DepC')\r\n})\r\n\r\ntest('encode custom header - include MsgSeqNum (for resends we do not want to overwrite)', async () => {\r\n const type = SecurityType.ConvertibleBond\r\n const seqNum: number = 10\r\n const o1 = createOrder(1, 'MSCb', type, Side.Buy, 100, 1000.0)\r\n o1.StandardHeader.MsgSeqNum = seqNum\r\n o1.StandardHeader.PossDupFlag = true\r\n const nosd = encoderTester.definitions.message.get('NewOrderSingle')\r\n expect(nosd).toBeTruthy()\r\n if (!nosd) return\r\n const fix = encoderTester.toFixMessage(o1, nosd)\r\n expect(fix).toBeTruthy()\r\n const res: ParsingResult = await encoderTester.setup.client.parseText(fix)\r\n expect(res.event).toEqual('msg')\r\n expect(res.msgType).toEqual(MsgType.NewOrderSingle)\r\n const parsed: INewOrderSingle = res.view?.toObject() as INewOrderSingle\r\n const h: IStandardHeader = parsed.StandardHeader\r\n expect(h.DeliverToCompID).toEqual('DepC')\r\n expect(h.MsgSeqNum).toEqual(seqNum)\r\n expect(h.BeginString).toEqual('FIX.4.4')\r\n expect(h.PossDupFlag).toEqual(true)\r\n expect(h.MsgType).toEqual(MsgType.NewOrderSingle)\r\n})\r\n"]}
|
|
@@ -42,6 +42,7 @@ test('client store states', () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
42
42
|
expect(s1.length).toEqual(1);
|
|
43
43
|
}));
|
|
44
44
|
test('server replay request from seq=1 to seq=10', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
45
46
|
const vec = yield server.recovery.getResendRequest(1, 10);
|
|
46
47
|
expect(vec).toBeTruthy();
|
|
47
48
|
expect(Array.isArray(vec));
|
|
@@ -49,18 +50,27 @@ test('server replay request from seq=1 to seq=10', () => __awaiter(void 0, void
|
|
|
49
50
|
checkSeqReset(vec[0], 1, 2);
|
|
50
51
|
expect(vec[1].msgType).toEqual(types_1.MsgType.TradeCaptureReportRequestAck);
|
|
51
52
|
expect(vec[1].seqNum).toEqual(2);
|
|
53
|
+
expect((_b = (_a = vec[1].obj) === null || _a === void 0 ? void 0 : _a.StandardHeader) === null || _b === void 0 ? void 0 : _b.PossDupFlag).toBeTruthy();
|
|
54
|
+
expect((_d = (_c = vec[1].obj) === null || _c === void 0 ? void 0 : _c.StandardHeader) === null || _d === void 0 ? void 0 : _d.OrigSendingTime).toBeDefined();
|
|
52
55
|
for (let i = 2; i <= 6; ++i) {
|
|
53
56
|
expect(vec[i].msgType).toEqual(types_1.MsgType.TradeCaptureReport);
|
|
54
57
|
expect(vec[i].seqNum).toEqual(i + 1);
|
|
58
|
+
expect((_f = (_e = vec[i].obj) === null || _e === void 0 ? void 0 : _e.StandardHeader) === null || _f === void 0 ? void 0 : _f.PossDupFlag).toBeTruthy();
|
|
59
|
+
expect((_h = (_g = vec[i].obj) === null || _g === void 0 ? void 0 : _g.StandardHeader) === null || _h === void 0 ? void 0 : _h.OrigSendingTime).toBeDefined();
|
|
55
60
|
}
|
|
56
61
|
expect(vec[7].msgType).toEqual(types_1.MsgType.TradeCaptureReportRequestAck);
|
|
57
62
|
expect(vec[7].seqNum).toEqual(8);
|
|
63
|
+
expect((_k = (_j = vec[7].obj) === null || _j === void 0 ? void 0 : _j.StandardHeader) === null || _k === void 0 ? void 0 : _k.PossDupFlag).toBeTruthy();
|
|
64
|
+
expect((_m = (_l = vec[7].obj) === null || _l === void 0 ? void 0 : _l.StandardHeader) === null || _m === void 0 ? void 0 : _m.OrigSendingTime).toBeDefined();
|
|
58
65
|
for (let i = 8; i < 10; ++i) {
|
|
59
66
|
expect(vec[i].msgType).toEqual(types_1.MsgType.TradeCaptureReport);
|
|
60
67
|
expect(vec[i].seqNum).toEqual(i + 1);
|
|
68
|
+
expect((_p = (_o = vec[1].obj) === null || _o === void 0 ? void 0 : _o.StandardHeader) === null || _p === void 0 ? void 0 : _p.PossDupFlag).toBeTruthy();
|
|
69
|
+
expect((_r = (_q = vec[i].obj) === null || _q === void 0 ? void 0 : _q.StandardHeader) === null || _r === void 0 ? void 0 : _r.OrigSendingTime).toBeDefined();
|
|
61
70
|
}
|
|
62
71
|
}));
|
|
63
72
|
test('client replay request from seq=1 to seq=10', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
+
var _s, _t, _u, _v;
|
|
64
74
|
const vec = yield client.recovery.getResendRequest(1, 10);
|
|
65
75
|
expect(vec).toBeTruthy();
|
|
66
76
|
expect(Array.isArray(vec));
|
|
@@ -68,13 +78,16 @@ test('client replay request from seq=1 to seq=10', () => __awaiter(void 0, void
|
|
|
68
78
|
checkSeqReset(vec[0], 1, 2);
|
|
69
79
|
expect(vec[1].msgType).toEqual(types_1.MsgType.TradeCaptureReportRequest);
|
|
70
80
|
expect(vec[1].seqNum).toEqual(2);
|
|
81
|
+
expect((_t = (_s = vec[1].obj) === null || _s === void 0 ? void 0 : _s.StandardHeader) === null || _t === void 0 ? void 0 : _t.PossDupFlag).toBeTruthy();
|
|
82
|
+
expect((_v = (_u = vec[1].obj) === null || _u === void 0 ? void 0 : _u.StandardHeader) === null || _v === void 0 ? void 0 : _v.OrigSendingTime).toBeDefined();
|
|
71
83
|
checkSeqReset(vec[2], 3, 11);
|
|
72
84
|
}));
|
|
73
85
|
function checkSeqReset(rec, from, to) {
|
|
74
86
|
const reset = rec.obj;
|
|
75
87
|
expect(rec.msgType).toEqual(types_1.MsgType.SequenceReset);
|
|
76
88
|
expect(rec.obj).toBeTruthy();
|
|
77
|
-
expect(rec.seqNum).toEqual(
|
|
89
|
+
expect(rec.seqNum).toEqual(from);
|
|
90
|
+
expect(reset.NewSeqNo).toEqual(to);
|
|
78
91
|
expect(reset.GapFillFlag).toBeTruthy();
|
|
79
92
|
expect(reset.StandardHeader.MsgType).toEqual(types_1.MsgType.SequenceReset);
|
|
80
93
|
expect(reset.StandardHeader.PossDupFlag).toBeTruthy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii-store-replay.test.js","sourceRoot":"","sources":["../../../src/test/ascii/ascii-store-replay.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,6BAA4B;AAK5B,uCAAqC;AAGrC,wCAAoC;AACpC,wDAAmD;AAEnD,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;AAE1D,IAAI,MAAoB,CAAA;AACxB,IAAI,MAAoB,CAAA;AACxB,IAAI,KAAY,CAAA;AAEhB,SAAS,CAAC,GAAS,EAAE;IACnB,KAAK,GAAG,IAAI,aAAK,CACf,6BAA6B,EAC7B,4BAA4B,CAAC,CAAA;IAC/B,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;IAClB,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACvC,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IA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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\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 server: TestRecovery\r\nlet client: TestRecovery\r\nlet setup: Setup\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup(\r\n 'session/test-initiator.json',\r\n 'session/test-acceptor.json')\r\n await setup.init()\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): void {\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/ascii-store-replay.test.ts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AC,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\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 server: TestRecovery\r\nlet client: TestRecovery\r\nlet setup: Setup\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup(\r\n 'session/test-initiator.json',\r\n 'session/test-acceptor.json')\r\n await setup.init()\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 expect(vec[1].obj?.StandardHeader?.PossDupFlag).toBeTruthy()\r\n expect(vec[1].obj?.StandardHeader?.OrigSendingTime).toBeDefined()\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 expect(vec[i].obj?.StandardHeader?.PossDupFlag).toBeTruthy()\r\n expect(vec[i].obj?.StandardHeader?.OrigSendingTime).toBeDefined()\r\n }\r\n\r\n expect(vec[7].msgType).toEqual(MsgType.TradeCaptureReportRequestAck)\r\n expect(vec[7].seqNum).toEqual(8)\r\n expect(vec[7].obj?.StandardHeader?.PossDupFlag).toBeTruthy()\r\n expect(vec[7].obj?.StandardHeader?.OrigSendingTime).toBeDefined()\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 expect(vec[1].obj?.StandardHeader?.PossDupFlag).toBeTruthy()\r\n expect(vec[i].obj?.StandardHeader?.OrigSendingTime).toBeDefined()\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 expect(vec[1].obj?.StandardHeader?.PossDupFlag).toBeTruthy()\r\n expect(vec[1].obj?.StandardHeader?.OrigSendingTime).toBeDefined()\r\n\r\n checkSeqReset(vec[2], 3, 11)\r\n})\r\n\r\nfunction checkSeqReset (rec: IFixMsgStoreRecord, from: number, to: number): void {\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(from)\r\n expect(reset.NewSeqNo).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
|
-
{"version":3,"file":"fix-log-replay.test.js","sourceRoot":"","sources":["../../../src/test/ascii/fix-log-replay.test.ts"],"names":[],"mappings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AC,OAAO,CAAC,QAAQ,CAAC,CAAA;AAClC,CAAC,CAAC,CAAA","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { FixDefinitions, MessageDefinition } from '../../dictionary/definition'\r\nimport { MsgView } from '../../buffer'\r\nimport { ILooseObject } from '../../collections/collection'\r\nimport { Setup } from '../env/setup'\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 setup: Setup\r\n\r\nbeforeAll(async () => {\r\n setup = new Setup('session/test-initiator.json', null)\r\n await setup.init()\r\n definitions = setup.client.config.definitions\r\n expected = require(path.join(root, 'examples/FIX.4.4/fix.json'))\r\n views = await setup.client.getViews()\r\n}, 45000)\r\n\r\ntest('expect 50 messages in log', () => {\r\n expect(views.length).toEqual(50)\r\n})\r\n\r\ntest('expect 50 messages of specific types in log', () => {\r\n const layout = views.reduce<ILooseObject>((a: ILooseObject, latest: MsgView) => {\r\n const def: MessageDefinition | undefined = definitions.message.get(latest.segment.name)\r\n if (def) {\r\n let lookup = a[def.msgType]\r\n if (!lookup) {\r\n lookup = 1\r\n } else {\r\n lookup++\r\n }\r\n a[def.msgType] = lookup\r\n }\r\n return a\r\n }, {})\r\n expect(layout).toEqual(expected)\r\n})\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-repo-dict.test.js","sourceRoot":"","sources":["../../../src/test/ascii/fix-repo-dict.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,6BAA4B;AAG5B,qCAA8C;AAC9C,0DAAkF;AAClF,wEAAkE;AAElE,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;AAE1D,IAAI,WAA2B,CAAA;AAC/B,IAAI,SAA8B,CAAA;AAElC,SAAS,CAAC,GAAS,EAAE;;IACnB,MAAM,kBAAkB,GAAwB,O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A;IACpD,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAA;AAChE,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;IACzC,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAA;IAC1B,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;IAC7B,KAAK,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAA;AACnC,CAAC,CAAC,CAAA;AAEF,SAAS,KAAK,CAAE,GAA+B,EAAE,IAAY;;IAC3D,MAAM,KAAK,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACnC,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAA;IAC1B,MAAM,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,CAAC,CAAC,UAAU,EAAE,CAAA;IACrC,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,eAAe,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAA;AACjE,CAAC","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { FixDefinitions } from '../../dictionary/definition'\r\nimport { ISessionDescription } from '../../transport'\r\nimport { DefinitionFactory } from '../../util'\r\nimport { ContainedFieldSet, ContainedFieldType } from '../../dictionary/contained'\r\nimport { SetConstraintHelper } from '../env/set-constraint-helper'\r\n\r\nconst root: string = path.join(__dirname, '../../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet setHelper: SetConstraintHelper\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/test-initiator.json'))\r\n definitions = await new DefinitionFactory().getDefinitions(sessionDescription?.application?.dictionary ?? '')\r\n setHelper = new SetConstraintHelper(definitions)\r\n}, 45000)\r\n// eslint-disable no-tabs\r\n/*\r\n<Field added=\"FIX.2.7\">\r\n <Tag>1</Tag>\r\n <Name>Account</Name>\r\n <Type>String</Type>\r\n <AbbrName>Acct</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Account mnemonic as agreed between buy and sell sides, e.g. broker and institution or investor/intermediary and fund manager.</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>15</Tag>\r\n <Name>Currency</Name>\r\n <Type>Currency</Type>\r\n <AbbrName>Ccy</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <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 </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 <Field added=\"FIX.2.7\">\r\n <Tag>35</Tag>\r\n <Name>MsgType</Name>\r\n <Type>String</Type>\r\n <AbbrName>MsgTyp</AbbrName>\r\n <NotReqXML>1</NotReqXML>\r\n <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 </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 <Field added=\"FIX.2.7\">\r\n <Tag>54</Tag>\r\n <Name>Side</Name>\r\n <Type>char</Type>\r\n <AbbrName>Side</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Side of order</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>99</Tag>\r\n <Name>StopPx</Name>\r\n <Type>Price</Type>\r\n <AbbrName>StopPx</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Price per unit of quantity (e.g. per share)</Description>\r\n </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 <Field added=\"FIX.3.0\">\r\n <Tag>113</Tag>\r\n <Name>ReportToExch</Name>\r\n <Type>Boolean</Type>\r\n <AbbrName>RptToExch</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Identifies party of trade responsible for exchange reporting.</Description>\r\n </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 <Field added=\"FIX.4.0\">\r\n <Tag>119</Tag>\r\n <Name>SettlCurrAmt</Name>\r\n <Type>Amt</Type>\r\n <AbbrName>SettlCurrAmt</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Total amount due expressed in settlement currency (includes the effect of the forex transaction)</Description>\r\n </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 <Field added=\"FIX.4.0\">\r\n <Tag>135</Tag>\r\n <Name>OfferSize</Name>\r\n <Type>Qty</Type>\r\n <AbbrName>OfrSz</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Quantity of offer\r\n(Prior to FIX 4.2 this field was of type int)</Description>\r\n </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 <Field added=\"FIX.4.1\">\r\n <Tag>168</Tag>\r\n <Name>EffectiveTime</Name>\r\n <Type>UTCTimestamp</Type>\r\n <AbbrName>EfctvTm</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Time the details within the message should take effect (always expressed in UTC (Universal Time Coordinated, also known as \"GMT\")</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>95</Tag>\r\n <Name>RawDataLength</Name>\r\n <Type>Length</Type>\r\n <AssociatedDataTag>96</AssociatedDataTag>\r\n <AbbrName>RawDataLength</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Number of bytes in raw data field.</Description>\r\n </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('length')\r\n})\r\n\r\n/*\r\n <Field added=\"FIX.2.7\">\r\n <Tag>96</Tag>\r\n <Name>RawData</Name>\r\n <Type>data</Type>\r\n <AbbrName>RawData</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Unformatted raw data, can include bitmaps, word processor documents, etc.</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>100</Tag>\r\n <Name>ExDestination</Name>\r\n <Type>Exchange</Type>\r\n <AbbrName>ExDest</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Execution destination as defined by institution when order is entered.\r\nValid values:\r\nSee \"Appendix 6-C\"</Description>\r\n</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\r\n/*\r\n StandardHeader: IStandardHeader// [1] BeginString.8, BodyLength.9 .. HopRefID.630\r\n EmailThreadID: string// [2] 164 (String)\r\n EmailType: string// [3] 94 (String)\r\n OrigTime?: Date// [4] 42 (UtcTimestamp)\r\n Subject: string// [5] 147 (String)\r\n EncodedSubjectLen?: number// [6] 356 (Int)\r\n EncodedSubject?: Buffer// [7] 357 (RawData)\r\n RoutingGrp?: IRoutingGrp[]// [8] RoutingType.216, RoutingID.217\r\n InstrmtGrp?: IInstrmtGrp[]// [9] Symbol.55, SymbolSfx.65 .. InterestAccrualDate.874\r\n UndInstrmtGrp?: IUndInstrmtGrp[]// [10] UnderlyingSymbol.311, UnderlyingSymbolSfx.312 .. UnderlyingStipValue.889\r\n InstrmtLegGrp?: IInstrmtLegGrp[]// [11] LegSymbol.600, LegSymbolSfx.601 .. LegInterestAccrualDate.956\r\n OrderID?: string// [12] 37 (String)\r\n ClOrdID?: string// [13] 11 (String)\r\n LinesOfTextGrp: ILinesOfTextGrp[]// [14] Text.58, EncodedTextLen.354, EncodedText.355\r\n RawDataLength?: number// [15] 95 (Int)\r\n RawData?: Buffer// [16] 96 (RawData)\r\n StandardTrailer: IStandardTrailer// [17] SignatureLength.93, Signature.89, CheckSum.10\r\n */\r\ntest('message check Email', () => {\r\n const email = definitions.message.get('Email')\r\n expect(email).toBeTruthy()\r\n let index = 0\r\n setHelper.isComponent(email, index++, 'StandardHeader', true)\r\n setHelper.isSimple(email, index++, 'EmailThreadID', true)\r\n setHelper.isSimple(email, index++, 'EmailType', true)\r\n setHelper.isSimple(email, index++, 'OrigTime', false)\r\n setHelper.isSimple(email, index++, 'Subject', true)\r\n setHelper.isSimple(email, index++, 'EncodedSubjectLen', false)\r\n setHelper.isSimple(email, index++, 'EncodedSubject', false)\r\n setHelper.isGroup(email, index++, 'RoutingGrp', false)\r\n setHelper.isGroup(email, index++, 'InstrmtGrp', false)\r\n setHelper.isGroup(email, index++, 'UndInstrmtGrp', false)\r\n setHelper.isGroup(email, index++, 'InstrmtLegGrp', false)\r\n setHelper.isSimple(email, index++, 'OrderID', false)\r\n setHelper.isSimple(email, index++, 'ClOrdID', false)\r\n setHelper.isGroup(email, index++, 'LinesOfTextGrp', true)\r\n setHelper.isSimple(email, index++, 'RawDataLength', false)\r\n setHelper.isSimple(email, index++, 'RawData', false)\r\n setHelper.isComponent(email, index++, 'StandardTrailer', true)\r\n})\r\n\r\ntest('message check Email rawfields', () => {\r\n const email = definitions.message.get('Email')\r\n expect(email).toBeTruthy()\r\n isRaw(email, 'RawDataLength')\r\n isRaw(email, 'EncodedSubjectLen')\r\n})\r\n\r\nfunction isRaw (set: (ContainedFieldSet | null), name: string): void {\r\n const field = set?.simple.get(name)\r\n expect(field).toBeTruthy()\r\n expect(set?.containsRaw).toBeTruthy()\r\n const masterDef = definitions.simple.get(name)\r\n expect(set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9C,MAAM,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,eAAe,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAA;AACjE,CAAC","sourcesContent":["import 'reflect-metadata'\r\n\r\nimport * as path from 'path'\r\nimport { FixDefinitions } from '../../dictionary/definition'\r\nimport { ISessionDescription } from '../../transport'\r\nimport { DefinitionFactory } from '../../util'\r\nimport { IContainedSet, ContainedFieldType } from '../../dictionary/contained'\r\nimport { SetConstraintHelper } from '../env/set-constraint-helper'\r\n\r\nconst root: string = path.join(__dirname, '../../../data')\r\n\r\nlet definitions: FixDefinitions\r\nlet setHelper: SetConstraintHelper\r\n\r\nbeforeAll(async () => {\r\n const sessionDescription: ISessionDescription = require(path.join(root, 'session/test-initiator.json'))\r\n definitions = await new DefinitionFactory().getDefinitions(sessionDescription?.application?.dictionary ?? '')\r\n setHelper = new SetConstraintHelper(definitions)\r\n}, 45000)\r\n// eslint-disable no-tabs\r\n/*\r\n<Field added=\"FIX.2.7\">\r\n <Tag>1</Tag>\r\n <Name>Account</Name>\r\n <Type>String</Type>\r\n <AbbrName>Acct</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Account mnemonic as agreed between buy and sell sides, e.g. broker and institution or investor/intermediary and fund manager.</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>15</Tag>\r\n <Name>Currency</Name>\r\n <Type>Currency</Type>\r\n <AbbrName>Ccy</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <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 </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 <Field added=\"FIX.2.7\">\r\n <Tag>35</Tag>\r\n <Name>MsgType</Name>\r\n <Type>String</Type>\r\n <AbbrName>MsgTyp</AbbrName>\r\n <NotReqXML>1</NotReqXML>\r\n <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 </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 <Field added=\"FIX.2.7\">\r\n <Tag>54</Tag>\r\n <Name>Side</Name>\r\n <Type>char</Type>\r\n <AbbrName>Side</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Side of order</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>99</Tag>\r\n <Name>StopPx</Name>\r\n <Type>Price</Type>\r\n <AbbrName>StopPx</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Price per unit of quantity (e.g. per share)</Description>\r\n </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 <Field added=\"FIX.3.0\">\r\n <Tag>113</Tag>\r\n <Name>ReportToExch</Name>\r\n <Type>Boolean</Type>\r\n <AbbrName>RptToExch</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Identifies party of trade responsible for exchange reporting.</Description>\r\n </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 <Field added=\"FIX.4.0\">\r\n <Tag>119</Tag>\r\n <Name>SettlCurrAmt</Name>\r\n <Type>Amt</Type>\r\n <AbbrName>SettlCurrAmt</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Total amount due expressed in settlement currency (includes the effect of the forex transaction)</Description>\r\n </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 <Field added=\"FIX.4.0\">\r\n <Tag>135</Tag>\r\n <Name>OfferSize</Name>\r\n <Type>Qty</Type>\r\n <AbbrName>OfrSz</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Quantity of offer\r\n(Prior to FIX 4.2 this field was of type int)</Description>\r\n </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 <Field added=\"FIX.4.1\">\r\n <Tag>168</Tag>\r\n <Name>EffectiveTime</Name>\r\n <Type>UTCTimestamp</Type>\r\n <AbbrName>EfctvTm</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Time the details within the message should take effect (always expressed in UTC (Universal Time Coordinated, also known as \"GMT\")</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>95</Tag>\r\n <Name>RawDataLength</Name>\r\n <Type>Length</Type>\r\n <AssociatedDataTag>96</AssociatedDataTag>\r\n <AbbrName>RawDataLength</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Number of bytes in raw data field.</Description>\r\n </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('length')\r\n})\r\n\r\n/*\r\n <Field added=\"FIX.2.7\">\r\n <Tag>96</Tag>\r\n <Name>RawData</Name>\r\n <Type>data</Type>\r\n <AbbrName>RawData</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Unformatted raw data, can include bitmaps, word processor documents, etc.</Description>\r\n </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 <Field added=\"FIX.2.7\">\r\n <Tag>100</Tag>\r\n <Name>ExDestination</Name>\r\n <Type>Exchange</Type>\r\n <AbbrName>ExDest</AbbrName>\r\n <NotReqXML>0</NotReqXML>\r\n <Description>Execution destination as defined by institution when order is entered.\r\nValid values:\r\nSee \"Appendix 6-C\"</Description>\r\n</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\r\n/*\r\n StandardHeader: IStandardHeader// [1] BeginString.8, BodyLength.9 .. HopRefID.630\r\n EmailThreadID: string// [2] 164 (String)\r\n EmailType: string// [3] 94 (String)\r\n OrigTime?: Date// [4] 42 (UtcTimestamp)\r\n Subject: string// [5] 147 (String)\r\n EncodedSubjectLen?: number// [6] 356 (Int)\r\n EncodedSubject?: Buffer// [7] 357 (RawData)\r\n RoutingGrp?: IRoutingGrp[]// [8] RoutingType.216, RoutingID.217\r\n InstrmtGrp?: IInstrmtGrp[]// [9] Symbol.55, SymbolSfx.65 .. InterestAccrualDate.874\r\n UndInstrmtGrp?: IUndInstrmtGrp[]// [10] UnderlyingSymbol.311, UnderlyingSymbolSfx.312 .. UnderlyingStipValue.889\r\n InstrmtLegGrp?: IInstrmtLegGrp[]// [11] LegSymbol.600, LegSymbolSfx.601 .. LegInterestAccrualDate.956\r\n OrderID?: string// [12] 37 (String)\r\n ClOrdID?: string// [13] 11 (String)\r\n LinesOfTextGrp: ILinesOfTextGrp[]// [14] Text.58, EncodedTextLen.354, EncodedText.355\r\n RawDataLength?: number// [15] 95 (Int)\r\n RawData?: Buffer// [16] 96 (RawData)\r\n StandardTrailer: IStandardTrailer// [17] SignatureLength.93, Signature.89, CheckSum.10\r\n */\r\ntest('message check Email', () => {\r\n const email = definitions.message.get('Email')\r\n expect(email).toBeTruthy()\r\n let index = 0\r\n setHelper.isComponent(email, index++, 'StandardHeader', true)\r\n setHelper.isSimple(email, index++, 'EmailThreadID', true)\r\n setHelper.isSimple(email, index++, 'EmailType', true)\r\n setHelper.isSimple(email, index++, 'OrigTime', false)\r\n setHelper.isSimple(email, index++, 'Subject', true)\r\n setHelper.isSimple(email, index++, 'EncodedSubjectLen', false)\r\n setHelper.isSimple(email, index++, 'EncodedSubject', false)\r\n setHelper.isGroup(email, index++, 'RoutingGrp', false)\r\n setHelper.isGroup(email, index++, 'InstrmtGrp', false)\r\n setHelper.isGroup(email, index++, 'UndInstrmtGrp', false)\r\n setHelper.isGroup(email, index++, 'InstrmtLegGrp', false)\r\n setHelper.isSimple(email, index++, 'OrderID', false)\r\n setHelper.isSimple(email, index++, 'ClOrdID', false)\r\n setHelper.isGroup(email, index++, 'LinesOfTextGrp', true)\r\n setHelper.isSimple(email, index++, 'RawDataLength', false)\r\n setHelper.isSimple(email, index++, 'RawData', false)\r\n setHelper.isComponent(email, index++, 'StandardTrailer', true)\r\n})\r\n\r\ntest('message check Email rawfields', () => {\r\n const email = definitions.message.get('Email')\r\n expect(email).toBeTruthy()\r\n isRaw(email, 'RawDataLength')\r\n isRaw(email, 'EncodedSubjectLen')\r\n})\r\n\r\nfunction isRaw (set: (IContainedSet | undefined), name: string): void {\r\n const field = set?.simple.get(name)\r\n expect(field).toBeTruthy()\r\n expect(set?.containsRaw).toBeTruthy()\r\n const masterDef = definitions.simple.get(name)\r\n expect(set?.containedLength[masterDef?.tag ?? -1]).toBeTruthy()\r\n}\r\n"]}
|
|
@@ -32,28 +32,28 @@ class SecDefHelper {
|
|
|
32
32
|
}
|
|
33
33
|
getNumRelatedSym() {
|
|
34
34
|
var _a, _b;
|
|
35
|
-
return (_b = (_a = this.getSecListGrp()) === null || _a === void 0 ? void 0 : _a.getSet('NoRelatedSym')) !== null && _b !== void 0 ? _b :
|
|
35
|
+
return (_b = (_a = this.getSecListGrp()) === null || _a === void 0 ? void 0 : _a.getSet('NoRelatedSym')) !== null && _b !== void 0 ? _b : undefined;
|
|
36
36
|
}
|
|
37
37
|
getSecurityTradingRules() {
|
|
38
38
|
var _a, _b;
|
|
39
|
-
return (_b = (_a = this.getNumRelatedSym()) === null || _a === void 0 ? void 0 : _a.getSet('SecurityTradingRules')) !== null && _b !== void 0 ? _b :
|
|
39
|
+
return (_b = (_a = this.getNumRelatedSym()) === null || _a === void 0 ? void 0 : _a.getSet('SecurityTradingRules')) !== null && _b !== void 0 ? _b : undefined;
|
|
40
40
|
}
|
|
41
41
|
getBaseTradingRules() {
|
|
42
42
|
var _a, _b;
|
|
43
|
-
return (_b = (_a = this.getSecurityTradingRules()) === null || _a === void 0 ? void 0 : _a.getSet('BaseTradingRules')) !== null && _b !== void 0 ? _b :
|
|
43
|
+
return (_b = (_a = this.getSecurityTradingRules()) === null || _a === void 0 ? void 0 : _a.getSet('BaseTradingRules')) !== null && _b !== void 0 ? _b : undefined;
|
|
44
44
|
}
|
|
45
45
|
getTickRules() {
|
|
46
46
|
var _a, _b;
|
|
47
|
-
return (_b = (_a = this.getBaseTradingRules()) === null || _a === void 0 ? void 0 : _a.getSet('TickRules')) !== null && _b !== void 0 ? _b :
|
|
47
|
+
return (_b = (_a = this.getBaseTradingRules()) === null || _a === void 0 ? void 0 : _a.getSet('TickRules')) !== null && _b !== void 0 ? _b : undefined;
|
|
48
48
|
}
|
|
49
49
|
getNoTickRules() {
|
|
50
50
|
var _a, _b;
|
|
51
|
-
return (_b = (_a = this.getTickRules()) === null || _a === void 0 ? void 0 : _a.getSet('NoTickRules')) !== null && _b !== void 0 ? _b :
|
|
51
|
+
return (_b = (_a = this.getTickRules()) === null || _a === void 0 ? void 0 : _a.getSet('NoTickRules')) !== null && _b !== void 0 ? _b : undefined;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
test('check message SecurityList', () => {
|
|
55
55
|
var _a;
|
|
56
|
-
const securityList = (_a = definitions === null || definitions === void 0 ? void 0 : definitions.getSet('SecurityList')) !== null && _a !== void 0 ? _a :
|
|
56
|
+
const securityList = (_a = definitions === null || definitions === void 0 ? void 0 : definitions.getSet('SecurityList')) !== null && _a !== void 0 ? _a : undefined;
|
|
57
57
|
expect(securityList).toBeTruthy();
|
|
58
58
|
let index = 0;
|
|
59
59
|
setHelper.isComponent(securityList, index++, 'StandardHeader', true);
|
|
@@ -83,7 +83,7 @@ test('check SecListGrp', () => {
|
|
|
83
83
|
const secListGrp = secHelper.getSecListGrp();
|
|
84
84
|
expect(secListGrp).toBeTruthy();
|
|
85
85
|
expect((_a = secListGrp === null || secListGrp === void 0 ? void 0 : secListGrp.fields) === null || _a === void 0 ? void 0 : _a.length).toEqual(1);
|
|
86
|
-
setHelper.isGroup(secListGrp !== null && secListGrp !== void 0 ? secListGrp :
|
|
86
|
+
setHelper.isGroup(secListGrp !== null && secListGrp !== void 0 ? secListGrp : undefined, 0, 'NoRelatedSym', false);
|
|
87
87
|
});
|
|
88
88
|
test('check NoRelatedSym', () => {
|
|
89
89
|
let index = 0;
|