@cosyte/mllp 0.1.5 → 0.1.7
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 +28 -0
- package/README.md +23 -12
- package/dist/ack-from-hl7/index.cjs +1 -1
- package/dist/ack-from-hl7/index.cjs.map +1 -1
- package/dist/ack-from-hl7/index.d.cts +3 -2
- package/dist/ack-from-hl7/index.d.ts +3 -2
- 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 +57 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -99
- package/dist/index.d.ts +33 -99
- package/dist/index.mjs +57 -17
- 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/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/package.json +34 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.7
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 772368f: New `@cosyte/mllp/arbitraries` entry point: fast-check generators for MLLP, so you can property-test your own code on generated frames and byte streams. `payload()` gives payloads the encoder accepts (any bytes, text, or synthetic HL7 v2 messages); `frame()` gives a canonical frame with its payload; `stream()` gives canonical frames back to back, split into random reads, with the payloads a reader must deliver; `messyStream()` gives the framing quirks real senders produce, limited to the tolerances you name, with the payloads and warning codes a reader must report; `hostileInput()` gives random, framing-heavy and mangled streams in random reads; and `chunked(bytes)` splits bytes of your own into random reads. Every generated value is synthetic and random, and a failing case reports the value as it was generated even if your code changed its bytes. `fast-check` (4.x) is an optional peer dependency: install it to use this entry point. The main entry point never loads it, so nothing changes for code that only imports `@cosyte/mllp`.
|
|
7
|
+
- b75745f: `close()` now resolves as soon as its connections are gone. A second `MllpServer.close()` with a
|
|
8
|
+
shorter `drainTimeoutMs` already destroyed a straggling connection at its own deadline, but its
|
|
9
|
+
promise, and the first call's, stayed pending until the first call's longer drain timed out. The
|
|
10
|
+
same held for `Connection.close()`: a `destroy()` or a peer close during a slow drain ended the
|
|
11
|
+
connection at once, yet `close()` waited out the drain timeout anyway. Every pending `close()` now
|
|
12
|
+
resolves the moment its connection leaves `DRAINING`, by whatever route, so a shutdown with a short
|
|
13
|
+
budget ends within that budget.
|
|
14
|
+
- 945a934: The documentation follows our docs-content standard: goal-named how-to guides for sending and receiving messages, tolerating framing quirks and building ACKs with `@cosyte/hl7`; a reference page of every warning and error code; troubleshooting; testing and performance pages; and an API reference generated from the doc comments. Every runnable sample is type-checked and run against the built package. The doc comments in the published types now use bold lines where they used Markdown headings. No API or behavior changes.
|
|
15
|
+
- b75745f: `Connection.notifyConnect()` on a connection that was already closed kept it `CLOSED` and emitted
|
|
16
|
+
no `stateChange`, yet still emitted `'connect'` and recorded a peer address and connect time, so a
|
|
17
|
+
subscriber could count a connection that never opened. It now does nothing unless the connection is
|
|
18
|
+
`CONNECTING`: a closed connection emits nothing, and a connect reported twice emits `'connect'`
|
|
19
|
+
once.
|
|
20
|
+
- 772368f: With `allowMissingLeadingVt` on, a stray `FS` where a frame was due (a sender repeating its `FS CR` trailer) is now read as an empty frame, with `MLLP_MISSING_LEADING_VT` and `MLLP_EMPTY_PAYLOAD`, instead of arriving as the first byte of the next message's payload, where it broke that message and could not be framed again. A frame that opens without a `VT` is now also held to `maxFrameSizeBytes` from its first byte.
|
|
21
|
+
|
|
22
|
+
## 0.1.6
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 2284ffe: The package is now built by tsup 9, through our shared `@cosyte/process` tooling. The API and the
|
|
26
|
+
runtime JavaScript are unchanged; the published files differ only in how they are laid out. The
|
|
27
|
+
declaration files list type-only exports in a separate `export type { ... }` statement, the
|
|
28
|
+
`@cosyte/mllp/testing` declarations import `Transport` through the root entry point rather than an
|
|
29
|
+
internal chunk, and the CommonJS build's source maps and one shim comment name the new tsup path.
|
|
30
|
+
|
|
3
31
|
## 0.1.5
|
|
4
32
|
### Patch Changes
|
|
5
33
|
|
package/README.md
CHANGED
|
@@ -73,7 +73,10 @@ pnpm add @cosyte/hl7
|
|
|
73
73
|
|
|
74
74
|
Node.js 22 or later, tested on 22, 24, and 26 (`engines.node` is `>=22.0.0`). The package ships
|
|
75
75
|
dual ESM (`import`) and CommonJS (`require`) builds, each with its own type declarations, and has
|
|
76
|
-
zero runtime dependencies.
|
|
76
|
+
zero runtime dependencies. The optional `@cosyte/mllp/arbitraries` entry point, fast-check
|
|
77
|
+
generators for
|
|
78
|
+
[property-testing your own code](https://github.com/cosyte/mllp/blob/main/docs-content/property-test-your-code.md),
|
|
79
|
+
needs `fast-check` installed beside it; the main entry point never loads it.
|
|
77
80
|
|
|
78
81
|
## Usage
|
|
79
82
|
|
|
@@ -239,13 +242,14 @@ The full reference is on [docs.cosyte.com/mllp](https://docs.cosyte.com/mllp); s
|
|
|
239
242
|
is the one place a whole message is parsed. [PHI and safety](#phi-and-safety) sets all of that out
|
|
240
243
|
in full. For actual parsing, pair this with [`@cosyte/hl7`](https://github.com/cosyte/hl7), which
|
|
241
244
|
is exactly what that subpath does.
|
|
242
|
-
- **
|
|
243
|
-
Google Cloud Healthcare MLLP adapter.
|
|
244
|
-
|
|
245
|
+
- **Framing checked against canonical frames for freely available engines**: Mirth Connect from
|
|
246
|
+
NextGen, and the Google Cloud Healthcare MLLP adapter. The frames are written from the
|
|
247
|
+
specification, not captured from a running engine, and no live engine runs in our CI. **Epic and
|
|
248
|
+
Cerner are not part of that harness**, and no claim about either is made here. `runDifferential` ships in the published artifact, so you can aim
|
|
245
249
|
it at your own test or staging endpoint and get a per-exchange frame-parity and `MSA-2` correlation
|
|
246
250
|
report for the engine you actually integrate with.
|
|
247
|
-
- **Known gaps, stated rather than hidden.** No batch acknowledgment, no MLLP Release 2, no
|
|
248
|
-
|
|
251
|
+
- **Known gaps, stated rather than hidden.** No batch acknowledgment, no MLLP Release 2, no persistent
|
|
252
|
+
queue of unacknowledged messages, no clinical acceptance decision, and no PKI. The
|
|
249
253
|
[known limitations](https://github.com/cosyte/mllp/blob/main/docs-content/limitations.md) page is
|
|
250
254
|
the full list. Read it before you depend on this.
|
|
251
255
|
|
|
@@ -255,16 +259,20 @@ The full reference lives at [docs.cosyte.com/mllp](https://docs.cosyte.com/mllp)
|
|
|
255
259
|
repository's [`docs-content/`](https://github.com/cosyte/mllp/tree/main/docs-content). Start with
|
|
256
260
|
these pages:
|
|
257
261
|
|
|
258
|
-
- [
|
|
259
|
-
|
|
262
|
+
- [Send messages](https://github.com/cosyte/mllp/blob/main/docs-content/send-messages.md) and
|
|
263
|
+
[Receive and acknowledge messages](https://github.com/cosyte/mllp/blob/main/docs-content/receive-messages.md): the two everyday tasks.
|
|
260
264
|
- [ACKs and the commit contract](https://github.com/cosyte/mllp/blob/main/docs-content/acks.md):
|
|
261
265
|
the code auto-ACK selects, correlation on the client, enhanced mode, and the ack-from-hl7 builder.
|
|
262
|
-
- [
|
|
266
|
+
- [Framing and tolerance](https://github.com/cosyte/mllp/blob/main/docs-content/framing.md): the
|
|
267
|
+
wire format, the opt-in tolerance flags, the stable warning codes, and what throws.
|
|
268
|
+
- [Connection, reconnect and backpressure](https://github.com/cosyte/mllp/blob/main/docs-content/reliability.md):
|
|
263
269
|
the six-state connection machine, backoff, dead-peer detection, and what `close()` does.
|
|
264
|
-
- [
|
|
270
|
+
- [Secure a link with TLS](https://github.com/cosyte/mllp/blob/main/docs-content/tls.md): mutual TLS,
|
|
265
271
|
verification, bind safety, the TLS 1.2 floor, and the typed failure modes.
|
|
266
|
-
- [
|
|
267
|
-
in-memory transport, and the differential harness for the engine you integrate with.
|
|
272
|
+
- [Test your code and verify an engine](https://github.com/cosyte/mllp/blob/main/docs-content/testing.md):
|
|
273
|
+
the in-memory transport, and the differential harness for the engine you integrate with.
|
|
274
|
+
- [Warning and error codes](https://github.com/cosyte/mllp/blob/main/docs-content/warning-and-error-codes.md)
|
|
275
|
+
and [Troubleshooting](https://github.com/cosyte/mllp/blob/main/docs-content/troubleshooting.md): every stable code, and what to do when a link fails.
|
|
268
276
|
- [Known limitations and non-goals](https://github.com/cosyte/mllp/blob/main/docs-content/limitations.md):
|
|
269
277
|
what not to trust this transport to do.
|
|
270
278
|
|
|
@@ -276,6 +284,9 @@ agreement on the approach before a pull request. The organization's
|
|
|
276
284
|
[support page](https://github.com/cosyte/.github/blob/main/SUPPORT.md) covers questions that span our
|
|
277
285
|
libraries.
|
|
278
286
|
|
|
287
|
+
Need an MLLP integration built, or hosted and run for you? See our
|
|
288
|
+
[integration services](https://cosyte.com/integration-services).
|
|
289
|
+
|
|
279
290
|
## Security
|
|
280
291
|
|
|
281
292
|
Report a vulnerability privately, as the
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var module$1 = require('module');
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/tsup@
|
|
5
|
+
// node_modules/.pnpm/tsup@9.0.0_postcss@8.5.32_tsx@4.23.15_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
|
|
6
6
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
7
7
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
8
8
|
|