@classytic/notifications 0.0.1 → 2.0.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 +70 -0
- package/README.md +640 -280
- package/dist/channels/index.d.mts +2 -0
- package/dist/channels/index.mjs +3 -0
- package/dist/errors-FYJYmfvj.mjs +36 -0
- package/dist/index.d.mts +136 -0
- package/dist/index.mjs +458 -0
- package/dist/push.channel-4mRkzrEu.d.mts +55 -0
- package/dist/push.channel-D1FdTPUi.mjs +468 -0
- package/dist/status-webhook-BDaI1BMy.d.mts +268 -0
- package/dist/status-webhook-XY42DCj_.mjs +582 -0
- package/dist/types-D94B3VNX.d.mts +546 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.mjs +4 -0
- package/package.json +75 -57
- package/notifications.d.ts +0 -269
- package/src/core/channel.js +0 -71
- package/src/core/dispatcher.js +0 -73
- package/src/core/factory.js +0 -92
- package/src/index.js +0 -36
- package/src/utils/merge-hooks.js +0 -45
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@classytic/notifications` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [2.0.0] - 2026-03-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `SmsChannel` and `PushChannel` with bring-your-own-provider integrations
|
|
10
|
+
- Rate limiting, delivery logging, and queue-backed delivery
|
|
11
|
+
- Built-in template resolver via `createSimpleResolver()`
|
|
12
|
+
- Channel fallback with `withFallback()`
|
|
13
|
+
- Delayed delivery via `payload.delay`
|
|
14
|
+
- Status webhook helper via `createStatusHandler()`
|
|
15
|
+
- Provider adapter examples and observability notes
|
|
16
|
+
- `DispatchResult.queued` plus `send:rate_limited` and `send:queued` events
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Skipped notifications now go through delivery logging and lifecycle events
|
|
21
|
+
- `EmailChannel` now protects critical mail fields from being overridden by defaults
|
|
22
|
+
- `pMap()` now validates invalid concurrency values
|
|
23
|
+
- `MemoryQueue.drain()` now cancels delayed jobs correctly
|
|
24
|
+
- `WebhookChannel` now uses a static `node:crypto` import
|
|
25
|
+
- Queue processing is owned by the service when a queue adapter is attached
|
|
26
|
+
- `withFallback()` now works correctly with queued delivery
|
|
27
|
+
- Bumped `tsdown` to v0.21.4
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- `batchBcc` from `EmailChannelConfig`
|
|
32
|
+
- `priority` from `QueueEnqueueOptions`
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
- `nodemailer >=6` remains the only optional peer dependency
|
|
37
|
+
|
|
38
|
+
## [1.1.0] - 2026-02-24
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- **EmailChannel** — Send email notifications via Nodemailer (SMTP, Gmail, SES, any transport)
|
|
43
|
+
- Lazy nodemailer import (zero overhead if unused)
|
|
44
|
+
- Pre-created transporter support for SES and custom transports
|
|
45
|
+
- `verify()` method for SMTP connection health checks
|
|
46
|
+
- `close()` method for graceful shutdown
|
|
47
|
+
- Attachments, CC/BCC, reply-to, custom `from` per-send
|
|
48
|
+
- **EmailChannel types** — `EmailChannelConfig`, `SmtpTransportOptions`, `EmailAttachment`, `NodemailerTransporter`
|
|
49
|
+
- **`QuietHoursConfig` type export** — Now available for consumers using `isQuietHours()` directly
|
|
50
|
+
|
|
51
|
+
## [1.0.0] - 2026-02-20
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
|
|
55
|
+
- **NotificationService** — Central orchestrator with send, batch send, hook factories, and lifecycle events
|
|
56
|
+
- **WebhookChannel** — HTTP POST/PUT with HMAC-SHA256 signing, custom headers, timeout (zero deps, native fetch)
|
|
57
|
+
- **ConsoleChannel** — Logs to console for development and testing
|
|
58
|
+
- **BaseChannel** — Abstract base class with event filtering and wildcard support (`user.*`)
|
|
59
|
+
- **Templates** — Pluggable template resolver (React Email, MJML, Handlebars, etc.)
|
|
60
|
+
- **Retry + Backoff** — Exponential, linear, or fixed backoff with jitter; per-channel overrides
|
|
61
|
+
- **User Preferences** — Per-user, per-event, per-channel opt-in/out with quiet hours
|
|
62
|
+
- **Quiet Hours** — Timezone-aware quiet period enforcement via `Intl.DateTimeFormat` (zero deps)
|
|
63
|
+
- **Idempotency** — Built-in deduplication with pluggable stores (memory default, Redis/DB via interface)
|
|
64
|
+
- **Batch Sending** — Worker-pool concurrency (`pMap`) with progress callback
|
|
65
|
+
- **Lifecycle Events** — `before:send` (fail-fast), `after:send`, `send:success`, `send:failed`, `send:retry`
|
|
66
|
+
- **Hook Factories** — `createHooks()` + `mergeHooks()` for EventEmitter/MongoKit/custom integration
|
|
67
|
+
- **Error Classes** — `NotificationError`, `ChannelError`, `ProviderNotInstalledError`
|
|
68
|
+
- **Utilities** — `withRetry`, `calculateDelay`, `resolveRetryConfig`, `Emitter`, `pMap`, `isQuietHours`, `MemoryIdempotencyStore`
|
|
69
|
+
- Full TypeScript types with ESM-only output
|
|
70
|
+
- Zero required dependencies (nodemailer is optional peer)
|