Comparing version 3.8.1 to 4.0.0
16
email.ts
@@ -1,8 +0,8 @@ | ||
export * from './smtp/address'; | ||
export * from './smtp/client'; | ||
export * from './smtp/connection'; | ||
export * from './smtp/date'; | ||
export * from './smtp/error'; | ||
export * from './smtp/message'; | ||
export * from './smtp/mime'; | ||
export * from './smtp/response'; | ||
export * from './smtp/address.js'; | ||
export * from './smtp/client.js'; | ||
export * from './smtp/connection.js'; | ||
export * from './smtp/date.js'; | ||
export * from './smtp/error.js'; | ||
export * from './smtp/message.js'; | ||
export * from './smtp/mime.js'; | ||
export * from './smtp/response.js'; |
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "3.8.1", | ||
"version": "4.0.0", | ||
"author": "eleith", | ||
@@ -20,14 +20,14 @@ "contributors": [ | ||
"@ledge/configs": "23.3.23322", | ||
"@rollup/plugin-typescript": "8.3.1", | ||
"@rollup/plugin-typescript": "8.3.2", | ||
"@types/mailparser": "3.4.0", | ||
"@types/node": "17.0.21", | ||
"@types/node": "12.12.6", | ||
"@types/smtp-server": "3.5.7", | ||
"@typescript-eslint/eslint-plugin": "5.15.0", | ||
"@typescript-eslint/parser": "5.15.0", | ||
"ava": "3.15.0", | ||
"eslint": "7.32.0", | ||
"@typescript-eslint/eslint-plugin": "5.19.0", | ||
"@typescript-eslint/parser": "5.19.0", | ||
"ava": "4.2.0", | ||
"eslint": "8.13.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"mailparser": "3.4.0", | ||
"prettier": "2.6.0", | ||
"prettier": "2.6.2", | ||
"rollup": "2.70.1", | ||
@@ -37,6 +37,6 @@ "smtp-server": "3.10.0", | ||
"tslib": "2.3.1", | ||
"typescript": "3.8.3" | ||
"typescript": "4.3.5" | ||
}, | ||
"peerDependencies": { | ||
"typescript": ">=3.8.3" | ||
"typescript": ">=4.3.5" | ||
}, | ||
@@ -49,17 +49,15 @@ "peerDependenciesMeta": { | ||
"resolutions": { | ||
"nodemailer": "6.7.2" | ||
"nodemailer": "6.7.3" | ||
}, | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
"files": [ | ||
"email.js", | ||
"email.ts", | ||
"smtp", | ||
"rollup" | ||
"smtp" | ||
], | ||
"main": "./rollup/email.cjs", | ||
"types": "./email.ts", | ||
"exports": { | ||
"import": "./rollup/email.mjs", | ||
"require": "./rollup/email.cjs" | ||
"default": "./email.js" | ||
}, | ||
@@ -69,7 +67,6 @@ "scripts": { | ||
"lint": "eslint *.ts \"+(smtp|test)/*.ts\"", | ||
"test": "ava", | ||
"pretest-cjs": "npm run build", | ||
"test-cjs": "npm run test -- --node-arguments='--title=cjs'" | ||
"pretest": "yarn build", | ||
"test": "ava" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -1,6 +0,6 @@ | ||
import { addressparser } from './address'; | ||
import type { MessageAttachment, MessageHeaders } from './message'; | ||
import { Message } from './message'; | ||
import type { SMTPConnectionOptions } from './connection'; | ||
import { SMTPConnection, SMTPState } from './connection'; | ||
import { addressparser } from './address.js'; | ||
import type { MessageAttachment, MessageHeaders } from './message.js'; | ||
import { Message } from './message.js'; | ||
import type { SMTPConnectionOptions } from './connection.js'; | ||
import { SMTPConnection, SMTPState } from './connection.js'; | ||
@@ -48,10 +48,11 @@ export type MessageCallback<T = Message | MessageHeaders> = < | ||
* @public | ||
* @param {Message} msg the message to send | ||
* @param {MessageCallback} callback . | ||
* @template {Message | MessageHeaders} T | ||
* @param {T} msg the message to send | ||
* @param {MessageCallback<T>} callback receiver for the error (if any) as well as the passed-in message / headers | ||
* @returns {void} | ||
*/ | ||
public send( | ||
msg: Message | MessageHeaders, | ||
callback: MessageCallback<Message | MessageHeaders> | ||
) { | ||
public send<T extends Message | MessageHeaders>( | ||
msg: T, | ||
callback: MessageCallback<T> | ||
): void { | ||
const message = | ||
@@ -85,6 +86,7 @@ msg instanceof Message | ||
* @public | ||
* @param {Message} msg the message to send | ||
* @returns {Promise<Message>} a promise that resolves to the fully processed message | ||
* @template {Message | MessageHeaders} T | ||
* @param {T} msg the message to send | ||
* @returns {Promise<T>} a promise that resolves to the passed-in message / headers | ||
*/ | ||
public sendAsync(msg: Message | MessageHeaders) { | ||
public sendAsync<T extends Message | MessageHeaders>(msg: T) { | ||
return new Promise<Message>((resolve, reject) => { | ||
@@ -91,0 +93,0 @@ this.send(msg, (err, message) => { |
@@ -8,4 +8,4 @@ import { createHmac } from 'crypto'; | ||
import { SMTPError, SMTPErrorStates } from './error'; | ||
import { SMTPResponseMonitor } from './response'; | ||
import { SMTPError, SMTPErrorStates } from './error.js'; | ||
import { SMTPResponseMonitor } from './response.js'; | ||
@@ -12,0 +12,0 @@ /** |
@@ -13,5 +13,5 @@ import type { PathLike } from 'fs'; | ||
import { addressparser } from './address'; | ||
import { getRFC2822Date } from './date'; | ||
import { mimeWordEncode } from './mime'; | ||
import { addressparser } from './address.js'; | ||
import { getRFC2822Date } from './date.js'; | ||
import { mimeWordEncode } from './mime.js'; | ||
@@ -18,0 +18,0 @@ const CRLF = '\r\n' as const; |
@@ -1,2 +0,2 @@ | ||
import { SMTPError, SMTPErrorStates } from './error'; | ||
import { SMTPError, SMTPErrorStates } from './error.js'; | ||
import type { Socket } from 'net'; | ||
@@ -3,0 +3,0 @@ import type { TLSSocket } from 'tls'; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
3
160252
13
4623