jspurefix 5.2.0 → 5.5.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 (92) hide show
  1. package/BACKPORT_PLAN.md +135 -39
  2. package/dist/config/js-fix-config.d.ts +2 -0
  3. package/dist/config/js-fix-config.js.map +1 -1
  4. package/dist/dictionary/parser/quickfix/dictionary-validator.d.ts +39 -0
  5. package/dist/dictionary/parser/quickfix/dictionary-validator.js +321 -0
  6. package/dist/dictionary/parser/quickfix/dictionary-validator.js.map +1 -0
  7. package/dist/dictionary/parser/quickfix/index-visitor.d.ts +10 -0
  8. package/dist/dictionary/parser/quickfix/index-visitor.js +68 -0
  9. package/dist/dictionary/parser/quickfix/index-visitor.js.map +1 -0
  10. package/dist/dictionary/parser/quickfix/index.d.ts +7 -0
  11. package/dist/dictionary/parser/quickfix/index.js +7 -0
  12. package/dist/dictionary/parser/quickfix/index.js.map +1 -1
  13. package/dist/dictionary/parser/quickfix/quick-fix-graph-file-parser.d.ts +13 -0
  14. package/dist/dictionary/parser/quickfix/quick-fix-graph-file-parser.js +65 -0
  15. package/dist/dictionary/parser/quickfix/quick-fix-graph-file-parser.js.map +1 -0
  16. package/dist/dictionary/parser/quickfix/quick-fix-graph-parser.d.ts +73 -0
  17. package/dist/dictionary/parser/quickfix/quick-fix-graph-parser.js +363 -0
  18. package/dist/dictionary/parser/quickfix/quick-fix-graph-parser.js.map +1 -0
  19. package/dist/dictionary/parser/quickfix/sax-tree-builder.d.ts +5 -0
  20. package/dist/dictionary/parser/quickfix/sax-tree-builder.js +103 -0
  21. package/dist/dictionary/parser/quickfix/sax-tree-builder.js.map +1 -0
  22. package/dist/dictionary/parser/quickfix/validation-error.d.ts +17 -0
  23. package/dist/dictionary/parser/quickfix/validation-error.js +32 -0
  24. package/dist/dictionary/parser/quickfix/validation-error.js.map +1 -0
  25. package/dist/dictionary/parser/quickfix/x-element.d.ts +26 -0
  26. package/dist/dictionary/parser/quickfix/x-element.js +82 -0
  27. package/dist/dictionary/parser/quickfix/x-element.js.map +1 -0
  28. package/dist/store/file-session-store.d.ts +42 -0
  29. package/dist/store/file-session-store.js +256 -0
  30. package/dist/store/file-session-store.js.map +1 -0
  31. package/dist/store/file-session-stream-provider.d.ts +25 -0
  32. package/dist/store/file-session-stream-provider.js +162 -0
  33. package/dist/store/file-session-stream-provider.js.map +1 -0
  34. package/dist/store/fix-msg-ascii-store-resend.js +6 -0
  35. package/dist/store/fix-msg-ascii-store-resend.js.map +1 -1
  36. package/dist/store/fix-session-store-factory.d.ts +13 -0
  37. package/dist/store/fix-session-store-factory.js +21 -0
  38. package/dist/store/fix-session-store-factory.js.map +1 -0
  39. package/dist/store/fix-session-store.d.ts +19 -0
  40. package/dist/store/fix-session-store.js +3 -0
  41. package/dist/store/fix-session-store.js.map +1 -0
  42. package/dist/store/index.d.ts +9 -0
  43. package/dist/store/index.js +9 -0
  44. package/dist/store/index.js.map +1 -1
  45. package/dist/store/memory-session-store.d.ts +27 -0
  46. package/dist/store/memory-session-store.js +104 -0
  47. package/dist/store/memory-session-store.js.map +1 -0
  48. package/dist/store/memory-session-stream-provider.d.ts +26 -0
  49. package/dist/store/memory-session-stream-provider.js +103 -0
  50. package/dist/store/memory-session-stream-provider.js.map +1 -0
  51. package/dist/store/session-id.d.ts +9 -0
  52. package/dist/store/session-id.js +55 -0
  53. package/dist/store/session-id.js.map +1 -0
  54. package/dist/store/session-stream-provider.d.ts +15 -0
  55. package/dist/store/session-stream-provider.js +3 -0
  56. package/dist/store/session-stream-provider.js.map +1 -0
  57. package/dist/store/store-config.d.ts +5 -0
  58. package/dist/store/store-config.js +3 -0
  59. package/dist/store/store-config.js.map +1 -0
  60. package/dist/transport/ascii/ascii-session.d.ts +6 -1
  61. package/dist/transport/ascii/ascii-session.js +37 -5
  62. package/dist/transport/ascii/ascii-session.js.map +1 -1
  63. package/dist/transport/session/session-description.d.ts +2 -0
  64. package/dist/transport/session/session-description.js.map +1 -1
  65. package/dist/util/definition-factory.js +1 -1
  66. package/dist/util/definition-factory.js.map +1 -1
  67. package/jsfix.test_client.txt +67 -67
  68. package/jsfix.test_server.txt +64 -64
  69. package/package.json +6 -6
  70. package/src/config/js-fix-config.ts +2 -0
  71. package/src/dictionary/parser/quickfix/dictionary-validator.ts +473 -0
  72. package/src/dictionary/parser/quickfix/index-visitor.ts +100 -0
  73. package/src/dictionary/parser/quickfix/index.ts +7 -0
  74. package/src/dictionary/parser/quickfix/quick-fix-graph-file-parser.ts +63 -0
  75. package/src/dictionary/parser/quickfix/quick-fix-graph-parser.ts +450 -0
  76. package/src/dictionary/parser/quickfix/sax-tree-builder.ts +112 -0
  77. package/src/dictionary/parser/quickfix/validation-error.ts +34 -0
  78. package/src/dictionary/parser/quickfix/x-element.ts +115 -0
  79. package/src/store/file-session-store.ts +294 -0
  80. package/src/store/file-session-stream-provider.ts +123 -0
  81. package/src/store/fix-msg-ascii-store-resend.ts +8 -0
  82. package/src/store/fix-session-store-factory.ts +31 -0
  83. package/src/store/fix-session-store.ts +37 -0
  84. package/src/store/index.ts +9 -0
  85. package/src/store/memory-session-store.ts +102 -0
  86. package/src/store/memory-session-stream-provider.ts +97 -0
  87. package/src/store/session-id.ts +32 -0
  88. package/src/store/session-stream-provider.ts +74 -0
  89. package/src/store/store-config.ts +16 -0
  90. package/src/transport/ascii/ascii-session.ts +57 -6
  91. package/src/transport/session/session-description.ts +2 -0
  92. package/src/util/definition-factory.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"fix-msg-ascii-store-resend.js","sourceRoot":"","sources":["../../src/store/fix-msg-ascii-store-resend.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iEAA8E;AAE9E,oCAAkC;AAClC,sCAAkD;AAClD,2CAA6C;AAG7C,MAAa,sBAAsB;IAEjC,YAA6B,KAAmB,EAAkB,MAAoB;QAAzD,UAAK,GAAL,KAAK,CAAc;QAAkB,WAAM,GAAN,MAAM,CAAc;QACpF,IAAI,CAAC,MAA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BAAgB,CAAE,QAAgB,EAAE,MAAc;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACnC,MAAM,OAAO,GAAmB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAmB,CAAA;QACtF,OAAO,CAAC,cAAc,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,eAAO,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAoB,CAAA;QACxG,OAAO,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAA;QAEzC,OAAO,IAAI,wCAAiB,CAC1B,eAAO,CAAC,aAAa,EACrB,IAAI,IAAI,EAAE,EACV,QAAQ,EACR,OAAO,EACP,IAAI,CACL,CAAA;IACH,CAAC;IAmBO,8BAA8B,CAAE,cAAkC;QACxE,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,EAAE,CAAA;QAE5C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACnC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;YACvB,aAAa,CAAC,GAAG,GAAG,EAAE,CAAA;QACxB,CAAC;QAGD,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAC5B,aAAa,CAAC,OAAO,EACrB,aAAa,CAAC,MAAM,EACpB,IAAI,IAAI,EAAE,EACV;YACE,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,aAAa,CAAC,SAAS;SACzC,CACF,CAAA;QACD,aAAa,CAAC,GAAG,mCACZ,aAAa,CAAC,GAAG,KACpB,cAAc,EAAE,MAAM,GACvB,CAAA;QACD,OAAO,aAAa,CAAA;IACtB,CAAC;CACF;AAtID,wDAsIC","sourcesContent":["import { IFixMsgStore } from './fix-msg-store'\nimport { FixMsgStoreRecord, IFixMsgStoreRecord } from './fix-msg-store-record'\nimport { IJsFixConfig } from '../config'\nimport { MsgType } from '../types'\nimport { ElasticBuffer, MsgView } from '../buffer'\nimport { AsciiParser } from '../buffer/ascii'\nimport { ISequenceReset, IStandardHeader } from '../types/FIX4.4/repo'\n\nexport class FixMsgAsciiStoreResend {\n parser: AsciiParser\n constructor (public readonly store: IFixMsgStore, public readonly config: IJsFixConfig) {\n this.parser = new AsciiParser(this.config, null, new ElasticBuffer(160 * 1024))\n }\n\n public async getResendRequest (startSeq: number, endSeq: number): Promise<IFixMsgStoreRecord[]> {\n // need to cover request from start to end where any missing numbers are\n // included as gaps to allow vector of messages to be sent by the session\n // on a request\n\n return await new Promise((resolve, reject) => {\n this.store.getSeqNumRange(startSeq, endSeq).then(res => {\n resolve(this.inflateRange(startSeq, endSeq, res))\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n private inflateRange (startSeq: number, endSeq: number, input: IFixMsgStoreRecord[]): IFixMsgStoreRecord[] {\n const toResend: IFixMsgStoreRecord[] = []\n // If no records for this given sequence number range, returns a single gap fill\n if (input.length === 0) {\n this.gap(startSeq, endSeq + 1, toResend)\n return toResend\n }\n\n let expected = startSeq\n for (let i = 0; i < input.length; ++i) {\n const record = this.prepareRecordForRetransmission(input[i])\n const seqNum = record.seqNum\n const toGap = seqNum - expected\n if (toGap > 0) {\n this.gap(expected, seqNum, toResend)\n }\n expected = seqNum + 1\n if (record.encoded) {\n this.inflate(record)\n }\n toResend.push(record)\n }\n if (endSeq - expected > 0) {\n this.gap(expected, endSeq + 1, toResend)\n }\n return toResend\n }\n\n private gap (beginGap: number, newSeq: number, arr: IFixMsgStoreRecord[]): void {\n if (beginGap > 0) {\n arr.push(this.sequenceResetGap(beginGap, newSeq))\n }\n }\n\n // if records were sent as encoded text then inflate back to object\n // so can be resent or examined\n\n private inflate (record: IFixMsgStoreRecord): void {\n if (record.obj) return\n if (!record.encoded) return\n const parser = this.parser\n parser.on('error', (_: Error) => {\n record.obj = null\n })\n parser.on('msg', (view: MsgView) => {\n record.obj = view.toObject()\n })\n // inline parse\n parser.parseText(record.encoded)\n }\n\n /**\n * A continuous sequence of messages not being retransmitted should be skipped over using a\n * single SequenceReset(35=4) message with GapFillFlag(123) set to “Y” and MsgSeqNum(34) set\n * to the sequence number of the first skipped message and NewSeqNo(36) must always be set\n * to the value of the next sequence number to be expected by the peer immediately following\n * the messages being skipped.\n */\n private sequenceResetGap (startGap: number, newSeq: number): IFixMsgStoreRecord {\n const factory = this.config.factory\n const gapFill: ISequenceReset = factory?.sequenceReset(newSeq, true) as ISequenceReset\n gapFill.StandardHeader = factory?.header(MsgType.SequenceReset, startGap, new Date()) as IStandardHeader\n gapFill.StandardHeader.PossDupFlag = true\n\n return new FixMsgStoreRecord(\n MsgType.SequenceReset,\n new Date(),\n startGap,\n gapFill,\n null\n )\n }\n\n /**\n * Prepares the FIX message as response to ResendRequest (2).\n *\n * The FIX session processor retransmitting a message with the PossDupFlag(43) set to \"Y\" must modify the following fields:\n *\n * SendingTime(52) set to the current sending time\n * OrigSendingTime(122) set to the SendingTime(52) from the original message\n * Recalculate the BodyLength(9)\n * Recalculate the CheckSum(10)\n *\n * If the message is encrypted, SecureDataLen(90) and SecureData(91) may also require re-encryption and re-encoding\n *\n * @see https://www.fixtrading.org/standards/fix-session-layer-online/#message-recovery\n *\n * @param originalRecord the FIX message to be retransmitted as possible duplicate\n * @returns the FIX message ready to be retransmitted\n */\n private prepareRecordForRetransmission (originalRecord: IFixMsgStoreRecord): IFixMsgStoreRecord {\n const retransmitted = originalRecord.clone() // We don't want to accidently change any fields of the original record\n\n const factory = this.config.factory\n if (!retransmitted.obj) {\n retransmitted.obj = {}\n }\n\n // Rebuilds header with the updated fields\n const header = factory?.header(\n retransmitted.msgType,\n retransmitted.seqNum,\n new Date(), // SendingTime(52)\n {\n PossDupFlag: true,\n OrigSendingTime: retransmitted.timestamp\n }\n )\n retransmitted.obj = {\n ...retransmitted.obj,\n StandardHeader: header\n }\n return retransmitted\n }\n}\n"]}
