@types/nodemailer
Advanced tools
Comparing version 3.1.3 to 4.1.0
@@ -1,215 +0,64 @@ | ||
// Type definitions for Nodemailer 3.1.5 | ||
// Project: https://github.com/andris9/Nodemailer | ||
// Type definitions for Nodemailer 4.1 | ||
// Project: https://github.com/nodemailer/nodemailer | ||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten> | ||
// Piotr Roszatycki <https://github.com/dex4er> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
/// <reference types="node" /> | ||
import directTransport = require("nodemailer-direct-transport"); | ||
import smtpTransport = require("nodemailer-smtp-transport"); | ||
import sesTransport = require("nodemailer-ses-transport") | ||
import JSONTransport = require('./lib/json-transport'); | ||
import Mail = require('./lib/mailer'); | ||
import MailMessage = require('./lib/mailer/mail-message'); | ||
import SendmailTransport = require('./lib/sendmail-transport'); | ||
import SESTransport = require('./lib/ses-transport'); | ||
import SMTPPool = require('./lib/smtp-pool'); | ||
import SMTPTransport = require('./lib/smtp-transport'); | ||
import StreamTransport = require('./lib/stream-transport'); | ||
/** | ||
* Transporter plugin | ||
*/ | ||
export interface Plugin { | ||
(mail: SendMailOptions, callback?: (error: Error, info: SentMessageInfo) => void): void; | ||
} | ||
export type SendMailOptions = Mail.Options; | ||
/** | ||
* This is what you use to send mail | ||
*/ | ||
export interface Transporter { | ||
/** | ||
* Send a mail with callback | ||
*/ | ||
sendMail(mail: SendMailOptions, callback: (error: Error, info: SentMessageInfo) => void): void; | ||
export type SentMessageInfo = any; | ||
/** | ||
* Send a mail | ||
* return Promise | ||
*/ | ||
sendMail(mail: SendMailOptions): Promise<SentMessageInfo>; | ||
export type Transporter = Mail; | ||
/** | ||
* Attach a plugin. 'compile' and 'stream' plugins can be attached with use(plugin) method | ||
* | ||
* @param step is a string, either 'compile' or 'stream' thatd defines when the plugin should be hooked | ||
* @param pluginFunc is a function that takes two arguments: the mail object and a callback function | ||
*/ | ||
use(step: string, plugin: Plugin): void; | ||
export interface Transport { | ||
mailer?: Mail; | ||
/** | ||
* Verifies connection with server | ||
*/ | ||
verify(callback: (error: Error, success?: boolean) => void): void; | ||
name: string; | ||
version: string; | ||
/** | ||
* Verifies connection with server | ||
*/ | ||
verify(): Promise<void>; | ||
send(mail: MailMessage, callback: (err: Error | null, info: SentMessageInfo) => void): void; | ||
/** | ||
* Close all connections | ||
*/ | ||
verify?(callback: (err: Error | null, success: true) => void): void; | ||
verify?(): Promise<true>; | ||
close?(): void; | ||
} | ||
/** | ||
* Create a direct transporter | ||
*/ | ||
export declare function createTransport(options?: directTransport.DirectOptions, defaults?: Object): Transporter; | ||
/** | ||
* Create an SMTP transporter | ||
*/ | ||
export declare function createTransport(options?: smtpTransport.SmtpOptions, defaults?: Object): Transporter; | ||
/** | ||
* Create an SMTP transporter using a connection url | ||
*/ | ||
export declare function createTransport(connectionUrl: string, defaults?: Object): Transporter; | ||
/** | ||
* Create an AWS SES transporter | ||
*/ | ||
export declare function createTransport(options?: sesTransport.SesOptions, defaults?: Object): Transporter; | ||
/** | ||
* Create a transporter from a given implementation | ||
*/ | ||
export declare function createTransport(transport: Transport, defaults?: Object): Transporter; | ||
export interface AttachmentObject { | ||
/** | ||
* filename to be reported as the name of the attached file, use of unicode is allowed | ||
*/ | ||
filename?: string; | ||
/** | ||
* optional content id for using inline images in HTML message source | ||
*/ | ||
cid?: string; | ||
/** | ||
* Pathname or URL to use streaming | ||
*/ | ||
path?: string; | ||
/** | ||
* String, Buffer or a Stream contents for the attachment | ||
*/ | ||
content: string|Buffer|NodeJS.ReadableStream; | ||
/** | ||
* If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: base64, hex, 'binary' etc. Useful if you want to use binary attachments in a JSON formatted e-mail object. | ||
*/ | ||
encoding?: string; | ||
/** | ||
* optional content type for the attachment, if not set will be derived from the filename property | ||
*/ | ||
contentType?: string; | ||
/** | ||
* optional content disposition type for the attachment, defaults to 'attachment' | ||
*/ | ||
contentDisposition?: string; | ||
export interface TransportOptions { | ||
component?: string; | ||
} | ||
export interface SendMailOptions { | ||
/** | ||
* The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name <sender@server.com>', see here for details | ||
*/ | ||
from?: string; | ||
/** | ||
* An e-mail address that will appear on the Sender: field | ||
*/ | ||
sender?: string; | ||
/** | ||
* Comma separated list or an array of recipients e-mail addresses that will appear on the To: field | ||
*/ | ||
to?: string|string[]; | ||
/** | ||
* Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field | ||
*/ | ||
cc?: string|string[]; | ||
/** | ||
* Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field | ||
*/ | ||
bcc?: string|string[]; | ||
/** | ||
* An e-mail address that will appear on the Reply-To: field | ||
*/ | ||
replyTo?: string; | ||
/** | ||
* The message-id this message is replying | ||
*/ | ||
inReplyTo?: string; | ||
/** | ||
* Message-id list (an array or space separated string) | ||
*/ | ||
references?: string|string[]; | ||
/** | ||
* The subject of the e-mail | ||
*/ | ||
subject?: string; | ||
/** | ||
* The plaintext version of the message as an Unicode string, Buffer, Stream or an object {path: '...'} | ||
*/ | ||
text?: string|Buffer|NodeJS.ReadableStream|AttachmentObject; | ||
/** | ||
* The HTML version of the message as an Unicode string, Buffer, Stream or an object {path: '...'} | ||
*/ | ||
html?: string|Buffer|NodeJS.ReadableStream|AttachmentObject; | ||
/** | ||
* An object or array of additional header fields (e.g. {"X-Key-Name": "key value"} or [{key: "X-Key-Name", value: "val1"}, {key: "X-Key-Name", value: "val2"}]) | ||
*/ | ||
headers?: any; | ||
/** | ||
* An array of attachment objects (see below for details) | ||
*/ | ||
attachments?: AttachmentObject[]; | ||
/** | ||
* An array of alternative text contents (in addition to text and html parts) (see below for details) | ||
*/ | ||
alternatives?: AttachmentObject[]; | ||
/** | ||
* optional Message-Id value, random value will be generated if not set | ||
*/ | ||
messageId?: string; | ||
/** | ||
* optional Date value, current UTC string will be used if not set | ||
*/ | ||
date?: Date; | ||
/** | ||
* optional transfer encoding for the textual parts (defaults to 'quoted-printable') | ||
*/ | ||
encoding?: string; | ||
export interface TestAccount { | ||
user: string; | ||
pass: string; | ||
smtp: { host: string, port: number, secure: boolean }; | ||
imap: { host: string, port: number, secure: boolean }; | ||
pop3: { host: string, port: number, secure: boolean }; | ||
web: string; | ||
} | ||
export interface SentMessageInfo { | ||
/** | ||
* most transports should return the final Message-Id value used with this property | ||
*/ | ||
messageId: string; | ||
/** | ||
* includes the envelope object for the message | ||
*/ | ||
envelope: any; | ||
/** | ||
* is an array returned by SMTP transports (includes recipient addresses that were accepted by the server) | ||
*/ | ||
accepted: string[]; | ||
/** | ||
* is an array returned by SMTP transports (includes recipient addresses that were rejected by the server) | ||
*/ | ||
rejected: string[]; | ||
/** | ||
* is an array returned by Direct SMTP transport. Includes recipient addresses that were temporarily rejected together with the server response | ||
*/ | ||
pending?: string[]; | ||
/** | ||
* is a string returned by SMTP transports and includes the last SMTP response from the server | ||
*/ | ||
response: string; | ||
} | ||
export function createTransport(transport?: SMTPTransport | SMTPTransport.Options | string, defaults?: SMTPTransport.Options): Mail; | ||
export function createTransport(transport: SMTPPool | SMTPPool.Options, defaults?: SMTPPool.Options): Mail; | ||
export function createTransport(transport: SendmailTransport | SendmailTransport.Options, defaults?: SendmailTransport.Options): Mail; | ||
export function createTransport(transport: StreamTransport | StreamTransport.Options, defaults?: StreamTransport.Options): Mail; | ||
export function createTransport(transport: JSONTransport | JSONTransport.Options, defaults?: JSONTransport.Options): Mail; | ||
export function createTransport(transport: SESTransport | SESTransport.Options, defaults?: SESTransport.Options): Mail; | ||
export function createTransport(transport: Transport | TransportOptions, defaults?: TransportOptions): Mail; | ||
/** | ||
* This is what you implement to create a new transporter yourself | ||
*/ | ||
export interface Transport { | ||
name: string; | ||
version: string; | ||
send(mail: SendMailOptions, callback?: (error: Error, info: SentMessageInfo) => void): void; | ||
close(): void; | ||
} | ||
export function createTestAccount(apiUrl: string, callback: (err: Error | null, testAccount: TestAccount) => void): void; | ||
export function createTestAccount(callback: (err: Error | null, testAccount: TestAccount) => void): void; | ||
export function createTestAccount(apiUrl?: string): Promise<TestAccount>; | ||
export function getTestMessageUrl(info: SESTransport.SentMessageInfo | SMTPTransport.SentMessageInfo): string | false; |
{ | ||
"name": "@types/nodemailer", | ||
"version": "3.1.3", | ||
"version": "4.1.0", | ||
"description": "TypeScript definitions for Nodemailer", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "rogierschouten" | ||
}, | ||
{ | ||
"name": "Piotr Roszatycki", | ||
"url": "https://github.com/dex4er", | ||
"githubUsername": "dex4er" | ||
} | ||
@@ -21,10 +26,6 @@ ], | ||
"dependencies": { | ||
"aws-sdk": "^2.37.0", | ||
"@types/nodemailer-direct-transport": "*", | ||
"@types/nodemailer-smtp-transport": "*", | ||
"@types/nodemailer-ses-transport": "*", | ||
"@types/node": "*" | ||
}, | ||
"typesPublisherContentHash": "f278fe757237c238f5ba2e20b0466ea0ef175ce1a0b4292ff6e5786a278c6265", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "d9ff485a2023811cdbfb4aca51f95c8e7d6769eb90d29561794c123c3e0346cf", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for Nodemailer (https://github.com/andris9/Nodemailer). | ||
This package contains type definitions for Nodemailer (https://github.com/nodemailer/nodemailer). | ||
@@ -12,7 +12,7 @@ # Details | ||
Additional Details | ||
* Last updated: Thu, 31 Aug 2017 21:47:30 GMT | ||
* Dependencies: nodemailer-direct-transport, nodemailer-smtp-transport, nodemailer-ses-transport, node | ||
* Last updated: Wed, 18 Oct 2017 20:09:19 GMT | ||
* Dependencies: stream, node, tls, events, url, net, http | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Rogier Schouten <https://github.com/rogierschouten>. | ||
These definitions were written by Rogier Schouten <https://github.com/rogierschouten>, Piotr Roszatycki <https://github.com/dex4er>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60068
1
26
1169
1
- Removed@types/nodemailer-direct-transport@*
- Removed@types/nodemailer-ses-transport@*
- Removed@types/nodemailer-smtp-transport@*
- Removedaws-sdk@^2.37.0
- Removed@types/nodemailer-direct-transport@1.0.35(transitive)
- Removed@types/nodemailer-ses-transport@3.1.6(transitive)
- Removed@types/nodemailer-smtp-transport@2.7.8(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedaws-sdk@2.1691.0(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@4.9.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedevents@1.1.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedieee754@1.1.13(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjmespath@0.16.0(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedpunycode@1.3.2(transitive)
- Removedquerystring@0.2.0(transitive)
- Removedsax@1.2.1(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedurl@0.10.3(transitive)
- Removedutil@0.12.5(transitive)
- Removeduuid@8.0.0(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedxml2js@0.6.2(transitive)
- Removedxmlbuilder@11.0.1(transitive)