@cosyte/mllp 0.0.3 → 0.0.4

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 CHANGED
@@ -110,6 +110,26 @@ begins its public history at `0.0.x`, per the cosyte version ladder (`0.0.x` unt
110
110
  `InMemoryTransport.pair()`; the receive example's fictional `respond`/`buildAck` → the real
111
111
  `createServer({ onMessage })`). Bumps the `@cosyte/vitest-config` devDependency to `^0.0.2` for the
112
112
  `/snippets` export. Docs and tests only: no runtime or public-API change.
113
+ - **README header swapped from the per-package banner to the shared Cosyte lockup.** Both sides of
114
+ this swap happened inside one unreleased window, so no published version carries the banner and
115
+ the release notes for this version describe only the lockup. It is recorded here, where build
116
+ history belongs, rather than dropped. The banner
117
+ (`cosyte-banner-mllp-1200x300.png`) baked the package name and its one line summary into the
118
+ artwork, and the `# @cosyte/mllp` H1 and the blockquote directly beneath it repeat both, so the
119
+ same two strings appeared three times in the first four lines of the page. The header is now a
120
+ `<picture>` carrying the theme-aware Cosyte lockup tile (`cosyte-lockup-tile-on-dark-1200x300.png`
121
+ and its `-on-light` counterpart), which reads "Cosyte" rather than the package name, so the
122
+ duplication goes and the heading stays untouched. The `<picture>` element was deliberately avoided
123
+ when the banner landed, on the grounds that npm sanitizer behaviour was unverified; that has since
124
+ been verified rather than assumed. On GitHub in dark mode `currentSrc` resolves to the on-dark tile
125
+ with parent element `PICTURE`, and on npm the `<img>` is hoisted out of the `<picture>` by GitHub's
126
+ anchor wrapper so the light fallback renders, which is the correct cut there because npmjs.com has
127
+ no dark mode. The block was copied programmatically out of `hl7`'s README rather than retyped, and
128
+ both URLs were fetched live (`200 image/png`) rather than trusted from the stored
129
+ `published-urls.json` declaration, since a typo in either is a 404 on a public package page. The
130
+ alt text now describes the artwork rather than the package, because a screen reader on the npm page
131
+ should hear what the image is and the package summary is already the next line. Docs only: no
132
+ runtime or public-API change.
113
133
  - **`docs-content/installation.md` publish-status note corrected (README-ORG-SWEEP).** The Status
114
134
  callout said the package was "not yet published to npm" and that the install command was "the shape
115
135
  it will take at first publish": stale now that `@cosyte/mllp` is published on npm at `0.0.1` and
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://cosyte.com/tile/cosyte-lockup-tile-on-dark-1200x300.png">
3
+ <img alt="Cosyte: a plus mark set in two overlapping rounded squares, one solid and one outlined, beside the Cosyte wordmark" src="https://cosyte.com/tile/cosyte-lockup-tile-on-light-1200x300.png">
4
+ </picture>
5
+
1
6
  # @cosyte/mllp
2
7
 
3
8
  > Send and receive HL7 v2 over a production-grade MLLP connection in a few lines, with framing, ACK correlation, auto-reconnect, and backpressure handled for you.
@@ -23,8 +28,15 @@ pnpm add @cosyte/mllp
23
28
  ```ts
24
29
  import { createStarterServer } from "@cosyte/mllp";
25
30
 
26
- // Echoes every received frame straight back as the ACK.
27
- const server = await createStarterServer({ port: 2575, onMessage: (buf) => buf });
31
+ // Auto-ACK is on by default: the server awaits your handler (the durable-commit
32
+ // step) before it answers, so a positive ACK can never precede the commit.
33
+ // A throw answers a negative ACK instead.
34
+ const server = await createStarterServer({
35
+ port: 2575,
36
+ onMessage: async (payload) => {
37
+ await db.commit(payload);
38
+ },
39
+ });
28
40
  ```
29
41
 
30
42
  ```ts
@@ -48,7 +60,7 @@ const server = createServer({ tls: { cert: certPem, key: keyPem } });
48
60
  await server.listen(2575, "127.0.0.1");
49
61
 
50
62
  // Server: mutual TLS (ATNA ITI-19)
51
- const server = createServer({
63
+ const mutualTlsServer = createServer({
52
64
  tls: { cert: certPem, key: keyPem, ca: clientCaPem, clientAuth: "MUST" },
53
65
  });
54
66
  ```
@@ -58,7 +70,7 @@ const server = createServer({
58
70
  const client = createClient({ host: "mllp.example.com", port: 2575, tls: { ca: caPem } });
59
71
 
60
72
  // Client: mutual TLS
61
- const client = createClient({
73
+ const mutualTlsClient = createClient({
62
74
  host: "mllp.example.com",
63
75
  port: 2575,
64
76
  tls: { ca: caPem, cert: clientCertPem, key: clientKeyPem },
@@ -84,7 +96,11 @@ const server = createServer({
84
96
  });
85
97
  ```
86
98
 
87
- Handler resolves ⇒ `AA`. Handler throws ⇒ `AE` (or `AR` via `MllpAckError`). **A positive ACK cannot
99
+ Handler resolves ⇒ `AA`, **unless the inbound could not carry a correlatable positive ACK** (no
100
+ readable `MSH`, an empty `MSH-10`, a batch or concatenated payload, or trailing bytes the framer
101
+ discarded). In that case the commit still happened, but the ACK is downgraded to `AE` and a `nack`
102
+ event names the reason, because a positive ACK the sender cannot match is one it will resend.
103
+ Handler throws ⇒ `AE` (or `AR` via `MllpAckError`). **A positive ACK cannot
88
104
  precede a successful commit.** `autoAck: 'AA'` *without* a handler is documented as a
89
105
  transport-accept: "received and framed", not "processed".
90
106
 
package/dist/index.cjs CHANGED
@@ -3412,7 +3412,7 @@ async function createStarterClient(opts) {
3412
3412
  }
3413
3413
 
3414
3414
  // src/index.ts
3415
- var VERSION = "0.0.3";
3415
+ var VERSION = "0.0.4";
3416
3416
 
3417
3417
  exports.Connection = Connection;
3418
3418
  exports.FrameReader = FrameReader;