@types/nodemailer 6.4.2 → 6.4.5
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.
- nodemailer/README.md +1 -1
- nodemailer/index.d.ts +2 -2
- nodemailer/lib/{addressparser.d.ts → addressparser/index.d.ts} +0 -0
- nodemailer/lib/{base64.d.ts → base64/index.d.ts} +1 -1
- nodemailer/lib/dkim/index.d.ts +5 -5
- nodemailer/lib/fetch/cookies.d.ts +7 -7
- nodemailer/lib/fetch/index.d.ts +13 -13
- nodemailer/lib/{json-transport.d.ts → json-transport/index.d.ts} +10 -6
- nodemailer/lib/{mail-composer.d.ts → mail-composer/index.d.ts} +2 -2
- nodemailer/lib/mailer/index.d.ts +50 -50
- nodemailer/lib/mime-funcs/index.d.ts +1 -1
- nodemailer/lib/mime-node/index.d.ts +12 -12
- nodemailer/lib/{qp.d.ts → qp/index.d.ts} +1 -1
- nodemailer/lib/sendmail-transport/index.d.ts +10 -4
- nodemailer/lib/{ses-transport.d.ts → ses-transport/index.d.ts} +19 -16
- nodemailer/lib/{shared.d.ts → shared/index.d.ts} +4 -4
- nodemailer/lib/smtp-connection/index.d.ts +35 -35
- nodemailer/lib/smtp-pool/index.d.ts +8 -8
- nodemailer/lib/{smtp-transport.d.ts → smtp-transport/index.d.ts} +22 -13
- nodemailer/lib/{stream-transport.d.ts → stream-transport/index.d.ts} +11 -7
- nodemailer/lib/{well-known.d.ts → well-known/index.d.ts} +1 -1
- nodemailer/lib/{xoauth2.d.ts → xoauth2/index.d.ts} +12 -12
- nodemailer/package.json +4 -3
nodemailer/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Nodemailer (https://github.com/nodema
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Fri, 05 Aug 2022 02:02:10 GMT
|
|
12
12
|
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
nodemailer/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type Transporter<T = any> = Mail<T>;
|
|
|
24
24
|
export type SentMessageInfo = any;
|
|
25
25
|
|
|
26
26
|
export interface Transport<T = any> {
|
|
27
|
-
mailer?: Transporter<T
|
|
27
|
+
mailer?: Transporter<T> | undefined;
|
|
28
28
|
|
|
29
29
|
name: string;
|
|
30
30
|
version: string;
|
|
@@ -38,7 +38,7 @@ export interface Transport<T = any> {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export interface TransportOptions {
|
|
41
|
-
component?: string;
|
|
41
|
+
component?: string | undefined;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export interface TestAccount {
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ export function encode(buffer: Buffer | string): string;
|
|
|
9
9
|
export function wrap(str: string, lineLength?: number): string;
|
|
10
10
|
|
|
11
11
|
export interface EncoderOptions extends TransformOptions {
|
|
12
|
-
lineLength?: number | false;
|
|
12
|
+
lineLength?: number | false | undefined;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export class Encoder extends Transform {
|
nodemailer/lib/dkim/index.d.ts
CHANGED
|
@@ -5,15 +5,15 @@ import { PassThrough, Readable } from 'stream';
|
|
|
5
5
|
declare namespace DKIM {
|
|
6
6
|
interface OptionalOptions {
|
|
7
7
|
/** optional location for cached messages. If not set then caching is not used. */
|
|
8
|
-
cacheDir?: string | false;
|
|
8
|
+
cacheDir?: string | false | undefined;
|
|
9
9
|
/** optional size in bytes, if message is larger than this treshold it gets cached to disk (assuming cacheDir is set and writable). Defaults to 131072 (128 kB). */
|
|
10
|
-
cacheTreshold?: number;
|
|
10
|
+
cacheTreshold?: number | undefined;
|
|
11
11
|
/** optional algorithm for the body hash, defaults to ‘sha256’ */
|
|
12
|
-
hashAlgo?: string;
|
|
12
|
+
hashAlgo?: string | undefined;
|
|
13
13
|
/** an optional colon separated list of header keys to sign (eg. message-id:date:from:to...') */
|
|
14
|
-
headerFieldNames?: string;
|
|
14
|
+
headerFieldNames?: string | undefined;
|
|
15
15
|
/** optional colon separated list of header keys not to sign. This is useful if you want to sign all the relevant keys but your provider changes some values, ie Message-ID and Date. In this case you should use 'message-id:date' to prevent signing these values. */
|
|
16
|
-
skipFields?: string;
|
|
16
|
+
skipFields?: string | undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface SingleKeyOptions extends OptionalOptions {
|
|
@@ -3,16 +3,16 @@ type s = number;
|
|
|
3
3
|
declare namespace Cookies {
|
|
4
4
|
interface Cookie {
|
|
5
5
|
name: string;
|
|
6
|
-
value?: string;
|
|
7
|
-
expires?: Date;
|
|
8
|
-
path?: string;
|
|
9
|
-
domain?: string;
|
|
10
|
-
secure?: boolean;
|
|
11
|
-
httponly?: boolean;
|
|
6
|
+
value?: string | undefined;
|
|
7
|
+
expires?: Date | undefined;
|
|
8
|
+
path?: string | undefined;
|
|
9
|
+
domain?: string | undefined;
|
|
10
|
+
secure?: boolean | undefined;
|
|
11
|
+
httponly?: boolean | undefined;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface Options {
|
|
15
|
-
sessionTimeout?: s;
|
|
15
|
+
sessionTimeout?: s | undefined;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
nodemailer/lib/fetch/index.d.ts
CHANGED
|
@@ -17,19 +17,19 @@ declare namespace fetch {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface Options {
|
|
20
|
-
fetchRes?: Writable;
|
|
21
|
-
cookies?: Cookies;
|
|
22
|
-
cookie?: string;
|
|
23
|
-
redirects?: number;
|
|
24
|
-
maxRedirects?: number;
|
|
25
|
-
method?: string;
|
|
26
|
-
headers?: { [key: string]: string };
|
|
27
|
-
userAgent?: string;
|
|
28
|
-
body?: Buffer | string | { [key: string]: string };
|
|
29
|
-
contentType?: string | false;
|
|
30
|
-
tls?: tls.TlsOptions;
|
|
31
|
-
timeout?: ms;
|
|
32
|
-
allowErrorResponse?: boolean;
|
|
20
|
+
fetchRes?: Writable | undefined;
|
|
21
|
+
cookies?: Cookies | undefined;
|
|
22
|
+
cookie?: string | undefined;
|
|
23
|
+
redirects?: number | undefined;
|
|
24
|
+
maxRedirects?: number | undefined;
|
|
25
|
+
method?: string | undefined;
|
|
26
|
+
headers?: { [key: string]: string } | undefined;
|
|
27
|
+
userAgent?: string | undefined;
|
|
28
|
+
body?: Buffer | string | { [key: string]: string } | undefined;
|
|
29
|
+
contentType?: string | false | undefined;
|
|
30
|
+
tls?: tls.TlsOptions | undefined;
|
|
31
|
+
timeout?: ms | undefined;
|
|
32
|
+
allowErrorResponse?: boolean | undefined;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
|
|
5
|
-
import { Transport, TransportOptions } from '
|
|
5
|
+
import { Transport, TransportOptions } from '../..';
|
|
6
6
|
|
|
7
|
-
import * as shared from '
|
|
7
|
+
import * as shared from '../shared';
|
|
8
8
|
|
|
9
|
-
import Mail = require('
|
|
10
|
-
import MailMessage = require('
|
|
11
|
-
import MimeNode = require('
|
|
9
|
+
import Mail = require('../mailer');
|
|
10
|
+
import MailMessage = require('../mailer/mail-message');
|
|
11
|
+
import MimeNode = require('../mime-node');
|
|
12
12
|
|
|
13
13
|
declare namespace JSONTransport {
|
|
14
14
|
type MailOptions = Mail.Options;
|
|
15
15
|
|
|
16
16
|
interface Options extends MailOptions, TransportOptions {
|
|
17
17
|
jsonTransport: true;
|
|
18
|
-
skipEncoding?: boolean;
|
|
18
|
+
skipEncoding?: boolean | undefined;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
interface SentMessageInfo {
|
|
@@ -25,6 +25,10 @@ declare namespace JSONTransport {
|
|
|
25
25
|
messageId: string;
|
|
26
26
|
/** JSON string */
|
|
27
27
|
message: string;
|
|
28
|
+
accepted: Array<string | Mail.Address>;
|
|
29
|
+
rejected: Array<string | Mail.Address>;
|
|
30
|
+
pending: Array<string | Mail.Address>;
|
|
31
|
+
response: string;
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { URL } from 'url';
|
|
4
4
|
|
|
5
|
-
import Mail = require('
|
|
6
|
-
import MimeNode = require('
|
|
5
|
+
import Mail = require('../mailer');
|
|
6
|
+
import MimeNode = require('../mime-node');
|
|
7
7
|
|
|
8
8
|
/** Creates the object for composing a MimeNode instance out from the mail options */
|
|
9
9
|
declare class MailComposer {
|
nodemailer/lib/mailer/index.d.ts
CHANGED
|
@@ -32,50 +32,50 @@ declare namespace Mail {
|
|
|
32
32
|
|
|
33
33
|
interface AttachmentLike {
|
|
34
34
|
/** String, Buffer or a Stream contents for the attachmentent */
|
|
35
|
-
content?: string | Buffer | Readable;
|
|
35
|
+
content?: string | Buffer | Readable | undefined;
|
|
36
36
|
/** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */
|
|
37
|
-
path?: string | Url;
|
|
37
|
+
path?: string | Url | undefined;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
interface Attachment extends AttachmentLike {
|
|
41
41
|
/** filename to be reported as the name of the attached file, use of unicode is allowed. If you do not want to use a filename, set this value as false, otherwise a filename is generated automatically */
|
|
42
|
-
filename?: string | false;
|
|
42
|
+
filename?: string | false | undefined;
|
|
43
43
|
/** optional content id for using inline images in HTML message source. Using cid sets the default contentDisposition to 'inline' and moves the attachment into a multipart/related mime node, so use it only if you actually want to use this attachment as an embedded image */
|
|
44
|
-
cid?: string;
|
|
44
|
+
cid?: string | undefined;
|
|
45
45
|
/** 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 */
|
|
46
|
-
encoding?: string;
|
|
46
|
+
encoding?: string | undefined;
|
|
47
47
|
/** optional content type for the attachment, if not set will be derived from the filename property */
|
|
48
|
-
contentType?: string;
|
|
48
|
+
contentType?: string | undefined;
|
|
49
49
|
/** optional transfer encoding for the attachment, if not set it will be derived from the contentType property. Example values: quoted-printable, base64. If it is unset then base64 encoding is used for the attachment. If it is set to false then previous default applies (base64 for most, 7bit for text). */
|
|
50
|
-
contentTransferEncoding?: '7bit' | 'base64' | 'quoted-printable' | false;
|
|
50
|
+
contentTransferEncoding?: '7bit' | 'base64' | 'quoted-printable' | false | undefined;
|
|
51
51
|
/** optional content disposition type for the attachment, defaults to ‘attachment’ */
|
|
52
|
-
contentDisposition?: 'attachment' | 'inline';
|
|
52
|
+
contentDisposition?: 'attachment' | 'inline' | undefined;
|
|
53
53
|
/** is an object of additional headers */
|
|
54
|
-
headers?: Headers;
|
|
54
|
+
headers?: Headers | undefined;
|
|
55
55
|
/** an optional value that overrides entire node content in the mime message. If used then all other options set for this node are ignored. */
|
|
56
|
-
raw?: string | Buffer | Readable | AttachmentLike;
|
|
56
|
+
raw?: string | Buffer | Readable | AttachmentLike | undefined;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
interface AmpAttachment extends AttachmentLike {
|
|
60
60
|
/** is an alternative for content to load the AMP4EMAIL data from an URL */
|
|
61
|
-
href?: string;
|
|
61
|
+
href?: string | undefined;
|
|
62
62
|
/** defines optional content encoding, eg. ‘base64’ or ‘hex’. This only applies if the content is a string. By default an unicode string is assumed. */
|
|
63
|
-
encoding?: string;
|
|
63
|
+
encoding?: string | undefined;
|
|
64
64
|
/** optional content type for the attachment, if not set will be derived from the filename property */
|
|
65
|
-
contentType?: string;
|
|
65
|
+
contentType?: string | undefined;
|
|
66
66
|
/** an optional value that overrides entire node content in the mime message. If used then all other options set for this node are ignored. */
|
|
67
|
-
raw?: string | Buffer | Readable | AttachmentLike;
|
|
67
|
+
raw?: string | Buffer | Readable | AttachmentLike | undefined;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
interface IcalAttachment extends AttachmentLike {
|
|
71
71
|
/** optional method, case insensitive, defaults to ‘publish’. Other possible values would be ‘request’, ‘reply’, ‘cancel’ or any other valid calendar method listed in RFC5546. This should match the METHOD: value in calendar event file. */
|
|
72
|
-
method?: string;
|
|
72
|
+
method?: string | undefined;
|
|
73
73
|
/** optional filename, defaults to ‘invite.ics’ */
|
|
74
|
-
filename?: string | false;
|
|
74
|
+
filename?: string | false | undefined;
|
|
75
75
|
/** is an alternative for content to load the calendar data from an URL */
|
|
76
|
-
href?: string;
|
|
76
|
+
href?: string | undefined;
|
|
77
77
|
/** defines optional content encoding, eg. ‘base64’ or ‘hex’. This only applies if the content is a string. By default an unicode string is assumed. */
|
|
78
|
-
encoding?: string;
|
|
78
|
+
encoding?: string | undefined;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
interface Connection {
|
|
@@ -84,73 +84,73 @@ declare namespace Mail {
|
|
|
84
84
|
|
|
85
85
|
interface Envelope {
|
|
86
86
|
/** the first address gets used as MAIL FROM address in SMTP */
|
|
87
|
-
from?: string;
|
|
87
|
+
from?: string | undefined;
|
|
88
88
|
/** addresses from this value get added to RCPT TO list */
|
|
89
|
-
to?: string;
|
|
89
|
+
to?: string | undefined;
|
|
90
90
|
/** addresses from this value get added to RCPT TO list */
|
|
91
|
-
cc?: string;
|
|
91
|
+
cc?: string | undefined;
|
|
92
92
|
/** addresses from this value get added to RCPT TO list */
|
|
93
|
-
bcc?: string;
|
|
93
|
+
bcc?: string | undefined;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
interface Options {
|
|
97
97
|
/** The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name <sender@server.com>' */
|
|
98
|
-
from?: string | Address;
|
|
98
|
+
from?: string | Address | undefined;
|
|
99
99
|
/** An e-mail address that will appear on the Sender: field */
|
|
100
|
-
sender?: string | Address;
|
|
100
|
+
sender?: string | Address | undefined;
|
|
101
101
|
/** Comma separated list or an array of recipients e-mail addresses that will appear on the To: field */
|
|
102
|
-
to?: string | Address | Array<string | Address
|
|
102
|
+
to?: string | Address | Array<string | Address> | undefined;
|
|
103
103
|
/** Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field */
|
|
104
|
-
cc?: string | Address | Array<string | Address
|
|
104
|
+
cc?: string | Address | Array<string | Address> | undefined;
|
|
105
105
|
/** Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field */
|
|
106
|
-
bcc?: string | Address | Array<string | Address
|
|
106
|
+
bcc?: string | Address | Array<string | Address> | undefined;
|
|
107
107
|
/** An e-mail address that will appear on the Reply-To: field */
|
|
108
|
-
replyTo?: string | Address;
|
|
108
|
+
replyTo?: string | Address | undefined;
|
|
109
109
|
/** The message-id this message is replying */
|
|
110
|
-
inReplyTo?: string | Address;
|
|
110
|
+
inReplyTo?: string | Address | undefined;
|
|
111
111
|
/** Message-id list (an array or space separated string) */
|
|
112
|
-
references?: string | string[];
|
|
112
|
+
references?: string | string[] | undefined;
|
|
113
113
|
/** The subject of the e-mail */
|
|
114
|
-
subject?: string;
|
|
114
|
+
subject?: string | undefined;
|
|
115
115
|
/** The plaintext version of the message */
|
|
116
|
-
text?: string | Buffer | Readable | AttachmentLike;
|
|
116
|
+
text?: string | Buffer | Readable | AttachmentLike | undefined;
|
|
117
117
|
/** The HTML version of the message */
|
|
118
|
-
html?: string | Buffer | Readable | AttachmentLike;
|
|
118
|
+
html?: string | Buffer | Readable | AttachmentLike | undefined;
|
|
119
119
|
/** Apple Watch specific HTML version of the message, same usage as with text and html */
|
|
120
|
-
watchHtml?: string | Buffer | Readable | AttachmentLike;
|
|
120
|
+
watchHtml?: string | Buffer | Readable | AttachmentLike | undefined;
|
|
121
121
|
/** AMP4EMAIL specific HTML version of the message, same usage as with text and html. Make sure it is a full and valid AMP4EMAIL document, otherwise the displaying email client falls back to html and ignores the amp part */
|
|
122
|
-
amp?: string | Buffer | Readable | AmpAttachment;
|
|
122
|
+
amp?: string | Buffer | Readable | AmpAttachment | undefined;
|
|
123
123
|
/** iCalendar event, same usage as with text and html. Event method attribute defaults to ‘PUBLISH’ or define it yourself: {method: 'REQUEST', content: iCalString}. This value is added as an additional alternative to html or text. Only utf-8 content is allowed */
|
|
124
|
-
icalEvent?: string | Buffer | Readable | IcalAttachment;
|
|
124
|
+
icalEvent?: string | Buffer | Readable | IcalAttachment | undefined;
|
|
125
125
|
/** An object or array of additional header fields */
|
|
126
|
-
headers?: Headers;
|
|
126
|
+
headers?: Headers | undefined;
|
|
127
127
|
/** An object where key names are converted into list headers. List key help becomes List-Help header etc. */
|
|
128
|
-
list?: ListHeaders;
|
|
128
|
+
list?: ListHeaders | undefined;
|
|
129
129
|
/** An array of attachment objects */
|
|
130
|
-
attachments?: Attachment[];
|
|
130
|
+
attachments?: Attachment[] | undefined;
|
|
131
131
|
/** An array of alternative text contents (in addition to text and html parts) */
|
|
132
|
-
alternatives?: Attachment[];
|
|
132
|
+
alternatives?: Attachment[] | undefined;
|
|
133
133
|
/** optional SMTP envelope, if auto generated envelope is not suitable */
|
|
134
|
-
envelope?: Envelope | MimeNode.Envelope;
|
|
134
|
+
envelope?: Envelope | MimeNode.Envelope | undefined;
|
|
135
135
|
/** optional Message-Id value, random value will be generated if not set */
|
|
136
|
-
messageId?: string;
|
|
136
|
+
messageId?: string | undefined;
|
|
137
137
|
/** optional Date value, current UTC string will be used if not set */
|
|
138
|
-
date?: Date | string;
|
|
138
|
+
date?: Date | string | undefined;
|
|
139
139
|
/** optional transfer encoding for the textual parts */
|
|
140
|
-
encoding?: string;
|
|
140
|
+
encoding?: string | undefined;
|
|
141
141
|
/** if set then overwrites entire message output with this value. The value is not parsed, so you should still set address headers or the envelope value for the message to work */
|
|
142
|
-
raw?: string | Buffer | Readable | AttachmentLike;
|
|
142
|
+
raw?: string | Buffer | Readable | AttachmentLike | undefined;
|
|
143
143
|
/** set explicitly which encoding to use for text parts (quoted-printable or base64). If not set then encoding is detected from text content (mostly ascii means quoted-printable, otherwise base64) */
|
|
144
|
-
textEncoding?: TextEncoding;
|
|
144
|
+
textEncoding?: TextEncoding | undefined;
|
|
145
145
|
/** if set to true then fails with an error when a node tries to load content from URL */
|
|
146
|
-
disableUrlAccess?: boolean;
|
|
146
|
+
disableUrlAccess?: boolean | undefined;
|
|
147
147
|
/** if set to true then fails with an error when a node tries to load content from a file */
|
|
148
|
-
disableFileAccess?: boolean;
|
|
148
|
+
disableFileAccess?: boolean | undefined;
|
|
149
149
|
/** is an object with DKIM options */
|
|
150
|
-
dkim?: DKIM.Options;
|
|
150
|
+
dkim?: DKIM.Options | undefined;
|
|
151
151
|
/** method to normalize header keys for custom caseing */
|
|
152
152
|
normalizeHeaderKey?(key: string): string;
|
|
153
|
-
priority?: "high"|"normal"|"low";
|
|
153
|
+
priority?: "high"|"normal"|"low" | undefined;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
type PluginFunction<T = any> = (mail: MailMessage<T>, callback: (err?: Error | null) => void) => void;
|
|
@@ -7,12 +7,12 @@ import SMTPConnection = require('../smtp-connection');
|
|
|
7
7
|
|
|
8
8
|
declare namespace MimeNode {
|
|
9
9
|
interface Addresses {
|
|
10
|
-
from?: string[];
|
|
11
|
-
sender?: string[];
|
|
12
|
-
'reply-to'?: string[];
|
|
13
|
-
to?: string[];
|
|
14
|
-
cc?: string[];
|
|
15
|
-
bcc?: string[];
|
|
10
|
+
from?: string[] | undefined;
|
|
11
|
+
sender?: string[] | undefined;
|
|
12
|
+
'reply-to'?: string[] | undefined;
|
|
13
|
+
to?: string[] | undefined;
|
|
14
|
+
cc?: string[] | undefined;
|
|
15
|
+
bcc?: string[] | undefined;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
interface Envelope {
|
|
@@ -24,17 +24,17 @@ declare namespace MimeNode {
|
|
|
24
24
|
|
|
25
25
|
interface Options {
|
|
26
26
|
/** root node for this tree */
|
|
27
|
-
rootNode?: MimeNode;
|
|
27
|
+
rootNode?: MimeNode | undefined;
|
|
28
28
|
/** immediate parent for this node */
|
|
29
|
-
parentNode?: MimeNode;
|
|
29
|
+
parentNode?: MimeNode | undefined;
|
|
30
30
|
/** filename for an attachment node */
|
|
31
|
-
filename?: string;
|
|
31
|
+
filename?: string | undefined;
|
|
32
32
|
/** shared part of the unique multipart boundary */
|
|
33
|
-
baseBoundary?: string;
|
|
33
|
+
baseBoundary?: string | undefined;
|
|
34
34
|
/** If true, do not exclude Bcc from the generated headers */
|
|
35
|
-
keepBcc?: boolean;
|
|
35
|
+
keepBcc?: boolean | undefined;
|
|
36
36
|
/** either 'Q' (the default) or 'B' */
|
|
37
|
-
textEncoding?: 'B' | 'Q';
|
|
37
|
+
textEncoding?: 'B' | 'Q' | undefined;
|
|
38
38
|
/** method to normalize header keys for custom caseing */
|
|
39
39
|
normalizeHeaderKey?(key: string): string;
|
|
40
40
|
}
|
|
@@ -9,7 +9,7 @@ export function encode(buffer: Buffer | string): string;
|
|
|
9
9
|
export function wrap(str: string, lineLength?: number): string;
|
|
10
10
|
|
|
11
11
|
export interface EncoderOptions extends TransformOptions {
|
|
12
|
-
lineLength?: number | false;
|
|
12
|
+
lineLength?: number | false | undefined;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/** Creates a transform stream for encoding data to Quoted-Printable encoding */
|
|
@@ -14,17 +14,20 @@ declare namespace SendmailTransport {
|
|
|
14
14
|
interface Options extends MailOptions, TransportOptions {
|
|
15
15
|
sendmail: true;
|
|
16
16
|
/** path to the sendmail command (defaults to ‘sendmail’) */
|
|
17
|
-
path?: string;
|
|
17
|
+
path?: string | undefined;
|
|
18
18
|
/** either ‘windows’ or ‘unix’ (default). Forces all newlines in the output to either use Windows syntax <CR><LF> or Unix syntax <LF> */
|
|
19
|
-
newline?: string;
|
|
19
|
+
newline?: string | undefined;
|
|
20
20
|
/** an optional array of command line options to pass to the sendmail command (ie. ["-f", "foo@blurdybloop.com"]). This overrides all default arguments except for ’-i’ and recipient list so you need to make sure you have all required arguments set (ie. the ‘-f’ flag). */
|
|
21
|
-
args?: string[];
|
|
21
|
+
args?: string[] | undefined;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
interface SentMessageInfo {
|
|
25
25
|
envelope: MimeNode.Envelope;
|
|
26
26
|
messageId: string;
|
|
27
27
|
response: string;
|
|
28
|
+
accepted: Array<string | Mail.Address>;
|
|
29
|
+
rejected: Array<string | Mail.Address>;
|
|
30
|
+
pending: Array<string | Mail.Address>;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -41,7 +44,10 @@ declare class SendmailTransport implements Transport<SendmailTransport.SentMessa
|
|
|
41
44
|
constructor(options: SendmailTransport.Options);
|
|
42
45
|
|
|
43
46
|
/** Compiles a mailcomposer message and forwards it to handler that sends it */
|
|
44
|
-
send(
|
|
47
|
+
send(
|
|
48
|
+
mail: MailMessage<SendmailTransport.SentMessageInfo>,
|
|
49
|
+
callback: (err: Error | null, info: SendmailTransport.SentMessageInfo) => void,
|
|
50
|
+
): void;
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
export = SendmailTransport;
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
|
|
5
|
-
import { Transport, TransportOptions } from '
|
|
5
|
+
import { Transport, TransportOptions } from '../..';
|
|
6
6
|
|
|
7
|
-
import * as shared from '
|
|
7
|
+
import * as shared from '../shared';
|
|
8
8
|
|
|
9
|
-
import Mail = require('
|
|
10
|
-
import MailMessage = require('
|
|
11
|
-
import MimeNode = require('
|
|
9
|
+
import Mail = require('../mailer');
|
|
10
|
+
import MailMessage = require('../mailer/mail-message');
|
|
11
|
+
import MimeNode = require('../mime-node');
|
|
12
12
|
|
|
13
13
|
declare namespace SESTransport {
|
|
14
14
|
interface MailOptions extends Mail.Options {
|
|
15
15
|
/** list of keys that SendRawEmail method can take */
|
|
16
|
-
ses?: MailSesOptions;
|
|
16
|
+
ses?: MailSesOptions | undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface MailSesOptions {
|
|
20
20
|
/**
|
|
21
21
|
* The identity's email address. If you do not provide a value for this parameter, you must specify a "From" address in the raw text of the message. (You can also specify both.) Amazon SES does not support the SMTPUTF8 extension, as described inRFC6531. For this reason, the local part of a source email address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as described in RFC3492. The sender name (also known as the friendly name) may contain non-ASCII characters. These characters must be encoded using MIME encoded-word syntax, as described in RFC 2047. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. If you specify the Source parameter and have feedback forwarding enabled, then bounces and complaints will be sent to this email address. This takes precedence over any Return-Path header that you might include in the raw text of the message.
|
|
22
22
|
*/
|
|
23
|
-
Source?: string;
|
|
23
|
+
Source?: string | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* A list of destinations for the message, consisting of To:, CC:, and BCC: addresses.
|
|
26
26
|
*/
|
|
27
|
-
Destinations?: string[];
|
|
27
|
+
Destinations?: string[] | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* The raw email message itself. The message has to meet the following criteria: The message has to contain a header and a body, separated by a blank line. All of the required header fields must be present in the message. Each part of a multipart MIME message must be formatted properly. Attachments must be of a content type that Amazon SES supports. For a list on unsupported content types, see Unsupported Attachment Types in the Amazon SES Developer Guide. The entire message must be base64-encoded. If any of the MIME parts in your message contain content that is outside of the 7-bit ASCII character range, we highly recommend that you encode that content. For more information, see Sending Raw Email in the Amazon SES Developer Guide. Per RFC 5321, the maximum length of each line of text, including the <CRLF>, must not exceed 1,000 characters.
|
|
30
30
|
*/
|
|
@@ -33,19 +33,19 @@ declare namespace SESTransport {
|
|
|
33
33
|
* The raw data of the message. This data needs to base64-encoded if you are accessing Amazon SES directly through the HTTPS interface. If you are accessing Amazon SES using an AWS SDK, the SDK takes care of the base 64-encoding for you. In all cases, the client must ensure that the message format complies with Internet email standards regarding email header fields, MIME types, and MIME encoding. The To:, CC:, and BCC: headers in the raw message can contain a group list. If you are using SendRawEmail with sending authorization, you can include X-headers in the raw message to specify the "Source," "From," and "Return-Path" addresses. For more information, see the documentation for SendRawEmail. Do not include these X-headers in the DKIM signature, because they are removed by Amazon SES before sending the email. For more information, go to the Amazon SES Developer Guide.
|
|
34
34
|
*/
|
|
35
35
|
Data: Buffer|Uint8Array|{}|string;
|
|
36
|
-
};
|
|
36
|
+
} | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to specify a particular "From" address in the header of the raw email. Instead of using this parameter, you can use the X-header X-SES-FROM-ARN in the raw message of the email. If you use both the FromArn parameter and the corresponding X-header, Amazon SES uses the value of the FromArn parameter. For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.
|
|
39
39
|
*/
|
|
40
|
-
FromArn?: string;
|
|
40
|
+
FromArn?: string | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to send for the email address specified in the Source parameter. For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to send from user@example.com, then you would specify the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the Source to be user@example.com. Instead of using this parameter, you can use the X-header X-SES-SOURCE-ARN in the raw message of the email. If you use both the SourceArn parameter and the corresponding X-header, Amazon SES uses the value of the SourceArn parameter. For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.
|
|
43
43
|
*/
|
|
44
|
-
SourceArn?: string;
|
|
44
|
+
SourceArn?: string | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the ReturnPath parameter. For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the ReturnPath to be feedback@example.com. Instead of using this parameter, you can use the X-header X-SES-RETURN-PATH-ARN in the raw message of the email. If you use both the ReturnPathArn parameter and the corresponding X-header, Amazon SES uses the value of the ReturnPathArn parameter. For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.
|
|
47
47
|
*/
|
|
48
|
-
ReturnPathArn?: string;
|
|
48
|
+
ReturnPathArn?: string | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* A list of tags, in the form of name/value pairs, to apply to an email that you send using SendRawEmail. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.
|
|
51
51
|
*/
|
|
@@ -58,20 +58,20 @@ declare namespace SESTransport {
|
|
|
58
58
|
* The value of the tag. The value must: This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). Contain less than 256 characters.
|
|
59
59
|
*/
|
|
60
60
|
Value: string;
|
|
61
|
-
}
|
|
61
|
+
}> | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* The name of the configuration set to use when you send an email using SendRawEmail.
|
|
64
64
|
*/
|
|
65
|
-
ConfigurationSetName?: string;
|
|
65
|
+
ConfigurationSetName?: string | undefined;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
interface Options extends MailOptions, TransportOptions {
|
|
69
69
|
/** is an option that expects an instantiated aws.SES object */
|
|
70
70
|
SES: any; // aws-sdk.SES object
|
|
71
71
|
/** How many messages per second is allowed to be delivered to SES */
|
|
72
|
-
maxConnections?: number;
|
|
72
|
+
maxConnections?: number | undefined;
|
|
73
73
|
/** How many parallel connections to allow towards SES */
|
|
74
|
-
sendingRate?: number;
|
|
74
|
+
sendingRate?: number | undefined;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
interface SentMessageInfo {
|
|
@@ -80,6 +80,9 @@ declare namespace SESTransport {
|
|
|
80
80
|
/** the Message-ID header value. This value is derived from the response of SES API, so it differs from the Message-ID values used in logging. */
|
|
81
81
|
messageId: string;
|
|
82
82
|
response: string;
|
|
83
|
+
accepted: Array<string | Mail.Address>;
|
|
84
|
+
rejected: Array<string | Mail.Address>;
|
|
85
|
+
pending: Array<string | Mail.Address>;
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import SMTPConnection = require('
|
|
3
|
+
import SMTPConnection = require('../smtp-connection');
|
|
4
4
|
|
|
5
5
|
import * as stream from 'stream';
|
|
6
6
|
|
|
@@ -17,14 +17,14 @@ export interface Logger {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface ResolveHostnameOptions {
|
|
20
|
-
host?: string;
|
|
21
|
-
servername?: string | false;
|
|
20
|
+
host?: string | undefined;
|
|
21
|
+
servername?: string | false | undefined;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface ResolveHostnameValue {
|
|
25
25
|
host: string;
|
|
26
26
|
servername: string | false;
|
|
27
|
-
_cached?: true;
|
|
27
|
+
_cached?: true | undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export function resolveHostname(options: ResolveHostnameOptions | null | undefined, callback: (err: Error | null, value: ResolveHostnameValue) => void): void;
|
|
@@ -30,12 +30,12 @@ declare namespace SMTPConnection {
|
|
|
30
30
|
|
|
31
31
|
interface AuthenticationTypeLogin extends Credentials {
|
|
32
32
|
/** indicates the authetication type, defaults to ‘login’, other option is ‘oauth2’ or ‘custom’ */
|
|
33
|
-
type?: 'login' | 'Login' | 'LOGIN';
|
|
33
|
+
type?: 'login' | 'Login' | 'LOGIN' | undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface AuthenticationTypeOAuth2 extends OAuth2 {
|
|
37
37
|
/** indicates the authetication type, defaults to ‘login’, other option is ‘oauth2’ or ‘custom’ */
|
|
38
|
-
type?: 'oauth2' | 'OAuth2' | 'OAUTH2';
|
|
38
|
+
type?: 'oauth2' | 'OAuth2' | 'OAUTH2' | undefined;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
type AuthenticationType = AuthenticationTypeCustom | AuthenticationTypeLogin | AuthenticationTypeOAuth2;
|
|
@@ -55,7 +55,7 @@ declare namespace SMTPConnection {
|
|
|
55
55
|
response: string;
|
|
56
56
|
status: number;
|
|
57
57
|
text: string;
|
|
58
|
-
code?: number;
|
|
58
|
+
code?: number | undefined;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
interface CustomAuthenticationContext {
|
|
@@ -78,13 +78,13 @@ declare namespace SMTPConnection {
|
|
|
78
78
|
|
|
79
79
|
interface DSNOptions {
|
|
80
80
|
/** return either the full message ‘FULL’ or only headers ‘HDRS’ */
|
|
81
|
-
ret?: 'Full' | 'HDRS';
|
|
81
|
+
ret?: 'Full' | 'HDRS' | undefined;
|
|
82
82
|
/** sender’s ‘envelope identifier’ for tracking */
|
|
83
|
-
envid?: string;
|
|
83
|
+
envid?: string | undefined;
|
|
84
84
|
/** when to send a DSN. Multiple options are OK - array or comma delimited. NEVER must appear by itself. */
|
|
85
|
-
notify?: DSNOption | DSNOption[];
|
|
85
|
+
notify?: DSNOption | DSNOption[] | undefined;
|
|
86
86
|
/** original recipient */
|
|
87
|
-
orcpt?: string;
|
|
87
|
+
orcpt?: string | undefined;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
interface Envelope {
|
|
@@ -93,22 +93,22 @@ declare namespace SMTPConnection {
|
|
|
93
93
|
/** the recipient address or an array of addresses */
|
|
94
94
|
to: string | string[];
|
|
95
95
|
/** an optional value of the predicted size of the message in bytes. This value is used if the server supports the SIZE extension (RFC1870) */
|
|
96
|
-
size?: number;
|
|
96
|
+
size?: number | undefined;
|
|
97
97
|
/** if true then inform the server that this message might contain bytes outside 7bit ascii range */
|
|
98
|
-
use8BitMime?: boolean;
|
|
98
|
+
use8BitMime?: boolean | undefined;
|
|
99
99
|
/** the dsn options */
|
|
100
|
-
dsn?: DSNOptions;
|
|
100
|
+
dsn?: DSNOptions | undefined;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
interface SMTPError extends NodeJS.ErrnoException {
|
|
104
104
|
/** string code identifying the error, for example ‘EAUTH’ is returned when authentication */
|
|
105
|
-
code?: string;
|
|
105
|
+
code?: string | undefined;
|
|
106
106
|
/** the last response received from the server (if the error is caused by an error response from the server) */
|
|
107
|
-
response?: string;
|
|
107
|
+
response?: string | undefined;
|
|
108
108
|
/** the numeric response code of the response string (if available) */
|
|
109
|
-
responseCode?: number;
|
|
109
|
+
responseCode?: number | undefined;
|
|
110
110
|
/** command which provoked an error */
|
|
111
|
-
command?: string;
|
|
111
|
+
command?: string | undefined;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
interface SentMessageInfo {
|
|
@@ -117,7 +117,7 @@ declare namespace SMTPConnection {
|
|
|
117
117
|
/** an array of rejected recipient addresses. This array includes both the addresses that were rejected before sending the message and addresses rejected after sending it if using LMTP */
|
|
118
118
|
rejected: string[];
|
|
119
119
|
/** if some recipients were rejected then this property holds an array of error objects for the rejected recipients */
|
|
120
|
-
rejectedErrors?: SMTPError[];
|
|
120
|
+
rejectedErrors?: SMTPError[] | undefined;
|
|
121
121
|
/** the last response received from the server */
|
|
122
122
|
response: string;
|
|
123
123
|
/** how long was envelope prepared */
|
|
@@ -130,44 +130,44 @@ declare namespace SMTPConnection {
|
|
|
130
130
|
|
|
131
131
|
interface Options {
|
|
132
132
|
/** the hostname or IP address to connect to (defaults to ‘localhost’) */
|
|
133
|
-
host?: string;
|
|
133
|
+
host?: string | undefined;
|
|
134
134
|
/** the port to connect to (defaults to 25 or 465) */
|
|
135
|
-
port?: number;
|
|
135
|
+
port?: number | undefined;
|
|
136
136
|
/** defines authentication data */
|
|
137
|
-
auth?: AuthenticationType;
|
|
137
|
+
auth?: AuthenticationType | undefined;
|
|
138
138
|
/** defines if the connection should use SSL (if true) or not (if false) */
|
|
139
|
-
secure?: boolean;
|
|
139
|
+
secure?: boolean | undefined;
|
|
140
140
|
/** turns off STARTTLS support if true */
|
|
141
|
-
ignoreTLS?: boolean;
|
|
141
|
+
ignoreTLS?: boolean | undefined;
|
|
142
142
|
/** forces the client to use STARTTLS. Returns an error if upgrading the connection is not possible or fails. */
|
|
143
|
-
requireTLS?: boolean;
|
|
143
|
+
requireTLS?: boolean | undefined;
|
|
144
144
|
/** tries to use STARTTLS and continues normally if it fails */
|
|
145
|
-
opportunisticTLS?: boolean;
|
|
145
|
+
opportunisticTLS?: boolean | undefined;
|
|
146
146
|
/** optional hostname of the client, used for identifying to the server */
|
|
147
|
-
name?: string;
|
|
147
|
+
name?: string | undefined;
|
|
148
148
|
/** the local interface to bind to for network connections */
|
|
149
|
-
localAddress?: string;
|
|
149
|
+
localAddress?: string | undefined;
|
|
150
150
|
/** how many milliseconds to wait for the connection to establish */
|
|
151
|
-
connectionTimeout?: ms;
|
|
151
|
+
connectionTimeout?: ms | undefined;
|
|
152
152
|
/** how many milliseconds to wait for the greeting after connection is established */
|
|
153
|
-
greetingTimeout?: ms;
|
|
153
|
+
greetingTimeout?: ms | undefined;
|
|
154
154
|
/** how many milliseconds of inactivity to allow */
|
|
155
|
-
socketTimeout?: ms;
|
|
155
|
+
socketTimeout?: ms | undefined;
|
|
156
156
|
/** optional bunyan compatible logger instance. If set to true then logs to console. If value is not set or is false then nothing is logged */
|
|
157
|
-
logger?: shared.Logger | boolean;
|
|
157
|
+
logger?: shared.Logger | boolean | undefined;
|
|
158
158
|
/** if set to true, then logs SMTP traffic without message content */
|
|
159
|
-
transactionLog?: boolean;
|
|
159
|
+
transactionLog?: boolean | undefined;
|
|
160
160
|
/** if set to true, then logs SMTP traffic and message content, otherwise logs only transaction events */
|
|
161
|
-
debug?: boolean;
|
|
161
|
+
debug?: boolean | undefined;
|
|
162
162
|
/** defines preferred authentication method, e.g. ‘PLAIN’ */
|
|
163
|
-
authMethod?: string;
|
|
163
|
+
authMethod?: string | undefined;
|
|
164
164
|
/** defines additional options to be passed to the socket constructor, e.g. {rejectUnauthorized: true} */
|
|
165
|
-
tls?: tls.ConnectionOptions;
|
|
165
|
+
tls?: tls.ConnectionOptions | undefined;
|
|
166
166
|
/** initialized socket to use instead of creating a new one */
|
|
167
|
-
socket?: net.Socket;
|
|
167
|
+
socket?: net.Socket | undefined;
|
|
168
168
|
/** connected socket to use instead of creating and connecting a new one. If secure option is true, then socket is upgraded from plaintext to ciphertext */
|
|
169
|
-
connection?: net.Socket;
|
|
170
|
-
customAuth?: CustomAuthenticationHandlers;
|
|
169
|
+
connection?: net.Socket | undefined;
|
|
170
|
+
customAuth?: CustomAuthenticationHandlers | undefined;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -12,24 +12,24 @@ import SMTPConnection = require('../smtp-connection');
|
|
|
12
12
|
|
|
13
13
|
declare namespace SMTPPool {
|
|
14
14
|
interface MailOptions extends Mail.Options {
|
|
15
|
-
auth?: SMTPConnection.AuthenticationType;
|
|
16
|
-
dsn?: SMTPConnection.DSNOptions;
|
|
15
|
+
auth?: SMTPConnection.AuthenticationType | undefined;
|
|
16
|
+
dsn?: SMTPConnection.DSNOptions | undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface Options extends MailOptions, TransportOptions, SMTPConnection.Options {
|
|
20
20
|
/** set to true to use pooled connections (defaults to false) instead of creating a new connection for every email */
|
|
21
21
|
pool: true;
|
|
22
|
-
service?: string;
|
|
22
|
+
service?: string | undefined;
|
|
23
23
|
getSocket?(options: Options, callback: (err: Error | null, socketOptions: any) => void): void; // TODO http.ClientRequest?
|
|
24
|
-
url?: string;
|
|
24
|
+
url?: string | undefined;
|
|
25
25
|
/** the count of maximum simultaneous connections to make against the SMTP server (defaults to 5) */
|
|
26
|
-
maxConnections?: number;
|
|
26
|
+
maxConnections?: number | undefined;
|
|
27
27
|
/** limits the message count to be sent using a single connection (defaults to 100). After maxMessages is reached the connection is dropped and a new one is created for the following messages */
|
|
28
|
-
maxMessages?: number;
|
|
28
|
+
maxMessages?: number | undefined;
|
|
29
29
|
/** defines the time measuring period in milliseconds (defaults to 1000, ie. to 1 second) for rate limiting */
|
|
30
|
-
rateDelta?: number;
|
|
30
|
+
rateDelta?: number | undefined;
|
|
31
31
|
/** limits the message count to be sent in rateDelta time. Once rateLimit is reached, sending is paused until the end of the measuring period. This limit is shared between connections, so if one connection uses up the limit, then other connections are paused as well. If rateLimit is not set then sending rate is not limited */
|
|
32
|
-
rateLimit?: number;
|
|
32
|
+
rateLimit?: number | undefined;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
interface SentMessageInfo extends SMTPConnection.SentMessageInfo {
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
import * as stream from 'stream';
|
|
5
5
|
|
|
6
|
-
import { Transport, TransportOptions } from '
|
|
7
|
-
import * as shared from '
|
|
6
|
+
import { Transport, TransportOptions } from '../..';
|
|
7
|
+
import * as shared from '../shared';
|
|
8
8
|
|
|
9
|
-
import Mail = require('
|
|
10
|
-
import MailMessage = require('
|
|
11
|
-
import MimeNode = require('
|
|
12
|
-
import SMTPConnection = require('
|
|
13
|
-
import XOAuth2 = require('
|
|
9
|
+
import Mail = require('../mailer');
|
|
10
|
+
import MailMessage = require('../mailer/mail-message');
|
|
11
|
+
import MimeNode = require('../mime-node');
|
|
12
|
+
import SMTPConnection = require('../smtp-connection');
|
|
13
|
+
import XOAuth2 = require('../xoauth2');
|
|
14
14
|
|
|
15
15
|
declare namespace SMTPTransport {
|
|
16
16
|
interface AuthenticationTypeCustom extends SMTPConnection.Credentials {
|
|
@@ -35,14 +35,14 @@ declare namespace SMTPTransport {
|
|
|
35
35
|
type AuthenticationType = AuthenticationTypeLogin | AuthenticationTypeOAuth2;
|
|
36
36
|
|
|
37
37
|
interface MailOptions extends Mail.Options {
|
|
38
|
-
auth?: SMTPConnection.AuthenticationType;
|
|
39
|
-
dsn?: SMTPConnection.DSNOptions;
|
|
38
|
+
auth?: SMTPConnection.AuthenticationType | undefined;
|
|
39
|
+
dsn?: SMTPConnection.DSNOptions | undefined;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
interface Options extends MailOptions, TransportOptions, SMTPConnection.Options {
|
|
43
|
-
service?: string;
|
|
43
|
+
service?: string | undefined;
|
|
44
44
|
getSocket?(options: Options, callback: (err: Error | null, socketOptions: any) => void): void; // TODO http.ClientRequest?
|
|
45
|
-
url?: string;
|
|
45
|
+
url?: string | undefined;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
interface SentMessageInfo {
|
|
@@ -50,6 +50,10 @@ declare namespace SMTPTransport {
|
|
|
50
50
|
envelope: MimeNode.Envelope;
|
|
51
51
|
/** most transports should return the final Message-Id value used with this property */
|
|
52
52
|
messageId: string;
|
|
53
|
+
accepted: Array<string | Mail.Address>;
|
|
54
|
+
rejected: Array<string | Mail.Address>;
|
|
55
|
+
pending: Array<string | Mail.Address>;
|
|
56
|
+
response: string;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
|
|
@@ -69,10 +73,15 @@ declare class SMTPTransport extends EventEmitter implements Transport<SMTPTransp
|
|
|
69
73
|
/** Placeholder function for creating proxy sockets. This method immediatelly returns without a socket */
|
|
70
74
|
getSocket(options: SMTPTransport.Options, callback: (err: Error | null, socketOptions: object) => void): void;
|
|
71
75
|
|
|
72
|
-
getAuth(
|
|
76
|
+
getAuth(
|
|
77
|
+
authOpts: SMTPConnection.AuthenticationTypeLogin | SMTPConnection.AuthenticationTypeOAuth2,
|
|
78
|
+
): SMTPTransport.AuthenticationType;
|
|
73
79
|
|
|
74
80
|
/** Sends an e-mail using the selected settings */
|
|
75
|
-
send(
|
|
81
|
+
send(
|
|
82
|
+
mail: MailMessage<SMTPTransport.SentMessageInfo>,
|
|
83
|
+
callback: (err: Error | null, info: SMTPTransport.SentMessageInfo) => void,
|
|
84
|
+
): void;
|
|
76
85
|
|
|
77
86
|
/** Verifies SMTP configuration */
|
|
78
87
|
verify(callback: (err: Error | null, success: true) => void): void;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
import { Readable } from 'stream';
|
|
5
5
|
|
|
6
|
-
import { Transport, TransportOptions } from '
|
|
6
|
+
import { Transport, TransportOptions } from '../..';
|
|
7
7
|
|
|
8
|
-
import * as shared from '
|
|
8
|
+
import * as shared from '../shared';
|
|
9
9
|
|
|
10
|
-
import Mail = require('
|
|
11
|
-
import MailMessage = require('
|
|
12
|
-
import MimeNode = require('
|
|
10
|
+
import Mail = require('../mailer');
|
|
11
|
+
import MailMessage = require('../mailer/mail-message');
|
|
12
|
+
import MimeNode = require('../mime-node');
|
|
13
13
|
|
|
14
14
|
declare namespace StreamTransport {
|
|
15
15
|
type MailOptions = Mail.Options;
|
|
@@ -17,9 +17,9 @@ declare namespace StreamTransport {
|
|
|
17
17
|
interface Options extends MailOptions, TransportOptions {
|
|
18
18
|
streamTransport: true;
|
|
19
19
|
/** if true, then returns the message as a Buffer object instead of a stream */
|
|
20
|
-
buffer?: boolean;
|
|
20
|
+
buffer?: boolean | undefined;
|
|
21
21
|
/** either ‘windows’ or ‘unix’ (default). Forces all newlines in the output to either use Windows syntax <CR><LF> or Unix syntax <LF> */
|
|
22
|
-
newline?: string;
|
|
22
|
+
newline?: string | undefined;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
interface SentMessageInfo {
|
|
@@ -29,6 +29,10 @@ declare namespace StreamTransport {
|
|
|
29
29
|
messageId: string;
|
|
30
30
|
/** either stream (default) of buffer depending on the options */
|
|
31
31
|
message: Buffer | Readable;
|
|
32
|
+
accepted: Array<string | Mail.Address>;
|
|
33
|
+
rejected: Array<string | Mail.Address>;
|
|
34
|
+
pending: Array<string | Mail.Address>;
|
|
35
|
+
response: string;
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import SMTPConnection = require('
|
|
1
|
+
import SMTPConnection = require('../smtp-connection');
|
|
2
2
|
|
|
3
3
|
/** Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or an email address (like 'test@googlemail.com'). */
|
|
4
4
|
declare function wellKnown(key: string): SMTPConnection.Options | false;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as http from 'http';
|
|
4
4
|
import { Readable, Stream } from 'stream';
|
|
5
5
|
|
|
6
|
-
import * as shared from '
|
|
6
|
+
import * as shared from '../shared';
|
|
7
7
|
|
|
8
8
|
type ms = number;
|
|
9
9
|
type s = number;
|
|
@@ -11,26 +11,26 @@ type s = number;
|
|
|
11
11
|
declare namespace XOAuth2 {
|
|
12
12
|
interface Options {
|
|
13
13
|
/** User e-mail address */
|
|
14
|
-
user?: string;
|
|
14
|
+
user?: string | undefined;
|
|
15
15
|
/** Client ID value */
|
|
16
|
-
clientId?: string;
|
|
16
|
+
clientId?: string | undefined;
|
|
17
17
|
/** Client secret value */
|
|
18
|
-
clientSecret?: string;
|
|
18
|
+
clientSecret?: string | undefined;
|
|
19
19
|
/** Refresh token for an user */
|
|
20
|
-
refreshToken?: string;
|
|
20
|
+
refreshToken?: string | undefined;
|
|
21
21
|
/** Endpoint for token generation, defaults to 'https://accounts.google.com/o/oauth2/token' */
|
|
22
|
-
accessUrl?: string;
|
|
22
|
+
accessUrl?: string | undefined;
|
|
23
23
|
/** An existing valid accessToken */
|
|
24
|
-
accessToken?: string;
|
|
24
|
+
accessToken?: string | undefined;
|
|
25
25
|
/** Private key for JSW */
|
|
26
|
-
privateKey?: string | { key: string; passphrase: string; };
|
|
26
|
+
privateKey?: string | { key: string; passphrase: string; } | undefined;
|
|
27
27
|
/** Optional Access Token expire time in ms */
|
|
28
|
-
expires?: ms;
|
|
28
|
+
expires?: ms | undefined;
|
|
29
29
|
/** Optional TTL for Access Token in seconds */
|
|
30
|
-
timeout?: s;
|
|
30
|
+
timeout?: s | undefined;
|
|
31
31
|
/** Function to run when a new access token is required */
|
|
32
32
|
provisionCallback?(user: string, renew: boolean, callback: (err: Error | null, accessToken: string, expires: number) => void): void;
|
|
33
|
-
serviceClient?: string;
|
|
33
|
+
serviceClient?: string | undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface Token {
|
|
@@ -40,7 +40,7 @@ declare namespace XOAuth2 {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
interface RequestParams {
|
|
43
|
-
customHeaders?: http.OutgoingHttpHeaders;
|
|
43
|
+
customHeaders?: http.OutgoingHttpHeaders | undefined;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
nodemailer/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/nodemailer",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.5",
|
|
4
4
|
"description": "TypeScript definitions for Nodemailer",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"contributors": [
|
|
7
8
|
{
|
|
@@ -31,6 +32,6 @@
|
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@types/node": "*"
|
|
33
34
|
},
|
|
34
|
-
"typesPublisherContentHash": "
|
|
35
|
-
"typeScriptVersion": "
|
|
35
|
+
"typesPublisherContentHash": "bc82ddff0202008408f4563e28ee614c01a323d55d6ea96181d36a5a74a5a6d6",
|
|
36
|
+
"typeScriptVersion": "4.0"
|
|
36
37
|
}
|