@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
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
//#region src/utils/idempotency.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Idempotency / deduplication utilities
|
|
4
|
+
* @module @classytic/notifications/utils
|
|
5
|
+
*
|
|
6
|
+
* Prevents duplicate notification delivery using idempotency keys.
|
|
7
|
+
* Ships with an in-memory store; implement IdempotencyStore for
|
|
8
|
+
* Redis, database, or other distributed backends.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Interface for idempotency stores.
|
|
12
|
+
*
|
|
13
|
+
* Methods may be sync or async to support both in-memory and
|
|
14
|
+
* distributed backends (Redis, DB).
|
|
15
|
+
*/
|
|
16
|
+
interface IdempotencyStore {
|
|
17
|
+
/** Check if a key has been seen (within TTL) */
|
|
18
|
+
has(key: string): boolean | Promise<boolean>;
|
|
19
|
+
/** Record a key with TTL in milliseconds */
|
|
20
|
+
set(key: string, ttlMs: number): void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* In-memory idempotency store with TTL-based expiry.
|
|
24
|
+
*
|
|
25
|
+
* Suitable for single-process apps. For distributed systems,
|
|
26
|
+
* implement `IdempotencyStore` with Redis or your database.
|
|
27
|
+
*
|
|
28
|
+
* Expired entries are lazily cleaned up every `cleanupInterval` writes.
|
|
29
|
+
*/
|
|
30
|
+
declare class MemoryIdempotencyStore implements IdempotencyStore {
|
|
31
|
+
private store;
|
|
32
|
+
private cleanupCounter;
|
|
33
|
+
private readonly cleanupInterval;
|
|
34
|
+
constructor(options?: {
|
|
35
|
+
cleanupInterval?: number;
|
|
36
|
+
});
|
|
37
|
+
has(key: string): boolean;
|
|
38
|
+
set(key: string, ttlMs: number): void;
|
|
39
|
+
/** Number of entries (including possibly expired) */
|
|
40
|
+
get size(): number;
|
|
41
|
+
/** Remove all entries */
|
|
42
|
+
clear(): void;
|
|
43
|
+
private maybeCleanup;
|
|
44
|
+
}
|
|
45
|
+
/** Default TTL for idempotency keys (24 hours) */
|
|
46
|
+
declare const IDEMPOTENCY_DEFAULT_TTL: number;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/types.d.ts
|
|
49
|
+
/**
|
|
50
|
+
* @classytic/notifications - Type Definitions
|
|
51
|
+
*
|
|
52
|
+
* Multi-channel notification system with pluggable providers
|
|
53
|
+
*
|
|
54
|
+
* @module @classytic/notifications
|
|
55
|
+
*/
|
|
56
|
+
/** Notification recipient */
|
|
57
|
+
interface Recipient {
|
|
58
|
+
id?: string;
|
|
59
|
+
email?: string;
|
|
60
|
+
phone?: string;
|
|
61
|
+
name?: string;
|
|
62
|
+
deviceToken?: string;
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
/** Notification payload sent through the service */
|
|
66
|
+
interface NotificationPayload {
|
|
67
|
+
/** Event name that triggered this notification */
|
|
68
|
+
event: string;
|
|
69
|
+
/** Recipient information */
|
|
70
|
+
recipient: Recipient;
|
|
71
|
+
/** Data for templates and channels */
|
|
72
|
+
data: Record<string, unknown>;
|
|
73
|
+
/** Template ID to resolve before sending */
|
|
74
|
+
template?: string;
|
|
75
|
+
/** Target specific channels by name (omit to send to all matching) */
|
|
76
|
+
channels?: string[];
|
|
77
|
+
/** Arbitrary metadata (passed through to results) */
|
|
78
|
+
metadata?: Record<string, unknown>;
|
|
79
|
+
/** Idempotency key — duplicate sends with the same key are skipped */
|
|
80
|
+
idempotencyKey?: string;
|
|
81
|
+
}
|
|
82
|
+
/** Result from a single channel send */
|
|
83
|
+
interface SendResult {
|
|
84
|
+
status: 'sent' | 'skipped' | 'failed';
|
|
85
|
+
channel: string;
|
|
86
|
+
duration?: number;
|
|
87
|
+
error?: string;
|
|
88
|
+
metadata?: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
/** Result from dispatching to all channels */
|
|
91
|
+
interface DispatchResult {
|
|
92
|
+
event: string;
|
|
93
|
+
results: SendResult[];
|
|
94
|
+
sent: number;
|
|
95
|
+
failed: number;
|
|
96
|
+
skipped: number;
|
|
97
|
+
duration: number;
|
|
98
|
+
}
|
|
99
|
+
/** Base channel configuration */
|
|
100
|
+
interface ChannelConfig {
|
|
101
|
+
/** Channel name (defaults to class name) */
|
|
102
|
+
name?: string;
|
|
103
|
+
/** Enable/disable this channel */
|
|
104
|
+
enabled?: boolean;
|
|
105
|
+
/** Event whitelist (empty = handle all events) */
|
|
106
|
+
events?: string[];
|
|
107
|
+
/** Per-channel retry override */
|
|
108
|
+
retry?: RetryConfig;
|
|
109
|
+
}
|
|
110
|
+
/** Channel interface - implement this for custom channels */
|
|
111
|
+
interface Channel {
|
|
112
|
+
readonly name: string;
|
|
113
|
+
shouldHandle(event: string): boolean;
|
|
114
|
+
send(payload: NotificationPayload): Promise<SendResult>;
|
|
115
|
+
}
|
|
116
|
+
/** SMTP / Nodemailer transport options */
|
|
117
|
+
interface SmtpTransportOptions {
|
|
118
|
+
host?: string;
|
|
119
|
+
port?: number;
|
|
120
|
+
secure?: boolean;
|
|
121
|
+
auth?: {
|
|
122
|
+
user: string;
|
|
123
|
+
pass: string;
|
|
124
|
+
};
|
|
125
|
+
/** Nodemailer service shorthand (e.g. 'gmail', 'outlook') */
|
|
126
|
+
service?: string;
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
/** Email attachment */
|
|
130
|
+
interface EmailAttachment {
|
|
131
|
+
filename: string;
|
|
132
|
+
content?: string | Buffer;
|
|
133
|
+
path?: string;
|
|
134
|
+
contentType?: string;
|
|
135
|
+
}
|
|
136
|
+
/** EmailChannel configuration */
|
|
137
|
+
interface EmailChannelConfig extends ChannelConfig {
|
|
138
|
+
/** Sender address (e.g. 'App <noreply@app.com>') */
|
|
139
|
+
from: string;
|
|
140
|
+
/** SMTP transport options (creates a Nodemailer transporter) */
|
|
141
|
+
transport?: SmtpTransportOptions;
|
|
142
|
+
/** Pre-created Nodemailer transporter (for SES, custom transports) */
|
|
143
|
+
transporter?: NodemailerTransporter;
|
|
144
|
+
/** Default mail options merged into every send */
|
|
145
|
+
defaults?: Record<string, unknown>;
|
|
146
|
+
}
|
|
147
|
+
/** Minimal Nodemailer transporter interface (avoids hard dep) */
|
|
148
|
+
interface NodemailerTransporter {
|
|
149
|
+
sendMail(options: Record<string, unknown>): Promise<{
|
|
150
|
+
messageId: string;
|
|
151
|
+
[key: string]: unknown;
|
|
152
|
+
}>;
|
|
153
|
+
verify?(): Promise<boolean>;
|
|
154
|
+
close?(): void;
|
|
155
|
+
}
|
|
156
|
+
/** WebhookChannel configuration */
|
|
157
|
+
interface WebhookChannelConfig extends ChannelConfig {
|
|
158
|
+
/** Webhook URL */
|
|
159
|
+
url: string;
|
|
160
|
+
/** Custom headers */
|
|
161
|
+
headers?: Record<string, string>;
|
|
162
|
+
/** HMAC secret for signing payloads */
|
|
163
|
+
secret?: string;
|
|
164
|
+
/** HTTP method (default: POST) */
|
|
165
|
+
method?: 'POST' | 'PUT';
|
|
166
|
+
/** Request timeout in ms (default: 10000) */
|
|
167
|
+
timeout?: number;
|
|
168
|
+
}
|
|
169
|
+
/** Resolved template content */
|
|
170
|
+
interface TemplateResult {
|
|
171
|
+
subject?: string;
|
|
172
|
+
html?: string;
|
|
173
|
+
text?: string;
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Template resolver function
|
|
178
|
+
* Plug any template engine: React Email, MJML, Handlebars, etc.
|
|
179
|
+
*/
|
|
180
|
+
type TemplateResolver = (templateId: string, data: Record<string, unknown>) => TemplateResult | Promise<TemplateResult>;
|
|
181
|
+
/** Retry configuration */
|
|
182
|
+
interface RetryConfig {
|
|
183
|
+
/** Max send attempts (default: 1 = no retry) */
|
|
184
|
+
maxAttempts?: number;
|
|
185
|
+
/** Backoff strategy (default: 'exponential') */
|
|
186
|
+
backoff?: 'fixed' | 'exponential' | 'linear';
|
|
187
|
+
/** Initial delay in ms (default: 500) */
|
|
188
|
+
initialDelay?: number;
|
|
189
|
+
/** Maximum delay in ms (default: 30000) */
|
|
190
|
+
maxDelay?: number;
|
|
191
|
+
}
|
|
192
|
+
/** Internal resolved retry config with defaults applied */
|
|
193
|
+
interface ResolvedRetryConfig {
|
|
194
|
+
maxAttempts: number;
|
|
195
|
+
backoff: 'fixed' | 'exponential' | 'linear';
|
|
196
|
+
initialDelay: number;
|
|
197
|
+
maxDelay: number;
|
|
198
|
+
}
|
|
199
|
+
/** Per-user notification preferences */
|
|
200
|
+
interface NotificationPreferences {
|
|
201
|
+
/** Channel opt-in/out: { email: true, sms: false } */
|
|
202
|
+
channels?: Record<string, boolean>;
|
|
203
|
+
/** Event opt-in/out: { 'marketing.promo': false } */
|
|
204
|
+
events?: Record<string, boolean>;
|
|
205
|
+
/** Quiet hours */
|
|
206
|
+
quiet?: {
|
|
207
|
+
start?: string;
|
|
208
|
+
end?: string;
|
|
209
|
+
timezone?: string;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Preference resolver function
|
|
214
|
+
* Load from DB, cache, or config
|
|
215
|
+
*/
|
|
216
|
+
type PreferenceResolver = (recipientId: string, event: string) => NotificationPreferences | Promise<NotificationPreferences | null> | null;
|
|
217
|
+
/** Pluggable logger interface (compatible with console, pino, winston) */
|
|
218
|
+
interface Logger {
|
|
219
|
+
info(message: string, ...args: unknown[]): void;
|
|
220
|
+
warn(message: string, ...args: unknown[]): void;
|
|
221
|
+
error(message: string, ...args: unknown[]): void;
|
|
222
|
+
debug?(message: string, ...args: unknown[]): void;
|
|
223
|
+
}
|
|
224
|
+
/** NotificationService configuration */
|
|
225
|
+
interface NotificationServiceConfig {
|
|
226
|
+
/** Registered channels */
|
|
227
|
+
channels?: Channel[];
|
|
228
|
+
/** Template resolver (plug any engine) */
|
|
229
|
+
templates?: TemplateResolver;
|
|
230
|
+
/** Global retry config (channels can override) */
|
|
231
|
+
retry?: RetryConfig;
|
|
232
|
+
/** Preference resolver for per-user filtering */
|
|
233
|
+
preferences?: PreferenceResolver;
|
|
234
|
+
/** Logger (default: silent) */
|
|
235
|
+
logger?: Logger;
|
|
236
|
+
/** Idempotency / deduplication config */
|
|
237
|
+
idempotency?: {
|
|
238
|
+
/** Store implementation (default: MemoryIdempotencyStore) */store?: IdempotencyStore; /** TTL in milliseconds (default: 86400000 = 24h) */
|
|
239
|
+
ttl?: number;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/** Service lifecycle events */
|
|
243
|
+
type ServiceEvent = 'before:send' | 'after:send' | 'send:success' | 'send:failed' | 'send:retry';
|
|
244
|
+
/** Event handler function */
|
|
245
|
+
type EventHandler<T = unknown> = (data: T) => void | Promise<void>;
|
|
246
|
+
/** Hook config for creating event-specific handlers */
|
|
247
|
+
interface NotificationHookConfig<T = unknown> {
|
|
248
|
+
/** Event name */
|
|
249
|
+
event: string;
|
|
250
|
+
/** Target specific channels */
|
|
251
|
+
channels?: string[];
|
|
252
|
+
/** Extract recipient from event data */
|
|
253
|
+
getRecipient: (eventData: T) => Recipient | Promise<Recipient | null> | null;
|
|
254
|
+
/** Extract notification data from event data */
|
|
255
|
+
getData: (eventData: T) => Record<string, unknown>;
|
|
256
|
+
/** Template to resolve */
|
|
257
|
+
template?: string;
|
|
258
|
+
/** Enable/disable */
|
|
259
|
+
enabled?: boolean;
|
|
260
|
+
}
|
|
261
|
+
/** Hook handler function */
|
|
262
|
+
type HookHandler = (eventData: unknown) => Promise<DispatchResult | undefined>;
|
|
263
|
+
/** Map of event name to hook handler arrays */
|
|
264
|
+
type HookMap = Record<string, HookHandler[]>;
|
|
265
|
+
/** Options for batch sending */
|
|
266
|
+
interface BatchOptions {
|
|
267
|
+
/** Max concurrent notification sends (default: 10) */
|
|
268
|
+
concurrency?: number;
|
|
269
|
+
/** Called after each notification completes */
|
|
270
|
+
onProgress?: (progress: BatchProgress) => void;
|
|
271
|
+
}
|
|
272
|
+
/** Progress info emitted during batch sending */
|
|
273
|
+
interface BatchProgress {
|
|
274
|
+
/** Number of notifications completed so far */
|
|
275
|
+
completed: number;
|
|
276
|
+
/** Total number of notifications in the batch */
|
|
277
|
+
total: number;
|
|
278
|
+
/** Result of the just-completed notification */
|
|
279
|
+
result: DispatchResult;
|
|
280
|
+
}
|
|
281
|
+
/** Aggregated result from sending a batch of notifications */
|
|
282
|
+
interface BatchResult {
|
|
283
|
+
/** Total notifications in the batch */
|
|
284
|
+
total: number;
|
|
285
|
+
/** Total successful channel sends across all notifications */
|
|
286
|
+
sent: number;
|
|
287
|
+
/** Total failed channel sends across all notifications */
|
|
288
|
+
failed: number;
|
|
289
|
+
/** Total skipped sends (quiet hours, dedup, preferences) */
|
|
290
|
+
skipped: number;
|
|
291
|
+
/** Total wall-clock duration in ms */
|
|
292
|
+
duration: number;
|
|
293
|
+
/** Per-notification dispatch results (same order as input) */
|
|
294
|
+
results: DispatchResult[];
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
export { MemoryIdempotencyStore as A, ServiceEvent as C, WebhookChannelConfig as D, TemplateResult as E, IDEMPOTENCY_DEFAULT_TTL as O, SendResult as S, TemplateResolver as T, NotificationServiceConfig as _, ChannelConfig as a, ResolvedRetryConfig as b, EmailChannelConfig as c, HookMap as d, Logger as f, NotificationPreferences as g, NotificationPayload as h, Channel as i, IdempotencyStore as k, EventHandler as l, NotificationHookConfig as m, BatchProgress as n, DispatchResult as o, NodemailerTransporter as p, BatchResult as r, EmailAttachment as s, BatchOptions as t, HookHandler as u, PreferenceResolver as v, SmtpTransportOptions as w, RetryConfig as x, Recipient as y };
|
|
@@ -0,0 +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 };
|
|
@@ -0,0 +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";
|
|
3
|
+
|
|
4
|
+
export { ChannelError, Emitter, IDEMPOTENCY_DEFAULT_TTL, MemoryIdempotencyStore, NotificationError, ProviderNotInstalledError, calculateDelay, isQuietHours, mergeHooks, pMap, resolveRetryConfig, withRetry };
|
package/package.json
CHANGED
|
@@ -1,30 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/notifications",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Multi-channel notification system
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Multi-channel notification system with pluggable providers, templates, and retry - zero required dependencies",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./dist/index.mjs",
|
|
8
|
+
"module": "./dist/index.mjs",
|
|
9
|
+
"types": "./dist/index.d.mts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.mts",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"./channels": {
|
|
16
|
+
"types": "./dist/channels/index.d.mts",
|
|
17
|
+
"default": "./dist/channels/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"./utils": {
|
|
20
|
+
"types": "./dist/utils/index.d.mts",
|
|
21
|
+
"default": "./dist/utils/index.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"CHANGELOG.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
8
30
|
"keywords": [
|
|
9
31
|
"notifications",
|
|
10
32
|
"multi-channel",
|
|
11
33
|
"email",
|
|
12
|
-
"push",
|
|
13
34
|
"sms",
|
|
14
|
-
"
|
|
35
|
+
"push",
|
|
36
|
+
"webhook",
|
|
37
|
+
"nodemailer",
|
|
38
|
+
"smtp",
|
|
39
|
+
"ses",
|
|
40
|
+
"gmail",
|
|
15
41
|
"event-driven",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"messaging",
|
|
19
|
-
"dispatcher",
|
|
20
|
-
"channels",
|
|
42
|
+
"templates",
|
|
43
|
+
"retry",
|
|
21
44
|
"pluggable",
|
|
22
45
|
"framework-agnostic",
|
|
23
46
|
"express",
|
|
24
47
|
"fastify",
|
|
25
|
-
"nestjs"
|
|
48
|
+
"nestjs",
|
|
49
|
+
"typescript",
|
|
50
|
+
"zero-dependencies"
|
|
51
|
+
],
|
|
52
|
+
"author": "Classytic <classytic.dev@gmail.com> (https://github.com/classytic)",
|
|
53
|
+
"contributors": [
|
|
54
|
+
"Sadman Chowdhury (https://github.com/siam923)"
|
|
26
55
|
],
|
|
27
|
-
"author": "Classytic",
|
|
28
56
|
"license": "MIT",
|
|
29
57
|
"repository": {
|
|
30
58
|
"type": "git",
|
|
@@ -34,49 +62,39 @@
|
|
|
34
62
|
"url": "https://github.com/classytic/notifications/issues"
|
|
35
63
|
},
|
|
36
64
|
"homepage": "https://github.com/classytic/notifications#readme",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"publish:npm": "npm publish --access public",
|
|
45
|
-
"release:patch": "npm run version:patch && npm run publish:npm",
|
|
46
|
-
"release:minor": "npm run version:minor && npm run publish:npm",
|
|
47
|
-
"release:major": "npm run version:major && npm run publish:npm"
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"nodemailer": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"nodemailer": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
48
72
|
},
|
|
49
73
|
"engines": {
|
|
50
|
-
"node": ">=18
|
|
74
|
+
"node": ">=18"
|
|
51
75
|
},
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"./utils/merge-hooks": {
|
|
67
|
-
"import": "./src/utils/merge-hooks.js"
|
|
68
|
-
}
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsdown",
|
|
78
|
+
"dev": "tsdown --watch",
|
|
79
|
+
"test": "vitest run",
|
|
80
|
+
"test:watch": "vitest",
|
|
81
|
+
"test:coverage": "vitest run --coverage",
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
|
+
"prepublishOnly": "npm run build && npm run typecheck",
|
|
84
|
+
"publish:dry": "npm publish --dry-run --access public",
|
|
85
|
+
"publish:npm": "npm publish --access public",
|
|
86
|
+
"release": "npm run build && npm run typecheck && npm publish --access public",
|
|
87
|
+
"release:patch": "npm version patch && npm run release",
|
|
88
|
+
"release:minor": "npm version minor && npm run release",
|
|
89
|
+
"release:major": "npm version major && npm run release"
|
|
69
90
|
},
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"dependencies": {}
|
|
81
|
-
}
|
|
82
|
-
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@types/node": "^22.0.0",
|
|
93
|
+
"@types/nodemailer": "^6.4.17",
|
|
94
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
95
|
+
"nodemailer": "^6.10.1",
|
|
96
|
+
"tsdown": "0.20.3",
|
|
97
|
+
"typescript": "^5.7.0",
|
|
98
|
+
"vitest": "^3.0.0"
|
|
99
|
+
}
|
|
100
|
+
}
|