@cosyte/mllp 0.1.6 → 0.1.9
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/CHANGELOG.md +29 -0
- package/README.md +29 -16
- package/dist/ack-from-hl7/index.cjs +48 -27
- package/dist/ack-from-hl7/index.cjs.map +1 -1
- package/dist/ack-from-hl7/index.d.cts +1 -1
- package/dist/ack-from-hl7/index.d.ts +1 -1
- package/dist/ack-from-hl7/index.mjs +48 -27
- package/dist/ack-from-hl7/index.mjs.map +1 -1
- package/dist/arbitraries/index.cjs +282 -0
- package/dist/arbitraries/index.cjs.map +1 -0
- package/dist/arbitraries/index.d.cts +245 -0
- package/dist/arbitraries/index.d.ts +245 -0
- package/dist/arbitraries/index.mjs +271 -0
- package/dist/arbitraries/index.mjs.map +1 -0
- package/dist/index.cjs +276 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -103
- package/dist/index.d.ts +74 -103
- package/dist/index.mjs +276 -82
- package/dist/index.mjs.map +1 -1
- package/dist/registry-CyGU_l8N.d.cts +86 -0
- package/dist/registry-CyGU_l8N.d.ts +86 -0
- package/package.json +26 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,92 +1,10 @@
|
|
|
1
|
+
import { W as WarningCode, M as MllpWarning } from './registry-CyGU_l8N.cjs';
|
|
2
|
+
export { c as createWarning } from './registry-CyGU_l8N.cjs';
|
|
1
3
|
import { T as Transport } from './index-CD8V2Mtk.cjs';
|
|
2
4
|
import { EventEmitter } from 'node:events';
|
|
3
5
|
import { Socket } from 'node:net';
|
|
4
6
|
import { TLSSocket } from 'node:tls';
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
* MLLP warning code registry and `MllpWarning` factory.
|
|
8
|
-
*
|
|
9
|
-
* `WarningCode` is a **stable public API**. Renaming or removing a code is a breaking change.
|
|
10
|
-
* New codes may only be added in minor versions.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import { createWarning, type MllpWarning, type WarningCode } from '@cosyte/mllp';
|
|
15
|
-
* const w: MllpWarning = createWarning('MLLP_EMPTY_PAYLOAD', 128, 'Empty payload between VT and FS');
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @packageDocumentation
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Union of all stable MLLP warning codes.
|
|
22
|
-
*
|
|
23
|
-
* These codes are a **public API**, they appear in `onWarning` handlers, log pipelines,
|
|
24
|
-
* monitoring dashboards, and error messages. Renaming is a breaking change.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* const code: WarningCode = 'MLLP_FS_WITHOUT_CR';
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
type WarningCode = "MLLP_MISSING_LEADING_VT" | "MLLP_FS_WITHOUT_CR" | "MLLP_LF_AFTER_FS" | "MLLP_LEADING_WHITESPACE" | "MLLP_TRAILING_BYTES" | "MLLP_PAYLOAD_CONTAINS_VT" | "MLLP_PAYLOAD_CONTAINS_FS" | "MLLP_EMPTY_PAYLOAD" | "MLLP_FRAME_TOO_LARGE" | "MLLP_ACK_UNMATCHED_CONTROL_ID" | "MLLP_ACK_AFTER_TIMEOUT";
|
|
32
|
-
/**
|
|
33
|
-
* A frozen warning object emitted when the decoder tolerates a framing deviation.
|
|
34
|
-
*
|
|
35
|
-
* `connectionId` is `undefined` when emitted by a standalone `FrameReader`.
|
|
36
|
-
* `Connection` enriches it to the real UUIDv4 before forwarding upstream.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* const reader = new FrameReader({
|
|
41
|
-
* onFrame: (p) => process(p),
|
|
42
|
-
* onWarning: (w: MllpWarning) => logger.warn(w),
|
|
43
|
-
* allowFsOnly: true,
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
interface MllpWarning {
|
|
48
|
-
readonly code: WarningCode;
|
|
49
|
-
/**
|
|
50
|
-
* Stable human-readable description. It carries structural facts (a byte
|
|
51
|
-
* offset, an accumulated size) and **never a run of payload content**.
|
|
52
|
-
*
|
|
53
|
-
* Two codes carry exactly one input byte, and it is worth knowing which:
|
|
54
|
-
* `MLLP_MISSING_LEADING_VT` and `MLLP_FS_WITHOUT_CR` render the hex of the
|
|
55
|
-
* single byte found where a framing byte was expected, and on a stream that
|
|
56
|
-
* omits its leading `VT` that byte is the first byte of the unframed content.
|
|
57
|
-
* One byte, never a run, the same bound `MllpFramingError.snippet` carries. If
|
|
58
|
-
* that is more than your threat model allows, log `code` and `byteOffset`
|
|
59
|
-
* rather than `message`.
|
|
60
|
-
*
|
|
61
|
-
* The ACK-correlation codes are stricter: their text comes from a frozen
|
|
62
|
-
* registry and does not vary with the wire at all.
|
|
63
|
-
*/
|
|
64
|
-
readonly message: string;
|
|
65
|
-
/** Absolute stream byte offset where the anomaly was detected. */
|
|
66
|
-
readonly byteOffset: number;
|
|
67
|
-
/**
|
|
68
|
-
* Connection identifier. `undefined` at the framing layer;
|
|
69
|
-
* enriched by `Connection` before emitting upstream.
|
|
70
|
-
*/
|
|
71
|
-
readonly connectionId: string | undefined;
|
|
72
|
-
/** Wall-clock time at point of emission. */
|
|
73
|
-
readonly timestamp: Date;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Create a frozen `MllpWarning` object. The returned object is `Object.freeze()`'d
|
|
77
|
-
* so subscribers cannot mutate shared warning state.
|
|
78
|
-
*
|
|
79
|
-
* `connectionId` is always `undefined` here; `Connection` enriches it via
|
|
80
|
-
* `{ ...w, connectionId: this.connectionId }` then re-freezes.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```typescript
|
|
84
|
-
* const w = createWarning('MLLP_EMPTY_PAYLOAD', 64, 'Empty payload between VT and FS');
|
|
85
|
-
* // w.connectionId === undefined
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
declare function createWarning(code: WarningCode, byteOffset: number, message: string): MllpWarning;
|
|
89
|
-
|
|
90
8
|
/**
|
|
91
9
|
* Typed framing error class for unrecoverable MLLP wire-format violations.
|
|
92
10
|
*
|
|
@@ -351,9 +269,17 @@ declare class FrameReader {
|
|
|
351
269
|
private readonly _opts;
|
|
352
270
|
private readonly _maxFrameSize;
|
|
353
271
|
private _state;
|
|
354
|
-
/** Reusable
|
|
272
|
+
/** Reusable 4 KiB block the current frame's latest bytes are gathered in. */
|
|
355
273
|
private _accumulator;
|
|
356
|
-
/** Number of
|
|
274
|
+
/** Number of the current frame's bytes in `_accumulator`. */
|
|
275
|
+
private _blockUsed;
|
|
276
|
+
/**
|
|
277
|
+
* The current frame's earlier bytes, in order, once it outgrew one block: full blocks, and
|
|
278
|
+
* exact copies of runs longer than a block. Dropped with the frame, so a reader holds no more
|
|
279
|
+
* than the frame it is part way through.
|
|
280
|
+
*/
|
|
281
|
+
private _parts;
|
|
282
|
+
/** Number of payload bytes in the current frame, `_parts` and `_accumulator` together. */
|
|
357
283
|
private _writePos;
|
|
358
284
|
/** Monotonic absolute stream byte offset across the entire connection lifetime. */
|
|
359
285
|
private _byteOffset;
|
|
@@ -382,6 +308,30 @@ declare class FrameReader {
|
|
|
382
308
|
* ```
|
|
383
309
|
*/
|
|
384
310
|
push(chunk: Buffer): void;
|
|
311
|
+
/** The byte-at-a-time reading, for a chunk that is not a byte array. */
|
|
312
|
+
private _pushEachByte;
|
|
313
|
+
/**
|
|
314
|
+
* How many more payload bytes the size cap admits. A byte is admitted while
|
|
315
|
+
* `writePos < maxFrameSizeBytes`, so a fractional cap admits up to its ceiling, a cap already
|
|
316
|
+
* reached admits none, and a `NaN` cap, which that comparison never refuses, admits any number.
|
|
317
|
+
*/
|
|
318
|
+
private _room;
|
|
319
|
+
/**
|
|
320
|
+
* Append the ordinary payload bytes `chunk[start, stop)`, none of them FS or VT, in one copy.
|
|
321
|
+
* The size cap holds as it did byte by byte: every byte it admits is appended, and the first it
|
|
322
|
+
* refuses throws at that byte's offset.
|
|
323
|
+
*/
|
|
324
|
+
private _appendRun;
|
|
325
|
+
/** Refuse the payload byte at the current offset: the frame has reached its size cap. */
|
|
326
|
+
private _throwTooLarge;
|
|
327
|
+
/**
|
|
328
|
+
* Add `src[start, end)` to the current frame: into the block while it has room; then the full
|
|
329
|
+
* block becomes a part, a run of a block or more is copied as one part of its own, and what is
|
|
330
|
+
* left starts a fresh block.
|
|
331
|
+
*/
|
|
332
|
+
private _gather;
|
|
333
|
+
/** Forget the current frame's bytes: the block is kept for the next frame, the parts dropped. */
|
|
334
|
+
private _discard;
|
|
385
335
|
/**
|
|
386
336
|
* Clear internal accumulator state and reset byte offset to 0.
|
|
387
337
|
*
|
|
@@ -398,13 +348,18 @@ declare class FrameReader {
|
|
|
398
348
|
private _scanForVt;
|
|
399
349
|
private _readPayload;
|
|
400
350
|
private _expectCr;
|
|
401
|
-
/**
|
|
351
|
+
/** Add one byte to the current frame, starting a fresh block when this one is full. */
|
|
402
352
|
private _appendByte;
|
|
403
353
|
/**
|
|
404
354
|
* Copy accumulated payload bytes into a new Buffer and deliver via `onFrame`.
|
|
405
355
|
* The copy isolates callers from internal accumulator reuse.
|
|
406
356
|
*/
|
|
407
357
|
private _deliverFrame;
|
|
358
|
+
/**
|
|
359
|
+
* Deliver `payload` via `onFrame` with this frame's start offset and warnings, the frame's
|
|
360
|
+
* bytes forgotten first.
|
|
361
|
+
*/
|
|
362
|
+
private _deliver;
|
|
408
363
|
/** Emit a warning via the `onWarning` callback, swallowing any handler exceptions. */
|
|
409
364
|
private _emitWarning;
|
|
410
365
|
}
|
|
@@ -1409,6 +1364,15 @@ declare class Connection extends EventEmitter {
|
|
|
1409
1364
|
private _warningsTruncated;
|
|
1410
1365
|
private _onWarningFn;
|
|
1411
1366
|
private _drainPromise;
|
|
1367
|
+
/** Resolves {@link Connection._leftDraining}; called on the transition out of `DRAINING`. */
|
|
1368
|
+
private _leaveDraining;
|
|
1369
|
+
/**
|
|
1370
|
+
* Settles when the connection leaves `DRAINING` by any route: the drain finishing, the drain
|
|
1371
|
+
* timeout, a `destroy()`, or the peer closing. A connection enters `DRAINING` at most once, so
|
|
1372
|
+
* one promise per connection is enough. The drain races it, so a `close()` never outlives the
|
|
1373
|
+
* drain it waits on.
|
|
1374
|
+
*/
|
|
1375
|
+
private readonly _leftDraining;
|
|
1412
1376
|
/**
|
|
1413
1377
|
* beforeClose hook, no-op default that resolves immediately.
|
|
1414
1378
|
*
|
|
@@ -1445,7 +1409,9 @@ declare class Connection extends EventEmitter {
|
|
|
1445
1409
|
* Notify the connection that the transport handshake has completed.
|
|
1446
1410
|
*
|
|
1447
1411
|
* Transitions `CONNECTING → CONNECTED` and emits the `'connect'` event.
|
|
1448
|
-
* Called externally by Server/Client after the socket connects.
|
|
1412
|
+
* Called externally by Server/Client after the socket connects. In any other state it does
|
|
1413
|
+
* nothing: a connection closed before its socket connected stays `CLOSED` and emits no
|
|
1414
|
+
* `'connect'`, and a second call on a `CONNECTED` connection emits no second one.
|
|
1449
1415
|
*
|
|
1450
1416
|
* @param remoteAddress - Remote peer IP address, or `null` if unavailable.
|
|
1451
1417
|
* @param remotePort - Remote peer port, or `null` if unavailable.
|
|
@@ -1482,6 +1448,10 @@ declare class Connection extends EventEmitter {
|
|
|
1482
1448
|
* then `DRAINING → DISCONNECTED` once the hook resolves, or `DRAINING → CLOSED`
|
|
1483
1449
|
* if the drain timeout elapses first.
|
|
1484
1450
|
* - If `DRAINING`: waits for the existing drain to complete (idempotent).
|
|
1451
|
+
*
|
|
1452
|
+
* Every pending `close()` resolves as soon as the connection leaves `DRAINING`, by whatever
|
|
1453
|
+
* route: the hook resolving, the drain timeout, a `destroy()`, or the peer closing. A
|
|
1454
|
+
* `destroy()` during a long drain therefore ends the wait at once, not at the drain timeout.
|
|
1485
1455
|
* - If `CLOSED` or `DISCONNECTED`: no-op.
|
|
1486
1456
|
*
|
|
1487
1457
|
* @param opts.drainTimeoutMs - Override drain timeout (default: `opts.drainTimeoutMs ?? 30_000`).
|
|
@@ -1712,7 +1682,7 @@ declare class MllpConnectionError extends Error {
|
|
|
1712
1682
|
* regardless of what arrives on the wire. It is the same shape, and for the same reason, as
|
|
1713
1683
|
* the correlation registry beside it.
|
|
1714
1684
|
*
|
|
1715
|
-
*
|
|
1685
|
+
* **What these diagnostics may carry**
|
|
1716
1686
|
*
|
|
1717
1687
|
* Stable codes, byte counts, byte offsets, elapsed times, and an acknowledgement code drawn
|
|
1718
1688
|
* from the closed six-code Table 0008 set. Nothing else. A control ID is payload content, a
|
|
@@ -2454,7 +2424,7 @@ declare function createStarterServer(opts: StarterServerOptions): Promise<MllpSe
|
|
|
2454
2424
|
* path, the HL7 Table 0008 acknowledgement-code union, and the error type a message
|
|
2455
2425
|
* handler throws to request a specific negative acknowledgement.
|
|
2456
2426
|
*
|
|
2457
|
-
*
|
|
2427
|
+
* **Why this is safety-critical**
|
|
2458
2428
|
*
|
|
2459
2429
|
* A positive acknowledgement (`AA`) tells the sender "you may forget this message, I
|
|
2460
2430
|
* have it." If a server emits `AA` *before* the message is durably handled and then the
|
|
@@ -2471,6 +2441,7 @@ declare function createStarterServer(opts: StarterServerOptions): Promise<MllpSe
|
|
|
2471
2441
|
*
|
|
2472
2442
|
* @packageDocumentation
|
|
2473
2443
|
*/
|
|
2444
|
+
|
|
2474
2445
|
/**
|
|
2475
2446
|
* HL7 Table 0008, Acknowledgment Code. A **stable public API**.
|
|
2476
2447
|
*
|
|
@@ -2608,7 +2579,7 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
|
|
|
2608
2579
|
* negative codes, adds a **static, PHI-free** MSA-3 reason. A fresh control ID fills the
|
|
2609
2580
|
* ACK's own MSH-10.
|
|
2610
2581
|
*
|
|
2611
|
-
*
|
|
2582
|
+
* **Why the delimiters are read, not assumed**
|
|
2612
2583
|
*
|
|
2613
2584
|
* MSH-1 **is** the field separator (HL7 v2.5.1 §2.5.4): the byte at offset 3 of the MSH
|
|
2614
2585
|
* segment *defines* it for the whole message. `|` is overwhelmingly common but it is a
|
|
@@ -2627,7 +2598,7 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
|
|
|
2627
2598
|
* single component rather than two. Echoing MSH-1 and MSH-2 keeps the content and
|
|
2628
2599
|
* the delimiters that define it together.
|
|
2629
2600
|
*
|
|
2630
|
-
*
|
|
2601
|
+
* **It reads the MSH through the SHARED scanner**
|
|
2631
2602
|
*
|
|
2632
2603
|
* The MSH read is `readMshSegment` from `src/internal/control-id.ts`, the same call the
|
|
2633
2604
|
* client's correlator makes to derive the key it will later match this ACK against. That
|
|
@@ -2647,7 +2618,7 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
|
|
|
2647
2618
|
* is not the goal; agreeing on the *correct*, *tolerant* answer is. A lenient reader may
|
|
2648
2619
|
* never drop data that is there (Postel's Law, CLAUDE.md).
|
|
2649
2620
|
*
|
|
2650
|
-
*
|
|
2621
|
+
* **The fail-safe downgrade: never a positive `AA`/`CA` it cannot correlate**
|
|
2651
2622
|
*
|
|
2652
2623
|
* A positive acknowledgement is a promise the sender may forget the message. If it names a
|
|
2653
2624
|
* control ID the sender cannot match, or names one message out of several it never read,
|
|
@@ -2688,7 +2659,7 @@ declare function buildRawAck(payload: Buffer, code: AckCode): Buffer;
|
|
|
2688
2659
|
* handed a value cannot interpolate one, regardless of what arrives on the
|
|
2689
2660
|
* wire.
|
|
2690
2661
|
*
|
|
2691
|
-
*
|
|
2662
|
+
* **What this replaces, and why the shape matters more than the wording**
|
|
2692
2663
|
*
|
|
2693
2664
|
* The `correlateByControlId` path used to build its diagnostics by
|
|
2694
2665
|
* interpolation, and both ends of it were consumer-controlled and unbounded.
|
|
@@ -2703,7 +2674,7 @@ declare function buildRawAck(payload: Buffer, code: AckCode): Buffer;
|
|
|
2703
2674
|
* PID-3, a patient's medical record number, as the "control ID" of a truncated
|
|
2704
2675
|
* MSH. Withholding the bytes is the defence that survives the next such bug.
|
|
2705
2676
|
*
|
|
2706
|
-
*
|
|
2677
|
+
* **What a correlation diagnostic says instead**
|
|
2707
2678
|
*
|
|
2708
2679
|
* That a control id did not match, plus **numbers**: a byte length, a stream
|
|
2709
2680
|
* offset, an elapsed time. A number is a shape, not content. A truncated id is
|
|
@@ -3579,7 +3550,7 @@ declare class MllpClient extends EventEmitter {
|
|
|
3579
3550
|
*
|
|
3580
3551
|
* Emits a frozen `'ack'` event on every successful match.
|
|
3581
3552
|
*
|
|
3582
|
-
*
|
|
3553
|
+
* **Enhanced acknowledgement mode**
|
|
3583
3554
|
*
|
|
3584
3555
|
* A message whose MSH-15 or MSH-16 is not null asks for the two-part protocol of HL7
|
|
3585
3556
|
* v2.5.1 §2.9, and on a client correlating by control ID this method delivers it: the
|
|
@@ -4666,14 +4637,14 @@ declare function resolveDifferentialPeer(raw: string | undefined | null): Differ
|
|
|
4666
4637
|
* `JSON.stringify` a run straight into a log pipeline or a review artifact and read it
|
|
4667
4638
|
* programmatically without scraping human-readable text.
|
|
4668
4639
|
*
|
|
4669
|
-
*
|
|
4640
|
+
* **What this report is, and what it is not**
|
|
4670
4641
|
*
|
|
4671
4642
|
* It records what was **observed** on the wire. It is not a conformance verdict and never
|
|
4672
4643
|
* becomes one: no field says a peer is conformant, no field says a run passed, and nothing
|
|
4673
4644
|
* here decides whether an interface is fit to carry clinical traffic. That judgement
|
|
4674
4645
|
* belongs to the people standing the interface up, with this evidence in front of them.
|
|
4675
4646
|
*
|
|
4676
|
-
*
|
|
4647
|
+
* **Why no payload content appears anywhere**
|
|
4677
4648
|
*
|
|
4678
4649
|
* A peer answering this harness may be a live engine holding real patients, and a report
|
|
4679
4650
|
* is a diagnostic surface that gets written to a file, pasted into a ticket and mailed to
|
|
@@ -4849,7 +4820,7 @@ interface DifferentialReportPeer {
|
|
|
4849
4820
|
* The differential run: send each canonical message at a peer, read what comes back, and
|
|
4850
4821
|
* report what was observed.
|
|
4851
4822
|
*
|
|
4852
|
-
*
|
|
4823
|
+
* **What it does, exchange by exchange**
|
|
4853
4824
|
*
|
|
4854
4825
|
* One connection per exchange, opened, used and closed. That is deliberate: a peer that
|
|
4855
4826
|
* refuses or drops one connection then costs one exchange rather than the whole run, which
|
|
@@ -4862,14 +4833,14 @@ interface DifferentialReportPeer {
|
|
|
4862
4833
|
* that deviates from the block is described by the stable warning code for that deviation
|
|
4863
4834
|
* rather than killing the run with an opaque error.
|
|
4864
4835
|
*
|
|
4865
|
-
*
|
|
4836
|
+
* **What byte parity means here**
|
|
4866
4837
|
*
|
|
4867
4838
|
* The MLLP **envelope** the peer emitted, compared against the canonical Release 1 block
|
|
4868
4839
|
* this package emits for the same payload. It is not equality of message content, which
|
|
4869
4840
|
* can never hold: an acknowledgement carries the peer's own control ID, its own timestamp
|
|
4870
4841
|
* and its own sending application, and it is supposed to.
|
|
4871
4842
|
*
|
|
4872
|
-
*
|
|
4843
|
+
* **Aim it with care**
|
|
4873
4844
|
*
|
|
4874
4845
|
* A run sends real bytes into whatever engine it is pointed at. Those bytes are synthetic
|
|
4875
4846
|
* patients, so an engine that accepts them stores synthetic patients. Point it at a test
|
|
@@ -4981,5 +4952,5 @@ declare function runDifferential(options?: DifferentialRunOptions): Promise<Diff
|
|
|
4981
4952
|
*/
|
|
4982
4953
|
declare const VERSION: string;
|
|
4983
4954
|
|
|
4984
|
-
export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_VERIFY_DISABLED, MllpAckError, MllpApplicationAckError, MllpBackpressureError, MllpClient, MllpCommitRejectedError, MllpConnectionError, MllpDifferentialConfigurationError, MllpFramingError, MllpNeverDeliveredError, MllpServer, MllpTimeoutError, MllpTlsConfigurationError, MllpUnknownFateError, NetTransport, TLS13_DEFAULT_CIPHER_SUITES, TlsTransport, Transport, VERSION, ackDiagnosticMessage, ackModeDiagnosticMessage, buildRawAck, canonicalAcknowledgement, canonicalExchanges, createClient, createServer, createStarterClient, createStarterServer,
|
|
4985
|
-
export type { AckCode, AckCorrelationCode, AckCorrelationWarning, AckModeCode, AckModeWarning, AckModeWarningEvent, ApplicationAckFailure, CanonicalExchange, ClientAuth, ClientOptions, ClientStats, CommitAckReport, ConnectionErrorCause, ConnectionErrorPhase, ConnectionOptions, ConnectionState, ConnectionStats, DifferentialConfigurationErrorCode, DifferentialConnect, DifferentialCorrelationOutcome, DifferentialDeviation, DifferentialExchangeOutcome, DifferentialExchangeReport, DifferentialParityOutcome, DifferentialPeer, DifferentialReport, DifferentialReportPeer, DifferentialRunOptions, DifferentialRunResult, DifferentialSkipReason, EncoderOptions, FrameReaderOptions, MessageMeta,
|
|
4955
|
+
export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_VERIFY_DISABLED, MllpAckError, MllpApplicationAckError, MllpBackpressureError, MllpClient, MllpCommitRejectedError, MllpConnectionError, MllpDifferentialConfigurationError, MllpFramingError, MllpNeverDeliveredError, MllpServer, MllpTimeoutError, MllpTlsConfigurationError, MllpUnknownFateError, MllpWarning, NetTransport, TLS13_DEFAULT_CIPHER_SUITES, TlsTransport, Transport, VERSION, WarningCode, ackDiagnosticMessage, ackModeDiagnosticMessage, buildRawAck, canonicalAcknowledgement, canonicalExchanges, createClient, createServer, createStarterClient, createStarterServer, differentialConfigurationMessage, encodeFrame, isTlsProtocolError, isTlsVerificationErrorCode, isTransientConnectionError, rawAckUncorrelatable, readNegotiatedTlsParameters, resolveDifferentialPeer, resolveNackCode, resolveTlsCipherPolicy, runDifferential, tlsConfigurationMessage };
|
|
4956
|
+
export type { AckCode, AckCorrelationCode, AckCorrelationWarning, AckModeCode, AckModeWarning, AckModeWarningEvent, ApplicationAckFailure, CanonicalExchange, ClientAuth, ClientOptions, ClientStats, CommitAckReport, ConnectionErrorCause, ConnectionErrorPhase, ConnectionOptions, ConnectionState, ConnectionStats, DifferentialConfigurationErrorCode, DifferentialConnect, DifferentialCorrelationOutcome, DifferentialDeviation, DifferentialExchangeOutcome, DifferentialExchangeReport, DifferentialParityOutcome, DifferentialPeer, DifferentialReport, DifferentialReportPeer, DifferentialRunOptions, DifferentialRunResult, DifferentialSkipReason, EncoderOptions, FrameReaderOptions, MessageMeta, NackAckCode, NackEvent, NackReason, NegativeAckCode, NegotiatedTlsParameters, PemInput, ReconnectingEvent, ResolvedTlsCipherPolicy, RetryContext, RetryStrategy, SecurityWarning, SecurityWarningCode, ServerOptions, ServerStats, ServerTlsOptions, StarterClientOptions, StarterServerOptions, StateChangeEvent, TlsCipherPolicyInput, TlsConfigurationErrorCode, TlsOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,92 +1,10 @@
|
|
|
1
|
+
import { W as WarningCode, M as MllpWarning } from './registry-CyGU_l8N.js';
|
|
2
|
+
export { c as createWarning } from './registry-CyGU_l8N.js';
|
|
1
3
|
import { T as Transport } from './index-CD8V2Mtk.js';
|
|
2
4
|
import { EventEmitter } from 'node:events';
|
|
3
5
|
import { Socket } from 'node:net';
|
|
4
6
|
import { TLSSocket } from 'node:tls';
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
* MLLP warning code registry and `MllpWarning` factory.
|
|
8
|
-
*
|
|
9
|
-
* `WarningCode` is a **stable public API**. Renaming or removing a code is a breaking change.
|
|
10
|
-
* New codes may only be added in minor versions.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import { createWarning, type MllpWarning, type WarningCode } from '@cosyte/mllp';
|
|
15
|
-
* const w: MllpWarning = createWarning('MLLP_EMPTY_PAYLOAD', 128, 'Empty payload between VT and FS');
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @packageDocumentation
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Union of all stable MLLP warning codes.
|
|
22
|
-
*
|
|
23
|
-
* These codes are a **public API**, they appear in `onWarning` handlers, log pipelines,
|
|
24
|
-
* monitoring dashboards, and error messages. Renaming is a breaking change.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* const code: WarningCode = 'MLLP_FS_WITHOUT_CR';
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
type WarningCode = "MLLP_MISSING_LEADING_VT" | "MLLP_FS_WITHOUT_CR" | "MLLP_LF_AFTER_FS" | "MLLP_LEADING_WHITESPACE" | "MLLP_TRAILING_BYTES" | "MLLP_PAYLOAD_CONTAINS_VT" | "MLLP_PAYLOAD_CONTAINS_FS" | "MLLP_EMPTY_PAYLOAD" | "MLLP_FRAME_TOO_LARGE" | "MLLP_ACK_UNMATCHED_CONTROL_ID" | "MLLP_ACK_AFTER_TIMEOUT";
|
|
32
|
-
/**
|
|
33
|
-
* A frozen warning object emitted when the decoder tolerates a framing deviation.
|
|
34
|
-
*
|
|
35
|
-
* `connectionId` is `undefined` when emitted by a standalone `FrameReader`.
|
|
36
|
-
* `Connection` enriches it to the real UUIDv4 before forwarding upstream.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* const reader = new FrameReader({
|
|
41
|
-
* onFrame: (p) => process(p),
|
|
42
|
-
* onWarning: (w: MllpWarning) => logger.warn(w),
|
|
43
|
-
* allowFsOnly: true,
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
interface MllpWarning {
|
|
48
|
-
readonly code: WarningCode;
|
|
49
|
-
/**
|
|
50
|
-
* Stable human-readable description. It carries structural facts (a byte
|
|
51
|
-
* offset, an accumulated size) and **never a run of payload content**.
|
|
52
|
-
*
|
|
53
|
-
* Two codes carry exactly one input byte, and it is worth knowing which:
|
|
54
|
-
* `MLLP_MISSING_LEADING_VT` and `MLLP_FS_WITHOUT_CR` render the hex of the
|
|
55
|
-
* single byte found where a framing byte was expected, and on a stream that
|
|
56
|
-
* omits its leading `VT` that byte is the first byte of the unframed content.
|
|
57
|
-
* One byte, never a run, the same bound `MllpFramingError.snippet` carries. If
|
|
58
|
-
* that is more than your threat model allows, log `code` and `byteOffset`
|
|
59
|
-
* rather than `message`.
|
|
60
|
-
*
|
|
61
|
-
* The ACK-correlation codes are stricter: their text comes from a frozen
|
|
62
|
-
* registry and does not vary with the wire at all.
|
|
63
|
-
*/
|
|
64
|
-
readonly message: string;
|
|
65
|
-
/** Absolute stream byte offset where the anomaly was detected. */
|
|
66
|
-
readonly byteOffset: number;
|
|
67
|
-
/**
|
|
68
|
-
* Connection identifier. `undefined` at the framing layer;
|
|
69
|
-
* enriched by `Connection` before emitting upstream.
|
|
70
|
-
*/
|
|
71
|
-
readonly connectionId: string | undefined;
|
|
72
|
-
/** Wall-clock time at point of emission. */
|
|
73
|
-
readonly timestamp: Date;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Create a frozen `MllpWarning` object. The returned object is `Object.freeze()`'d
|
|
77
|
-
* so subscribers cannot mutate shared warning state.
|
|
78
|
-
*
|
|
79
|
-
* `connectionId` is always `undefined` here; `Connection` enriches it via
|
|
80
|
-
* `{ ...w, connectionId: this.connectionId }` then re-freezes.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```typescript
|
|
84
|
-
* const w = createWarning('MLLP_EMPTY_PAYLOAD', 64, 'Empty payload between VT and FS');
|
|
85
|
-
* // w.connectionId === undefined
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
declare function createWarning(code: WarningCode, byteOffset: number, message: string): MllpWarning;
|
|
89
|
-
|
|
90
8
|
/**
|
|
91
9
|
* Typed framing error class for unrecoverable MLLP wire-format violations.
|
|
92
10
|
*
|
|
@@ -351,9 +269,17 @@ declare class FrameReader {
|
|
|
351
269
|
private readonly _opts;
|
|
352
270
|
private readonly _maxFrameSize;
|
|
353
271
|
private _state;
|
|
354
|
-
/** Reusable
|
|
272
|
+
/** Reusable 4 KiB block the current frame's latest bytes are gathered in. */
|
|
355
273
|
private _accumulator;
|
|
356
|
-
/** Number of
|
|
274
|
+
/** Number of the current frame's bytes in `_accumulator`. */
|
|
275
|
+
private _blockUsed;
|
|
276
|
+
/**
|
|
277
|
+
* The current frame's earlier bytes, in order, once it outgrew one block: full blocks, and
|
|
278
|
+
* exact copies of runs longer than a block. Dropped with the frame, so a reader holds no more
|
|
279
|
+
* than the frame it is part way through.
|
|
280
|
+
*/
|
|
281
|
+
private _parts;
|
|
282
|
+
/** Number of payload bytes in the current frame, `_parts` and `_accumulator` together. */
|
|
357
283
|
private _writePos;
|
|
358
284
|
/** Monotonic absolute stream byte offset across the entire connection lifetime. */
|
|
359
285
|
private _byteOffset;
|
|
@@ -382,6 +308,30 @@ declare class FrameReader {
|
|
|
382
308
|
* ```
|
|
383
309
|
*/
|
|
384
310
|
push(chunk: Buffer): void;
|
|
311
|
+
/** The byte-at-a-time reading, for a chunk that is not a byte array. */
|
|
312
|
+
private _pushEachByte;
|
|
313
|
+
/**
|
|
314
|
+
* How many more payload bytes the size cap admits. A byte is admitted while
|
|
315
|
+
* `writePos < maxFrameSizeBytes`, so a fractional cap admits up to its ceiling, a cap already
|
|
316
|
+
* reached admits none, and a `NaN` cap, which that comparison never refuses, admits any number.
|
|
317
|
+
*/
|
|
318
|
+
private _room;
|
|
319
|
+
/**
|
|
320
|
+
* Append the ordinary payload bytes `chunk[start, stop)`, none of them FS or VT, in one copy.
|
|
321
|
+
* The size cap holds as it did byte by byte: every byte it admits is appended, and the first it
|
|
322
|
+
* refuses throws at that byte's offset.
|
|
323
|
+
*/
|
|
324
|
+
private _appendRun;
|
|
325
|
+
/** Refuse the payload byte at the current offset: the frame has reached its size cap. */
|
|
326
|
+
private _throwTooLarge;
|
|
327
|
+
/**
|
|
328
|
+
* Add `src[start, end)` to the current frame: into the block while it has room; then the full
|
|
329
|
+
* block becomes a part, a run of a block or more is copied as one part of its own, and what is
|
|
330
|
+
* left starts a fresh block.
|
|
331
|
+
*/
|
|
332
|
+
private _gather;
|
|
333
|
+
/** Forget the current frame's bytes: the block is kept for the next frame, the parts dropped. */
|
|
334
|
+
private _discard;
|
|
385
335
|
/**
|
|
386
336
|
* Clear internal accumulator state and reset byte offset to 0.
|
|
387
337
|
*
|
|
@@ -398,13 +348,18 @@ declare class FrameReader {
|
|
|
398
348
|
private _scanForVt;
|
|
399
349
|
private _readPayload;
|
|
400
350
|
private _expectCr;
|
|
401
|
-
/**
|
|
351
|
+
/** Add one byte to the current frame, starting a fresh block when this one is full. */
|
|
402
352
|
private _appendByte;
|
|
403
353
|
/**
|
|
404
354
|
* Copy accumulated payload bytes into a new Buffer and deliver via `onFrame`.
|
|
405
355
|
* The copy isolates callers from internal accumulator reuse.
|
|
406
356
|
*/
|
|
407
357
|
private _deliverFrame;
|
|
358
|
+
/**
|
|
359
|
+
* Deliver `payload` via `onFrame` with this frame's start offset and warnings, the frame's
|
|
360
|
+
* bytes forgotten first.
|
|
361
|
+
*/
|
|
362
|
+
private _deliver;
|
|
408
363
|
/** Emit a warning via the `onWarning` callback, swallowing any handler exceptions. */
|
|
409
364
|
private _emitWarning;
|
|
410
365
|
}
|
|
@@ -1409,6 +1364,15 @@ declare class Connection extends EventEmitter {
|
|
|
1409
1364
|
private _warningsTruncated;
|
|
1410
1365
|
private _onWarningFn;
|
|
1411
1366
|
private _drainPromise;
|
|
1367
|
+
/** Resolves {@link Connection._leftDraining}; called on the transition out of `DRAINING`. */
|
|
1368
|
+
private _leaveDraining;
|
|
1369
|
+
/**
|
|
1370
|
+
* Settles when the connection leaves `DRAINING` by any route: the drain finishing, the drain
|
|
1371
|
+
* timeout, a `destroy()`, or the peer closing. A connection enters `DRAINING` at most once, so
|
|
1372
|
+
* one promise per connection is enough. The drain races it, so a `close()` never outlives the
|
|
1373
|
+
* drain it waits on.
|
|
1374
|
+
*/
|
|
1375
|
+
private readonly _leftDraining;
|
|
1412
1376
|
/**
|
|
1413
1377
|
* beforeClose hook, no-op default that resolves immediately.
|
|
1414
1378
|
*
|
|
@@ -1445,7 +1409,9 @@ declare class Connection extends EventEmitter {
|
|
|
1445
1409
|
* Notify the connection that the transport handshake has completed.
|
|
1446
1410
|
*
|
|
1447
1411
|
* Transitions `CONNECTING → CONNECTED` and emits the `'connect'` event.
|
|
1448
|
-
* Called externally by Server/Client after the socket connects.
|
|
1412
|
+
* Called externally by Server/Client after the socket connects. In any other state it does
|
|
1413
|
+
* nothing: a connection closed before its socket connected stays `CLOSED` and emits no
|
|
1414
|
+
* `'connect'`, and a second call on a `CONNECTED` connection emits no second one.
|
|
1449
1415
|
*
|
|
1450
1416
|
* @param remoteAddress - Remote peer IP address, or `null` if unavailable.
|
|
1451
1417
|
* @param remotePort - Remote peer port, or `null` if unavailable.
|
|
@@ -1482,6 +1448,10 @@ declare class Connection extends EventEmitter {
|
|
|
1482
1448
|
* then `DRAINING → DISCONNECTED` once the hook resolves, or `DRAINING → CLOSED`
|
|
1483
1449
|
* if the drain timeout elapses first.
|
|
1484
1450
|
* - If `DRAINING`: waits for the existing drain to complete (idempotent).
|
|
1451
|
+
*
|
|
1452
|
+
* Every pending `close()` resolves as soon as the connection leaves `DRAINING`, by whatever
|
|
1453
|
+
* route: the hook resolving, the drain timeout, a `destroy()`, or the peer closing. A
|
|
1454
|
+
* `destroy()` during a long drain therefore ends the wait at once, not at the drain timeout.
|
|
1485
1455
|
* - If `CLOSED` or `DISCONNECTED`: no-op.
|
|
1486
1456
|
*
|
|
1487
1457
|
* @param opts.drainTimeoutMs - Override drain timeout (default: `opts.drainTimeoutMs ?? 30_000`).
|
|
@@ -1712,7 +1682,7 @@ declare class MllpConnectionError extends Error {
|
|
|
1712
1682
|
* regardless of what arrives on the wire. It is the same shape, and for the same reason, as
|
|
1713
1683
|
* the correlation registry beside it.
|
|
1714
1684
|
*
|
|
1715
|
-
*
|
|
1685
|
+
* **What these diagnostics may carry**
|
|
1716
1686
|
*
|
|
1717
1687
|
* Stable codes, byte counts, byte offsets, elapsed times, and an acknowledgement code drawn
|
|
1718
1688
|
* from the closed six-code Table 0008 set. Nothing else. A control ID is payload content, a
|
|
@@ -2454,7 +2424,7 @@ declare function createStarterServer(opts: StarterServerOptions): Promise<MllpSe
|
|
|
2454
2424
|
* path, the HL7 Table 0008 acknowledgement-code union, and the error type a message
|
|
2455
2425
|
* handler throws to request a specific negative acknowledgement.
|
|
2456
2426
|
*
|
|
2457
|
-
*
|
|
2427
|
+
* **Why this is safety-critical**
|
|
2458
2428
|
*
|
|
2459
2429
|
* A positive acknowledgement (`AA`) tells the sender "you may forget this message, I
|
|
2460
2430
|
* have it." If a server emits `AA` *before* the message is durably handled and then the
|
|
@@ -2471,6 +2441,7 @@ declare function createStarterServer(opts: StarterServerOptions): Promise<MllpSe
|
|
|
2471
2441
|
*
|
|
2472
2442
|
* @packageDocumentation
|
|
2473
2443
|
*/
|
|
2444
|
+
|
|
2474
2445
|
/**
|
|
2475
2446
|
* HL7 Table 0008, Acknowledgment Code. A **stable public API**.
|
|
2476
2447
|
*
|
|
@@ -2608,7 +2579,7 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
|
|
|
2608
2579
|
* negative codes, adds a **static, PHI-free** MSA-3 reason. A fresh control ID fills the
|
|
2609
2580
|
* ACK's own MSH-10.
|
|
2610
2581
|
*
|
|
2611
|
-
*
|
|
2582
|
+
* **Why the delimiters are read, not assumed**
|
|
2612
2583
|
*
|
|
2613
2584
|
* MSH-1 **is** the field separator (HL7 v2.5.1 §2.5.4): the byte at offset 3 of the MSH
|
|
2614
2585
|
* segment *defines* it for the whole message. `|` is overwhelmingly common but it is a
|
|
@@ -2627,7 +2598,7 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
|
|
|
2627
2598
|
* single component rather than two. Echoing MSH-1 and MSH-2 keeps the content and
|
|
2628
2599
|
* the delimiters that define it together.
|
|
2629
2600
|
*
|
|
2630
|
-
*
|
|
2601
|
+
* **It reads the MSH through the SHARED scanner**
|
|
2631
2602
|
*
|
|
2632
2603
|
* The MSH read is `readMshSegment` from `src/internal/control-id.ts`, the same call the
|
|
2633
2604
|
* client's correlator makes to derive the key it will later match this ACK against. That
|
|
@@ -2647,7 +2618,7 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
|
|
|
2647
2618
|
* is not the goal; agreeing on the *correct*, *tolerant* answer is. A lenient reader may
|
|
2648
2619
|
* never drop data that is there (Postel's Law, CLAUDE.md).
|
|
2649
2620
|
*
|
|
2650
|
-
*
|
|
2621
|
+
* **The fail-safe downgrade: never a positive `AA`/`CA` it cannot correlate**
|
|
2651
2622
|
*
|
|
2652
2623
|
* A positive acknowledgement is a promise the sender may forget the message. If it names a
|
|
2653
2624
|
* control ID the sender cannot match, or names one message out of several it never read,
|
|
@@ -2688,7 +2659,7 @@ declare function buildRawAck(payload: Buffer, code: AckCode): Buffer;
|
|
|
2688
2659
|
* handed a value cannot interpolate one, regardless of what arrives on the
|
|
2689
2660
|
* wire.
|
|
2690
2661
|
*
|
|
2691
|
-
*
|
|
2662
|
+
* **What this replaces, and why the shape matters more than the wording**
|
|
2692
2663
|
*
|
|
2693
2664
|
* The `correlateByControlId` path used to build its diagnostics by
|
|
2694
2665
|
* interpolation, and both ends of it were consumer-controlled and unbounded.
|
|
@@ -2703,7 +2674,7 @@ declare function buildRawAck(payload: Buffer, code: AckCode): Buffer;
|
|
|
2703
2674
|
* PID-3, a patient's medical record number, as the "control ID" of a truncated
|
|
2704
2675
|
* MSH. Withholding the bytes is the defence that survives the next such bug.
|
|
2705
2676
|
*
|
|
2706
|
-
*
|
|
2677
|
+
* **What a correlation diagnostic says instead**
|
|
2707
2678
|
*
|
|
2708
2679
|
* That a control id did not match, plus **numbers**: a byte length, a stream
|
|
2709
2680
|
* offset, an elapsed time. A number is a shape, not content. A truncated id is
|
|
@@ -3579,7 +3550,7 @@ declare class MllpClient extends EventEmitter {
|
|
|
3579
3550
|
*
|
|
3580
3551
|
* Emits a frozen `'ack'` event on every successful match.
|
|
3581
3552
|
*
|
|
3582
|
-
*
|
|
3553
|
+
* **Enhanced acknowledgement mode**
|
|
3583
3554
|
*
|
|
3584
3555
|
* A message whose MSH-15 or MSH-16 is not null asks for the two-part protocol of HL7
|
|
3585
3556
|
* v2.5.1 §2.9, and on a client correlating by control ID this method delivers it: the
|
|
@@ -4666,14 +4637,14 @@ declare function resolveDifferentialPeer(raw: string | undefined | null): Differ
|
|
|
4666
4637
|
* `JSON.stringify` a run straight into a log pipeline or a review artifact and read it
|
|
4667
4638
|
* programmatically without scraping human-readable text.
|
|
4668
4639
|
*
|
|
4669
|
-
*
|
|
4640
|
+
* **What this report is, and what it is not**
|
|
4670
4641
|
*
|
|
4671
4642
|
* It records what was **observed** on the wire. It is not a conformance verdict and never
|
|
4672
4643
|
* becomes one: no field says a peer is conformant, no field says a run passed, and nothing
|
|
4673
4644
|
* here decides whether an interface is fit to carry clinical traffic. That judgement
|
|
4674
4645
|
* belongs to the people standing the interface up, with this evidence in front of them.
|
|
4675
4646
|
*
|
|
4676
|
-
*
|
|
4647
|
+
* **Why no payload content appears anywhere**
|
|
4677
4648
|
*
|
|
4678
4649
|
* A peer answering this harness may be a live engine holding real patients, and a report
|
|
4679
4650
|
* is a diagnostic surface that gets written to a file, pasted into a ticket and mailed to
|
|
@@ -4849,7 +4820,7 @@ interface DifferentialReportPeer {
|
|
|
4849
4820
|
* The differential run: send each canonical message at a peer, read what comes back, and
|
|
4850
4821
|
* report what was observed.
|
|
4851
4822
|
*
|
|
4852
|
-
*
|
|
4823
|
+
* **What it does, exchange by exchange**
|
|
4853
4824
|
*
|
|
4854
4825
|
* One connection per exchange, opened, used and closed. That is deliberate: a peer that
|
|
4855
4826
|
* refuses or drops one connection then costs one exchange rather than the whole run, which
|
|
@@ -4862,14 +4833,14 @@ interface DifferentialReportPeer {
|
|
|
4862
4833
|
* that deviates from the block is described by the stable warning code for that deviation
|
|
4863
4834
|
* rather than killing the run with an opaque error.
|
|
4864
4835
|
*
|
|
4865
|
-
*
|
|
4836
|
+
* **What byte parity means here**
|
|
4866
4837
|
*
|
|
4867
4838
|
* The MLLP **envelope** the peer emitted, compared against the canonical Release 1 block
|
|
4868
4839
|
* this package emits for the same payload. It is not equality of message content, which
|
|
4869
4840
|
* can never hold: an acknowledgement carries the peer's own control ID, its own timestamp
|
|
4870
4841
|
* and its own sending application, and it is supposed to.
|
|
4871
4842
|
*
|
|
4872
|
-
*
|
|
4843
|
+
* **Aim it with care**
|
|
4873
4844
|
*
|
|
4874
4845
|
* A run sends real bytes into whatever engine it is pointed at. Those bytes are synthetic
|
|
4875
4846
|
* patients, so an engine that accepts them stores synthetic patients. Point it at a test
|
|
@@ -4981,5 +4952,5 @@ declare function runDifferential(options?: DifferentialRunOptions): Promise<Diff
|
|
|
4981
4952
|
*/
|
|
4982
4953
|
declare const VERSION: string;
|
|
4983
4954
|
|
|
4984
|
-
export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_VERIFY_DISABLED, MllpAckError, MllpApplicationAckError, MllpBackpressureError, MllpClient, MllpCommitRejectedError, MllpConnectionError, MllpDifferentialConfigurationError, MllpFramingError, MllpNeverDeliveredError, MllpServer, MllpTimeoutError, MllpTlsConfigurationError, MllpUnknownFateError, NetTransport, TLS13_DEFAULT_CIPHER_SUITES, TlsTransport, Transport, VERSION, ackDiagnosticMessage, ackModeDiagnosticMessage, buildRawAck, canonicalAcknowledgement, canonicalExchanges, createClient, createServer, createStarterClient, createStarterServer,
|
|
4985
|
-
export type { AckCode, AckCorrelationCode, AckCorrelationWarning, AckModeCode, AckModeWarning, AckModeWarningEvent, ApplicationAckFailure, CanonicalExchange, ClientAuth, ClientOptions, ClientStats, CommitAckReport, ConnectionErrorCause, ConnectionErrorPhase, ConnectionOptions, ConnectionState, ConnectionStats, DifferentialConfigurationErrorCode, DifferentialConnect, DifferentialCorrelationOutcome, DifferentialDeviation, DifferentialExchangeOutcome, DifferentialExchangeReport, DifferentialParityOutcome, DifferentialPeer, DifferentialReport, DifferentialReportPeer, DifferentialRunOptions, DifferentialRunResult, DifferentialSkipReason, EncoderOptions, FrameReaderOptions, MessageMeta,
|
|
4955
|
+
export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_VERIFY_DISABLED, MllpAckError, MllpApplicationAckError, MllpBackpressureError, MllpClient, MllpCommitRejectedError, MllpConnectionError, MllpDifferentialConfigurationError, MllpFramingError, MllpNeverDeliveredError, MllpServer, MllpTimeoutError, MllpTlsConfigurationError, MllpUnknownFateError, MllpWarning, NetTransport, TLS13_DEFAULT_CIPHER_SUITES, TlsTransport, Transport, VERSION, WarningCode, ackDiagnosticMessage, ackModeDiagnosticMessage, buildRawAck, canonicalAcknowledgement, canonicalExchanges, createClient, createServer, createStarterClient, createStarterServer, differentialConfigurationMessage, encodeFrame, isTlsProtocolError, isTlsVerificationErrorCode, isTransientConnectionError, rawAckUncorrelatable, readNegotiatedTlsParameters, resolveDifferentialPeer, resolveNackCode, resolveTlsCipherPolicy, runDifferential, tlsConfigurationMessage };
|
|
4956
|
+
export type { AckCode, AckCorrelationCode, AckCorrelationWarning, AckModeCode, AckModeWarning, AckModeWarningEvent, ApplicationAckFailure, CanonicalExchange, ClientAuth, ClientOptions, ClientStats, CommitAckReport, ConnectionErrorCause, ConnectionErrorPhase, ConnectionOptions, ConnectionState, ConnectionStats, DifferentialConfigurationErrorCode, DifferentialConnect, DifferentialCorrelationOutcome, DifferentialDeviation, DifferentialExchangeOutcome, DifferentialExchangeReport, DifferentialParityOutcome, DifferentialPeer, DifferentialReport, DifferentialReportPeer, DifferentialRunOptions, DifferentialRunResult, DifferentialSkipReason, EncoderOptions, FrameReaderOptions, MessageMeta, NackAckCode, NackEvent, NackReason, NegativeAckCode, NegotiatedTlsParameters, PemInput, ReconnectingEvent, ResolvedTlsCipherPolicy, RetryContext, RetryStrategy, SecurityWarning, SecurityWarningCode, ServerOptions, ServerStats, ServerTlsOptions, StarterClientOptions, StarterServerOptions, StateChangeEvent, TlsCipherPolicyInput, TlsConfigurationErrorCode, TlsOptions };
|