@homaiohq/napi-quickfix 0.0.0-stage → 0.1.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.
Files changed (131) hide show
  1. package/CMakeLists.txt +131 -0
  2. package/LICENSE +21 -0
  3. package/README.md +421 -2
  4. package/THIRD_PARTY_LICENSES +48 -0
  5. package/cpp/acceptor_wrap.cpp +234 -0
  6. package/cpp/acceptor_wrap.h +57 -0
  7. package/cpp/addon.cpp +83 -0
  8. package/cpp/application_bridge.cpp +382 -0
  9. package/cpp/application_bridge.h +151 -0
  10. package/cpp/data_dictionary_wrap.cpp +79 -0
  11. package/cpp/data_dictionary_wrap.h +37 -0
  12. package/cpp/engine_common.cpp +5 -0
  13. package/cpp/engine_common.h +19 -0
  14. package/cpp/engine_workers.h +86 -0
  15. package/cpp/enums.cpp +66 -0
  16. package/cpp/errors.h +142 -0
  17. package/cpp/initiator_wrap.cpp +255 -0
  18. package/cpp/initiator_wrap.h +69 -0
  19. package/cpp/message_wrap.cpp +195 -0
  20. package/cpp/message_wrap.h +53 -0
  21. package/cpp/session_id_wrap.cpp +91 -0
  22. package/cpp/session_id_wrap.h +46 -0
  23. package/cpp/session_settings_wrap.cpp +98 -0
  24. package/cpp/session_settings_wrap.h +40 -0
  25. package/cpp/session_static.cpp +93 -0
  26. package/dist/cjs/acceptor.d.ts +30 -0
  27. package/dist/cjs/acceptor.d.ts.map +1 -0
  28. package/dist/cjs/acceptor.js +39 -0
  29. package/dist/cjs/acceptor.js.map +1 -0
  30. package/dist/cjs/application.d.ts +116 -0
  31. package/dist/cjs/application.d.ts.map +1 -0
  32. package/dist/cjs/application.js +63 -0
  33. package/dist/cjs/application.js.map +1 -0
  34. package/dist/cjs/data-dictionary.d.ts +49 -0
  35. package/dist/cjs/data-dictionary.d.ts.map +1 -0
  36. package/dist/cjs/data-dictionary.js +77 -0
  37. package/dist/cjs/data-dictionary.js.map +1 -0
  38. package/dist/cjs/engine.d.ts +114 -0
  39. package/dist/cjs/engine.d.ts.map +1 -0
  40. package/dist/cjs/engine.js +138 -0
  41. package/dist/cjs/engine.js.map +1 -0
  42. package/dist/cjs/enums.d.ts +22 -0
  43. package/dist/cjs/enums.d.ts.map +1 -0
  44. package/dist/cjs/enums.js +49 -0
  45. package/dist/cjs/enums.js.map +1 -0
  46. package/dist/cjs/generated/fields.d.ts +6123 -0
  47. package/dist/cjs/generated/fields.d.ts.map +1 -0
  48. package/dist/cjs/generated/fields.js +6128 -0
  49. package/dist/cjs/generated/fields.js.map +1 -0
  50. package/dist/cjs/index.d.ts +47 -0
  51. package/dist/cjs/index.d.ts.map +1 -0
  52. package/dist/cjs/index.js +73 -0
  53. package/dist/cjs/index.js.map +1 -0
  54. package/dist/cjs/initiator.d.ts +30 -0
  55. package/dist/cjs/initiator.d.ts.map +1 -0
  56. package/dist/cjs/initiator.js +39 -0
  57. package/dist/cjs/initiator.js.map +1 -0
  58. package/dist/cjs/load-native.cjs +5 -0
  59. package/dist/cjs/message.d.ts +114 -0
  60. package/dist/cjs/message.d.ts.map +1 -0
  61. package/dist/cjs/message.js +162 -0
  62. package/dist/cjs/message.js.map +1 -0
  63. package/dist/cjs/native.d.ts +163 -0
  64. package/dist/cjs/native.d.ts.map +1 -0
  65. package/dist/cjs/native.js +23 -0
  66. package/dist/cjs/native.js.map +1 -0
  67. package/dist/cjs/package.json +1 -0
  68. package/dist/cjs/session-id.d.ts +40 -0
  69. package/dist/cjs/session-id.d.ts.map +1 -0
  70. package/dist/cjs/session-id.js +67 -0
  71. package/dist/cjs/session-id.js.map +1 -0
  72. package/dist/cjs/session-settings.d.ts +47 -0
  73. package/dist/cjs/session-settings.d.ts.map +1 -0
  74. package/dist/cjs/session-settings.js +76 -0
  75. package/dist/cjs/session-settings.js.map +1 -0
  76. package/dist/esm/acceptor.d.ts +30 -0
  77. package/dist/esm/acceptor.d.ts.map +1 -0
  78. package/dist/esm/acceptor.js +35 -0
  79. package/dist/esm/acceptor.js.map +1 -0
  80. package/dist/esm/application.d.ts +116 -0
  81. package/dist/esm/application.d.ts.map +1 -0
  82. package/dist/esm/application.js +58 -0
  83. package/dist/esm/application.js.map +1 -0
  84. package/dist/esm/data-dictionary.d.ts +49 -0
  85. package/dist/esm/data-dictionary.d.ts.map +1 -0
  86. package/dist/esm/data-dictionary.js +73 -0
  87. package/dist/esm/data-dictionary.js.map +1 -0
  88. package/dist/esm/engine.d.ts +114 -0
  89. package/dist/esm/engine.d.ts.map +1 -0
  90. package/dist/esm/engine.js +134 -0
  91. package/dist/esm/engine.js.map +1 -0
  92. package/dist/esm/enums.d.ts +22 -0
  93. package/dist/esm/enums.d.ts.map +1 -0
  94. package/dist/esm/enums.js +45 -0
  95. package/dist/esm/enums.js.map +1 -0
  96. package/dist/esm/generated/fields.d.ts +6123 -0
  97. package/dist/esm/generated/fields.d.ts.map +1 -0
  98. package/dist/esm/generated/fields.js +6125 -0
  99. package/dist/esm/generated/fields.js.map +1 -0
  100. package/dist/esm/index.d.ts +47 -0
  101. package/dist/esm/index.d.ts.map +1 -0
  102. package/dist/esm/index.js +52 -0
  103. package/dist/esm/index.js.map +1 -0
  104. package/dist/esm/initiator.d.ts +30 -0
  105. package/dist/esm/initiator.d.ts.map +1 -0
  106. package/dist/esm/initiator.js +35 -0
  107. package/dist/esm/initiator.js.map +1 -0
  108. package/dist/esm/load-native.cjs +5 -0
  109. package/dist/esm/message.d.ts +114 -0
  110. package/dist/esm/message.d.ts.map +1 -0
  111. package/dist/esm/message.js +156 -0
  112. package/dist/esm/message.js.map +1 -0
  113. package/dist/esm/native.d.ts +163 -0
  114. package/dist/esm/native.d.ts.map +1 -0
  115. package/dist/esm/native.js +17 -0
  116. package/dist/esm/native.js.map +1 -0
  117. package/dist/esm/session-id.d.ts +40 -0
  118. package/dist/esm/session-id.d.ts.map +1 -0
  119. package/dist/esm/session-id.js +63 -0
  120. package/dist/esm/session-id.js.map +1 -0
  121. package/dist/esm/session-settings.d.ts +47 -0
  122. package/dist/esm/session-settings.d.ts.map +1 -0
  123. package/dist/esm/session-settings.js +72 -0
  124. package/dist/esm/session-settings.js.map +1 -0
  125. package/package.json +83 -4
  126. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  127. package/prebuilds/darwin-x64/node.napi.node +0 -0
  128. package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
  129. package/prebuilds/linux-x64/node.napi.musl.node +0 -0
  130. package/prebuilds/win32-x64/node.napi.node +0 -0
  131. package/src/load-native.cjs +5 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptor.js","sourceRoot":"","sources":["../../src/acceptor.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,2CAAqC;AACrC,2CAAyD;AAIzD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAsB,SAAQ,kBAAM;IAClC,qCAAqC;IACrC,YAAY,OAAsB;QAChC,KAAK,CAAC,kBAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Application-callback types for the session engine.
