@crvouga/mockingbird-notifications 0.2.0 → 0.3.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/cli.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  DEFAULT_PORT,
4
4
  createServer
5
- } from "./chunk-4QVURMVP.js";
6
- import "./chunk-GHIEYY5B.js";
7
- import "./chunk-3HF2NSFV.js";
5
+ } from "./chunk-TN2LRJAM.js";
6
+ import "./chunk-ZRI5NLWC.js";
7
+ import "./chunk-4BPQC52H.js";
8
8
 
9
9
  // src/cli.ts
10
10
  import { parseArgs } from "node:util";
package/dist/index.d.ts CHANGED
@@ -1,125 +1,6 @@
1
- /** The kinds of device a notification lands on. */
2
- type Channel = "sms" | "email" | "push" | "chat";
3
- /** Every channel, in the order the devices are laid out. */
4
- declare const CHANNELS: readonly Channel[];
5
- /** Emulators the harness knows how to read. */
6
- type ServiceKind = "twilio" | "resend" | "fcm" | "ses" | "sns" | "customerio" | "mailosaur" | "slack";
7
- declare const SERVICE_KINDS: readonly ServiceKind[];
8
- declare const SERVICE_LABELS: Record<ServiceKind, string>;
9
- type Address = {
10
- name: string | null;
11
- address: string;
12
- };
13
- type SmsContent = {
14
- body: string;
15
- /** One-time code the sender included (Twilio Verify), when known. */
16
- code: string | null;
17
- media: string[];
18
- /** `whatsapp` when the message went to a `whatsapp:` address; plain text messages omit it. */
19
- via?: "sms" | "whatsapp";
20
- };
21
- type EmailAttachment = {
22
- filename: string;
23
- contentType: string | null;
24
- size: number | null;
25
- };
26
- type EmailContent = {
27
- subject: string;
28
- html: string | null;
29
- text: string | null;
30
- cc: string[];
31
- bcc: string[];
32
- replyTo: string[];
33
- attachments: EmailAttachment[];
34
- headers: Record<string, string>;
35
- };
36
- type PushPlatform = "android" | "ios" | "web" | "unknown";
37
- type PushContent = {
38
- title: string | null;
39
- body: string | null;
40
- imageUrl: string | null;
41
- /** The app the notification belongs to (the FCM project, for example). */
42
- app: string;
43
- platform: PushPlatform;
44
- data: Record<string, string>;
45
- badge: number | null;
46
- sound: string | null;
47
- };
48
- type ChatReaction = {
49
- name: string;
50
- count: number;
51
- };
52
- /** A message posted into a team chat channel (Slack). */
53
- type ChatContent = {
54
- /** The message text, in the provider's own markup (Slack mrkdwn). */
55
- text: string;
56
- /** Workspace the message was posted in. */
57
- workspace: string | null;
58
- /** How it arrived: `chat.postMessage`, `chat.postEphemeral` or `incoming-webhook`. */
59
- method: string;
60
- /** Block Kit blocks, exactly as sent. */
61
- blocks: unknown[];
62
- /** Legacy attachments, exactly as sent. */
63
- attachments: unknown[];
64
- /** Parent message timestamp when this is a threaded reply. */
65
- threadTs: string | null;
66
- /** Shown to one member only. */
67
- ephemeral: boolean;
68
- edited: boolean;
69
- reactions: ChatReaction[];
70
- /** Display names of the users and channels the message mentions by id (`U…` → `ada`). */
71
- names?: Record<string, string>;
72
- };
73
- /** One message as a recipient would receive it, normalized across emulators. */
74
- type Notification = {
75
- /** Stable across polls: `<service entry>:<namespace>:<provider id>`. */
76
- id: string;
77
- /** The provider's own id (Twilio SID, Resend id, FCM message name, …). */
78
- providerId: string;
79
- channel: Channel;
80
- /** The fleet entry name (`twilio`, or an alias such as `push`). */
81
- source: string;
82
- service: ServiceKind;
83
- namespace: string;
84
- /** Phone number, email address, push registration token, or chat channel (`#alerts`). */
85
- to: string;
86
- from: Address;
87
- /** ISO-8601, on the emulator's clock. */
88
- createdAt: string;
89
- /** Short plain-text preview. */
90
- preview: string;
91
- /** Provider delivery state when it reports one (`queued`, `delivered`, `suppressed`, …). */
92
- status: string | null;
93
- sms: SmsContent | null;
94
- email: EmailContent | null;
95
- push: PushContent | null;
96
- /** Set on `chat` notifications; absent or null on every other channel. */
97
- chat?: ChatContent | null;
98
- /** The record exactly as the emulator reported it. */
99
- raw: unknown;
100
- };
101
- type NotificationFilter = {
102
- channel?: Channel | undefined;
103
- service?: ServiceKind | undefined;
104
- source?: string | undefined;
105
- namespace?: string | undefined;
106
- /** Exact recipient (case-insensitive for email). */
107
- to?: string | undefined;
108
- /** Case-insensitive text search across sender, subject, title and body. */
109
- contains?: string | undefined;
110
- /** Only notifications created at or after this instant (ISO-8601 or epoch ms). */
111
- since?: string | number | undefined;
112
- };
113
- type SourceStatus = {
114
- name: string;
115
- service: ServiceKind | null;
116
- url: string;
117
- ok: boolean;
118
- error: string | null;
119
- count: number;
120
- lastSyncAt: string | null;
121
- };
122
- declare const matches: (n: Notification, filter: NotificationFilter) => boolean;
1
+ import { N as NotificationFilter, a as Notification, S as SourceStatus, C as Channel, E as EmailAttachment } from './types-CU0LKNyA.js';
2
+ export { A as Address, b as AdminGateway, c as AdminGatewayContext, d as AdminGatewayFactory, e as AdminTarget, f as CHANNELS, g as ChatContent, h as ChatReaction, i as EmailContent, j as Endpoint, F as FetchLike, k as FleetManifest, H as HarnessOptions, l as NotificationHarness, P as PushContent, m as PushPlatform, n as SERVICE_KINDS, o as SERVICE_LABELS, p as ServiceInput, q as ServiceKind, r as SmsContent, W as WaitOptions, s as createNotificationHarness, t as matches } from './types-CU0LKNyA.js';
3
+ export { T as TEST_IDS, a as TestId, s as selectors } from './types-B--Ql-Jg.js';
123
4
 
