@types/nodemailer 6.4.10 → 6.4.12
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/LICENSE +0 -0
- nodemailer/README.md +2 -3
- nodemailer/index.d.ts +16 -18
- nodemailer/lib/dkim/index.d.ts +1 -1
- nodemailer/lib/dkim/message-parser.d.ts +43 -43
- nodemailer/lib/dkim/relaxed-body.d.ts +43 -43
- nodemailer/lib/dkim/sign.d.ts +14 -4
- nodemailer/lib/json-transport/index.d.ts +10 -7
- nodemailer/lib/mailer/index.d.ts +82 -42
- nodemailer/lib/mailer/mail-message.d.ts +8 -4
- nodemailer/lib/mime-node/index.d.ts +7 -7
- nodemailer/lib/mime-node/last-newline.d.ts +1 -1
- nodemailer/lib/sendmail-transport/index.d.ts +5 -5
- nodemailer/lib/ses-transport/index.d.ts +37 -27
- nodemailer/lib/shared/index.d.ts +24 -17
- nodemailer/lib/smtp-connection/data-stream.d.ts +1 -1
- nodemailer/lib/smtp-connection/http-proxy-client.d.ts +8 -3
- nodemailer/lib/smtp-connection/index.d.ts +47 -37
- nodemailer/lib/smtp-pool/index.d.ts +18 -15
- nodemailer/lib/smtp-pool/pool-resource.d.ts +25 -25
- nodemailer/lib/smtp-transport/index.d.ts +27 -27
- nodemailer/lib/stream-transport/index.d.ts +11 -8
- nodemailer/lib/xoauth2/index.d.ts +24 -20
- nodemailer/package.json +10 -10
- nodemailer/lib/addressparser/index.d.ts +0 -31
- nodemailer/lib/base64/index.d.ts +0 -22
- nodemailer/lib/fetch/cookies.d.ts +0 -54
- nodemailer/lib/fetch/index.d.ts +0 -38
- nodemailer/lib/mail-composer/index.d.ts +0 -25
- nodemailer/lib/mime-funcs/index.d.ts +0 -87
- nodemailer/lib/mime-funcs/mime-types.d.ts +0 -2
- nodemailer/lib/qp/index.d.ts +0 -23
- nodemailer/lib/sendmail-transport/le-unix.d.ts +0 -7
- nodemailer/lib/sendmail-transport/le-windows.d.ts +0 -7
- nodemailer/lib/well-known/index.d.ts +0 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { Transport, TransportOptions } from
|
|
3
|
+
import { Transport, TransportOptions } from "../..";
|
|
4
4
|
|
|
5
|
-
import * as shared from
|
|
5
|
+
import * as shared from "../shared";
|
|
6
6
|
|
|
7
|
-
import Mail = require(
|
|
8
|
-
import MailMessage = require(
|
|
9
|
-
import MimeNode = require(
|
|
7
|
+
import Mail = require("../mailer");
|
|
8
|
+
import MailMessage = require("../mailer/mail-message");
|
|
9
|
+
import MimeNode = require("../mime-node");
|
|
10
10
|
|
|
11
11
|
declare namespace SendmailTransport {
|
|
12
12
|
type MailOptions = Mail.Options;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { EventEmitter } from
|
|
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 {
|
|
@@ -32,7 +32,7 @@ declare namespace SESTransport {
|
|
|
32
32
|
/**
|
|
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
|
-
Data: Buffer|Uint8Array|{}|string;
|
|
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.
|
|
@@ -49,16 +49,18 @@ declare namespace SESTransport {
|
|
|
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
|
*/
|
|
52
|
-
Tags?:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
Tags?:
|
|
53
|
+
| Array<{
|
|
54
|
+
/**
|
|
55
|
+
* The name of the tag. The name must: This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). Contain less than 256 characters.
|
|
56
|
+
*/
|
|
57
|
+
Name: string;
|
|
58
|
+
/**
|
|
59
|
+
* 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.
|
|
60
|
+
*/
|
|
61
|
+
Value: string;
|
|
62
|
+
}>
|
|
63
|
+
| undefined;
|
|
62
64
|
/**
|
|
63
65
|
* The name of the configuration set to use when you send an email using SendRawEmail.
|
|
64
66
|
*/
|
|
@@ -103,14 +105,22 @@ declare class SESTransport extends EventEmitter implements Transport<SESTranspor
|
|
|
103
105
|
sendingRate: number;
|
|
104
106
|
sendingRateTTL: number | null;
|
|
105
107
|
rateInterval: number;
|
|
106
|
-
rateMessages: Array<{ ts: number
|
|
107
|
-
pending: Array<
|
|
108
|
+
rateMessages: Array<{ ts: number; pending: boolean }>;
|
|
109
|
+
pending: Array<
|
|
110
|
+
{
|
|
111
|
+
mail: Mail<SESTransport.SentMessageInfo>;
|
|
112
|
+
callback(err: Error | null, info: SESTransport.SentMessageInfo): void;
|
|
113
|
+
}
|
|
114
|
+
>;
|
|
108
115
|
idling: boolean;
|
|
109
116
|
|
|
110
117
|
constructor(options: SESTransport.Options);
|
|
111
118
|
|
|
112
119
|
/** Schedules a sending of a message */
|
|
113
|
-
send(
|
|
120
|
+
send(
|
|
121
|
+
mail: MailMessage<SESTransport.SentMessageInfo>,
|
|
122
|
+
callback: (err: Error | null, info: SESTransport.SentMessageInfo) => void,
|
|
123
|
+
): void;
|
|
114
124
|
|
|
115
125
|
/** Returns true if there are free slots in the queue */
|
|
116
126
|
isIdle(): boolean;
|
|
@@ -119,19 +129,19 @@ declare class SESTransport extends EventEmitter implements Transport<SESTranspor
|
|
|
119
129
|
verify(callback: (err: Error | null, success: true) => void): void;
|
|
120
130
|
verify(): Promise<true>;
|
|
121
131
|
|
|
122
|
-
addListener(event:
|
|
132
|
+
addListener(event: "idle", listener: () => void): this;
|
|
123
133
|
|
|
124
|
-
emit(event:
|
|
134
|
+
emit(event: "idle"): boolean;
|
|
125
135
|
|
|
126
|
-
on(event:
|
|
136
|
+
on(event: "idle", listener: () => void): this;
|
|
127
137
|
|
|
128
|
-
once(event:
|
|
138
|
+
once(event: "idle", listener: () => void): this;
|
|
129
139
|
|
|
130
|
-
prependListener(event:
|
|
140
|
+
prependListener(event: "idle", listener: () => void): this;
|
|
131
141
|
|
|
132
|
-
prependOnceListener(event:
|
|
142
|
+
prependOnceListener(event: "idle", listener: () => void): this;
|
|
133
143
|
|
|
134
|
-
listeners(event:
|
|
144
|
+
listeners(event: "idle"): Array<() => void>;
|
|
135
145
|
}
|
|
136
146
|
|
|
137
147
|
export = SESTransport;
|
nodemailer/lib/shared/index.d.ts
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import SMTPConnection = require(
|
|
3
|
+
import SMTPConnection = require("../smtp-connection");
|
|
4
4
|
|
|
5
|
-
import * as stream from
|
|
5
|
+
import * as stream from "stream";
|
|
6
6
|
|
|
7
|
-
export type LoggerLevel =
|
|
7
|
+
export type LoggerLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal";
|
|
8
8
|
|
|
9
9
|
export interface Logger {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
level(level: LoggerLevel): void;
|
|
11
|
+
trace(...params: any[]): void;
|
|
12
|
+
debug(...params: any[]): void;
|
|
13
|
+
info(...params: any[]): void;
|
|
14
|
+
warn(...params: any[]): void;
|
|
15
|
+
error(...params: any[]): void;
|
|
16
|
+
fatal(...params: any[]): void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface ResolveHostnameOptions {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
host?: string | undefined;
|
|
21
|
+
servername?: string | false | undefined;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface ResolveHostnameValue {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
host: string;
|
|
26
|
+
servername: string | false;
|
|
27
|
+
_cached?: true | undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export function resolveHostname(
|
|
30
|
+
export function resolveHostname(
|
|
31
|
+
options: ResolveHostnameOptions | null | undefined,
|
|
32
|
+
callback: (err: Error | null, value: ResolveHostnameValue) => void,
|
|
33
|
+
): void;
|
|
31
34
|
|
|
32
35
|
/** Parses connection url to a structured configuration object */
|
|
33
36
|
export function parseConnectionUrl(url: string): SMTPConnection.Options;
|
|
@@ -44,7 +47,11 @@ export function callbackPromise(resolve: (...args: any[]) => void, reject: (err:
|
|
|
44
47
|
* for example the `html` or `text` value as a String or a Buffer but not as
|
|
45
48
|
* a file path or an URL.
|
|
46
49
|
*/
|
|
47
|
-
export function resolveContent(
|
|
50
|
+
export function resolveContent(
|
|
51
|
+
data: object | any[],
|
|
52
|
+
key: string | number,
|
|
53
|
+
callback: (err: Error | null, value: Buffer | string) => void,
|
|
54
|
+
): void;
|
|
48
55
|
export function resolveContent(data: object | any[], key: string | number): Promise<Buffer | string>;
|
|
49
56
|
/** Copies properties from source objects to target objects */
|
|
50
57
|
export function assign(target: object, ...sources: object[]): object;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { Socket } from
|
|
4
|
-
import { TLSSocket } from
|
|
3
|
+
import { Socket } from "net";
|
|
4
|
+
import { TLSSocket } from "tls";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Establishes proxied connection to destinationPort
|
|
8
8
|
*/
|
|
9
|
-
declare function httpProxyClient(
|
|
9
|
+
declare function httpProxyClient(
|
|
10
|
+
proxyUrl: string,
|
|
11
|
+
destinationPort: number,
|
|
12
|
+
destinationHost: string,
|
|
13
|
+
callback: (err: Error | null, socket: TLSSocket | Socket) => void,
|
|
14
|
+
): void;
|
|
10
15
|
|
|
11
16
|
export = httpProxyClient;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { EventEmitter } from
|
|
4
|
-
import * as net from
|
|
5
|
-
import { Readable } from
|
|
6
|
-
import * as tls from
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
|
+
import * as net from "net";
|
|
5
|
+
import { Readable } from "stream";
|
|
6
|
+
import * as tls from "tls";
|
|
7
7
|
|
|
8
|
-
import * as shared from
|
|
8
|
+
import * as shared from "../shared";
|
|
9
9
|
|
|
10
|
-
import MimeNode = require(
|
|
11
|
-
import XOAuth2 = require(
|
|
10
|
+
import MimeNode = require("../mime-node");
|
|
11
|
+
import XOAuth2 = require("../xoauth2");
|
|
12
12
|
|
|
13
13
|
type ms = number;
|
|
14
14
|
|
|
@@ -24,18 +24,18 @@ declare namespace SMTPConnection {
|
|
|
24
24
|
|
|
25
25
|
interface AuthenticationTypeCustom extends Credentials {
|
|
26
26
|
/** indicates the authetication type, defaults to ‘login’, other option is ‘oauth2’ or ‘custom’ */
|
|
27
|
-
type:
|
|
27
|
+
type: "custom" | "Custom" | "CUSTOM";
|
|
28
28
|
method: string;
|
|
29
29
|
}
|
|
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?:
|
|
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?:
|
|
38
|
+
type?: "oauth2" | "OAuth2" | "OAUTH2" | undefined;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
type AuthenticationType = AuthenticationTypeCustom | AuthenticationTypeLogin | AuthenticationTypeOAuth2;
|
|
@@ -74,11 +74,11 @@ declare namespace SMTPConnection {
|
|
|
74
74
|
[method: string]: (ctx: CustomAuthenticationContext) => Promise<boolean> | unknown;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
type DSNOption =
|
|
77
|
+
type DSNOption = "NEVER" | "SUCCESS" | "FAILURE" | "DELAY";
|
|
78
78
|
|
|
79
79
|
interface DSNOptions {
|
|
80
80
|
/** return either the full message ‘FULL’ or only headers ‘HDRS’ */
|
|
81
|
-
ret?:
|
|
81
|
+
ret?: "Full" | "HDRS" | undefined;
|
|
82
82
|
/** sender’s ‘envelope identifier’ for tracking */
|
|
83
83
|
envid?: string | undefined;
|
|
84
84
|
/** when to send a DSN. Multiple options are OK - array or comma delimited. NEVER must appear by itself. */
|
|
@@ -181,7 +181,7 @@ declare class SMTPConnection extends EventEmitter {
|
|
|
181
181
|
logger: shared.Logger;
|
|
182
182
|
|
|
183
183
|
id: string;
|
|
184
|
-
stage:
|
|
184
|
+
stage: "init" | "connected";
|
|
185
185
|
|
|
186
186
|
secureConnection: boolean;
|
|
187
187
|
alreadySecured: boolean;
|
|
@@ -214,45 +214,55 @@ declare class SMTPConnection extends EventEmitter {
|
|
|
214
214
|
/** Closes the connection to the server */
|
|
215
215
|
close(): void;
|
|
216
216
|
/** Authenticate user */
|
|
217
|
-
login(
|
|
217
|
+
login(
|
|
218
|
+
auth:
|
|
219
|
+
| SMTPConnection.AuthenticationCredentials
|
|
220
|
+
| SMTPConnection.AuthenticationOAuth2
|
|
221
|
+
| SMTPConnection.Credentials,
|
|
222
|
+
callback: (err?: SMTPConnection.SMTPError) => void,
|
|
223
|
+
): void;
|
|
218
224
|
/** Sends a message */
|
|
219
|
-
send(
|
|
225
|
+
send(
|
|
226
|
+
envelope: SMTPConnection.Envelope,
|
|
227
|
+
message: string | Buffer | Readable,
|
|
228
|
+
callback: (err: SMTPConnection.SMTPError | null, info: SMTPConnection.SentMessageInfo) => void,
|
|
229
|
+
): void;
|
|
220
230
|
/** Resets connection state */
|
|
221
231
|
reset(callback: (err?: SMTPConnection.SMTPError) => void): void;
|
|
222
232
|
|
|
223
|
-
addListener(event:
|
|
224
|
-
addListener(event:
|
|
233
|
+
addListener(event: "connect" | "end", listener: () => void): this;
|
|
234
|
+
addListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
225
235
|
|
|
226
|
-
emit(event:
|
|
227
|
-
emit(event:
|
|
236
|
+
emit(event: "connect" | "end"): boolean;
|
|
237
|
+
emit(event: "error", error: Error): boolean;
|
|
228
238
|
|
|
229
|
-
listenerCount(event:
|
|
239
|
+
listenerCount(event: "connect" | "end" | "error"): number;
|
|
230
240
|
|
|
231
|
-
listeners(event:
|
|
232
|
-
listeners(event:
|
|
241
|
+
listeners(event: "connect" | "end"): Array<() => void>;
|
|
242
|
+
listeners(event: "error"): Array<(err: SMTPConnection.SMTPError) => void>;
|
|
233
243
|
|
|
234
|
-
off(event:
|
|
235
|
-
off(event:
|
|
244
|
+
off(event: "connect" | "end", listener: () => void): this;
|
|
245
|
+
off(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
236
246
|
|
|
237
|
-
on(event:
|
|
238
|
-
on(event:
|
|
247
|
+
on(event: "connect" | "end", listener: () => void): this;
|
|
248
|
+
on(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
239
249
|
|
|
240
|
-
once(event:
|
|
241
|
-
once(event:
|
|
250
|
+
once(event: "connect" | "end", listener: () => void): this;
|
|
251
|
+
once(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
242
252
|
|
|
243
|
-
prependListener(event:
|
|
244
|
-
prependListener(event:
|
|
253
|
+
prependListener(event: "connect" | "end", listener: () => void): this;
|
|
254
|
+
prependListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
245
255
|
|
|
246
|
-
prependOnceListener(event:
|
|
247
|
-
prependOnceListener(event:
|
|
256
|
+
prependOnceListener(event: "connect" | "end", listener: () => void): this;
|
|
257
|
+
prependOnceListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
248
258
|
|
|
249
|
-
rawListeners(event:
|
|
250
|
-
rawListeners(event:
|
|
259
|
+
rawListeners(event: "connect" | "end"): Array<() => void>;
|
|
260
|
+
rawListeners(event: "error"): Array<(err: SMTPConnection.SMTPError) => void>;
|
|
251
261
|
|
|
252
|
-
removeAllListener(event:
|
|
262
|
+
removeAllListener(event: "connect" | "end" | "error"): this;
|
|
253
263
|
|
|
254
|
-
removeListener(event:
|
|
255
|
-
removeListener(event:
|
|
264
|
+
removeListener(event: "connect" | "end", listener: () => void): this;
|
|
265
|
+
removeListener(event: "error", listener: (err: SMTPConnection.SMTPError) => void): this;
|
|
256
266
|
}
|
|
257
267
|
|
|
258
268
|
export = SMTPConnection;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { EventEmitter } from
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
4
|
|
|
5
|
-
import { Transport, TransportOptions } from
|
|
6
|
-
import * as shared from
|
|
5
|
+
import { Transport, TransportOptions } from "../..";
|
|
6
|
+
import * as shared from "../shared";
|
|
7
7
|
|
|
8
|
-
import Mail = require(
|
|
9
|
-
import MailMessage = require(
|
|
10
|
-
import MimeNode = require(
|
|
11
|
-
import SMTPConnection = require(
|
|
8
|
+
import Mail = require("../mailer");
|
|
9
|
+
import MailMessage = require("../mailer/mail-message");
|
|
10
|
+
import MimeNode = require("../mime-node");
|
|
11
|
+
import SMTPConnection = require("../smtp-connection");
|
|
12
12
|
|
|
13
13
|
declare namespace SMTPPool {
|
|
14
14
|
interface MailOptions extends Mail.Options {
|
|
@@ -60,7 +60,10 @@ declare class SMTPPool extends EventEmitter implements Transport<SMTPPool.SentMe
|
|
|
60
60
|
getSocket(options: SMTPPool.Options, callback: (err: Error | null, socketOptions: any) => void): void;
|
|
61
61
|
|
|
62
62
|
/** Sends an e-mail using the selected settings */
|
|
63
|
-
send(
|
|
63
|
+
send(
|
|
64
|
+
mail: MailMessage<SMTPPool.SentMessageInfo>,
|
|
65
|
+
callback: (err: Error | null, info: SMTPPool.SentMessageInfo) => void,
|
|
66
|
+
): void;
|
|
64
67
|
|
|
65
68
|
/** Closes all connections in the pool. If there is a message being sent, the connection is closed later */
|
|
66
69
|
close(): void;
|
|
@@ -72,19 +75,19 @@ declare class SMTPPool extends EventEmitter implements Transport<SMTPPool.SentMe
|
|
|
72
75
|
verify(callback: (err: Error | null, success: true) => void): void;
|
|
73
76
|
verify(): Promise<true>;
|
|
74
77
|
|
|
75
|
-
addListener(event:
|
|
78
|
+
addListener(event: "idle", listener: () => void): this;
|
|
76
79
|
|
|
77
|
-
emit(event:
|
|
80
|
+
emit(event: "idle"): boolean;
|
|
78
81
|
|
|
79
|
-
on(event:
|
|
82
|
+
on(event: "idle", listener: () => void): this;
|
|
80
83
|
|
|
81
|
-
once(event:
|
|
84
|
+
once(event: "idle", listener: () => void): this;
|
|
82
85
|
|
|
83
|
-
prependListener(event:
|
|
86
|
+
prependListener(event: "idle", listener: () => void): this;
|
|
84
87
|
|
|
85
|
-
prependOnceListener(event:
|
|
88
|
+
prependOnceListener(event: "idle", listener: () => void): this;
|
|
86
89
|
|
|
87
|
-
listeners(event:
|
|
90
|
+
listeners(event: "idle"): Array<() => void>;
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
export = SMTPPool;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { EventEmitter } from
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
4
|
|
|
5
|
-
import MailMessage = require(
|
|
6
|
-
import * as shared from
|
|
5
|
+
import MailMessage = require("../mailer/mail-message");
|
|
6
|
+
import * as shared from "../shared";
|
|
7
7
|
|
|
8
|
-
import SMTPPool = require(
|
|
8
|
+
import SMTPPool = require(".");
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Creates an element for the pool
|
|
@@ -27,39 +27,39 @@ declare class PoolResource extends EventEmitter {
|
|
|
27
27
|
/** Closes the connection */
|
|
28
28
|
close(): void;
|
|
29
29
|
|
|
30
|
-
addListener(event:
|
|
31
|
-
addListener(event:
|
|
32
|
-
addListener(event:
|
|
30
|
+
addListener(event: "available", listener: () => void): this;
|
|
31
|
+
addListener(event: "close", listener: () => void): this;
|
|
32
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
33
33
|
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
34
34
|
|
|
35
|
-
emit(event:
|
|
36
|
-
emit(event:
|
|
37
|
-
emit(event:
|
|
35
|
+
emit(event: "available"): boolean;
|
|
36
|
+
emit(event: "close"): boolean;
|
|
37
|
+
emit(event: "error", err: Error): boolean;
|
|
38
38
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
39
39
|
|
|
40
|
-
on(event:
|
|
41
|
-
on(event:
|
|
42
|
-
on(event:
|
|
40
|
+
on(event: "available", listener: () => void): this;
|
|
41
|
+
on(event: "close", listener: () => void): this;
|
|
42
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
43
43
|
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
44
44
|
|
|
45
|
-
once(event:
|
|
46
|
-
once(event:
|
|
47
|
-
once(event:
|
|
45
|
+
once(event: "available", listener: () => void): this;
|
|
46
|
+
once(event: "close", listener: () => void): this;
|
|
47
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
48
48
|
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
49
49
|
|
|
50
|
-
prependListener(event:
|
|
51
|
-
prependListener(event:
|
|
52
|
-
prependListener(event:
|
|
50
|
+
prependListener(event: "available", listener: () => void): this;
|
|
51
|
+
prependListener(event: "close", listener: () => void): this;
|
|
52
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
53
53
|
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
54
54
|
|
|
55
|
-
prependOnceListener(event:
|
|
56
|
-
prependOnceListener(event:
|
|
57
|
-
prependOnceListener(event:
|
|
55
|
+
prependOnceListener(event: "available", listener: () => void): this;
|
|
56
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
57
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
58
58
|
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
59
59
|
|
|
60
|
-
removeListener(event:
|
|
61
|
-
removeListener(event:
|
|
62
|
-
removeListener(event:
|
|
60
|
+
removeListener(event: "available", listener: () => void): this;
|
|
61
|
+
removeListener(event: "close", listener: () => void): this;
|
|
62
|
+
removeListener(event: "error", listener: (err: Error) => void): this;
|
|
63
63
|
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
-
import { EventEmitter } from
|
|
4
|
-
import * as stream from
|
|
3
|
+
import { EventEmitter } from "events";
|
|
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 {
|
|
17
|
-
type:
|
|
17
|
+
type: "CUSTOM";
|
|
18
18
|
method: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
interface AuthenticationTypeLogin {
|
|
22
|
-
type:
|
|
22
|
+
type: "LOGIN";
|
|
23
23
|
user: string;
|
|
24
24
|
credentials: SMTPConnection.Credentials;
|
|
25
25
|
method: string | false;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface AuthenticationTypeOAuth2 {
|
|
29
|
-
type:
|
|
29
|
+
type: "OAUTH2";
|
|
30
30
|
user: string;
|
|
31
31
|
oauth2: XOAuth2;
|
|
32
|
-
method:
|
|
32
|
+
method: "XOAUTH2";
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
type AuthenticationType = AuthenticationTypeLogin | AuthenticationTypeOAuth2;
|
|
@@ -90,26 +90,26 @@ declare class SMTPTransport extends EventEmitter implements Transport<SMTPTransp
|
|
|
90
90
|
/** Releases resources */
|
|
91
91
|
close(): void;
|
|
92
92
|
|
|
93
|
-
addListener(event:
|
|
94
|
-
addListener(event:
|
|
93
|
+
addListener(event: "close", listener: () => void): this;
|
|
94
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
95
95
|
|
|
96
|
-
emit(event:
|
|
97
|
-
emit(event:
|
|
96
|
+
emit(event: "close"): boolean;
|
|
97
|
+
emit(event: "error", error: Error): boolean;
|
|
98
98
|
|
|
99
|
-
on(event:
|
|
100
|
-
on(event:
|
|
99
|
+
on(event: "close", listener: () => void): this;
|
|
100
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
101
101
|
|
|
102
|
-
once(event:
|
|
103
|
-
once(event:
|
|
102
|
+
once(event: "close", listener: () => void): this;
|
|
103
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
104
104
|
|
|
105
|
-
prependListener(event:
|
|
106
|
-
prependListener(event:
|
|
105
|
+
prependListener(event: "close", listener: () => void): this;
|
|
106
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
107
107
|
|
|
108
|
-
prependOnceListener(event:
|
|
109
|
-
prependOnceListener(event:
|
|
108
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
109
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
110
110
|
|
|
111
|
-
listeners(event:
|
|
112
|
-
listeners(event:
|
|
111
|
+
listeners(event: "close"): Array<() => void>;
|
|
112
|
+
listeners(event: "error"): Array<(err: Error) => void>;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export = SMTPTransport;
|