@types/nodemailer 6.4.12 → 6.4.13
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/lib/addressparser/index.d.ts +31 -0
- nodemailer/lib/base64/index.d.ts +22 -0
- nodemailer/lib/fetch/cookies.d.ts +54 -0
- nodemailer/lib/fetch/index.d.ts +38 -0
- nodemailer/lib/mail-composer/index.d.ts +25 -0
- nodemailer/lib/mime-funcs/index.d.ts +87 -0
- nodemailer/lib/mime-funcs/mime-types.d.ts +2 -0
- nodemailer/lib/qp/index.d.ts +23 -0
- nodemailer/lib/sendmail-transport/le-unix.d.ts +7 -0
- nodemailer/lib/sendmail-transport/le-windows.d.ts +7 -0
- nodemailer/lib/well-known/index.d.ts +6 -0
- nodemailer/package.json +2 -2
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: Wed, 18 Oct 2023
|
|
11
|
+
* Last updated: Wed, 18 Oct 2023 18:04:03 GMT
|
|
12
12
|
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare namespace addressparser {
|
|
2
|
+
interface Address {
|
|
3
|
+
name: string;
|
|
4
|
+
address: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface Group {
|
|
8
|
+
name: string;
|
|
9
|
+
group: AddressOrGroup[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type AddressOrGroup = Address | Group;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Parses structured e-mail addresses from an address field
|
|
17
|
+
*
|
|
18
|
+
* Example:
|
|
19
|
+
*
|
|
20
|
+
* 'Name <address@domain>'
|
|
21
|
+
*
|
|
22
|
+
* will be converted to
|
|
23
|
+
*
|
|
24
|
+
* [{name: 'Name', address: 'address@domain'}]
|
|
25
|
+
*
|
|
26
|
+
* @return An array of address objects
|
|
27
|
+
*/
|
|
28
|
+
declare function addressparser(address: string, options: { flatten: true }): addressparser.Address[];
|
|
29
|
+
declare function addressparser(address: string, options?: { flatten: false }): addressparser.AddressOrGroup[];
|
|
30
|
+
|
|
31
|
+
export = addressparser;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import { Transform, TransformOptions } from "stream";
|
|
4
|
+
|
|
5
|
+
/** Encodes a Buffer into a base64 encoded string */
|
|
6
|
+
export function encode(buffer: Buffer | string): string;
|
|
7
|
+
|
|
8
|
+
/** Adds soft line breaks to a base64 string */
|
|
9
|
+
export function wrap(str: string, lineLength?: number): string;
|
|
10
|
+
|
|
11
|
+
export interface EncoderOptions extends TransformOptions {
|
|
12
|
+
lineLength?: number | false | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class Encoder extends Transform {
|
|
16
|
+
options: EncoderOptions;
|
|
17
|
+
|
|
18
|
+
inputBytes: number;
|
|
19
|
+
outputBytes: number;
|
|
20
|
+
|
|
21
|
+
constructor(options?: EncoderOptions);
|
|
22
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
type s = number;
|
|
2
|
+
|
|
3
|
+
declare namespace Cookies {
|
|
4
|
+
interface Cookie {
|
|
5
|
+
name: string;
|
|
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
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Options {
|
|
15
|
+
sessionTimeout?: s | undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Creates a biskviit cookie jar for managing cookie values in memory */
|
|
20
|
+
declare class Cookies {
|
|
21
|
+
options: Cookies.Options;
|
|
22
|
+
cookies: Cookies.Cookie[];
|
|
23
|
+
|
|
24
|
+
constructor(options?: Cookies.Options);
|
|
25
|
+
|
|
26
|
+
/** Stores a cookie string to the cookie storage */
|
|
27
|
+
set(cookieStr: string, url: string): boolean;
|
|
28
|
+
|
|
29
|
+
/** Returns cookie string for the 'Cookie:' header. */
|
|
30
|
+
get(url: string): string;
|
|
31
|
+
|
|
32
|
+
/** Lists all valied cookie objects for the specified URL */
|
|
33
|
+
list(url: string): Cookies.Cookie[];
|
|
34
|
+
|
|
35
|
+
/** Parses cookie string from the 'Set-Cookie:' header */
|
|
36
|
+
parse(cookieStr: string): Cookies.Cookie;
|
|
37
|
+
|
|
38
|
+
/** Checks if a cookie object is valid for a specified URL */
|
|
39
|
+
match(cookie: Cookies.Cookie, url: string): boolean;
|
|
40
|
+
|
|
41
|
+
/** Adds (or updates/removes if needed) a cookie object to the cookie storage */
|
|
42
|
+
add(cookie: Cookies.Cookie): boolean;
|
|
43
|
+
|
|
44
|
+
/** Checks if two cookie objects are the same */
|
|
45
|
+
compare(a: Cookies.Cookie, b: Cookies.Cookie): boolean;
|
|
46
|
+
|
|
47
|
+
/** Checks if a cookie is expired */
|
|
48
|
+
isExpired(cookie: Cookies.Cookie): boolean;
|
|
49
|
+
|
|
50
|
+
/** Returns normalized cookie path for an URL path argument */
|
|
51
|
+
getPath(pathname: string): string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export = Cookies;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
type ms = number;
|
|
4
|
+
|
|
5
|
+
import _Cookies = require("./cookies");
|
|
6
|
+
|
|
7
|
+
import * as http from "http";
|
|
8
|
+
import { Writable } from "stream";
|
|
9
|
+
import * as tls from "tls";
|
|
10
|
+
|
|
11
|
+
declare namespace fetch {
|
|
12
|
+
type Cookies = _Cookies;
|
|
13
|
+
|
|
14
|
+
interface WritableResponse extends Writable {
|
|
15
|
+
statusCode: number;
|
|
16
|
+
headers: http.IncomingHttpHeaders;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Options {
|
|
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
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function fetch(url: string, options?: fetch.Options): fetch.WritableResponse;
|
|
37
|
+
|
|
38
|
+
export = fetch;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import { URL } from "url";
|
|
4
|
+
|
|
5
|
+
import Mail = require("../mailer");
|
|
6
|
+
import MimeNode = require("../mime-node");
|
|
7
|
+
|
|
8
|
+
/** Creates the object for composing a MimeNode instance out from the mail options */
|
|
9
|
+
declare class MailComposer {
|
|
10
|
+
mail: Mail.Options;
|
|
11
|
+
message: MimeNode | false;
|
|
12
|
+
|
|
13
|
+
constructor(mail: Mail.Options);
|
|
14
|
+
|
|
15
|
+
/** Builds MimeNode instance */
|
|
16
|
+
compile(): MimeNode;
|
|
17
|
+
|
|
18
|
+
/** List all attachments. Resulting attachment objects can be used as input for MimeNode nodes */
|
|
19
|
+
getAttachments(findRelated: boolean): Mail.Attachment[];
|
|
20
|
+
|
|
21
|
+
/** List alternatives. Resulting objects can be used as input for MimeNode nodes */
|
|
22
|
+
getAlternatives(): Mail.Attachment[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export = MailComposer;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export interface HeaderValue {
|
|
2
|
+
value: string;
|
|
3
|
+
params?: { [key: string]: string } | undefined;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface ParsedHeaderValue extends HeaderValue {
|
|
7
|
+
params: { [key: string]: string };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ParsedHeaderParam {
|
|
11
|
+
key: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Checks if a value is plaintext string (uses only printable 7bit chars) */
|
|
16
|
+
export function isPlainText(value: string): boolean;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a multi line string containes lines longer than the selected value.
|
|
20
|
+
*
|
|
21
|
+
* Useful when detecting if a mail message needs any processing at all –
|
|
22
|
+
* if only plaintext characters are used and lines are short, then there is
|
|
23
|
+
* no need to encode the values in any way. If the value is plaintext but has
|
|
24
|
+
* longer lines then allowed, then use format=flowed
|
|
25
|
+
*/
|
|
26
|
+
export function hasLongerLines(str: string, lineLength: number): boolean;
|
|
27
|
+
|
|
28
|
+
/** Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047) */
|
|
29
|
+
export function encodeWord(data: Buffer | string, mimeWordEncoding?: "Q" | "B", maxLength?: number): string;
|
|
30
|
+
|
|
31
|
+
/** Finds word sequences with non ascii text and converts these to mime words */
|
|
32
|
+
export function encodeWords(value: string, mimeWordEncoding?: "Q" | "B", maxLength?: number): string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Joins parsed header value together as 'value; param1=value1; param2=value2'
|
|
36
|
+
* PS: We are following RFC 822 for the list of special characters that we need to keep in quotes.
|
|
37
|
+
* Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
|
|
38
|
+
*/
|
|
39
|
+
export function buildHeaderValue(structured: HeaderValue): string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231)
|
|
43
|
+
* Useful for splitting long parameter values.
|
|
44
|
+
*
|
|
45
|
+
* For example
|
|
46
|
+
* ```
|
|
47
|
+
* title="unicode string"
|
|
48
|
+
* ```
|
|
49
|
+
* becomes
|
|
50
|
+
* ```
|
|
51
|
+
* title*0*=utf-8''unicode
|
|
52
|
+
* title*1*=%20string
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export function buildHeaderParam(key: string, data: Buffer | string, maxLength?: number): ParsedHeaderParam[];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Parses a header value with key=value arguments into a structured
|
|
59
|
+
* object.
|
|
60
|
+
*
|
|
61
|
+
* ```
|
|
62
|
+
* parseHeaderValue('content-type: text/plain; CHARSET='UTF-8') ->
|
|
63
|
+
* {
|
|
64
|
+
* 'value': 'text/plain',
|
|
65
|
+
* 'params': {
|
|
66
|
+
* 'charset': 'UTF-8'
|
|
67
|
+
* }
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export function parseHeaderValue(str: string): ParsedHeaderValue;
|
|
72
|
+
|
|
73
|
+
/** Returns file extension for a content type string. If no suitable extensions are found, 'bin' is used as the default extension */
|
|
74
|
+
export function detectExtension(mimeType: string): string;
|
|
75
|
+
|
|
76
|
+
/** Returns content type for a file extension. If no suitable content types are found, 'application/octet-stream' is used as the default content type */
|
|
77
|
+
export function detectMimeType(extension: string): string;
|
|
78
|
+
|
|
79
|
+
/** Folds long lines, useful for folding header lines (afterSpace=false) and flowed text (afterSpace=true) */
|
|
80
|
+
export function foldLines(str: string, lineLength?: number, afterSpace?: boolean): string;
|
|
81
|
+
|
|
82
|
+
/** Splits a mime encoded string. Needed for dividing mime words into smaller chunks */
|
|
83
|
+
export function splitMimeEncodedString(str: string, maxlen?: number): string[];
|
|
84
|
+
|
|
85
|
+
export function encodeURICharComponent(chr: string): string;
|
|
86
|
+
|
|
87
|
+
export function safeEncodeURIComponent(str: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import { Transform, TransformOptions } from "stream";
|
|
4
|
+
|
|
5
|
+
/** Encodes a Buffer into a Quoted-Printable encoded string */
|
|
6
|
+
export function encode(buffer: Buffer | string): string;
|
|
7
|
+
|
|
8
|
+
/** Adds soft line breaks to a Quoted-Printable string */
|
|
9
|
+
export function wrap(str: string, lineLength?: number): string;
|
|
10
|
+
|
|
11
|
+
export interface EncoderOptions extends TransformOptions {
|
|
12
|
+
lineLength?: number | false | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Creates a transform stream for encoding data to Quoted-Printable encoding */
|
|
16
|
+
export class Encoder extends Transform {
|
|
17
|
+
options: EncoderOptions;
|
|
18
|
+
|
|
19
|
+
inputBytes: number;
|
|
20
|
+
outputBytes: number;
|
|
21
|
+
|
|
22
|
+
constructor(options?: EncoderOptions);
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import SMTPConnection = require("../smtp-connection");
|
|
2
|
+
|
|
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
|
+
declare function wellKnown(key: string): SMTPConnection.Options | false;
|
|
5
|
+
|
|
6
|
+
export = wellKnown;
|
nodemailer/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/nodemailer",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.13",
|
|
4
4
|
"description": "TypeScript definitions for nodemailer",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@types/node": "*"
|
|
34
34
|
},
|
|
35
|
-
"typesPublisherContentHash": "
|
|
35
|
+
"typesPublisherContentHash": "5f29fc512be89e02dfed5dc1c7aa88ce996bf942f6057978e6c8e4fc71bb29d1",
|
|
36
36
|
"typeScriptVersion": "4.5"
|
|
37
37
|
}
|