Vigia

Оновлення @nestjs-modules/mailer з 3.x до 4.x

Порівняння публічного API @nestjs-modules/mailer 3.0.2 і 4.0.0, обчислене автоматично за їхніми типами TypeScript. Змінена сигнатура — можлива несумісна зміна, а не гарантія.

Підсумок

Видалені шляхи імпорту0
Видалені експорти0
Змінені сигнатури0
Видалені члени класів або інтерфейсів1
Змінені члени класів або інтерфейсів3
Нові застарівання0
Зміни вимог (engines, peer-залежності)3
Нові експорти64

Видалені експорти

Не виявлено.

Змінені сигнатури

Не виявлено.

Видалені члени класів або інтерфейсів

memberimportБуло
MailerService.executeSend@nestjs-modules/mailerany

Змінені члени класів або інтерфейсів

memberБулоСтало
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

Нові застарівання

Не виявлено.

Зміни вимог (engines, peer-залежності)

БулоСтало
peerDependencies.handlebars>=4.7.9>=4.7.10
peerDependencies.@nestjs/mail—>=0.0.1
peerDependencies.@nestjs/outbox—>=0.1.3
Нові експорти (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 між цими версіями

Текст, опублікований авторами пакета, показано без змін.

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

Передайте ці дані своєму ШІ-агенту

Vigia — безкоштовний MCP-сервер: ваш агент для програмування перевіряє версії, несумісні зміни та вразливості, перш ніж писати код. Без реєстрації та API-ключа.

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

Додати в CursorДодати в VS Code★ Зірка на GitHub

Будь-який інший MCP-клієнт
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }

Навичка для агентів (SKILL.md): підказує агенту, коли використовувати Vigia · GitHub Action для pull request

Поширені запитання

Які несумісні зміни під час оновлення @nestjs-modules/mailer з 3 до 4?

Між @nestjs-modules/mailer 3.0.2 і 4.0.0 Vigia знайшла видалених експортів: 0, змінених сигнатур: 0, видалених або змінених членів класів та інтерфейсів: 4.

Що застаріло в @nestjs-modules/mailer 4?

У @nestjs-modules/mailer 4.0.0 новими застарілими позначено експортів або членів: 0.

Для агентів

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