@classytic/notifications 1.2.0 → 2.1.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.
@@ -0,0 +1,572 @@
1
+ //#region src/utils/rate-limiter.d.ts
2
+ /**
3
+ * Rate Limiter (Token Bucket)
4
+ * @module @classytic/notifications/utils
5
+ *
6
+ * Per-channel rate limiting using the token bucket algorithm.
7
+ * Prevents exceeding provider limits (e.g., Gmail 500/day, SendGrid 100/sec).
8
+ *
9
+ * Ships with an in-memory store; implement RateLimitStore for
10
+ * Redis or other distributed backends.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { EmailChannel } from '@classytic/notifications/channels';
15
+ *
16
+ * const email = new EmailChannel({
17
+ * from: 'noreply@app.com',
18
+ * transport: { service: 'gmail', auth: { user, pass } },
19
+ * rateLimit: {
20
+ * maxPerWindow: 500, // max 500 emails
21
+ * windowMs: 86_400_000, // per day (24h)
22
+ * },
23
+ * });
24
+ * ```
25
+ */
26
+ /** Rate limit configuration for a channel */
27
+ interface RateLimitConfig {
28
+ /** Maximum sends allowed within the time window */
29
+ maxPerWindow: number;
30
+ /** Time window in milliseconds (e.g., 60_000 for 1 minute) */
31
+ windowMs: number;
32
+ }
33
+ /** Interface for pluggable rate limit stores (Redis, DB, etc.) */
34
+ interface RateLimitStore {
35
+ /** Record a send and return whether it was allowed */
36
+ consume(channelName: string, config: RateLimitConfig): boolean | Promise<boolean>;
37
+ /** Get remaining tokens for a channel */
38
+ remaining(channelName: string, config: RateLimitConfig): number | Promise<number>;
39
+ /** Reset rate limit state for a channel */
40
+ reset(channelName: string): void | Promise<void>;
41
+ }
42
+ /**
43
+ * In-memory sliding window rate limiter.
44
+ *
45
+ * Tracks timestamps of recent sends per channel and checks
46
+ * against the configured window. Suitable for single-process apps.
47
+ * For distributed systems, implement `RateLimitStore` with Redis.
48
+ */
49
+ declare class MemoryRateLimitStore implements RateLimitStore {
50
+ private windows;
51
+ consume(channelName: string, config: RateLimitConfig): boolean;
52
+ remaining(channelName: string, config: RateLimitConfig): number;
53
+ reset(channelName: string): void;
54
+ /** Get only the timestamps that fall within the current window */
55
+ private getActive;
56
+ }
57
+ //#endregion
58
+ //#region src/utils/idempotency.d.ts
59
+ /**
60
+ * Idempotency / deduplication utilities
61
+ * @module @classytic/notifications/utils
62
+ *
63
+ * Prevents duplicate notification delivery using idempotency keys.
64
+ * Ships with an in-memory store; implement IdempotencyStore for
65
+ * Redis, database, or other distributed backends.
66
+ */
67
+ /**
68
+ * Interface for idempotency stores.
69
+ *
70
+ * Methods may be sync or async to support both in-memory and
71
+ * distributed backends (Redis, DB).
72
+ */
73
+ interface IdempotencyStore {
74
+ /** Check if a key has been seen (within TTL) */
75
+ has(key: string): boolean | Promise<boolean>;
76
+ /** Record a key with TTL in milliseconds */
77
+ set(key: string, ttlMs: number): void | Promise<void>;
78
+ }
79
+ /**
80
+ * In-memory idempotency store with TTL-based expiry.
81
+ *
82
+ * Suitable for single-process apps. For distributed systems,
83
+ * implement `IdempotencyStore` with Redis or your database.
84
+ *
85
+ * Expired entries are lazily cleaned up every `cleanupInterval` writes.
86
+ */
87
+ declare class MemoryIdempotencyStore implements IdempotencyStore {
88
+ private store;
89
+ private cleanupCounter;
90
+ private readonly cleanupInterval;
91
+ constructor(options?: {
92
+ cleanupInterval?: number;
93
+ });
94
+ has(key: string): boolean;
95
+ set(key: string, ttlMs: number): void;
96
+ /** Number of entries (including possibly expired) */
97
+ get size(): number;
98
+ /** Remove all entries */
99
+ clear(): void;
100
+ private maybeCleanup;
101
+ }
102
+ /** Default TTL for idempotency keys (24 hours) */
103
+ declare const IDEMPOTENCY_DEFAULT_TTL: number;
104
+ //#endregion
105
+ //#region src/utils/delivery-log.d.ts
106
+ /** A single delivery log entry */
107
+ interface DeliveryLogEntry {
108
+ /** Unique log entry ID */
109
+ id: string;
110
+ /** Timestamp of the delivery attempt */
111
+ timestamp: Date;
112
+ /** Event name */
113
+ event: string;
114
+ /** Recipient ID (if available) */
115
+ recipientId?: string;
116
+ /** Recipient email (if available) */
117
+ recipientEmail?: string;
118
+ /** Channels attempted */
119
+ channels: string[];
120
+ /** Per-channel results */
121
+ results: SendResult[];
122
+ /** Overall status */
123
+ status: 'delivered' | 'partial' | 'failed';
124
+ /** Total duration in ms */
125
+ duration: number;
126
+ /** Original payload metadata */
127
+ metadata?: Record<string, unknown>;
128
+ }
129
+ /** Query filter for delivery log entries */
130
+ interface DeliveryLogQuery {
131
+ recipientId?: string;
132
+ recipientEmail?: string;
133
+ event?: string;
134
+ channel?: string;
135
+ status?: 'delivered' | 'partial' | 'failed';
136
+ /** Only entries after this date */
137
+ after?: Date;
138
+ /** Only entries before this date */
139
+ before?: Date;
140
+ /** Max entries to return (default: 100) */
141
+ limit?: number;
142
+ }
143
+ /** Interface for pluggable delivery log stores (MongoDB, Postgres, etc.) */
144
+ interface DeliveryLog {
145
+ /** Record a delivery attempt */
146
+ record(payload: NotificationPayload, dispatch: DispatchResult): void | Promise<void>;
147
+ /** Query delivery history */
148
+ query(filter: DeliveryLogQuery): DeliveryLogEntry[] | Promise<DeliveryLogEntry[]>;
149
+ /** Get a specific log entry by ID */
150
+ get(id: string): DeliveryLogEntry | null | Promise<DeliveryLogEntry | null>;
151
+ }
152
+ /**
153
+ * In-memory delivery log with query support.
154
+ *
155
+ * Keeps entries in memory with optional max size (evicts oldest).
156
+ * For production, implement `DeliveryLog` with your database.
157
+ */
158
+ declare class MemoryDeliveryLog implements DeliveryLog {
159
+ private entries;
160
+ private readonly maxEntries;
161
+ constructor(options?: {
162
+ maxEntries?: number;
163
+ });
164
+ record(payload: NotificationPayload, dispatch: DispatchResult): void;
165
+ query(filter: DeliveryLogQuery): DeliveryLogEntry[];
166
+ get(id: string): DeliveryLogEntry | null;
167
+ /** Get total number of entries */
168
+ get size(): number;
169
+ /** Clear all entries */
170
+ clear(): void;
171
+ private resolveStatus;
172
+ }
173
+ //#endregion
174
+ //#region src/utils/queue.d.ts
175
+ /** Status of a queued job */
176
+ type QueueJobStatus = 'pending' | 'processing' | 'completed' | 'failed';
177
+ /** A queued notification job */
178
+ interface QueueJob {
179
+ id: string;
180
+ payload: NotificationPayload;
181
+ status: QueueJobStatus;
182
+ attempts: number;
183
+ maxAttempts: number;
184
+ createdAt: Date;
185
+ updatedAt: Date;
186
+ error?: string;
187
+ }
188
+ /** Queue adapter interface — implement for BullMQ, Redis, DB, etc. */
189
+ interface QueueAdapter {
190
+ /**
191
+ * Enqueue a notification for later processing.
192
+ * Returns a job ID for tracking.
193
+ */
194
+ enqueue(payload: NotificationPayload, options?: QueueEnqueueOptions): string | Promise<string>;
195
+ /**
196
+ * Process queued jobs. Called by the service when queue is attached.
197
+ * The processor function is the service's internal send pipeline.
198
+ */
199
+ process(processor: QueueProcessor): void | Promise<void>;
200
+ /** Get job by ID */
201
+ getJob(id: string): QueueJob | null | Promise<QueueJob | null>;
202
+ /** Get queue size (pending + processing) */
203
+ size(): number | Promise<number>;
204
+ /** Pause processing */
205
+ pause(): void | Promise<void>;
206
+ /** Resume processing */
207
+ resume(): void | Promise<void>;
208
+ /** Drain the queue (remove all pending jobs) */
209
+ drain(): void | Promise<void>;
210
+ }
211
+ /** Options for enqueuing a notification */
212
+ interface QueueEnqueueOptions {
213
+ /** Delay before processing (ms) */
214
+ delay?: number;
215
+ /** Max processing attempts (default: 3) */
216
+ maxAttempts?: number;
217
+ }
218
+ /** Processor function called by the queue for each job */
219
+ type QueueProcessor = (payload: NotificationPayload) => Promise<void>;
220
+ /**
221
+ * In-memory queue for development and testing.
222
+ *
223
+ * Jobs are processed immediately in FIFO order with concurrency control.
224
+ * **Not crash-resilient** — use BullMQ or a database-backed adapter for production.
225
+ */
226
+ declare class MemoryQueue implements QueueAdapter {
227
+ private jobs;
228
+ private pending;
229
+ private processor;
230
+ private paused;
231
+ private readonly concurrency;
232
+ private activeCount;
233
+ private delayTimers;
234
+ constructor(options?: {
235
+ concurrency?: number;
236
+ });
237
+ enqueue(payload: NotificationPayload, options?: QueueEnqueueOptions): string;
238
+ process(processor: QueueProcessor): void;
239
+ getJob(id: string): QueueJob | null;
240
+ size(): number;
241
+ pause(): void;
242
+ resume(): void;
243
+ drain(): void;
244
+ /** Get all jobs (for testing/debugging) */
245
+ getAllJobs(): QueueJob[];
246
+ /** Clear all jobs and cancel all timers */
247
+ clear(): void;
248
+ private drain_queue;
249
+ }
250
+ //#endregion
251
+ //#region src/types.d.ts
252
+ /**
253
+ * @classytic/notifications - Type Definitions
254
+ *
255
+ * Multi-channel notification system with pluggable providers
256
+ *
257
+ * @module @classytic/notifications
258
+ */
259
+ /** Notification recipient */
260
+ interface Recipient {
261
+ id?: string;
262
+ email?: string;
263
+ phone?: string;
264
+ name?: string;
265
+ deviceToken?: string;
266
+ metadata?: Record<string, unknown>;
267
+ }
268
+ /** Notification payload sent through the service */
269
+ interface NotificationPayload {
270
+ /** Event name that triggered this notification */
271
+ event: string;
272
+ /** Recipient information */
273
+ recipient: Recipient;
274
+ /** Data for templates and channels */
275
+ data: Record<string, unknown>;
276
+ /** Template ID to resolve before sending */
277
+ template?: string;
278
+ /** Target specific channels by name (omit to send to all matching) */
279
+ channels?: string[];
280
+ /** Arbitrary metadata (passed through to results) */
281
+ metadata?: Record<string, unknown>;
282
+ /** Idempotency key — duplicate sends with the same key are skipped */
283
+ idempotencyKey?: string;
284
+ /** Delay delivery by this many milliseconds (requires queue adapter) */
285
+ delay?: number;
286
+ }
287
+ /** Result from a single channel send */
288
+ interface SendResult {
289
+ status: 'sent' | 'skipped' | 'failed';
290
+ channel: string;
291
+ duration?: number;
292
+ error?: string;
293
+ metadata?: Record<string, unknown>;
294
+ }
295
+ /** Result from dispatching to all channels */
296
+ interface DispatchResult {
297
+ event: string;
298
+ results: SendResult[];
299
+ sent: number;
300
+ failed: number;
301
+ skipped: number;
302
+ duration: number;
303
+ /** True when the notification was enqueued (not yet processed) */
304
+ queued?: boolean;
305
+ }
306
+ /** Base channel configuration */
307
+ interface ChannelConfig {
308
+ /** Channel name (defaults to class name) */
309
+ name?: string;
310
+ /** Enable/disable this channel */
311
+ enabled?: boolean;
312
+ /** Event whitelist (empty = handle all events) */
313
+ events?: string[];
314
+ /** Per-channel retry override */
315
+ retry?: RetryConfig;
316
+ /** Per-channel rate limiting (e.g., Gmail 500/day) */
317
+ rateLimit?: RateLimitConfig;
318
+ }
319
+ /** Channel interface - implement this for custom channels */
320
+ interface Channel {
321
+ readonly name: string;
322
+ shouldHandle(event: string): boolean;
323
+ send(payload: NotificationPayload): Promise<SendResult>;
324
+ /**
325
+ * Optional pre-flight check. Return a `SendResult` (typically with
326
+ * `status: 'skipped'`) to short-circuit before the service consumes a
327
+ * rate-limit token or starts the retry loop. Return `null` to proceed.
328
+ *
329
+ * Built-in channels use this to skip when the payload obviously can't
330
+ * be delivered (no `recipient.email` for `EmailChannel`, no
331
+ * `recipient.phone` for `SmsChannel`, etc.) so a mixed-channel batch
332
+ * doesn't burn the quota of one channel because another channel's
333
+ * recipient field is missing.
334
+ */
335
+ canSend?(payload: NotificationPayload): SendResult | null;
336
+ }
337
+ /** SMTP / Nodemailer transport options */
338
+ interface SmtpTransportOptions {
339
+ host?: string;
340
+ port?: number;
341
+ secure?: boolean;
342
+ auth?: {
343
+ user: string;
344
+ pass: string;
345
+ };
346
+ /** Nodemailer service shorthand (e.g. 'gmail', 'outlook') */
347
+ service?: string;
348
+ [key: string]: unknown;
349
+ }
350
+ /** Email attachment */
351
+ interface EmailAttachment {
352
+ filename: string;
353
+ content?: string | Buffer;
354
+ path?: string;
355
+ contentType?: string;
356
+ }
357
+ /** EmailChannel configuration */
358
+ interface EmailChannelConfig extends ChannelConfig {
359
+ /** Sender address (e.g. 'App <noreply@app.com>') */
360
+ from: string;
361
+ /** SMTP transport options (creates a Nodemailer transporter) */
362
+ transport?: SmtpTransportOptions;
363
+ /** Pre-created Nodemailer transporter (for SES, custom transports) */
364
+ transporter?: NodemailerTransporter;
365
+ /** Default mail options merged into every send */
366
+ defaults?: Record<string, unknown>;
367
+ }
368
+ /** Minimal Nodemailer transporter interface (avoids hard dep) */
369
+ interface NodemailerTransporter {
370
+ sendMail(options: Record<string, unknown>): Promise<{
371
+ messageId: string;
372
+ [key: string]: unknown;
373
+ }>;
374
+ verify?(): Promise<boolean>;
375
+ close?(): void;
376
+ }
377
+ /** WebhookChannel configuration */
378
+ interface WebhookChannelConfig extends ChannelConfig {
379
+ /** Webhook URL */
380
+ url: string;
381
+ /** Custom headers */
382
+ headers?: Record<string, string>;
383
+ /** HMAC secret for signing payloads */
384
+ secret?: string;
385
+ /** HTTP method (default: POST) */
386
+ method?: 'POST' | 'PUT';
387
+ /** Request timeout in ms (default: 10000) */
388
+ timeout?: number;
389
+ }
390
+ /** SMS provider interface (Twilio or custom) */
391
+ interface SmsProvider {
392
+ send(message: {
393
+ to: string;
394
+ from: string;
395
+ body: string;
396
+ }): Promise<{
397
+ sid: string;
398
+ }>;
399
+ }
400
+ /** SmsChannel configuration — bring your own SMS SDK */
401
+ interface SmsChannelConfig extends ChannelConfig {
402
+ /** Sender phone number or sender ID (E.164 format: +15551234567) */
403
+ from: string;
404
+ /** SMS provider implementation (Twilio, SNS, Vonage, etc.) */
405
+ provider: SmsProvider;
406
+ }
407
+ /** Push notification provider interface (FCM or custom) */
408
+ interface PushProvider {
409
+ send(message: {
410
+ token: string;
411
+ title: string;
412
+ body: string;
413
+ data?: Record<string, string>;
414
+ imageUrl?: string;
415
+ }): Promise<{
416
+ messageId: string;
417
+ }>;
418
+ }
419
+ /** PushChannel configuration — bring your own push SDK */
420
+ interface PushChannelConfig extends ChannelConfig {
421
+ /** Push provider implementation (FCM, Expo, OneSignal, APNs, etc.) */
422
+ provider: PushProvider;
423
+ }
424
+ /** Resolved template content */
425
+ interface TemplateResult {
426
+ subject?: string;
427
+ html?: string;
428
+ text?: string;
429
+ [key: string]: unknown;
430
+ }
431
+ /**
432
+ * Template resolver function
433
+ * Plug any template engine: React Email, MJML, Handlebars, etc.
434
+ */
435
+ type TemplateResolver = (templateId: string, data: Record<string, unknown>) => TemplateResult | Promise<TemplateResult>;
436
+ /** Retry configuration */
437
+ interface RetryConfig {
438
+ /** Max send attempts (default: 1 = no retry) */
439
+ maxAttempts?: number;
440
+ /** Backoff strategy (default: 'exponential') */
441
+ backoff?: 'fixed' | 'exponential' | 'linear';
442
+ /** Initial delay in ms (default: 500) */
443
+ initialDelay?: number;
444
+ /** Maximum delay in ms (default: 30000) */
445
+ maxDelay?: number;
446
+ }
447
+ /** Internal resolved retry config with defaults applied */
448
+ interface ResolvedRetryConfig {
449
+ maxAttempts: number;
450
+ backoff: 'fixed' | 'exponential' | 'linear';
451
+ initialDelay: number;
452
+ maxDelay: number;
453
+ }
454
+ /** Per-user notification preferences */
455
+ interface NotificationPreferences {
456
+ /** Channel opt-in/out: { email: true, sms: false } */
457
+ channels?: Record<string, boolean>;
458
+ /** Event opt-in/out: { 'marketing.promo': false } */
459
+ events?: Record<string, boolean>;
460
+ /** Quiet hours */
461
+ quiet?: {
462
+ start?: string;
463
+ end?: string;
464
+ timezone?: string;
465
+ };
466
+ }
467
+ /**
468
+ * Preference resolver function
469
+ * Load from DB, cache, or config
470
+ */
471
+ type PreferenceResolver = (recipientId: string, event: string) => NotificationPreferences | Promise<NotificationPreferences | null> | null;
472
+ /** Pluggable logger interface (compatible with console, pino, winston) */
473
+ interface Logger {
474
+ info(message: string, ...args: unknown[]): void;
475
+ warn(message: string, ...args: unknown[]): void;
476
+ error(message: string, ...args: unknown[]): void;
477
+ debug?(message: string, ...args: unknown[]): void;
478
+ }
479
+ /** NotificationService configuration */
480
+ interface NotificationServiceConfig {
481
+ /** Registered channels */
482
+ channels?: Channel[];
483
+ /** Template resolver (plug any engine) */
484
+ templates?: TemplateResolver;
485
+ /** Global retry config (channels can override) */
486
+ retry?: RetryConfig;
487
+ /** Preference resolver for per-user filtering */
488
+ preferences?: PreferenceResolver;
489
+ /** Logger (default: silent) */
490
+ logger?: Logger;
491
+ /** Idempotency / deduplication config */
492
+ idempotency?: {
493
+ /** Store implementation (default: MemoryIdempotencyStore) */store?: IdempotencyStore; /** TTL in milliseconds (default: 86400000 = 24h) */
494
+ ttl?: number;
495
+ };
496
+ /** Delivery log for audit trail — records every send attempt */
497
+ deliveryLog?: DeliveryLog;
498
+ /** Rate limit store (default: MemoryRateLimitStore when channels use rateLimit) */
499
+ rateLimitStore?: RateLimitStore;
500
+ /** Queue adapter for crash-resilient delivery. Service owns the queue. */
501
+ queue?: QueueAdapter;
502
+ /**
503
+ * How the queue processor signals failure back to the queue adapter.
504
+ *
505
+ * - `'throw-on-total-failure'` (default) — the processor throws
506
+ * when a dispatch had `sent === 0 && failed > 0`, so the queue
507
+ * marks the job failed (and retries up to `maxAttempts`). Partial
508
+ * successes (some channels sent) resolve normally to avoid
509
+ * double-sending the channels that already succeeded.
510
+ * - `'always-complete'` — legacy behavior. The processor never
511
+ * throws; queued jobs always resolve as completed, regardless of
512
+ * channel outcome. Keep this if your delivery log is the source
513
+ * of truth for failures and you don't want queue-level retries.
514
+ */
515
+ queueFailureMode?: 'throw-on-total-failure' | 'always-complete';
516
+ }
517
+ /** Service lifecycle events */
518
+ type ServiceEvent = 'before:send' | 'after:send' | 'send:success' | 'send:failed' | 'send:retry' | 'send:rate_limited' | 'send:queued';
519
+ /** Event handler function */
520
+ type EventHandler<T = unknown> = (data: T) => void | Promise<void>;
521
+ /** Hook config for creating event-specific handlers */
522
+ interface NotificationHookConfig<T = unknown> {
523
+ /** Event name */
524
+ event: string;
525
+ /** Target specific channels */
526
+ channels?: string[];
527
+ /** Extract recipient from event data */
528
+ getRecipient: (eventData: T) => Recipient | Promise<Recipient | null> | null;
529
+ /** Extract notification data from event data */
530
+ getData: (eventData: T) => Record<string, unknown>;
531
+ /** Template to resolve */
532
+ template?: string;
533
+ /** Enable/disable */
534
+ enabled?: boolean;
535
+ }
536
+ /** Hook handler function */
537
+ type HookHandler = (eventData: unknown) => Promise<DispatchResult | undefined>;
538
+ /** Map of event name to hook handler arrays */
539
+ type HookMap = Record<string, HookHandler[]>;
540
+ /** Options for batch sending */
541
+ interface BatchOptions {
542
+ /** Max concurrent notification sends (default: 10) */
543
+ concurrency?: number;
544
+ /** Called after each notification completes */
545
+ onProgress?: (progress: BatchProgress) => void;
546
+ }
547
+ /** Progress info emitted during batch sending */
548
+ interface BatchProgress {
549
+ /** Number of notifications completed so far */
550
+ completed: number;
551
+ /** Total number of notifications in the batch */
552
+ total: number;
553
+ /** Result of the just-completed notification */
554
+ result: DispatchResult;
555
+ }
556
+ /** Aggregated result from sending a batch of notifications */
557
+ interface BatchResult {
558
+ /** Total notifications in the batch */
559
+ total: number;
560
+ /** Total successful channel sends across all notifications */
561
+ sent: number;
562
+ /** Total failed channel sends across all notifications */
563
+ failed: number;
564
+ /** Total skipped sends (quiet hours, dedup, preferences) */
565
+ skipped: number;
566
+ /** Total wall-clock duration in ms */
567
+ duration: number;
568
+ /** Per-notification dispatch results (same order as input) */
569
+ results: DispatchResult[];
570
+ }
571
+ //#endregion
572
+ export { TemplateResult as A, DeliveryLogQuery as B, RetryConfig as C, SmsProvider as D, SmsChannelConfig as E, QueueJob as F, MemoryRateLimitStore as G, IDEMPOTENCY_DEFAULT_TTL as H, QueueJobStatus as I, RateLimitConfig as K, QueueProcessor as L, MemoryQueue as M, QueueAdapter as N, SmtpTransportOptions as O, QueueEnqueueOptions as P, DeliveryLog as R, ResolvedRetryConfig as S, ServiceEvent as T, IdempotencyStore as U, MemoryDeliveryLog as V, MemoryIdempotencyStore as W, NotificationServiceConfig as _, ChannelConfig as a, PushProvider as b, EmailChannelConfig as c, HookMap as d, Logger as f, NotificationPreferences as g, NotificationPayload as h, Channel as i, WebhookChannelConfig as j, TemplateResolver as k, EventHandler as l, NotificationHookConfig as m, BatchProgress as n, DispatchResult as o, NodemailerTransporter as p, RateLimitStore as q, BatchResult as r, EmailAttachment as s, BatchOptions as t, HookHandler as u, PreferenceResolver as v, SendResult as w, Recipient as x, PushChannelConfig as y, DeliveryLogEntry as z };
@@ -1,3 +1,3 @@
1
- import { A as MemoryIdempotencyStore, O as IDEMPOTENCY_DEFAULT_TTL, k as IdempotencyStore } from "../types-BnjZ7x2U.mjs";
2
- import { a as ChannelError, c as Emitter, d as withRetry, f as mergeHooks, i as isQuietHours, l as calculateDelay, n as pMap, o as NotificationError, r as QuietHoursConfig, s as ProviderNotInstalledError, t as PMapOptions, u as resolveRetryConfig } from "../concurrency-CV_XyiBQ.mjs";
3
- export { ChannelError, Emitter, IDEMPOTENCY_DEFAULT_TTL, type IdempotencyStore, MemoryIdempotencyStore, NotificationError, type PMapOptions, ProviderNotInstalledError, type QuietHoursConfig, calculateDelay, isQuietHours, mergeHooks, pMap, resolveRetryConfig, withRetry };
1
+ import { B as DeliveryLogQuery, F as QueueJob, G as MemoryRateLimitStore, H as IDEMPOTENCY_DEFAULT_TTL, I as QueueJobStatus, K as RateLimitConfig, L as QueueProcessor, M as MemoryQueue, N as QueueAdapter, P as QueueEnqueueOptions, R as DeliveryLog, U as IdempotencyStore, V as MemoryDeliveryLog, W as MemoryIdempotencyStore, q as RateLimitStore, z as DeliveryLogEntry } from "../types-BMs4UhKD.mjs";
2
+ import { S as mergeHooks, _ as ProviderNotInstalledError, a as createStatusHandler, b as resolveRetryConfig, c as TemplateDefinition, d as PMapOptions, f as pMap, g as NotificationError, h as ChannelError, i as StatusUpdate, l as TemplateMap, m as isQuietHours, n as StatusHandler, o as FallbackOptions, p as QuietHoursConfig, r as StatusHandlerConfig, s as withFallback, t as DeliveryStatus, u as createSimpleResolver, v as Emitter, x as withRetry, y as calculateDelay } from "../status-webhook-Bb4UoinT.mjs";
3
+ export { ChannelError, type DeliveryLog, type DeliveryLogEntry, type DeliveryLogQuery, type DeliveryStatus, Emitter, type FallbackOptions, IDEMPOTENCY_DEFAULT_TTL, type IdempotencyStore, MemoryDeliveryLog, MemoryIdempotencyStore, MemoryQueue, MemoryRateLimitStore, NotificationError, type PMapOptions, ProviderNotInstalledError, type QueueAdapter, type QueueEnqueueOptions, type QueueJob, type QueueJobStatus, type QueueProcessor, type QuietHoursConfig, type RateLimitConfig, type RateLimitStore, type StatusHandler, type StatusHandlerConfig, type StatusUpdate, type TemplateDefinition, type TemplateMap, calculateDelay, createSimpleResolver, createStatusHandler, isQuietHours, mergeHooks, pMap, resolveRetryConfig, withFallback, withRetry };
@@ -1,4 +1,4 @@
1
- import { a as isQuietHours, c as withRetry, i as MemoryIdempotencyStore, l as Emitter, n as pMap, o as calculateDelay, r as IDEMPOTENCY_DEFAULT_TTL, s as resolveRetryConfig, t as mergeHooks } from "../merge-hooks-B4_uHR9x.mjs";
2
- import { n as NotificationError, r as ProviderNotInstalledError, t as ChannelError } from "../errors-DAIVZx_Q.mjs";
1
+ import { a as MemoryDeliveryLog, c as MemoryRateLimitStore, d as isQuietHours, f as calculateDelay, h as Emitter, i as MemoryQueue, l as IDEMPOTENCY_DEFAULT_TTL, m as withRetry, n as withFallback, o as mergeHooks, p as resolveRetryConfig, r as createSimpleResolver, s as pMap, t as createStatusHandler, u as MemoryIdempotencyStore } from "../status-webhook-XY42DCj_.mjs";
2
+ import { n as NotificationError, r as ProviderNotInstalledError, t as ChannelError } from "../errors-FYJYmfvj.mjs";
3
3
 
4
- export { ChannelError, Emitter, IDEMPOTENCY_DEFAULT_TTL, MemoryIdempotencyStore, NotificationError, ProviderNotInstalledError, calculateDelay, isQuietHours, mergeHooks, pMap, resolveRetryConfig, withRetry };
4
+ export { ChannelError, Emitter, IDEMPOTENCY_DEFAULT_TTL, MemoryDeliveryLog, MemoryIdempotencyStore, MemoryQueue, MemoryRateLimitStore, NotificationError, ProviderNotInstalledError, calculateDelay, createSimpleResolver, createStatusHandler, isQuietHours, mergeHooks, pMap, resolveRetryConfig, withFallback, withRetry };