@crvouga/mockingbird-notifications 0.0.0-stage → 0.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/dist/index.js ADDED
@@ -0,0 +1,98 @@
1
+ import {
2
+ TEST_IDS,
3
+ selectors
4
+ } from "./chunk-FBJ2DRHH.js";
5
+ import {
6
+ createNotificationHarness,
7
+ parseMime
8
+ } from "./chunk-GHIEYY5B.js";
9
+ import {
10
+ CHANNELS,
11
+ SERVICE_KINDS,
12
+ SERVICE_LABELS,
13
+ filterToSearch,
14
+ matches
15
+ } from "./chunk-3HF2NSFV.js";
16
+
17
+ // src/client.ts
18
+ var NotificationClient = class {
19
+ baseUrl;
20
+ namespace;
21
+ fetchImpl;
22
+ constructor(baseUrl, options = {}) {
23
+ this.baseUrl = baseUrl.replace(/\/+$/, "");
24
+ this.namespace = options.namespace;
25
+ this.fetchImpl = options.fetch ?? ((request) => fetch(request));
26
+ }
27
+ async get(path, filter = {}, extra = {}) {
28
+ const params = filterToSearch({ namespace: this.namespace, ...filter });
29
+ for (const [k, v] of Object.entries(extra)) params.set(k, v);
30
+ const query = params.toString();
31
+ const response = await this.fetchImpl(
32
+ new Request(`${this.baseUrl}${path}${query ? `?${query}` : ""}`)
33
+ );
34
+ const body = await response.json();
35
+ if (!response.ok) {
36
+ const error = new Error(body.error?.message ?? `HTTP ${response.status}`);
37
+ Object.assign(error, { status: response.status, body });
38
+ throw error;
39
+ }
40
+ return body;
41
+ }
42
+ /** Every matching notification, oldest first. */
43
+ async list(filter = {}) {
44
+ return (await this.get("/api/notifications", filter)).notifications;
45
+ }
46
+ /** The newest match, or `null`. */
47
+ async latest(filter = {}) {
48
+ try {
49
+ return await this.get("/api/notifications/latest", filter);
50
+ } catch (error) {
51
+ if (error.status === 404) return null;
52
+ throw error;
53
+ }
54
+ }
55
+ /** Wait until `count` (default 1) notifications match and return them; throws on timeout. */
56
+ async waitFor(filter, options = {}) {
57
+ const extra = {};
58
+ if (options.timeoutMs !== void 0) extra.timeoutMs = String(options.timeoutMs);
59
+ if (options.count !== void 0) extra.count = String(options.count);
60
+ return (await this.get("/api/wait", filter, extra)).notifications;
61
+ }
62
+ /** Wait for the next SMS to `to` and return its one-time code (Twilio Verify) or first 4–8 digit run. */
63
+ async waitForCode(to, filter = {}, timeoutMs) {
64
+ const found = await this.waitFor(
65
+ { channel: "sms", to, ...filter },
66
+ timeoutMs === void 0 ? {} : { timeoutMs }
67
+ );
68
+ const last = found.at(-1);
69
+ const code = last?.sms?.code ?? /\b(\d{4,8})\b/.exec(last?.sms?.body ?? "")?.[1];
70
+ if (!code) throw new Error(`no code in the latest SMS to ${to}`);
71
+ return code;
72
+ }
73
+ async sources() {
74
+ return (await this.get("/api/sources")).sources;
75
+ }
76
+ /** A UI link that opens one device (or one notification) for a screenshot. */
77
+ link(view = {}) {
78
+ const params = new URLSearchParams();
79
+ if (this.namespace) params.set("namespace", this.namespace);
80
+ if (view.channel) params.set("view", view.channel);
81
+ if (view.to) params.set("to", view.to);
82
+ if (view.id) params.set("id", view.id);
83
+ const query = params.toString();
84
+ return `${this.baseUrl}/${query ? `?${query}` : ""}`;
85
+ }
86
+ };
87
+ export {
88
+ CHANNELS,
89
+ NotificationClient,
90
+ SERVICE_KINDS,
91
+ SERVICE_LABELS,
92
+ TEST_IDS,
93
+ createNotificationHarness,
94
+ matches,
95
+ parseMime,
96
+ selectors
97
+ };
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/client.ts"],
4
+ "sourcesContent": ["import {\n type Channel,\n filterToSearch,\n type Notification,\n type NotificationFilter,\n type SourceStatus,\n} from \"./model.js\"\n\nexport type NotificationClientOptions = {\n /** Default namespace for every call that does not name one. */\n namespace?: string\n fetch?: (request: Request) => Response | Promise<Response>\n}\n\n/** Talks to a running harness over HTTP, for tests that run in another process. */\nexport class NotificationClient {\n readonly baseUrl: string\n private readonly namespace: string | undefined\n private readonly fetchImpl: (request: Request) => Response | Promise<Response>\n\n constructor(baseUrl: string, options: NotificationClientOptions = {}) {\n this.baseUrl = baseUrl.replace(/\\/+$/, \"\")\n this.namespace = options.namespace\n this.fetchImpl = options.fetch ?? ((request) => fetch(request))\n }\n\n private async get<T>(\n path: string,\n filter: NotificationFilter = {},\n extra: Record<string, string> = {},\n ) {\n const params = filterToSearch({ namespace: this.namespace, ...filter })\n for (const [k, v] of Object.entries(extra)) params.set(k, v)\n const query = params.toString()\n const response = await this.fetchImpl(\n new Request(`${this.baseUrl}${path}${query ? `?${query}` : \"\"}`),\n )\n const body = (await response.json()) as T & { error?: { message?: string } }\n if (!response.ok) {\n const error = new Error(body.error?.message ?? `HTTP ${response.status}`)\n Object.assign(error, { status: response.status, body })\n throw error\n }\n return body\n }\n\n /** Every matching notification, oldest first. */\n async list(filter: NotificationFilter = {}): Promise<Notification[]> {\n return (await this.get<{ notifications: Notification[] }>(\"/api/notifications\", filter))\n .notifications\n }\n\n /** The newest match, or `null`. */\n async latest(filter: NotificationFilter = {}): Promise<Notification | null> {\n try {\n return await this.get<Notification>(\"/api/notifications/latest\", filter)\n } catch (error) {\n if ((error as { status?: number }).status === 404) return null\n throw error\n }\n }\n\n /** Wait until `count` (default 1) notifications match and return them; throws on timeout. */\n async waitFor(\n filter: NotificationFilter,\n options: { timeoutMs?: number; count?: number } = {},\n ): Promise<Notification[]> {\n const extra: Record<string, string> = {}\n if (options.timeoutMs !== undefined) extra.timeoutMs = String(options.timeoutMs)\n if (options.count !== undefined) extra.count = String(options.count)\n return (await this.get<{ notifications: Notification[] }>(\"/api/wait\", filter, extra))\n .notifications\n }\n\n /** Wait for the next SMS to `to` and return its one-time code (Twilio Verify) or first 4\u20138 digit run. */\n async waitForCode(\n to: string,\n filter: NotificationFilter = {},\n timeoutMs?: number,\n ): Promise<string> {\n const found = await this.waitFor(\n { channel: \"sms\", to, ...filter },\n timeoutMs === undefined ? {} : { timeoutMs },\n )\n const last = found.at(-1)\n const code = last?.sms?.code ?? /\\b(\\d{4,8})\\b/.exec(last?.sms?.body ?? \"\")?.[1]\n if (!code) throw new Error(`no code in the latest SMS to ${to}`)\n return code\n }\n\n async sources(): Promise<SourceStatus[]> {\n return (await this.get<{ sources: SourceStatus[] }>(\"/api/sources\")).sources\n }\n\n /** A UI link that opens one device (or one notification) for a screenshot. */\n link(view: { channel?: Channel; to?: string; id?: string } = {}): string {\n const params = new URLSearchParams()\n if (this.namespace) params.set(\"namespace\", this.namespace)\n if (view.channel) params.set(\"view\", view.channel)\n if (view.to) params.set(\"to\", view.to)\n if (view.id) params.set(\"id\", view.id)\n const query = params.toString()\n return `${this.baseUrl}/${query ? `?${query}` : \"\"}`\n }\n}\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -0,0 +1,262 @@
1
+ /** The kinds of device a notification lands on. */
2
+ type Channel = "sms" | "email" | "push" | "chat";
3
+ /** Emulators the harness knows how to read. */
4
+ type ServiceKind = "twilio" | "resend" | "fcm" | "ses" | "sns" | "customerio" | "mailosaur" | "slack";
5
+ type Address = {
6
+ name: string | null;
7
+ address: string;
8
+ };
9
+ type SmsContent = {
10
+ body: string;
11
+ /** One-time code the sender included (Twilio Verify), when known. */
12
+ code: string | null;
13
+ media: string[];
14
+ /** `whatsapp` when the message went to a `whatsapp:` address; plain text messages omit it. */
15
+ via?: "sms" | "whatsapp";
16
+ };
17
+ type EmailAttachment = {
18
+ filename: string;
19
+ contentType: string | null;
20
+ size: number | null;
21
+ };
22
+ type EmailContent = {
23
+ subject: string;
24
+ html: string | null;
25
+ text: string | null;
26
+ cc: string[];
27
+ bcc: string[];
28
+ replyTo: string[];
29
+ attachments: EmailAttachment[];
30
+ headers: Record<string, string>;
31
+ };
32
+ type PushPlatform = "android" | "ios" | "web" | "unknown";
33
+ type PushContent = {
34
+ title: string | null;
35
+ body: string | null;
36
+ imageUrl: string | null;
37
+ /** The app the notification belongs to (the FCM project, for example). */
38
+ app: string;
39
+ platform: PushPlatform;
40
+ data: Record<string, string>;
41
+ badge: number | null;
42
+ sound: string | null;
43
+ };
44
+ type ChatReaction = {
45
+ name: string;
46
+ count: number;
47
+ };
48
+ /** A message posted into a team chat channel (Slack). */
49
+ type ChatContent = {
50
+ /** The message text, in the provider's own markup (Slack mrkdwn). */
51
+ text: string;
52
+ /** Workspace the message was posted in. */
53
+ workspace: string | null;
54
+ /** How it arrived: `chat.postMessage`, `chat.postEphemeral` or `incoming-webhook`. */
55
+ method: string;
56
+ /** Block Kit blocks, exactly as sent. */
57
+ blocks: unknown[];
58
+ /** Legacy attachments, exactly as sent. */
59
+ attachments: unknown[];
60
+ /** Parent message timestamp when this is a threaded reply. */
61
+ threadTs: string | null;
62
+ /** Shown to one member only. */
63
+ ephemeral: boolean;
64
+ edited: boolean;
65
+ reactions: ChatReaction[];
66
+ /** Display names of the users and channels the message mentions by id (`U…` → `ada`). */
67
+ names?: Record<string, string>;
68
+ };
69
+ /** One message as a recipient would receive it, normalized across emulators. */
70
+ type Notification = {
71
+ /** Stable across polls: `<service entry>:<namespace>:<provider id>`. */
72
+ id: string;
73
+ /** The provider's own id (Twilio SID, Resend id, FCM message name, …). */
74
+ providerId: string;
75
+ channel: Channel;
76
+ /** The fleet entry name (`twilio`, or an alias such as `push`). */
77
+ source: string;
78
+ service: ServiceKind;
79
+ namespace: string;
80
+ /** Phone number, email address, push registration token, or chat channel (`#alerts`). */
81
+ to: string;
82
+ from: Address;
83
+ /** ISO-8601, on the emulator's clock. */
84
+ createdAt: string;
85
+ /** Short plain-text preview. */
86
+ preview: string;
87
+ /** Provider delivery state when it reports one (`queued`, `delivered`, `suppressed`, …). */
88
+ status: string | null;
89
+ sms: SmsContent | null;
90
+ email: EmailContent | null;
91
+ push: PushContent | null;
92
+ /** Set on `chat` notifications; absent or null on every other channel. */
93
+ chat?: ChatContent | null;
94
+ /** The record exactly as the emulator reported it. */
95
+ raw: unknown;
96
+ };
97
+ type NotificationFilter = {
98
+ channel?: Channel | undefined;
99
+ service?: ServiceKind | undefined;
100
+ source?: string | undefined;
101
+ namespace?: string | undefined;
102
+ /** Exact recipient (case-insensitive for email). */
103
+ to?: string | undefined;
104
+ /** Case-insensitive text search across sender, subject, title and body. */
105
+ contains?: string | undefined;
106
+ /** Only notifications created at or after this instant (ISO-8601 or epoch ms). */
107
+ since?: string | number | undefined;
108
+ };
109
+ type SourceStatus = {
110
+ name: string;
111
+ service: ServiceKind | null;
112
+ url: string;
113
+ ok: boolean;
114
+ error: string | null;
115
+ count: number;
116
+ lastSyncAt: string | null;
117
+ };
118
+
119
+ /**
120
+ * Where the emulators are. The harness reads the same fleet the application uses: the live fleet
121
+ * controller (`adminBase`), the fleet's ready manifest, or explicit URLs and in-process runtimes.
122
+ */
123
+
124
+ type FetchLike = (request: Request) => Response | Promise<Response>;
125
+ /** A service emulator: its base URL, an `{ url, adminUrl?, service? }` entry, or an in-process runtime. */
126
+ type ServiceInput = string | {
127
+ url: string;
128
+ adminUrl?: string;
129
+ service?: ServiceKind;
130
+ } | {
131
+ fetch: FetchLike;
132
+ service?: ServiceKind;
133
+ adminPrefix?: string;
134
+ };
135
+ /** The subset of a fleet ready manifest (`--ready-file`) the harness reads. */
136
+ type FleetManifest = {
137
+ adminBase?: string;
138
+ services: Record<string, {
139
+ protocol?: string;
140
+ url?: string;
141
+ adminUrl?: string;
142
+ target?: string;
143
+ } | undefined>;
144
+ };
145
+ /**
146
+ * An emulator whose admin API the dashboard fronts. Unlike {@link Endpoint} this is every HTTP
147
+ * emulator, messaging or not (stripe, cognito, …).
148
+ */
149
+ type AdminTarget = {
150
+ /** The fleet entry name, e.g. `stripe`, or an alias such as `push`. */
151
+ name: string;
152
+ /** The emulator it runs, e.g. `fcm` for the alias `push`. The name when nobody said. */
153
+ target: string;
154
+ /** Absolute admin prefix, e.g. `http://127.0.0.1:8798/__admin`. */
155
+ adminUrl: string;
156
+ fetch: FetchLike;
157
+ };
158
+
159
+ type HarnessOptions = {
160
+ /** A running fleet controller's `adminBase` (`http://127.0.0.1:9000/__admin/fleet`). */
161
+ fleet?: string;
162
+ /** A fleet ready manifest, or a function that reads the current one (re-read on every sync). */
163
+ manifest?: FleetManifest | (() => FleetManifest | Promise<FleetManifest>);
164
+ /** Explicit emulators by name: base URLs, `{ url, adminUrl }`, or in-process runtimes. */
165
+ services?: Record<string, ServiceInput>;
166
+ /**
167
+ * Namespaces to watch in the background. `"all"` follows the fleet's namespace list.
168
+ * Any namespace an API call or the UI asks for is watched from then on. Default `["default"]`,
169
+ * or `"all"` with `fleet`.
170
+ */
171
+ namespaces?: "all" | string[];
172
+ /** Background polling interval. `0` turns it off; reads still sync on demand. Default 750 ms. */
173
+ pollIntervalMs?: number;
174
+ /** Sent as `x-mockingbird-admin-key` to the fleet and every emulator. */
175
+ adminKey?: string;
176
+ /** Admin keys by emulator name, for emulators whose key is not `adminKey`. */
177
+ adminKeys?: Record<string, string>;
178
+ /**
179
+ * Front every emulator's admin API on this origin, so the page shows an Emulators tab next to
180
+ * Notifications. `createServer` (the `./server` entry) turns it on; pass `adminGateway()` from
181
+ * that entry to turn it on for a harness you serve yourself.
182
+ */
183
+ admin?: AdminGatewayFactory | false;
184
+ /** The tab the page opens on when it has both. Default `notifications`. */
185
+ defaultTab?: "emulators" | "notifications";
186
+ /** Transport for URL endpoints. Default: global `fetch`. */
187
+ fetch?: FetchLike;
188
+ /** Page title. */
189
+ title?: string;
190
+ };
191
+ type AdminGatewayContext = {
192
+ /** Every HTTP emulator the harness knows, messaging or not, after a fresh discovery. */
193
+ targets(): Promise<AdminTarget[]>;
194
+ /** The admin key header for one emulator: empty when the harness has no key for it. */
195
+ headers(name: string): Record<string, string>;
196
+ title: string;
197
+ };
198
+ type AdminGateway = {
199
+ /** The admin UI's mount config for the current emulators; null when there are none. */
200
+ config(): Promise<Record<string, unknown> | null>;
201
+ /** Everything under `/admin/`: the admin UI script and each emulator's admin API. */
202
+ fetch(request: Request): Promise<Response>;
203
+ };
204
+ type AdminGatewayFactory = (context: AdminGatewayContext) => AdminGateway;
205
+ type WaitOptions = {
206
+ timeoutMs?: number;
207
+ count?: number;
208
+ };
209
+ type NotificationHarness = {
210
+ /** The harness UI and JSON API as a Fetch handler. */
211
+ fetch(request: Request): Promise<Response>;
212
+ /** Read every emulator now. Resolves after a read that started after this call. */
213
+ sync(namespace?: string): Promise<void>;
214
+ /** Notifications matching `filter`, oldest first, after a fresh sync. */
215
+ list(filter?: NotificationFilter): Promise<Notification[]>;
216
+ /** Resolve once at least `count` (default 1) notifications match; reject after `timeoutMs`. */
217
+ waitFor(filter: NotificationFilter, options?: WaitOptions): Promise<Notification[]>;
218
+ sources(): SourceStatus[];
219
+ close(): void;
220
+ };
221
+
222
+ /** Where the admin UI reads each vendor's logo and links from, as every emulator's own admin does. */
223
+ declare const ADMIN_BRANDS_URL = "https://mockingbird.chrisvouga.dev/brands.json";
224
+ type AdminGatewayOptions = {
225
+ /** Default {@link ADMIN_BRANDS_URL}. */
226
+ brandsUrl?: string;
227
+ };
228
+ /**
229
+ * Pass the result as the harness's `admin` option. `createServer` does so by default.
230
+ *
231
+ * A request that carries no admin key gets the harness's own (`adminKey` / `adminKeys`), so the
232
+ * page works against a locked fleet without the viewer typing the key. Anyone who can reach the
233
+ * harness can then change emulator state: keep it on a loopback or otherwise private address.
234
+ */
235
+ declare const adminGateway: (options?: AdminGatewayOptions) => AdminGatewayFactory;
236
+
237
+ /** Port `mockingbird-notifications serve` listens on when none is given. */
238
+ declare const DEFAULT_PORT = 8790;
239
+ /**
240
+ * `admin` defaults to `adminGateway()` here: the page gets an Emulators tab with every emulator's
241
+ * admin dashboard. Pass `admin: false` for the notifications UI alone.
242
+ */
243
+ type NotificationServerOptions = Omit<HarnessOptions, "manifest"> & {
244
+ /** A fleet ready manifest object, or the path of the fleet's `--ready-file` (re-read every sync). */
245
+ manifest?: HarnessOptions["manifest"] | string;
246
+ /** Default `0`: the OS picks a free port. */
247
+ port?: number;
248
+ /** Default `127.0.0.1`. */
249
+ host?: string;
250
+ };
251
+ type NotificationServer = {
252
+ url: string;
253
+ port: number;
254
+ harness: NotificationHarness;
255
+ close(): Promise<void>;
256
+ };
257
+ /** A manifest loader that re-reads the fleet's ready file, so a restarted fleet is picked up. */
258
+ declare const manifestFile: (path: string) => () => Promise<FleetManifest>;
259
+ declare const createServer: (options?: NotificationServerOptions) => Promise<NotificationServer>;
260
+
261
+ export { ADMIN_BRANDS_URL, DEFAULT_PORT, adminGateway, createServer, manifestFile };
262
+ export type { AdminGatewayOptions, NotificationServer, NotificationServerOptions };
package/dist/server.js ADDED
@@ -0,0 +1,17 @@
1
+ import {
2
+ ADMIN_BRANDS_URL,
3
+ DEFAULT_PORT,
4
+ adminGateway,
5
+ createServer,
6
+ manifestFile
7
+ } from "./chunk-4QVURMVP.js";
8
+ import "./chunk-GHIEYY5B.js";
9
+ import "./chunk-3HF2NSFV.js";
10
+ export {
11
+ ADMIN_BRANDS_URL,
12
+ DEFAULT_PORT,
13
+ adminGateway,
14
+ createServer,
15
+ manifestFile
16
+ };
17
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }