sently 0.4.1 → 0.4.3
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 +10 -0
- package/README.md +149 -94
- package/dist/{chunk-z3eq2t1d.js → chunk-8sm0vz0n.js} +7 -6
- package/dist/chunk-8sm0vz0n.js.map +10 -0
- package/dist/chunk-bfrvnqhq.js +270 -0
- package/dist/chunk-bfrvnqhq.js.map +11 -0
- package/dist/{chunk-tjsgb3qb.js → chunk-sbydk09g.js} +6 -2
- package/dist/{chunk-tjsgb3qb.js.map → chunk-sbydk09g.js.map} +2 -2
- package/dist/core/smtp.js +32 -0
- package/dist/{index.js.map → core/smtp.js.map} +1 -1
- package/dist/detect.js +181 -0
- package/dist/detect.js.map +11 -0
- package/dist/index.js +14 -29
- package/dist/pool/pool.js +8 -268
- package/dist/pool/pool.js.map +3 -5
- package/dist/transports/retry.js +1 -1
- package/dist/transports/smtp.js +4 -4
- package/dist/transports/smtp.js.map +1 -1
- package/package.json +16 -3
- package/dist/chunk-z3eq2t1d.js.map +0 -10
package/dist/pool/pool.js
CHANGED
|
@@ -1,277 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "../chunk-z3eq2t1d.js";
|
|
7
|
-
import {
|
|
8
|
-
buildMIME
|
|
9
|
-
} from "../chunk-j6qw8ms6.js";
|
|
10
|
-
import"../chunk-tjsgb3qb.js";
|
|
2
|
+
RateLimiter,
|
|
3
|
+
SMTPPool
|
|
4
|
+
} from "../chunk-bfrvnqhq.js";
|
|
5
|
+
import"../chunk-8sm0vz0n.js";
|
|
11
6
|
import"../chunk-ym3zzv8b.js";
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import"../chunk-j6qw8ms6.js";
|
|
8
|
+
import"../chunk-sbydk09g.js";
|
|
9
|
+
import"../chunk-bvxkmq94.js";
|
|
15
10
|
import"../chunk-794hc3m4.js";
|
|
16
11
|
import"../chunk-v0bahtg2.js";
|
|
17
|
-
|
|
18
|
-
// src/pool/connection.ts
|
|
19
|
-
async function createPooledConnection(options) {
|
|
20
|
-
const config = resolveSMTPConfig(options.config);
|
|
21
|
-
const adapter = await options.createAdapter();
|
|
22
|
-
await adapter.connect(options.connectHost, config.port);
|
|
23
|
-
await openSMTPSession(adapter, config);
|
|
24
|
-
let messageCount = 0;
|
|
25
|
-
let idle = true;
|
|
26
|
-
let sendChain = Promise.resolve();
|
|
27
|
-
const maxMessages = options.maxMessages;
|
|
28
|
-
return {
|
|
29
|
-
get idle() {
|
|
30
|
-
return idle;
|
|
31
|
-
},
|
|
32
|
-
get messageCount() {
|
|
33
|
-
return messageCount;
|
|
34
|
-
},
|
|
35
|
-
get usable() {
|
|
36
|
-
return messageCount < maxMessages;
|
|
37
|
-
},
|
|
38
|
-
async send(mailOptions) {
|
|
39
|
-
const run = async () => {
|
|
40
|
-
idle = false;
|
|
41
|
-
try {
|
|
42
|
-
const resolvedOptions = {
|
|
43
|
-
...mailOptions,
|
|
44
|
-
attachments: await resolveAttachments(mailOptions.attachments)
|
|
45
|
-
};
|
|
46
|
-
const mime = await buildMIME(resolvedOptions, config.dkim);
|
|
47
|
-
const result = await deliverSMTPMessage(adapter, mime);
|
|
48
|
-
messageCount += 1;
|
|
49
|
-
return result;
|
|
50
|
-
} finally {
|
|
51
|
-
idle = true;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const resultPromise = sendChain.then(run);
|
|
55
|
-
sendChain = resultPromise.then(() => {
|
|
56
|
-
return;
|
|
57
|
-
}, () => {
|
|
58
|
-
return;
|
|
59
|
-
});
|
|
60
|
-
return resultPromise;
|
|
61
|
-
},
|
|
62
|
-
async close() {
|
|
63
|
-
await sendChain;
|
|
64
|
-
await closeSMTPSession(adapter);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/pool/pool.ts
|
|
70
|
-
class RateLimiter {
|
|
71
|
-
rateDelta;
|
|
72
|
-
rateLimit;
|
|
73
|
-
now;
|
|
74
|
-
tokens;
|
|
75
|
-
lastRefill;
|
|
76
|
-
waiters = [];
|
|
77
|
-
constructor(rateDelta, rateLimit, now = Date.now) {
|
|
78
|
-
this.rateDelta = rateDelta;
|
|
79
|
-
this.rateLimit = rateLimit;
|
|
80
|
-
this.now = now;
|
|
81
|
-
this.tokens = rateDelta;
|
|
82
|
-
this.lastRefill = now();
|
|
83
|
-
}
|
|
84
|
-
async acquire() {
|
|
85
|
-
for (;; ) {
|
|
86
|
-
this.refill();
|
|
87
|
-
if (this.tokens > 0) {
|
|
88
|
-
this.tokens -= 1;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
await new Promise((resolve) => {
|
|
92
|
-
this.waiters.push(resolve);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
notify() {
|
|
97
|
-
this.refill();
|
|
98
|
-
}
|
|
99
|
-
refill() {
|
|
100
|
-
const t = this.now();
|
|
101
|
-
const elapsed = t - this.lastRefill;
|
|
102
|
-
if (elapsed >= this.rateLimit) {
|
|
103
|
-
const periods = Math.floor(elapsed / this.rateLimit);
|
|
104
|
-
this.tokens = Math.min(this.rateDelta, this.tokens + periods * this.rateDelta);
|
|
105
|
-
this.lastRefill += periods * this.rateLimit;
|
|
106
|
-
while (this.tokens > 0 && this.waiters.length > 0) {
|
|
107
|
-
this.tokens -= 1;
|
|
108
|
-
const next = this.waiters.shift();
|
|
109
|
-
next?.();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
class SMTPPool {
|
|
116
|
-
config;
|
|
117
|
-
maxConnections;
|
|
118
|
-
maxMessages;
|
|
119
|
-
createAdapterFn;
|
|
120
|
-
rateLimiter;
|
|
121
|
-
connections = [];
|
|
122
|
-
queue = [];
|
|
123
|
-
draining = false;
|
|
124
|
-
closed = false;
|
|
125
|
-
processChain = Promise.resolve();
|
|
126
|
-
constructor(config, options) {
|
|
127
|
-
this.config = config;
|
|
128
|
-
this.maxConnections = config.maxConnections ?? 5;
|
|
129
|
-
this.maxMessages = config.maxMessages ?? 100;
|
|
130
|
-
if (options?.createAdapter) {
|
|
131
|
-
const factory = options.createAdapter;
|
|
132
|
-
this.createAdapterFn = async () => factory();
|
|
133
|
-
} else if (config.adapter) {
|
|
134
|
-
this.createAdapterFn = async () => config.adapter;
|
|
135
|
-
} else {
|
|
136
|
-
throw new Error("SMTPPool requires config.adapter or options.createAdapter");
|
|
137
|
-
}
|
|
138
|
-
if (config.rateDelta !== undefined && config.rateDelta > 0) {
|
|
139
|
-
this.rateLimiter = new RateLimiter(config.rateDelta, config.rateLimit ?? 1000, options?.now);
|
|
140
|
-
} else {
|
|
141
|
-
this.rateLimiter = null;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async send(options) {
|
|
145
|
-
if (this.draining) {
|
|
146
|
-
throw new Error("SMTPPool is closing — no new messages accepted");
|
|
147
|
-
}
|
|
148
|
-
if (this.closed) {
|
|
149
|
-
throw new Error("SMTPPool is closed");
|
|
150
|
-
}
|
|
151
|
-
if (this.rateLimiter) {
|
|
152
|
-
await this.rateLimiter.acquire();
|
|
153
|
-
}
|
|
154
|
-
return new Promise((resolve, reject) => {
|
|
155
|
-
this.queue.push({ options, resolve, reject });
|
|
156
|
-
this.scheduleProcess();
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
scheduleProcess() {
|
|
160
|
-
this.processChain = this.processChain.then(() => this.processQueue()).catch(() => {
|
|
161
|
-
return;
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
async verify() {
|
|
165
|
-
try {
|
|
166
|
-
const conn = await this.spawnConnection();
|
|
167
|
-
try {
|
|
168
|
-
return { ok: true, provider: "smtp-pool" };
|
|
169
|
-
} finally {
|
|
170
|
-
await conn.close();
|
|
171
|
-
this.removeConnection(conn);
|
|
172
|
-
}
|
|
173
|
-
} catch (err) {
|
|
174
|
-
return {
|
|
175
|
-
ok: false,
|
|
176
|
-
provider: "smtp-pool",
|
|
177
|
-
message: err instanceof Error ? err.message : String(err)
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
async close() {
|
|
182
|
-
this.draining = true;
|
|
183
|
-
await this.drainQueue();
|
|
184
|
-
await Promise.allSettled(this.connections.map((c) => c.close()));
|
|
185
|
-
this.connections.length = 0;
|
|
186
|
-
this.closed = true;
|
|
187
|
-
}
|
|
188
|
-
get connectionCount() {
|
|
189
|
-
return this.connections.length;
|
|
190
|
-
}
|
|
191
|
-
get queueSize() {
|
|
192
|
-
return this.queue.length;
|
|
193
|
-
}
|
|
194
|
-
async processQueue() {
|
|
195
|
-
if (this.draining) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
while (this.queue.length > 0) {
|
|
199
|
-
const idleConn = this.connections.find((c) => c.idle && c.usable);
|
|
200
|
-
if (idleConn) {
|
|
201
|
-
const entry = this.queue.shift();
|
|
202
|
-
if (!entry) {
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
try {
|
|
206
|
-
const result = await idleConn.send(entry.options);
|
|
207
|
-
entry.resolve(result);
|
|
208
|
-
if (!idleConn.usable) {
|
|
209
|
-
await idleConn.close();
|
|
210
|
-
this.removeConnection(idleConn);
|
|
211
|
-
}
|
|
212
|
-
} catch (err) {
|
|
213
|
-
entry.reject(err);
|
|
214
|
-
await idleConn.close().catch(() => {
|
|
215
|
-
return;
|
|
216
|
-
});
|
|
217
|
-
this.removeConnection(idleConn);
|
|
218
|
-
}
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
if (this.connections.length < this.maxConnections) {
|
|
222
|
-
const entry = this.queue.shift();
|
|
223
|
-
if (!entry) {
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
const conn = await this.spawnConnection();
|
|
227
|
-
try {
|
|
228
|
-
const result = await conn.send(entry.options);
|
|
229
|
-
entry.resolve(result);
|
|
230
|
-
if (!conn.usable) {
|
|
231
|
-
await conn.close();
|
|
232
|
-
this.removeConnection(conn);
|
|
233
|
-
}
|
|
234
|
-
} catch (err) {
|
|
235
|
-
entry.reject(err);
|
|
236
|
-
await conn.close().catch(() => {
|
|
237
|
-
return;
|
|
238
|
-
});
|
|
239
|
-
this.removeConnection(conn);
|
|
240
|
-
}
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
async spawnConnection() {
|
|
247
|
-
const resolved = resolveSMTPConfig(this.config);
|
|
248
|
-
const conn = await createPooledConnection({
|
|
249
|
-
config: this.config,
|
|
250
|
-
maxMessages: this.maxMessages,
|
|
251
|
-
connectHost: resolved.host,
|
|
252
|
-
createAdapter: this.createAdapterFn
|
|
253
|
-
});
|
|
254
|
-
this.connections.push(conn);
|
|
255
|
-
return conn;
|
|
256
|
-
}
|
|
257
|
-
removeConnection(conn) {
|
|
258
|
-
const index = this.connections.indexOf(conn);
|
|
259
|
-
if (index >= 0) {
|
|
260
|
-
this.connections.splice(index, 1);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
async drainQueue() {
|
|
264
|
-
while (this.queue.length > 0 || this.connections.some((c) => !c.idle)) {
|
|
265
|
-
await this.processQueue();
|
|
266
|
-
if (this.queue.length > 0) {
|
|
267
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
12
|
export {
|
|
273
13
|
SMTPPool,
|
|
274
14
|
RateLimiter
|
|
275
15
|
};
|
|
276
16
|
|
|
277
|
-
//# debugId=
|
|
17
|
+
//# debugId=C06866950F09705E64756E2164756E21
|
package/dist/pool/pool.js.map
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { buildMIME } from \"../core/mime.js\";\nimport type { MailOptions, SendResult, SMTPConfig } from \"../core/types.js\";\nimport { resolveAttachments } from \"../transports/resolve-attachments.js\";\nimport {\n closeSMTPSession,\n deliverSMTPMessage,\n openSMTPSession,\n resolveSMTPConfig,\n} from \"../transports/smtp.js\";\n\n/** A single pooled SMTP connection with a persistent session. */\nexport interface PooledConnection {\n /** Send one message over this connection. */\n send(options: MailOptions): Promise<SendResult>;\n /** Whether this connection is idle and available for work. */\n readonly idle: boolean;\n /** Number of messages sent on this connection. */\n readonly messageCount: number;\n /** Whether this connection can accept more messages before recycle. */\n readonly usable: boolean;\n /** Close the connection and end the SMTP session. */\n close(): Promise<void>;\n}\n\n/** Options for creating a pooled connection. */\nexport interface PooledConnectionOptions {\n config: SMTPConfig;\n maxMessages: number;\n connectHost: string;\n createAdapter: () => Promise<import(\"../core/types.js\").SocketAdapter>;\n}\n\n/**\n * Create a pooled SMTP connection with an open authenticated session.\n */\nexport async function createPooledConnection(\n options: PooledConnectionOptions,\n): Promise<PooledConnection> {\n const config = resolveSMTPConfig(options.config);\n const adapter = await options.createAdapter();\n await adapter.connect(options.connectHost, config.port);\n await openSMTPSession(adapter, config);\n\n let messageCount = 0;\n let idle = true;\n let sendChain: Promise<void> = Promise.resolve();\n\n const maxMessages = options.maxMessages;\n\n return {\n get idle(): boolean {\n return idle;\n },\n get messageCount(): number {\n return messageCount;\n },\n get usable(): boolean {\n return messageCount < maxMessages;\n },\n\n async send(mailOptions: MailOptions): Promise<SendResult> {\n const run = async (): Promise<SendResult> => {\n idle = false;\n try {\n const resolvedOptions = {\n ...mailOptions,\n attachments: await resolveAttachments(mailOptions.attachments),\n };\n const mime = await buildMIME(resolvedOptions, config.dkim);\n const result = await deliverSMTPMessage(adapter, mime);\n messageCount += 1;\n return result;\n } finally {\n idle = true;\n }\n };\n\n const resultPromise = sendChain.then(run);\n sendChain = resultPromise.then(\n () => undefined,\n () => undefined,\n );\n return resultPromise;\n },\n\n async close(): Promise<void> {\n await sendChain;\n await closeSMTPSession(adapter);\n },\n };\n}\n",
|
|
6
|
-
"import type {\n MailOptions,\n PoolConfig,\n SendResult,\n SMTPConfig,\n SocketAdapter,\n Transport,\n VerifyResult,\n} from \"../core/types.js\";\nimport { resolveSMTPConfig } from \"../transports/smtp.js\";\nimport { createPooledConnection, type PooledConnection } from \"./connection.js\";\n\n/** Options for {@link SMTPPool}. */\nexport interface SMTPPoolOptions {\n /** Factory for a new socket adapter per pooled connection. */\n createAdapter?: () => Promise<SocketAdapter> | SocketAdapter;\n /** Injectable clock for rate limiting (testing). */\n now?: () => number;\n}\n\ninterface QueueEntry {\n options: MailOptions;\n resolve: (result: SendResult) => void;\n reject: (error: unknown) => void;\n}\n\n/**\n * Token bucket rate limiter with lazy refill on acquire.\n */\nclass RateLimiter {\n private tokens: number;\n private lastRefill: number;\n private waiters: Array<() => void> = [];\n\n constructor(\n private readonly rateDelta: number,\n private readonly rateLimit: number,\n private readonly now: () => number = Date.now,\n ) {\n this.tokens = rateDelta;\n this.lastRefill = now();\n }\n\n /** Wait until a token is available, then consume one. */\n async acquire(): Promise<void> {\n for (;;) {\n this.refill();\n if (this.tokens > 0) {\n this.tokens -= 1;\n return;\n }\n await new Promise<void>((resolve) => {\n this.waiters.push(resolve);\n });\n }\n }\n\n /** Wake waiters after the clock advances (for testing). */\n notify(): void {\n this.refill();\n }\n\n private refill(): void {\n const t = this.now();\n const elapsed = t - this.lastRefill;\n if (elapsed >= this.rateLimit) {\n const periods = Math.floor(elapsed / this.rateLimit);\n this.tokens = Math.min(this.rateDelta, this.tokens + periods * this.rateDelta);\n this.lastRefill += periods * this.rateLimit;\n while (this.tokens > 0 && this.waiters.length > 0) {\n this.tokens -= 1;\n const next = this.waiters.shift();\n next?.();\n }\n }\n }\n}\n\n/**\n * SMTP connection pool with optional rate limiting.\n */\nexport class SMTPPool implements Transport {\n private readonly config: SMTPConfig & PoolConfig;\n private readonly maxConnections: number;\n private readonly maxMessages: number;\n private readonly createAdapterFn: () => Promise<SocketAdapter>;\n private readonly rateLimiter: RateLimiter | null;\n private readonly connections: PooledConnection[] = [];\n private readonly queue: QueueEntry[] = [];\n private draining = false;\n private closed = false;\n private processChain: Promise<void> = Promise.resolve();\n\n /** Creates an SMTP connection pool. */\n constructor(config: SMTPConfig & PoolConfig, options?: SMTPPoolOptions) {\n this.config = config;\n this.maxConnections = config.maxConnections ?? 5;\n this.maxMessages = config.maxMessages ?? 100;\n\n if (options?.createAdapter) {\n const factory = options.createAdapter;\n this.createAdapterFn = async () => factory();\n } else if (config.adapter) {\n this.createAdapterFn = async () => config.adapter as SocketAdapter;\n } else {\n throw new Error(\"SMTPPool requires config.adapter or options.createAdapter\");\n }\n\n if (config.rateDelta !== undefined && config.rateDelta > 0) {\n this.rateLimiter = new RateLimiter(config.rateDelta, config.rateLimit ?? 1000, options?.now);\n } else {\n this.rateLimiter = null;\n }\n }\n\n /** Sends a message through the pool. */\n async send(options: MailOptions): Promise<SendResult> {\n if (this.draining) {\n throw new Error(\"SMTPPool is closing — no new messages accepted\");\n }\n if (this.closed) {\n throw new Error(\"SMTPPool is closed\");\n }\n if (this.rateLimiter) {\n await this.rateLimiter.acquire();\n }\n return new Promise<SendResult>((resolve, reject) => {\n this.queue.push({ options, resolve, reject });\n this.scheduleProcess();\n });\n }\n\n private scheduleProcess(): void {\n this.processChain = this.processChain.then(() => this.processQueue()).catch(() => undefined);\n }\n\n /** Verifies connectivity using a temporary connection. */\n async verify(): Promise<VerifyResult> {\n try {\n const conn = await this.spawnConnection();\n try {\n return { ok: true, provider: \"smtp-pool\" };\n } finally {\n await conn.close();\n this.removeConnection(conn);\n }\n } catch (err) {\n return {\n ok: false,\n provider: \"smtp-pool\",\n message: err instanceof Error ? err.message : String(err),\n };\n }\n }\n\n /** Drains the queue and closes all connections. */\n async close(): Promise<void> {\n this.draining = true;\n await this.drainQueue();\n await Promise.allSettled(this.connections.map((c) => c.close()));\n this.connections.length = 0;\n this.closed = true;\n }\n\n /** Current number of open pooled connections. */\n get connectionCount(): number {\n return this.connections.length;\n }\n\n /** Number of messages waiting in the send queue. */\n get queueSize(): number {\n return this.queue.length;\n }\n\n private async processQueue(): Promise<void> {\n if (this.draining) {\n return;\n }\n\n while (this.queue.length > 0) {\n const idleConn = this.connections.find((c) => c.idle && c.usable);\n if (idleConn) {\n const entry = this.queue.shift();\n if (!entry) {\n break;\n }\n try {\n const result = await idleConn.send(entry.options);\n entry.resolve(result);\n if (!idleConn.usable) {\n await idleConn.close();\n this.removeConnection(idleConn);\n }\n } catch (err) {\n entry.reject(err);\n await idleConn.close().catch(() => undefined);\n this.removeConnection(idleConn);\n }\n continue;\n }\n\n if (this.connections.length < this.maxConnections) {\n const entry = this.queue.shift();\n if (!entry) {\n break;\n }\n const conn = await this.spawnConnection();\n try {\n const result = await conn.send(entry.options);\n entry.resolve(result);\n if (!conn.usable) {\n await conn.close();\n this.removeConnection(conn);\n }\n } catch (err) {\n entry.reject(err);\n await conn.close().catch(() => undefined);\n this.removeConnection(conn);\n }\n continue;\n }\n\n break;\n }\n }\n\n private async spawnConnection(): Promise<PooledConnection> {\n const resolved = resolveSMTPConfig(this.config);\n const conn = await createPooledConnection({\n config: this.config,\n maxMessages: this.maxMessages,\n connectHost: resolved.host,\n createAdapter: this.createAdapterFn,\n });\n this.connections.push(conn);\n return conn;\n }\n\n private removeConnection(conn: PooledConnection): void {\n const index = this.connections.indexOf(conn);\n if (index >= 0) {\n this.connections.splice(index, 1);\n }\n }\n\n private async drainQueue(): Promise<void> {\n while (this.queue.length > 0 || this.connections.some((c) => !c.idle)) {\n await this.processQueue();\n if (this.queue.length > 0) {\n await new Promise((r) => setTimeout(r, 10));\n }\n }\n }\n}\n\n/** @internal Exposed for deterministic rate limiter tests. */\nexport { RateLimiter };\n"
|
|
7
5
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "C06866950F09705E64756E2164756E21",
|
|
10
8
|
"names": []
|
|
11
9
|
}
|
package/dist/transports/retry.js
CHANGED
package/dist/transports/smtp.js
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
openSMTPSession,
|
|
6
6
|
readSMTPResponse,
|
|
7
7
|
resolveSMTPConfig
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-8sm0vz0n.js";
|
|
9
|
+
import"../chunk-ym3zzv8b.js";
|
|
9
10
|
import"../chunk-j6qw8ms6.js";
|
|
10
11
|
import {
|
|
11
12
|
encodeLine
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import"../chunk-ym3zzv8b.js";
|
|
13
|
+
} from "../chunk-sbydk09g.js";
|
|
14
14
|
import"../chunk-bvxkmq94.js";
|
|
15
15
|
import"../chunk-794hc3m4.js";
|
|
16
16
|
import"../chunk-v0bahtg2.js";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
SMTPTransport
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
//# debugId=
|
|
27
|
+
//# debugId=8C0FAE0AFD5EFFCA64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sently",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "Runtime-agnostic email library for Node.js, Bun, Deno, and Cloudflare Workers",
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "Runtime-agnostic email library for Node.js, Bun, Deno, and Cloudflare Workers. ESM-native Nodemailer alternative with zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -46,11 +46,24 @@
|
|
|
46
46
|
"smtp",
|
|
47
47
|
"mailer",
|
|
48
48
|
"nodemailer",
|
|
49
|
+
"nodemailer-alternative",
|
|
49
50
|
"bun",
|
|
50
51
|
"deno",
|
|
51
52
|
"cloudflare-workers",
|
|
52
53
|
"edge",
|
|
53
|
-
"runtime-agnostic"
|
|
54
|
+
"runtime-agnostic",
|
|
55
|
+
"resend",
|
|
56
|
+
"sendgrid",
|
|
57
|
+
"postmark",
|
|
58
|
+
"mailgun",
|
|
59
|
+
"ses",
|
|
60
|
+
"aws-ses",
|
|
61
|
+
"brevo",
|
|
62
|
+
"dkim",
|
|
63
|
+
"oauth2",
|
|
64
|
+
"transactional-email",
|
|
65
|
+
"esm",
|
|
66
|
+
"zero-dependencies"
|
|
54
67
|
],
|
|
55
68
|
"license": "MIT",
|
|
56
69
|
"engines": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/transports/smtp.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * @module\n * SMTP transport — orchestrates socket adapter, MIME builder, and protocol logic.\n *\n * @example\n * ```ts\n * import { SMTPTransport } from \"sently/transports/smtp\";\n * import { NodeAdapter } from \"sently/adapters/node\";\n * import { createMailer } from \"sently\";\n *\n * const mailer = await createMailer({\n * transport: new SMTPTransport({\n * host: \"smtp.example.com\",\n * auth: { user: \"you@example.com\", pass: \"secret\" },\n * adapter: new NodeAdapter(),\n * }),\n * });\n * ```\n */\nimport { OAuth2Client } from \"../auth/oauth2.js\";\nimport { buildMIME, type MIMEBuildResult } from \"../core/mime.js\";\nimport type { SMTPResponse } from \"../core/smtp.js\";\nimport {\n accumulateResponse,\n assertResponse,\n computeCRAMMD5,\n encodeAuthLoginPass,\n encodeAuthLoginUser,\n encodeCommand,\n encodeLine,\n parseEHLO,\n parseResponse,\n SMTPError,\n selectAuthMethod,\n} from \"../core/smtp.js\";\nimport type {\n MailOptions,\n SendResult,\n SMTPConfig,\n SocketAdapter,\n Transport,\n VerifyResult,\n} from \"../core/types.js\";\nimport { resolveAttachments } from \"./resolve-attachments.js\";\n\n/**\n * SMTP transport orchestrating adapter, MIME builder, and protocol logic.\n */\nexport class SMTPTransport implements Transport {\n private readonly config: ResolvedSMTPConfig;\n private adapter: SocketAdapter | null = null;\n\n /** Creates an SMTP transport with the given configuration. */\n constructor(config: SMTPConfig) {\n this.config = resolveSMTPConfig(config);\n }\n\n /** Sends an email via SMTP using the configured adapter. */\n async send(options: MailOptions): Promise<SendResult> {\n const resolvedOptions = {\n ...options,\n attachments: await resolveAttachments(options.attachments),\n };\n const mime = await buildMIME(resolvedOptions, this.config.dkim);\n const adapter = await this.getAdapter();\n\n const host = this.config.direct\n ? await resolveMX(mime.envelope.from.split(\"@\")[1] ?? this.config.host)\n : this.config.host;\n\n await adapter.connect(host, this.config.port);\n this.adapter = adapter;\n\n try {\n await openSMTPSession(adapter, this.config);\n return await deliverSMTPMessage(adapter, mime);\n } finally {\n await closeSMTPSession(adapter);\n this.adapter = null;\n }\n }\n\n /** Verifies SMTP connectivity and authentication without sending mail. */\n async verify(): Promise<VerifyResult> {\n try {\n const adapter = await this.getAdapter();\n await adapter.connect(this.config.host, this.config.port);\n\n try {\n await openSMTPSession(adapter, this.config);\n return { ok: true, provider: \"smtp\" };\n } finally {\n await closeSMTPSession(adapter);\n }\n } catch (err) {\n return {\n ok: false,\n provider: \"smtp\",\n message: err instanceof Error ? err.message : String(err),\n };\n }\n }\n\n /** Closes the underlying socket adapter if connected. */\n async close(): Promise<void> {\n if (this.adapter) {\n await this.adapter.close();\n this.adapter = null;\n }\n }\n\n private async getAdapter(): Promise<SocketAdapter> {\n if (!this.config.adapter) {\n throw new SMTPError(\"No socket adapter configured\", 0, \"CONNECT\", \"\");\n }\n return this.config.adapter;\n }\n}\n\n/** Resolved SMTP transport configuration with defaults applied. */\nexport interface ResolvedSMTPConfig {\n host: string;\n port: number;\n secure: boolean;\n auth?: SMTPConfig[\"auth\"];\n tls?: SMTPConfig[\"tls\"];\n dkim?: SMTPConfig[\"dkim\"];\n connectionTimeout?: number;\n greetingTimeout?: number;\n socketTimeout?: number;\n direct?: boolean;\n adapter?: SocketAdapter;\n}\n\n/** Apply defaults to SMTP configuration. */\nexport function resolveSMTPConfig(config: SMTPConfig): ResolvedSMTPConfig {\n const secure = config.secure ?? false;\n return {\n host: config.host,\n port: config.port ?? (secure ? 465 : 587),\n secure,\n ...(config.auth !== undefined ? { auth: config.auth } : {}),\n ...(config.dkim !== undefined ? { dkim: config.dkim } : {}),\n ...(config.tls !== undefined ? { tls: config.tls } : {}),\n ...(config.connectionTimeout !== undefined\n ? { connectionTimeout: config.connectionTimeout }\n : {}),\n ...(config.greetingTimeout !== undefined ? { greetingTimeout: config.greetingTimeout } : {}),\n ...(config.socketTimeout !== undefined ? { socketTimeout: config.socketTimeout } : {}),\n ...(config.direct !== undefined ? { direct: config.direct } : {}),\n ...(config.adapter !== undefined ? { adapter: config.adapter } : {}),\n };\n}\n\n/**\n * Connect greeting, EHLO, optional STARTTLS, and AUTH on an open adapter.\n */\nexport async function openSMTPSession(\n adapter: SocketAdapter,\n config: ResolvedSMTPConfig,\n): Promise<void> {\n const greeting = await readSMTPResponse(adapter);\n assertResponse(greeting, [220], \"greeting\");\n\n let capabilities = await ehlo(adapter, config.host);\n if (!config.secure && !adapter.secure) {\n await sendRaw(adapter, encodeCommand({ type: \"STARTTLS\" }));\n const starttlsResp = await readSMTPResponse(adapter);\n assertResponse(starttlsResp, [220], \"STARTTLS\");\n await adapter.startTLS(config.tls);\n capabilities = await ehlo(adapter, config.host);\n }\n\n if (config.auth) {\n await authenticate(adapter, config.auth, capabilities);\n }\n}\n\n/**\n * MAIL FROM, RCPT TO, and DATA for a built MIME message on an authenticated session.\n */\nexport async function deliverSMTPMessage(\n adapter: SocketAdapter,\n mime: MIMEBuildResult,\n): Promise<SendResult> {\n await sendCommand(adapter, { type: \"MAIL_FROM\", address: mime.envelope.from });\n const mailResp = await readSMTPResponse(adapter);\n assertResponse(mailResp, [250], \"MAIL FROM\");\n\n const accepted: string[] = [];\n const rejected: string[] = [];\n\n for (const recipient of mime.envelope.to) {\n await sendRaw(adapter, encodeCommand({ type: \"RCPT_TO\", address: recipient }));\n const rcptResp = await readSMTPResponse(adapter);\n if (rcptResp.isSuccess) {\n accepted.push(recipient);\n } else {\n rejected.push(recipient);\n }\n }\n\n await sendCommand(adapter, { type: \"DATA\" });\n const dataResp = await readSMTPResponse(adapter);\n assertResponse(dataResp, [354], \"DATA\");\n\n let finalResp: SMTPResponse;\n try {\n await sendRaw(adapter, encodeCommand({ type: \"DATA_BODY\", content: mime.raw }));\n finalResp = await readSMTPResponse(adapter);\n } catch (err) {\n await sendRaw(adapter, encodeCommand({ type: \"DATA_BODY\", content: mime.raw }));\n finalResp = await readSMTPResponse(adapter);\n if (finalResp.isError) {\n throw err;\n }\n }\n assertResponse(finalResp, [250], \"DATA end\");\n\n return {\n messageId: mime.messageId,\n accepted,\n rejected,\n response: finalResp.message,\n envelope: mime.envelope,\n };\n}\n\n/**\n * QUIT and close an SMTP session adapter.\n */\nexport async function closeSMTPSession(adapter: SocketAdapter): Promise<void> {\n try {\n await sendCommand(adapter, { type: \"QUIT\" });\n await readSMTPResponse(adapter);\n } catch {\n // ignore errors during shutdown\n } finally {\n await adapter.close();\n }\n}\n\nasync function ehlo(adapter: SocketAdapter, host: string): Promise<string[]> {\n await sendCommand(adapter, { type: \"EHLO\", domain: host });\n const response = await readSMTPResponse(adapter);\n assertResponse(response, [250], \"EHLO\");\n return parseEHLO(response);\n}\n\nasync function authenticate(\n adapter: SocketAdapter,\n auth: NonNullable<SMTPConfig[\"auth\"]>,\n capabilities: string[],\n): Promise<void> {\n if (auth.type === \"OAUTH2\" && auth.oauth2) {\n const client = new OAuth2Client(auth.oauth2);\n const xoauth2 = await client.buildXOAUTH2();\n await sendCommand(adapter, { type: \"AUTH_XOAUTH2\", xoauth2String: xoauth2 });\n let resp = await readSMTPResponse(adapter);\n if (resp.code === 334) {\n await sendRaw(adapter, encodeLine(\"\"));\n resp = await readSMTPResponse(adapter);\n }\n assertResponse(resp, [235], \"AUTH XOAUTH2\");\n return;\n }\n\n const method = auth.type ?? selectAuthMethod(capabilities);\n\n if (method === \"CRAM-MD5\") {\n const pass = requirePassword(auth, \"CRAM-MD5\");\n await sendCommand(adapter, { type: \"AUTH_CRAM_MD5_INIT\" });\n let resp = await readSMTPResponse(adapter);\n assertResponse(resp, [334], \"AUTH CRAM-MD5\");\n const challenge = resp.message.trim();\n const response = await computeCRAMMD5(challenge, auth.user, pass);\n await sendCommand(adapter, { type: \"AUTH_CRAM_MD5_RESPONSE\", response });\n resp = await readSMTPResponse(adapter);\n assertResponse(resp, [235], \"AUTH CRAM-MD5 response\");\n return;\n }\n\n if (method === \"PLAIN\") {\n const pass = requirePassword(auth, \"PLAIN\");\n await sendRaw(adapter, encodeCommand({ type: \"AUTH_PLAIN\", user: auth.user, pass }));\n const resp = await readSMTPResponse(adapter);\n assertResponse(resp, [235], \"AUTH PLAIN\");\n return;\n }\n\n const pass = requirePassword(auth, \"LOGIN\");\n await sendRaw(adapter, encodeCommand({ type: \"AUTH_LOGIN\", user: auth.user, pass }));\n let resp = await readSMTPResponse(adapter);\n assertResponse(resp, [334], \"AUTH LOGIN\");\n\n await sendRaw(adapter, encodeAuthLoginUser(auth.user));\n resp = await readSMTPResponse(adapter);\n assertResponse(resp, [334], \"AUTH LOGIN user\");\n\n await sendRaw(adapter, encodeAuthLoginPass(pass));\n resp = await readSMTPResponse(adapter);\n assertResponse(resp, [235], \"AUTH LOGIN pass\");\n}\n\nfunction requirePassword(auth: NonNullable<SMTPConfig[\"auth\"]>, method: string): string {\n if (!auth.pass) {\n throw new SMTPError(`Password required for ${method} authentication`, 0, `AUTH ${method}`, \"\");\n }\n return auth.pass;\n}\n\nasync function sendCommand(\n adapter: SocketAdapter,\n command: Parameters<typeof encodeCommand>[0],\n): Promise<void> {\n await sendRaw(adapter, encodeCommand(command));\n}\n\nasync function sendRaw(adapter: SocketAdapter, data: Uint8Array): Promise<void> {\n await adapter.write(data);\n}\n\n/** Reads and parses a complete SMTP response from the adapter. */\nasync function readSMTPResponse(adapter: SocketAdapter): Promise<SMTPResponse> {\n const chunks: Uint8Array[] = [];\n for await (const chunk of adapter.read()) {\n chunks.push(chunk);\n const complete = accumulateResponse(chunks);\n if (complete) {\n return parseResponse(complete);\n }\n }\n throw new SMTPError(\"Connection closed while reading SMTP response\", 0, \"READ\", \"\");\n}\n\nasync function resolveMX(domain: string): Promise<string> {\n const dns = await import(\"node:dns/promises\");\n const records = await dns.resolveMx(domain);\n if (records.length === 0) {\n throw new SMTPError(`No MX records for ${domain}`, 0, \"MX\", \"\");\n }\n records.sort((a: { priority: number }, b: { priority: number }) => a.priority - b.priority);\n return records[0]?.exchange ?? domain;\n}\n\n/** @internal Test helper for raw line writes. */\nexport { encodeLine, readSMTPResponse };\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,MAAM,cAAmC;AAAA,EAC7B;AAAA,EACT,UAAgC;AAAA,EAGxC,WAAW,CAAC,QAAoB;AAAA,IAC9B,KAAK,SAAS,kBAAkB,MAAM;AAAA;AAAA,OAIlC,KAAI,CAAC,SAA2C;AAAA,IACpD,MAAM,kBAAkB;AAAA,SACnB;AAAA,MACH,aAAa,MAAM,mBAAmB,QAAQ,WAAW;AAAA,IAC3D;AAAA,IACA,MAAM,OAAO,MAAM,UAAU,iBAAiB,KAAK,OAAO,IAAI;AAAA,IAC9D,MAAM,UAAU,MAAM,KAAK,WAAW;AAAA,IAEtC,MAAM,OAAO,KAAK,OAAO,SACrB,MAAM,UAAU,KAAK,SAAS,KAAK,MAAM,GAAG,EAAE,MAAM,KAAK,OAAO,IAAI,IACpE,KAAK,OAAO;AAAA,IAEhB,MAAM,QAAQ,QAAQ,MAAM,KAAK,OAAO,IAAI;AAAA,IAC5C,KAAK,UAAU;AAAA,IAEf,IAAI;AAAA,MACF,MAAM,gBAAgB,SAAS,KAAK,MAAM;AAAA,MAC1C,OAAO,MAAM,mBAAmB,SAAS,IAAI;AAAA,cAC7C;AAAA,MAC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