Vigia

Nâng cấp @nestjs-modules/mailer từ 3.x lên 4.x

So sánh API công khai của @nestjs-modules/mailer 3.0.2 và 4.0.0, được tính tự động từ kiểu TypeScript. Chữ ký thay đổi là thay đổi có thể không tương thích, không phải điều chắc chắn.

Tóm tắt

Đường dẫn import bị xóa0
Export bị xóa0
Chữ ký thay đổi0
Thành viên lớp hoặc interface bị xóa1
Thành viên lớp hoặc interface thay đổi3
Mới bị ngừng hỗ trợ0
Thay đổi yêu cầu (engines, phụ thuộc peer)3
Export mới64

Export bị xóa

Không phát hiện.

Chữ ký thay đổi

Không phát hiện.

Thành viên lớp hoặc interface bị xóa

memberimportTrước
MailerService.executeSend@nestjs-modules/mailerany

Thành viên lớp hoặc interface thay đổi

memberTrướcSau
MailerService.constructor(mailerOptions: MailerOptions, transportFactory: MailerTransportFactory, eventService?: MailerEventService | undefined): MailerService(mailerOptions: MailerOptions, transportFactory?: MailerTransportFactory | undefined, eventService?: MailerEventService | undefined, moduleRef?: any): MailerService
MailerTestModule.static register(options?: Partial<{ template: { dir?: string | undefined; adapter?: any; options?: any; }; }> | undefined): DynamicModule(options?: Omit<MailerOptions, "transport" | "transports"> | undefined): DynamicModule
MailerEventService.constructor(eventEmitter?: any): MailerEventService(eventEmitter?: MailerEventEmitter | undefined, moduleRef?: any): MailerEventService

Mới bị ngừng hỗ trợ

Không phát hiện.

Thay đổi yêu cầu (engines, phụ thuộc peer)

TrướcSau
peerDependencies.handlebars>=4.7.9>=4.7.10
peerDependencies.@nestjs/mail—>=0.0.1
peerDependencies.@nestjs/outbox—>=0.1.3
Export mới (64)
importexportkind
@nestjs-modules/mailerhtmlfunction
@nestjs-modules/mailersignV4function
@nestjs-modules/mailerMailableinterface
@nestjs-modules/mailerSafeHtmlclass
@nestjs-modules/mailerMailQueryinterface
@nestjs-modules/mailerhtmlToTextfunction
@nestjs-modules/mailerisSafeHtmlfunction
@nestjs-modules/mailerunsafeHtmlfunction
@nestjs-modules/mailerMailerErrorclass
@nestjs-modules/mailerTestMailboxclass
@nestjs-modules/mailerCapturedMailclass
@nestjs-modules/mailerLogTransportclass
@nestjs-modules/mailerMailableDatatype
@nestjs-modules/mailerRenderedMailinterface
@nestjs-modules/mailerSesTransportclass
@nestjs-modules/mailerSigV4Optionsinterface
@nestjs-modules/mailerSigV4Requestinterface
@nestjs-modules/mailerFileTransportclass
@nestjs-modules/mailerMailerPreviewtype
@nestjs-modules/mailertoMailerErrorfunction
@nestjs-modules/mailerAwsCredentialsinterface
@nestjs-modules/mailerBrevoTransportclass
@nestjs-modules/mailerSigV4Signatureinterface
@nestjs-modules/mailerLOCAL_TRANSPORTvariable
@nestjs-modules/mailerMailableContenttype
@nestjs-modules/mailerMailableContextinterface
@nestjs-modules/mailerMailerSmtpErrorclass
@nestjs-modules/mailerResendTransportclass
@nestjs-modules/mailerparseRetryAfterfunction
@nestjs-modules/mailervalidateMessagefunction
@nestjs-modules/mailerInterceptOptionsinterface
@nestjs-modules/mailerMailgunTransportclass
@nestjs-modules/mailerisTransientErrorfunction
@nestjs-modules/mailerMailerEventRecordinterface
@nestjs-modules/mailerPostmarkTransportclass
@nestjs-modules/mailerSendGridTransportclass
@nestjs-modules/mailermailerChannelNamefunction
@nestjs-modules/mailerMailerEventEmitterinterface
@nestjs-modules/mailerMailerMessageErrorclass
@nestjs-modules/mailerMailerRetryOptionsinterface
@nestjs-modules/mailerMailerTimeoutErrorclass
@nestjs-modules/mailerUnsubscribeOptionsinterface
@nestjs-modules/mailerHttpSentMessageInfointerface
@nestjs-modules/mailerLogTransportOptionsinterface
@nestjs-modules/mailerMailableSendOptionstype
@nestjs-modules/mailerMailerPreviewModuleclass
@nestjs-modules/mailerMailerProviderErrorclass
@nestjs-modules/mailerMailerTemplateErrorclass
@nestjs-modules/mailerSesTransportOptionsinterface
@nestjs-modules/mailerFileTransportOptionsinterface
@nestjs-modules/mailerHttpTransportOptionsinterface
@nestjs-modules/mailerMAILER_EVENT_EMITTERvariable
@nestjs-modules/mailerMailerPreviewOptionsinterface
@nestjs-modules/mailermayHaveBeenDeliveredfunction
@nestjs-modules/mailerBrevoTransportOptionsinterface
@nestjs-modules/mailerHttpProviderTransportclass
@nestjs-modules/mailerMailerConnectionErrorclass
@nestjs-modules/mailerSuppressedMessageInfointerface
@nestjs-modules/mailerMAILER_PREVIEW_OPTIONSvariable
@nestjs-modules/mailerResendTransportOptionsinterface
@nestjs-modules/mailerMailgunTransportOptionsinterface
@nestjs-modules/mailerPostmarkTransportOptionsinterface
@nestjs-modules/mailerSendGridTransportOptionsinterface
@nestjs-modules/mailerMailerRecipientsRejectedErrorclass

