@crvouga/mockingbird-service-customerio 3.16.0 → 3.17.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 +14 -1
- package/dist/chunk-2NY3YAAP.js +71 -0
- package/dist/chunk-2NY3YAAP.js.map +7 -0
- package/dist/chunk-UCKUIVGB.js +1651 -0
- package/dist/chunk-UCKUIVGB.js.map +7 -0
- package/dist/cli.js +3 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +114 -106
- package/dist/index.js +1 -2
- package/dist/server.d.ts +45 -37
- package/dist/server.js +2 -3
- package/package.json +3 -2
- package/dist/admin-ui.js +0 -27
- package/dist/admin-ui.js.map +0 -7
- package/dist/chunk-2NI5BGYW.js +0 -5118
- package/dist/chunk-2NI5BGYW.js.map +0 -7
- package/dist/chunk-AECCAFDC.js +0 -7534
- package/dist/chunk-AECCAFDC.js.map +0 -7
- package/dist/chunk-GTYCDIPI.js +0 -7
- package/dist/chunk-GTYCDIPI.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-customerio
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.17.0 (2026-11-14)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- expand in-process emulation and resolve Plane and streaming gaps ([e6733fd](https://github.com/crvouga/mockingbird/commit/e6733fd00f5dd03259f36cc0f452780a7e0deea4))
|
|
8
|
+
- add browser runtime polyfills and edge-snapping app cycle ([815b739](https://github.com/crvouga/mockingbird/commit/815b7399f1e058b89b3fa025f79a5014172b3ab8))
|
|
9
|
+
- run lab systems in browser PR previews ([df14882](https://github.com/crvouga/mockingbird/commit/df148828ca66db1e20cf9fa2fdf38b56b5116da4))
|
|
10
|
+
- publish the shared runtime once; services depend on it instead of inlining it ([4903c4a](https://github.com/crvouga/mockingbird/commit/4903c4a748fd801001ad3fd34b6016b55e0f9953))
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
- `@crvouga/mockingbird-runtime`
|
|
15
|
+
|
|
16
|
+
## 3.16.0 (2026-11-13)
|
|
4
17
|
|
|
5
18
|
### Features
|
|
6
19
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRuntime
|
|
3
|
+
} from "./chunk-UCKUIVGB.js";
|
|
4
|
+
|
|
5
|
+
// src/server.ts
|
|
6
|
+
import { listen } from "@crvouga/mockingbird-runtime/adapter-node";
|
|
7
|
+
var DEFAULT_PORT = 8810;
|
|
8
|
+
var createServer = async (options = {}) => {
|
|
9
|
+
const { port, host, ...rest } = options;
|
|
10
|
+
const runtime = createRuntime(rest);
|
|
11
|
+
const listening = await listen(runtime, {
|
|
12
|
+
port: port ?? 0,
|
|
13
|
+
...host !== void 0 ? { host } : {}
|
|
14
|
+
});
|
|
15
|
+
return { ...listening, runtime };
|
|
16
|
+
};
|
|
17
|
+
var text = (value) => typeof value === "string" ? value : void 0;
|
|
18
|
+
var serveTarget = {
|
|
19
|
+
name: "customerio",
|
|
20
|
+
defaultPort: DEFAULT_PORT,
|
|
21
|
+
options: {
|
|
22
|
+
"webhook-url": {
|
|
23
|
+
type: "string",
|
|
24
|
+
value: "<url>",
|
|
25
|
+
description: "Deliver reporting events here (e.g. http://127.0.0.1:3000/v1/customer-io/reporting-webhook)"
|
|
26
|
+
},
|
|
27
|
+
"webhook-secret": {
|
|
28
|
+
type: "string",
|
|
29
|
+
value: "<secret>",
|
|
30
|
+
description: "Signs x-cio-signature (the app's CUSTOMERIO_REPORTING_WEBHOOK_SIGNING_KEY)"
|
|
31
|
+
},
|
|
32
|
+
"strict-messages": {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Refuse sends whose transactional_message_id is not in the workspace catalog"
|
|
35
|
+
},
|
|
36
|
+
"tracking-base": {
|
|
37
|
+
type: "string",
|
|
38
|
+
value: "<url>",
|
|
39
|
+
description: "Base of rewritten tracked links (default https://links.customer.io)"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
create: (values, common) => {
|
|
43
|
+
const url = text(values["webhook-url"]);
|
|
44
|
+
const secret = text(values["webhook-secret"]);
|
|
45
|
+
const trackingBase = text(values["tracking-base"]);
|
|
46
|
+
return createRuntime({
|
|
47
|
+
...url ? { webhooks: { url, ...secret ? { secret } : {} } } : {},
|
|
48
|
+
settings: {
|
|
49
|
+
...values["strict-messages"] === true ? { strictMessages: true } : {},
|
|
50
|
+
...trackingBase ? { trackingBase } : {}
|
|
51
|
+
},
|
|
52
|
+
...common.adminPrefix !== void 0 ? { adminPrefix: common.adminPrefix } : {},
|
|
53
|
+
...common.adminKey !== void 0 ? { adminKey: common.adminKey } : {},
|
|
54
|
+
...common.adminControls !== void 0 ? { adminControls: common.adminControls } : {},
|
|
55
|
+
...common.seed !== void 0 ? { seed: common.seed } : {},
|
|
56
|
+
...common.onLog ? { onLog: common.onLog } : {}
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
banner: () => [
|
|
60
|
+
"CDP: POST /v1/identify|track|batch with Basic <write key>: (the SDK's host)",
|
|
61
|
+
"App API: POST /v1/send/email|sms|inbox_message, GET /v1/transactional, /v1/customers/{id}/attributes, /v1/messages/{id}",
|
|
62
|
+
"namespaces: x-mockingbird-namespace, /__admin/ns/<name>/\u2026, or PUT /__admin/credentials {<key>: <ns>}"
|
|
63
|
+
]
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
DEFAULT_PORT,
|
|
68
|
+
createServer,
|
|
69
|
+
serveTarget
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=chunk-2NY3YAAP.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server.ts"],
|
|
4
|
+
"sourcesContent": ["/// <reference types=\"node\" />\nimport { type Listening, listen, type ServeTarget } from \"@crvouga/mockingbird-adapter-node\"\nimport { type CustomerIoRuntime, type CustomerIoRuntimeOptions, createRuntime } from \"./runtime.js\"\n\n/** Port `mockingbird-customerio serve` listens on when none is given. */\nexport const DEFAULT_PORT = 8810\n\nexport type CustomerIoServerOptions = CustomerIoRuntimeOptions & {\n /** Default `0`: the OS picks a free port. */\n port?: number\n /** Default `127.0.0.1`. */\n host?: string\n}\n\nexport type CustomerIoServer = Listening & { runtime: CustomerIoRuntime }\n\n/** Serve the Customer.io mock (CDP, App API and click tracking) over `node:http`. */\nexport const createServer = async (\n options: CustomerIoServerOptions = {},\n): Promise<CustomerIoServer> => {\n const { port, host, ...rest } = options\n const runtime = createRuntime(rest)\n const listening = await listen(runtime, {\n port: port ?? 0,\n ...(host !== undefined ? { host } : {}),\n })\n return { ...listening, runtime }\n}\n\nconst text = (value: string | boolean | undefined) =>\n typeof value === \"string\" ? value : undefined\n\n/** How `serve` (and `serve --config`) builds the Customer.io mock from flags. */\nexport const serveTarget: ServeTarget = {\n name: \"customerio\",\n defaultPort: DEFAULT_PORT,\n options: {\n \"webhook-url\": {\n type: \"string\",\n value: \"<url>\",\n description:\n \"Deliver reporting events here (e.g. http://127.0.0.1:3000/v1/customer-io/reporting-webhook)\",\n },\n \"webhook-secret\": {\n type: \"string\",\n value: \"<secret>\",\n description: \"Signs x-cio-signature (the app's CUSTOMERIO_REPORTING_WEBHOOK_SIGNING_KEY)\",\n },\n \"strict-messages\": {\n type: \"boolean\",\n description: \"Refuse sends whose transactional_message_id is not in the workspace catalog\",\n },\n \"tracking-base\": {\n type: \"string\",\n value: \"<url>\",\n description: \"Base of rewritten tracked links (default https://links.customer.io)\",\n },\n },\n create: (values, common) => {\n const url = text(values[\"webhook-url\"])\n const secret = text(values[\"webhook-secret\"])\n const trackingBase = text(values[\"tracking-base\"])\n return createRuntime({\n ...(url ? { webhooks: { url, ...(secret ? { secret } : {}) } } : {}),\n settings: {\n ...(values[\"strict-messages\"] === true ? { strictMessages: true } : {}),\n ...(trackingBase ? { trackingBase } : {}),\n },\n ...(common.adminPrefix !== undefined ? { adminPrefix: common.adminPrefix } : {}),\n ...(common.adminKey !== undefined ? { adminKey: common.adminKey } : {}),\n ...(common.adminControls !== undefined ? { adminControls: common.adminControls } : {}),\n ...(common.seed !== undefined ? { seed: common.seed } : {}),\n ...(common.onLog ? { onLog: common.onLog } : {}),\n })\n },\n banner: () => [\n \"CDP: POST /v1/identify|track|batch with Basic <write key>: (the SDK's host)\",\n \"App API: POST /v1/send/email|sms|inbox_message, GET /v1/transactional, /v1/customers/{id}/attributes, /v1/messages/{id}\",\n \"namespaces: x-mockingbird-namespace, /__admin/ns/<name>/\u2026, or PUT /__admin/credentials {<key>: <ns>}\",\n ],\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AACA,SAAyB,cAAgC;AAIlD,IAAM,eAAe;AAYrB,IAAM,eAAe,OAC1B,UAAmC,CAAC,MACN;AAC9B,QAAM,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAChC,QAAM,UAAU,cAAc,IAAI;AAClC,QAAM,YAAY,MAAM,OAAO,SAAS;AAAA,IACtC,MAAM,QAAQ;AAAA,IACd,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC;AAAA,EACvC,CAAC;AACD,SAAO,EAAE,GAAG,WAAW,QAAQ;AACjC;AAEA,IAAM,OAAO,CAAC,UACZ,OAAO,UAAU,WAAW,QAAQ;AAG/B,IAAM,cAA2B;AAAA,EACtC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AAAA,IACP,eAAe;AAAA,MACb,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,IACJ;AAAA,IACA,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA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