Vigia

Memperbarui @nestjs-modules/mailer dari 3.x ke 4.x

Perbandingan API publik @nestjs-modules/mailer 3.0.2 dan 4.0.0, dihitung otomatis dari tipe TypeScript-nya. Tanda tangan yang berubah adalah kemungkinan perubahan tidak kompatibel, bukan kepastian.

Ringkasan

Jalur impor yang dihapus0
Ekspor yang dihapus0
Tanda tangan yang berubah0
Anggota kelas atau antarmuka yang dihapus1
Anggota kelas atau antarmuka yang berubah3
Baru ditandai usang0
Perubahan persyaratan (engines, dependensi peer)3
Ekspor baru64

Ekspor yang dihapus

Tidak ada yang terdeteksi.

Tanda tangan yang berubah

Tidak ada yang terdeteksi.

Anggota kelas atau antarmuka yang dihapus

memberimportSebelum
MailerService.executeSend@nestjs-modules/mailerany

Anggota kelas atau antarmuka yang berubah

memberSebelumSesudah
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

Baru ditandai usang

Tidak ada yang terdeteksi.

Perubahan persyaratan (engines, dependensi peer)

SebelumSesudah
peerDependencies.handlebars>=4.7.9>=4.7.10
peerDependencies.@nestjs/mail—>=0.0.1
peerDependencies.@nestjs/outbox—>=0.1.3
Ekspor baru (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 di antara versi ini

Teks yang diterbitkan oleh penulis paket, ditampilkan apa adanya.

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

Berikan fakta ini ke agen AI Anda

Vigia adalah server MCP gratis: agen coding Anda memeriksa versi, perubahan yang merusak kompatibilitas, dan kerentanan sebelum menulis kode. Tanpa pendaftaran, tanpa kunci API.

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

Tambahkan ke CursorTambahkan ke VS Code★ Bintang di GitHub

Klien MCP lainnya
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }

Skill agen (SKILL.md): memberi tahu agen kapan memakai Vigia · GitHub Action untuk pull request

Pertanyaan umum

Apa saja perubahan tidak kompatibel saat memperbarui @nestjs-modules/mailer dari 3 ke 4?

Antara @nestjs-modules/mailer 3.0.2 dan 4.0.0, Vigia menemukan 0 ekspor yang dihapus, 0 tanda tangan yang berubah, dan 4 anggota kelas atau antarmuka yang dihapus atau berubah.

Apa yang ditandai usang di @nestjs-modules/mailer 4?

0 ekspor atau anggota baru ditandai usang di @nestjs-modules/mailer 4.0.0.

Untuk agen

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