weifuwu 0.27.3 → 0.27.4
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/README.md +0 -19
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -26
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -407,24 +407,6 @@ Options: `dir`, `defaultLocale`, `cookie`, `param`, `header`
|
|
|
407
407
|
|
|
408
408
|
### Standalone utilities
|
|
409
409
|
|
|
410
|
-
#### mailer()
|
|
411
|
-
|
|
412
|
-
```ts
|
|
413
|
-
import { mailer } from 'weifuwu'
|
|
414
|
-
|
|
415
|
-
const m = mailer({
|
|
416
|
-
host: 'smtp.example.com',
|
|
417
|
-
port: 587,
|
|
418
|
-
auth: { user: '...', pass: '...' },
|
|
419
|
-
from: 'noreply@example.com',
|
|
420
|
-
})
|
|
421
|
-
|
|
422
|
-
await m.send({ to: 'user@example.com', subject: 'Hello', text: '...' })
|
|
423
|
-
await m.close()
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
Options: `host`, `port`, `auth`, `from`, `secure`
|
|
427
|
-
|
|
428
410
|
#### SSE
|
|
429
411
|
|
|
430
412
|
```ts
|
|
@@ -519,6 +501,5 @@ Creates a minimal API project with `app.ts`, `index.ts`, and TypeScript config.
|
|
|
519
501
|
- `graphql`, `@graphql-tools/schema` — GraphQL
|
|
520
502
|
- `ws` — WebSocket
|
|
521
503
|
- `zod` — Schema validation
|
|
522
|
-
- `nodemailer` — Email
|
|
523
504
|
|
|
524
505
|
Zero build tools. Zero frontend framework dependencies.
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,5 @@ export { i18n } from './middleware/i18n.ts';
|
|
|
55
55
|
export type { I18nOptions, I18nInjected } from './middleware/i18n.ts';
|
|
56
56
|
export { flash } from './middleware/flash.ts';
|
|
57
57
|
export type { FlashOptions, FlashInjected, FlashModule } from './middleware/flash.ts';
|
|
58
|
-
export { mailer } from './mailer.ts';
|
|
59
|
-
export type { MailerOptions, MailOptions, Mailer } from './mailer.ts';
|
|
60
58
|
export { csrf } from './middleware/csrf.ts';
|
|
61
59
|
export type { CsrfOptions, CsrfInjected, CsrfModule } from './middleware/csrf.ts';
|
package/dist/index.js
CHANGED
|
@@ -3828,31 +3828,6 @@ function flash(options) {
|
|
|
3828
3828
|
return mw;
|
|
3829
3829
|
}
|
|
3830
3830
|
|
|
3831
|
-
// mailer.ts
|
|
3832
|
-
import { createTransport } from "nodemailer";
|
|
3833
|
-
function mailer(options) {
|
|
3834
|
-
const sender = options.send;
|
|
3835
|
-
const from = options.from;
|
|
3836
|
-
let transporter = null;
|
|
3837
|
-
if (!sender && options.transport) {
|
|
3838
|
-
transporter = typeof options.transport === "string" ? createTransport(options.transport) : options.transport;
|
|
3839
|
-
}
|
|
3840
|
-
async function send(opts) {
|
|
3841
|
-
if (sender) {
|
|
3842
|
-
await sender(opts);
|
|
3843
|
-
return;
|
|
3844
|
-
}
|
|
3845
|
-
if (!transporter) {
|
|
3846
|
-
throw new Error("mailer: no transport configured \u2014 provide `transport` or `send` option");
|
|
3847
|
-
}
|
|
3848
|
-
await transporter.sendMail({ ...opts, from: opts.from ?? from });
|
|
3849
|
-
}
|
|
3850
|
-
async function close() {
|
|
3851
|
-
transporter?.close();
|
|
3852
|
-
}
|
|
3853
|
-
return { send, close };
|
|
3854
|
-
}
|
|
3855
|
-
|
|
3856
3831
|
// middleware/csrf.ts
|
|
3857
3832
|
function csrf(options) {
|
|
3858
3833
|
const cookieName = options?.cookie ?? "_csrf";
|
|
@@ -3938,7 +3913,6 @@ export {
|
|
|
3938
3913
|
isProd,
|
|
3939
3914
|
loadEnv,
|
|
3940
3915
|
logger,
|
|
3941
|
-
mailer,
|
|
3942
3916
|
openai,
|
|
3943
3917
|
postgres,
|
|
3944
3918
|
queue,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weifuwu",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.4",
|
|
5
5
|
"description": "Web-standard HTTP microframework for Node.js — (req, ctx) => Response",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js"
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"ai": "^6",
|
|
32
32
|
"graphql": "^16",
|
|
33
33
|
"ioredis": "^5.11.0",
|
|
34
|
-
"nodemailer": "^8.0.10",
|
|
35
34
|
"postgres": "^3.4.9",
|
|
36
35
|
"ws": "^8",
|
|
37
36
|
"zod": "^4.4.3"
|
|
@@ -48,7 +47,6 @@
|
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@eslint/js": "^10.0.1",
|
|
50
49
|
"@types/node": "^25.9.3",
|
|
51
|
-
"@types/nodemailer": "^6.4.17",
|
|
52
50
|
"@types/ws": "^8.18.1",
|
|
53
51
|
"esbuild": "^0.28.0",
|
|
54
52
|
"eslint": "^10.5.0",
|