3
+ *
4
+ * Handlers are invoked **synchronously** by QuickFIX on its own threads via the
5
+ * native bridge. Two callbacks may mutate their message argument in place
6
+ * (`toAdmin`/`toApp`), and several may reject a message by **throwing** a typed
7
+ * rejection (`toApp`/`fromApp`/`fromAdmin`). Throwing anything else surfaces as
8
+ * a generic rejection.
9
+ *
10
+ * The {@link Initiator}/{@link Acceptor} also emit observe-only EventEmitter
11
+ * events mirroring these callbacks — but events cannot mutate or reject; that
12
+ * MUST go through the handlers.
13
+ */
14
+ import type { Message } from './message.js';
15
+ import type { SessionID } from './session-id.js';
16
+ /**
17
+ * User-supplied FIX application callbacks.
18
+ *
19
+ * All are optional. Runtime semantics:
20
+ * - `onCreate`/`onLogon`/`onLogout` — fire-and-forget notifications.
21
+ * - `toAdmin`/`toApp` — invoked before an outbound message is sent; may **mutate**
22
+ * the message in place (e.g. add credentials to a Logon in `toAdmin`).
23
+ * - `toApp` — additionally may **throw** {@link FixReject} with kind `'DoNotSend'`
24
+ * to suppress sending.
25
+ * - `fromAdmin`/`fromApp` — invoked for inbound messages; may **throw**
26
+ * {@link FixReject} to reject (e.g. `'RejectLogon'`, `'UnsupportedMessageType'`).
27
+ */
28
+ export interface ApplicationHandlers {
29
+ /** A new session was created. */
30
+ onCreate?(sessionID: SessionID): void;
31
+ /** A session successfully logged on. */
32
+ onLogon?(sessionID: SessionID): void;
33
+ /** A session logged out (or was disconnected). */
34
+ onLogout?(sessionID: SessionID): void;
35
+ /**
36
+ * About to send an admin (session-level) message. May mutate `message`.
37
+ * @param message The outbound message (mutable).
38
+ */
39
+ toAdmin?(message: Message, sessionID: SessionID): void;
40
+ /**
41
+ * About to send an application message. May mutate `message`, or throw a
42
+ * {@link FixReject} with kind `'DoNotSend'` to suppress it.
43
+ */
44
+ toApp?(message: Message, sessionID: SessionID): void;
45
+ /**
46
+ * Received an admin (session-level) message. May throw a {@link FixReject}
47
+ * (e.g. `'RejectLogon'`) to reject it.
48
+ */
49
+ fromAdmin?(message: Message, sessionID: SessionID): void;
50
+ /**
51
+ * Received an application message. May throw a {@link FixReject} (e.g.
52
+ * `'UnsupportedMessageType'`, `'DoNotSend'`) to reject it.
53
+ */
54
+ fromApp?(message: Message, sessionID: SessionID): void;
55
+ }
56
+ /**
57
+ * The kinds of rejection the native bridge understands. Throwing a
58
+ * {@link FixReject} with one of these maps to the matching QuickFIX behaviour:
59
+ * - `'DoNotSend'` → `FIX::DoNotSend` (from `toApp`)
60
+ * - `'RejectLogon'` → `FIX::RejectLogon` (from `fromAdmin`)
61
+ * - `'UnsupportedMessageType'` → `FIX::UnsupportedMessageType` (from `fromApp`)
62
+ * - `'IncorrectDataFormat'` → `FIX::IncorrectDataFormat`
63
+ * - `'IncorrectTagValue'` → `FIX::IncorrectTagValue`
64
+ * - `'FieldNotFound'` → `FIX::FieldNotFound`
65
+ */
66
+ export type FixRejectKind = 'DoNotSend' | 'RejectLogon' | 'UnsupportedMessageType' | 'IncorrectDataFormat' | 'IncorrectTagValue' | 'FieldNotFound';
67
+ /**
68
+ * A typed rejection error to throw from an {@link ApplicationHandlers} callback.
69
+ *
70
+ * The native bridge inspects a thrown error's `fixError` property (a
71
+ * {@link FixRejectKind}) to decide which QuickFIX exception to raise on the
72
+ * engine thread. Throwing any error without a recognized `fixError` results in a
73
+ * generic rejection.
74
+ *
75
+ * For symmetry with errors flowing the OTHER way (native → JS
76
+ * {@link import('./native.js').QuickFixError}), a `FixReject` also carries a
77
+ * `fixErrorName` set to the same stable {@link FixRejectKind} discriminator.
78
+ * Here `fixError` and `fixErrorName` are identical (the kinds are already
79
+ * space-free); the pair exists so both directions expose the same shape.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * handlers: {
84
+ * fromApp(msg) {
85
+ * if (msg.getMsgType() === 'X') throw new FixReject('UnsupportedMessageType');
86
+ * },
87
+ * }
88
+ * ```
89
+ */
90
+ export declare class FixReject extends Error {
91
+ /**
92
+ * Discriminator read by the native bridge to map to a FIX exception. The
93
+ * bridge maps rejections by THIS property.
94
+ */
95
+ readonly fixError: FixRejectKind;
96
+ /**
97
+ * Stable, space-free discriminator (equal to {@link FixReject.fixError}).
98
+ * Mirrors {@link import('./native.js').QuickFixError.fixErrorName} so both
99
+ * error directions share one shape.
100
+ */
101
+ readonly fixErrorName: FixRejectKind;
102
+ /** Optional extra detail forwarded to the engine where supported. */
103
+ readonly detail?: string;
104
+ constructor(kind: FixRejectKind, message?: string, detail?: string);
105
+ }
106
+ /**
107
+ * Convenience factory for a {@link FixReject}. Equivalent to
108
+ * `new FixReject(kind, message, detail)`.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * throw fixReject('DoNotSend');
113
+ * ```
114
+ */
115
+ export declare function fixReject(kind: FixRejectKind, message?: string, detail?: string): FixReject;
116
+ //# sourceMappingURL=application.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../src/application.ts"],"names":[],"mapp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AAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAMjE;CACF;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAE3F"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FixReject = void 0;
4
+ exports.fixReject = fixReject;
5
+ /**
6
+ * A typed rejection error to throw from an {@link ApplicationHandlers} callback.
7
+ *
8
+ * The native bridge inspects a thrown error's `fixError` property (a
9
+ * {@link FixRejectKind}) to decide which QuickFIX exception to raise on the
10
+ * engine thread. Throwing any error without a recognized `fixError` results in a
11
+ * generic rejection.
12
+ *
13
+ * For symmetry with errors flowing the OTHER way (native → JS
14
+ * {@link import('./native.js').QuickFixError}), a `FixReject` also carries a
15
+ * `fixErrorName` set to the same stable {@link FixRejectKind} discriminator.
16
+ * Here `fixError` and `fixErrorName` are identical (the kinds are already
17
+ * space-free); the pair exists so both directions expose the same shape.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * handlers: {
22
+ * fromApp(msg) {
23
+ * if (msg.getMsgType() === 'X') throw new FixReject('UnsupportedMessageType');
24
+ * },
25
+ * }
26
+ * ```
27
+ */
28
+ class FixReject extends Error {
29
+ /**
30
+ * Discriminator read by the native bridge to map to a FIX exception. The
31
+ * bridge maps rejections by THIS property.
32
+ */
33
+ fixError;
34
+ /**
35
+ * Stable, space-free discriminator (equal to {@link FixReject.fixError}).
36
+ * Mirrors {@link import('./native.js').QuickFixError.fixErrorName} so both
37
+ * error directions share one shape.
38
+ */
39
+ fixErrorName;
40
+ /** Optional extra detail forwarded to the engine where supported. */
41
+ detail;
42
+ constructor(kind, message, detail) {
43
+ super(message ?? kind);
44
+ this.name = 'FixReject';
45
+ this.fixError = kind;
46
+ this.fixErrorName = kind;
47
+ this.detail = detail;
48
+ }
49
+ }
50
+ exports.FixReject = FixReject;
51
+ /**
52
+ * Convenience factory for a {@link FixReject}. Equivalent to
53
+ * `new FixReject(kind, message, detail)`.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * throw fixReject('DoNotSend');
58
+ * ```
59
+ */
60
+ function fixReject(kind, message, detail) {
61
+ return new FixReject(kind, message, detail);
62
+ }
63
+ //# sourceMappingURL=application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/application.ts"],"names":[],"mappings":";;;;AA2EA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAuB,SAAQ,KAAK;IAClC;;;OAGG;IACM,QAAQ,CAAgB;IACjC;;;;OAIG;IACM,YAAY,CAAgB;IACrC,qEAAqE;IAC5D,MAAM,CAAU;IAEzB,YAAY,IAAmB,EAAE,OAAgB,EAAE,MAAe;QAChE,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;;AAED;;;;;;;;GAQG;AACH,mBAA0B,IAAmB,EAAE,OAAgB,EAAE,MAAe;IAC9E,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Ergonomic wrapper around the native `FIX::DataDictionary`.
3
+ */
4
+ import { type NativeDataDictionary } from './native.js';
5
+ import type { Message } from './message.js';
6
+ /**
7
+ * A FIX data dictionary, used to validate messages against a FIX spec XML.
8
+ *
9
+ * Construct via {@link DataDictionary.fromFile} or
10
+ * {@link DataDictionary.fromString}; direct construction is not supported.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const dd = DataDictionary.fromFile('./spec/FIX44.xml');
15
+ * dd.validate(msg); // throws QuickFixError if invalid
16
+ * ```
17
+ */
18
+ export declare class DataDictionary {
19
+ #private;
20
+ /** @internal Use {@link DataDictionary.fromFile} / {@link DataDictionary.fromString}. */
21
+ private constructor();
22
+ /**
23
+ * Load a data dictionary from a FIX spec XML file.
24
+ *
25
+ * @param xmlPath Path to the FIX spec XML (e.g. `FIX44.xml`).
26
+ * @throws A `QuickFixError` (`fixError: 'ConfigError'`) if the file is invalid.
27
+ */
28
+ static fromFile(xmlPath: string): DataDictionary;
29
+ /**
30
+ * Load a data dictionary from FIX spec XML held in memory.
31
+ *
32
+ * @param xml The FIX spec XML contents.
33
+ * @throws A `QuickFixError` (`fixError: 'ConfigError'`) if the XML is invalid.
34
+ */
35
+ static fromString(xml: string): DataDictionary;
36
+ /** @internal Wrap an existing native handle. */
37
+ static fromNative(handle: NativeDataDictionary): DataDictionary;
38
+ /** @internal The native handle backing this dictionary. */
39
+ get nativeHandle(): NativeDataDictionary;
40
+ /**
41
+ * Validate a message against this dictionary.
42
+ *
43
+ * @param msg The message to validate.
44
+ * @throws A `QuickFixError` on any validation failure (e.g.
45
+ * `fixError: 'InvalidMessage'` / `'FieldNotFound'` / `'IncorrectTagValue'`).
46
+ */
47
+ validate(msg: Message): void;
48
+ }
49
+ //# sourceMappingURL=data-dictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-dictionary.d.ts","sourceRoot":"","sources":["../../src/data-dictionary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAU,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,qBAAa,cAAc;;IAIzB,yFAAyF;IACzF,OAAO,eAEN;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAU/C;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAQ7C;IAED,gDAAgD;IAChD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAE9D;IAED,2DAA2D;IAC3D,IAAI,YAAY,IAAI,oBAAoB,CAEvC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAE3B;CACF"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataDictionary = void 0;
4
+ /**
5
+ * Ergonomic wrapper around the native `FIX::DataDictionary`.
6
+ */
7
+ const native_js_1 = require("./native.js");
8
+ /**
9
+ * A FIX data dictionary, used to validate messages against a FIX spec XML.
10
+ *
11
+ * Construct via {@link DataDictionary.fromFile} or
12
+ * {@link DataDictionary.fromString}; direct construction is not supported.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const dd = DataDictionary.fromFile('./spec/FIX44.xml');
17
+ * dd.validate(msg); // throws QuickFixError if invalid
18
+ * ```
19
+ */
20
+ class DataDictionary {
21
+ /** @internal Underlying native handle. */
22
+ #native;
23
+ /** @internal Use {@link DataDictionary.fromFile} / {@link DataDictionary.fromString}. */
24
+ constructor(handle) {
25
+ this.#native = handle;
26
+ }
27
+ /**
28
+ * Load a data dictionary from a FIX spec XML file.
29
+ *
30
+ * @param xmlPath Path to the FIX spec XML (e.g. `FIX44.xml`).
31
+ * @throws A `QuickFixError` (`fixError: 'ConfigError'`) if the file is invalid.
32
+ */
33
+ static fromFile(xmlPath) {
34
+ // The native `fromFile` may be a module-level fn or a class static;
35
+ // prefer the module-level fn, fall back to the static.
36
+ const handle = native_js_1.native.dataDictionaryFromFile?.(xmlPath) ??
37
+ native_js_1.native.DataDictionaryWrap.fromFile?.(xmlPath);
38
+ if (!handle) {
39
+ throw new Error('native DataDictionary.fromFile is unavailable');
40
+ }
41
+ return new DataDictionary(handle);
42
+ }
43
+ /**
44
+ * Load a data dictionary from FIX spec XML held in memory.
45
+ *
46
+ * @param xml The FIX spec XML contents.
47
+ * @throws A `QuickFixError` (`fixError: 'ConfigError'`) if the XML is invalid.
48
+ */
49
+ static fromString(xml) {
50
+ const handle = native_js_1.native.dataDictionaryFromString?.(xml) ??
51
+ native_js_1.native.DataDictionaryWrap.fromString?.(xml);
52
+ if (!handle) {
53
+ throw new Error('native DataDictionary.fromString is unavailable');
54
+ }
55
+ return new DataDictionary(handle);
56
+ }
57
+ /** @internal Wrap an existing native handle. */
58
+ static fromNative(handle) {
59
+ return new DataDictionary(handle);
60
+ }
61
+ /** @internal The native handle backing this dictionary. */
62
+ get nativeHandle() {
63
+ return this.#native;
64
+ }
65
+ /**
66
+ * Validate a message against this dictionary.
67
+ *
68
+ * @param msg The message to validate.
69
+ * @throws A `QuickFixError` on any validation failure (e.g.
70
+ * `fixError: 'InvalidMessage'` / `'FieldNotFound'` / `'IncorrectTagValue'`).
71
+ */
72
+ validate(msg) {
73
+ this.#native.validate(msg.nativeHandle);
74
+ }
75
+ }
76
+ exports.DataDictionary = DataDictionary;
77
+ //# sourceMappingURL=data-dictionary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-dictionary.js","sourceRoot":"","sources":["../../src/data-dictionary.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,2CAAgE;AAGhE;;;;;;;;;;;GAWG;AACH;IACE,0CAA0C;IACjC,OAAO,CAAuB;IAEvC,yFAAyF;IACzF,YAAoB,MAA4B;QAC9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAe;QAC7B,oEAAoE;QACpE,uDAAuD;QACvD,MAAM,MAAM,GACV,kBAAM,CAAC,sBAAsB,EAAE,CAAC,OAAO,CAAC;YACxC,kBAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,MAAM,MAAM,GACV,kBAAM,CAAC,wBAAwB,EAAE,CAAC,GAAG,CAAC;YACtC,kBAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,gDAAgD;IAChD,MAAM,CAAC,UAAU,CAAC,MAA4B;QAC5C,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,2DAA2D;IAC3D,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,GAAY;QACnB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Shared implementation for {@link Initiator} and {@link Acceptor}.
3
+ *
4
+ * Both are thin subclasses of {@link Engine} that differ only in which native
5
+ * constructor they instantiate.
6
+ */
7
+ import { EventEmitter } from 'node:events';
8
+ import { type NativeEngineConstructor } from './native.js';
9
+ import { Message } from './message.js';
10
+ import { SessionID } from './session-id.js';
11
+ import type { ApplicationHandlers } from './application.js';
12
+ import type { SessionSettings } from './session-settings.js';
13
+ /** Options for constructing an {@link Initiator} or {@link Acceptor}. */
14
+ export interface EngineOptions {
15
+ /** Parsed session settings ({@link SessionSettings.fromString}/`fromFile`). */
16
+ settings: SessionSettings;
17
+ /**
18
+ * Synchronous application callbacks. These may mutate outbound messages and
19
+ * throw to reject inbound ones (see {@link ApplicationHandlers}).
20
+ */
21
+ handlers?: ApplicationHandlers;
22
+ /** Message-store factory. Defaults to the engine's default (`'file'`). */
23
+ store?: 'file' | 'memory';
24
+ /** Log factory. Defaults to the engine's default. */
25
+ log?: 'screen' | 'file' | 'none';
26
+ }
27
+ /**
28
+ * Events emitted (observe-only) by an {@link Engine}. Each mirrors a callback in
29
+ * {@link ApplicationHandlers} but CANNOT mutate or reject — do that via
30
+ * `handlers`.
31
+ */
32
+ export interface EngineEvents {
33
+ create: [sessionID: SessionID];
34
+ logon: [sessionID: SessionID];
35
+ logout: [sessionID: SessionID];
36
+ toAdmin: [message: Message, sessionID: SessionID];
37
+ fromAdmin: [message: Message, sessionID: SessionID];
38
+ toApp: [message: Message, sessionID: SessionID];
39
+ fromApp: [message: Message, sessionID: SessionID];
40
+ }
41
+ /**
42
+ * Base class for the FIX session engines.
43
+ *
44
+ * Extends Node's {@link EventEmitter}: in addition to invoking your `handlers`,
45
+ * the engine emits an observe-only event for each callback
46
+ * (`'create' | 'logon' | 'logout' | 'toAdmin' | 'fromAdmin' | 'toApp' | 'fromApp'`).
47
+ *
48
+ * **Important:** mutation of outbound messages and rejection of inbound ones
49
+ * MUST be done in `handlers` (which run synchronously and can throw); event
50
+ * listeners run after and cannot affect the message or reject it.
51
+ */
52
+ export declare abstract class Engine extends EventEmitter {
53
+ #private;
54
+ /**
55
+ * @param Native The native engine constructor (`InitiatorWrap`/`AcceptorWrap`).
56
+ * @param options Engine options.
57
+ */
58
+ protected constructor(Native: NativeEngineConstructor, options: EngineOptions);
59
+ /**
60
+ * Start the engine (begins connecting / listening).
61
+ *
62
+ * Runs off the main thread, so the Node.js event loop stays free to service
63
+ * the application callbacks/events the engine fires. The returned Promise
64
+ * resolves once startup completes.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * await initiator.start();
69
+ * ```
70
+ */
71
+ start(): Promise<void>;
72
+ /**
73
+ * Stop the engine.
74
+ *
75
+ * Runs off the main thread and resolves once shutdown completes, keeping the
76
+ * event loop free for any in-flight callbacks.
77
+ *
78
+ * @param force When `true`, aborts immediately instead of draining gracefully.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * await initiator.stop();
83
+ * ```
84
+ */
85
+ stop(force?: boolean): Promise<void>;
86
+ /** Whether any session is currently logged on. */
87
+ isLoggedOn(): boolean;
88
+ /**
89
+ * Keep the Node.js event loop alive while the engine is running (default once
90
+ * started). Pair with {@link Engine.unref} to let a short script exit.
91
+ */
92
+ ref(): void;
93
+ /** Allow the process to exit even while the engine is running. */
94
+ unref(): void;
95
+ }
96
+ export interface Engine {
97
+ /** Register a listener for an engine event (typed per {@link EngineEvents}). */
98
+ on<E extends keyof EngineEvents>(event: E, listener: (...args: EngineEvents[E]) => void): this;
99
+ /** Register a one-shot listener for an engine event. */
100
+ once<E extends keyof EngineEvents>(event: E, listener: (...args: EngineEvents[E]) => void): this;
101
+ /** Alias of {@link Engine.on}. */
102
+ addListener<E extends keyof EngineEvents>(event: E, listener: (...args: EngineEvents[E]) => void): this;
103
+ /** Remove a previously registered listener. */
104
+ off<E extends keyof EngineEvents>(event: E, listener: (...args: EngineEvents[E]) => void): this;
105
+ /** Alias of {@link Engine.off}. */
106
+ removeListener<E extends keyof EngineEvents>(event: E, listener: (...args: EngineEvents[E]) => void): this;
107
+ /** Remove all listeners (optionally for a single event). */
108
+ removeAllListeners<E extends keyof EngineEvents>(event?: E): this;
109
+ /** Emit an engine event with its typed arguments. */
110
+ emit<E extends keyof EngineEvents>(event: E, ...args: EngineEvents[E]): boolean;
111
+ /** List the listeners registered for an event. */
112
+ listeners<E extends keyof EngineEvents>(event: E): Array<(...args: EngineEvents[E]) => void>;
113
+ }
114
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/engine.ts"],"names":[],"mappings":"AAAA;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CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,IAAI,CAAC;IACR,4DAA4D;IAC5D,kBAAkB,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAClE,qDAAqD;IACrD,IAAI,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAChF,kDAAkD;IAClD,SAAS,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;CAC9F"}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Engine = void 0;
4
+ /**
5
+ * Shared implementation for {@link Initiator} and {@link Acceptor}.
6
+ *
7
+ * Both are thin subclasses of {@link Engine} that differ only in which native
8
+ * constructor they instantiate.
9
+ */
10
+ const node_events_1 = require("node:events");
11
+ const message_js_1 = require("./message.js");
12
+ const session_id_js_1 = require("./session-id.js");
13
+ /**
14
+ * Base class for the FIX session engines.
15
+ *
16
+ * Extends Node's {@link EventEmitter}: in addition to invoking your `handlers`,
17
+ * the engine emits an observe-only event for each callback
18
+ * (`'create' | 'logon' | 'logout' | 'toAdmin' | 'fromAdmin' | 'toApp' | 'fromApp'`).
19
+ *
20
+ * **Important:** mutation of outbound messages and rejection of inbound ones
21
+ * MUST be done in `handlers` (which run synchronously and can throw); event
22
+ * listeners run after and cannot affect the message or reject it.
23
+ */
24
+ class Engine extends node_events_1.EventEmitter {
25
+ /** @internal Underlying native engine handle. */
26
+ #native;
27
+ /**
28
+ * @param Native The native engine constructor (`InitiatorWrap`/`AcceptorWrap`).
29
+ * @param options Engine options.
30
+ */
31
+ constructor(Native, options) {
32
+ super();
33
+ const userHandlers = options.handlers ?? {};
34
+ // Bridge native handlers: wrap native handles into TS classes, invoke the
35
+ // user's handler (preserving mutate/throw semantics — exceptions propagate
36
+ // to the native bridge, which maps them to FIX exceptions), then emit the
37
+ // observe-only event.
38
+ const nativeHandlers = {
39
+ onCreate: (id) => {
40
+ const sid = session_id_js_1.SessionID.fromNative(id);
41
+ userHandlers.onCreate?.(sid);
42
+ this.emit('create', sid);
43
+ },
44
+ onLogon: (id) => {
45
+ const sid = session_id_js_1.SessionID.fromNative(id);
46
+ userHandlers.onLogon?.(sid);
47
+ this.emit('logon', sid);
48
+ },
49
+ onLogout: (id) => {
50
+ const sid = session_id_js_1.SessionID.fromNative(id);
51
+ userHandlers.onLogout?.(sid);
52
+ this.emit('logout', sid);
53
+ },
54
+ toAdmin: (m, id) => {
55
+ const msg = message_js_1.Message.fromNative(m);
56
+ const sid = session_id_js_1.SessionID.fromNative(id);
57
+ // Handler may mutate `msg` (writes go straight to the native handle).
58
+ userHandlers.toAdmin?.(msg, sid);
59
+ this.emit('toAdmin', msg, sid);
60
+ },
61
+ toApp: (m, id) => {
62
+ const msg = message_js_1.Message.fromNative(m);
63
+ const sid = session_id_js_1.SessionID.fromNative(id);
64
+ // May mutate or throw FixReject('DoNotSend') — do NOT swallow.
65
+ userHandlers.toApp?.(msg, sid);
66
+ this.emit('toApp', msg, sid);
67
+ },
68
+ fromAdmin: (m, id) => {
69
+ const msg = message_js_1.Message.fromNative(m);
70
+ const sid = session_id_js_1.SessionID.fromNative(id);
71
+ // May throw FixReject('RejectLogon', ...) — do NOT swallow.
72
+ userHandlers.fromAdmin?.(msg, sid);
73
+ this.emit('fromAdmin', msg, sid);
74
+ },
75
+ fromApp: (m, id) => {
76
+ const msg = message_js_1.Message.fromNative(m);
77
+ const sid = session_id_js_1.SessionID.fromNative(id);
78
+ // May throw FixReject('UnsupportedMessageType', ...) — do NOT swallow.
79
+ userHandlers.fromApp?.(msg, sid);
80
+ this.emit('fromApp', msg, sid);
81
+ },
82
+ };
83
+ this.#native = new Native({
84
+ settings: options.settings.nativeHandle,
85
+ handlers: nativeHandlers,
86
+ store: options.store,
87
+ log: options.log,
88
+ });
89
+ }
90
+ /**
91
+ * Start the engine (begins connecting / listening).
92
+ *
93
+ * Runs off the main thread, so the Node.js event loop stays free to service
94
+ * the application callbacks/events the engine fires. The returned Promise
95
+ * resolves once startup completes.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * await initiator.start();
100
+ * ```
101
+ */
102
+ start() {
103
+ return this.#native.start();
104
+ }
105
+ /**
106
+ * Stop the engine.
107
+ *
108
+ * Runs off the main thread and resolves once shutdown completes, keeping the
109
+ * event loop free for any in-flight callbacks.
110
+ *
111
+ * @param force When `true`, aborts immediately instead of draining gracefully.
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * await initiator.stop();
116
+ * ```
117
+ */
118
+ stop(force) {
119
+ return this.#native.stop(force);
120
+ }
121
+ /** Whether any session is currently logged on. */
122
+ isLoggedOn() {
123
+ return this.#native.isLoggedOn();
124
+ }
125
+ /**
126
+ * Keep the Node.js event loop alive while the engine is running (default once
127
+ * started). Pair with {@link Engine.unref} to let a short script exit.
128
+ */
129
+ ref() {
130
+ this.#native.ref();
131
+ }
132
+ /** Allow the process to exit even while the engine is running. */
133
+ unref() {
134
+ this.#native.unref();
135
+ }
136
+ }
137
+ exports.Engine = Engine;
138
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/engine.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6CAA2C;AAQ3C,6CAAuC;AACvC,mDAA4C;AAkC5C;;;;;;;;;;GAUG;AACH,YAA6B,SAAQ,0BAAY;IAC/C,iDAAiD;IACxC,OAAO,CAAe;IAE/B;;;OAGG;IACH,YAAsB,MAA+B,EAAE,OAAsB;QAC3E,KAAK,EAAE,CAAC;QAER,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC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AAO,CAAC,GAAG;SACjB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAe;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,kDAAkD;IAClD,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,GAAG;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,kEAAkE;IAClE,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ export { FIELD, type FieldName } from './generated/fields.js';
2
+ /** A single group of FIX constants (name → value). */
3
+ export type EnumGroup = Readonly<Record<string, number | string>>;
4
+ /** The full, frozen tree of FIX constants. */
5
+ export type Enums = Readonly<Record<string, EnumGroup>>;
6
+ /**
7
+ * The complete tree of FIX constants (frozen), e.g. `enums.FIELD.MsgType`,
8
+ * `enums.MsgType.Logon`, `enums.Side.Buy`.
9
+ *
10
+ * `enums.FIELD` is the same table as {@link FIELD}; the value groups come from
11
+ * the native engine.
12
+ */
13
+ export declare const enums: Enums;
14
+ /** A group of numeric FIX constants (name → number). */
15
+ export type NumericEnumGroup = Readonly<Record<string, number>>;
16
+ /** A group of string-valued FIX constants (name → string), e.g. {@link MsgType}. */
17
+ export type StringEnumGroup = Readonly<Record<string, string>>;
18
+ /** MsgType values (strings), e.g. `MsgType.Logon === 'A'`. */
19
+ export declare const MsgType: StringEnumGroup;
20
+ /** Side values (strings), e.g. `Side.Buy === '1'`. */
21
+ export declare const Side: StringEnumGroup;
22
+ //# sourceMappingURL=enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE9D,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;AAElE,8CAA8C;AAC9C,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAYxD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhE,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/D,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,eAAyE,CAAC;AAEhG,sDAAsD;AACtD,eAAO,MAAM,IAAI,EAAE,eAAsE,CAAC"}