1
+ {"version":3,"file":"f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AO,CAAA;QACnC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;YACvB,aAAa,CAAC,GAAG,GAAG,EAAE,CAAA;QACxB,CAAC;QAGD,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAC5B,aAAa,CAAC,OAAO,EACrB,aAAa,CAAC,MAAM,EACpB,IAAI,IAAI,EAAE,EACV;YACE,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,aAAa,CAAC,SAAS;SACzC,CACF,CAAA;QACD,aAAa,CAAC,GAAG,mCACZ,aAAa,CAAC,GAAG,KACpB,cAAc,EAAE,MAAM,GACvB,CAAA;QACD,OAAO,aAAa,CAAA;IACtB,CAAC;CACF;AA9ID,wDA8IC","sourcesContent":["import { IFixMsgStore } from './fix-msg-store'\nimport { FixMsgStoreRecord, IFixMsgStoreRecord } from './fix-msg-store-record'\nimport { IJsFixConfig } from '../config'\nimport { MsgType } from '../types'\nimport { ElasticBuffer, MsgView } from '../buffer'\nimport { AsciiParser } from '../buffer/ascii'\nimport { ISequenceReset, IStandardHeader } from '../types/FIX4.4/repo'\n\nexport class FixMsgAsciiStoreResend {\n parser: AsciiParser\n constructor (public readonly store: IFixMsgStore, public readonly config: IJsFixConfig) {\n this.parser = new AsciiParser(this.config, null, new ElasticBuffer(160 * 1024))\n }\n\n public async getResendRequest (startSeq: number, endSeq: number): Promise<IFixMsgStoreRecord[]> {\n // Safety feature: If ResendGapFillOnly is enabled, ALWAYS send GapFill instead of\n // replaying stored messages. This prevents accidental duplicate order execution.\n if (this.config.description.store?.resendGapFillOnly === true) {\n const gapFillOnly: IFixMsgStoreRecord[] = []\n this.gap(startSeq, endSeq + 1, gapFillOnly)\n return gapFillOnly\n }\n\n // need to cover request from start to end where any missing numbers are\n // included as gaps to allow vector of messages to be sent by the session\n // on a request\n\n return await new Promise((resolve, reject) => {\n this.store.getSeqNumRange(startSeq, endSeq).then(res => {\n resolve(this.inflateRange(startSeq, endSeq, res))\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n private inflateRange (startSeq: number, endSeq: number, input: IFixMsgStoreRecord[]): IFixMsgStoreRecord[] {\n const toResend: IFixMsgStoreRecord[] = []\n // If no records for this given sequence number range, returns a single gap fill\n if (input.length === 0) {\n this.gap(startSeq, endSeq + 1, toResend)\n return toResend\n }\n\n let expected = startSeq\n for (let i = 0; i < input.length; ++i) {\n const record = this.prepareRecordForRetransmission(input[i])\n const seqNum = record.seqNum\n const toGap = seqNum - expected\n if (toGap > 0) {\n this.gap(expected, seqNum, toResend)\n }\n expected = seqNum + 1\n if (record.encoded) {\n this.inflate(record)\n }\n toResend.push(record)\n }\n if (endSeq - expected > 0) {\n this.gap(expected, endSeq + 1, toResend)\n }\n return toResend\n }\n\n private gap (beginGap: number, newSeq: number, arr: IFixMsgStoreRecord[]): void {\n if (beginGap > 0) {\n arr.push(this.sequenceResetGap(beginGap, newSeq))\n }\n }\n\n // if records were sent as encoded text then inflate back to object\n // so can be resent or examined\n\n private inflate (record: IFixMsgStoreRecord): void {\n if (record.obj) return\n if (!record.encoded) return\n const parser = this.parser\n parser.on('error', (_: Error) => {\n record.obj = null\n })\n parser.on('msg', (view: MsgView) => {\n record.obj = view.toObject()\n })\n // inline parse\n parser.parseText(record.encoded)\n }\n\n /**\n * A continuous sequence of messages not being retransmitted should be skipped over using a\n * single SequenceReset(35=4) message with GapFillFlag(123) set to “Y” and MsgSeqNum(34) set\n * to the sequence number of the first skipped message and NewSeqNo(36) must always be set\n * to the value of the next sequence number to be expected by the peer immediately following\n * the messages being skipped.\n */\n private sequenceResetGap (startGap: number, newSeq: number): IFixMsgStoreRecord {\n const factory = this.config.factory\n const gapFill: ISequenceReset = factory?.sequenceReset(newSeq, true) as ISequenceReset\n gapFill.StandardHeader = factory?.header(MsgType.SequenceReset, startGap, new Date()) as IStandardHeader\n gapFill.StandardHeader.PossDupFlag = true\n\n return new FixMsgStoreRecord(\n MsgType.SequenceReset,\n new Date(),\n startGap,\n gapFill,\n null\n )\n }\n\n /**\n * Prepares the FIX message as response to ResendRequest (2).\n *\n * The FIX session processor retransmitting a message with the PossDupFlag(43) set to \"Y\" must modify the following fields:\n *\n * SendingTime(52) set to the current sending time\n * OrigSendingTime(122) set to the SendingTime(52) from the original message\n * Recalculate the BodyLength(9)\n * Recalculate the CheckSum(10)\n *\n * If the message is encrypted, SecureDataLen(90) and SecureData(91) may also require re-encryption and re-encoding\n *\n * @see https://www.fixtrading.org/standards/fix-session-layer-online/#message-recovery\n *\n * @param originalRecord the FIX message to be retransmitted as possible duplicate\n * @returns the FIX message ready to be retransmitted\n */\n private prepareRecordForRetransmission (originalRecord: IFixMsgStoreRecord): IFixMsgStoreRecord {\n const retransmitted = originalRecord.clone() // We don't want to accidently change any fields of the original record\n\n const factory = this.config.factory\n if (!retransmitted.obj) {\n retransmitted.obj = {}\n }\n\n // Rebuilds header with the updated fields\n const header = factory?.header(\n retransmitted.msgType,\n retransmitted.seqNum,\n new Date(), // SendingTime(52)\n {\n PossDupFlag: true,\n OrigSendingTime: retransmitted.timestamp\n }\n )\n retransmitted.obj = {\n ...retransmitted.obj,\n StandardHeader: header\n }\n return retransmitted\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { IFixSessionStore } from './fix-session-store';
2
+ import { SessionId } from './session-id';
3
+ export interface IFixSessionStoreFactory {
4
+ create(sessionId: SessionId): IFixSessionStore;
5
+ }
6
+ export declare class MemorySessionStoreFactory implements IFixSessionStoreFactory {
7
+ create(sessionId: SessionId): IFixSessionStore;
8
+ }
9
+ export declare class FileSessionStoreFactory implements IFixSessionStoreFactory {
10
+ private readonly directory;
11
+ constructor(directory: string);
12
+ create(sessionId: SessionId): IFixSessionStore;
13
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileSessionStoreFactory = exports.MemorySessionStoreFactory = void 0;
4
+ const memory_session_store_1 = require("./memory-session-store");
5
+ const file_session_store_1 = require("./file-session-store");
6
+ class MemorySessionStoreFactory {
7
+ create(sessionId) {
8
+ return new memory_session_store_1.MemorySessionStore(sessionId);
9
+ }
10
+ }
11
+ exports.MemorySessionStoreFactory = MemorySessionStoreFactory;
12
+ class FileSessionStoreFactory {
13
+ constructor(directory) {
14
+ this.directory = directory;
15
+ }
16
+ create(sessionId) {
17
+ return file_session_store_1.FileSessionStore.createWithFiles(sessionId, this.directory);
18
+ }
19
+ }
20
+ exports.FileSessionStoreFactory = FileSessionStoreFactory;
21
+ //# sourceMappingURL=fix-session-store-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-session-store-factory.js","sourceRoot":"","sources":["../../src/store/fix-session-store-factory.ts"],"names":[],"mappings":";;;AAEA,iEAA2D;AAC3D,6DAAuD;AAYvD,MAAa,yBAAyB;IACpC,MAAM,CAAE,SAAoB;QAC1B,OAAO,IAAI,yCAAkB,CAAC,SAAS,CAAC,CAAA;IAC1C,CAAC;CACF;AAJD,8DAIC;AAKD,MAAa,uBAAuB;IAClC,YAA8B,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAEnD,MAAM,CAAE,SAAoB;QAC1B,OAAO,qCAAgB,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IACpE,CAAC;CACF;AAND,0DAMC","sourcesContent":["import { IFixSessionStore } from './fix-session-store'\nimport { SessionId } from './session-id'\nimport { MemorySessionStore } from './memory-session-store'\nimport { FileSessionStore } from './file-session-store'\n\n/**\n * Factory for creating session stores.\n */\nexport interface IFixSessionStoreFactory {\n create (sessionId: SessionId): IFixSessionStore\n}\n\n/**\n * Factory for creating in-memory session stores.\n */\nexport class MemorySessionStoreFactory implements IFixSessionStoreFactory {\n create (sessionId: SessionId): IFixSessionStore {\n return new MemorySessionStore(sessionId)\n }\n}\n\n/**\n * Factory for creating file-based session stores.\n */\nexport class FileSessionStoreFactory implements IFixSessionStoreFactory {\n constructor (private readonly directory: string) {}\n\n create (sessionId: SessionId): IFixSessionStore {\n return FileSessionStore.createWithFiles(sessionId, this.directory)\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { SessionId } from './session-id';
2
+ import { IFixMsgStoreRecord } from './fix-msg-store-record';
3
+ export interface IFixSessionStore {
4
+ readonly sessionId: SessionId;
5
+ put(record: IFixMsgStoreRecord): Promise<void>;
6
+ get(seqNum: number): Promise<IFixMsgStoreRecord | null>;
7
+ getRange(fromSeqNum: number, toSeqNum: number): Promise<IFixMsgStoreRecord[]>;
8
+ senderSeqNum: number;
9
+ targetSeqNum: number;
10
+ setSenderSeqNum(value: number): Promise<void>;
11
+ setTargetSeqNum(value: number): Promise<void>;
12
+ nextSenderSeqNum(): Promise<number>;
13
+ nextTargetSeqNum(): Promise<number>;
14
+ readonly creationTime: Date;
15
+ reset(): Promise<void>;
16
+ initialize(): Promise<void>;
17
+ flush(): Promise<void>;
18
+ dispose(): Promise<void>;
19
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=fix-session-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-session-store.js","sourceRoot":"","sources":["../../src/store/fix-session-store.ts"],"names":[],"mappings":"","sourcesContent":["import { SessionId } from './session-id'\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\n\n/**\n * Unified session store interface for FIX message persistence and sequence number management.\n * Coordinates all persistence for a single FIX session:\n * - Message storage (.body + .header files)\n * - Sequence numbers (.seqnums file)\n * - Session metadata (.session file)\n *\n * QuickFix-compatible file format for interoperability.\n */\nexport interface IFixSessionStore {\n readonly sessionId: SessionId\n\n // Message Operations\n put (record: IFixMsgStoreRecord): Promise<void>\n get (seqNum: number): Promise<IFixMsgStoreRecord | null>\n getRange (fromSeqNum: number, toSeqNum: number): Promise<IFixMsgStoreRecord[]>\n\n // Sequence Number Operations\n senderSeqNum: number\n targetSeqNum: number\n setSenderSeqNum (value: number): Promise<void>\n setTargetSeqNum (value: number): Promise<void>\n nextSenderSeqNum (): Promise<number>\n nextTargetSeqNum (): Promise<number>\n\n // Session Operations\n readonly creationTime: Date\n reset (): Promise<void>\n\n // Lifecycle\n initialize (): Promise<void>\n flush (): Promise<void>\n dispose (): Promise<void>\n}\n"]}
@@ -2,3 +2,12 @@ export * from './fix-msg-memory-store';
2
2
  export * from './fix-msg-store';
3
3
  export * from './fix-msg-store-record';
4
4
  export * from './fix-msg-ascii-store-resend';
5
+ export * from './session-id';
6
+ export * from './fix-session-store';
7
+ export * from './memory-session-store';
8
+ export * from './fix-session-store-factory';
9
+ export * from './session-stream-provider';
10
+ export * from './memory-session-stream-provider';
11
+ export * from './file-session-stream-provider';
12
+ export * from './file-session-store';
13
+ export * from './store-config';
@@ -18,4 +18,13 @@ __exportStar(require("./fix-msg-memory-store"), exports);
18
18
  __exportStar(require("./fix-msg-store"), exports);
19
19
  __exportStar(require("./fix-msg-store-record"), exports);
20
20
  __exportStar(require("./fix-msg-ascii-store-resend"), exports);
21
+ __exportStar(require("./session-id"), exports);
22
+ __exportStar(require("./fix-session-store"), exports);
23
+ __exportStar(require("./memory-session-store"), exports);
24
+ __exportStar(require("./fix-session-store-factory"), exports);
25
+ __exportStar(require("./session-stream-provider"), exports);
26
+ __exportStar(require("./memory-session-stream-provider"), exports);
27
+ __exportStar(require("./file-session-stream-provider"), exports);
28
+ __exportStar(require("./file-session-store"), exports);
29
+ __exportStar(require("./store-config"), exports);
21
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAsC;AACtC,kDAA+B;AAC/B,yDAAsC;AACtC,+DAA4C","sourcesContent":["export * from './fix-msg-memory-store'\nexport * from './fix-msg-store'\nexport * from './fix-msg-store-record'\nexport * from './fix-msg-ascii-store-resend'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAsC;AACtC,kDAA+B;AAC/B,yDAAsC;AACtC,+DAA4C;AAC5C,+CAA4B;AAC5B,sDAAmC;AACnC,yDAAsC;AACtC,8DAA2C;AAC3C,4DAAyC;AACzC,mEAAgD;AAChD,iEAA8C;AAC9C,uDAAoC;AACpC,iDAA8B","sourcesContent":["export * from './fix-msg-memory-store'\nexport * from './fix-msg-store'\nexport * from './fix-msg-store-record'\nexport * from './fix-msg-ascii-store-resend'\nexport * from './session-id'\nexport * from './fix-session-store'\nexport * from './memory-session-store'\nexport * from './fix-session-store-factory'\nexport * from './session-stream-provider'\nexport * from './memory-session-stream-provider'\nexport * from './file-session-stream-provider'\nexport * from './file-session-store'\nexport * from './store-config'\n"]}
@@ -0,0 +1,27 @@
1
+ import { IFixSessionStore } from './fix-session-store';
2
+ import { SessionId } from './session-id';
3
+ import { IFixMsgStoreRecord } from './fix-msg-store-record';
4
+ export declare class MemorySessionStore implements IFixSessionStore {
5
+ readonly sessionId: SessionId;
6
+ private readonly messages;
7
+ private senderSeqNumValue;
8
+ private targetSeqNumValue;
9
+ private creationTimeValue;
10
+ constructor(sessionId: SessionId);
11
+ get senderSeqNum(): number;
12
+ set senderSeqNum(value: number);
13
+ get targetSeqNum(): number;
14
+ set targetSeqNum(value: number);
15
+ setSenderSeqNum(value: number): Promise<void>;
16
+ setTargetSeqNum(value: number): Promise<void>;
17
+ nextSenderSeqNum(): Promise<number>;
18
+ nextTargetSeqNum(): Promise<number>;
19
+ get creationTime(): Date;
20
+ reset(): Promise<void>;
21
+ put(record: IFixMsgStoreRecord): Promise<void>;
22
+ get(seqNum: number): Promise<IFixMsgStoreRecord | null>;
23
+ getRange(fromSeqNum: number, toSeqNum: number): Promise<IFixMsgStoreRecord[]>;
24
+ initialize(): Promise<void>;
25
+ flush(): Promise<void>;
26
+ dispose(): Promise<void>;
27
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MemorySessionStore = void 0;
13
+ class MemorySessionStore {
14
+ constructor(sessionId) {
15
+ this.sessionId = sessionId;
16
+ this.messages = new Map();
17
+ this.senderSeqNumValue = 1;
18
+ this.targetSeqNumValue = 1;
19
+ this.creationTimeValue = new Date();
20
+ }
21
+ get senderSeqNum() {
22
+ return this.senderSeqNumValue;
23
+ }
24
+ set senderSeqNum(value) {
25
+ this.senderSeqNumValue = value;
26
+ }
27
+ get targetSeqNum() {
28
+ return this.targetSeqNumValue;
29
+ }
30
+ set targetSeqNum(value) {
31
+ this.targetSeqNumValue = value;
32
+ }
33
+ setSenderSeqNum(value) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ this.senderSeqNumValue = value;
36
+ });
37
+ }
38
+ setTargetSeqNum(value) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ this.targetSeqNumValue = value;
41
+ });
42
+ }
43
+ nextSenderSeqNum() {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ return ++this.senderSeqNumValue;
46
+ });
47
+ }
48
+ nextTargetSeqNum() {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ return ++this.targetSeqNumValue;
51
+ });
52
+ }
53
+ get creationTime() {
54
+ return this.creationTimeValue;
55
+ }
56
+ reset() {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ this.senderSeqNumValue = 1;
59
+ this.targetSeqNumValue = 1;
60
+ this.creationTimeValue = new Date();
61
+ this.messages.clear();
62
+ });
63
+ }
64
+ put(record) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ this.messages.set(record.seqNum, record.clone());
67
+ });
68
+ }
69
+ get(seqNum) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const record = this.messages.get(seqNum);
72
+ return record ? record.clone() : null;
73
+ });
74
+ }
75
+ getRange(fromSeqNum, toSeqNum) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const results = [];
78
+ const keys = Array.from(this.messages.keys())
79
+ .filter(k => k >= fromSeqNum && k <= toSeqNum)
80
+ .sort((a, b) => a - b);
81
+ for (const seq of keys) {
82
+ const record = this.messages.get(seq);
83
+ if (record) {
84
+ results.push(record.clone());
85
+ }
86
+ }
87
+ return results;
88
+ });
89
+ }
90
+ initialize() {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ });
93
+ }
94
+ flush() {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ });
97
+ }
98
+ dispose() {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ });
101
+ }
102
+ }
103
+ exports.MemorySessionStore = MemorySessionStore;
104
+ //# sourceMappingURL=memory-session-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-session-store.js","sourceRoot":"","sources":["../../src/store/memory-session-store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,MAAa,kBAAkB;IAM7B,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QALhC,aAAQ,GAAoC,IAAI,GAAG,EAAE,CAAA;QAC9D,sBAAiB,GAAW,CAAC,CAAA;QAC7B,sBAAiB,GAAW,CAAC,CAAA;QAC7B,sBAAiB,GAAS,IAAI,IAAI,EAAE,CAAA;IAEQ,CAAC;IAIrD,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC/B,CAAC;IAED,IAAI,YAAY,CAAE,KAAa;QAC7B,IAAI,CAAC,i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OAAO,GAAyB,EAAE,CAAA;YACxC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;iBAC1C,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,QAAQ,CAAC;iBAC7C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;YACxB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBACrC,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;gBAC9B,CAAC;YACH,CAAC;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;KAAA;IAIK,UAAU;;QAEhB,CAAC;KAAA;IAEK,KAAK;;QAEX,CAAC;KAAA;IAEK,OAAO;;QAEb,CAAC;KAAA;CACF;AA7FD,gDA6FC","sourcesContent":["import { IFixSessionStore } from './fix-session-store'\nimport { SessionId } from './session-id'\nimport { IFixMsgStoreRecord } from './fix-msg-store-record'\n\n/**\n * In-memory session store for testing and development.\n * Not persistent - all data lost on dispose.\n */\nexport class MemorySessionStore implements IFixSessionStore {\n private readonly messages: Map<number, IFixMsgStoreRecord> = new Map()\n private senderSeqNumValue: number = 1\n private targetSeqNumValue: number = 1\n private creationTimeValue: Date = new Date()\n\n constructor (public readonly sessionId: SessionId) {}\n\n // Sequence Numbers\n\n get senderSeqNum (): number {\n return this.senderSeqNumValue\n }\n\n set senderSeqNum (value: number) {\n this.senderSeqNumValue = value\n }\n\n get targetSeqNum (): number {\n return this.targetSeqNumValue\n }\n\n set targetSeqNum (value: number) {\n this.targetSeqNumValue = value\n }\n\n async setSenderSeqNum (value: number): Promise<void> {\n this.senderSeqNumValue = value\n }\n\n async setTargetSeqNum (value: number): Promise<void> {\n this.targetSeqNumValue = value\n }\n\n async nextSenderSeqNum (): Promise<number> {\n return ++this.senderSeqNumValue\n }\n\n async nextTargetSeqNum (): Promise<number> {\n return ++this.targetSeqNumValue\n }\n\n // Session\n\n get creationTime (): Date {\n return this.creationTimeValue\n }\n\n async reset (): Promise<void> {\n this.senderSeqNumValue = 1\n this.targetSeqNumValue = 1\n this.creationTimeValue = new Date()\n this.messages.clear()\n }\n\n // Message Operations\n\n async put (record: IFixMsgStoreRecord): Promise<void> {\n this.messages.set(record.seqNum, record.clone())\n }\n\n async get (seqNum: number): Promise<IFixMsgStoreRecord | null> {\n const record = this.messages.get(seqNum)\n return record ? record.clone() : null\n }\n\n async getRange (fromSeqNum: number, toSeqNum: number): Promise<IFixMsgStoreRecord[]> {\n const results: IFixMsgStoreRecord[] = []\n const keys = Array.from(this.messages.keys())\n .filter(k => k >= fromSeqNum && k <= toSeqNum)\n .sort((a, b) => a - b)\n for (const seq of keys) {\n const record = this.messages.get(seq)\n if (record) {\n results.push(record.clone())\n }\n }\n return results\n }\n\n // Lifecycle\n\n async initialize (): Promise<void> {\n // No-op for memory store\n }\n\n async flush (): Promise<void> {\n // No-op for memory store\n }\n\n async dispose (): Promise<void> {\n // No-op for memory store\n }\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import { ISessionStreamProvider } from './session-stream-provider';
2
+ export declare class MemorySessionStreamProvider implements ISessionStreamProvider {
3
+ private bodyBuffer;
4
+ private headerLines;
5
+ private seqNumsContent;
6
+ private sessionTimeContent;
7
+ getBodyBytes(): Buffer;
8
+ getBodyString(): string;
9
+ getHeaderString(): string;
10
+ getHeaderLinesSnapshot(): string[];
11
+ getSeqNumsContent(): string | null;
12
+ getSessionTimeContent(): string | null;
13
+ openBody(): void;
14
+ appendBody(data: Buffer): Promise<number>;
15
+ readBody(offset: number, length: number): Promise<Buffer>;
16
+ getBodySize(): number;
17
+ appendHeaderLine(line: string): Promise<void>;
18
+ readHeaderLines(): Promise<string[]>;
19
+ readSeqNums(): Promise<string | null>;
20
+ writeSeqNums(content: string): Promise<void>;
21
+ readSessionTime(): Promise<string | null>;
22
+ writeSessionTime(content: string): Promise<void>;
23
+ reset(): Promise<void>;
24
+ flush(): Promise<void>;
25
+ dispose(): Promise<void>;
26
+ }
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MemorySessionStreamProvider = void 0;
13
+ class MemorySessionStreamProvider {
14
+ constructor() {
15
+ this.bodyBuffer = Buffer.alloc(0);
16
+ this.headerLines = [];
17
+ this.seqNumsContent = null;
18
+ this.sessionTimeContent = null;
19
+ }
20
+ getBodyBytes() {
21
+ return Buffer.from(this.bodyBuffer);
22
+ }
23
+ getBodyString() {
24
+ return this.bodyBuffer.toString('utf8');
25
+ }
26
+ getHeaderString() {
27
+ return this.headerLines.join('\n');
28
+ }
29
+ getHeaderLinesSnapshot() {
30
+ return [...this.headerLines];
31
+ }
32
+ getSeqNumsContent() {
33
+ return this.seqNumsContent;
34
+ }
35
+ getSessionTimeContent() {
36
+ return this.sessionTimeContent;
37
+ }
38
+ openBody() {
39
+ }
40
+ appendBody(data) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const offset = this.bodyBuffer.length;
43
+ this.bodyBuffer = Buffer.concat([this.bodyBuffer, data]);
44
+ return offset;
45
+ });
46
+ }
47
+ readBody(offset, length) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ return this.bodyBuffer.subarray(offset, offset + length);
50
+ });
51
+ }
52
+ getBodySize() {
53
+ return this.bodyBuffer.length;
54
+ }
55
+ appendHeaderLine(line) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ this.headerLines.push(line);
58
+ });
59
+ }
60
+ readHeaderLines() {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ return [...this.headerLines];
63
+ });
64
+ }
65
+ readSeqNums() {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ return this.seqNumsContent;
68
+ });
69
+ }
70
+ writeSeqNums(content) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ this.seqNumsContent = content;
73
+ });
74
+ }
75
+ readSessionTime() {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ return this.sessionTimeContent;
78
+ });
79
+ }
80
+ writeSessionTime(content) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ this.sessionTimeContent = content;
83
+ });
84
+ }
85
+ reset() {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ this.bodyBuffer = Buffer.alloc(0);
88
+ this.headerLines = [];
89
+ this.seqNumsContent = null;
90
+ this.sessionTimeContent = null;
91
+ });
92
+ }
93
+ flush() {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ });
96
+ }
97
+ dispose() {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ });
100
+ }
101
+ }
102
+ exports.MemorySessionStreamProvider = MemorySessionStreamProvider;
103
+ //# sourceMappingURL=memory-session-stream-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-session-stream-provider.js","sourceRoot":"","sources":["../../src/store/memory-session-stream-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,MAAa,2BAA2B;IAAxC;QACU,eAAU,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACpC,gBAAW,GAAa,EAAE,CAAA;QAC1B,mBAAc,GA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AO,IAAI,CAAC,cAAc,CAAA;QAC5B,CAAC;KAAA;IAEK,YAAY,CAAE,OAAe;;YACjC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAA;QAC/B,CAAC;KAAA;IAEK,eAAe;;YACnB,OAAO,IAAI,CAAC,kBAAkB,CAAA;QAChC,CAAC;KAAA;IAEK,gBAAgB,CAAE,OAAe;;YACrC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAA;QACnC,CAAC;KAAA;IAEK,KAAK;;YACT,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACjC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;YACrB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAA;YAC1B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAA;QAChC,CAAC;KAAA;IAEK,KAAK;;QAEX,CAAC;KAAA;IAEK,OAAO;;QAEb,CAAC;KAAA;CACF;AA1FD,kEA0FC","sourcesContent":["import { ISessionStreamProvider } from './session-stream-provider'\n\n/**\n * In-memory implementation of ISessionStreamProvider for testing.\n * Stores all data in buffers and strings for inspection.\n */\nexport class MemorySessionStreamProvider implements ISessionStreamProvider {\n private bodyBuffer: Buffer = Buffer.alloc(0)\n private headerLines: string[] = []\n private seqNumsContent: string | null = null\n private sessionTimeContent: string | null = null\n\n // Inspection methods for tests\n\n getBodyBytes (): Buffer {\n return Buffer.from(this.bodyBuffer)\n }\n\n getBodyString (): string {\n return this.bodyBuffer.toString('utf8')\n }\n\n getHeaderString (): string {\n return this.headerLines.join('\\n')\n }\n\n getHeaderLinesSnapshot (): string[] {\n return [...this.headerLines]\n }\n\n getSeqNumsContent (): string | null {\n return this.seqNumsContent\n }\n\n getSessionTimeContent (): string | null {\n return this.sessionTimeContent\n }\n\n // ISessionStreamProvider implementation\n\n openBody (): void {\n // No-op for memory provider, body is always available\n }\n\n async appendBody (data: Buffer): Promise<number> {\n const offset = this.bodyBuffer.length\n this.bodyBuffer = Buffer.concat([this.bodyBuffer, data])\n return offset\n }\n\n async readBody (offset: number, length: number): Promise<Buffer> {\n return this.bodyBuffer.subarray(offset, offset + length)\n }\n\n getBodySize (): number {\n return this.bodyBuffer.length\n }\n\n async appendHeaderLine (line: string): Promise<void> {\n this.headerLines.push(line)\n }\n\n async readHeaderLines (): Promise<string[]> {\n return [...this.headerLines]\n }\n\n async readSeqNums (): Promise<string | null> {\n return this.seqNumsContent\n }\n\n async writeSeqNums (content: string): Promise<void> {\n this.seqNumsContent = content\n }\n\n async readSessionTime (): Promise<string | null> {\n return this.sessionTimeContent\n }\n\n async writeSessionTime (content: string): Promise<void> {\n this.sessionTimeContent = content\n }\n\n async reset (): Promise<void> {\n this.bodyBuffer = Buffer.alloc(0)\n this.headerLines = []\n this.seqNumsContent = null\n this.sessionTimeContent = null\n }\n\n async flush (): Promise<void> {\n // No-op for memory provider\n }\n\n async dispose (): Promise<void> {\n // No-op for memory provider\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ export declare class SessionId {
2
+ readonly beginString: string;
3
+ readonly senderCompID: string;
4
+ readonly targetCompID: string;
5
+ constructor(beginString: string, senderCompID: string, targetCompID: string);
6
+ toFilePrefix(): string;
7
+ getFilePath(directory: string, extension: string): string;
8
+ toString(): string;
9
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.SessionId = void 0;
37
+ const path = __importStar(require("path"));
38
+ class SessionId {
39
+ constructor(beginString, senderCompID, targetCompID) {
40
+ this.beginString = beginString;
41
+ this.senderCompID = senderCompID;
42
+ this.targetCompID = targetCompID;
43
+ }
44
+ toFilePrefix() {
45
+ return `${this.beginString}-${this.senderCompID}-${this.targetCompID}`;
46
+ }
47
+ getFilePath(directory, extension) {
48
+ return path.join(directory, `${this.toFilePrefix()}.${extension}`);
49
+ }
50
+ toString() {
51
+ return this.toFilePrefix();
52
+ }
53
+ }
54
+ exports.SessionId = SessionId;
55
+ //# sourceMappingURL=session-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-id.js","sourceRoot":"","sources":["../../src/store/session-id.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAM5B,MAAa,SAAS;IACpB,YACkB,WAAmB,EACnB,YAAoB,EACpB,YAAoB;QAFpB,gBAAW,GAAX,WAAW,CAAQ;QACnB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAQ;IACnC,CAAC;IAMJ,YAAY;QACV,OAAO,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,EAAE,CAAA;IACxE,CAAC;IAKD,WAAW,CAAE,SAAiB,EAAE,SAAiB;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,SAAS,EAAE,CAAC,CAAA;IACpE,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,YAAY,EAAE,CAAA;IAC5B,CAAC;CACF;AAzBD,8BAyBC","sourcesContent":["import * as path from 'path'\n\n/**\n * Identifies a FIX session for file naming and lookup.\n * Format: {BeginString}-{SenderCompID}-{TargetCompID}\n */\nexport class SessionId {\n constructor (\n public readonly beginString: string,\n public readonly senderCompID: string,\n public readonly targetCompID: string\n ) {}\n\n /**\n * Creates a file prefix for QuickFix-compatible file naming.\n * Example: \"FIX.4.4-SENDER-TARGET\"\n */\n toFilePrefix (): string {\n return `${this.beginString}-${this.senderCompID}-${this.targetCompID}`\n }\n\n /**\n * Gets the full path for a specific file extension.\n */\n getFilePath (directory: string, extension: string): string {\n return path.join(directory, `${this.toFilePrefix()}.${extension}`)\n }\n\n toString (): string {\n return this.toFilePrefix()\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ export interface ISessionStreamProvider {
2
+ openBody(): void;
3
+ appendBody(data: Buffer): Promise<number>;
4
+ readBody(offset: number, length: number): Promise<Buffer>;
5
+ getBodySize(): number;
6
+ appendHeaderLine(line: string): Promise<void>;
7
+ readHeaderLines(): Promise<string[]>;
8
+ readSeqNums(): Promise<string | null>;
9
+ writeSeqNums(content: string): Promise<void>;
10
+ readSessionTime(): Promise<string | null>;
11
+ writeSessionTime(content: string): Promise<void>;
12
+ reset(): Promise<void>;
13
+ flush(): Promise<void>;
14
+ dispose(): Promise<void>;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=session-stream-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-stream-provider.js","sourceRoot":"","sources":["../../src/store/session-stream-provider.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Provides stream access for session store operations.\n * Allows abstraction of file I/O for testing with in-memory buffers.\n */\nexport interface ISessionStreamProvider {\n /**\n * Opens or creates a read-write buffer for the message body file.\n * Must support random-access reads (by offset+length).\n */\n openBody (): void\n\n /**\n * Appends data to the body. Returns the offset at which data was written.\n */\n appendBody (data: Buffer): Promise<number>\n\n /**\n * Reads data from the body at the given offset and length.\n */\n readBody (offset: number, length: number): Promise<Buffer>\n\n /**\n * Gets the current body size (for calculating offsets).\n */\n getBodySize (): number\n\n /**\n * Appends a line to the header index file.\n */\n appendHeaderLine (line: string): Promise<void>\n\n /**\n * Reads all lines from the header index file.\n * Returns empty array if no data exists.\n */\n readHeaderLines (): Promise<string[]>\n\n /**\n * Reads the sequence numbers string.\n * Returns null if no data exists.\n */\n readSeqNums (): Promise<string | null>\n\n /**\n * Writes the sequence numbers string.\n */\n writeSeqNums (content: string): Promise<void>\n\n /**\n * Reads the session time string.\n * Returns null if no data exists.\n */\n readSessionTime (): Promise<string | null>\n\n /**\n * Writes the session time string.\n */\n writeSessionTime (content: string): Promise<void>\n\n /**\n * Resets all streams/files for a new session.\n */\n reset (): Promise<void>\n\n /**\n * Flushes any pending writes.\n */\n flush (): Promise<void>\n\n /**\n * Disposes of all resources.\n */\n dispose (): Promise<void>\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export interface StoreConfig {
2
+ readonly type: 'memory' | 'file';
3
+ readonly directory?: string;
4
+ readonly resendGapFillOnly?: boolean;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=store-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-config.js","sourceRoot":"","sources":["../../src/store/store-config.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Configuration for session message store.\n * Add to session description JSON to enable persistent storage.\n *\n * Examples:\n * \"store\": { \"type\": \"memory\" } — explicit in-memory (default)\n * \"store\": { \"type\": \"file\" } — file store in ./store directory\n * \"store\": { \"type\": \"file\", \"directory\": \"/var/fix/sessions\" }\n *\n * Omitting the store block entirely uses in-memory storage.\n */\nexport interface StoreConfig {\n readonly type: 'memory' | 'file'\n readonly directory?: string\n readonly resendGapFillOnly?: boolean\n}\n"]}
@@ -1,14 +1,17 @@
1
1
  import { MsgView } from '../../buffer';