Changelog giữa các phiên bản này

Văn bản do tác giả gói công bố, hiển thị nguyên trạng.

4.0.0
### Major Changes

- [#1353](https://github.com/nest-modules/mailer/pull/1353) [`c8c0423`](https://github.com/nest-modules/mailer/commit/c8c0423749bd8f0f7d0f247e62ee5ab7a55f6535) Thanks [@juandav](https://github.com/juandav)! - v4: everything the official `@nestjs/mail` offers and more, without dropping anything v3 supports. Every capability is optional: use nodemailer, the built-in HTTP providers or `@nestjs/mail`'s transports; send directly, through BullMQ or through `@nestjs/outbox`; call `sendMail`, mail classes or the official `Mailer` over this module.
  
  **Breaking changes** (see the [migration guide](https://nest-modules.github.io/mailer/guide/migration)):
  
  - Transient failures are retried by default (3 attempts with backoff); `retry: false` restores v3. A timeout or a dropped connection while the message was being handed over is retried only when the email has a stable Message-ID (`idempotencyKey`), so nothing is sent twice. `sendTimeout` applies per attempt.
  - Errors from transports are typed (`MailerSmtpError`, `MailerTimeoutError`, … all `MailerError`), keeping nodemailer's fields and the original as `cause`; `wrapErrors: false` restores v3.
  - Emails without a text part get one derived from the HTML (`textFromHtml: false` to opt out), and messages are validated before sending (`validate: false` to opt out).
  - `MailerTestModule` delivers to a `TestMailbox` (no stream transport; `info.message` uses CRLF line endings) and defaults `retry` to `false`.
  - `MailerPreviewModule` is on by default only when `NODE_ENV` is `development` or `test`.
  - Event payloads carry `attempt`, `permanent`, `transporterName` and `durationMs`; `MailerEventService` takes its emitter through `MAILER_EVENT_EMITTER`, and `EventEmitter2` is found automatically (in v3 it was never injected).
  - `MailableContext.to` is `{ name?, address }[]`, the same shape as `@nestjs/mail`.
  
  **New**
  
  - Mail classes (`mailerService.send(WelcomeMail, { to, data })`) compatible with `@nestjs/mail`'s, with dependencies resolved from the whole app, and `render()` to render without sending.
  - Retries with backoff and error classification (nodemailer, HTTP and AWS SDK errors), failover between transporters, `AbortSignal`, `idempotencyKey`, and graceful shutdown that waits for sends in flight (`shutdownTimeout`).
  - Zero-dependency HTTP transports: Resend, Postmark, SendGrid, SES (SigV4), Mailgun and Brevo.
  - The `html` tagged template (`unsafeHtml()` for trusted markup), `htmlToText()` and message validation.
  - `intercept` (redirect recipients in staging), `suppress` (suppression lists) and one-click `unsubscribe` (RFC 8058).
  - `TestMailbox` with assertions, `FileTransport` and `LogTransport` (with a warning when used in production) and `MailerPreviewModule` to preview emails in the browser.
  - `events$`, `node:diagnostics_channel` publishing (credentials redacted), and `RETRY`, `FAILOVER` and `SUPPRESSED` events.
  - BullMQ: permanent failures fail the j

Cung cấp dữ liệu này cho tác tử AI của bạn

Vigia là máy chủ MCP miễn phí: tác tử lập trình của bạn kiểm tra phiên bản, thay đổi phá vỡ tương thích và lỗ hổng trước khi viết mã. Không cần đăng ký, không cần khóa API.

claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp

Thêm vào CursorThêm vào VS Code★ Gắn sao trên GitHub

Mọi ứng dụng MCP khác
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }

Kỹ năng cho tác tử (SKILL.md): cho tác tử biết khi nào dùng Vigia · GitHub Action cho pull request

Câu hỏi thường gặp

Nâng cấp @nestjs-modules/mailer từ 3 lên 4 có những thay đổi không tương thích nào?

Giữa @nestjs-modules/mailer 3.0.2 và 4.0.0, Vigia tìm thấy 0 export bị xóa, 0 chữ ký thay đổi và 4 thành viên lớp hoặc interface bị xóa hay thay đổi.

Những gì bị ngừng hỗ trợ trong @nestjs-modules/mailer 4?

0 export hoặc thành viên mới bị đánh dấu ngừng hỗ trợ trong @nestjs-modules/mailer 4.0.0.

Dành cho tác tử

GET https://vigia.coredls.cloud/v1/packages/npm/@nestjs-modules/mailer/upgrade?from=3.0.2&to=4.0.0