@cosyte/mllp 0.1.10 → 0.1.12

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/dist/index.d.cts CHANGED
@@ -635,8 +635,31 @@ interface TlsOptions {
635
635
  readonly cert?: PemInput;
636
636
  /** Private key matching {@link TlsOptions.cert}. */
637
637
  readonly key?: PemInput;
638
- /** Passphrase for an encrypted {@link TlsOptions.key}. */
638
+ /**
639
+ * Passphrase for an encrypted {@link TlsOptions.key}, or for the PKCS#12 file in
640
+ * {@link TlsOptions.pfx}.
641
+ */
639
642
  readonly passphrase?: string;
643
+ /**
644
+ * The client certificate and its private key as one PKCS#12 file (`.pfx` / `.p12`), for mutual
645
+ * TLS, in place of {@link TlsOptions.cert} and {@link TlsOptions.key}, unlocked with
646
+ * {@link TlsOptions.passphrase}. The file's bytes, as `readFileSync` returns them; this package
647
+ * reads no file itself.
648
+ *
649
+ * The file is loaded before a socket is opened. One the TLS library cannot load rejects
650
+ * `connect()` with a typed `MllpTlsConfigurationError` carrying `MLLP_TLS_PFX_REJECTED`, whose
651
+ * message names this option and never its value: a wrong passphrase, bytes that are not
652
+ * PKCS#12, or a legacy encryption (RC2-40, as `openssl pkcs12 -export -legacy`, OpenSSL 1.x and
653
+ * older Windows exports write it) that Node.js, on OpenSSL 3, does not load. Re-export such a
654
+ * file with AES-256. The refusal is permanent: a client does not retry it.
655
+ *
656
+ * Set it instead of `cert` and `key`, never with either: a client given both throws
657
+ * `MllpTlsConfigurationError` with `MLLP_TLS_CREDENTIAL_CONFLICT` at construction, since Node.js
658
+ * would load the file last and present its certificate in place of `cert`.
659
+ *
660
+ * @default undefined (no PKCS#12 file)
661
+ */
662
+ readonly pfx?: Buffer;
640
663
  /**
641
664
  * SNI hostname and the identity-check target (matched against the server
642
665
  * certificate's Subject/SAN). Defaults to `ClientOptions.host` when unset.
@@ -676,6 +699,13 @@ interface TlsOptions {
676
699
  * offered list, so setting both rejects `connect()` with a typed
677
700
  * `MllpTlsConfigurationError`.
678
701
  *
702
+ * **On a runtime that cannot offer the list it rejects `connect()`** with a
703
+ * typed `MllpTlsConfigurationError` carrying
704
+ * `MLLP_TLS_CIPHER_LIST_UNENFORCEABLE`, before any socket exists: under Deno,
705
+ * whose `node:tls` takes a cipher list without applying it, and under Bun,
706
+ * whose TLS library has none of the DHE suites the option names. Node.js
707
+ * offers it.
708
+ *
679
709
  * @default false
680
710
  */
681
711
  readonly atnaTransportSecurity?: boolean;
@@ -689,7 +719,10 @@ interface TlsOptions {
689
719
  *
690
720
  * A list the runtime rejects rejects `connect()` with a typed
691
721
  * `MllpTlsConfigurationError`; it never silently falls back to the default
692
- * list.
722
+ * list. **So does any list on a runtime that does not enforce cipher lists**
723
+ * (Deno, whose `node:tls` takes a list without applying it), with
724
+ * `MLLP_TLS_CIPHER_LIST_UNENFORCEABLE`, before any socket exists. Node.js and
725
+ * Bun enforce a list.
693
726
  *
694
727
  * @default undefined (Node defaults)
695
728
  */
@@ -741,14 +774,41 @@ type ClientAuth = "NONE" | "WANT" | "MUST";
741
774
  * ```
742
775
  */
743
776
  interface ServerTlsOptions {
744
- /** Server certificate (PEM). Required. */
745
- readonly cert: PemInput;
746
- /** Private key matching {@link ServerTlsOptions.cert}. Required. */
747
- readonly key: PemInput;
777
+ /**
778
+ * Server certificate (PEM). Required with {@link ServerTlsOptions.key} unless
779
+ * {@link ServerTlsOptions.pfx} is set: a server given neither pair nor file throws a
780
+ * `TypeError` at construction.
781
+ */
782
+ readonly cert?: PemInput;
783
+ /** Private key matching {@link ServerTlsOptions.cert}. Required with it unless `pfx` is set. */
784
+ readonly key?: PemInput;
748
785
  /** Trust anchor(s) for verifying client certificates under `WANT`/`MUST`. */
749
786
  readonly ca?: PemInput;
750
- /** Passphrase for an encrypted {@link ServerTlsOptions.key}. */
787
+ /**
788
+ * Passphrase for an encrypted {@link ServerTlsOptions.key}, or for the PKCS#12 file in
789
+ * {@link ServerTlsOptions.pfx}.
790
+ */
751
791
  readonly passphrase?: string;
792
+ /**
793
+ * The server certificate and its private key as one PKCS#12 file (`.pfx` / `.p12`), in place of
794
+ * {@link ServerTlsOptions.cert} and {@link ServerTlsOptions.key}, unlocked with
795
+ * {@link ServerTlsOptions.passphrase}. The file's bytes, as `readFileSync` returns them; this
796
+ * package reads no file itself.
797
+ *
798
+ * The file is loaded before anything is bound. One the TLS library cannot load rejects
799
+ * `listen()` with a typed `MllpTlsConfigurationError` carrying `MLLP_TLS_PFX_REJECTED`, whose
800
+ * message names this option and never its value: a wrong passphrase, bytes that are not
801
+ * PKCS#12, or a legacy encryption (RC2-40, as `openssl pkcs12 -export -legacy`, OpenSSL 1.x and
802
+ * older Windows exports write it) that Node.js, on OpenSSL 3, does not load. Re-export such a
803
+ * file with AES-256. Construction never throws for a file that cannot be loaded.
804
+ *
805
+ * Set it instead of `cert` and `key`, never with either: a server given both throws
806
+ * `MllpTlsConfigurationError` with `MLLP_TLS_CREDENTIAL_CONFLICT` at construction, since Node.js
807
+ * would load the file last and present its certificate in place of `cert`.
808
+ *
809
+ * @default undefined (no PKCS#12 file)
810
+ */
811
+ readonly pfx?: Buffer;
752
812
  /**
753
813
  * ATNA ITI-19 mutual-authentication mode. `'WANT'` requests a client
754
814
  * certificate without rejecting unauthorized/absent ones (surfaced, not
@@ -784,6 +844,13 @@ interface ServerTlsOptions {
784
844
  * Mutually exclusive with {@link ServerTlsOptions.ciphers}: setting both
785
845
  * rejects `listen()` with a typed `MllpTlsConfigurationError`.
786
846
  *
847
+ * **On a runtime that cannot honour it, `listen()` rejects** with a typed
848
+ * `MllpTlsConfigurationError` carrying `MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE`,
849
+ * before anything is bound: under Bun, whose TLS library refuses the automatic
850
+ * Diffie-Hellman selection (its own error is the `cause`), and under Deno,
851
+ * whose `node:tls` takes parameters and a cipher list without applying them.
852
+ * Construction never throws for it. Node.js honours it.
853
+ *
787
854
  * @default false
788
855
  */
789
856
  readonly atnaTransportSecurity?: boolean;
@@ -794,7 +861,9 @@ interface ServerTlsOptions {
794
861
  *
795
862
  * A list the runtime rejects rejects `listen()` with a typed
796
863
  * `MllpTlsConfigurationError`; it never silently falls back to the default
797
- * list.
864
+ * list. **So does any list on a runtime that does not enforce cipher lists**
865
+ * (Deno), with `MLLP_TLS_CIPHER_LIST_UNENFORCEABLE`, before anything is bound.
866
+ * Node.js and Bun enforce a list.
798
867
  *
799
868
  * @default undefined (Node defaults)
800
869
  */
@@ -826,6 +895,13 @@ interface ServerTlsOptions {
826
895
  * silence. `'auto'` is not accepted here; that selection is what
827
896
  * `atnaTransportSecurity` already makes.
828
897
  *
898
+ * **On a runtime that does not enforce Diffie-Hellman parameters, `listen()`
899
+ * rejects** with `MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE`, before anything is
900
+ * bound, rather than serving without them: under Deno, whose `node:tls` takes
901
+ * parameters without using them, and under Bun, whose TLS library has no
902
+ * finite-field Diffie-Hellman (its own refusal is the `cause`). Node.js
903
+ * enforces them.
904
+ *
829
905
  * There is no counterpart on {@link TlsOptions}: the side that answers the
830
906
  * key exchange supplies the parameters.
831
907
  *
@@ -841,7 +917,9 @@ interface ServerTlsOptions {
841
917
  * was asked to offer cannot be honoured, so the connection is refused rather
842
918
  * than opened on some other configuration. Two things can be asked for, and
843
919
  * they carry separate codes: the offered cipher-suite list, and the server's
844
- * ephemeral Diffie-Hellman parameters. It rejects the `connect()` / `listen()`
920
+ * ephemeral Diffie-Hellman parameters. Each can fail in two ways, also with
921
+ * separate codes: the runtime refused this input, or the runtime does not
922
+ * enforce that kind of input at all. It rejects the `connect()` / `listen()`
845
923
  * call that asked for it, never a live connection.
846
924
  *
847
925
  * These codes are a **public API**. They appear in caller `catch` blocks, log
@@ -904,6 +982,86 @@ declare const MLLP_TLS_CIPHER_OPTION_CONFLICT = "MLLP_TLS_CIPHER_OPTION_CONFLICT
904
982
  * ```
905
983
  */
906
984
  declare const MLLP_TLS_DH_PARAMETERS_REJECTED = "MLLP_TLS_DH_PARAMETERS_REJECTED";
985
+ /**
986
+ * The runtime's TLS library does not enforce a cipher-suite list: it accepts a list and then
987
+ * offers its own, or it cannot offer a suite the configuration names. Raised for `ciphers` and for
988
+ * `atnaTransportSecurity`, before any socket exists.
989
+ *
990
+ * This is a property of the runtime, not of the list: Node.js enforces both options, and the same
991
+ * configuration fails here on a runtime whose `node:tls` takes a `ciphers` list without applying
992
+ * it, or whose TLS library has no finite-field Diffie-Hellman suite for the ATNA option to offer.
993
+ * It is proved with a probe rather than read off a runtime name: a list that names a suite and then
994
+ * removes it, so selects none, must be refused, and each suite the ATNA option names must be
995
+ * accepted on its own.
996
+ *
997
+ * Distinct from {@link MLLP_TLS_CIPHER_LIST_REJECTED}, where the runtime does enforce lists and
998
+ * refused this one: the remedy here is a different runtime, or no cipher option at all.
999
+ *
1000
+ * @example
1001
+ * ```typescript
1002
+ * import { MLLP_TLS_CIPHER_LIST_UNENFORCEABLE } from '@cosyte/mllp';
1003
+ * if (err.code === MLLP_TLS_CIPHER_LIST_UNENFORCEABLE) logger.error('run this link on Node.js');
1004
+ * ```
1005
+ */
1006
+ declare const MLLP_TLS_CIPHER_LIST_UNENFORCEABLE = "MLLP_TLS_CIPHER_LIST_UNENFORCEABLE";
1007
+ /**
1008
+ * The runtime's TLS library does not enforce server-side ephemeral Diffie-Hellman parameters: it
1009
+ * accepts parameters and then runs without them, or it refuses the automatic selection the ATNA
1010
+ * option makes. Raised for `ServerTlsOptions.dhParameters` and for a server's
1011
+ * `atnaTransportSecurity`, before anything is bound.
1012
+ *
1013
+ * Proved with a probe rather than read off a runtime name: the automatic selection must be
1014
+ * accepted, and a group far too small to use must be refused. A runtime that takes the small group
1015
+ * in silence would take the caller's group in silence too, and nothing would say it went unused.
1016
+ * When the runtime refused the probe itself, its own error is the `cause`.
1017
+ *
1018
+ * Distinct from {@link MLLP_TLS_DH_PARAMETERS_REJECTED}, where the runtime does enforce parameters
1019
+ * and refused these: the remedy here is a different runtime, or no Diffie-Hellman option at all.
1020
+ *
1021
+ * @example
1022
+ * ```typescript
1023
+ * import { MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE } from '@cosyte/mllp';
1024
+ * if (err.code === MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE) logger.error('run this server on Node.js');
1025
+ * ```
1026
+ */
1027
+ declare const MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE = "MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE";
1028
+ /**
1029
+ * The TLS library could not load `tls.pfx`, the PKCS#12 file, with `tls.passphrase`. Raised for
1030
+ * `ServerTlsOptions.pfx` by `listen()`, before anything is bound, and for `TlsOptions.pfx` by a
1031
+ * client's `connect()`, before a socket is opened.
1032
+ *
1033
+ * Three causes share it: the passphrase is wrong, the bytes are not a PKCS#12 file, or the file
1034
+ * uses a legacy encryption the library does not load. The last is the one that surprises: a file
1035
+ * written by `openssl pkcs12 -export -legacy`, by OpenSSL 1.x, or by an older Windows export
1036
+ * protects its certificates with RC2-40, and Node.js runs OpenSSL 3 without the legacy provider
1037
+ * that holds RC2, so it refuses the file. Re-export it with AES-256
1038
+ * (`openssl pkcs12 -export` on OpenSSL 3 does by default). The TLS library's own error is the
1039
+ * `cause`; it names the failure and carries neither the passphrase nor any of the file.
1040
+ *
1041
+ * @example
1042
+ * ```typescript
1043
+ * import { MLLP_TLS_PFX_REJECTED } from '@cosyte/mllp';
1044
+ * if (err.code === MLLP_TLS_PFX_REJECTED) logger.error('re-export the PKCS#12 file with AES-256');
1045
+ * ```
1046
+ */
1047
+ declare const MLLP_TLS_PFX_REJECTED = "MLLP_TLS_PFX_REJECTED";
1048
+ /**
1049
+ * `tls.pfx` was set together with `tls.cert` or `tls.key`. The PKCS#12 file carries its own
1050
+ * certificate and key, and Node.js loads it after the PEM pair, so the file's certificate would
1051
+ * silently win over the one passed as `cert`. Both declarations are refused instead.
1052
+ *
1053
+ * Unlike the other codes, this one is thrown by the constructor (`createClient`, `createServer`,
1054
+ * `new MllpClient`, `new MllpServer`), not by `connect()` or `listen()`: it is a contradiction in
1055
+ * the options themselves, the same kind of mistake as a server given no certificate at all. The
1056
+ * message names the options and never their values, and there is no `cause`.
1057
+ *
1058
+ * @example
1059
+ * ```typescript
1060
+ * import { MLLP_TLS_CREDENTIAL_CONFLICT } from '@cosyte/mllp';
1061
+ * if (err.code === MLLP_TLS_CREDENTIAL_CONFLICT) logger.error('pass cert and key, or pfx');
1062
+ * ```
1063
+ */
1064
+ declare const MLLP_TLS_CREDENTIAL_CONFLICT = "MLLP_TLS_CREDENTIAL_CONFLICT";
907
1065
  /**
908
1066
  * Union of the stable TLS-configuration error codes.
909
1067
  *
@@ -912,14 +1070,14 @@ declare const MLLP_TLS_DH_PARAMETERS_REJECTED = "MLLP_TLS_DH_PARAMETERS_REJECTED
912
1070
  * const code: TlsConfigurationErrorCode = 'MLLP_TLS_CIPHER_LIST_REJECTED';
913
1071
  * ```
914
1072
  */
915
- type TlsConfigurationErrorCode = typeof MLLP_TLS_CIPHER_LIST_REJECTED | typeof MLLP_TLS_CIPHER_OPTION_CONFLICT | typeof MLLP_TLS_DH_PARAMETERS_REJECTED;
1073
+ type TlsConfigurationErrorCode = typeof MLLP_TLS_CIPHER_LIST_REJECTED | typeof MLLP_TLS_CIPHER_OPTION_CONFLICT | typeof MLLP_TLS_DH_PARAMETERS_REJECTED | typeof MLLP_TLS_CIPHER_LIST_UNENFORCEABLE | typeof MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE | typeof MLLP_TLS_PFX_REJECTED | typeof MLLP_TLS_CREDENTIAL_CONFLICT;
916
1074
  /**
917
1075
  * Fixed, human-readable description for a TLS-configuration code.
918
1076
  *
919
1077
  * Byte-for-byte identical for a given code, whatever the configuration was.
920
1078
  *
921
1079
  * @param code - The stable configuration-error code.
922
- * @returns The frozen registry text for `code`.
1080
+ * @returns The fixed registry text for `code`.
923
1081
  *
924
1082
  * @example
925
1083
  * ```typescript
@@ -931,13 +1089,16 @@ declare function tlsConfigurationMessage(code: TlsConfigurationErrorCode): strin
931
1089
  /**
932
1090
  * Thrown for a TLS configuration this package will not open a connection on.
933
1091
  * Rejects the originating `MllpClient.connect()` or `MllpServer.listen()`; no
934
- * socket is opened and no listener is left bound.
1092
+ * socket is opened and no listener is left bound. One code,
1093
+ * {@link MLLP_TLS_CREDENTIAL_CONFLICT}, is thrown by the constructor instead.
935
1094
  *
936
1095
  * Identify it by `instanceof` **and** by the stable {@link MllpTlsConfigurationError.code},
937
- * never by matching on the message text. `message` is a frozen registry entry
1096
+ * never by matching on the message text. `message` is a fixed registry entry
938
1097
  * and carries no key material and no passphrase; `cause`, when present, is the
939
1098
  * TLS library's own error for one input on its own (the suite list and the
940
- * Diffie-Hellman parameters are each validated with no credential in scope).
1099
+ * Diffie-Hellman parameters are each validated with no credential in scope; a
1100
+ * PKCS#12 file is validated with its passphrase, and the library's error for it
1101
+ * names the failure without repeating either).
941
1102
  *
942
1103
  * @example
943
1104
  * ```typescript
@@ -957,7 +1118,8 @@ declare class MllpTlsConfigurationError extends Error {
957
1118
  */
958
1119
  readonly code: TlsConfigurationErrorCode;
959
1120
  /**
960
- * The TLS library's own error, when the runtime is what refused the list.
1121
+ * The TLS library's own error, when the runtime is what refused the input
1122
+ * (or, for an `_UNENFORCEABLE` code, refused one of the probes).
961
1123
  * `undefined` when this package refused the configuration itself.
962
1124
  */
963
1125
  readonly cause: Error | undefined;
@@ -1114,10 +1276,17 @@ interface ResolvedTlsCipherPolicy {
1114
1276
  * @param opts - The cipher-suite half of the caller's TLS options.
1115
1277
  * @param side - Which end of the connection is being configured.
1116
1278
  * @returns The TLS-context fields to spread into `tls.connect` / `tls.createServer`.
1279
+ * **A runtime that would not enforce what was asked for is refused too.** Before
1280
+ * a list or parameters are handed over, probes with no caller input in scope
1281
+ * prove that this runtime's TLS library enforces that kind of input at all; one
1282
+ * that would accept it and then run without it (a `node:tls` that takes a list
1283
+ * and offers its own) gets an `_UNENFORCEABLE` code instead of a link that is
1284
+ * not what it says. Node.js passes every probe.
1285
+ *
1117
1286
  * @throws {MllpTlsConfigurationError} On a conflicting declaration, a list the
1118
- * runtime rejects, or Diffie-Hellman parameters it cannot use. Never falls back
1119
- * to the runtime default list, and never to a server with no Diffie-Hellman
1120
- * parameters.
1287
+ * runtime rejects, Diffie-Hellman parameters it cannot use, or a list or
1288
+ * parameters this runtime does not enforce. Never falls back to the runtime
1289
+ * default list, and never to a server with no Diffie-Hellman parameters.
1121
1290
  *
1122
1291
  * @example
1123
1292
  * ```typescript
@@ -1615,9 +1784,18 @@ type ConnectionErrorPhase = "connect" | "send" | "receive" | "close" | "reconnec
1615
1784
  * server, …). See `isTlsProtocolError` for the boundary. Pure TCP-level
1616
1785
  * failures (`ECONNREFUSED`, `ETIMEDOUT`, …) on a TLS-configured
1617
1786
  * connection carry **no** `connectionCause`, the same shape as plaintext.
1618
- *
1619
- * Scope note: the `'tls-verify'`/`'tls-handshake'` values are attached on
1620
- * the client's **initial `connect()` path**. Failures on the auto-reconnect
1787
+ * - `'framing-fatal'`, the peer sent bytes the decoder could not accept, or a
1788
+ * frame past the size cap. Classified **permanent**.
1789
+ * - `'connect-timeout'`, the connection was not established within
1790
+ * `ClientOptions.connectTimeoutMs`: the TCP connect, or the TLS handshake
1791
+ * after it, did not complete in time and the socket was destroyed. Nothing
1792
+ * was written, so no message reached the peer. The `cause` carries
1793
+ * `code: 'ETIMEDOUT'`, and it is classified **transient** by
1794
+ * `isTransientConnectionError`, like the operating system's own connect
1795
+ * timeout: a peer that is down or unreachable now may answer later.
1796
+ *
1797
+ * Scope note: the `'tls-verify'`/`'tls-handshake'`/`'connect-timeout'` values
1798
+ * are attached on the client's **initial `connect()` path**. Failures on the auto-reconnect
1621
1799
  * path surface as raw socket errors, their transient/permanent
1622
1800
  * classification still applies, but they do not (yet) carry a
1623
1801
  * `connectionCause`.
@@ -1630,7 +1808,7 @@ type ConnectionErrorPhase = "connect" | "send" | "receive" | "close" | "reconnec
1630
1808
  * }
1631
1809
  * ```
1632
1810
  */
1633
- type ConnectionErrorCause = "fifo-unsafe" | "in-flight-orphan" | "tls-verify" | "tls-handshake" | "framing-fatal";
1811
+ type ConnectionErrorCause = "fifo-unsafe" | "in-flight-orphan" | "tls-verify" | "tls-handshake" | "framing-fatal" | "connect-timeout";
1634
1812
  /**
1635
1813
  * Thrown (or emitted via `onError`) for socket-layer problems such as
1636
1814
  * connection refused, ECONNRESET, ETIMEDOUT, or DNS failure.
@@ -2018,6 +2196,15 @@ interface ServerOptions {
2018
2196
  * Distinct from `deadPeerTimeoutMs` (application-level idle close).
2019
2197
  */
2020
2198
  keepaliveIntervalMs?: number;
2199
+ /**
2200
+ * Whether to turn off Nagle's algorithm (`socket.setNoDelay(noDelay)`) on each accepted
2201
+ * socket. With it on (`false` here), an ACK written while an earlier one is still
2202
+ * unacknowledged at the TCP level waits for that acknowledgment, which Linux delays by up to
2203
+ * about 40 ms. Set `false` only to restore the operating system's default.
2204
+ *
2205
+ * @default true
2206
+ */
2207
+ noDelay?: boolean;
2021
2208
  /**
2022
2209
  * Application-level idle close timeout in ms.
2023
2210
  * If no HL7 messages are received on a connection for this interval, the connection
@@ -2036,6 +2223,14 @@ interface ServerOptions {
2036
2223
  * (post-handshake sockets) instead of `'connection'`, and surfaces failed
2037
2224
  * handshakes via the `'tlsClientError'` event rather than crashing.
2038
2225
  *
2226
+ * We set no handshake time limit of our own: the runtime's applies. On Node.js that is its
2227
+ * `handshakeTimeout` default of 120 seconds, after which the socket is closed and
2228
+ * `'tlsClientError'` fires with code `ERR_TLS_HANDSHAKE_TIMEOUT`. Until then a peer that
2229
+ * connects and never completes the handshake holds a {@link ServerOptions.maxConnections}
2230
+ * place, and `deadPeerTimeoutMs` does not apply, because it starts only once the connection is
2231
+ * accepted after its handshake. We have not measured what bounds a handshake on Bun or Deno,
2232
+ * which may set no limit at all.
2233
+ *
2039
2234
  * Spec anchor: IHE ATNA ITI-19 (https://profiles.ihe.net/ITI/TF/Volume2/ITI-19.html).
2040
2235
  *
2041
2236
  * @default undefined (plaintext TCP)
@@ -2069,6 +2264,10 @@ interface ServerOptions {
2069
2264
  * over-cap TLS connection is closed before its handshake, so it costs no handshake work and is
2070
2265
  * not a `'tlsClientError'`.
2071
2266
  *
2267
+ * The server counts its connections itself rather than handing the cap to the runtime's
2268
+ * listener, so the cap and `'connectionRejected'` hold the same on Node.js, Bun and Deno (Deno's
2269
+ * own listener cap closed the connection and reported nothing).
2270
+ *
2072
2271
  * Must be a positive integer; anything else throws a `RangeError` at construction. Unset means
2073
2272
  * no cap.
2074
2273
  *
@@ -2185,6 +2384,18 @@ declare class MllpServer extends EventEmitter {
2185
2384
  private _host;
2186
2385
  private _acceptedTotal;
2187
2386
  private _closedTotal;
2387
+ /**
2388
+ * Sockets accepted and not yet closed, counted only when {@link ServerOptions.maxConnections} is
2389
+ * set: the number the cap is compared against.
2390
+ */
2391
+ private _openSockets;
2392
+ /** Sockets the connection cap closed at accept, so a runtime's report of them is recognised. */
2393
+ private readonly _closedAtAccept;
2394
+ /**
2395
+ * For each socket the connection cap counted, what gives its place back. Released once, however
2396
+ * many times it is called.
2397
+ */
2398
+ private readonly _capRelease;
2188
2399
  /** Count of `'tlsClientError'` events since listen(). */
2189
2400
  private _tlsClientErrorsTotal;
2190
2401
  /**
@@ -2205,10 +2416,29 @@ declare class MllpServer extends EventEmitter {
2205
2416
  */
2206
2417
  constructor(opts: ServerOptions);
2207
2418
  /**
2208
- * Report a connection the listener closed at accept because the cap was full.
2419
+ * Enforce {@link ServerOptions.maxConnections} by counting sockets here, at accept.
2420
+ *
2421
+ * WHY NOT THE LISTENER'S OWN `maxConnections`. Node's `net.Server` enforces a cap of its own and
2422
+ * reports each refusal on `'drop'`, but that report is the runtime's to make, and Deno's
2423
+ * `node:net` closes the socket without emitting `'drop'` (measured: Deno 2.9.8), so the cap held
2424
+ * and `'connectionRejected'` never fired. Counting here makes the cap and its event a property of
2425
+ * this package on every runtime.
2426
+ *
2427
+ * The gate sits IN FRONT of every `'connection'` listener the server already has, and replaces
2428
+ * them: for a plaintext server that is this class's own accept handler, and for a TLS server it
2429
+ * is the runtime's, which wraps the raw socket and starts the handshake. An over-cap socket is
2430
+ * destroyed before either runs, so it never becomes a `Connection`, costs no handshake, and is
2431
+ * not a `'tlsClientError'`. The count is of open sockets, the number that bounds file
2432
+ * descriptors: a socket counts from accept until its `'close'`, handshake in flight included.
2433
+ *
2434
+ * @param maxConnections - The validated cap.
2435
+ */
2436
+ private _gateConnections;
2437
+ /**
2438
+ * Report a connection closed at accept because the cap was full.
2209
2439
  *
2210
- * Contained: this runs inside the listener's own 'drop' callback, so a throwing subscriber would
2211
- * otherwise unwind into the accept path. The throw is surfaced on 'error' instead.
2440
+ * Contained: this runs inside the listener's own 'connection' callback, so a throwing subscriber
2441
+ * would otherwise unwind into the accept path. The throw is surfaced on 'error' instead.
2212
2442
  */
2213
2443
  private _onConnectionOverCap;
2214
2444
  /**
@@ -2727,6 +2957,127 @@ declare function rawAckUncorrelatable(payload: Buffer): boolean;
2727
2957
  */
2728
2958
  declare function buildRawAck(payload: Buffer, code: AckCode): Buffer;
2729
2959
 
2960
+ /**
2961
+ * The acknowledgement-condition table as a public function: from MSH-15, MSH-16 and an outcome to
2962
+ * the HL7 Table 0008 code to send.
2963
+ *
2964
+ * The server's auto-ACK path selects its code by the same rules, read from the same internal
2965
+ * functions, so a caller that builds its own acknowledgement (an `autoAck` function, manual mode,
2966
+ * or another engine) answers exactly as the server would.
2967
+ *
2968
+ * @packageDocumentation
2969
+ */
2970
+
2971
+ /**
2972
+ * Input to {@link selectAckCode}.
2973
+ *
2974
+ * @example
2975
+ * ```typescript
2976
+ * import type { AckCodeSelectionInput } from '@cosyte/mllp';
2977
+ * const input: AckCodeSelectionInput = { msh15: 'AL', msh16: 'NE', outcome: 'AA' };
2978
+ * ```
2979
+ */
2980
+ interface AckCodeSelectionInput {
2981
+ /**
2982
+ * MSH-15, accept acknowledgment type (HL7 Table 0155), as the field's text: `AL`, `NE`, `ER`,
2983
+ * `SU`, or anything else the sender put there. Read the way the server reads it: the text before
2984
+ * the first repetition separator, then before the first component separator, with leading and
2985
+ * trailing spaces dropped, compared case-sensitively. Unset, empty, or the HL7 explicit null
2986
+ * `""` is a NULL field.
2987
+ */
2988
+ readonly msh15?: string | undefined;
2989
+ /** MSH-16, application acknowledgment type (HL7 Table 0155), read the same way as `msh15`. */
2990
+ readonly msh16?: string | undefined;
2991
+ /**
2992
+ * The message's MSH-2 encoding characters, which name its component (first byte) and repetition
2993
+ * (second byte) separators. Unset means the standard `^~\&`.
2994
+ *
2995
+ * @default '^~\\&'
2996
+ */
2997
+ readonly encodingCharacters?: string | undefined;
2998
+ /**
2999
+ * What the receiving application did with the message, as an application-mode code: `AA` it was
3000
+ * accepted, `AE` it failed, `AR` it was rejected. Any other value throws a `RangeError`.
3001
+ */
3002
+ readonly outcome: "AA" | "AE" | "AR";
3003
+ }
3004
+ /**
3005
+ * What {@link selectAckCode} decided. A frozen object; it carries no field text.
3006
+ *
3007
+ * @example
3008
+ * ```typescript
3009
+ * import { selectAckCode, type AckCodeSelection } from '@cosyte/mllp';
3010
+ * const selection: AckCodeSelection = selectAckCode({ msh15: 'AL', outcome: 'AA' });
3011
+ * selection.code; // 'CA'
3012
+ * ```
3013
+ */
3014
+ interface AckCodeSelection {
3015
+ /**
3016
+ * The one code to send now. The accept-mode counterpart of `outcome` (`CA`, `CE` or `CR`) when
3017
+ * MSH-15 asks for an accept acknowledgement on that outcome, and `outcome` itself otherwise. This
3018
+ * is the code the server's auto-ACK sends for the same fields and outcome.
3019
+ */
3020
+ readonly code: AckCode;
3021
+ /**
3022
+ * `'enhanced'` when MSH-15 or MSH-16 is non-NULL (the standard's own test for the enhanced
3023
+ * protocol), `'original'` when both are NULL.
3024
+ */
3025
+ readonly mode: "original" | "enhanced";
3026
+ /**
3027
+ * Whether MSH-16 asks for an application acknowledgement carrying this outcome: `AL` always, `NE`
3028
+ * never, `ER` on `AE` or `AR` only, `SU` on `AA` only. A NULL or unrecognised MSH-16 reads as
3029
+ * `AL`, which is the original protocol. Where `code` is an accept-mode code and this is `true`,
3030
+ * the application acknowledgement is a second message, and sending it is the caller's; where
3031
+ * `code` is an application-mode code, `code` is that acknowledgement.
3032
+ */
3033
+ readonly applicationAckRequested: boolean;
3034
+ /**
3035
+ * MSH-15 held a value outside Table 0155. It was read as NULL: `code` is `outcome`, unchanged,
3036
+ * as the server answers (and reports with `MLLP_ACK_ACCEPT_TYPE_UNRECOGNISED`).
3037
+ */
3038
+ readonly acceptTypeUnrecognised: boolean;
3039
+ /** MSH-16 held a value outside Table 0155. It was read as NULL, so as `AL`. */
3040
+ readonly applicationTypeUnrecognised: boolean;
3041
+ }
3042
+ /**
3043
+ * Select the acknowledgement code for a message from its MSH-15, MSH-16 and what the application
3044
+ * did with it, by the table the server's auto-ACK uses.
3045
+ *
3046
+ * Rows are MSH-15, columns the outcome:
3047
+ *
3048
+ * | MSH-15 | `AA` | `AE` | `AR` |
3049
+ * | ------------------ | ----- | ----- | ----- |
3050
+ * | NULL | `AA` | `AE` | `AR` |
3051
+ * | `NE` | `AA` | `AE` | `AR` |
3052
+ * | `AL` | `CA` | `CE` | `CR` |
3053
+ * | `ER` | `AA` | `CE` | `CR` |
3054
+ * | `SU` | `CA` | `AE` | `AR` |
3055
+ * | outside Table 0155 | `AA` | `AE` | `AR` |
3056
+ *
3057
+ * MSH-16 never changes the code; it decides {@link AckCodeSelection.applicationAckRequested}.
3058
+ *
3059
+ * Two things the server does are not in this function, because they are about the whole message
3060
+ * rather than its fields: a batch or concatenated frame keeps its warned non-positive answer, and
3061
+ * a message with no usable MSH-10 is never answered positively. A caller building its own
3062
+ * acknowledgement for such a message applies those rules itself.
3063
+ *
3064
+ * @param input - MSH-15, MSH-16, the message's MSH-2 and the outcome.
3065
+ * @returns The code to send, the mode, whether an application acknowledgement is asked for, and
3066
+ * whether either field held a value outside Table 0155.
3067
+ * @throws {RangeError} when `outcome` is not `AA`, `AE` or `AR`. The message does not repeat the
3068
+ * value.
3069
+ *
3070
+ * @example
3071
+ * ```typescript
3072
+ * import { selectAckCode } from '@cosyte/mllp';
3073
+ * selectAckCode({ msh15: 'AL', msh16: 'AL', outcome: 'AA' }).code; // 'CA'
3074
+ * selectAckCode({ msh15: 'ER', outcome: 'AA' }).code; // 'AA'
3075
+ * selectAckCode({ msh15: 'ER', outcome: 'AE' }).code; // 'CE'
3076
+ * selectAckCode({ outcome: 'AR' }).code; // 'AR'
3077
+ * ```
3078
+ */
3079
+ declare function selectAckCode(input: AckCodeSelectionInput): AckCodeSelection;
3080
+
2730
3081
  /**
2731
3082
  * The frozen diagnostic registry for ACK correlation.
2732
3083
  *
@@ -3033,6 +3384,9 @@ interface ClientOptions {
3033
3384
  * Per-message ACK timeout in milliseconds. The clock starts at
3034
3385
  * the underlying `write()` flush callback, NOT at the `send()` call,
3035
3386
  * pre-flush queue time is not charged to the peer. Default: `30_000`.
3387
+ *
3388
+ * A send can set its own with `send(payload, { ackTimeoutMs })`, which replaces this value
3389
+ * for that send's acknowledgement wait.
3036
3390
  */
3037
3391
  readonly ackTimeoutMs?: number;
3038
3392
  /**
@@ -3132,6 +3486,15 @@ interface ClientOptions {
3132
3486
  * @default undefined (off)
3133
3487
  */
3134
3488
  readonly keepaliveIntervalMs?: number;
3489
+ /**
3490
+ * Whether to turn off Nagle's algorithm (`socket.setNoDelay(noDelay)`) on each connection,
3491
+ * the first and every reconnect. With it on (`false` here), a frame written while an earlier
3492
+ * one is still unacknowledged at the TCP level waits for that acknowledgment, which Linux
3493
+ * delays by up to about 40 ms. Set `false` only to restore the operating system's default.
3494
+ *
3495
+ * @default true
3496
+ */
3497
+ readonly noDelay?: boolean;
3135
3498
  /**
3136
3499
  * Application-idle timeout (ms) keyed on last inbound bytes / ACK / warning.
3137
3500
  * On trip, calls `connection.destroy(new Error('dead
@@ -3142,6 +3505,26 @@ interface ClientOptions {
3142
3505
  * @default undefined (off)
3143
3506
  */
3144
3507
  readonly deadPeerTimeoutMs?: number;
3508
+ /**
3509
+ * Bound, in milliseconds, on establishing each connection: the TCP connect and, when
3510
+ * {@link ClientOptions.tls} is set, the TLS handshake after it. The clock starts when the
3511
+ * socket is created and stops at `'connect'` (plaintext) or `'secureConnect'` (TLS).
3512
+ *
3513
+ * On expiry the socket is destroyed. On `connect()` the promise rejects with an
3514
+ * `MllpConnectionError` whose `phase` is `'connect'` and whose `connectionCause` is
3515
+ * `'connect-timeout'`; nothing was written, so no message can have reached the peer. On an
3516
+ * auto-reconnect attempt the failure feeds the reconnect policy like any other connect
3517
+ * failure: `RetryContext.lastError` carries `code: 'ETIMEDOUT'` and it is classified
3518
+ * **transient**, so the client backs off and tries again.
3519
+ *
3520
+ * Must be an integer from 1 to 2147483647 (the largest delay a Node timer takes); anything else
3521
+ * throws a `RangeError` at construction. Unset means no bound of our own: a connect waits on
3522
+ * the operating system, and a TLS handshake against a peer that accepts the TCP connection and
3523
+ * never answers waits indefinitely.
3524
+ *
3525
+ * @default undefined (no bound)
3526
+ */
3527
+ readonly connectTimeoutMs?: number;
3145
3528
  /**
3146
3529
  * Enable TLS (MLLPS) for this connection. `true` enables TLS with
3147
3530
  * all defaults, including certificate verification **on**. Pass a
@@ -3307,6 +3690,15 @@ declare class MllpClient extends EventEmitter {
3307
3690
  private _connectSignal;
3308
3691
  /** Set when close()/destroy()/abort fires; reconnect handler short-circuits. */
3309
3692
  private _userClosed;
3693
+ /**
3694
+ * The reason passed to the `destroy(reason)` that closed a connection still connecting, `null`
3695
+ * otherwise. The socket hands it back on `'error'`, and `connect()` compares by identity so the
3696
+ * caller's own reason is carried as the cause and never sorted into a TLS `connectionCause`.
3697
+ * Only the call that reaches the socket records it: a later `destroy()` finds the connection
3698
+ * already CLOSED and leaves it alone. Cleared once matched and at the start of `connect()`, so
3699
+ * the client does not keep the caller's object alive.
3700
+ */
3701
+ private _destroyReason;
3310
3702
  /**
3311
3703
  * Sends parked inside the client with nothing written for them. See {@link ParkedSend}.
3312
3704
  * Every entry removes itself the moment its own wait ends, however it ends.
@@ -3381,10 +3773,25 @@ declare class MllpClient extends EventEmitter {
3381
3773
  * TLS failures carry a `connectionCause`: `'tls-verify'` for certificate
3382
3774
  * verification failures, `'tls-handshake'` for TLS-protocol-shaped failures
3383
3775
  * ({@link isTlsProtocolError}); pure TCP failures carry none.
3776
+ * - `MllpConnectionError({ phase: 'connect', connectionCause: 'connect-timeout' })` if
3777
+ * {@link ClientOptions.connectTimeoutMs} is set and the TCP connect, or the TLS handshake
3778
+ * after it, did not complete in time. The socket is destroyed; nothing was written.
3779
+ * - `MllpConnectionError({ phase: 'connect' })` if {@link MllpClient.destroy} is called while
3780
+ * `connect()` is still connecting, over TCP or TLS, before or during the handshake. Its
3781
+ * `cause` is the reason passed to `destroy(reason)`, as it is, and its message is that
3782
+ * reason's; with no reason the cause is an `Error` whose message is `closed before connect`,
3783
+ * the same as for any socket that closes before connecting with no error. It carries no
3784
+ * `connectionCause` either way: a reason is the caller's own, so one whose message or `code`
3785
+ * reads like a TLS failure (`alert`, `ERR_SSL_*`, `EPROTO`, a certificate code) is never
3786
+ * sorted into `'tls-handshake'` or `'tls-verify'`. The first `destroy()` decides: a second
3787
+ * call before `connect()` settles, with a reason or without one, changes nothing.
3384
3788
  * - `MllpTlsConfigurationError` if the configured cipher-suite list cannot be
3385
- * honoured (the runtime rejects it, or `atnaTransportSecurity` and `ciphers`
3386
- * both declare one). Raised **before** a socket is opened, so nothing is left
3387
- * connected; identify it by `instanceof` plus its stable `code`.
3789
+ * honoured (the runtime rejects it, the runtime does not enforce cipher lists
3790
+ * at all, or `atnaTransportSecurity` and `ciphers` both declare one). Raised
3791
+ * **before** a socket is opened, so nothing is left connected; identify it by
3792
+ * `instanceof` plus its stable `code`.
3793
+ * - `MllpTlsConfigurationError` with `MLLP_TLS_PFX_REJECTED` if `tls.pfx` cannot be loaded
3794
+ * with `tls.passphrase` (see {@link TlsOptions.pfx}), also before a socket is opened.
3388
3795
  *
3389
3796
  * **Dual failure signal on initial connect:** the Connection's transport
3390
3797
  * error handler is attached before this promise's own error listener, so a
@@ -3425,6 +3832,18 @@ declare class MllpClient extends EventEmitter {
3425
3832
  * against it.
3426
3833
  */
3427
3834
  private _createSocketAndTransport;
3835
+ /**
3836
+ * Bound one connection attempt by {@link ClientOptions.connectTimeoutMs}, when it is set.
3837
+ *
3838
+ * Armed after the `Connection` has registered its own socket listeners (its set-once
3839
+ * `onClose`/`onError` would otherwise remove ours). The timer stops at the socket's connect
3840
+ * event (`'secureConnect'` for TLS, so the handshake is inside the bound) or at its `'close'`,
3841
+ * whichever comes first; a refused connect or an abort therefore leaves no timer behind. On
3842
+ * expiry the socket is destroyed with a {@link ConnectTimeoutCause}, which reaches the same
3843
+ * `'error'` listeners as any other connect failure: `connect()` rejects, and a reconnect
3844
+ * attempt hands it to the reconnect classifier.
3845
+ */
3846
+ private _armConnectTimeout;
3428
3847
  /**
3429
3848
  * Wrap a connect-phase socket error as `MllpConnectionError`, classifying
3430
3849
  * TLS failures into the additive `connectionCause`:
@@ -3620,8 +4039,8 @@ declare class MllpClient extends EventEmitter {
3620
4039
  *
3621
4040
  * Resolves with the ACK Buffer (framing stripped). Rejects with:
3622
4041
  * - `DOMException('Aborted', 'AbortError')` if `signal` aborts before the ACK.
3623
- * - `MllpTimeoutError` if no ACK arrives within `ackTimeoutMs`.
3624
- * The clock starts at the underlying `write()` flush callback, NOT at
4042
+ * - `MllpTimeoutError` if no ACK arrives within `ackTimeoutMs` (this send's own, else the
4043
+ * client's). The clock starts at the underlying `write()` flush callback, NOT at
3625
4044
  * the `send()` call.
3626
4045
  * - `MllpConnectionError({ phase: 'send' })` if the client is not connected.
3627
4046
  *
@@ -3650,7 +4069,10 @@ declare class MllpClient extends EventEmitter {
3650
4069
  *
3651
4070
  * @param payload Raw bytes; MLLP framing is added internally via `encodeFrame`.
3652
4071
  * @param opts.signal AbortSignal, aborting cancels the ACK wait.
3653
- * @param opts.ackTimeoutMs Per-send override of the backpressure wait budget.
4072
+ * @param opts.ackTimeoutMs This send's bound on the wait for its acknowledgement, from the
4073
+ * moment its bytes are flushed, in place of the client's `ackTimeoutMs`. Under
4074
+ * `onBackpressure: "wait"` it also bounds the wait for queue room, and the
4075
+ * acknowledgement wait then starts afresh once the send is written.
3654
4076
  * @param opts.applicationAckTimeoutMs Per-send override of the second wait's bound.
3655
4077
  * @param opts.onCommitAck Called with the commit disposition when the peer commits the
3656
4078
  * message ahead of its application acknowledgement. See {@link CommitAckReport}.
@@ -3863,6 +4285,12 @@ declare class MllpClient extends EventEmitter {
3863
4285
  * ever written for it; that is a statement about the bytes, not about how the client was
3864
4286
  * shut down, so it holds on this path too.
3865
4287
  *
4288
+ * A {@link MllpClient.connect} still connecting rejects with an `MllpConnectionError` whose
4289
+ * `phase` is `'connect'` and no `connectionCause`. Its `cause` is `reason` when one is given,
4290
+ * never classified as a TLS failure whatever its message or `code`, and otherwise an `Error`
4291
+ * whose message is `closed before connect`. Only the first call reaches the socket, so a
4292
+ * second `destroy()` before `connect()` settles, with or without a reason, changes nothing.
4293
+ *
3866
4294
  * @example
3867
4295
  * ```typescript
3868
4296
  * client.destroy(new Error('shutting down'));
@@ -3960,8 +4388,15 @@ interface StarterClientOptions {
3960
4388
  readonly framing?: ClientOptions["framing"];
3961
4389
  /** TCP keepalive interval ms. */
3962
4390
  readonly keepaliveIntervalMs?: number;
4391
+ /** Turn off Nagle's algorithm. Passthrough to `ClientOptions.noDelay`, default `true`. */
4392
+ readonly noDelay?: boolean;
3963
4393
  /** Application-idle dead-peer timeout ms. */
3964
4394
  readonly deadPeerTimeoutMs?: number;
4395
+ /**
4396
+ * Bound on the TCP connect and TLS handshake, in ms. Passthrough to
4397
+ * `ClientOptions.connectTimeoutMs`; unset means no bound, as there.
4398
+ */
4399
+ readonly connectTimeoutMs?: number;
3965
4400
  /** Enable TLS (MLLPS) for this connection. Passthrough to `ClientOptions.tls`. */
3966
4401
  readonly tls?: TlsOptions | true;
3967
4402
  /**
@@ -4372,7 +4807,9 @@ declare function isTlsProtocolError(err: unknown): boolean;
4372
4807
  * Classification table:
4373
4808
  * - `ENOTFOUND`, `EACCES` → **permanent** (`false`)
4374
4809
  * - `ECONNREFUSED`, `ECONNRESET`, `ETIMEDOUT`, `EHOSTUNREACH`,
4375
- * `ENETUNREACH`, `EPIPE` → **transient** (`true`)
4810
+ * `ENETUNREACH`, `EPIPE` → **transient** (`true`). An expired
4811
+ * `ClientOptions.connectTimeoutMs` is one of these: its error carries
4812
+ * `ETIMEDOUT`, the code of the operating system's own connect timeout.
4376
4813
  * - `CERT_*` and `UNABLE_TO_VERIFY_LEAF_SIGNATURE` /
4377
4814
  * `DEPTH_ZERO_SELF_SIGNED_CERT` / `SELF_SIGNED_CERT_IN_CHAIN`
4378
4815
  * (any {@link isTlsVerificationErrorCode} code) → **permanent** (`false`),
@@ -5029,5 +5466,5 @@ declare function runDifferential(options?: DifferentialRunOptions): Promise<Diff
5029
5466
  */
5030
5467
  declare const VERSION: string;
5031
5468
 
5032
- export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_CONNECTION_LIMIT_REACHED, 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 };
5033
- export type { AckCode, AckCorrelationCode, AckCorrelationWarning, AckModeCode, AckModeWarning, AckModeWarningEvent, ApplicationAckFailure, CanonicalExchange, ClientAuth, ClientOptions, ClientStats, CommitAckReport, ConnectionErrorCause, ConnectionErrorPhase, ConnectionOptions, ConnectionRejectedEvent, 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 };
5469
+ export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_CONNECTION_LIMIT_REACHED, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_LIST_UNENFORCEABLE, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_CREDENTIAL_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE, MLLP_TLS_PFX_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, selectAckCode, tlsConfigurationMessage };
5470
+ export type { AckCode, AckCodeSelection, AckCodeSelectionInput, AckCorrelationCode, AckCorrelationWarning, AckModeCode, AckModeWarning, AckModeWarningEvent, ApplicationAckFailure, CanonicalExchange, ClientAuth, ClientOptions, ClientStats, CommitAckReport, ConnectionErrorCause, ConnectionErrorPhase, ConnectionOptions, ConnectionRejectedEvent, 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 };