124
5
  type NotificationClientOptions = {
125
6
  /** Default namespace for every call that does not name one. */
@@ -153,119 +34,6 @@ declare class NotificationClient {
153
34
  }): string;
154
35
  }
155
36
 
156
- /**
157
- * Where the emulators are. The harness reads the same fleet the application uses: the live fleet
158
- * controller (`adminBase`), the fleet's ready manifest, or explicit URLs and in-process runtimes.
159
- */
160
-
161
- type FetchLike = (request: Request) => Response | Promise<Response>;
162
- /** A service emulator: its base URL, an `{ url, adminUrl?, service? }` entry, or an in-process runtime. */
163
- type ServiceInput = string | {
164
- url: string;
165
- adminUrl?: string;
166
- service?: ServiceKind;
167
- } | {
168
- fetch: FetchLike;
169
- service?: ServiceKind;
170
- adminPrefix?: string;
171
- };
172
- /** The subset of a fleet ready manifest (`--ready-file`) the harness reads. */
173
- type FleetManifest = {
174
- adminBase?: string;
175
- services: Record<string, {
176
- protocol?: string;
177
- url?: string;
178
- adminUrl?: string;
179
- target?: string;
180
- } | undefined>;
181
- };
182
- type Endpoint = {
183
- /** The fleet entry name, e.g. `twilio`, or an alias such as `push`. */
184
- name: string;
185
- /** Null until the emulator's health route has told us what it is. */
186
- service: ServiceKind | null;
187
- /** Absolute admin prefix, e.g. `http://127.0.0.1:8798/__admin`. */
188
- adminUrl: string;
189
- fetch: FetchLike;
190
- };
191
- /**
192
- * An emulator whose admin API the dashboard fronts. Unlike {@link Endpoint} this is every HTTP
193
- * emulator, messaging or not (stripe, cognito, …).
194
- */
195
- type AdminTarget = {
196
- /** The fleet entry name, e.g. `stripe`, or an alias such as `push`. */
197
- name: string;
198
- /** The emulator it runs, e.g. `fcm` for the alias `push`. The name when nobody said. */
199
- target: string;
200
- /** Absolute admin prefix, e.g. `http://127.0.0.1:8798/__admin`. */
201
- adminUrl: string;
202
- fetch: FetchLike;
203
- };
204
-
205
- type HarnessOptions = {
206
- /** A running fleet controller's `adminBase` (`http://127.0.0.1:9000/__admin/fleet`). */
207
- fleet?: string;
208
- /** A fleet ready manifest, or a function that reads the current one (re-read on every sync). */
209
- manifest?: FleetManifest | (() => FleetManifest | Promise<FleetManifest>);
210
- /** Explicit emulators by name: base URLs, `{ url, adminUrl }`, or in-process runtimes. */
211
- services?: Record<string, ServiceInput>;
212
- /**
213
- * Namespaces to watch in the background. `"all"` follows the fleet's namespace list.
214
- * Any namespace an API call or the UI asks for is watched from then on. Default `["default"]`,
215
- * or `"all"` with `fleet`.
216
- */
217
- namespaces?: "all" | string[];
218
- /** Background polling interval. `0` turns it off; reads still sync on demand. Default 750 ms. */
219
- pollIntervalMs?: number;
220
- /** Sent as `x-mockingbird-admin-key` to the fleet and every emulator. */
221
- adminKey?: string;
222
- /** Admin keys by emulator name, for emulators whose key is not `adminKey`. */
223
- adminKeys?: Record<string, string>;
224
- /**
225
- * Front every emulator's admin API on this origin, so the page shows an Emulators tab next to
226
- * Notifications. `createServer` (the `./server` entry) turns it on; pass `adminGateway()` from
227
- * that entry to turn it on for a harness you serve yourself.
228
- */
229
- admin?: AdminGatewayFactory | false;
230
- /** The tab the page opens on when it has both. Default `notifications`. */
231
- defaultTab?: "emulators" | "notifications";
232
- /** Transport for URL endpoints. Default: global `fetch`. */
233
- fetch?: FetchLike;
234
- /** Page title. */
235
- title?: string;
236
- };
237
- type AdminGatewayContext = {
238
- /** Every HTTP emulator the harness knows, messaging or not, after a fresh discovery. */
239
- targets(): Promise<AdminTarget[]>;
240
- /** The admin key header for one emulator: empty when the harness has no key for it. */
241
- headers(name: string): Record<string, string>;
242
- title: string;
243
- };
244
- type AdminGateway = {
245
- /** The admin UI's mount config for the current emulators; null when there are none. */
246
- config(): Promise<Record<string, unknown> | null>;
247
- /** Everything under `/admin/`: the admin UI script and each emulator's admin API. */
248
- fetch(request: Request): Promise<Response>;
249
- };
250
- type AdminGatewayFactory = (context: AdminGatewayContext) => AdminGateway;
251
- type WaitOptions = {
252
- timeoutMs?: number;
253
- count?: number;
254
- };
255
- type NotificationHarness = {
256
- /** The harness UI and JSON API as a Fetch handler. */
257
- fetch(request: Request): Promise<Response>;
258
- /** Read every emulator now. Resolves after a read that started after this call. */
259
- sync(namespace?: string): Promise<void>;
260
- /** Notifications matching `filter`, oldest first, after a fresh sync. */
261
- list(filter?: NotificationFilter): Promise<Notification[]>;
262
- /** Resolve once at least `count` (default 1) notifications match; reject after `timeoutMs`. */
263
- waitFor(filter: NotificationFilter, options?: WaitOptions): Promise<Notification[]>;
264
- sources(): SourceStatus[];
265
- close(): void;
266
- };
267
- declare const createNotificationHarness: (options?: HarnessOptions) => NotificationHarness;
268
-
269
37
  /**
270
38
  * A small MIME reader for the raw messages SES `SendRawEmail` receives. It covers what mail
271
39
  * libraries produce (nodemailer, the AWS samples): folded headers, RFC 2047 encoded words,
@@ -284,247 +52,5 @@ type ParsedMime = {
284
52
  };
285
53
  declare const parseMime: (raw: string) => ParsedMime;
286
54
 
287
- /**
288
- * Every `data-testid` the harness UI renders, and selector helpers for browser tests.
289
- *
290
- * Elements that show one notification also carry its fields as attributes, so a test can narrow by
291
- * what it knows instead of by position:
292
- *
293
- * data-notification-id data-channel data-service data-source data-to data-from
294
- * data-status data-created-at data-unread ("true" | "false")
295
- * data-via ("whatsapp", only on WhatsApp messages)
296
- *
297
- * The UI root (`TEST_IDS.app`) reports its state the same way: `data-ready` ("true" once the first
298
- * read finished), `data-view`, `data-namespace`, `data-count`, `data-version`, `data-connected`,
299
- * `data-sound`, `data-motion`, `data-layout` ("grid" = devices side by side, "tabs" = one device at
300
- * a time) and `data-tab` (the selected channel tab: "all", "sms", "push", "email" or "chat").
301
- *
302
- * This module has no dependencies, so Playwright, Cypress or WebdriverIO specs can import it.
303
- */
304
- declare const TEST_IDS: {
305
- /** The UI root. */
306
- readonly app: "notifications-app";
307
- readonly topbar: "topbar";
308
- /** `<select>` of namespaces. */
309
- readonly namespace: "namespace";
310
- /** Filter `<input>` (recipient, sender, text). */
311
- readonly search: "search";
312
- /** View tabs; `aria-pressed="true"` on the active one. */
313
- readonly viewDevices: "view-devices";
314
- readonly viewTimeline: "view-timeline";
315
- /** "Follow new" checkbox. */
316
- readonly follow: "follow";
317
- /** Sound on/off button; `aria-pressed`. */
318
- readonly sound: "sound-toggle";
319
- /** Live stream indicator; `data-state="live" | "reconnecting"`. */
320
- readonly connection: "connection";
321
- /** One pill per emulator; `data-name`, `data-service`, `data-ok`, `data-count`. */
322
- readonly source: "source";
323
- /** Discovery or emulator errors, or the "no emulators" hint; `data-kind="error" | "empty"`. */
324
- readonly notice: "notice";
325
- /** Bottom-left message after an action, e.g. "Conversation archived." */
326
- readonly toast: "toast";
327
- readonly toastUndo: "toast-undo";
328
- /** The `role="tablist"` that switches between devices; `data-layout="grid" | "tabs"`. */
329
- readonly channelTabs: "channel-tabs";
330
- /** One `role="tab"`; `data-value="all" | "sms" | "push" | "email" | "chat"`, `aria-selected`, `data-unread` (a count). */
331
- readonly channelTab: "channel-tab";
332
- /** Unread badge on a tab whose device is not showing its newest arrivals (absent when 0). */
333
- readonly channelTabUnread: "channel-tab-unread";
334
- /** The phone; `data-screen="threads" | "conversation"`, `data-recipient`, `data-thread`, and `data-via="whatsapp"` while a WhatsApp chat is open. */
335
- readonly smsDevice: "sms-device";
336
- /** Phone number `<select>`; option values are E.164 numbers. */
337
- readonly smsRecipient: "sms-recipient";
338
- /** Unread SMS badge next to the column title (absent when 0). */
339
- readonly smsUnreadCount: "sms-unread-count";
340
- /** One conversation in the list; `data-from` (the sender address), `data-unread`, `data-pinned`, `data-muted`, `data-via`. */
341
- readonly smsThread: "sms-thread";
342
- readonly smsThreadName: "sms-thread-name";
343
- readonly smsThreadPreview: "sms-thread-preview";
344
- readonly smsThreadTime: "sms-thread-time";
345
- readonly smsThreadUnread: "sms-thread-unread";
346
- /** "WhatsApp" label on a WhatsApp conversation in the list. */
347
- readonly smsThreadVia: "sms-thread-via";
348
- /** Swipe actions behind a thread (also reachable with the keyboard: focus the thread, press Delete). */
349
- readonly smsThreadDelete: "sms-thread-delete";
350
- readonly smsThreadMute: "sms-thread-mute";
351
- readonly smsThreadPin: "sms-thread-pin";
352
- readonly smsThreadToggleUnread: "sms-thread-toggle-unread";
353
- /** Shown when the phone has no messages. */
354
- readonly smsEmpty: "sms-empty";
355
- /** An open conversation; `data-from`, `data-via="sms" | "whatsapp"`. */
356
- readonly smsConversation: "sms-conversation";
357
- readonly smsConversationTitle: "sms-conversation-title";
358
- readonly smsBack: "sms-back";
359
- /** One message; carries the notification attributes plus `data-code` when it holds a one-time code. */
360
- readonly smsBubble: "sms-bubble";
361
- readonly smsBubbleMedia: "sms-bubble-media";
362
- /** The time revealed by swiping the conversation left. */
363
- readonly smsBubbleTime: "sms-bubble-time";
364
- /** A reaction added with the long-press menu; `data-tapback`. */
365
- readonly smsTapback: "sms-tapback";
366
- /** Centered date stamp between messages. */
367
- readonly smsTimestamp: "sms-timestamp";
368
- /** One-time code suggestion above the keyboard; `data-code`. */
369
- readonly smsCode: "sms-code";
370
- /** Long-press menu on a bubble. */
371
- readonly smsMenu: "sms-menu";
372
- readonly smsMenuCopy: "sms-menu-copy";
373
- /** One tapback in the menu; `data-tapback="heart" | "like" | "dislike" | "laugh" | "emphasize" | "question"`. */
374
- readonly smsMenuTapback: "sms-menu-tapback";
375
- /** The phone; `data-skin="ios" | "android"`, `data-recipient`, `data-platform`. */
376
- readonly pushDevice: "push-device";
377
- /** Device token `<select>`. */
378
- readonly pushRecipient: "push-recipient";
379
- /** Skin buttons; `data-value`, `aria-pressed`. */
380
- readonly pushSkin: "push-skin";
381
- readonly pushUnreadCount: "push-unread-count";
382
- /** One notification; notification attributes plus `data-expanded`, `data-platform`, `data-app`, `data-stacked`. */
383
- readonly pushNotification: "push-notification";
384
- readonly pushNotificationApp: "push-notification-app";
385
- readonly pushNotificationTitle: "push-notification-title";
386
- readonly pushNotificationBody: "push-notification-body";
387
- readonly pushNotificationTime: "push-notification-time";
388
- readonly pushNotificationImage: "push-notification-image";
389
- /** The `data` payload, shown when expanded. */
390
- readonly pushNotificationData: "push-notification-data";
391
- /** Service, status, badge and sound, shown when expanded. */
392
- readonly pushNotificationMeta: "push-notification-meta";
393
- /** iOS: a group of notifications from one app; `data-app`, `data-count`, `data-open`. */
394
- readonly pushGroup: "push-group";
395
- /** iOS: "N more notifications" under a collapsed group (click to open it); `data-count`. */
396
- readonly pushGroupMore: "push-group-more";
397
- /** iOS: "Show less" on an open group. */
398
- readonly pushGroupCollapse: "push-group-collapse";
399
- /** iOS: swipe-left actions. */
400
- readonly pushClear: "push-clear";
401
- readonly pushOptions: "push-options";
402
- /** iOS long-press preview; Android long-press settings. */
403
- readonly pushPreview: "push-preview";
404
- readonly pushSettings: "push-settings";
405
- /** Android "Clear all". */
406
- readonly pushClearAll: "push-clear-all";
407
- readonly pushEmpty: "push-empty";
408
- /** The browser window; `data-screen="inbox" | "message"`, `data-recipient`. */
409
- readonly emailDevice: "email-device";
410
- /** Mailbox `<select>`; option values are lower-case addresses. */
411
- readonly emailRecipient: "email-recipient";
412
- readonly emailUnreadCount: "email-unread-count";
413
- /** One inbox row; notification attributes plus `data-starred`. */
414
- readonly emailRow: "email-row";
415
- readonly emailRowFrom: "email-row-from";
416
- readonly emailRowSubject: "email-row-subject";
417
- readonly emailRowSnippet: "email-row-snippet";
418
- readonly emailRowDate: "email-row-date";
419
- readonly emailRowService: "email-row-service";
420
- readonly emailRowAttachment: "email-row-attachment";
421
- readonly emailRowStar: "email-row-star";
422
- /** Hover actions on a row. */
423
- readonly emailRowArchive: "email-row-archive";
424
- readonly emailRowDelete: "email-row-delete";
425
- readonly emailRowToggleRead: "email-row-toggle-read";
426
- readonly emailRefresh: "email-refresh";
427
- readonly emailEmpty: "email-empty";
428
- /** The open message; notification attributes. */
429
- readonly emailOpen: "email-open";
430
- readonly emailBack: "email-back";
431
- readonly emailArchive: "email-archive";
432
- readonly emailDelete: "email-delete";
433
- readonly emailMarkUnread: "email-mark-unread";
434
- readonly emailSubject: "email-subject";
435
- readonly emailFromName: "email-from-name";
436
- readonly emailFromAddress: "email-from-address";
437
- /** "to me, …" line; click to toggle the details. */
438
- readonly emailTo: "email-to";
439
- readonly emailDate: "email-date";
440
- readonly emailDetails: "email-details";
441
- /** One row of the details; `data-field="from" | "to" | "cc" | "bcc" | "reply-to" | "date" | "subject" | "mailed-by" | "message-id"`. */
442
- readonly emailDetail: "email-detail";
443
- /** The HTML body `<iframe>` (same origin: use `frameLocator`). */
444
- readonly emailBody: "email-body";
445
- /** The plain-text body when there is no HTML. */
446
- readonly emailText: "email-text";
447
- readonly emailAttachments: "email-attachments";
448
- /** One attachment; `data-filename`, `data-content-type`, `data-size`. */
449
- readonly emailAttachment: "email-attachment";
450
- /** The chat window; `data-recipient` (the open channel), `data-workspace`. */
451
- readonly chatDevice: "chat-device";
452
- /** Channel `<select>`; option values are channel names (`#alerts`) or webhook paths. */
453
- readonly chatRecipient: "chat-recipient";
454
- readonly chatUnreadCount: "chat-unread-count";
455
- readonly chatWorkspace: "chat-workspace";
456
- /** One channel in the sidebar; `data-to`, `data-unread` (a count), `aria-current`. */
457
- readonly chatChannel: "chat-channel";
458
- /** The open channel's name in the header. */
459
- readonly chatTitle: "chat-title";
460
- /** One message; notification attributes plus `data-method`, `data-ephemeral`, `data-thread`. */
461
- readonly chatMessage: "chat-message";
462
- readonly chatMessageAuthor: "chat-message-author";
463
- readonly chatMessageTime: "chat-message-time";
464
- /** The message text, with mrkdwn formatting applied. */
465
- readonly chatMessageText: "chat-message-text";
466
- /** Block Kit blocks; each block inside carries `data-block="<type>"`. */
467
- readonly chatMessageBlocks: "chat-message-blocks";
468
- /** Legacy attachments; each one inside carries `data-color`. */
469
- readonly chatMessageAttachments: "chat-message-attachments";
470
- /** One reaction; `data-name`, `data-count`. */
471
- readonly chatMessageReaction: "chat-message-reaction";
472
- readonly chatEmpty: "chat-empty";
473
- readonly timeline: "timeline";
474
- /** One row; notification attributes. Click it to inspect. */
475
- readonly timelineRow: "timeline-row";
476
- readonly timelineEmpty: "timeline-empty";
477
- /** The JSON inspector; notification attributes. Opened by clicking a timeline row or double-clicking any notification. */
478
- readonly inspector: "inspector";
479
- readonly inspectorTitle: "inspector-title";
480
- readonly inspectorClose: "inspector-close";
481
- readonly inspectorShowOnDevice: "inspector-show-on-device";
482
- /** One normalized field; `data-field`. */
483
- readonly inspectorField: "inspector-field";
484
- /** The full record, normalized fields plus `raw`, as JSON text. */
485
- readonly inspectorJson: "inspector-json";
486
- /** The dashboard root; `data-tab` is the open tab's id. */
487
- readonly dashboard: "dashboard";
488
- /** One tab button; `data-tab` (`emulators`, `notifications`, or an embedder's id), `aria-selected`. */
489
- readonly dashboardTab: "dashboard-tab";
490
- /** One tab's panel; `data-tab`. Hidden unless its tab is open. */
491
- readonly dashboardPanel: "dashboard-panel";
492
- /** Notifications that arrived while another tab was open; `data-count`. Hidden at 0. */
493
- readonly dashboardBadge: "dashboard-badge";
494
- };
495
- type TestId = (typeof TEST_IDS)[keyof typeof TEST_IDS];
496
- /** CSS selectors for the harness UI. Each one works with `page.locator()` or `querySelector`. */
497
- declare const selectors: {
498
- /** `[data-testid="…"]` */
499
- testId: (id: TestId) => string;
500
- /** The ready UI root: wait for this before asserting. */
501
- ready: () => string;
502
- /** Any element showing this notification (bubble, thread, card, row, open email, timeline row). */
503
- notification: (id: string) => string;
504
- /** A message bubble, optionally from one sender. */
505
- smsBubble: (filter?: {
506
- from?: string;
507
- id?: string;
508
- }) => string;
509
- /** A conversation in the Messages list. */
510
- smsThread: (from: string) => string;
511
- /** A channel tab: `"all"`, `"sms"`, `"push"`, `"email"` or `"chat"`. */
512
- channelTab: (value: "all" | "sms" | "push" | "email" | "chat") => string;
513
- /** A chat message, optionally by id. */
514
- chatMessage: (id?: string) => string;
515
- /** A channel in the chat sidebar. */
516
- chatChannel: (to: string) => string;
517
- /** A push notification card, optionally by id. */
518
- pushNotification: (id?: string) => string;
519
- /** An inbox row, optionally by id. */
520
- emailRow: (id?: string) => string;
521
- /** A timeline row, optionally by id. */
522
- timelineRow: (id?: string) => string;
523
- /** A dashboard tab button by tab id (`emulators`, `notifications`, …). */
524
- dashboardTab: (id: string) => string;
525
- /** A dashboard tab's panel by tab id. */
526
- dashboardPanel: (id: string) => string;
527
- };
528
-
529
- export { CHANNELS, NotificationClient, SERVICE_KINDS, SERVICE_LABELS, TEST_IDS, createNotificationHarness, matches, parseMime, selectors };
530
- export type { Address, AdminGateway, AdminGatewayContext, AdminGatewayFactory, AdminTarget, Channel, ChatContent, ChatReaction, EmailAttachment, EmailContent, Endpoint, FetchLike, FleetManifest, HarnessOptions, Notification, NotificationClientOptions, NotificationFilter, NotificationHarness, PushContent, PushPlatform, ServiceInput, ServiceKind, SmsContent, SourceStatus, TestId, WaitOptions };
55
+ export { Channel, EmailAttachment, Notification, NotificationClient, NotificationFilter, SourceStatus, parseMime };
56
+ export type { NotificationClientOptions };
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  TEST_IDS,
3
3
  selectors
4
- } from "./chunk-FBJ2DRHH.js";
4
+ } from "./chunk-OR6VYHWA.js";
5
5
  import {
6
6
  createNotificationHarness,
7
7
  parseMime
8
- } from "./chunk-GHIEYY5B.js";
8
+ } from "./chunk-ZRI5NLWC.js";
9
9
  import {
10
10
  CHANNELS,
11
11
  SERVICE_KINDS,
12
12
  SERVICE_LABELS,
13
13
  filterToSearch,
14
14
  matches
15
- } from "./chunk-3HF2NSFV.js";
15
+ } from "./chunk-4BPQC52H.js";
16
16
 
17
17
  // src/client.ts
18
18
  var NotificationClient = class {