@crvouga/mockingbird-service-customerio 2.0.0 → 2.2.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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog — @crvouga/mockingbird-service-customerio
2
2
 
3
+ ## 2.2.0 (2026-10-05)
4
+
5
+ ### Features
6
+
7
+ - add scripted local API mock ([4a76a11](https://github.com/crvouga/mockingbird/commit/4a76a114e2efad45934e0a93cf29576fd418e15c))
8
+ - reconcile sender opt-outs ([43b7c8e](https://github.com/crvouga/mockingbird/commit/43b7c8e55ff8de7d15efe4db55beda80f01bcbd0))
9
+
10
+ ### Fixes and improvements
11
+
12
+ - support embedded route parameters ([127cad9](https://github.com/crvouga/mockingbird/commit/127cad997ef106950c1b866070eea191ba54403f))
13
+ - preserve namespace URLs after main sync ([62a15ce](https://github.com/crvouga/mockingbird/commit/62a15ce9bd453069bde69e3a30c91efc01f8871b))
14
+
15
+ ## 2.1.0 (2026-10-04)
16
+
17
+ ### Features
18
+
19
+ - use shared forms for service actions ([af19eb9](https://github.com/crvouga/mockingbird/commit/af19eb9d4896d8418f5db850f20808a89291b949))
20
+ - replace UI with Ant Design ([6547b4e](https://github.com/crvouga/mockingbird/commit/6547b4ef1663fb597ab515cce06245c82010407a))
21
+
22
+ ### Fixes and improvements
23
+
24
+ - fill the embedded viewport ([c1a35a4](https://github.com/crvouga/mockingbird/commit/c1a35a4789389ee9cd06c286d09bd47c4d06c71e))
25
+ - make dialog cleanup immediate ([0c1a3c5](https://github.com/crvouga/mockingbird/commit/0c1a3c5b12584d50c19dcae595b951b8e5417b9c))
26
+
3
27
  ## 2.0.0 (2026-10-04)
4
28
 
5
29
  ### ⚠️ Breaking changes
@@ -18,10 +42,6 @@
18
42
  - parse ISO journal timestamps ([20b39a2](https://github.com/crvouga/mockingbird/commit/20b39a2c738e278533d610dfc91f1cb3ae9b3f1e))
19
43
  - harden shared controls ([7822614](https://github.com/crvouga/mockingbird/commit/7822614f6cba0387aeb60ba7320b0379aa1ef690))
20
44
 
21
- ### Dependencies
22
-
23
- - `@crvouga/mockingbird-service-sqlite`
24
-
25
45
  ## 1.8.0 (2026-10-01)
26
46
 
27
47
  ### Features
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Stateful mock of **Customer.io** for test suites, serving all three hosts our code talks to from
6
6
  one process: the Segment-compatible **CDP** (`identify`, `track`, `batch`, exactly as
7
7
  `@customerio/cdp-analytics-node` posts them), the **App API** transactional sends (email, SMS,
8
- inbox message), message catalog, profile attribute reads, and delivery-status reads, and the
8
+ inbox message), message catalog, profile attribute reads, sender opt-out reconciliation, and delivery-status reads, and the
9
9
  **link-tracking** click endpoint. Sends land in an outbox a suite asserts on (and reads links out
10
10
  of); reporting events (`unsubscribed`, `subscribed`, `spammed`, subscription preferences,
11
11
  `clicked`) are posted to our reporting webhook, signed the way Customer.io signs them.
@@ -81,6 +81,8 @@ await cio.close()
81
81
  | `GET /v1/transactional` | `{messages: [{id, name, trigger_name, description, send_to_unsubscribed, link_tracking, …}]}`, no pagination (the whole catalog, including hundreds of rows). Seeded with `acme_<key>` for every legacy email key the consumer app has, plus `acme_inbox_message` and `acme_playground_notification` (ids 1–21). `transactionalListKey: "transactional"` renames the array key. |
82
82
  | `GET /v1/transactional/{id}` | `{message: {...}}` by id or trigger name (case-insensitive), or 404. |
83
83
  | `GET /v1/customers/{customer_id}/attributes?id_type=id\|email\|cio_id` | `{customer: {identifiers: {id, email?, cio_id}, attributes, devices}}`. Unknown `id_type` is 400; an unknown customer is 404. Attributes spread stored traits, then `id`, `cio_id`, `email`, and `unsubscribed` win. |
84
+ | `GET /v1/optouts?limit=&start=&from=` | Workspace sender opt-outs as `{optouts: [{customer_id, cio_id, optouts: [{channel, from}]}], next?}`. `limit` defaults to 100 (1–1000); follow `next` using `start` until it is absent. `from` filters sender/channel entries, omitting people with no matches. Sender values are trimmed and lowercased; E.164 numbers retain their form. |
85
+ | `GET /v1/customers/{customer_id}/optouts?id_type=id\|email\|cio_id` | `{optouts: [{channel, from}]}` for an existing profile, empty if none, 404 for unknown people. Uses the same identity state as CDP identify and profile updates. App API authentication applies to both reads. |
84
86
  | `GET /v1/messages/{delivery_id}` | `{message: {id, type, recipient, customer_id, created, state, status, metrics}}`. `type` is `in_app` for inbox. No `message_data`. 404 when the id is missing or still inside `statusVisibleAfterMs`. Failure states add `failure_message`, `rejection_reason`, and `error`. |
85
87
  | `POST /click/{linkId}` | Our backend's click report (unauthenticated) → 200, counts the click and posts a `clicked` reporting event. Unknown link: plain-text 404. |
86
88
  | `GET /click/{linkId}` | A browser following a tracked link → 302 to the original URL. |
@@ -103,6 +105,7 @@ is the JSON string of subscription preferences. `timestamp` never runs ahead of
103
105
  | `POST /__admin/reporting-events` | `{metric, userId? \| email? \| deliveryId?, objectType?, preferences?: {topics?, channels?}}`: apply it to the profile (`unsubscribed`, `subscribed`, `spammed`, `cio_subscription_preferences_changed`) and post the signed event. Any other metric (`delivered`, `opened`, `bounced`, …) is posted as-is. |
104
106
  | `GET /__admin/cdp/events?userId=&type=&event=` | CDP calls received (with `duplicate`). |
105
107
  | `GET /__admin/profiles`, `GET /__admin/profiles/:id`, `PUT /__admin/profiles/:id` | Profiles (traits, `cioId`, `unsubscribed`, `channelsOff`, `preferences`). PUT merges `{traits?, email?, unsubscribed?, preferences?}`. |
108
+ | `POST /__admin/optouts` | `{customerId, from, optout: boolean, channel?: "sms"\|"whatsapp"}` scripts STOP (`true`) or START (`false`) for an existing person; unknown people are 404. Only that sender/channel changes. Marketing preferences and reporting webhooks stay independent. State participates in namespaces, snapshots, Timeline, clocks and reset. |
106
109
  | `POST /__admin/deliveries/:id` | `{"state": "pending"\|"sent"\|"delivered"\|"bounced"\|"dropped"\|"failed"\|"spammed"\|"undeliverable"\|"suppressed"}`. Stamps `metrics[state]` with unix seconds on the namespace clock. `delivered` is success; the failure states are terminal. |
107
110
  | `POST /__admin/namespace-clock` | `{"advance": <ms>}` adds to this namespace's clock offset only. |
108
111
  | `GET\|PUT /__admin/transactional` | Read or replace the workspace's transactional messages (`[{id?, name?, trigger_name, link_tracking?, send_to_unsubscribed?}]`). |
@@ -131,6 +134,7 @@ username) or the App API key (Bearer) through `PUT /__admin/credentials {"creden
131
134
 
132
135
  ### Deliberately not modelled
133
136
 
137
+ - Opt-out writes through the public PUT API, phone identifier workspace configuration, Twilio sender identity casing recovery, and automatic carrier STOP callbacks. Use the admin control to script reconciler state; it does not model carrier delivery enforcement.
134
138
  - Rendering: templates are not rendered; the outbox holds `message_data`, not HTML.
135
139
  - Campaigns, segments, journeys, broadcasts and the Track API (`track.customer.io`).
136
140
  - CDP `page`, `screen`, `group` and `alias` calls (our consumers send none).
package/SUPPORT.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Generated from `openapi.yaml`; do not edit by hand.
4
4
 
5
- - operations in spec: **12**
6
- - supported by the mock: **12**
7
- - parity enabled: **12**
5
+ - operations in spec: **14**
6
+ - supported by the mock: **14**
7
+ - parity enabled: **14**
8
8
 
9
9
  | operationId | route | mock | parity | notes |
10
10
  | --- | --- | --- | --- | --- |
@@ -17,6 +17,8 @@ Generated from `openapi.yaml`; do not edit by hand.
17
17
  | `ListTransactionalMessages` | `GET /v1/transactional` | ✅ supported | ✅ | |
18
18
  | `GetTransactionalMessage` | `GET /v1/transactional/{transactional_id}` | ✅ supported | ✅ | |
19
19
  | `GetCustomerAttributes` | `GET /v1/customers/{customer_id}/attributes` | ✅ supported | ✅ | |
20
+ | `ListOptOuts` | `GET /v1/optouts` | ✅ supported | ✅ | |
21
+ | `GetCustomerOptOuts` | `GET /v1/customers/{customer_id}/optouts` | ✅ supported | ✅ | |
20
22
  | `GetMessage` | `GET /v1/messages/{message_id}` | ✅ supported | ✅ | |
21
23
  | `FollowClick` | `GET /click/{linkId}` | ✅ supported | ⚠️ unsafe (opt-in) | |
22
24
  | `ReportClick` | `POST /click/{linkId}` | ✅ supported | ⚠️ unsafe (opt-in) | |
@@ -3,7 +3,7 @@ import {
3
3
  createRuntime,
4
4
  parseDuration,
5
5
  resolveAdminPrefix
6
- } from "./chunk-BOZCY34D.js";
6
+ } from "./chunk-XGFF36NR.js";
7
7
 
8
8
  // ../../adapters/node/dist/cli.js
9
9
  import { readFile as readFile2 } from "node:fs/promises";
@@ -855,4 +855,4 @@ export {
855
855
  createServer2 as createServer,
856
856
  serveTarget
857
857
  };
858
- //# sourceMappingURL=chunk-JFPKZWBO.js.map
858
+ //# sourceMappingURL=chunk-NL7M7QLP.js.map