jspurefix 5.10.1 → 5.10.3

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/ATDL_PLAN.md ADDED
@@ -0,0 +1,109 @@
1
+ # FIXatdl renderer and end-to-end test harness
2
+
3
+ Design notes from 2026-08-08. Nothing is built yet. This exists so the next session
4
+ can start from the thinking rather than redo it.
5
+
6
+ **First decision to settle:** this is not jspurefix work and should almost certainly
7
+ live in its own repository (`jspf-atdl`, or similar). The plan is parked here because
8
+ it is where the conversation happened and because the back-end half does use the
9
+ engine. Move it when the code starts.
10
+
11
+ ---
12
+
13
+ ## The problem
14
+
15
+ A broker publishes a FIXatdl document per algorithm: an XML definition of its
16
+ parameters and the order ticket used to fill them in. An EMS — Bloomberg EMSX,
17
+ Flextrade, Portware, Fidessa, ITG Triton — renders the ticket from that document, and
18
+ the values map onto FIX tags, usually the `NoStrategyParameters` group.
19
+
20
+ The observed pain, in more than one shop: getting a definition rendered is cobbled
21
+ together, and **you cannot tell whether a definition is sound until a vendor renders
22
+ it**. The loop is write it, send it, wait, discover it renders differently in EMSX
23
+ than in Triton, repeat. Nothing good and open exists to shorten that.
24
+
25
+ The goal is to close the loop locally, and then go one step further than any renderer
26
+ does — send the resulting order to a back end that answers, so a definition can be
27
+ proved end to end before it goes to clients.
28
+
29
+ ## What it actually is
30
+
31
+ **An interpreter, not an application.** The UI is entirely data driven: you never
32
+ hand-write a component per algorithm, you walk the layout tree. That single
33
+ observation drives every technology choice below.
34
+
35
+ The state is a flat map of control id to value. There is no routing, no server state,
36
+ no virtualised list, no async rendering. Almost nothing a UI framework is good at is
37
+ in play.
38
+
39
+ ## Technology
40
+
41
+ Deliberately small. FIXatdl is *already* a declarative UI description — wrapping it in
42
+ React means writing a compiler from one declarative tree into another and inheriting a
43
+ second lifecycle model, build chain and version churn, for a form with thirty
44
+ controls.
45
+
46
+ - **`DOMParser` for the XML.** ATDL is split across several namespaces — core,
47
+ layout, validation, flow control — and `getElementsByTagNameNS` is exactly the tool
48
+ for that. Built into every browser, zero dependencies.
49
+ - **Plain DOM for rendering.** Walk the layout tree, emit a label and an input per
50
+ control. On any change, re-evaluate every state rule and edit, then toggle
51
+ `disabled` / `hidden`. Tens of rules, not thousands — a full re-evaluation is
52
+ microseconds, so the machinery that exists to avoid one is dead weight.
53
+ - **TypeScript for the model and interpreter**, built to a single ESM module. A build
54
+ step for the author, not for anyone using it.
55
+ - **Static hosting, dynamic page.** One HTML file plus one module, opening from
56
+ `file://` if need be. Drag an ATDL file on, see it render, edit the XML, drop it
57
+ again.
58
+
59
+ Note the distinction that matters: static **hosting**, not static **generation**.
60
+ Generating HTML at build time would need a rebuild per edit, and the tight edit loop
61
+ is the entire product.
62
+
63
+ ## Build order
64
+
65
+ **The expression engine first, headless, with tests.** `StateRule` and `StrategyEdit`
66
+ form a small expression language — operators, logical combinators, references to other
67
+ controls — and that is where the time will go and where correctness actually matters.
68
+ Unit-test it against real broker ATDL documents before drawing a single widget. If
69
+ that engine is right the tool is good; if it is approximate, it is one more
70
+ cobbled-together thing.
71
+
72
+ Controls are the easy half and should come second.
73
+
74
+ ## Pluggable skins
75
+
76
+ Part of the value is answering "roughly how will EMSX lay this out, versus Fidessa" —
77
+ the question people genuinely cannot answer today. Keep layout strategy and CSS behind
78
+ an adapter so the same definition can render two ways side by side. CSS custom
79
+ properties cover it; still no framework.
80
+
81
+ ## The back end
82
+
83
+ A browser cannot open a TCP FIX session, so:
84
+
85
+ ```
86
+ page --(WebSocket, composed order as JSON)--> bridge --(FIX)--> test acceptor
87
+ <--(ExecutionReports)---------------------
88
+ ```
89
+
90
+ The bridge owns a jspurefix initiator; the acceptor validates the strategy parameters
91
+ against the same ATDL definition and answers. This keeps the page genuinely static and
92
+ the FIX where it belongs.
93
+
94
+ A thin WebSocket server is the right shape here — the engine's existing HTTP acceptor
95
+ is FIXML-shaped and is not a good fit for this.
96
+
97
+ ## Rough size
98
+
99
+ ~1,500 lines of interpreter, zero runtime dependencies.
100
+
101
+ ## Open questions for next session
102
+
103
+ 1. Own repository or a folder here? (Recommendation: own repository.)
104
+ 2. Which real ATDL documents can be used as test fixtures? The expression engine is
105
+ only as good as what it is tested against, and broker-published files vary a lot.
106
+ 3. Which FIXatdl version to target. 1.1 is the one in widespread use; confirm before
107
+ writing the parser rather than after.
108
+ 4. How strategy parameters map onto the outbound order — the `NoStrategyParameters`
109
+ group versus direct custom tags — likely needs to be configurable per broker.
package/WORKLOG.md CHANGED
@@ -2,7 +2,40 @@
2
2
 
3
3
  Running notes on what has been done and what is worth doing next, so a session can
4
4
  be resumed cold. The long-form plans live in `BACKPORT_PLAN.md` (engine, cspurefix →
5
- jspurefix) and `DEMO_PORT_PLAN.md` (the jspf-demo reference app).
5
+ jspurefix), `DEMO_PORT_PLAN.md` (the jspf-demo reference app) and `ATDL_PLAN.md` (a
6
+ FIXatdl renderer and test harness — a prospective sibling project, not engine work).
7
+
8
+ ---
9
+
10
+ ## 2026-08-08 — closing the acceptor's listener
11
+
12
+ Reported from jspf-demo: `npm run custom-logon` never exits. The logs say everything
13
+ shut down — sessions logged out, transports harvested, registry empty, `.. done` —
14
+ and the node process sits there.
15
+
16
+ Diagnosed by dumping `process._getActiveHandles()` after the run. Session and
17
+ transport teardown is complete; the only handle left is the listening `net.Server`.
18
+ A listening socket keeps node alive by itself, and nothing ever closed it.
19
+
20
+ `TcpAcceptorListener.stop()` has always existed and does the right thing. What was
21
+ missing was any way to *call* it: `SessionLauncher.stopAcceptor()` was private and
22
+ reached only from the branch where one launcher holds both roles. An application that
23
+ gives its acceptor a launcher of its own — which jspf-demo started doing on 2026-08-01
24
+ so the acceptor would survive any one client — could not close its listener at all.
25
+
26
+ **Changed:** `SessionLauncher.stop()`, public. Remembers a stop that arrives before
27
+ the acceptor has started (`makeSystem` is async, so that window is real) and never
28
+ opens the listener in that case. `run()` resolves once the listener has closed.
29
+ Pinned by `src/test/session/launcher-stop.test.ts`.
30
+
31
+ Worth checking against
32
+ [#72](https://github.com/TimelordUK/jspurefix/issues/72) ("`session-launcher.run()`
33
+ never resolves when connection established") before that issue is next looked at —
34
+ for an acceptor, run() not resolving was the designed behaviour with no way out, and
35
+ now there is one.
36
+
37
+ `docs/acceptor.md` gained a "Closing the listener" section, because from the outside
38
+ this reads as a hang rather than as a decision.
6
39
 
7
40
  ---
8
41
 
@@ -37,6 +70,62 @@ confirmation — see below).
37
70
 
38
71
  ---
39
72
 