2
2
  import { IJsFixConfig } from '../../config';
3
3
  import { FixSession } from '../session/fix-session';
4
- import { FixMsgAsciiStoreResend, IFixMsgStore } from '../../store';
4
+ import { FixMsgAsciiStoreResend, IFixMsgStore, IFixSessionStore, SessionId } from '../../store';
5
5
  import { SessionSequenceCoordinator } from '../session/session-sequence-coordinator';
6
+ import { ILooseObject } from '../../collections/collection';
6
7
  export declare abstract class AsciiSession extends FixSession {
7
8
  readonly config: IJsFixConfig;
8
9
  heartbeat: boolean;
9
10
  protected store: IFixMsgStore | null;
10
11
  protected resender: FixMsgAsciiStoreResend;
11
12
  protected readonly coordinator: SessionSequenceCoordinator;
13
+ protected readonly sessionStore: IFixSessionStore;
14
+ protected readonly sessionId: SessionId;
12
15
  protected constructor(config: IJsFixConfig);
13
16
  private checkSeqNo;
14
17
  protected checkForwardMsg(msgType: string, view: MsgView): void;
@@ -17,8 +20,10 @@ export declare abstract class AsciiSession extends FixSession {
17
20
  private checkIntegrity;
18
21
  protected onResendRequest(view: MsgView): void;
19
22
  protected onPrepareForReconnect(): void;
23
+ protected txOnEncoded(msgType: string, data: string, hdr: ILooseObject): void;
20
24
  private static readonly MaxLogonRetries;
21
25
  private static readonly MaxTimeoutRecoveryAttempts;
26
+ private static createStoreFactory;
22
27
  private handleLogonRejected;
23
28
  okForLogon(): boolean;
24
29
  protected onSessionMsg(msgType: string, view: MsgView): void;