@crvouga/mockingbird-service-aha 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -4
- package/DISCOVERY.md +2 -2
- package/README.md +10 -10
- package/SUPPORT.md +2 -2
- package/dist/{chunk-OW2YRGUP.js → chunk-I3QFPLJY.js} +4 -4
- package/dist/{chunk-OW2YRGUP.js.map → chunk-I3QFPLJY.js.map} +2 -2
- package/dist/{chunk-OKMBV2CI.js → chunk-SYG4ZGBY.js} +5 -5
- package/dist/chunk-SYG4ZGBY.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/openapi.yaml +4 -4
- package/package.json +3 -3
- package/dist/chunk-OKMBV2CI.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-aha
|
|
2
2
|
|
|
3
|
+
## 3.1.0 (2026-10-08)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- redesign emulator experience ([d6038c2](https://github.com/crvouga/mockingbird/commit/d6038c27eebbaa1751f02bc9305002a5b1304779))
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
- `@crvouga/mockingbird-service-sqlite`
|
|
12
|
+
|
|
3
13
|
## 3.0.0 (2026-10-07)
|
|
4
14
|
|
|
5
15
|
### ⚠️ Breaking changes
|
|
@@ -14,10 +24,6 @@
|
|
|
14
24
|
- typecheck the brand gate before builds ([fc36095](https://github.com/crvouga/mockingbird/commit/fc3609514de70ffe3170a5d216fb8a49f9ce7cbb))
|
|
15
25
|
- format the emulates records query ([8698872](https://github.com/crvouga/mockingbird/commit/8698872509d06002be5a8fcdc85d79f8462320c3))
|
|
16
26
|
|
|
17
|
-
### Dependencies
|
|
18
|
-
|
|
19
|
-
- `@crvouga/mockingbird-service-sqlite`
|
|
20
|
-
|
|
21
27
|
## 2.3.0 (2026-10-04)
|
|
22
28
|
|
|
23
29
|
### Features
|
package/DISCOVERY.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @crvouga/mockingbird-service-aha discovery
|
|
2
2
|
|
|
3
3
|
This is the installed-package index for coding agents and tooling. All relative links resolve
|
|
4
|
-
inside `node_modules/@crvouga/mockingbird-service-aha/`; no repository checkout is needed to discover the
|
|
4
|
+
inside `node_modules/@crvouga/mockingbird-service-aha/`; no repository checkout is needed to discover the emulator's
|
|
5
5
|
supported surface or documented behavior.
|
|
6
6
|
|
|
7
7
|
## Capability and behavior sources
|
|
@@ -48,7 +48,7 @@ designed for assertions and diagnosis by consuming test suites.
|
|
|
48
48
|
## Report a mismatch or missing capability
|
|
49
49
|
|
|
50
50
|
Follow the [agent reporting contract](https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md). Include package version,
|
|
51
|
-
operation/command, a minimal redacted request, actual
|
|
51
|
+
operation/command, a minimal redacted request, actual emulator result, expected oracle result or vendor
|
|
52
52
|
documentation, and whether the mismatch appears in the matrix. Never include keys, tokens,
|
|
53
53
|
customer data, prompts, PHI, card data, or unredacted recordings.
|
|
54
54
|
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @crvouga/mockingbird-service-aha
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Local emulators. Real API contracts. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
|
|
4
4
|
|
|
5
|
-
Stateful
|
|
5
|
+
Stateful emulator of the **AHA (Advanced Health Academy) at-home phlebotomy** partner API for test
|
|
6
6
|
suites: HMAC-signed create-order and cancel, and — its main job — the order-status webhooks AHA
|
|
7
7
|
posts back. The vendor has no pull API, so every downstream effect (EMR appointment booking,
|
|
8
|
-
storefront status, "blood drawn") starts with a webhook; the
|
|
8
|
+
storefront status, "blood drawn") starts with a webhook; the emulator emits one on demand, with every
|
|
9
9
|
field our handler reads, so the ZIP-routed bloodwork path can finally be tested.
|
|
10
10
|
|
|
11
11
|
- Operation coverage: [SUPPORT.md](https://github.com/crvouga/mockingbird/blob/main/packages/service/aha/SUPPORT.md)
|
|
@@ -24,7 +24,7 @@ Fetch server.
|
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
|
-
Point the app at the
|
|
27
|
+
Point the app at the emulator:
|
|
28
28
|
|
|
29
29
|
| Env | Value |
|
|
30
30
|
| --- | --- |
|
|
@@ -70,7 +70,7 @@ await admin("/orders/AC-101/transition", { status: "Check Out", drawStatus: "Sam
|
|
|
70
70
|
|
|
71
71
|
### Routes
|
|
72
72
|
|
|
73
|
-
The `{partner}` path segment is your account's slug (e.g. `acme`); the
|
|
73
|
+
The `{partner}` path segment is your account's slug (e.g. `acme`); the emulator accepts any.
|
|
74
74
|
|
|
75
75
|
| Route | Behaviour |
|
|
76
76
|
| --- | --- |
|
|
@@ -117,7 +117,7 @@ plus, by status (all local times in the order's IANA zone):
|
|
|
117
117
|
| --- | --- |
|
|
118
118
|
| `POST /__admin/orders/:partnerOrderId/transition` | `{status, drawStatus?, scheduledAt?, timeZone?}` emits the webhook. `status` is any value above (case and `_` forgiven; unknown values are sent verbatim). `scheduledAt` (ISO or epoch ms) defaults to the order's preferred slot, else the next hour 24 h out; `Rescheduled` defaults to one day later. `timeZone` defaults to the order's `patient_timezone`, else `America/New_York`. `:partnerOrderId` may also be the `order_number`. |
|
|
119
119
|
| `PUT /__admin/settings` | `{envelope?, credentials?: [{apiKey, apiSecret?}], allowLegacy?, timestampToleranceMs?, defaultTimeZone?, cancelWebhook?, autoSchedule?: {afterMs, leadMs?} \| ms \| null}` for the calling namespace. `GET` shows them with secrets masked. |
|
|
120
|
-
| `POST /__admin/tick` | Emit every `autoSchedule` webhook that is due on the
|
|
120
|
+
| `POST /__admin/tick` | Emit every `autoSchedule` webhook that is due on the emulator clock (the served emulator ticks every 100 ms). |
|
|
121
121
|
| `GET /__admin/orders` | The namespace's orders (ids, status, appointment, zone — no patient data). |
|
|
122
122
|
|
|
123
123
|
Fault presets (`POST /__admin/faults {"preset": "<name>", "count"?: n}`): `bad_signature` (401),
|
|
@@ -133,7 +133,7 @@ only the path after it), or by API key:
|
|
|
133
133
|
|
|
134
134
|
### SFTP result delivery
|
|
135
135
|
|
|
136
|
-
`createAhaSftpServer` from `./sftp` starts a real SSH/SFTP server on an ephemeral port and shares order state with `createRuntime`. It supports password or public-key authentication, host-key verification, `list`/`stat`, binary upload/download, atomic temp-file rename, delete, nested directories, stable POSIX permissions and
|
|
136
|
+
`createAhaSftpServer` from `./sftp` starts a real SSH/SFTP server on an ephemeral port and shares order state with `createRuntime`. It supports password or public-key authentication, host-key verification, `list`/`stat`, binary upload/download, atomic temp-file rename, delete, nested directories, stable POSIX permissions and emulator-clock timestamps. The deterministic Ed25519 host key is stable between runs.
|
|
137
137
|
|
|
138
138
|
```ts
|
|
139
139
|
import { createRuntime } from "@crvouga/mockingbird-service-aha"
|
|
@@ -162,13 +162,13 @@ Use `seed()` to install arbitrary binary fixtures or `publishResult(orderId, byt
|
|
|
162
162
|
|
|
163
163
|
| Export | Kind | Description |
|
|
164
164
|
| --- | --- | --- |
|
|
165
|
-
| `AhaAPI` | class | The in-process
|
|
166
|
-
| `createRuntime` | function | The
|
|
165
|
+
| `AhaAPI` | class | The in-process emulator: `fetch(request)`, `reset()`, `transition(id, {status, drawStatus?, scheduledAt?, timeZone?})`, `tick()`, `orders()`. Options: `sqlite`, `now`, `namespace`, `settings`, `onWebhook`, `wallClock`. |
|
|
166
|
+
| `createRuntime` | function | The emulator with the full service contract. Options: `webhooks: {url, secret, retryDelaysMs?, fetch?}`, `settings`, `tickMs`, `wallClock`, `clock`, `seed`, `adminKey`, `onLog`. |
|
|
167
167
|
| `AHA_PRESETS` | object | Every named fault preset. |
|
|
168
168
|
| `AHA_NAMESPACE` | string | The service name, `"aha"`. |
|
|
169
169
|
| `WEBHOOK_PATH` | string | `"/bloodwork/aha-webhook"`, our receiver's route. |
|
|
170
170
|
| `ORDER_STATUSES`, `DRAW_STATUSES` | arrays | The vendor status spellings the webhooks use. |
|
|
171
|
-
| `verifyAuth` | function | The HMAC / legacy verification the
|
|
171
|
+
| `verifyAuth` | function | The HMAC / legacy verification the emulator applies (an error message, or `undefined`). |
|
|
172
172
|
| `apiKeyCredential` | function | The API key a request carries (how credentials map to namespaces). |
|
|
173
173
|
| `isTimeZone`, `zonedParts`, `zonedToEpoch` | functions | IANA-zone helpers used to fill the local date/time fields. |
|
|
174
174
|
| `document`, `operationIds`, `supportedOperationIds` | values | The vendored OpenAPI contract and its operation ids. |
|
package/SUPPORT.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Generated from `openapi.yaml`; do not edit by hand.
|
|
4
4
|
|
|
5
5
|
- operations in spec: **2**
|
|
6
|
-
- supported by the
|
|
6
|
+
- supported by the emulator: **2**
|
|
7
7
|
- parity enabled: **2**
|
|
8
8
|
|
|
9
|
-
| operationId | route |
|
|
9
|
+
| operationId | route | emulator | parity | notes |
|
|
10
10
|
| --- | --- | --- | --- | --- |
|
|
11
11
|
| `CreateOrder` | `POST /v1/{partner}/create-order` | ✅ supported | ⚠️ unsafe (opt-in) | |
|
|
12
12
|
| `CancelOrder` | `POST /v1/{partner}/cancel` | ✅ supported | ⚠️ unsafe (opt-in) | |
|