73
+ ## 2026-08-08 — customising the Logon, and making silent drops visible, released as 5.10.0
74
+
75
+ Started from [#93](https://github.com/TimelordUK/jspurefix/issues/93), open since
76
+ December 2024, and ended up somewhere broader. Two issues that look unrelated turned
77
+ out to share a theme: **the engine failed quietly in several places, and nobody could
78
+ see it.**
79
+
80
+ **Merged (PR #164):**
81
+
82
+ - a `Logon` block in the session description, merged over the fields the engine
83
+ derives. `AsciiSessionMsgFactory.logon()` had read exactly five values off the
84
+ description and ignored everything else, so an `"Account"` in the config was never
85
+ looked at. A null in the block suppresses a field.
86
+ - `AsciiEncoder` now reports a key it cannot resolve, via
87
+ `MsgEncoder.onUnknownField`. This was the real cause of the confusion: `Account` is
88
+ tag 1 but is not a field of FIX 4.4 `Logon`, so it was discarded with no error and
89
+ no log line. Only runs on the miss path — a key that resolves costs nothing.
90
+ - `SessionContainer(provider)` and `SessionLauncher.makeSessionMsgFactory()`, so
91
+ supplying a factory no longer needs a `SessionContainer` subclass
92
+ - `AsciiSessionMsgFactory` / `FixmlSessionMsgFactory` exported from the package root.
93
+ Extending the ascii factory — the thing every previous answer to these issues told
94
+ people to do — used to require importing through `dist/transport/ascii/...`.
95
+ - an optional callback on `send`, giving back the stamped `StandardHeader` (and so
96
+ the sequence number) or an error. Writing it exposed three drops that told nobody:
97
+ `encodeMessage` returning null for an unknown msgType, a session in state
98
+ `Stopped`, and no transport at all. All three still reach the error channel; the
99
+ callback is additive.
100
+
101
+ **Issues resolved:** #93, #86, #39, #96 (all commented with the full explanation).
102
+ #69 verified fixed — `SenderSubID` has been in the header since `dd9a540` — and left
103
+ open pending the reporter, since their actual complaint was "no response from the
104
+ server".
105
+
106
+ **Docs:** `docs/custom-logon.md`, plus README sections on the `Logon` block and on
107
+ send callbacks.
108
+
109
+ **Perf:** flat. Parse benchmarks moved inside the noise floor; Logon encode 2.26
110
+ µs/msg against the 2.3 in the README table. The encoder change is genuinely off the
111
+ hot path.
112
+
113
+ **Demos:** `jspf-demo` gained a `custom-logon` mode (config block + generated
114
+ dictionary + run-time factory, and one field deliberately left undeclared so the new
115
+ warning is visible). `jspf-md-demo`'s `Msg44Fact` had a `logon()` that was a verbatim
116
+ copy of the stock one — it showed the hook and never the point — and now sends a real
117
+ bespoke tag; its generated types were regenerated in a separate commit, having
118
+ drifted a long way behind the generator.
119
+
120
+ **Found along the way:** jspf-demo had been sending every `TradeCaptureReportRequest`
121
+ without its dates for as long as the demo has existed. `TrdCapDtGrp` was built as a
122
+ flat array, which is how the FIX repository models it, but those sessions load the
123
+ QuickFIX dictionary where it is a component wrapping `NoDates`. The encoder dropped
124
+ it silently. The new warning is what caught it, about an hour after it existed — a
125
+ fair advertisement for the feature.
126
+
127
+ ---
128
+
40
129
  ## Next up
41
130
 
42
131
  ### 1. Toolchain major bumps
@@ -49,10 +138,9 @@ acceptor work:
49
138
  - `eslint-config-love` 151 → 154
50
139
  - `@types/node` 25 → 26
51
140
 
52
- Expect lint churn. There are 17 pre-existing lint errors on master (`fix-clock`,
53
- `resend-request-manager`, `session-sequence-*`, `tcp-initiator`) — worth clearing in
54
- the same pass, since they make it hard to tell new problems from old. `npm audit` is
55
- currently clean.
141
+ Expect lint churn. The 17 pre-existing lint errors noted here were cleared in
142
+ `1d2f267` — `npx eslint src/` is clean on master as of 5.10.0, so any churn from the
143
+ bump is genuinely new and worth reading. `npm audit` is clean.
56
144
 
57
145
  ### 2. #77 — confirm or close
58
146
 
@@ -76,14 +164,21 @@ reproduced.
76
164
 
77
165
  ### 3. Other open issues worth a look
78
166
 
79
- Several are old and may already be fixed, in the way #140 turned out to be — worth
80
- verifying against 5.9.1 rather than reading the thread:
81
-
82
- - #96 / #69 — `DefaultApplVerID` / `SenderSubID` missing during login
83
- - #93 — customising the Logon message
84
- - #86 — make `encoderStream` protected
85
- - #85 — `ASessionMsgFactory` types patch (may be superseded by `cloneFor`)
86
- - #72 — `session-launcher.run()` never resolves when connection established
167
+ Most of this list was cleared in 5.10.0. What remains:
168
+
169
+ - **#69** — verified fixed and commented; awaiting the reporter before closing. Their
170
+ literal question (`SenderSubID`) works; their real complaint was silence from
171
+ cServer, which is a different problem.
172
+ - **#85** — `ASessionMsgFactory` types patch. Possibly superseded twice over now, by
173
+ `cloneFor` and by the root exports added in 5.10.0. Worth reading the patch against
174
+ current master before doing anything.
175
+ - **#72** — `session-launcher.run()` never resolves when the connection is
176
+ established. Not looked at. Given how #140 and #77 went, verify against 5.10.0
177
+ before trusting the thread.
178
+
179
+ The lesson from this batch, worth repeating: **several of these were already fixed,
180
+ or were one line plus a docs gap.** Reading the thread is a poor substitute for
181
+ running the reporter's config.
87
182
 
88
183
  ### 4. Small things noticed, none urgent
89
184
 
@@ -40,8 +40,8 @@ class StandardSnippet {
40
40
  this.settings = settings;
41
41
  }
42
42
  static rhsJustify(txt, width) {
43
- const align = require('align-text');
44
- return align(txt, width);
43
+ const pad = ' '.repeat(Math.max(0, width));
44
+ return txt.split(/\r\n|\n/).map(line => pad + line).join('\n');
45
45
  }
46
46
  import(name, isMsg, indent) {
47
47
  const spaces = this.spaces(indent);
@@ -1 +1 @@
1
- {"version":3,"file":"standard-snippet.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/standard-snippet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA2B;AAE3B,MAAa,eAAe;IAC1B,YAA6B,QAA2B;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IACxD,CAAC;IAEO,MAAM,CAAC,UAAU,CAAE,GAAW,EAAE,KAAa;QACnD,MAAM,KAAK,G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;YACN,OAAO;YACP,KAAK,CAAA;IACT,CAAC;IAEO,OAAO,CAAE,GAAa;QAC5B,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1GD,0CA0GC","sourcesContent":["import { ICompilerSettings } from './compiler-settings'\nimport * as _ from 'lodash'\n\nexport class StandardSnippet {\n constructor (public readonly settings: ICompilerSettings) {\n }\n\n private static rhsJustify (txt: string, width: number): string {\n const align = require('align-text')\n return align(txt, width)\n }\n\n // import { camelName } from './component/name_underscore'\n public import (name: string, isMsg: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n const fileName = _.snakeCase(name)\n const path = isMsg ? `./set/${fileName}` : `./${fileName}`\n return `${spaces}import { I${name} } from '${path}'`\n }\n\n public interface (name: string, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}export interface I${name}`\n }\n\n public startBlockComment (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}/*`\n }\n\n public endBlockComment (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}*/`\n }\n\n public startBlock (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}{`\n }\n\n public endBlock (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}}`\n }\n\n public group (name: string, type: string, required: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}${name}${required ? '' : '?'}: I${type}[]`\n }\n\n public component (name: string, required: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}${name}${required ? '' : '?'}: I${name}`\n }\n\n public simple (name: string, type: string, required: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}${name}${required ? '' : '?'}: ${type}`\n }\n\n public enum (name: string, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `export ${spaces}enum ${name}`\n }\n\n public enumValue (name: string, val: any, indent: number): string {\n const spaces: string = this.spaces(indent)\n if (typeof (val) === 'string') {\n return `${spaces}${name} = '${val}'`\n }\n return `${spaces}${name} = ${val}`\n }\n\n public spaces (indent: number): string {\n return ' '.repeat(this.settings.spaces * indent)\n }\n\n public commentLine (line: string, justify: number): string {\n return StandardSnippet.rhsJustify(`// ${line}`, justify)\n }\n\n public commentBox (str: string): string {\n const wrap = require('word-wrap')\n const text = wrap(str, {\n width: 60,\n indent: ' '\n }\n )\n let lines = text.split('\\n').map((a: string) => a.trim())\n const max = this.longest(lines).length + 2\n const newLine: string = require('os').EOL\n lines = lines.map(function (line: string) {\n line = ` ${line} `\n const diff = max - line.length\n return '*' + line + ' '.repeat(diff) + '*'\n })\n const stars: string = '*'.repeat(lines[0].length)\n const joined: string = lines.join(newLine)\n return stars + newLine +\n joined +\n newLine +\n stars\n }\n\n private longest (arr: string[]): string {\n return arr.reduce(function (a, b) {\n return a.length > b.length ? a : b\n })\n }\n}\n"]}
1
+ {"version":3,"file":"standard-snippet.js","sourceRoot":"","sources":["../../../src/dictionary/compiler/standard-snippet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA2B;AAE3B,MAAa,eAAe;IAC1B,YAA6B,QAA2B;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IACxD,CAAC;IAEO,MAAM,CAAC,UAAU,CAAE,GAAW,EAAE,KAAa;QACnD,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;QAC1C,OAAO,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAChE,CAAC;IAGM,MAAM,CA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E,CAAC;YAC9B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1GD,0CA0GC","sourcesContent":["import { ICompilerSettings } from './compiler-settings'\nimport * as _ from 'lodash'\n\nexport class StandardSnippet {\n constructor (public readonly settings: ICompilerSettings) {\n }\n\n private static rhsJustify (txt: string, width: number): string {\n const pad = ' '.repeat(Math.max(0, width))\n return txt.split(/\\r\\n|\\n/).map(line => pad + line).join('\\n')\n }\n\n // import { camelName } from './component/name_underscore'\n public import (name: string, isMsg: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n const fileName = _.snakeCase(name)\n const path = isMsg ? `./set/${fileName}` : `./${fileName}`\n return `${spaces}import { I${name} } from '${path}'`\n }\n\n public interface (name: string, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}export interface I${name}`\n }\n\n public startBlockComment (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}/*`\n }\n\n public endBlockComment (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}*/`\n }\n\n public startBlock (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}{`\n }\n\n public endBlock (indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}}`\n }\n\n public group (name: string, type: string, required: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}${name}${required ? '' : '?'}: I${type}[]`\n }\n\n public component (name: string, required: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}${name}${required ? '' : '?'}: I${name}`\n }\n\n public simple (name: string, type: string, required: boolean, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `${spaces}${name}${required ? '' : '?'}: ${type}`\n }\n\n public enum (name: string, indent: number): string {\n const spaces: string = this.spaces(indent)\n return `export ${spaces}enum ${name}`\n }\n\n public enumValue (name: string, val: any, indent: number): string {\n const spaces: string = this.spaces(indent)\n if (typeof (val) === 'string') {\n return `${spaces}${name} = '${val}'`\n }\n return `${spaces}${name} = ${val}`\n }\n\n public spaces (indent: number): string {\n return ' '.repeat(this.settings.spaces * indent)\n }\n\n public commentLine (line: string, justify: number): string {\n return StandardSnippet.rhsJustify(`// ${line}`, justify)\n }\n\n public commentBox (str: string): string {\n const wrap = require('word-wrap')\n const text = wrap(str, {\n width: 60,\n indent: ' '\n }\n )\n let lines = text.split('\\n').map((a: string) => a.trim())\n const max = this.longest(lines).length + 2\n const newLine: string = require('os').EOL\n lines = lines.map(function (line: string) {\n line = ` ${line} `\n const diff = max - line.length\n return '*' + line + ' '.repeat(diff) + '*'\n })\n const stars: string = '*'.repeat(lines[0].length)\n const joined: string = lines.join(newLine)\n return stars + newLine +\n joined +\n newLine +\n stars\n }\n\n private longest (arr: string[]): string {\n return arr.reduce(function (a, b) {\n return a.length > b.length ? a : b\n })\n }\n}\n"]}
package/dist/jsfix-cmd.js CHANGED
@@ -61,7 +61,7 @@ const runtime_1 = require("./runtime");
61
61
  const di_tokens_1 = require("./runtime/di-tokens");
62
62
  const minimist_options_1 = __importDefault(require("minimist-options"));
63
63
  const quick_fix_xml_file_builder_1 = require("./dictionary/parser/quickfix/quick-fix-xml-file-builder");
64
- const fs = require('node-fs-extra');
64
+ const fs = require('fs');
65
65
  const options = (0, minimist_options_1.default)({
66
66
  dict: {
67
67
  type: 'string',
@@ -436,7 +436,7 @@ class JsfixCmd {
436
436
  ensureExists(path) {
437
437
  return __awaiter(this, void 0, void 0, function* () {
438
438
  return yield new Promise((resolve, reject) => {
439
- fs.mkdirp(path, (err) => {
439
+ fs.mkdir(path, { recursive: true }, (err) => {
440
440
  if (err) {
441
441
  reject(err);
442
442
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jsfix-cmd.js","sourceRoot":"","sources":["../src/jsfix-cmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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zC,IAAI,IAAI,EAAE,CAAC;IACT,QAAQ,EAAE,CAAA;AACZ,CAAC;KAAM,CAAC;IACN,MAAM,GAAG,GAAa,IAAI,QAAQ,EAAE,CAAA;IACpC,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,GAAY,EAAE,EAAE;QAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,QAAQ,EAAE,CAAA;QACZ,CAAC;IACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import 'reflect-metadata'\n\nimport { ElasticBuffer, MsgView, MsgParser } from './buffer'\nimport { AsciiParser, AsciiView, AsciiChars } from './buffer/ascii'\nimport { ILooseObject } from './collections/collection'\nimport { SimpleFieldDefinition, FixDefinitions } from './dictionary/definition'\nimport { MessageGenerator, JsonHelper, getWords, DefinitionFactory } from './util'\nimport { ISessionDescription, FileDuplex, StringDuplex } from './transport'\n\nimport { MsgTag } from './types'\nimport { IJsFixConfig } from './config'\n\nimport * as util from 'util'\nimport minimist = require('minimist')\nimport * as path from 'path'\nimport { MsgTransport } from './transport/factory'\nimport { EnumCompiler, ICompilerSettings, MsgCompiler } from './dictionary/compiler'\nimport { AsciiMsgTransmitter } from './transport/ascii/ascii-msg-transmitter'\nimport { SessionContainer } from './runtime'\nimport { DITokens } from './runtime/di-tokens'\nimport buildOptions from 'minimist-options'\nimport { QuickFixXmlFileBuilder } from './dictionary/parser/quickfix/quick-fix-xml-file-builder'\n\nconst fs = require('node-fs-extra')\n\nconst options = buildOptions({\n dict: {\n type: 'string',\n alias: 'd',\n default: 'data/FIX44.xml'\n },\n\n type: {\n type: 'string-array',\n alias: 't'\n },\n\n fix: {\n type: 'string',\n alias: 'f',\n default: 'data/FIX44.xml'\n },\n\n session: {\n type: 'string',\n alias: 's'\n },\n\n delimiter: {\n type: 'string',\n alias: 'l',\n default: '|'\n },\n\n help: {\n type: 'boolean',\n alias: ['h'],\n default: false\n },\n\n unit: {\n type: 'boolean',\n alias: ['u'],\n default: false\n },\n\n generate: {\n type: 'boolean',\n alias: ['g'],\n default: false\n },\n\n stats: {\n type: 'boolean',\n alias: ['st'],\n default: false\n },\n\n tokens: {\n type: 'boolean',\n alias: ['t'],\n default: false\n },\n\n objects: {\n type: 'boolean',\n alias: ['o'],\n default: true\n },\n\n structures: {\n type: 'boolean',\n alias: ['r'],\n default: false\n },\n\n script: {\n type: 'boolean',\n alias: ['i'],\n default: false\n },\n\n compile: {\n type: 'boolean',\n alias: ['c'],\n default: false\n },\n\n groups: {\n type: 'boolean',\n alias: ['g'],\n default: true\n },\n\n density: {\n type: 'number',\n alias: 'd',\n default: 0.8\n },\n\n repeats: {\n type: 'number',\n alias: 'r',\n default: 1\n },\n\n arr: {\n type: 'array',\n alias: 'a',\n default: []\n }\n\n /*\n booleans: {\n type: 'boolean-array',\n alias: 'b',\n default: [true, false]\n },\n\n numbers: {\n type: 'number-array',\n alias: 'n',\n default: [0, 1]\n },\n\n published: 'boolean',\n\n // Special option for positional arguments (`_` in minimist)\n arguments: 'string'\n */\n})\n\nconst argv: any = minimist(process.argv.slice(2), options)\n\nenum PrintMode {\n Structure = 1,\n Object = 2,\n Verbose = 3,\n Stats = 4,\n Token = 5,\n Encoded = 6\n}\n\nenum Command {\n Generate = 1,\n Replay = 2,\n Lookup = 3,\n Encode = 4,\n Benchmark = 5,\n Compile = 6,\n Trim,\n Unknown = 8\n}\n\nclass ParseSummary {\n public readonly micros_per_msg: number\n public readonly chars_per_second: number\n public readonly fields_per_second: number\n public readonly content_length: number\n\n constructor (\n public readonly content: string,\n public readonly view: string,\n public readonly msg_type: string,\n public readonly iterations: number,\n public readonly elapsed_ms: number,\n public readonly fields: number\n ) {\n this.content_length = this.content.length\n this.micros_per_msg = (this.elapsed_ms / this.iterations) * 1000\n this.chars_per_second = Math.round(this.content_length * this.iterations / this.elapsed_ms * 1000)\n this.fields_per_second = Math.round(this.fields * this.iterations / this.elapsed_ms * 1000)\n }\n}\n\nexport class JsfixCmd {\n private readonly root: string = path.join(__dirname, '../')\n private definitions: FixDefinitions\n private jsonHelper: JsonHelper\n private session: AsciiMsgTransmitter\n private sessionDescription: ISessionDescription\n private delimiter: number = AsciiChars.Soh\n private stats: ILooseObject = {}\n private readonly filter: Map<string, boolean> = new Map<string, boolean>()\n private messages: number = 0\n private print: boolean = true\n\n private static getCommand (): Command {\n let command: Command = Command.Unknown\n if (argv.trim) {\n command = Command.Trim\n } else if (argv.compile) {\n command = Command.Compile\n } else if (argv.generate) {\n command = Command.Generate\n } else if (argv.fix) {\n command = argv.benchmark ? Command.Benchmark : Command.Replay\n } else if (argv.field) {\n command = Command.Lookup\n } else if (argv.json) {\n command = Command.Encode\n } else if (argv.msg) {\n command = Command.Lookup\n }\n return command\n }\n\n private static getPrintMode (): PrintMode {\n let mode: PrintMode = PrintMode.Stats\n if (argv.tokens) {\n mode = PrintMode.Token\n } else if (argv.stats) {\n mode = PrintMode.Stats\n } else if (argv.objects) {\n mode = PrintMode.Object\n } else if (argv.verbose) {\n mode = PrintMode.Verbose\n } else if (argv.structures) {\n mode = PrintMode.Structure\n } else if (argv.encoded) {\n mode = PrintMode.Encoded\n } else if (argv.trim) {\n mode = PrintMode.Object\n }\n return mode\n }\n\n private static async writeFile (name: string, api: string): Promise<void> {\n const writer = util.promisify(fs.writeFile)\n await writer(name, api, { encoding: 'utf8' }\n ).catch((e: Error) => {\n throw e\n })\n }\n\n public async exec (): Promise<any> {\n return await new Promise<any>((resolve, reject) => {\n this.init().then(async () => {\n let actioned: boolean = true\n const command = JsfixCmd.getCommand()\n\n switch (command) {\n case Command.Generate: {\n // produce a test message or a valid fix log of n messages\n await this.generate()\n break\n }\n\n case Command.Encode: {\n // encode a json message back to fix\n this.encode()\n break\n }\n\n case Command.Replay: {\n // parse a file into either objects, tokens, structures or stats\n const repeats: number = !isNaN(argv.repeats) ? argv.repeats : 1\n try {\n for (let i: number = 0; i < repeats; ++i) {\n await this.replay()\n }\n } catch (e) {\n reject(e)\n }\n break\n }\n\n case Command.Benchmark: {\n // time how long to parse 10000 repeats of contents of file\n const repeats: number = !isNaN(argv.repeats) ? argv.repeats : 10000\n try {\n const summary = await this.benchmark(repeats)\n console.log(JSON.stringify(summary, null, 4))\n } catch (e) {\n reject(e)\n }\n break\n }\n\n case Command.Lookup: {\n // lookup a field\n if (argv.field) {\n this.field()\n } else {\n this.msg()\n }\n break\n }\n\n case Command.Compile: {\n await this.compile()\n break\n }\n\n case Command.Trim: {\n const xml = this.trim()\n console.log(xml)\n break\n }\n\n case Command.Unknown:\n default: {\n actioned = false\n }\n }\n resolve(actioned)\n }).catch((e) => {\n reject(e)\n })\n })\n }\n\n private async firstMessage (t: MsgTransport): Promise<MsgView> {\n return await new Promise<MsgView>((resolve, reject) => {\n t.receiver.on('msg', (msgType: string, msgView: MsgView) => {\n resolve(msgView.clone())\n })\n t.receiver.on('error', (e) => {\n reject(e)\n })\n })\n }\n\n protected async generate (): Promise<void> {\n const lipPath: string = path.join(this.root, 'data/examples/lipsum.txt')\n const words: string[] = await getWords(lipPath)\n const generator = new MessageGenerator(words, this.definitions)\n let density = 1\n if (argv.density) {\n density = parseFloat(argv.density)\n }\n if (isNaN(density)) {\n console.log('density must be numeric in range > 0 density <= 1.0')\n return\n }\n\n if (argv.script) {\n await this.script(generator, density)\n } else {\n await this.single(generator, density)\n }\n }\n\n private async single (generator: MessageGenerator, density: number): Promise<void> {\n if (!argv.type) {\n console.log('specify type to generate e.g. --type = AE')\n return\n }\n const msgType: string = `${argv.type}`\n let makeGroups: boolean = true\n if (argv.groups) {\n makeGroups = argv.groups === 'true'\n }\n const obj: ILooseObject = generator.generate(msgType, density, makeGroups)\n console.log(JSON.stringify(obj, null, 4))\n const fix: string = this.encodeObject(msgType, obj)\n const ft: MsgTransport = new MsgTransport(1, this.session.config, new StringDuplex(fix))\n if (argv.unit) {\n await this.unitTest(fix, obj, ft)\n } else {\n this.subscribe(ft)\n }\n }\n\n private async script (generator: MessageGenerator, density: number): Promise<void> {\n const buffer: ElasticBuffer = new ElasticBuffer()\n const repeats: number = argv.repeats || 50\n const key: string = MsgTag.MsgType.toString()\n const sf = this.definitions.simple.get(key)\n const session: AsciiMsgTransmitter = this.session\n for (let i = 0; i < repeats; ++i) {\n const msgType: string = sf ? MessageGenerator.getRandomEnum(sf).toString() : ''\n console.log(`i = ${i} ${msgType}`)\n const obj: ILooseObject = generator.generate(msgType, density)\n session.encodeMessage(msgType, obj)\n buffer.writeBuffer(session.buffer.slice())\n buffer.writeString(require('os').EOL)\n }\n await JsfixCmd.writeFile('./fix.txt', buffer.slice().toString('utf8'))\n }\n\n private async unitTest (fix: string, obj: ILooseObject, ft: MsgTransport): Promise<void> {\n const view: MsgView = await this.firstMessage(ft)\n const summary = view?.structure?.summary()\n\n await JsfixCmd.writeFile('./fix.txt', fix)\n await JsfixCmd.writeFile('./object.json', JSON.stringify(obj, null, 4))\n await JsfixCmd.writeFile('./token.txt', view.toString())\n await JsfixCmd.writeFile('./structure.json', JSON.stringify(summary, null, 4))\n }\n\n private encodeObject (msgType: string, object: ILooseObject): string {\n const session: AsciiMsgTransmitter = this.session\n session.encodeMessage(msgType, object)\n return session.buffer.toString()\n }\n\n private msg (): void {\n const definitions = this.definitions\n const m = definitions.message.get(argv.msg)\n if (m) {\n console.log(m.toString())\n }\n }\n\n private field (): void {\n let sf: SimpleFieldDefinition | undefined\n const tag: number = parseInt(argv.field, 10)\n const definitions = this.definitions\n if (!isNaN(tag)) {\n sf = definitions.tagToSimple[tag]\n } else {\n sf = definitions.simple.get(argv.field)\n }\n if (sf) {\n console.log(sf.toString())\n }\n }\n\n async ensureExists (path: string): Promise<any> {\n return await new Promise<any>((resolve, reject) => {\n fs.mkdirp(path, (err: Error) => {\n if (err) {\n reject(err)\n } else {\n resolve(true)\n }\n })\n })\n }\n\n private async compileDefinitions (outputPath: string): Promise<void> {\n await this.ensureExists(path.join(outputPath, 'set'))\n await this.ensureExists(path.join(outputPath, 'enum'))\n const definitions = this.definitions\n const compilerSettings: ICompilerSettings = require('../data/compiler.json')\n compilerSettings.output = outputPath\n const msgCompiler: MsgCompiler = new MsgCompiler(definitions, compilerSettings)\n await msgCompiler.generate()\n const enumCompiler: EnumCompiler = new EnumCompiler(definitions, compilerSettings)\n const writeFile = path.join(compilerSettings.output, './enum/all-enum.ts')\n await enumCompiler.generate(writeFile)\n }\n\n private trim (): string {\n this.setFilter()\n const types = this.filter.size > 0 ? Array.from(this.filter.keys()) : Array.from(this.definitions.simple.get('MsgType')?.enums.keys() ?? [])\n const qfb = new QuickFixXmlFileBuilder(this.definitions)\n qfb.write(types)\n return qfb.elasticBuffer.toString()\n }\n\n private async compile (): Promise<void> {\n let output = argv.output\n const dp = new DefinitionFactory().getDictPath(argv.dict)\n if (dp) {\n output = dp.output\n }\n output = path.join(this.root, output)\n await this.compileDefinitions(output)\n }\n\n sys: SessionContainer\n config: IJsFixConfig\n\n private async init (): Promise<any> {\n let session: string = argv.session || 'data/session/test-initiator.json'\n this.sys = new SessionContainer()\n this.sys.registerGlobal('error')\n session = this.norm(session)\n this.sessionDescription = require(session)\n const container = await this.sys.makeSystem(this.sessionDescription)\n this.config = container.resolve<IJsFixConfig>(DITokens.IJsFixConfig)\n this.definitions = this.config.definitions\n let dict: string\n if (argv.dict) {\n dict = argv.dict\n const df = await new DefinitionFactory().getDefinitions(dict)\n this.config.definitions = df\n this.definitions = df\n }\n const definitions = this.definitions\n if (argv.delimiter) {\n this.delimiter = AsciiChars.firstChar(argv.delimiter)\n this.config.delimiter = this.delimiter\n }\n this.jsonHelper = new JsonHelper(definitions)\n if (argv.session) {\n this.session = container.resolve<AsciiMsgTransmitter>(DITokens.MsgTransmitter)\n }\n }\n\n private setFilter (): void {\n const types: string[] = []\n if (argv.type != null) {\n if (Array.isArray(argv.type)) {\n argv.type.forEach((mt: any) => {\n types.push(mt)\n })\n } else {\n argv.type.split(',').forEach((mt: string) => {\n types.push(mt)\n })\n }\n types.forEach((mt: any) => {\n this.filter.set(mt, true)\n })\n }\n }\n\n private async dispatch (ft: MsgTransport): Promise<any> {\n this.setFilter()\n let time: boolean = false\n if (argv.time || argv.stats) {\n this.print = false\n time = true\n }\n this.subscribe(ft)\n const startsAt: Date = new Date()\n await ft.wait()\n const elapsed: number = new Date().getTime() - startsAt.getTime()\n if (time) {\n console.log(`messages ${this.messages} elapsed ms ${elapsed}`)\n }\n if (argv.stats) {\n console.log(JSON.stringify(this.stats, null, 4))\n }\n }\n\n private subscribe (ft: MsgTransport): void {\n this.messages = 0\n this.stats = {}\n const filter = this.filter\n // the receiver is message parser which is piped from an input stream - file, socket\n ft.receiver.on('msg', (msgType: string, m: AsciiView) => {\n if (filter) {\n if (filter.has(msgType)) {\n return\n }\n }\n ++this.messages\n this.onMsg(msgType, m)\n })\n }\n\n private onMsg (msgType: string, m: MsgView): void {\n const mode: PrintMode = JsfixCmd.getPrintMode()\n const print = this.print\n const stats = this.stats\n switch (mode) {\n case PrintMode.Stats: {\n let i: number = 0\n if (!stats[msgType]) {\n i = 1\n } else {\n i = stats[msgType] as number + 1\n }\n stats[msgType] = i\n break\n }\n\n case PrintMode.Verbose: {\n const verbose = m.toVerbose()\n if (verbose) {\n console.log(verbose)\n }\n break\n }\n\n case PrintMode.Object: {\n const asObject: ILooseObject = m.toObject() as ILooseObject\n if (print) {\n const def = this.definitions.message.get(msgType)\n console.log(`${msgType} [${def?.name}] = ${JSON.stringify(asObject, null, 4)}`)\n console.log()\n }\n break\n }\n\n case PrintMode.Structure: {\n const summary = m?.structure?.summary()\n if (print) {\n console.log(JSON.stringify(summary, null, 4))\n }\n break\n }\n\n case PrintMode.Token: {\n const tokens = m.toString()\n if (print) {\n console.log(tokens)\n }\n break\n }\n\n case PrintMode.Encoded: {\n const fix: string = this.encodeObject(msgType, m.toObject() as ILooseObject)\n console.log(fix)\n break\n }\n\n default:\n throw new Error(`unknown mode ${mode}`)\n }\n }\n\n private async replay (): Promise<any> {\n if (!argv.fix) {\n console.log('provide a path to fix file i.e. --fix=data/examples/execution-report/fix.txt')\n return\n }\n const fix: string = this.norm(argv.fix)\n const config = this.config\n const ft: MsgTransport = new MsgTransport(1, config, new FileDuplex(fix))\n await this.dispatch(ft)\n }\n\n private async promisedRead (f: string): Promise<string> {\n return new Promise((resolve, reject) => {\n fs.readFile(f, 'utf8', async (err: Error, contents: string) => {\n if (err) {\n reject(err)\n }\n resolve(contents)\n })\n })\n }\n\n async benchParse (contents: string, iterations: number): Promise<ParseSummary> {\n return new Promise((resolve, reject) => {\n const toParse = new StringDuplex(contents.repeat(iterations))\n const startsAt: Date = new Date()\n let i = 0\n const config = this.config\n const buffer = config.sessionContainer.resolve<ElasticBuffer>(DITokens.ParseBuffer)\n const asciiParser: MsgParser = new AsciiParser(config, toParse.readable, buffer)\n asciiParser.on('msg', (msgType: string, v: MsgView) => {\n ++i\n if (i === iterations) {\n const elapsed: number = new Date().getTime() - startsAt.getTime()\n const fields = v?.structure?.tags.nextTagPos ?? 0\n const summary = new ParseSummary(contents, v.toString(), msgType, iterations, elapsed, fields)\n resolve(summary)\n }\n })\n asciiParser.on('error', e => {\n reject(e)\n })\n })\n }\n\n private async benchmark (repeats: number): Promise<(ParseSummary | null)> {\n if (!argv.fix) {\n console.log('provide a path to fix file i.e. --fix=data/examples/execution-report/fix.txt')\n return null\n }\n return await new Promise<any>((resolve, reject) => {\n const fix: string = this.norm(argv.fix)\n this.promisedRead(fix)\n .then(contents => {\n this.benchParse(contents, repeats)\n .then((a: ParseSummary) => {\n resolve(a)\n })\n .catch(e => { reject(e) })\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n private encode (): void {\n const session: AsciiMsgTransmitter = this.session\n if (!session) {\n console.log('provide a session json file e.g. --session=data/session/test-initiator.json')\n return\n }\n if (!argv.type) {\n console.log('provide a message type e.g. --type=8')\n return\n }\n if (!argv.json) {\n console.log('provide a json representation e.g. data/examples/execution-report/object.json')\n return\n }\n const ts: string = argv.type.toString()\n const msg: ILooseObject = this.jsonHelper.fromJson(path.join(this.root, argv.json), ts)\n session.encodeMessage(ts, msg)\n const fix: string = session.buffer.toString()\n console.log(fix)\n }\n\n private norm (p: string): string {\n let f: string = p\n if (!path.isAbsolute(p)) {\n f = path.join(this.root, f)\n }\n return f\n }\n}\n\nfunction showHelp (): void {\n console.log('this help page')\n console.log('npm run cmd')\n console.log('npm run cmd -- --help')\n console.log()\n\n console.log('print to console a trim quickfix format xml only including given message types')\n console.log('node dist/jsfix-cmd --dict=qf44 --trim --type=\"0,1,2,3,4,5,AE\"')\n\n console.log('token format i.e. [602] 687 (LegQty) = 33589')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/quickfix/FIX.4.4/execution-report/fix.txt --delimiter=\"|\" --tokens')\n console.log()\n\n console.log('token format use fix repo dictionary')\n console.log('node dist/jsfix-cmd --dict=data/fix_repo/FIX.4.4/Base --fix=data/examples/quickfix/FIX.4.4/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens')\n console.log()\n\n console.log('structure format i.e. show locations of components etc.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens --structures')\n console.log()\n\n console.log('full JS object in JSON format.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens --objects')\n console.log()\n\n console.log('full JS object in JSON format - filter only type messages.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens --type=8 --objects')\n console.log()\n\n console.log('timing stats and message counts. Structured parsing of all messages.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt --stats')\n console.log()\n\n console.log('encode a json object to fix format')\n console.log('node dist/jsfix-cmd --json=data/examples/FIX.4.4/quickfix/execution-report/object.json' +\n ' --session=data/session.json --type=8 --delimiter=\"|\"')\n console.log()\n\n console.log('display field definition')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --field=MsgType|35')\n console.log()\n\n console.log('display field use fix repo dictionary e.g. 271 MDEntrySize QTY Quantity or volume represented by the Market Data Entry.')\n console.log('node dist/jsfix-cmd --dict=data/fix_repo/FIX.4.4/Base --field=MsgType')\n console.log('node dist/jsfix-cmd --dict=data/fix_repo/FIX.4.4/Base --field=35')\n console.log()\n\n console.log('script to describe field in repository version 4.4')\n console.log('npm run repo44 -- --field=8')\n console.log()\n\n console.log('script to describe field in fixml')\n console.log('npm run fixml -- --field=50')\n console.log()\n\n console.log('generate unit test set of files - i.e. randomly generate an object, encode to fix. density 1 is all fields')\n console.log('node dist/jsfix-cmd --generate --type=AE --density=0.8 --unit --delimiter=\"|\" --session=data/session/test-initiator.json')\n console.log('npm run repo44-unit -- --type=AE')\n console.log('test script with no repeat groups')\n console.log('npm run repo44-unit -- --type=AE --groups=false')\n console.log()\n\n console.log('generate a fix log of randomly generated but syntactically correct messages')\n console.log('node dist/jsfix-cmd --generate --density=0.8 --repeats=50 --script --delimiter=\"|\" --session=data/session/test-initiator.json')\n console.log('npm run repo44-script')\n console.log('parse above generated script')\n console.log('npm run repo44-repscr')\n console.log()\n\n console.log('replay example repo fix file of 50 messages.')\n console.log('node dist/jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --stats')\n console.log('npm run repo44-replay -- --stats')\n console.log('npm run repo44-replay -- --objects')\n console.log('npm run repo44-replay -- --tokens')\n console.log('npm run repo44-replay -- --structures')\n console.log()\n\n console.log('benchmark parse a message')\n console.log('node dist/jsfix-cmd --delimiter=\"|\" --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/repo/trade-capture-no-groups/fix.txt --benchmark')\n console.log('npm run repo44-bench -- --fix=data/examples/FIX.4.4/repo/trade-capture-no-groups/fix.txt')\n console.log()\n\n console.log('compile typescript interfaces - i.e. outputs to src/types/FIX4.4 - requires set and enum sub folders')\n console.log('npm run cmd -- --dict=repo40 --compile')\n console.log('npm run cmd -- --dict=repo41 --compile')\n console.log('npm run cmd -- --dict=repo42 --compile')\n console.log('npm run cmd -- --dict=repo43 --compile')\n console.log('npm run cmd -- --dict=repo44 --compile')\n console.log('npm run cmd -- --dict=repo50 --compile')\n console.log('npm run cmd -- --dict=repo50sp1 --compile')\n console.log('npm run cmd -- --dict=repo50sp2 --compile')\n console.log('npm run cmd -- --dict=repofixml --compile')\n console.log('npm run cmd -- --dict=qf44 --compile')\n console.log('npm run cmd -- --dict=data/handmade.xml --compile --output=src/types/handmade')\n\n console.log()\n}\n\nconst help: boolean = argv.h || argv.help\nif (help) {\n showHelp()\n} else {\n const cmd: JsfixCmd = new JsfixCmd()\n cmd.exec().then((res: boolean) => {\n if (!res) {\n showHelp()\n }\n }).catch((e: Error) => {\n console.error(e)\n })\n}\n"]}
1
+ {"version":3,"file":"jsfix-cmd.js","sourceRoot":"","sources":["../src/jsfix-cmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAAyB;AAEzB,qCAA4D;AAC5D,0CAAmE;AAGnE,iCAAkF;AAClF,2CAA2E;AAE3E,mCAAgC;AAGhC,2CAA4B;AAC5B,qCAAqC;AACrC,2CAA4B;AAC5B,iDAAkD;AAClD,oDAAoF;AAEpF,uCAA4C;AAC5C,mDAA8C;AAC9C,wEAA2C;AAC3C,wGAAgG;AAEhG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,OAAO,GAAG,IAAA,0BAAY,EAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,gBAAgB;KAC1B;IAED,I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AAC","sourcesContent":["import 'reflect-metadata'\n\nimport { ElasticBuffer, MsgView, MsgParser } from './buffer'\nimport { AsciiParser, AsciiView, AsciiChars } from './buffer/ascii'\nimport { ILooseObject } from './collections/collection'\nimport { SimpleFieldDefinition, FixDefinitions } from './dictionary/definition'\nimport { MessageGenerator, JsonHelper, getWords, DefinitionFactory } from './util'\nimport { ISessionDescription, FileDuplex, StringDuplex } from './transport'\n\nimport { MsgTag } from './types'\nimport { IJsFixConfig } from './config'\n\nimport * as util from 'util'\nimport minimist = require('minimist')\nimport * as path from 'path'\nimport { MsgTransport } from './transport/factory'\nimport { EnumCompiler, ICompilerSettings, MsgCompiler } from './dictionary/compiler'\nimport { AsciiMsgTransmitter } from './transport/ascii/ascii-msg-transmitter'\nimport { SessionContainer } from './runtime'\nimport { DITokens } from './runtime/di-tokens'\nimport buildOptions from 'minimist-options'\nimport { QuickFixXmlFileBuilder } from './dictionary/parser/quickfix/quick-fix-xml-file-builder'\n\nconst fs = require('fs')\n\nconst options = buildOptions({\n dict: {\n type: 'string',\n alias: 'd',\n default: 'data/FIX44.xml'\n },\n\n type: {\n type: 'string-array',\n alias: 't'\n },\n\n fix: {\n type: 'string',\n alias: 'f',\n default: 'data/FIX44.xml'\n },\n\n session: {\n type: 'string',\n alias: 's'\n },\n\n delimiter: {\n type: 'string',\n alias: 'l',\n default: '|'\n },\n\n help: {\n type: 'boolean',\n alias: ['h'],\n default: false\n },\n\n unit: {\n type: 'boolean',\n alias: ['u'],\n default: false\n },\n\n generate: {\n type: 'boolean',\n alias: ['g'],\n default: false\n },\n\n stats: {\n type: 'boolean',\n alias: ['st'],\n default: false\n },\n\n tokens: {\n type: 'boolean',\n alias: ['t'],\n default: false\n },\n\n objects: {\n type: 'boolean',\n alias: ['o'],\n default: true\n },\n\n structures: {\n type: 'boolean',\n alias: ['r'],\n default: false\n },\n\n script: {\n type: 'boolean',\n alias: ['i'],\n default: false\n },\n\n compile: {\n type: 'boolean',\n alias: ['c'],\n default: false\n },\n\n groups: {\n type: 'boolean',\n alias: ['g'],\n default: true\n },\n\n density: {\n type: 'number',\n alias: 'd',\n default: 0.8\n },\n\n repeats: {\n type: 'number',\n alias: 'r',\n default: 1\n },\n\n arr: {\n type: 'array',\n alias: 'a',\n default: []\n }\n\n /*\n booleans: {\n type: 'boolean-array',\n alias: 'b',\n default: [true, false]\n },\n\n numbers: {\n type: 'number-array',\n alias: 'n',\n default: [0, 1]\n },\n\n published: 'boolean',\n\n // Special option for positional arguments (`_` in minimist)\n arguments: 'string'\n */\n})\n\nconst argv: any = minimist(process.argv.slice(2), options)\n\nenum PrintMode {\n Structure = 1,\n Object = 2,\n Verbose = 3,\n Stats = 4,\n Token = 5,\n Encoded = 6\n}\n\nenum Command {\n Generate = 1,\n Replay = 2,\n Lookup = 3,\n Encode = 4,\n Benchmark = 5,\n Compile = 6,\n Trim,\n Unknown = 8\n}\n\nclass ParseSummary {\n public readonly micros_per_msg: number\n public readonly chars_per_second: number\n public readonly fields_per_second: number\n public readonly content_length: number\n\n constructor (\n public readonly content: string,\n public readonly view: string,\n public readonly msg_type: string,\n public readonly iterations: number,\n public readonly elapsed_ms: number,\n public readonly fields: number\n ) {\n this.content_length = this.content.length\n this.micros_per_msg = (this.elapsed_ms / this.iterations) * 1000\n this.chars_per_second = Math.round(this.content_length * this.iterations / this.elapsed_ms * 1000)\n this.fields_per_second = Math.round(this.fields * this.iterations / this.elapsed_ms * 1000)\n }\n}\n\nexport class JsfixCmd {\n private readonly root: string = path.join(__dirname, '../')\n private definitions: FixDefinitions\n private jsonHelper: JsonHelper\n private session: AsciiMsgTransmitter\n private sessionDescription: ISessionDescription\n private delimiter: number = AsciiChars.Soh\n private stats: ILooseObject = {}\n private readonly filter: Map<string, boolean> = new Map<string, boolean>()\n private messages: number = 0\n private print: boolean = true\n\n private static getCommand (): Command {\n let command: Command = Command.Unknown\n if (argv.trim) {\n command = Command.Trim\n } else if (argv.compile) {\n command = Command.Compile\n } else if (argv.generate) {\n command = Command.Generate\n } else if (argv.fix) {\n command = argv.benchmark ? Command.Benchmark : Command.Replay\n } else if (argv.field) {\n command = Command.Lookup\n } else if (argv.json) {\n command = Command.Encode\n } else if (argv.msg) {\n command = Command.Lookup\n }\n return command\n }\n\n private static getPrintMode (): PrintMode {\n let mode: PrintMode = PrintMode.Stats\n if (argv.tokens) {\n mode = PrintMode.Token\n } else if (argv.stats) {\n mode = PrintMode.Stats\n } else if (argv.objects) {\n mode = PrintMode.Object\n } else if (argv.verbose) {\n mode = PrintMode.Verbose\n } else if (argv.structures) {\n mode = PrintMode.Structure\n } else if (argv.encoded) {\n mode = PrintMode.Encoded\n } else if (argv.trim) {\n mode = PrintMode.Object\n }\n return mode\n }\n\n private static async writeFile (name: string, api: string): Promise<void> {\n const writer = util.promisify(fs.writeFile)\n await writer(name, api, { encoding: 'utf8' }\n ).catch((e: Error) => {\n throw e\n })\n }\n\n public async exec (): Promise<any> {\n return await new Promise<any>((resolve, reject) => {\n this.init().then(async () => {\n let actioned: boolean = true\n const command = JsfixCmd.getCommand()\n\n switch (command) {\n case Command.Generate: {\n // produce a test message or a valid fix log of n messages\n await this.generate()\n break\n }\n\n case Command.Encode: {\n // encode a json message back to fix\n this.encode()\n break\n }\n\n case Command.Replay: {\n // parse a file into either objects, tokens, structures or stats\n const repeats: number = !isNaN(argv.repeats) ? argv.repeats : 1\n try {\n for (let i: number = 0; i < repeats; ++i) {\n await this.replay()\n }\n } catch (e) {\n reject(e)\n }\n break\n }\n\n case Command.Benchmark: {\n // time how long to parse 10000 repeats of contents of file\n const repeats: number = !isNaN(argv.repeats) ? argv.repeats : 10000\n try {\n const summary = await this.benchmark(repeats)\n console.log(JSON.stringify(summary, null, 4))\n } catch (e) {\n reject(e)\n }\n break\n }\n\n case Command.Lookup: {\n // lookup a field\n if (argv.field) {\n this.field()\n } else {\n this.msg()\n }\n break\n }\n\n case Command.Compile: {\n await this.compile()\n break\n }\n\n case Command.Trim: {\n const xml = this.trim()\n console.log(xml)\n break\n }\n\n case Command.Unknown:\n default: {\n actioned = false\n }\n }\n resolve(actioned)\n }).catch((e) => {\n reject(e)\n })\n })\n }\n\n private async firstMessage (t: MsgTransport): Promise<MsgView> {\n return await new Promise<MsgView>((resolve, reject) => {\n t.receiver.on('msg', (msgType: string, msgView: MsgView) => {\n resolve(msgView.clone())\n })\n t.receiver.on('error', (e) => {\n reject(e)\n })\n })\n }\n\n protected async generate (): Promise<void> {\n const lipPath: string = path.join(this.root, 'data/examples/lipsum.txt')\n const words: string[] = await getWords(lipPath)\n const generator = new MessageGenerator(words, this.definitions)\n let density = 1\n if (argv.density) {\n density = parseFloat(argv.density)\n }\n if (isNaN(density)) {\n console.log('density must be numeric in range > 0 density <= 1.0')\n return\n }\n\n if (argv.script) {\n await this.script(generator, density)\n } else {\n await this.single(generator, density)\n }\n }\n\n private async single (generator: MessageGenerator, density: number): Promise<void> {\n if (!argv.type) {\n console.log('specify type to generate e.g. --type = AE')\n return\n }\n const msgType: string = `${argv.type}`\n let makeGroups: boolean = true\n if (argv.groups) {\n makeGroups = argv.groups === 'true'\n }\n const obj: ILooseObject = generator.generate(msgType, density, makeGroups)\n console.log(JSON.stringify(obj, null, 4))\n const fix: string = this.encodeObject(msgType, obj)\n const ft: MsgTransport = new MsgTransport(1, this.session.config, new StringDuplex(fix))\n if (argv.unit) {\n await this.unitTest(fix, obj, ft)\n } else {\n this.subscribe(ft)\n }\n }\n\n private async script (generator: MessageGenerator, density: number): Promise<void> {\n const buffer: ElasticBuffer = new ElasticBuffer()\n const repeats: number = argv.repeats || 50\n const key: string = MsgTag.MsgType.toString()\n const sf = this.definitions.simple.get(key)\n const session: AsciiMsgTransmitter = this.session\n for (let i = 0; i < repeats; ++i) {\n const msgType: string = sf ? MessageGenerator.getRandomEnum(sf).toString() : ''\n console.log(`i = ${i} ${msgType}`)\n const obj: ILooseObject = generator.generate(msgType, density)\n session.encodeMessage(msgType, obj)\n buffer.writeBuffer(session.buffer.slice())\n buffer.writeString(require('os').EOL)\n }\n await JsfixCmd.writeFile('./fix.txt', buffer.slice().toString('utf8'))\n }\n\n private async unitTest (fix: string, obj: ILooseObject, ft: MsgTransport): Promise<void> {\n const view: MsgView = await this.firstMessage(ft)\n const summary = view?.structure?.summary()\n\n await JsfixCmd.writeFile('./fix.txt', fix)\n await JsfixCmd.writeFile('./object.json', JSON.stringify(obj, null, 4))\n await JsfixCmd.writeFile('./token.txt', view.toString())\n await JsfixCmd.writeFile('./structure.json', JSON.stringify(summary, null, 4))\n }\n\n private encodeObject (msgType: string, object: ILooseObject): string {\n const session: AsciiMsgTransmitter = this.session\n session.encodeMessage(msgType, object)\n return session.buffer.toString()\n }\n\n private msg (): void {\n const definitions = this.definitions\n const m = definitions.message.get(argv.msg)\n if (m) {\n console.log(m.toString())\n }\n }\n\n private field (): void {\n let sf: SimpleFieldDefinition | undefined\n const tag: number = parseInt(argv.field, 10)\n const definitions = this.definitions\n if (!isNaN(tag)) {\n sf = definitions.tagToSimple[tag]\n } else {\n sf = definitions.simple.get(argv.field)\n }\n if (sf) {\n console.log(sf.toString())\n }\n }\n\n async ensureExists (path: string): Promise<any> {\n return await new Promise<any>((resolve, reject) => {\n fs.mkdir(path, { recursive: true }, (err: Error) => {\n if (err) {\n reject(err)\n } else {\n resolve(true)\n }\n })\n })\n }\n\n private async compileDefinitions (outputPath: string): Promise<void> {\n await this.ensureExists(path.join(outputPath, 'set'))\n await this.ensureExists(path.join(outputPath, 'enum'))\n const definitions = this.definitions\n const compilerSettings: ICompilerSettings = require('../data/compiler.json')\n compilerSettings.output = outputPath\n const msgCompiler: MsgCompiler = new MsgCompiler(definitions, compilerSettings)\n await msgCompiler.generate()\n const enumCompiler: EnumCompiler = new EnumCompiler(definitions, compilerSettings)\n const writeFile = path.join(compilerSettings.output, './enum/all-enum.ts')\n await enumCompiler.generate(writeFile)\n }\n\n private trim (): string {\n this.setFilter()\n const types = this.filter.size > 0 ? Array.from(this.filter.keys()) : Array.from(this.definitions.simple.get('MsgType')?.enums.keys() ?? [])\n const qfb = new QuickFixXmlFileBuilder(this.definitions)\n qfb.write(types)\n return qfb.elasticBuffer.toString()\n }\n\n private async compile (): Promise<void> {\n let output = argv.output\n const dp = new DefinitionFactory().getDictPath(argv.dict)\n if (dp) {\n output = dp.output\n }\n output = path.join(this.root, output)\n await this.compileDefinitions(output)\n }\n\n sys: SessionContainer\n config: IJsFixConfig\n\n private async init (): Promise<any> {\n let session: string = argv.session || 'data/session/test-initiator.json'\n this.sys = new SessionContainer()\n this.sys.registerGlobal('error')\n session = this.norm(session)\n this.sessionDescription = require(session)\n const container = await this.sys.makeSystem(this.sessionDescription)\n this.config = container.resolve<IJsFixConfig>(DITokens.IJsFixConfig)\n this.definitions = this.config.definitions\n let dict: string\n if (argv.dict) {\n dict = argv.dict\n const df = await new DefinitionFactory().getDefinitions(dict)\n this.config.definitions = df\n this.definitions = df\n }\n const definitions = this.definitions\n if (argv.delimiter) {\n this.delimiter = AsciiChars.firstChar(argv.delimiter)\n this.config.delimiter = this.delimiter\n }\n this.jsonHelper = new JsonHelper(definitions)\n if (argv.session) {\n this.session = container.resolve<AsciiMsgTransmitter>(DITokens.MsgTransmitter)\n }\n }\n\n private setFilter (): void {\n const types: string[] = []\n if (argv.type != null) {\n if (Array.isArray(argv.type)) {\n argv.type.forEach((mt: any) => {\n types.push(mt)\n })\n } else {\n argv.type.split(',').forEach((mt: string) => {\n types.push(mt)\n })\n }\n types.forEach((mt: any) => {\n this.filter.set(mt, true)\n })\n }\n }\n\n private async dispatch (ft: MsgTransport): Promise<any> {\n this.setFilter()\n let time: boolean = false\n if (argv.time || argv.stats) {\n this.print = false\n time = true\n }\n this.subscribe(ft)\n const startsAt: Date = new Date()\n await ft.wait()\n const elapsed: number = new Date().getTime() - startsAt.getTime()\n if (time) {\n console.log(`messages ${this.messages} elapsed ms ${elapsed}`)\n }\n if (argv.stats) {\n console.log(JSON.stringify(this.stats, null, 4))\n }\n }\n\n private subscribe (ft: MsgTransport): void {\n this.messages = 0\n this.stats = {}\n const filter = this.filter\n // the receiver is message parser which is piped from an input stream - file, socket\n ft.receiver.on('msg', (msgType: string, m: AsciiView) => {\n if (filter) {\n if (filter.has(msgType)) {\n return\n }\n }\n ++this.messages\n this.onMsg(msgType, m)\n })\n }\n\n private onMsg (msgType: string, m: MsgView): void {\n const mode: PrintMode = JsfixCmd.getPrintMode()\n const print = this.print\n const stats = this.stats\n switch (mode) {\n case PrintMode.Stats: {\n let i: number = 0\n if (!stats[msgType]) {\n i = 1\n } else {\n i = stats[msgType] as number + 1\n }\n stats[msgType] = i\n break\n }\n\n case PrintMode.Verbose: {\n const verbose = m.toVerbose()\n if (verbose) {\n console.log(verbose)\n }\n break\n }\n\n case PrintMode.Object: {\n const asObject: ILooseObject = m.toObject() as ILooseObject\n if (print) {\n const def = this.definitions.message.get(msgType)\n console.log(`${msgType} [${def?.name}] = ${JSON.stringify(asObject, null, 4)}`)\n console.log()\n }\n break\n }\n\n case PrintMode.Structure: {\n const summary = m?.structure?.summary()\n if (print) {\n console.log(JSON.stringify(summary, null, 4))\n }\n break\n }\n\n case PrintMode.Token: {\n const tokens = m.toString()\n if (print) {\n console.log(tokens)\n }\n break\n }\n\n case PrintMode.Encoded: {\n const fix: string = this.encodeObject(msgType, m.toObject() as ILooseObject)\n console.log(fix)\n break\n }\n\n default:\n throw new Error(`unknown mode ${mode}`)\n }\n }\n\n private async replay (): Promise<any> {\n if (!argv.fix) {\n console.log('provide a path to fix file i.e. --fix=data/examples/execution-report/fix.txt')\n return\n }\n const fix: string = this.norm(argv.fix)\n const config = this.config\n const ft: MsgTransport = new MsgTransport(1, config, new FileDuplex(fix))\n await this.dispatch(ft)\n }\n\n private async promisedRead (f: string): Promise<string> {\n return new Promise((resolve, reject) => {\n fs.readFile(f, 'utf8', async (err: Error, contents: string) => {\n if (err) {\n reject(err)\n }\n resolve(contents)\n })\n })\n }\n\n async benchParse (contents: string, iterations: number): Promise<ParseSummary> {\n return new Promise((resolve, reject) => {\n const toParse = new StringDuplex(contents.repeat(iterations))\n const startsAt: Date = new Date()\n let i = 0\n const config = this.config\n const buffer = config.sessionContainer.resolve<ElasticBuffer>(DITokens.ParseBuffer)\n const asciiParser: MsgParser = new AsciiParser(config, toParse.readable, buffer)\n asciiParser.on('msg', (msgType: string, v: MsgView) => {\n ++i\n if (i === iterations) {\n const elapsed: number = new Date().getTime() - startsAt.getTime()\n const fields = v?.structure?.tags.nextTagPos ?? 0\n const summary = new ParseSummary(contents, v.toString(), msgType, iterations, elapsed, fields)\n resolve(summary)\n }\n })\n asciiParser.on('error', e => {\n reject(e)\n })\n })\n }\n\n private async benchmark (repeats: number): Promise<(ParseSummary | null)> {\n if (!argv.fix) {\n console.log('provide a path to fix file i.e. --fix=data/examples/execution-report/fix.txt')\n return null\n }\n return await new Promise<any>((resolve, reject) => {\n const fix: string = this.norm(argv.fix)\n this.promisedRead(fix)\n .then(contents => {\n this.benchParse(contents, repeats)\n .then((a: ParseSummary) => {\n resolve(a)\n })\n .catch(e => { reject(e) })\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n private encode (): void {\n const session: AsciiMsgTransmitter = this.session\n if (!session) {\n console.log('provide a session json file e.g. --session=data/session/test-initiator.json')\n return\n }\n if (!argv.type) {\n console.log('provide a message type e.g. --type=8')\n return\n }\n if (!argv.json) {\n console.log('provide a json representation e.g. data/examples/execution-report/object.json')\n return\n }\n const ts: string = argv.type.toString()\n const msg: ILooseObject = this.jsonHelper.fromJson(path.join(this.root, argv.json), ts)\n session.encodeMessage(ts, msg)\n const fix: string = session.buffer.toString()\n console.log(fix)\n }\n\n private norm (p: string): string {\n let f: string = p\n if (!path.isAbsolute(p)) {\n f = path.join(this.root, f)\n }\n return f\n }\n}\n\nfunction showHelp (): void {\n console.log('this help page')\n console.log('npm run cmd')\n console.log('npm run cmd -- --help')\n console.log()\n\n console.log('print to console a trim quickfix format xml only including given message types')\n console.log('node dist/jsfix-cmd --dict=qf44 --trim --type=\"0,1,2,3,4,5,AE\"')\n\n console.log('token format i.e. [602] 687 (LegQty) = 33589')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/quickfix/FIX.4.4/execution-report/fix.txt --delimiter=\"|\" --tokens')\n console.log()\n\n console.log('token format use fix repo dictionary')\n console.log('node dist/jsfix-cmd --dict=data/fix_repo/FIX.4.4/Base --fix=data/examples/quickfix/FIX.4.4/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens')\n console.log()\n\n console.log('structure format i.e. show locations of components etc.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens --structures')\n console.log()\n\n console.log('full JS object in JSON format.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens --objects')\n console.log()\n\n console.log('full JS object in JSON format - filter only type messages.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt' +\n ' --delimiter=\"|\" --tokens --type=8 --objects')\n console.log()\n\n console.log('timing stats and message counts. Structured parsing of all messages.')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --fix=data/examples/FIX.4.4/quickfix/execution-report/fix.txt --stats')\n console.log()\n\n console.log('encode a json object to fix format')\n console.log('node dist/jsfix-cmd --json=data/examples/FIX.4.4/quickfix/execution-report/object.json' +\n ' --session=data/session.json --type=8 --delimiter=\"|\"')\n console.log()\n\n console.log('display field definition')\n console.log('node dist/jsfix-cmd --dict=data/FIX44.xml --field=MsgType|35')\n console.log()\n\n console.log('display field use fix repo dictionary e.g. 271 MDEntrySize QTY Quantity or volume represented by the Market Data Entry.')\n console.log('node dist/jsfix-cmd --dict=data/fix_repo/FIX.4.4/Base --field=MsgType')\n console.log('node dist/jsfix-cmd --dict=data/fix_repo/FIX.4.4/Base --field=35')\n console.log()\n\n console.log('script to describe field in repository version 4.4')\n console.log('npm run repo44 -- --field=8')\n console.log()\n\n console.log('script to describe field in fixml')\n console.log('npm run fixml -- --field=50')\n console.log()\n\n console.log('generate unit test set of files - i.e. randomly generate an object, encode to fix. density 1 is all fields')\n console.log('node dist/jsfix-cmd --generate --type=AE --density=0.8 --unit --delimiter=\"|\" --session=data/session/test-initiator.json')\n console.log('npm run repo44-unit -- --type=AE')\n console.log('test script with no repeat groups')\n console.log('npm run repo44-unit -- --type=AE --groups=false')\n console.log()\n\n console.log('generate a fix log of randomly generated but syntactically correct messages')\n console.log('node dist/jsfix-cmd --generate --density=0.8 --repeats=50 --script --delimiter=\"|\" --session=data/session/test-initiator.json')\n console.log('npm run repo44-script')\n console.log('parse above generated script')\n console.log('npm run repo44-repscr')\n console.log()\n\n console.log('replay example repo fix file of 50 messages.')\n console.log('node dist/jsfix-cmd --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/fix.txt --delimiter=\"|\" --stats')\n console.log('npm run repo44-replay -- --stats')\n console.log('npm run repo44-replay -- --objects')\n console.log('npm run repo44-replay -- --tokens')\n console.log('npm run repo44-replay -- --structures')\n console.log()\n\n console.log('benchmark parse a message')\n console.log('node dist/jsfix-cmd --delimiter=\"|\" --session=data/session/test-initiator.json --fix=data/examples/FIX.4.4/repo/trade-capture-no-groups/fix.txt --benchmark')\n console.log('npm run repo44-bench -- --fix=data/examples/FIX.4.4/repo/trade-capture-no-groups/fix.txt')\n console.log()\n\n console.log('compile typescript interfaces - i.e. outputs to src/types/FIX4.4 - requires set and enum sub folders')\n console.log('npm run cmd -- --dict=repo40 --compile')\n console.log('npm run cmd -- --dict=repo41 --compile')\n console.log('npm run cmd -- --dict=repo42 --compile')\n console.log('npm run cmd -- --dict=repo43 --compile')\n console.log('npm run cmd -- --dict=repo44 --compile')\n console.log('npm run cmd -- --dict=repo50 --compile')\n console.log('npm run cmd -- --dict=repo50sp1 --compile')\n console.log('npm run cmd -- --dict=repo50sp2 --compile')\n console.log('npm run cmd -- --dict=repofixml --compile')\n console.log('npm run cmd -- --dict=qf44 --compile')\n console.log('npm run cmd -- --dict=data/handmade.xml --compile --output=src/types/handmade')\n\n console.log()\n}\n\nconst help: boolean = argv.h || argv.help\nif (help) {\n showHelp()\n} else {\n const cmd: JsfixCmd = new JsfixCmd()\n cmd.exec().then((res: boolean) => {\n if (!res) {\n showHelp()\n }\n }).catch((e: Error) => {\n console.error(e)\n })\n}\n"]}
@@ -16,7 +16,6 @@ const config_1 = require("../config");
16
16
  const di_tokens_1 = require("./di-tokens");
17
17
  const make_config_1 = require("./make-config");
18
18
  const tcp_1 = require("../transport/tcp");
19
- const http_1 = require("../transport/http");
20
19
  const ascii_msg_transmitter_1 = require("../transport/ascii/ascii-msg-transmitter");
21
20
  const fixml_msg_transmitter_1 = require("../transport/fixml/fixml-msg-transmitter");
22
21
  const fixml_1 = require("../transport/fixml");
@@ -24,6 +23,9 @@ const ascii_1 = require("../transport/ascii");
24
23
  const buffer_1 = require("../buffer");
25
24
  const ascii_2 = require("../buffer/ascii");
26
25
  const fixml_2 = require("../buffer/fixml");
26
+ function httpTransport() {
27
+ return require('../transport/http');
28
+ }
27
29
  class SessionContainer {
28
30
  constructor(msgFactoryProvider = null) {
29
31
  this.msgFactoryProvider = msgFactoryProvider;
@@ -151,23 +153,24 @@ class SessionContainer {
151
153
  useClass: fixml_2.FixmlEncoder
152
154
  });
153
155
  sessionContainer.registerInstance(di_tokens_1.DITokens.TransmitBuffer, new buffer_1.ElasticBuffer(sendSize));
154
- sessionContainer.register(http_1.HttpAcceptorListener, {
155
- useClass: http_1.HttpAcceptorListener
156
+ const { HttpInitiator, HttpAcceptorListener, HttpJsonSampleAdapter } = httpTransport();
157
+ sessionContainer.register(HttpAcceptorListener, {
158
+ useClass: HttpAcceptorListener
156
159
  });
157
- sessionContainer.register(http_1.HttpInitiator, {
158
- useClass: http_1.HttpInitiator
160
+ sessionContainer.register(HttpInitiator, {
161
+ useClass: HttpInitiator
159
162
  });
160
163
  if (this.isInitiator(description)) {
161
164
  sessionContainer.register(di_tokens_1.DITokens.FixEntity, {
162
- useClass: http_1.HttpInitiator
165
+ useClass: HttpInitiator
163
166
  });
164
167
  sessionContainer.register(di_tokens_1.DITokens.IHttpAdapter, {
165
- useClass: http_1.HttpJsonSampleAdapter
168
+ useClass: HttpJsonSampleAdapter
166
169
  });
167
170
  }
168
171
  else {
169
172
  sessionContainer.register(di_tokens_1.DITokens.FixEntity, {
170
- useClass: http_1.HttpAcceptorListener
173
+ useClass: HttpAcceptorListener
171
174
  });
172
175
  }
173
176
  }