@orieljs/mail 0.1.0-alpha.6 → 0.1.0-alpha.7

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/NOTICE CHANGED
@@ -10,3 +10,7 @@ The Oriel name and logo are not covered by that license; see TRADEMARKS.md
10
10
 
11
11
  @orieljs/support (and @orieljs/framework, which bundles it) includes transliteration data from
12
12
  voku/portable-ascii (https://github.com/voku/portable-ascii), Copyright (C) 2019 Lars Moelleken, MIT License.
13
+
14
+ @orieljs/notifications (and @orieljs/framework, which bundles it) includes the HTML and CSS of
15
+ Laravel's default notification mail (laravel/framework, https://github.com/laravel/framework),
16
+ Copyright (c) Taylor Otwell, MIT License.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @orieljs/mail
2
+
3
+ Mail for Oriel: mailables with an envelope and TSX views, the `Mail` facade, queued mail, and SMTP, log, array and failover transports. It is Oriel's counterpart of Laravel's mailer. Mail is part of `@orieljs/framework`, which every Oriel app already installs, and is re-exported from it. In an app, import it from `@orieljs/framework`; `@orieljs/mail` is also published on its own.
4
+
5
+ ```bash
6
+ npm install @orieljs/framework
7
+ ```
8
+
9
+ ```ts title="app/Mail/PostPublished.ts"
10
+ import { Mailable } from '@orieljs/framework'
11
+ import type { Content, Envelope } from '@orieljs/framework/contracts'
12
+ import type { Post } from '../Models/Post'
13
+
14
+ export class PostPublished extends Mailable {
15
+ constructor(public post: Post) {
16
+ super()
17
+ }
18
+
19
+ override async envelope(): Promise<Envelope> {
20
+ return { subject: `Published: ${this.post.title}` }
21
+ }
22
+
23
+ override async content(): Promise<Content> {
24
+ return { view: 'mail.post-published', with: { post: this.post } }
25
+ }
26
+ }
27
+ ```
28
+
29
+ Send it with `await Mail.to(user).send(new PostPublished(post))`, or with `queue()` or `later(seconds, mailable)` in place of `send()` to send it from the queue worker; `Mail.mailer(name)` picks a mailer from `config/mail.ts`. `node oriel make:mail PostPublished` writes the mailable, with `readonly shouldQueue = true` so `send()` queues it, and its TSX view, `resources/views/mail/post-published.tsx`. Imported from `@orieljs/framework`, `Mail.fake()` records mail in tests.
30
+
31
+ Documentation: https://orieljs.vercel.app/docs/mail
32
+
33
+ Status: early alpha. APIs will change.
34
+
35
+ ## License
36
+
37
+ Oriel is open-source software licensed under the Apache License 2.0 (Apache-2.0; see `LICENSE` and `NOTICE`). The Oriel name and logo are trademarks; see `TRADEMARKS.md`.
38
+
39
+ Website: https://orieljs.vercel.app
package/TRADEMARKS.md ADDED
@@ -0,0 +1,33 @@
1
+ # Oriel trademark policy
2
+
3
+ The Oriel code is open source under the Apache License 2.0. The **Oriel name and logo** are not: the license covers
4
+ the code only (section 6 of the license says so), and the name and logo stay with the project. This page explains
5
+ what you can and can't do with them. The goal is simple: people should always be able to tell what is the real Oriel
6
+ and what isn't.
7
+
8
+ ## You can, without asking
9
+
10
+ - Use, change, ship and sell the code, as the license allows.
11
+ - Say that your app or package is "built with Oriel", "for Oriel" or "compatible with Oriel".
12
+ - Name a package `oriel-<something>` or `<something>-for-oriel` when it works with Oriel, as long as it is clear that
13
+ it is not official (for example, don't publish it under the `@orieljs` npm scope).
14
+ - Use the name and logo to write about Oriel, teach it, or link to it, in articles, talks, videos and courses.
15
+ - Use the unmodified logo to point to the project, as it is (no recolouring, cropping or
16
+ distortion).
17
+
18
+ ## You can't, without written permission
19
+
20
+ - Call a fork, a modified copy or a competing product "Oriel", or anything likely to be confused with it.
21
+ - Use the name or logo as the name, logo or domain of your own product, company or service.
22
+ - Suggest that the Oriel project made, endorses or supports your work when it doesn't.
23
+ - Sell merchandise with the name or logo.
24
+
25
+ ## Forks
26
+
27
+ Forks are welcome. Please give yours a different name and logo, keep the `LICENSE` and `NOTICE` files, and say that
28
+ it is based on Oriel.
29
+
30
+ ## Questions
31
+
32
+ Open an issue at https://github.com/orieljs/framework or email meeeet.dev@gmail.com. If you're unsure whether a use
33
+ is fine, ask; the answer is usually yes.
package/dist/index.d.ts CHANGED
@@ -178,7 +178,8 @@ declare const QueuedMailSender: _orieljs_contracts.Token<QueuedMailSender>;
178
178
  * Carries `SHOULD_QUEUE` on its own prototype, per the Queue/Bus protocol, so `BusDispatcher.dispatch()` — which
179
179
  * re-decides queued-or-now on whatever job it's handed — actually enqueues it instead of running it inline; the
180
180
  * mailable's own queueability (checked by MailerImpl) only decides whether to wrap it at all. Like Laravel's
181
- * SendQueuedMailable, it forwards failed(), retryUntil(), middleware() and displayName() to the mailable.
181
+ * SendQueuedMailable, it forwards failed(), retryUntil(), middleware() and displayName() to the mailable. Unlike
182
+ * Laravel's, it is unique when the mailable is (Laravel pushes a mailable straight to the queue, past the unique lock).
182
183
  */
183
184
  declare class SendQueuedMailable implements Job {
184
185
  readonly mailerName: string | undefined;
package/dist/index.js CHANGED
@@ -251,6 +251,20 @@ var Mailable = class {
251
251
 
252
252
  // symbols.ts
253
253
  var SHOULD_QUEUE = /* @__PURE__ */ Symbol.for("oriel:bus.shouldQueue");
254
+ var UNIQUE = /* @__PURE__ */ Symbol.for("oriel:bus.unique");
255
+ function uniqueSpecOf(target, name) {
256
+ const members = target;
257
+ const declared = typeof members.uniqueId === "function" || members.uniqueFor !== void 0 || members.uniqueUntilProcessing === true || typeof members.uniqueVia === "function";
258
+ if (!declared) return void 0;
259
+ const id = typeof members.uniqueId === "function" ? members.uniqueId.call(target) : void 0;
260
+ const spec = { name, id: id === void 0 || id === null ? "" : String(id) };
261
+ const uniqueFor = typeof members.uniqueFor === "function" ? members.uniqueFor.call(target) : members.uniqueFor;
262
+ if (typeof uniqueFor === "number") spec.for = uniqueFor;
263
+ if (members.uniqueUntilProcessing === true) spec.untilProcessing = true;
264
+ const via = typeof members.uniqueVia === "function" ? members.uniqueVia.call(target) : void 0;
265
+ if (typeof via === "string") spec.via = via;
266
+ return spec;
267
+ }
254
268
 
255
269
  // Mailer.ts
256
270
  import {
@@ -364,6 +378,7 @@ import { token } from "@orieljs/contracts";
364
378
  var QueuedMailSender = token("Mail.QueuedMailSender");
365
379
 
366
380
  // Jobs/SendQueuedMailable.ts
381
+ import { createHash } from "crypto";
367
382
  import { inject } from "@orieljs/container";
368
383
  var QUEUE_OPTIONS = [
369
384
  "connection",
@@ -381,6 +396,12 @@ function copyShouldQueueFields(target, source) {
381
396
  if (fields[option] !== void 0) target[option] = fields[option];
382
397
  }
383
398
  }
399
+ function recipientsHash(to = [], cc = [], bcc = []) {
400
+ if (to.length + cc.length + bcc.length === 0) return void 0;
401
+ const addresses = (list) => list.map((recipient) => recipient.address);
402
+ const recipients = JSON.stringify({ to: addresses(to), cc: addresses(cc), bcc: addresses(bcc) });
403
+ return createHash("sha1").update(recipients).digest("hex");
404
+ }
384
405
  var SendQueuedMailable = class {
385
406
  constructor(mailerName, mailable, to, cc, bcc) {
386
407
  this.mailerName = mailerName;
@@ -389,6 +410,12 @@ var SendQueuedMailable = class {
389
410
  this.cc = cc;
390
411
  this.bcc = bcc;
391
412
  copyShouldQueueFields(this, mailable);
413
+ const unique = uniqueSpecOf(mailable, mailable.constructor.name);
414
+ if (unique) {
415
+ const recipients = recipientsHash(to, cc, bcc);
416
+ if (recipients !== void 0) unique.id += `:${recipients}`;
417
+ this[UNIQUE] = unique;
418
+ }
392
419
  }
393
420
  mailerName;
394
421
  mailable;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../errors.ts","../address.ts","../transports/ArrayTransport.ts","../transports/LogTransport.ts","../transports/FailoverTransport.ts","../transports/SmtpTransport.ts","../render.ts","../Mailable.ts","../symbols.ts","../Mailer.ts","../QueuedMailSender.ts","../Jobs/SendQueuedMailable.ts","../MailManager.ts","../facade.ts","../MailServiceProvider.ts"],"sourcesContent":["import type { OrielError } from '@orieljs/contracts'\n\nexport class UnknownMailerError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'UnknownMailerError'\n constructor(name: string) {\n super(`Mailer [${name}] is not configured. Add it to config('mail.mailers').`)\n }\n}\n\nexport class UnknownMailTransportError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'UnknownMailTransportError'\n constructor(transport: string) {\n super(`Mail transport [${transport}] is not supported. Register it first with MailManager.extend().`)\n }\n}\n\nexport class MissingRecipientError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'MissingRecipientError'\n constructor() {\n super('Cannot send mail: no recipients. Set envelope().to, or call Mail.to(...).send(mailable).')\n }\n}\n\nexport class MailQueueUnavailableError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'MailQueueUnavailableError'\n constructor() {\n super('Queueing mail requires the Bus component. Register BusDispatcher, or call send() instead of queue()/later().')\n }\n}\n\nexport class ViewFactoryUnavailableError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'ViewFactoryUnavailableError'\n constructor(view: string) {\n super(`Cannot render the [${view}] mail view: the View component isn't registered (ViewFactory is unbound).`)\n }\n}\n\nexport class AllMailersFailedError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'AllMailersFailedError'\n constructor(\n readonly mailers: string[],\n readonly causes: unknown[],\n ) {\n super(`All failover mailers failed: ${mailers.join(', ')}. Last error: ${String(causes.at(-1))}`, {\n cause: causes.at(-1),\n })\n }\n}\n","import type { Address, MailRecipient } from '@orieljs/contracts'\n\n/** A MailRecipient is a bare string, an Address, or anything with `email` (+ optional `name`), such as a User model. */\nexport function normalizeAddress(recipient: MailRecipient): Address {\n if (typeof recipient === 'string') return { address: recipient }\n if ('address' in recipient) return { address: recipient.address, name: recipient.name }\n return { address: recipient.email, name: recipient.name }\n}\n\nexport function normalizeAddresses(recipients: MailRecipient | MailRecipient[] | undefined): Address[] {\n if (recipients === undefined) return []\n const list = Array.isArray(recipients) ? recipients : [recipients]\n return list.map(normalizeAddress)\n}\n\nexport function formatAddress(address: Address): string {\n return address.name ? `${address.name} <${address.address}>` : address.address\n}\n","import { randomUUID } from 'node:crypto'\nimport type { MailTransport, OutgoingMessage, SentMessage } from '@orieljs/contracts'\n\n/** In-memory transport backing the `array` mailer: never leaves the process, so tests can inspect `sent`. */\nexport class ArrayTransport implements MailTransport {\n readonly sent: OutgoingMessage[] = []\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n this.sent.push(message)\n return { messageId: randomUUID(), message }\n }\n\n flush(): void {\n this.sent.length = 0\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { LogManager as LogManagerToken, type MailTransport, type OutgoingMessage, type SentMessage } from '@orieljs/contracts'\nimport { currentContainer } from '@orieljs/container'\nimport { formatAddress } from '../address'\n\n/** Writes the message through LogManager (a channel from config, or the default channel) when bound, else console.log. */\nexport class LogTransport implements MailTransport {\n constructor(private readonly channel?: string) {}\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n const dump = formatMessage(message)\n const container = currentContainer()\n if (container?.bound(LogManagerToken)) {\n const manager = container.make(LogManagerToken)\n const logger = this.channel ? manager.channel(this.channel) : manager\n logger.info(dump)\n } else {\n console.log(dump)\n }\n return { messageId: randomUUID(), message }\n }\n}\n\nfunction formatMessage(message: OutgoingMessage): string {\n const lines = [\n `To: ${message.to.map(formatAddress).join(', ')}`,\n message.cc.length > 0 ? `Cc: ${message.cc.map(formatAddress).join(', ')}` : undefined,\n message.bcc.length > 0 ? `Bcc: ${message.bcc.map(formatAddress).join(', ')}` : undefined,\n `From: ${formatAddress(message.from)}`,\n `Subject: ${message.subject}`,\n '',\n message.text ?? stripHtml(message.html ?? ''),\n ]\n return lines.filter((line): line is string => line !== undefined).join('\\n')\n}\n\nfunction stripHtml(html: string): string {\n return html.replace(/<[^>]*>/g, '')\n}\n","import type { MailTransport, OutgoingMessage, SentMessage } from '@orieljs/contracts'\nimport { AllMailersFailedError } from '../errors'\n\n/** Tries each transport in order, returning the first success (Laravel's `failover` mailer). */\nexport class FailoverTransport implements MailTransport {\n constructor(\n private readonly transports: MailTransport[],\n private readonly names: string[],\n ) {}\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n const causes: unknown[] = []\n for (const transport of this.transports) {\n try {\n return await transport.send(message)\n } catch (error) {\n causes.push(error)\n }\n }\n throw new AllMailersFailedError(this.names, causes)\n }\n}\n","import nodemailer from 'nodemailer'\nimport type { MailTransport, OutgoingMessage, SentMessage } from '@orieljs/contracts'\nimport { formatAddress } from '../address'\n\nexport interface SmtpConfig {\n host: string\n port: number\n encryption?: 'tls' | 'ssl' | null\n username?: string\n password?: string\n}\n\n/** The minimal nodemailer surface this transport needs — lets tests inject a fake without a real Transporter. */\nexport interface MailTransporter {\n sendMail(options: Record<string, unknown>): Promise<{ messageId: string }>\n}\n\nexport type TransporterFactory = (config: SmtpConfig) => MailTransporter\n\nconst defaultFactory: TransporterFactory = (config) =>\n nodemailer.createTransport({\n host: config.host,\n port: config.port,\n secure: config.encryption === 'ssl',\n requireTLS: config.encryption === 'tls',\n auth: config.username ? { user: config.username, pass: config.password } : undefined,\n })\n\nexport class SmtpTransport implements MailTransport {\n private readonly transporter: MailTransporter\n\n constructor(config: SmtpConfig, factory: TransporterFactory = defaultFactory) {\n this.transporter = factory(config)\n }\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n const info = await this.transporter.sendMail({\n from: formatAddress(message.from),\n to: message.to.map(formatAddress),\n cc: message.cc.length > 0 ? message.cc.map(formatAddress) : undefined,\n bcc: message.bcc.length > 0 ? message.bcc.map(formatAddress) : undefined,\n replyTo: message.replyTo.length > 0 ? message.replyTo.map(formatAddress) : undefined,\n subject: message.subject,\n html: message.html,\n text: message.text,\n headers: message.headers,\n attachments: message.attachments.map((attachment) => ({\n filename: attachment.name,\n path: attachment.path,\n content: attachment.data,\n contentType: attachment.mime,\n })),\n })\n return { messageId: info.messageId, message }\n }\n}\n","import { ViewFactory as ViewFactoryToken, type Content } from '@orieljs/contracts'\nimport { currentContainer } from '@orieljs/container'\nimport { ViewFactoryUnavailableError } from './errors'\n\nexport interface RenderedContent {\n html?: string\n text?: string\n}\n\n/**\n * Renders a Mailable's content() into transport-ready HTML/text. A `view`/`text` name is resolved through\n * ViewFactory (TSX); `htmlString`/`textString` are used as-is, with no View involved at all.\n */\nexport async function renderContent(content: Content): Promise<RenderedContent> {\n const html = content.view !== undefined ? await renderView(content.view, content.with) : content.htmlString\n const text = content.text !== undefined ? await renderView(content.text, content.with) : content.textString\n return { html, text }\n}\n\nasync function renderView(view: string, data: Record<string, unknown> | undefined): Promise<string> {\n const container = currentContainer()\n if (!container?.bound(ViewFactoryToken)) throw new ViewFactoryUnavailableError(view)\n return container.make(ViewFactoryToken).make(view, data).render()\n}\n","import type { Attachment, Content, Envelope, MailRecipient, Mailable as MailableContract } from '@orieljs/contracts'\n\n/**\n * Laravel-style Mailable. New code overrides envelope()/content()/attachments() directly. Legacy (pre-Laravel-9)\n * code overrides build() instead, and calls the fluent subject()/view()/text()/html()/from()/with()/attach()\n * methods, which feed the default envelope()/content()/attachments() below. build() runs at most once.\n */\nexport abstract class Mailable implements MailableContract {\n protected mailSubject?: string\n protected mailView?: string\n protected mailTextView?: string\n protected mailHtml?: string\n protected mailFrom?: MailRecipient\n protected mailData: Record<string, unknown> = {}\n protected mailAttachments: Attachment[] = []\n private built = false\n\n /** Legacy hook: override this and call the fluent methods below instead of envelope()/content()/attachments(). */\n build?(): void | Promise<void>\n\n subject(subject: string): this {\n this.mailSubject = subject\n return this\n }\n\n view(view: string): this {\n this.mailView = view\n return this\n }\n\n text(view: string): this {\n this.mailTextView = view\n return this\n }\n\n html(html: string): this {\n this.mailHtml = html\n return this\n }\n\n from(address: MailRecipient): this {\n this.mailFrom = address\n return this\n }\n\n with(key: string | Record<string, unknown>, value?: unknown): this {\n if (typeof key === 'string') this.mailData[key] = value\n else Object.assign(this.mailData, key)\n return this\n }\n\n attach(attachment: Attachment): this {\n this.mailAttachments.push(attachment)\n return this\n }\n\n private async ensureBuilt(): Promise<void> {\n if (this.built) return\n this.built = true\n await this.build?.()\n }\n\n async envelope(): Promise<Envelope> {\n await this.ensureBuilt()\n return { subject: this.mailSubject, from: this.mailFrom }\n }\n\n async content(): Promise<Content> {\n await this.ensureBuilt()\n return { view: this.mailView, text: this.mailTextView, htmlString: this.mailHtml, with: this.mailData }\n }\n\n async attachments(): Promise<Attachment[]> {\n await this.ensureBuilt()\n return this.mailAttachments\n }\n}\n","/**\n * The Queue/Bus protocol's shared marker (the \"Queue/Bus protocol\" section of the Queue/Bus design notes):\n * `Symbol.for('oriel:bus.shouldQueue')` is a *global* registry key, so `Symbol.for` called here returns the\n * literal same runtime symbol Bus's `Queueable` base class and `isQueueable()` use — genuinely shared state, with\n * no import needed (and none allowed: Mail can't import `@orieljs/bus`).\n */\nexport const SHOULD_QUEUE: unique symbol = Symbol.for('oriel:bus.shouldQueue')\n","import {\n BusDispatcher as BusDispatcherToken,\n type Address,\n type Job,\n type Mailable,\n type MailRecipient,\n type Mailer as MailerContract,\n type MailTransport,\n type OutgoingMessage,\n type PendingMail as PendingMailContract,\n type SentMessage,\n} from '@orieljs/contracts'\nimport { currentContainer } from '@orieljs/container'\nimport { normalizeAddress, normalizeAddresses } from './address'\nimport { MailQueueUnavailableError, MissingRecipientError } from './errors'\nimport { renderContent } from './render'\nimport { SHOULD_QUEUE } from './symbols'\n\nexport interface RecipientOverrides {\n to?: Address[]\n cc?: Address[]\n bcc?: Address[]\n}\n\n/** Builds the queue job for a mailable. Decoupled from the concrete SendQueuedMailable class so this\n * file has no forward reference to it, and so tests can inject a fake job. */\nexport type QueuedMailableFactory = (\n mailerName: string | undefined,\n mailable: Mailable,\n overrides?: RecipientOverrides,\n) => Job\n\n/**\n * Matches the Queue/Bus protocol's `isQueueable()` exactly: true when the mailable carries ShouldQueue's\n * `shouldQueue: true` or `SHOULD_QUEUE === true`, or has a defined value for any of ShouldQueue's fields, or\n * declares a `uniqueId()`/`retryUntil()` method. Call queue()/later() explicitly to queue a mailable that declares\n * none of these.\n */\nfunction isQueueableMailable(mailable: Mailable): boolean {\n const record = mailable as unknown as Record<PropertyKey, unknown>\n if (record.shouldQueue === true || record[SHOULD_QUEUE] === true) return true\n return (\n record.connection !== undefined ||\n record.queue !== undefined ||\n record.delay !== undefined ||\n record.tries !== undefined ||\n record.backoff !== undefined ||\n record.timeout !== undefined ||\n typeof record.uniqueId === 'function' ||\n typeof record.retryUntil === 'function'\n )\n}\n\nexport class MailerImpl implements MailerContract {\n constructor(\n private readonly name: string,\n private readonly transport: MailTransport,\n private readonly defaultFrom: Address | undefined,\n private readonly makeQueuedJob: QueuedMailableFactory,\n ) {}\n\n to(recipients: MailRecipient | MailRecipient[]): PendingMailContract {\n return new PendingMail(this, normalizeAddresses(recipients))\n }\n\n async send(mailable: Mailable, overrides?: RecipientOverrides): Promise<SentMessage | undefined> {\n if (isQueueableMailable(mailable)) {\n await this.queue(mailable, overrides)\n return undefined\n }\n return this.sendNow(mailable, overrides)\n }\n\n async queue(mailable: Mailable, overrides?: RecipientOverrides): Promise<void> {\n await this.dispatch(this.makeQueuedJob(this.name, mailable, overrides))\n }\n\n async later(delaySeconds: number, mailable: Mailable, overrides?: RecipientOverrides): Promise<void> {\n const job = this.makeQueuedJob(this.name, mailable, overrides)\n job.delay = delaySeconds\n await this.dispatch(job)\n }\n\n private async dispatch(job: Job): Promise<void> {\n const container = currentContainer()\n if (!container?.bound(BusDispatcherToken)) throw new MailQueueUnavailableError()\n await container.make(BusDispatcherToken).dispatch(job)\n }\n\n /** Renders and delivers immediately, bypassing the queueable check. Used by send() and by the queued job's\n * handle(), once it's already running on the worker. */\n async sendNow(mailable: Mailable, overrides?: RecipientOverrides): Promise<SentMessage> {\n const envelope = await mailable.envelope()\n const to = overrides?.to && overrides.to.length > 0 ? overrides.to : normalizeAddresses(envelope.to)\n if (to.length === 0) throw new MissingRecipientError()\n const cc = [...normalizeAddresses(envelope.cc), ...(overrides?.cc ?? [])]\n const bcc = [...normalizeAddresses(envelope.bcc), ...(overrides?.bcc ?? [])]\n const replyTo = normalizeAddresses(envelope.replyTo)\n const from = envelope.from ? normalizeAddress(envelope.from) : this.defaultFrom\n if (!from) throw new MissingRecipientError()\n const content = await mailable.content()\n const rendered = await renderContent(content)\n const attachments = (await mailable.attachments?.()) ?? []\n const message: OutgoingMessage = {\n from,\n to,\n cc,\n bcc,\n replyTo,\n subject: envelope.subject ?? '',\n html: rendered.html,\n text: rendered.text,\n attachments,\n headers: {},\n }\n return this.transport.send(message)\n }\n}\n\nclass PendingMail implements PendingMailContract {\n private readonly ccList: Address[] = []\n private readonly bccList: Address[] = []\n\n constructor(\n private readonly mailer: MailerImpl,\n private readonly toList: Address[],\n ) {}\n\n cc(recipients: MailRecipient | MailRecipient[]): this {\n this.ccList.push(...normalizeAddresses(recipients))\n return this\n }\n\n bcc(recipients: MailRecipient | MailRecipient[]): this {\n this.bccList.push(...normalizeAddresses(recipients))\n return this\n }\n\n private overrides(): RecipientOverrides {\n return { to: this.toList, cc: this.ccList, bcc: this.bccList }\n }\n\n async send(mailable: Mailable): Promise<SentMessage | undefined> {\n return this.mailer.send(mailable, this.overrides())\n }\n\n async sendNow(mailable: Mailable): Promise<SentMessage> {\n return this.mailer.sendNow(mailable, this.overrides())\n }\n\n async queue(mailable: Mailable): Promise<void> {\n await this.mailer.queue(mailable, this.overrides())\n }\n\n async later(delaySeconds: number, mailable: Mailable): Promise<void> {\n await this.mailer.later(delaySeconds, mailable, this.overrides())\n }\n}\n","import { token, type Mailable, type SentMessage } from '@orieljs/contracts'\nimport type { RecipientOverrides } from './Mailer'\n\n/**\n * Internal-only token. `SendQueuedMailable.handle()` runs on the worker, where the mailable's ShouldQueue fields\n * are still set — calling the public `Mailer.send()` there would re-detect it as queueable and dispatch it again,\n * forever. `MailServiceProvider` binds this to the MailManager's mailers, so `sendNow()` here always delivers\n * immediately, through the mailer the job names and with the recipients PendingMail gave.\n */\nexport interface QueuedMailSender {\n sendNow(mailerName: string | undefined, mailable: Mailable, overrides?: RecipientOverrides): Promise<SentMessage>\n}\nexport const QueuedMailSender = token<QueuedMailSender>('Mail.QueuedMailSender')\n","import type { Address, Job, Mailable } from '@orieljs/contracts'\nimport { inject } from '@orieljs/container'\nimport { QueuedMailSender } from '../QueuedMailSender'\nimport { SHOULD_QUEUE } from '../symbols'\n\n/** The ShouldQueue options copied from the mailable onto the wrapper job. */\nconst QUEUE_OPTIONS = [\n 'connection',\n 'queue',\n 'delay',\n 'tries',\n 'backoff',\n 'timeout',\n 'failOnTimeout',\n 'deleteWhenMissingModels',\n] as const\n\n/** The job hooks Queue reads off a job instance, when the wrapped mailable defines them. */\ninterface JobHooks {\n failed?: (error: unknown) => unknown\n retryUntil?: () => unknown\n middleware?: unknown[] | (() => unknown[])\n}\n\n/** Copies the mailable's own ShouldQueue fields onto the wrapper job (when set), so once Queue actually runs the\n * job, its delay/retry/backoff/connection routing reflects what the app developer put on the Mailable. Uses\n * `declare` fields on the class (no runtime auto-initialization to `undefined`), so a field is a genuinely own\n * property only when the mailable actually set it. */\nfunction copyShouldQueueFields(target: Record<PropertyKey, unknown>, source: object): void {\n const fields = source as Record<string, unknown>\n for (const option of QUEUE_OPTIONS) {\n if (fields[option] !== undefined) target[option] = fields[option]\n }\n}\n\n/**\n * Dispatched by MailerImpl.queue()/later()/send() (when queueable). Runs on the worker: renders and delivers the\n * mailable through QueuedMailSender, bypassing the queueable check (it's already on the worker, not the request).\n *\n * Carries `SHOULD_QUEUE` on its own prototype, per the Queue/Bus protocol, so `BusDispatcher.dispatch()` — which\n * re-decides queued-or-now on whatever job it's handed — actually enqueues it instead of running it inline; the\n * mailable's own queueability (checked by MailerImpl) only decides whether to wrap it at all. Like Laravel's\n * SendQueuedMailable, it forwards failed(), retryUntil(), middleware() and displayName() to the mailable.\n */\nexport class SendQueuedMailable implements Job {\n declare connection?: string\n declare queue?: string\n declare delay?: number\n declare tries?: number\n declare backoff?: number | number[]\n declare timeout?: number\n declare failOnTimeout?: boolean\n declare deleteWhenMissingModels?: boolean\n\n constructor(\n readonly mailerName: string | undefined,\n readonly mailable: Mailable,\n readonly to?: Address[],\n readonly cc?: Address[],\n readonly bcc?: Address[],\n ) {\n copyShouldQueueFields(this as unknown as Record<PropertyKey, unknown>, mailable)\n }\n\n async handle(): Promise<void> {\n await inject(QueuedMailSender).sendNow(this.mailerName, this.mailable, { to: this.to, cc: this.cc, bcc: this.bcc })\n }\n\n /** Called by Queue after the final failed attempt. */\n async failed(error: unknown): Promise<void> {\n const hooks = this.mailable as unknown as JobHooks\n if (typeof hooks.failed === 'function') await hooks.failed.call(this.mailable, error)\n }\n\n /** `failed_jobs` and `queue:failed` show the mailable's class, not the wrapper's. */\n displayName(): string {\n return this.mailable.constructor.name\n }\n\n retryUntil(): unknown {\n const hooks = this.mailable as unknown as JobHooks\n return typeof hooks.retryUntil === 'function' ? hooks.retryUntil.call(this.mailable) : undefined\n }\n\n middleware(): unknown[] {\n const declared = (this.mailable as unknown as JobHooks).middleware\n return (typeof declared === 'function' ? declared.call(this.mailable) : declared) ?? []\n }\n}\n;(SendQueuedMailable.prototype as unknown as Record<PropertyKey, unknown>)[SHOULD_QUEUE] = true\n","import {\n ConfigRepository,\n type Address,\n type Container,\n type Mailable,\n type MailManager as MailManagerContract,\n type MailRecipient,\n type MailTransport,\n type PendingMail,\n type SentMessage,\n} from '@orieljs/contracts'\nimport { ArrayTransport } from './transports/ArrayTransport'\nimport { FailoverTransport } from './transports/FailoverTransport'\nimport { LogTransport } from './transports/LogTransport'\nimport { SmtpTransport, type SmtpConfig } from './transports/SmtpTransport'\nimport { UnknownMailerError, UnknownMailTransportError } from './errors'\nimport { MailerImpl } from './Mailer'\nimport { SendQueuedMailable } from './Jobs/SendQueuedMailable'\n\ntype TransportFactory = (config: Record<string, unknown>) => MailTransport\n\nexport class MailManager implements MailManagerContract {\n private readonly mailers = new Map<string, MailerImpl>()\n private readonly drivers = new Map<string, TransportFactory>([\n ['array', () => new ArrayTransport()],\n ['log', (config) => new LogTransport(config.channel as string | undefined)],\n [\n 'smtp',\n (config) =>\n new SmtpTransport({\n host: String(config.host ?? '127.0.0.1'),\n port: Number(config.port ?? 2525),\n encryption: (config.encryption as SmtpConfig['encryption']) ?? null,\n username: config.username as string | undefined,\n password: config.password as string | undefined,\n }),\n ],\n ])\n\n constructor(private readonly container: Container) {}\n\n private config(): ConfigRepository {\n return this.container.make(ConfigRepository)\n }\n\n mailer(name?: string): MailerImpl {\n const mailerName = name ?? this.config().get<string>('mail.default', 'log')\n const cached = this.mailers.get(mailerName)\n if (cached) return cached\n const config = this.config().get<Record<string, unknown> | undefined>(`mail.mailers.${mailerName}`)\n if (!config) throw new UnknownMailerError(mailerName)\n const transport = this.buildTransport(String(config.transport ?? ''), config)\n const from = this.config().get<Address | undefined>('mail.from')\n const impl = new MailerImpl(mailerName, transport, from, (mailerNameArg, mailable, overrides) =>\n new SendQueuedMailable(mailerNameArg, mailable, overrides?.to, overrides?.cc, overrides?.bcc),\n )\n this.mailers.set(mailerName, impl)\n return impl\n }\n\n private buildTransport(transportName: string, config: Record<string, unknown>): MailTransport {\n if (transportName === 'failover') {\n const names = (config.mailers as string[] | undefined) ?? []\n const transports = names.map((mailerName) => {\n const mailerConfig = this.config().get<Record<string, unknown> | undefined>(`mail.mailers.${mailerName}`)\n if (!mailerConfig) throw new UnknownMailerError(mailerName)\n return this.buildTransport(String(mailerConfig.transport ?? ''), mailerConfig)\n })\n return new FailoverTransport(transports, names)\n }\n const factory = this.drivers.get(transportName)\n if (!factory) throw new UnknownMailTransportError(transportName)\n return factory(config)\n }\n\n to(recipients: MailRecipient | MailRecipient[]): PendingMail {\n return this.mailer().to(recipients)\n }\n\n async send(mailable: Mailable): Promise<SentMessage | undefined> {\n return this.mailer().send(mailable)\n }\n\n async queue(mailable: Mailable): Promise<void> {\n await this.mailer().queue(mailable)\n }\n\n /** Sends through the default mailer at once, even when the mailable is queueable (Laravel's Mail::sendNow()). */\n async sendNow(mailable: Mailable): Promise<SentMessage> {\n return this.mailer().sendNow(mailable)\n }\n\n extend(transport: string, factory: TransportFactory): void {\n this.drivers.set(transport, factory)\n }\n}\n","import type { MailManager as MailManagerContract } from '@orieljs/contracts'\nimport { MailManager as MailManagerToken } from '@orieljs/contracts'\nimport { facade } from '@orieljs/support'\n\nexport const Mail = facade<MailManagerContract>(MailManagerToken)\n","import { ClassRegistry as ClassRegistryToken, MailManager as MailManagerToken } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { SendQueuedMailable } from './Jobs/SendQueuedMailable'\nimport { MailManager } from './MailManager'\nimport { QueuedMailSender } from './QueuedMailSender'\n\nexport class MailServiceProvider extends ServiceProvider {\n override register(): void {\n this.mergeConfigFrom(\n {\n default: 'log',\n mailers: {\n smtp: { transport: 'smtp', host: '127.0.0.1', port: 2525 },\n log: { transport: 'log' },\n array: { transport: 'array' },\n failover: { transport: 'failover', mailers: ['smtp', 'log'] },\n },\n from: { address: 'hello@example.com', name: 'Example' },\n },\n 'mail',\n )\n this.app.singleton(MailManagerToken, (container) => new MailManager(container))\n // The internal token the queued job delivers through (see QueuedMailSender.ts): the named mailer's sendNow(),\n // with the job's recipients. The MailManager bound just above is this package's, so its mailers take them.\n this.app.singleton(QueuedMailSender, (container) => {\n const manager = container.make(MailManagerToken) as MailManager\n return { sendNow: (mailerName, mailable, overrides) => manager.mailer(mailerName).sendNow(mailable, overrides) }\n })\n // Namespaced name, registered in register() (not boot()) — the Queue/Bus protocol rule for wrapper classes.\n // ClassRegistry is safe to use here: Application's own constructor binds it before any provider registers.\n this.app.make(ClassRegistryToken).register(SendQueuedMailable, 'Mail.SendQueuedMailable')\n }\n}\n"],"mappings":";AAEO,IAAM,qBAAN,cAAiC,MAA4B;AAAA,EACzD,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,YAAY,MAAc;AACxB,UAAM,WAAW,IAAI,wDAAwD;AAAA,EAC/E;AACF;AAEO,IAAM,4BAAN,cAAwC,MAA4B;AAAA,EAChE,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,YAAY,WAAmB;AAC7B,UAAM,mBAAmB,SAAS,kEAAkE;AA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mB,SAAiC;AACzD,SAAK,QAAQ,IAAI,WAAW,OAAO;AAAA,EACrC;AACF;;;AC9FA,SAAS,eAAe,wBAAwB;AAChD,SAAS,cAAc;AAEhB,IAAM,OAAO,OAA4B,gBAAgB;;;ACJhE,SAAS,iBAAiB,oBAAoB,eAAeC,yBAAwB;AACrF,SAAS,uBAAuB;AAKzB,IAAM,sBAAN,cAAkC,gBAAgB;AAAA,EAC9C,WAAiB;AACxB,SAAK;AAAA,MACH;AAAA,QACE,SAAS;AAAA,QACT,SAAS;AAAA,UACP,MAAM,EAAE,WAAW,QAAQ,MAAM,aAAa,MAAM,KAAK;AAAA,UACzD,KAAK,EAAE,WAAW,MAAM;AAAA,UACxB,OAAO,EAAE,WAAW,QAAQ;AAAA,UAC5B,UAAU,EAAE,WAAW,YAAY,SAAS,CAAC,QAAQ,KAAK,EAAE;AAAA,QAC9D;AAAA,QACA,MAAM,EAAE,SAAS,qBAAqB,MAAM,UAAU;AAAA,MACxD;AAAA,MACA;AAAA,IACF;AACA,SAAK,IAAI,UAAUC,mBAAkB,CAAC,cAAc,IAAI,YAAY,SAAS,CAAC;AAG9E,SAAK,IAAI,UAAU,kBAAkB,CAAC,cAAc;AAClD,YAAM,UAAU,UAAU,KAAKA,iBAAgB;AAC/C,aAAO,EAAE,SAAS,CAAC,YAAY,UAAU,cAAc,QAAQ,OAAO,UAAU,EAAE,QAAQ,UAAU,SAAS,EAAE;AAAA,IACjH,CAAC;AAGD,SAAK,IAAI,KAAK,kBAAkB,EAAE,SAAS,oBAAoB,yBAAyB;AAAA,EAC1F;AACF;","names":["randomUUID","randomUUID","currentContainer","currentContainer","currentContainer","currentContainer","MailManagerToken","MailManagerToken"]}
1
+ {"version":3,"sources":["../errors.ts","../address.ts","../transports/ArrayTransport.ts","../transports/LogTransport.ts","../transports/FailoverTransport.ts","../transports/SmtpTransport.ts","../render.ts","../Mailable.ts","../symbols.ts","../Mailer.ts","../QueuedMailSender.ts","../Jobs/SendQueuedMailable.ts","../MailManager.ts","../facade.ts","../MailServiceProvider.ts"],"sourcesContent":["import type { OrielError } from '@orieljs/contracts'\n\nexport class UnknownMailerError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'UnknownMailerError'\n constructor(name: string) {\n super(`Mailer [${name}] is not configured. Add it to config('mail.mailers').`)\n }\n}\n\nexport class UnknownMailTransportError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'UnknownMailTransportError'\n constructor(transport: string) {\n super(`Mail transport [${transport}] is not supported. Register it first with MailManager.extend().`)\n }\n}\n\nexport class MissingRecipientError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'MissingRecipientError'\n constructor() {\n super('Cannot send mail: no recipients. Set envelope().to, or call Mail.to(...).send(mailable).')\n }\n}\n\nexport class MailQueueUnavailableError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'MailQueueUnavailableError'\n constructor() {\n super('Queueing mail requires the Bus component. Register BusDispatcher, or call send() instead of queue()/later().')\n }\n}\n\nexport class ViewFactoryUnavailableError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'ViewFactoryUnavailableError'\n constructor(view: string) {\n super(`Cannot render the [${view}] mail view: the View component isn't registered (ViewFactory is unbound).`)\n }\n}\n\nexport class AllMailersFailedError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'AllMailersFailedError'\n constructor(\n readonly mailers: string[],\n readonly causes: unknown[],\n ) {\n super(`All failover mailers failed: ${mailers.join(', ')}. Last error: ${String(causes.at(-1))}`, {\n cause: causes.at(-1),\n })\n }\n}\n","import type { Address, MailRecipient } from '@orieljs/contracts'\n\n/** A MailRecipient is a bare string, an Address, or anything with `email` (+ optional `name`), such as a User model. */\nexport function normalizeAddress(recipient: MailRecipient): Address {\n if (typeof recipient === 'string') return { address: recipient }\n if ('address' in recipient) return { address: recipient.address, name: recipient.name }\n return { address: recipient.email, name: recipient.name }\n}\n\nexport function normalizeAddresses(recipients: MailRecipient | MailRecipient[] | undefined): Address[] {\n if (recipients === undefined) return []\n const list = Array.isArray(recipients) ? recipients : [recipients]\n return list.map(normalizeAddress)\n}\n\nexport function formatAddress(address: Address): string {\n return address.name ? `${address.name} <${address.address}>` : address.address\n}\n","import { randomUUID } from 'node:crypto'\nimport type { MailTransport, OutgoingMessage, SentMessage } from '@orieljs/contracts'\n\n/** In-memory transport backing the `array` mailer: never leaves the process, so tests can inspect `sent`. */\nexport class ArrayTransport implements MailTransport {\n readonly sent: OutgoingMessage[] = []\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n this.sent.push(message)\n return { messageId: randomUUID(), message }\n }\n\n flush(): void {\n this.sent.length = 0\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { LogManager as LogManagerToken, type MailTransport, type OutgoingMessage, type SentMessage } from '@orieljs/contracts'\nimport { currentContainer } from '@orieljs/container'\nimport { formatAddress } from '../address'\n\n/** Writes the message through LogManager (a channel from config, or the default channel) when bound, else console.log. */\nexport class LogTransport implements MailTransport {\n constructor(private readonly channel?: string) {}\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n const dump = formatMessage(message)\n const container = currentContainer()\n if (container?.bound(LogManagerToken)) {\n const manager = container.make(LogManagerToken)\n const logger = this.channel ? manager.channel(this.channel) : manager\n logger.info(dump)\n } else {\n console.log(dump)\n }\n return { messageId: randomUUID(), message }\n }\n}\n\nfunction formatMessage(message: OutgoingMessage): string {\n const lines = [\n `To: ${message.to.map(formatAddress).join(', ')}`,\n message.cc.length > 0 ? `Cc: ${message.cc.map(formatAddress).join(', ')}` : undefined,\n message.bcc.length > 0 ? `Bcc: ${message.bcc.map(formatAddress).join(', ')}` : undefined,\n `From: ${formatAddress(message.from)}`,\n `Subject: ${message.subject}`,\n '',\n message.text ?? stripHtml(message.html ?? ''),\n ]\n return lines.filter((line): line is string => line !== undefined).join('\\n')\n}\n\nfunction stripHtml(html: string): string {\n return html.replace(/<[^>]*>/g, '')\n}\n","import type { MailTransport, OutgoingMessage, SentMessage } from '@orieljs/contracts'\nimport { AllMailersFailedError } from '../errors'\n\n/** Tries each transport in order, returning the first success (Laravel's `failover` mailer). */\nexport class FailoverTransport implements MailTransport {\n constructor(\n private readonly transports: MailTransport[],\n private readonly names: string[],\n ) {}\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n const causes: unknown[] = []\n for (const transport of this.transports) {\n try {\n return await transport.send(message)\n } catch (error) {\n causes.push(error)\n }\n }\n throw new AllMailersFailedError(this.names, causes)\n }\n}\n","import nodemailer from 'nodemailer'\nimport type { MailTransport, OutgoingMessage, SentMessage } from '@orieljs/contracts'\nimport { formatAddress } from '../address'\n\nexport interface SmtpConfig {\n host: string\n port: number\n encryption?: 'tls' | 'ssl' | null\n username?: string\n password?: string\n}\n\n/** The minimal nodemailer surface this transport needs — lets tests inject a fake without a real Transporter. */\nexport interface MailTransporter {\n sendMail(options: Record<string, unknown>): Promise<{ messageId: string }>\n}\n\nexport type TransporterFactory = (config: SmtpConfig) => MailTransporter\n\nconst defaultFactory: TransporterFactory = (config) =>\n nodemailer.createTransport({\n host: config.host,\n port: config.port,\n secure: config.encryption === 'ssl',\n requireTLS: config.encryption === 'tls',\n auth: config.username ? { user: config.username, pass: config.password } : undefined,\n })\n\nexport class SmtpTransport implements MailTransport {\n private readonly transporter: MailTransporter\n\n constructor(config: SmtpConfig, factory: TransporterFactory = defaultFactory) {\n this.transporter = factory(config)\n }\n\n async send(message: OutgoingMessage): Promise<SentMessage> {\n const info = await this.transporter.sendMail({\n from: formatAddress(message.from),\n to: message.to.map(formatAddress),\n cc: message.cc.length > 0 ? message.cc.map(formatAddress) : undefined,\n bcc: message.bcc.length > 0 ? message.bcc.map(formatAddress) : undefined,\n replyTo: message.replyTo.length > 0 ? message.replyTo.map(formatAddress) : undefined,\n subject: message.subject,\n html: message.html,\n text: message.text,\n headers: message.headers,\n attachments: message.attachments.map((attachment) => ({\n filename: attachment.name,\n path: attachment.path,\n content: attachment.data,\n contentType: attachment.mime,\n })),\n })\n return { messageId: info.messageId, message }\n }\n}\n","import { ViewFactory as ViewFactoryToken, type Content } from '@orieljs/contracts'\nimport { currentContainer } from '@orieljs/container'\nimport { ViewFactoryUnavailableError } from './errors'\n\nexport interface RenderedContent {\n html?: string\n text?: string\n}\n\n/**\n * Renders a Mailable's content() into transport-ready HTML/text. A `view`/`text` name is resolved through\n * ViewFactory (TSX); `htmlString`/`textString` are used as-is, with no View involved at all.\n */\nexport async function renderContent(content: Content): Promise<RenderedContent> {\n const html = content.view !== undefined ? await renderView(content.view, content.with) : content.htmlString\n const text = content.text !== undefined ? await renderView(content.text, content.with) : content.textString\n return { html, text }\n}\n\nasync function renderView(view: string, data: Record<string, unknown> | undefined): Promise<string> {\n const container = currentContainer()\n if (!container?.bound(ViewFactoryToken)) throw new ViewFactoryUnavailableError(view)\n return container.make(ViewFactoryToken).make(view, data).render()\n}\n","import type { Attachment, Content, Envelope, MailRecipient, Mailable as MailableContract } from '@orieljs/contracts'\n\n/**\n * Laravel-style Mailable. New code overrides envelope()/content()/attachments() directly. Legacy (pre-Laravel-9)\n * code overrides build() instead, and calls the fluent subject()/view()/text()/html()/from()/with()/attach()\n * methods, which feed the default envelope()/content()/attachments() below. build() runs at most once.\n */\nexport abstract class Mailable implements MailableContract {\n protected mailSubject?: string\n protected mailView?: string\n protected mailTextView?: string\n protected mailHtml?: string\n protected mailFrom?: MailRecipient\n protected mailData: Record<string, unknown> = {}\n protected mailAttachments: Attachment[] = []\n private built = false\n\n /** Legacy hook: override this and call the fluent methods below instead of envelope()/content()/attachments(). */\n build?(): void | Promise<void>\n\n subject(subject: string): this {\n this.mailSubject = subject\n return this\n }\n\n view(view: string): this {\n this.mailView = view\n return this\n }\n\n text(view: string): this {\n this.mailTextView = view\n return this\n }\n\n html(html: string): this {\n this.mailHtml = html\n return this\n }\n\n from(address: MailRecipient): this {\n this.mailFrom = address\n return this\n }\n\n with(key: string | Record<string, unknown>, value?: unknown): this {\n if (typeof key === 'string') this.mailData[key] = value\n else Object.assign(this.mailData, key)\n return this\n }\n\n attach(attachment: Attachment): this {\n this.mailAttachments.push(attachment)\n return this\n }\n\n private async ensureBuilt(): Promise<void> {\n if (this.built) return\n this.built = true\n await this.build?.()\n }\n\n async envelope(): Promise<Envelope> {\n await this.ensureBuilt()\n return { subject: this.mailSubject, from: this.mailFrom }\n }\n\n async content(): Promise<Content> {\n await this.ensureBuilt()\n return { view: this.mailView, text: this.mailTextView, htmlString: this.mailHtml, with: this.mailData }\n }\n\n async attachments(): Promise<Attachment[]> {\n await this.ensureBuilt()\n return this.mailAttachments\n }\n}\n","/**\n * The Queue/Bus protocol's shared marker (the \"Queue/Bus protocol\" section of the Queue/Bus design notes):\n * `Symbol.for('oriel:bus.shouldQueue')` is a *global* registry key, so `Symbol.for` called here returns the\n * literal same runtime symbol Bus's `Queueable` base class and `isQueueable()` use — genuinely shared state, with\n * no import needed (and none allowed: Mail can't import `@orieljs/bus`).\n */\nexport const SHOULD_QUEUE: unique symbol = Symbol.for('oriel:bus.shouldQueue')\n\n/**\n * Bus's UNIQUE key, the same `Symbol.for`: the uniqueness a SendQueuedMailable carries for its mailable, read by Bus's\n * isUnique() and UniqueLock. Symbol-keyed, so the payload never carries it.\n */\nexport const UNIQUE: unique symbol = Symbol.for('oriel:bus.unique')\n\n/** Bus's UniqueSpec, declared again here (Mail can't import Bus): the lock is `oriel_unique_job:<name>:<id>`. */\nexport interface UniqueSpec {\n name: string\n id: string\n for?: number\n untilProcessing?: boolean\n via?: string\n}\n\ninterface UniqueMembers {\n uniqueId?: () => unknown\n uniqueFor?: number | (() => unknown)\n uniqueUntilProcessing?: boolean\n uniqueVia?: () => unknown\n}\n\n/**\n * Laravel's ShouldBeUnique read off a mailable, by Bus's isUnique() rule (it defines uniqueId(), uniqueFor,\n * uniqueUntilProcessing or uniqueVia()), each value resolved now, at dispatch. undefined when it declares none.\n */\nexport function uniqueSpecOf(target: object, name: string): UniqueSpec | undefined {\n const members = target as UniqueMembers\n const declared =\n typeof members.uniqueId === 'function' ||\n members.uniqueFor !== undefined ||\n members.uniqueUntilProcessing === true ||\n typeof members.uniqueVia === 'function'\n if (!declared) return undefined\n const id = typeof members.uniqueId === 'function' ? members.uniqueId.call(target) : undefined\n const spec: UniqueSpec = { name, id: id === undefined || id === null ? '' : String(id) }\n const uniqueFor = typeof members.uniqueFor === 'function' ? members.uniqueFor.call(target) : members.uniqueFor\n if (typeof uniqueFor === 'number') spec.for = uniqueFor\n if (members.uniqueUntilProcessing === true) spec.untilProcessing = true\n const via = typeof members.uniqueVia === 'function' ? members.uniqueVia.call(target) : undefined\n if (typeof via === 'string') spec.via = via\n return spec\n}\n","import {\n BusDispatcher as BusDispatcherToken,\n type Address,\n type Job,\n type Mailable,\n type MailRecipient,\n type Mailer as MailerContract,\n type MailTransport,\n type OutgoingMessage,\n type PendingMail as PendingMailContract,\n type SentMessage,\n} from '@orieljs/contracts'\nimport { currentContainer } from '@orieljs/container'\nimport { normalizeAddress, normalizeAddresses } from './address'\nimport { MailQueueUnavailableError, MissingRecipientError } from './errors'\nimport { renderContent } from './render'\nimport { SHOULD_QUEUE } from './symbols'\n\nexport interface RecipientOverrides {\n to?: Address[]\n cc?: Address[]\n bcc?: Address[]\n}\n\n/** Builds the queue job for a mailable. Decoupled from the concrete SendQueuedMailable class so this\n * file has no forward reference to it, and so tests can inject a fake job. */\nexport type QueuedMailableFactory = (\n mailerName: string | undefined,\n mailable: Mailable,\n overrides?: RecipientOverrides,\n) => Job\n\n/**\n * Matches the Queue/Bus protocol's `isQueueable()` exactly: true when the mailable carries ShouldQueue's\n * `shouldQueue: true` or `SHOULD_QUEUE === true`, or has a defined value for any of ShouldQueue's fields, or\n * declares a `uniqueId()`/`retryUntil()` method. Call queue()/later() explicitly to queue a mailable that declares\n * none of these.\n */\nfunction isQueueableMailable(mailable: Mailable): boolean {\n const record = mailable as unknown as Record<PropertyKey, unknown>\n if (record.shouldQueue === true || record[SHOULD_QUEUE] === true) return true\n return (\n record.connection !== undefined ||\n record.queue !== undefined ||\n record.delay !== undefined ||\n record.tries !== undefined ||\n record.backoff !== undefined ||\n record.timeout !== undefined ||\n typeof record.uniqueId === 'function' ||\n typeof record.retryUntil === 'function'\n )\n}\n\nexport class MailerImpl implements MailerContract {\n constructor(\n private readonly name: string,\n private readonly transport: MailTransport,\n private readonly defaultFrom: Address | undefined,\n private readonly makeQueuedJob: QueuedMailableFactory,\n ) {}\n\n to(recipients: MailRecipient | MailRecipient[]): PendingMailContract {\n return new PendingMail(this, normalizeAddresses(recipients))\n }\n\n async send(mailable: Mailable, overrides?: RecipientOverrides): Promise<SentMessage | undefined> {\n if (isQueueableMailable(mailable)) {\n await this.queue(mailable, overrides)\n return undefined\n }\n return this.sendNow(mailable, overrides)\n }\n\n async queue(mailable: Mailable, overrides?: RecipientOverrides): Promise<void> {\n await this.dispatch(this.makeQueuedJob(this.name, mailable, overrides))\n }\n\n async later(delaySeconds: number, mailable: Mailable, overrides?: RecipientOverrides): Promise<void> {\n const job = this.makeQueuedJob(this.name, mailable, overrides)\n job.delay = delaySeconds\n await this.dispatch(job)\n }\n\n private async dispatch(job: Job): Promise<void> {\n const container = currentContainer()\n if (!container?.bound(BusDispatcherToken)) throw new MailQueueUnavailableError()\n await container.make(BusDispatcherToken).dispatch(job)\n }\n\n /** Renders and delivers immediately, bypassing the queueable check. Used by send() and by the queued job's\n * handle(), once it's already running on the worker. */\n async sendNow(mailable: Mailable, overrides?: RecipientOverrides): Promise<SentMessage> {\n const envelope = await mailable.envelope()\n const to = overrides?.to && overrides.to.length > 0 ? overrides.to : normalizeAddresses(envelope.to)\n if (to.length === 0) throw new MissingRecipientError()\n const cc = [...normalizeAddresses(envelope.cc), ...(overrides?.cc ?? [])]\n const bcc = [...normalizeAddresses(envelope.bcc), ...(overrides?.bcc ?? [])]\n const replyTo = normalizeAddresses(envelope.replyTo)\n const from = envelope.from ? normalizeAddress(envelope.from) : this.defaultFrom\n if (!from) throw new MissingRecipientError()\n const content = await mailable.content()\n const rendered = await renderContent(content)\n const attachments = (await mailable.attachments?.()) ?? []\n const message: OutgoingMessage = {\n from,\n to,\n cc,\n bcc,\n replyTo,\n subject: envelope.subject ?? '',\n html: rendered.html,\n text: rendered.text,\n attachments,\n headers: {},\n }\n return this.transport.send(message)\n }\n}\n\nclass PendingMail implements PendingMailContract {\n private readonly ccList: Address[] = []\n private readonly bccList: Address[] = []\n\n constructor(\n private readonly mailer: MailerImpl,\n private readonly toList: Address[],\n ) {}\n\n cc(recipients: MailRecipient | MailRecipient[]): this {\n this.ccList.push(...normalizeAddresses(recipients))\n return this\n }\n\n bcc(recipients: MailRecipient | MailRecipient[]): this {\n this.bccList.push(...normalizeAddresses(recipients))\n return this\n }\n\n private overrides(): RecipientOverrides {\n return { to: this.toList, cc: this.ccList, bcc: this.bccList }\n }\n\n async send(mailable: Mailable): Promise<SentMessage | undefined> {\n return this.mailer.send(mailable, this.overrides())\n }\n\n async sendNow(mailable: Mailable): Promise<SentMessage> {\n return this.mailer.sendNow(mailable, this.overrides())\n }\n\n async queue(mailable: Mailable): Promise<void> {\n await this.mailer.queue(mailable, this.overrides())\n }\n\n async later(delaySeconds: number, mailable: Mailable): Promise<void> {\n await this.mailer.later(delaySeconds, mailable, this.overrides())\n }\n}\n","import { token, type Mailable, type SentMessage } from '@orieljs/contracts'\nimport type { RecipientOverrides } from './Mailer'\n\n/**\n * Internal-only token. `SendQueuedMailable.handle()` runs on the worker, where the mailable's ShouldQueue fields\n * are still set — calling the public `Mailer.send()` there would re-detect it as queueable and dispatch it again,\n * forever. `MailServiceProvider` binds this to the MailManager's mailers, so `sendNow()` here always delivers\n * immediately, through the mailer the job names and with the recipients PendingMail gave.\n */\nexport interface QueuedMailSender {\n sendNow(mailerName: string | undefined, mailable: Mailable, overrides?: RecipientOverrides): Promise<SentMessage>\n}\nexport const QueuedMailSender = token<QueuedMailSender>('Mail.QueuedMailSender')\n","import { createHash } from 'node:crypto'\nimport type { Address, Job, Mailable } from '@orieljs/contracts'\nimport { inject } from '@orieljs/container'\nimport { QueuedMailSender } from '../QueuedMailSender'\nimport { SHOULD_QUEUE, UNIQUE, uniqueSpecOf } from '../symbols'\n\n/** The ShouldQueue options copied from the mailable onto the wrapper job. */\nconst QUEUE_OPTIONS = [\n 'connection',\n 'queue',\n 'delay',\n 'tries',\n 'backoff',\n 'timeout',\n 'failOnTimeout',\n 'deleteWhenMissingModels',\n] as const\n\n/** The job hooks Queue reads off a job instance, when the wrapped mailable defines them. */\ninterface JobHooks {\n failed?: (error: unknown) => unknown\n retryUntil?: () => unknown\n middleware?: unknown[] | (() => unknown[])\n}\n\n/** Copies the mailable's own ShouldQueue fields onto the wrapper job (when set), so once Queue actually runs the\n * job, its delay/retry/backoff/connection routing reflects what the app developer put on the Mailable. Uses\n * `declare` fields on the class (no runtime auto-initialization to `undefined`), so a field is a genuinely own\n * property only when the mailable actually set it. */\nfunction copyShouldQueueFields(target: Record<PropertyKey, unknown>, source: object): void {\n const fields = source as Record<string, unknown>\n for (const option of QUEUE_OPTIONS) {\n if (fields[option] !== undefined) target[option] = fields[option]\n }\n}\n\n/**\n * The recipients given with Mail.to(), cc() and bcc(), for a unique mailable's id: a sha1 of the three address lists,\n * kept apart and in the order given, so the lock key stays short and holds no address. undefined when all are empty.\n */\nfunction recipientsHash(to: Address[] = [], cc: Address[] = [], bcc: Address[] = []): string | undefined {\n if (to.length + cc.length + bcc.length === 0) return undefined\n const addresses = (list: Address[]) => list.map((recipient) => recipient.address)\n const recipients = JSON.stringify({ to: addresses(to), cc: addresses(cc), bcc: addresses(bcc) })\n return createHash('sha1').update(recipients).digest('hex')\n}\n\n/**\n * Dispatched by MailerImpl.queue()/later()/send() (when queueable). Runs on the worker: renders and delivers the\n * mailable through QueuedMailSender, bypassing the queueable check (it's already on the worker, not the request).\n *\n * Carries `SHOULD_QUEUE` on its own prototype, per the Queue/Bus protocol, so `BusDispatcher.dispatch()` — which\n * re-decides queued-or-now on whatever job it's handed — actually enqueues it instead of running it inline; the\n * mailable's own queueability (checked by MailerImpl) only decides whether to wrap it at all. Like Laravel's\n * SendQueuedMailable, it forwards failed(), retryUntil(), middleware() and displayName() to the mailable. Unlike\n * Laravel's, it is unique when the mailable is (Laravel pushes a mailable straight to the queue, past the unique lock).\n */\nexport class SendQueuedMailable implements Job {\n declare connection?: string\n declare queue?: string\n declare delay?: number\n declare tries?: number\n declare backoff?: number | number[]\n declare timeout?: number\n declare failOnTimeout?: boolean\n declare deleteWhenMissingModels?: boolean\n\n constructor(\n readonly mailerName: string | undefined,\n readonly mailable: Mailable,\n readonly to?: Address[],\n readonly cc?: Address[],\n readonly bcc?: Address[],\n ) {\n copyShouldQueueFields(this as unknown as Record<PropertyKey, unknown>, mailable)\n // A unique mailable (uniqueId(), uniqueFor, ...) makes this job unique, under the mailable's class; the id is\n // `<uniqueId()>:<sha1 of the to, cc and bcc recipients>`, so the same mail to anyone else is not a duplicate.\n const unique = uniqueSpecOf(mailable, mailable.constructor.name)\n if (unique) {\n const recipients = recipientsHash(to, cc, bcc)\n if (recipients !== undefined) unique.id += `:${recipients}`\n ;(this as unknown as Record<PropertyKey, unknown>)[UNIQUE] = unique\n }\n }\n\n async handle(): Promise<void> {\n await inject(QueuedMailSender).sendNow(this.mailerName, this.mailable, { to: this.to, cc: this.cc, bcc: this.bcc })\n }\n\n /** Called by Queue after the final failed attempt. */\n async failed(error: unknown): Promise<void> {\n const hooks = this.mailable as unknown as JobHooks\n if (typeof hooks.failed === 'function') await hooks.failed.call(this.mailable, error)\n }\n\n /** `failed_jobs` and `queue:failed` show the mailable's class, not the wrapper's. */\n displayName(): string {\n return this.mailable.constructor.name\n }\n\n retryUntil(): unknown {\n const hooks = this.mailable as unknown as JobHooks\n return typeof hooks.retryUntil === 'function' ? hooks.retryUntil.call(this.mailable) : undefined\n }\n\n middleware(): unknown[] {\n const declared = (this.mailable as unknown as JobHooks).middleware\n return (typeof declared === 'function' ? declared.call(this.mailable) : declared) ?? []\n }\n}\n;(SendQueuedMailable.prototype as unknown as Record<PropertyKey, unknown>)[SHOULD_QUEUE] = true\n","import {\n ConfigRepository,\n type Address,\n type Container,\n type Mailable,\n type MailManager as MailManagerContract,\n type MailRecipient,\n type MailTransport,\n type PendingMail,\n type SentMessage,\n} from '@orieljs/contracts'\nimport { ArrayTransport } from './transports/ArrayTransport'\nimport { FailoverTransport } from './transports/FailoverTransport'\nimport { LogTransport } from './transports/LogTransport'\nimport { SmtpTransport, type SmtpConfig } from './transports/SmtpTransport'\nimport { UnknownMailerError, UnknownMailTransportError } from './errors'\nimport { MailerImpl } from './Mailer'\nimport { SendQueuedMailable } from './Jobs/SendQueuedMailable'\n\ntype TransportFactory = (config: Record<string, unknown>) => MailTransport\n\nexport class MailManager implements MailManagerContract {\n private readonly mailers = new Map<string, MailerImpl>()\n private readonly drivers = new Map<string, TransportFactory>([\n ['array', () => new ArrayTransport()],\n ['log', (config) => new LogTransport(config.channel as string | undefined)],\n [\n 'smtp',\n (config) =>\n new SmtpTransport({\n host: String(config.host ?? '127.0.0.1'),\n port: Number(config.port ?? 2525),\n encryption: (config.encryption as SmtpConfig['encryption']) ?? null,\n username: config.username as string | undefined,\n password: config.password as string | undefined,\n }),\n ],\n ])\n\n constructor(private readonly container: Container) {}\n\n private config(): ConfigRepository {\n return this.container.make(ConfigRepository)\n }\n\n mailer(name?: string): MailerImpl {\n const mailerName = name ?? this.config().get<string>('mail.default', 'log')\n const cached = this.mailers.get(mailerName)\n if (cached) return cached\n const config = this.config().get<Record<string, unknown> | undefined>(`mail.mailers.${mailerName}`)\n if (!config) throw new UnknownMailerError(mailerName)\n const transport = this.buildTransport(String(config.transport ?? ''), config)\n const from = this.config().get<Address | undefined>('mail.from')\n const impl = new MailerImpl(mailerName, transport, from, (mailerNameArg, mailable, overrides) =>\n new SendQueuedMailable(mailerNameArg, mailable, overrides?.to, overrides?.cc, overrides?.bcc),\n )\n this.mailers.set(mailerName, impl)\n return impl\n }\n\n private buildTransport(transportName: string, config: Record<string, unknown>): MailTransport {\n if (transportName === 'failover') {\n const names = (config.mailers as string[] | undefined) ?? []\n const transports = names.map((mailerName) => {\n const mailerConfig = this.config().get<Record<string, unknown> | undefined>(`mail.mailers.${mailerName}`)\n if (!mailerConfig) throw new UnknownMailerError(mailerName)\n return this.buildTransport(String(mailerConfig.transport ?? ''), mailerConfig)\n })\n return new FailoverTransport(transports, names)\n }\n const factory = this.drivers.get(transportName)\n if (!factory) throw new UnknownMailTransportError(transportName)\n return factory(config)\n }\n\n to(recipients: MailRecipient | MailRecipient[]): PendingMail {\n return this.mailer().to(recipients)\n }\n\n async send(mailable: Mailable): Promise<SentMessage | undefined> {\n return this.mailer().send(mailable)\n }\n\n async queue(mailable: Mailable): Promise<void> {\n await this.mailer().queue(mailable)\n }\n\n /** Sends through the default mailer at once, even when the mailable is queueable (Laravel's Mail::sendNow()). */\n async sendNow(mailable: Mailable): Promise<SentMessage> {\n return this.mailer().sendNow(mailable)\n }\n\n extend(transport: string, factory: TransportFactory): void {\n this.drivers.set(transport, factory)\n }\n}\n","import type { MailManager as MailManagerContract } from '@orieljs/contracts'\nimport { MailManager as MailManagerToken } from '@orieljs/contracts'\nimport { facade } from '@orieljs/support'\n\nexport const Mail = facade<MailManagerContract>(MailManagerToken)\n","import { ClassRegistry as ClassRegistryToken, MailManager as MailManagerToken } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { SendQueuedMailable } from './Jobs/SendQueuedMailable'\nimport { MailManager } from './MailManager'\nimport { QueuedMailSender } from './QueuedMailSender'\n\nexport class MailServiceProvider extends ServiceProvider {\n override register(): void {\n this.mergeConfigFrom(\n {\n default: 'log',\n mailers: {\n smtp: { transport: 'smtp', host: '127.0.0.1', port: 2525 },\n log: { transport: 'log' },\n array: { transport: 'array' },\n failover: { transport: 'failover', mailers: ['smtp', 'log'] },\n },\n from: { address: 'hello@example.com', name: 'Example' },\n },\n 'mail',\n )\n this.app.singleton(MailManagerToken, (container) => new MailManager(container))\n // The internal token the queued job delivers through (see QueuedMailSender.ts): the named mailer's sendNow(),\n // with the job's recipients. The MailManager bound just above is this package's, so its mailers take them.\n this.app.singleton(QueuedMailSender, (container) => {\n const manager = container.make(MailManagerToken) as MailManager\n return { sendNow: (mailerName, mailable, overrides) => manager.mailer(mailerName).sendNow(mailable, overrides) }\n })\n // Namespaced name, registered in register() (not boot()) — the Queue/Bus protocol rule for wrapper classes.\n // ClassRegistry is safe to use here: Application's own constructor binds it before any provider registers.\n this.app.make(ClassRegistryToken).register(SendQueuedMailable, 'Mail.SendQueuedMailable')\n }\n}\n"],"mappings":";AAEO,IAAM,qBAAN,cAAiC,MAA4B;AAAA,EACzD,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,YAAY,MAAc;AACxB,UAAM,WAAW,IAAI,wDAAwD;AAAA,EAC/E;AACF;AAEO,IAAM,4BAAN,cAAwC,MAA4B;AAAA,EAChE,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,YAAY,WAAmB;AAC7B,UAAM,mBAAmB,SAAS,kEAAkE;AAAA,EACtG;AACF;AAEO,IAAM,wBAAN,cAAoC,MAA4B;AAAA,EAC5D,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,cAAc;AACZ,UAAM,0FAA0F;AAAA,EAClG;AACF;AAEO,IAAM,4BAAN,cAAwC,MAA4B;AAAA,EAChE,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,cAAc;AACZ,UAAM,8GAA8G;AAAA,EACtH;AACF;AAEO,IAAM,8BAAN,cAA0C,MAA4B;AAAA,EAClE,OAAO;AAAA,EACP,SAAS;AAAA,EACA,OAAO;AAAA,EACzB,YAAY,MAAc;AACxB,UAAM,sBAAsB,IAAI,4EAA4E;AAAA,EAC9G;AACF;AAEO,IAAM,wBAAN,cAAoC,MAA4B;AAAA,EAIrE,YACW,SACA,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,OAAO,EAAE,WAAW,QAAQ;AAAA,UAC5B,UAAU,EAAE,WAAW,YAAY,SAAS,CAAC,QAAQ,KAAK,EAAE;AAAA,QAC9D;AAAA,QACA,MAAM,EAAE,SAAS,qBAAqB,MAAM,UAAU;AAAA,MACxD;AAAA,MACA;AAAA,IACF;AACA,SAAK,IAAI,UAAUC,mBAAkB,CAAC,cAAc,IAAI,YAAY,SAAS,CAAC;AAG9E,SAAK,IAAI,UAAU,kBAAkB,CAAC,cAAc;AAClD,YAAM,UAAU,UAAU,KAAKA,iBAAgB;AAC/C,aAAO,EAAE,SAAS,CAAC,YAAY,UAAU,cAAc,QAAQ,OAAO,UAAU,EAAE,QAAQ,UAAU,SAAS,EAAE;AAAA,IACjH,CAAC;AAGD,SAAK,IAAI,KAAK,kBAAkB,EAAE,SAAS,oBAAoB,yBAAyB;AAAA,EAC1F;AACF;","names":["randomUUID","randomUUID","currentContainer","currentContainer","currentContainer","currentContainer","MailManagerToken","MailManagerToken"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orieljs/mail",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.7",
4
4
  "description": "The Oriel Mail component.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -27,13 +27,14 @@
27
27
  "files": [
28
28
  "dist",
29
29
  "LICENSE",
30
- "NOTICE"
30
+ "NOTICE",
31
+ "TRADEMARKS.md"
31
32
  ],
32
33
  "dependencies": {
33
34
  "nodemailer": "10.0.10",
34
- "@orieljs/contracts": "0.1.0-alpha.6",
35
- "@orieljs/support": "0.1.0-alpha.6",
36
- "@orieljs/container": "0.1.0-alpha.6"
35
+ "@orieljs/contracts": "0.1.0-alpha.7",
36
+ "@orieljs/container": "0.1.0-alpha.7",
37
+ "@orieljs/support": "0.1.0-alpha.7"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@types/nodemailer": "8.0.2"