@classytic/notifications 0.0.1 → 1.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 +37 -0
- package/README.md +490 -280
- package/dist/channels/index.d.mts +2 -0
- package/dist/channels/index.mjs +3 -0
- package/dist/concurrency-CV_XyiBQ.d.mts +139 -0
- package/dist/console.channel-BoWi_5nH.d.mts +39 -0
- package/dist/console.channel-CfA4b_Er.mjs +246 -0
- package/dist/errors-DAIVZx_Q.mjs +36 -0
- package/dist/index.d.mts +116 -0
- package/dist/index.mjs +369 -0
- package/dist/merge-hooks-B4_uHR9x.mjs +233 -0
- package/dist/types-BnjZ7x2U.d.mts +297 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.mjs +4 -0
- package/package.json +73 -55
- 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,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@classytic/notifications` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.1.0] - 2026-02-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **EmailChannel** — Send email notifications via Nodemailer (SMTP, Gmail, SES, any transport)
|
|
10
|
+
- Lazy nodemailer import (zero overhead if unused)
|
|
11
|
+
- Pre-created transporter support for SES and custom transports
|
|
12
|
+
- `verify()` method for SMTP connection health checks
|
|
13
|
+
- `close()` method for graceful shutdown
|
|
14
|
+
- Attachments, CC/BCC, reply-to, custom `from` per-send
|
|
15
|
+
- **EmailChannel types** — `EmailChannelConfig`, `SmtpTransportOptions`, `EmailAttachment`, `NodemailerTransporter`
|
|
16
|
+
- **`QuietHoursConfig` type export** — Now available for consumers using `isQuietHours()` directly
|
|
17
|
+
|
|
18
|
+
## [1.0.0] - 2026-02-20
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **NotificationService** — Central orchestrator with send, batch send, hook factories, and lifecycle events
|
|
23
|
+
- **WebhookChannel** — HTTP POST/PUT with HMAC-SHA256 signing, custom headers, timeout (zero deps, native fetch)
|
|
24
|
+
- **ConsoleChannel** — Logs to console for development and testing
|
|
25
|
+
- **BaseChannel** — Abstract base class with event filtering and wildcard support (`user.*`)
|
|
26
|
+
- **Templates** — Pluggable template resolver (React Email, MJML, Handlebars, etc.)
|
|
27
|
+
- **Retry + Backoff** — Exponential, linear, or fixed backoff with jitter; per-channel overrides
|
|
28
|
+
- **User Preferences** — Per-user, per-event, per-channel opt-in/out with quiet hours
|
|
29
|
+
- **Quiet Hours** — Timezone-aware quiet period enforcement via `Intl.DateTimeFormat` (zero deps)
|
|
30
|
+
- **Idempotency** — Built-in deduplication with pluggable stores (memory default, Redis/DB via interface)
|
|
31
|
+
- **Batch Sending** — Worker-pool concurrency (`pMap`) with progress callback
|
|
32
|
+
- **Lifecycle Events** — `before:send` (fail-fast), `after:send`, `send:success`, `send:failed`, `send:retry`
|
|
33
|
+
- **Hook Factories** — `createHooks()` + `mergeHooks()` for EventEmitter/MongoKit/custom integration
|
|
34
|
+
- **Error Classes** — `NotificationError`, `ChannelError`, `ProviderNotInstalledError`
|
|
35
|
+
- **Utilities** — `withRetry`, `calculateDelay`, `resolveRetryConfig`, `Emitter`, `pMap`, `isQuietHours`, `MemoryIdempotencyStore`
|
|
36
|
+
- Full TypeScript types with ESM-only output
|
|
37
|
+
- Zero required dependencies (nodemailer is optional peer)
|