@mavogel/awscdk-rootmail 0.1.4 → 0.1.6
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.
- package/.jsii +3 -3
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@aws-sdk/checksums/package.json +2 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +3 -3
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +38 -15
- package/node_modules/@aws-sdk/client-s3/dist-es/models/enums.js +7 -0
- package/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js +28 -14
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/CopyObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateMultipartUploadCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketInventoryConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketNotificationConfigurationCommand.d.ts +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLockConfigurationCommand.d.ts +4 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectRetentionCommand.d.ts +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketInventoryConfigurationsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketInventoryConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLockConfigurationCommand.d.ts +4 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectRetentionCommand.d.ts +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutPublicAccessBlockCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/models/enums.d.ts +15 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +186 -49
- package/node_modules/@aws-sdk/client-s3/dist-types/models/models_1.d.ts +43 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutPublicAccessBlockCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/enums.d.ts +8 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_0.d.ts +23 -7
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_1.d.ts +14 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-s3/package.json +6 -6
- package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ses/package.json +3 -3
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@zone-eu/mailsplit/package.json +3 -3
- package/node_modules/encoding-japanese/LICENSE +25 -1
- package/node_modules/encoding-japanese/README.md +86 -51
- package/node_modules/encoding-japanese/encoding.js +107 -78
- package/node_modules/encoding-japanese/encoding.min.js +2 -2
- package/node_modules/encoding-japanese/index.d.ts +102 -0
- package/node_modules/encoding-japanese/package.json +26 -17
- package/node_modules/encoding-japanese/src/encoding-convert.js +67 -58
- package/node_modules/encoding-japanese/src/encoding-table.js +1 -0
- package/node_modules/encoding-japanese/src/index.js +1 -1
- package/node_modules/encoding-japanese/src/kana-case-table.js +1 -1
- package/node_modules/encoding-japanese/src/utf8-to-jis-alias-table.js +14 -0
- package/node_modules/encoding-japanese/src/utf8-to-jis-table.js +6 -5
- package/node_modules/encoding-japanese/src/utf8-to-jisx0212-table.js +7 -5
- package/node_modules/libmime/CHANGELOG.md +7 -0
- package/node_modules/libmime/package.json +2 -2
- package/node_modules/mailparser/.release-please-manifest.json +1 -1
- package/node_modules/mailparser/CHANGELOG.md +42 -0
- package/node_modules/mailparser/package.json +5 -5
- package/node_modules/nodemailer/CHANGELOG.md +83 -0
- package/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +1 -3
- package/node_modules/nodemailer/dist/cjs/addressparser/index.js +176 -13
- package/node_modules/nodemailer/dist/cjs/base64/index.d.ts +2 -6
- package/node_modules/nodemailer/dist/cjs/base64/index.js +2 -0
- package/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +4 -4
- package/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +1 -3
- package/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +14 -5
- package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +3 -22
- package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +5 -0
- package/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +5 -5
- package/node_modules/nodemailer/dist/cjs/errors.d.ts +8 -8
- package/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +12 -10
- package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +28 -14
- package/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +15 -15
- package/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +49 -104
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +14 -3
- package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +21 -28
- package/node_modules/nodemailer/dist/cjs/mailer/index.js +19 -5
- package/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +8 -12
- package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +4 -1
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +4 -1
- package/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +37 -191
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +82 -12
- package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +1 -3
- package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +2 -0
- package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +1 -5
- package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +1 -0
- package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +1 -5
- package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +1 -0
- package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +2 -2
- package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
- package/node_modules/nodemailer/dist/cjs/qp/index.d.ts +2 -5
- package/node_modules/nodemailer/dist/cjs/qp/index.js +2 -0
- package/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +4 -6
- package/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/cjs/ses-transport/index.js +5 -1
- package/node_modules/nodemailer/dist/cjs/shared/index.d.ts +31 -37
- package/node_modules/nodemailer/dist/cjs/shared/index.js +19 -7
- package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +1 -9
- package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +2 -0
- package/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +65 -403
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +99 -19
- package/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +8 -46
- package/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +13 -2
- package/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +2 -4
- package/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +16 -16
- package/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +3 -3
- package/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +9 -9
- package/node_modules/nodemailer/dist/cjs/well-known/services.js +2 -0
- package/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +18 -18
- package/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +1 -3
- package/node_modules/nodemailer/dist/esm/addressparser/index.js +176 -13
- package/node_modules/nodemailer/dist/esm/base64/index.d.ts +2 -6
- package/node_modules/nodemailer/dist/esm/base64/index.js +2 -0
- package/node_modules/nodemailer/dist/esm/dkim/index.d.ts +4 -4
- package/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +1 -3
- package/node_modules/nodemailer/dist/esm/dkim/message-parser.js +14 -5
- package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +3 -22
- package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +5 -0
- package/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +5 -5
- package/node_modules/nodemailer/dist/esm/errors.d.ts +8 -8
- package/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +12 -10
- package/node_modules/nodemailer/dist/esm/fetch/cookies.js +25 -14
- package/node_modules/nodemailer/dist/esm/fetch/index.d.ts +15 -15
- package/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +49 -104
- package/node_modules/nodemailer/dist/esm/mail-composer/index.js +14 -3
- package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +21 -28
- package/node_modules/nodemailer/dist/esm/mailer/index.js +19 -5
- package/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +8 -12
- package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +4 -1
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +4 -1
- package/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +37 -191
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +82 -12
- package/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +1 -3
- package/node_modules/nodemailer/dist/esm/mime-node/last-newline.js +2 -0
- package/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +1 -5
- package/node_modules/nodemailer/dist/esm/mime-node/le-unix.js +1 -0
- package/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +1 -5
- package/node_modules/nodemailer/dist/esm/mime-node/le-windows.js +1 -0
- package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +2 -2
- package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
- package/node_modules/nodemailer/dist/esm/qp/index.d.ts +2 -5
- package/node_modules/nodemailer/dist/esm/qp/index.js +2 -0
- package/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +4 -6
- package/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/esm/ses-transport/index.js +5 -1
- package/node_modules/nodemailer/dist/esm/shared/index.d.ts +31 -37
- package/node_modules/nodemailer/dist/esm/shared/index.js +19 -7
- package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +1 -9
- package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +2 -0
- package/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +65 -403
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +99 -19
- package/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +8 -46
- package/node_modules/nodemailer/dist/esm/smtp-pool/index.js +13 -2
- package/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +2 -4
- package/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +16 -16
- package/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +3 -3
- package/node_modules/nodemailer/dist/esm/well-known/index.d.ts +9 -9
- package/node_modules/nodemailer/dist/esm/well-known/services.js +2 -0
- package/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +18 -18
- package/node_modules/nodemailer/dist/well-known/services.json +2 -2
- package/node_modules/nodemailer/package.json +6 -6
- package/package.json +1 -1
|
@@ -61,6 +61,23 @@ function normalizeDomain(domain, toUnicode) {
|
|
|
61
61
|
}
|
|
62
62
|
return toUnicode ? punycode.toUnicode(domain) : punycode.toASCII(domain);
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Removes the characters that must never reach a multipart delimiter line.
|
|
66
|
+
*
|
|
67
|
+
* A line break splits the delimiter, so the boundary declared in the header can never
|
|
68
|
+
* match it again and the parts go out as body lines instead. The other C0 controls and
|
|
69
|
+
* DEL do not split anything but must not be written either: RFC 5321 does not allow a
|
|
70
|
+
* NUL in DATA at all, and an MTA or a scanner that stops at one reads a different
|
|
71
|
+
* message than a client that does not, which is the same parser disagreement a split
|
|
72
|
+
* delimiter creates. Both sides are cleaned together, since the declared value and the
|
|
73
|
+
* delimiters come from this one result.
|
|
74
|
+
*
|
|
75
|
+
* @param value Value to clean
|
|
76
|
+
* @return Value with every control character removed
|
|
77
|
+
*/
|
|
78
|
+
function _stripBoundaryControls(value) {
|
|
79
|
+
return value.replace(/[\x00-\x1f\x7f]+/g, '');
|
|
80
|
+
}
|
|
64
81
|
/**
|
|
65
82
|
* Creates a new mime tree node. Assumes 'multipart/*' as the content type
|
|
66
83
|
* if it is a branch, anything else counts as leaf. If rootNode is missing from
|
|
@@ -81,10 +98,11 @@ class MimeNode {
|
|
|
81
98
|
this.nodeCounter = 0;
|
|
82
99
|
options = options || {};
|
|
83
100
|
/**
|
|
84
|
-
* shared part of the unique multipart boundary
|
|
101
|
+
* shared part of the unique multipart boundary. Control characters are dropped
|
|
102
|
+
* here rather than at the delimiter, see _stripBoundaryControls
|
|
85
103
|
*/
|
|
86
|
-
this.baseBoundary = options.baseBoundary || crypto.randomBytes(8).toString('hex');
|
|
87
|
-
this.boundaryPrefix = options.boundaryPrefix || '--_NmP';
|
|
104
|
+
this.baseBoundary = _stripBoundaryControls(options.baseBoundary || crypto.randomBytes(8).toString('hex'));
|
|
105
|
+
this.boundaryPrefix = _stripBoundaryControls(options.boundaryPrefix || '--_NmP');
|
|
88
106
|
this.disableFileAccess = !!options.disableFileAccess;
|
|
89
107
|
this.disableUrlAccess = !!options.disableUrlAccess;
|
|
90
108
|
this.normalizeHeaderKey = options.normalizeHeaderKey;
|
|
@@ -916,6 +934,7 @@ class MimeNode {
|
|
|
916
934
|
*
|
|
917
935
|
* @param flag Either 'disableFileAccess' or 'disableUrlAccess'
|
|
918
936
|
* @return true if this node or an ancestor closed that access
|
|
937
|
+
* @internal
|
|
919
938
|
*/
|
|
920
939
|
_accessDisabled(flag) {
|
|
921
940
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -933,6 +952,7 @@ class MimeNode {
|
|
|
933
952
|
*
|
|
934
953
|
* @param content Node content
|
|
935
954
|
* @returns Stream object
|
|
955
|
+
* @internal
|
|
936
956
|
*/
|
|
937
957
|
_getStream(content) {
|
|
938
958
|
let contentStream;
|
|
@@ -999,19 +1019,41 @@ class MimeNode {
|
|
|
999
1019
|
*
|
|
1000
1020
|
* @param addresses Addresses to be parsed
|
|
1001
1021
|
* @return An array of address objects
|
|
1022
|
+
* @internal
|
|
1002
1023
|
*/
|
|
1003
1024
|
_parseAddresses(addresses) {
|
|
1004
|
-
// Collected into one list as we go. concat.apply spreads the entries into arguments
|
|
1005
|
-
// and throws a RangeError once a recipient array is long enough to pass the
|
|
1006
|
-
// argument limit, which a large Bcc list reaches on its own.
|
|
1007
1025
|
const flattened = [];
|
|
1008
|
-
|
|
1026
|
+
// Nested arrays are flattened iteratively. concat.apply throws once a recipient list
|
|
1027
|
+
// is long enough to pass the argument limit, and an array handed to addressparser is
|
|
1028
|
+
// stringified, which recurses once per nesting level and exhausts the call stack on
|
|
1029
|
+
// a deep enough value. Every array is walked once, which also ends a self-referential
|
|
1030
|
+
// input
|
|
1031
|
+
const seen = new WeakSet();
|
|
1032
|
+
const stack = [];
|
|
1033
|
+
const enter = (list) => {
|
|
1034
|
+
if (!seen.has(list)) {
|
|
1035
|
+
seen.add(list);
|
|
1036
|
+
stack.push({ list, pos: 0 });
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
enter(Array.isArray(addresses) ? addresses : [addresses]);
|
|
1040
|
+
while (stack.length) {
|
|
1041
|
+
const frame = stack[stack.length - 1];
|
|
1042
|
+
if (frame.pos >= frame.list.length) {
|
|
1043
|
+
stack.pop();
|
|
1044
|
+
continue;
|
|
1045
|
+
}
|
|
1046
|
+
const address = frame.list[frame.pos++];
|
|
1047
|
+
if (Array.isArray(address)) {
|
|
1048
|
+
enter(address);
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1009
1051
|
if (address && address.address) {
|
|
1010
1052
|
const normalized = this._normalizeAddress(address.address);
|
|
1011
1053
|
if (normalized === address.address && typeof address.name === 'string') {
|
|
1012
1054
|
// there is nothing to rewrite, so there is nothing to keep off the original
|
|
1013
1055
|
flattened.push(address);
|
|
1014
|
-
|
|
1056
|
+
continue;
|
|
1015
1057
|
}
|
|
1016
1058
|
// rewriting would land on the object the caller passed in and might
|
|
1017
1059
|
// still hold a reference to, so rewrite a copy of it instead. An own
|
|
@@ -1021,13 +1063,13 @@ class MimeNode {
|
|
|
1021
1063
|
copy.address = normalized;
|
|
1022
1064
|
copy.name = address.name || '';
|
|
1023
1065
|
flattened.push(copy);
|
|
1024
|
-
|
|
1066
|
+
continue;
|
|
1025
1067
|
}
|
|
1026
1068
|
const parsed = this._normalizeParsedAddresses(addressparser(address));
|
|
1027
1069
|
for (let i = 0; i < parsed.length; i++) {
|
|
1028
1070
|
flattened.push(parsed[i]);
|
|
1029
1071
|
}
|
|
1030
|
-
}
|
|
1072
|
+
}
|
|
1031
1073
|
return flattened;
|
|
1032
1074
|
}
|
|
1033
1075
|
/**
|
|
@@ -1040,6 +1082,7 @@ class MimeNode {
|
|
|
1040
1082
|
*
|
|
1041
1083
|
* @param parsed An array of address objects, as returned by addressparser
|
|
1042
1084
|
* @return The same array, with every address normalized
|
|
1085
|
+
* @internal
|
|
1043
1086
|
*/
|
|
1044
1087
|
_normalizeParsedAddresses(parsed) {
|
|
1045
1088
|
// addressparser builds these objects, so no caller holds a reference to rewrite around
|
|
@@ -1062,6 +1105,7 @@ class MimeNode {
|
|
|
1062
1105
|
*
|
|
1063
1106
|
* @param addresses Addresses to be parsed
|
|
1064
1107
|
* @return An array of address objects
|
|
1108
|
+
* @internal
|
|
1065
1109
|
*/
|
|
1066
1110
|
_parseEnvelopeAddresses(addresses) {
|
|
1067
1111
|
return this._parseAddresses(addresses).map(entry => {
|
|
@@ -1076,6 +1120,7 @@ class MimeNode {
|
|
|
1076
1120
|
*
|
|
1077
1121
|
* @param key Key to be normalized
|
|
1078
1122
|
* @return key in Camel-Case form
|
|
1123
|
+
* @internal
|
|
1079
1124
|
*/
|
|
1080
1125
|
_normalizeHeaderKey(key) {
|
|
1081
1126
|
key = (key || '')
|
|
@@ -1098,13 +1143,26 @@ class MimeNode {
|
|
|
1098
1143
|
* Doesn't return anything, modifies object argument instead.
|
|
1099
1144
|
*
|
|
1100
1145
|
* @param structured Parsed header value for 'Content-Type' key
|
|
1146
|
+
* @internal
|
|
1101
1147
|
*/
|
|
1102
1148
|
_handleContentType(structured) {
|
|
1103
1149
|
this.contentType = structured.value.trim().toLowerCase();
|
|
1104
1150
|
this.multipart = /^multipart\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;
|
|
1105
1151
|
if (this.multipart) {
|
|
1152
|
+
// The declared value and the delimiters are assigned from the same expression
|
|
1153
|
+
// here, so whatever the header emitter then does with it, the two sides cannot
|
|
1154
|
+
// disagree about which characters the boundary is made of.
|
|
1155
|
+
//
|
|
1156
|
+
// Stripping runs before the fallback rather than over the whole chain: a
|
|
1157
|
+
// boundary made only of control characters would otherwise strip to '' and
|
|
1158
|
+
// leave the node declaring no boundary and streaming bare '--' delimiters.
|
|
1159
|
+
// _generateBoundary cleans what it builds, but this is the one place the boundary
|
|
1160
|
+
// is written, so it cleans the value it is about to write rather than trusting
|
|
1161
|
+
// where it came from. MimeNode is exported and subclassable, so the generator is
|
|
1162
|
+
// not necessarily the one below. Stripping twice costs nothing, it is idempotent.
|
|
1163
|
+
const declared = _stripBoundaryControls(structured.params.boundary || this.boundary || '');
|
|
1106
1164
|
this.boundary = structured.params.boundary =
|
|
1107
|
-
|
|
1165
|
+
declared || _stripBoundaryControls(this._generateBoundary());
|
|
1108
1166
|
}
|
|
1109
1167
|
else {
|
|
1110
1168
|
this.boundary = false;
|
|
@@ -1114,15 +1172,19 @@ class MimeNode {
|
|
|
1114
1172
|
* Generates a multipart boundary value
|
|
1115
1173
|
*
|
|
1116
1174
|
* @return boundary value
|
|
1175
|
+
* @internal
|
|
1117
1176
|
*/
|
|
1118
1177
|
_generateBoundary() {
|
|
1119
|
-
|
|
1178
|
+
// baseBoundary and boundaryPrefix are public, so they may hold something the
|
|
1179
|
+
// constructor never cleaned, and the -Part_ suffix keeps the result non empty
|
|
1180
|
+
return _stripBoundaryControls(this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary) + '-Part_' + this._nodeId;
|
|
1120
1181
|
}
|
|
1121
1182
|
/**
|
|
1122
1183
|
* Encodes a header value for use in the generated rfc2822 email.
|
|
1123
1184
|
*
|
|
1124
1185
|
* @param key Header key
|
|
1125
1186
|
* @param value Header value
|
|
1187
|
+
* @internal
|
|
1126
1188
|
*/
|
|
1127
1189
|
_encodeHeaderValue(key, value) {
|
|
1128
1190
|
key = this._normalizeHeaderKey(key);
|
|
@@ -1195,6 +1257,7 @@ class MimeNode {
|
|
|
1195
1257
|
* @param addresses An array of address objects
|
|
1196
1258
|
* @param [uniqueList] An array to be populated with addresses
|
|
1197
1259
|
* @return address string
|
|
1260
|
+
* @internal
|
|
1198
1261
|
*/
|
|
1199
1262
|
_convertAddresses(addresses, uniqueList, seenAddresses) {
|
|
1200
1263
|
const values = [];
|
|
@@ -1239,6 +1302,7 @@ class MimeNode {
|
|
|
1239
1302
|
*
|
|
1240
1303
|
* @param address An array of address objects
|
|
1241
1304
|
* @return address string
|
|
1305
|
+
* @internal
|
|
1242
1306
|
*/
|
|
1243
1307
|
_normalizeAddress(address) {
|
|
1244
1308
|
address = (address || '')
|
|
@@ -1285,6 +1349,7 @@ class MimeNode {
|
|
|
1285
1349
|
*
|
|
1286
1350
|
* @param user Local part of an address
|
|
1287
1351
|
* @return Local part as a dot-atom or as a quoted-string
|
|
1352
|
+
* @internal
|
|
1288
1353
|
*/
|
|
1289
1354
|
_normalizeLocalPart(user) {
|
|
1290
1355
|
if (DOT_ATOM.test(user) || QUOTED_STRING.test(user)) {
|
|
@@ -1297,6 +1362,7 @@ class MimeNode {
|
|
|
1297
1362
|
*
|
|
1298
1363
|
* @param name Name part of an address
|
|
1299
1364
|
* @returns Mime word encoded string if needed
|
|
1365
|
+
* @internal
|
|
1300
1366
|
*/
|
|
1301
1367
|
_encodeAddressName(name) {
|
|
1302
1368
|
if (!/^[\w ]*$/.test(name)) {
|
|
@@ -1316,6 +1382,7 @@ class MimeNode {
|
|
|
1316
1382
|
*
|
|
1317
1383
|
* @param value Header value to encode
|
|
1318
1384
|
* @returns Mime word encoded string if needed
|
|
1385
|
+
* @internal
|
|
1319
1386
|
*/
|
|
1320
1387
|
_encodeHeaderText(value) {
|
|
1321
1388
|
return /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(value)
|
|
@@ -1328,6 +1395,7 @@ class MimeNode {
|
|
|
1328
1395
|
*
|
|
1329
1396
|
* @param name Name part of an address
|
|
1330
1397
|
* @returns Mime word encoded string if needed
|
|
1398
|
+
* @internal
|
|
1331
1399
|
*/
|
|
1332
1400
|
_encodeWords(value) {
|
|
1333
1401
|
// set encodeAll parameter to true even though it is against the recommendation of RFC2047,
|
|
@@ -1340,6 +1408,7 @@ class MimeNode {
|
|
|
1340
1408
|
*
|
|
1341
1409
|
* @param value Value to check for
|
|
1342
1410
|
* @return either 'Q' or 'B'
|
|
1411
|
+
* @internal
|
|
1343
1412
|
*/
|
|
1344
1413
|
_getTextEncoding(value) {
|
|
1345
1414
|
value = (value || '').toString();
|
|
@@ -1367,6 +1436,7 @@ class MimeNode {
|
|
|
1367
1436
|
* Generates a message id
|
|
1368
1437
|
*
|
|
1369
1438
|
* @return Random Message-ID value
|
|
1439
|
+
* @internal
|
|
1370
1440
|
*/
|
|
1371
1441
|
_generateMessageId() {
|
|
1372
1442
|
return ('<' +
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Transform
|
|
1
|
+
import { Transform } from 'node:stream';
|
|
2
2
|
export default class LastNewline extends Transform {
|
|
3
3
|
lastByte: number | false;
|
|
4
4
|
constructor();
|
|
5
|
-
_transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
|
|
6
|
-
_flush(done: TransformCallback): void;
|
|
7
5
|
}
|
|
@@ -4,6 +4,7 @@ export default class LastNewline extends Transform {
|
|
|
4
4
|
super();
|
|
5
5
|
this.lastByte = false;
|
|
6
6
|
}
|
|
7
|
+
/** @internal */
|
|
7
8
|
_transform(chunk, encoding, done) {
|
|
8
9
|
if (chunk.length) {
|
|
9
10
|
this.lastByte = chunk[chunk.length - 1];
|
|
@@ -11,6 +12,7 @@ export default class LastNewline extends Transform {
|
|
|
11
12
|
this.push(chunk);
|
|
12
13
|
done();
|
|
13
14
|
}
|
|
15
|
+
/** @internal */
|
|
14
16
|
_flush(done) {
|
|
15
17
|
if (this.lastByte === 0x0a) {
|
|
16
18
|
return done();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transform, type
|
|
1
|
+
import { Transform, type TransformOptions } from 'node:stream';
|
|
2
2
|
/**
|
|
3
3
|
* Ensures that only <LF> is used for linebreaks
|
|
4
4
|
*
|
|
@@ -6,8 +6,4 @@ import { Transform, type TransformCallback, type TransformOptions } from 'node:s
|
|
|
6
6
|
*/
|
|
7
7
|
export default class LeUnix extends Transform {
|
|
8
8
|
constructor(options?: TransformOptions);
|
|
9
|
-
/**
|
|
10
|
-
* Escapes dots
|
|
11
|
-
*/
|
|
12
|
-
_transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
|
|
13
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transform, type
|
|
1
|
+
import { Transform, type TransformOptions } from 'node:stream';
|
|
2
2
|
/**
|
|
3
3
|
* Ensures that only <CR><LF> sequences are used for linebreaks
|
|
4
4
|
*
|
|
@@ -7,8 +7,4 @@ import { Transform, type TransformCallback, type TransformOptions } from 'node:s
|
|
|
7
7
|
export default class LeWindows extends Transform {
|
|
8
8
|
lastByte: number | false;
|
|
9
9
|
constructor(options?: TransformOptions);
|
|
10
|
-
/**
|
|
11
|
-
* Escapes dots
|
|
12
|
-
*/
|
|
13
|
-
_transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
|
|
14
10
|
}
|
|
@@ -25,7 +25,7 @@ export interface TestAccount {
|
|
|
25
25
|
pop3: TestAccountService;
|
|
26
26
|
web: string;
|
|
27
27
|
/** true if the account can also receive external mail */
|
|
28
|
-
mxEnabled?: boolean;
|
|
28
|
+
mxEnabled?: boolean | undefined;
|
|
29
29
|
[key: string]: unknown;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -77,7 +77,7 @@ export declare function createTestAccount(apiUrl?: string | false | null): Promi
|
|
|
77
77
|
* @returns URL of the message in the Ethereal web interface, or false if the response does not carry one
|
|
78
78
|
*/
|
|
79
79
|
export declare function getTestMessageUrl(info?: {
|
|
80
|
-
response?: string | Buffer | null;
|
|
80
|
+
response?: string | Buffer | null | undefined;
|
|
81
81
|
} | false | null): string | false;
|
|
82
82
|
declare const nodemailer: {
|
|
83
83
|
createTransport: typeof createTransport;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transform
|
|
1
|
+
import { Transform } from 'node:stream';
|
|
2
2
|
export declare function encode(buffer: Buffer | string): string;
|
|
3
3
|
/**
|
|
4
4
|
* Adds soft line breaks to a Quoted-Printable string
|
|
@@ -13,7 +13,7 @@ export declare function wrap(str: string, lineLength?: number): string;
|
|
|
13
13
|
*/
|
|
14
14
|
export interface QPEncoderOptions {
|
|
15
15
|
/** Maximum length for lines, set to false to disable wrapping */
|
|
16
|
-
lineLength?: number | false;
|
|
16
|
+
lineLength?: number | false | undefined;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Creates a transform stream for encoding data to Quoted-Printable encoding
|
|
@@ -26,8 +26,5 @@ export declare class Encoder extends Transform {
|
|
|
26
26
|
options: QPEncoderOptions;
|
|
27
27
|
inputBytes: number;
|
|
28
28
|
outputBytes: number;
|
|
29
|
-
_curLine: string;
|
|
30
29
|
constructor(options?: QPEncoderOptions);
|
|
31
|
-
_transform(chunk: Buffer | string, encoding: BufferEncoding | 'buffer', done: TransformCallback): void;
|
|
32
|
-
_flush(done: TransformCallback): void;
|
|
33
30
|
}
|
|
@@ -152,6 +152,7 @@ export class Encoder extends Transform {
|
|
|
152
152
|
this.inputBytes = 0;
|
|
153
153
|
this.outputBytes = 0;
|
|
154
154
|
}
|
|
155
|
+
/** @internal */
|
|
155
156
|
_transform(chunk, encoding, done) {
|
|
156
157
|
let qp;
|
|
157
158
|
if (encoding !== 'buffer') {
|
|
@@ -180,6 +181,7 @@ export class Encoder extends Transform {
|
|
|
180
181
|
}
|
|
181
182
|
done();
|
|
182
183
|
}
|
|
184
|
+
/** @internal */
|
|
183
185
|
_flush(done) {
|
|
184
186
|
if (this._curLine) {
|
|
185
187
|
this.outputBytes += this._curLine.length;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
2
1
|
import type { Logger } from '../shared/index.js';
|
|
3
2
|
import type { MimeNodeEnvelope } from '../mime-node/index.js';
|
|
4
3
|
import type MailMessage from '../mailer/mail-message.js';
|
|
@@ -8,13 +7,13 @@ import type { default as Mail, SentMessageInfo, SendMailOptions, TransportOption
|
|
|
8
7
|
*/
|
|
9
8
|
export interface SendmailTransportOptions extends TransportOptions {
|
|
10
9
|
/** Selects this transport in createTransport, the binary itself is set with `path` */
|
|
11
|
-
sendmail?: boolean | string;
|
|
10
|
+
sendmail?: boolean | string | undefined;
|
|
12
11
|
/** Path to the sendmail binary, defaults to 'sendmail' */
|
|
13
|
-
path?: string;
|
|
12
|
+
path?: string | undefined;
|
|
14
13
|
/** Either 'windows' or 'unix', the line ending of the message piped to sendmail */
|
|
15
|
-
newline?: string;
|
|
14
|
+
newline?: string | undefined;
|
|
16
15
|
/** Arguments for the sendmail binary, replaces the default '-f <sender>' */
|
|
17
|
-
args?: string[];
|
|
16
|
+
args?: string[] | undefined;
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* The value the Sendmail transport hands to the send callback
|
|
@@ -41,7 +40,6 @@ export interface SendmailSentMessageInfo extends SentMessageInfo {
|
|
|
41
40
|
*/
|
|
42
41
|
declare class SendmailTransport {
|
|
43
42
|
mailer: Mail<SendmailSentMessageInfo>;
|
|
44
|
-
_spawn: typeof spawn;
|
|
45
43
|
options: SendmailTransportOptions;
|
|
46
44
|
name: string;
|
|
47
45
|
version: string;
|
|
@@ -12,9 +12,9 @@ export interface SESTransportOptions extends TransportOptions {
|
|
|
12
12
|
/** SESv2Client instance. Its config.region provider is resolved for the domain of the returned Message-ID */
|
|
13
13
|
sesClient: {
|
|
14
14
|
config?: {
|
|
15
|
-
region?: () => Promise<string
|
|
15
|
+
region?: (() => Promise<string>) | undefined;
|
|
16
16
|
[key: string]: any;
|
|
17
|
-
};
|
|
17
|
+
} | undefined;
|
|
18
18
|
send(command: unknown): Promise<any>;
|
|
19
19
|
};
|
|
20
20
|
/** SendEmailCommand class, constructed with the SendEmailCommandInput of every message */
|
|
@@ -24,7 +24,11 @@ function tagSesError(err) {
|
|
|
24
24
|
class SESTransport extends EventEmitter {
|
|
25
25
|
constructor(options) {
|
|
26
26
|
super();
|
|
27
|
-
options
|
|
27
|
+
if (!options || !options.SES || !options.SES.sesClient) {
|
|
28
|
+
const error = new Error('Missing SES configuration, expecting { sesClient, SendEmailCommand } from @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/');
|
|
29
|
+
error.code = errors.ECONFIG;
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
28
32
|
this.options = options;
|
|
29
33
|
this.ses = this.options.SES;
|
|
30
34
|
this.name = 'SESTransport';
|
|
@@ -9,39 +9,36 @@ export { isProtoKey, copyOwnKeys };
|
|
|
9
9
|
*/
|
|
10
10
|
export interface ResolveHostnameOptions {
|
|
11
11
|
/** Hostname or IP address to resolve */
|
|
12
|
-
host?: string;
|
|
12
|
+
host?: string | undefined;
|
|
13
13
|
/** Server name for TLS, used as the host when no host is set */
|
|
14
|
-
servername?: string;
|
|
14
|
+
servername?: string | undefined;
|
|
15
15
|
/** Count loopback interfaces when checking which address families are usable */
|
|
16
|
-
allowInternalNetworkInterfaces?: boolean;
|
|
16
|
+
allowInternalNetworkInterfaces?: boolean | undefined;
|
|
17
17
|
/** How long a resolved value stays cached, in milliseconds (default 5 minutes) */
|
|
18
|
-
dnsTtl?: number;
|
|
18
|
+
dnsTtl?: number | undefined;
|
|
19
19
|
/** Query timeout in milliseconds, passed to dns.Resolver */
|
|
20
|
-
timeout?: number;
|
|
20
|
+
timeout?: number | undefined;
|
|
21
21
|
/** Number of query attempts, passed to dns.Resolver */
|
|
22
|
-
tries?: number;
|
|
22
|
+
tries?: number | undefined;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Resolved value handed to the resolveHostname callback
|
|
26
26
|
*/
|
|
27
27
|
export interface ResolvedHostname {
|
|
28
28
|
/** Server name to use for TLS, false when an IP literal was given without one */
|
|
29
|
-
servername?: string | false;
|
|
29
|
+
servername?: string | false | undefined;
|
|
30
30
|
/** Address to connect to, picked at random from the resolved addresses */
|
|
31
|
-
host?: string | null;
|
|
32
|
-
/** All resolved addresses, for connection fallback support */
|
|
33
|
-
_addresses?: string[];
|
|
31
|
+
host?: string | null | undefined;
|
|
34
32
|
/** Whether the value came from the DNS cache */
|
|
35
|
-
cached?: boolean;
|
|
33
|
+
cached?: boolean | undefined;
|
|
36
34
|
/** The resolver error when a cached value was used because of it */
|
|
37
|
-
error?: Error;
|
|
35
|
+
error?: Error | undefined;
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
38
|
* Resolved addresses as stored in the DNS cache
|
|
41
39
|
*/
|
|
42
40
|
export interface DnsCacheValue {
|
|
43
41
|
addresses: string[];
|
|
44
|
-
servername: string | false;
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
44
|
* A DNS cache entry
|
|
@@ -49,26 +46,26 @@ export interface DnsCacheValue {
|
|
|
49
46
|
export interface DnsCacheEntry {
|
|
50
47
|
value: DnsCacheValue;
|
|
51
48
|
/** Expiration time as a timestamp, entries without one never expire */
|
|
52
|
-
expires?: number;
|
|
49
|
+
expires?: number | undefined;
|
|
53
50
|
}
|
|
54
51
|
/**
|
|
55
52
|
* Configuration object parsed from a connection url. Query parameters become
|
|
56
53
|
* top level keys, `tls.*` parameters go into `tls`
|
|
57
54
|
*/
|
|
58
55
|
export interface ConnectionUrlOptions {
|
|
59
|
-
secure?: boolean;
|
|
60
|
-
direct?: boolean;
|
|
61
|
-
port?: number;
|
|
62
|
-
host?: string;
|
|
56
|
+
secure?: boolean | undefined;
|
|
57
|
+
direct?: boolean | undefined;
|
|
58
|
+
port?: number | undefined;
|
|
59
|
+
host?: string | undefined;
|
|
63
60
|
/** Well-known service name from the ?service= query parameter */
|
|
64
|
-
service?: string;
|
|
61
|
+
service?: string | undefined;
|
|
65
62
|
auth?: {
|
|
66
63
|
user: string;
|
|
67
64
|
pass: string;
|
|
68
|
-
};
|
|
65
|
+
} | undefined;
|
|
69
66
|
tls?: {
|
|
70
67
|
[key: string]: unknown;
|
|
71
|
-
};
|
|
68
|
+
} | undefined;
|
|
72
69
|
[key: string]: unknown;
|
|
73
70
|
}
|
|
74
71
|
/**
|
|
@@ -77,12 +74,12 @@ export interface ConnectionUrlOptions {
|
|
|
77
74
|
*/
|
|
78
75
|
export interface LogEntry {
|
|
79
76
|
/** 'server' or 'client' for SMTP transaction lines */
|
|
80
|
-
tnx?: string;
|
|
77
|
+
tnx?: string | undefined;
|
|
81
78
|
/** Session id */
|
|
82
|
-
sid?: string;
|
|
79
|
+
sid?: string | undefined;
|
|
83
80
|
/** Connection id */
|
|
84
|
-
cid?: string | number;
|
|
85
|
-
level?: string;
|
|
81
|
+
cid?: string | number | undefined;
|
|
82
|
+
level?: string | undefined;
|
|
86
83
|
[key: string]: any;
|
|
87
84
|
}
|
|
88
85
|
export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
@@ -105,7 +102,7 @@ export interface ExternalLogger {
|
|
|
105
102
|
*/
|
|
106
103
|
export interface GetLoggerOptions {
|
|
107
104
|
/** A bunyan compatible logger, true for the default console logger, false or unset for no logging */
|
|
108
|
-
logger?: ExternalLogger | boolean;
|
|
105
|
+
logger?: ExternalLogger | boolean | undefined;
|
|
109
106
|
}
|
|
110
107
|
/**
|
|
111
108
|
* The bunyan compatible logger interface returned by getLogger
|
|
@@ -137,9 +134,9 @@ export interface ParsedDataURI {
|
|
|
137
134
|
*/
|
|
138
135
|
export interface ResolveContentOptions {
|
|
139
136
|
/** Reject content that points to a file path */
|
|
140
|
-
disableFileAccess?: boolean;
|
|
137
|
+
disableFileAccess?: boolean | undefined;
|
|
141
138
|
/** Reject content that points to a URL */
|
|
142
|
-
disableUrlAccess?: boolean;
|
|
139
|
+
disableUrlAccess?: boolean | undefined;
|
|
143
140
|
}
|
|
144
141
|
/**
|
|
145
142
|
* An object value resolveContent understands. A plain string or Buffer value is returned as
|
|
@@ -148,23 +145,21 @@ export interface ResolveContentOptions {
|
|
|
148
145
|
*/
|
|
149
146
|
export interface ContentDescriptor {
|
|
150
147
|
/** The content itself, a string, a Buffer or a readable stream */
|
|
151
|
-
content?: string | Buffer | Readable;
|
|
148
|
+
content?: string | Buffer | Readable | undefined;
|
|
152
149
|
/** Encoding of a string `content`, it is decoded into a Buffer unless it is utf8 or ascii */
|
|
153
|
-
encoding?: string;
|
|
150
|
+
encoding?: string | undefined;
|
|
154
151
|
/** File path, http(s) URL or data URI to read the content from */
|
|
155
|
-
path?: string;
|
|
152
|
+
path?: string | undefined;
|
|
156
153
|
/** URL to fetch the content from */
|
|
157
|
-
href?: string;
|
|
154
|
+
href?: string | undefined;
|
|
158
155
|
/** Request headers for a URL fetch */
|
|
159
|
-
httpHeaders?: OutgoingHttpHeaders;
|
|
156
|
+
httpHeaders?: OutgoingHttpHeaders | undefined;
|
|
160
157
|
/** TLS settings for a URL fetch, see nmfetch */
|
|
161
158
|
tls?: {
|
|
162
159
|
[key: string]: any;
|
|
163
|
-
};
|
|
160
|
+
} | undefined;
|
|
164
161
|
}
|
|
165
162
|
export type ResolveContentCallback = (err: Error | null, value?: any) => void;
|
|
166
|
-
export declare const _lastCacheCleanup: () => number;
|
|
167
|
-
export declare const _resetCacheCleanup: () => void;
|
|
168
163
|
export declare let networkInterfaces: NodeJS.Dict<os.NetworkInterfaceInfo[]> | undefined;
|
|
169
164
|
export declare const dnsCache: Map<string, DnsCacheEntry>;
|
|
170
165
|
export declare const resolveHostname: (options: ResolveHostnameOptions | undefined, callback: (err: Error | null, result?: ResolvedHostname) => void) => void;
|
|
@@ -175,7 +170,6 @@ export declare const resolveHostname: (options: ResolveHostnameOptions | undefin
|
|
|
175
170
|
* @return Configuration object
|
|
176
171
|
*/
|
|
177
172
|
export declare const parseConnectionUrl: (str?: string | null) => ConnectionUrlOptions;
|
|
178
|
-
export declare const _logFunc: (logger: ExternalLogger, level: string, defaults: LogEntry | undefined, data: LogEntry | undefined, message?: string, ...args: any[]) => void;
|
|
179
173
|
/**
|
|
180
174
|
* Returns a bunyan-compatible logger interface. Uses either provided logger or
|
|
181
175
|
* creates a default console logger
|