@mavogel/awscdk-rootmail 0.1.23 → 0.1.25
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 +4 -4
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@zone-eu/mailsplit/README.md +1 -1
- package/node_modules/@zone-eu/mailsplit/lib/headers.js +10 -4
- package/node_modules/@zone-eu/mailsplit/lib/message-splitter.js +5 -4
- package/node_modules/@zone-eu/mailsplit/lib/mime-node.d.ts +4 -1
- package/node_modules/@zone-eu/mailsplit/lib/mime-node.js +23 -2
- package/node_modules/@zone-eu/mailsplit/lib/types.d.ts +3 -1
- package/node_modules/@zone-eu/mailsplit/package.json +4 -4
- package/node_modules/libbase64/CHANGELOG.md +20 -0
- package/node_modules/libbase64/README.md +40 -13
- package/node_modules/libbase64/dist/cjs/libbase64.d.ts +80 -0
- package/node_modules/libbase64/dist/cjs/libbase64.js +310 -0
- package/node_modules/libbase64/dist/cjs/package.json +3 -0
- package/node_modules/libbase64/dist/esm/libbase64.d.ts +80 -0
- package/node_modules/libbase64/{lib → dist/esm}/libbase64.js +74 -117
- package/node_modules/libbase64/dist/esm/package.json +3 -0
- package/node_modules/libbase64/package.json +59 -13
- package/node_modules/libmime/CHANGELOG.md +31 -0
- package/node_modules/libmime/README.md +55 -26
- package/node_modules/libmime/SECURITY.md +152 -0
- package/node_modules/libmime/dist/cjs/charset.d.ts +43 -0
- package/node_modules/libmime/dist/cjs/charset.js +135 -0
- package/node_modules/libmime/dist/cjs/charsets.d.ts +2 -0
- package/node_modules/libmime/dist/cjs/charsets.js +213 -0
- package/node_modules/libmime/dist/cjs/get-charset-name.d.ts +1 -0
- package/node_modules/libmime/dist/cjs/get-charset-name.js +224 -0
- package/node_modules/libmime/dist/cjs/libmime.d.ts +218 -0
- package/node_modules/libmime/dist/cjs/libmime.js +1013 -0
- package/node_modules/libmime/dist/cjs/mimetypes.d.ts +7 -0
- package/node_modules/libmime/dist/cjs/mimetypes.js +2072 -0
- package/node_modules/libmime/dist/cjs/package.json +3 -0
- package/node_modules/libmime/dist/cjs/types.d.ts +59 -0
- package/node_modules/libmime/dist/cjs/types.js +4 -0
- package/node_modules/libmime/dist/esm/charset.d.ts +43 -0
- package/node_modules/libmime/dist/esm/charset.js +125 -0
- package/node_modules/libmime/dist/esm/charsets.d.ts +2 -0
- package/node_modules/libmime/{lib → dist/esm}/charsets.js +3 -5
- package/node_modules/libmime/dist/esm/get-charset-name.d.ts +1 -0
- package/node_modules/libmime/{lib → dist/esm}/get-charset-name.js +1 -8
- package/node_modules/libmime/dist/esm/libmime.d.ts +219 -0
- package/node_modules/libmime/{lib → dist/esm}/libmime.js +256 -329
- package/node_modules/libmime/dist/esm/mimetypes.d.ts +7 -0
- package/node_modules/libmime/dist/esm/mimetypes.js +2068 -0
- package/node_modules/libmime/dist/esm/package.json +3 -0
- package/node_modules/libmime/dist/esm/types.d.ts +59 -0
- package/node_modules/libmime/dist/esm/types.js +3 -0
- package/node_modules/libmime/package.json +58 -15
- package/node_modules/libqp/CHANGELOG.md +18 -0
- package/node_modules/libqp/README.md +50 -19
- package/node_modules/libqp/dist/cjs/libqp.d.ts +74 -0
- package/node_modules/libqp/dist/cjs/libqp.js +378 -0
- package/node_modules/libqp/dist/cjs/package.json +3 -0
- package/node_modules/libqp/dist/esm/libqp.d.ts +74 -0
- package/node_modules/libqp/dist/esm/libqp.js +369 -0
- package/node_modules/libqp/dist/esm/package.json +3 -0
- package/node_modules/libqp/lib/libqp.js +4 -383
- package/node_modules/libqp/lib/package.json +3 -0
- package/node_modules/libqp/package.json +62 -6
- 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 +44 -0
- package/node_modules/nodemailer/dist/cjs/addressparser/index.js +695 -267
- package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +4 -1
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +8 -2
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +48 -16
- 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/shared/url.js +22 -5
- package/node_modules/nodemailer/dist/esm/addressparser/index.js +695 -267
- package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +4 -1
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +8 -2
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +48 -16
- 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/shared/url.js +22 -5
- package/node_modules/nodemailer/package.json +1 -1
- package/package.json +3 -3
- package/node_modules/libbase64/.eslintrc +0 -11
- package/node_modules/libbase64/.github/FUNDING.yml +0 -4
- package/node_modules/libbase64/.github/VULNERABILITY_REPORT.yml +0 -75
- package/node_modules/libbase64/.github/workflows/release.yaml +0 -39
- package/node_modules/libbase64/.github/workflows/test.yml +0 -21
- package/node_modules/libbase64/.ncurc.js +0 -13
- package/node_modules/libbase64/.prettierrc.js +0 -8
- package/node_modules/libmime/lib/charset.js +0 -131
- package/node_modules/libmime/lib/mimetypes.js +0 -2049
- package/node_modules/libqp/.eslintrc +0 -15
- package/node_modules/libqp/.github/FUNDING.yml +0 -4
- package/node_modules/libqp/.github/VULNERABILITY_REPORT.yml +0 -75
- package/node_modules/libqp/.github/workflows/release.yaml +0 -39
- package/node_modules/libqp/.github/workflows/test.yml +0 -21
- package/node_modules/libqp/.prettierrc.js +0 -8
- package/node_modules/libqp/test/libqp-test.js +0 -366
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration object of a Libmime instance, kept as `config`. The library itself does not read any keys
|
|
3
|
+
*/
|
|
4
|
+
export type LibmimeConfig = Record<string, any>;
|
|
5
|
+
/**
|
|
6
|
+
* A single header line split into its key and value
|
|
7
|
+
*/
|
|
8
|
+
export interface HeaderLine {
|
|
9
|
+
/** Lowercased header key */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Header value, unfolded and trimmed, not mime word decoded */
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parsed header block, every key holds the values of all the header lines with that key
|
|
16
|
+
*/
|
|
17
|
+
export type HeaderObject = Record<string, string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Header value with key=value parameters as returned by parseHeaderValue()
|
|
20
|
+
*/
|
|
21
|
+
export interface ParsedHeaderValue {
|
|
22
|
+
/** The value in front of the parameters, eg. "text/plain" */
|
|
23
|
+
value: string;
|
|
24
|
+
/** Parameters keyed by their lowercased names */
|
|
25
|
+
params: Record<string, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Names of the params assembled from rfc2231 segments. Their values are already decoded,
|
|
28
|
+
* so a caller that runs decodeWords() over the params has to leave them out. Non-enumerable
|
|
29
|
+
*/
|
|
30
|
+
decodedParams: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Header value with parameters as accepted by buildHeaderValue()
|
|
34
|
+
*/
|
|
35
|
+
export interface StructuredHeaderValue {
|
|
36
|
+
value: string;
|
|
37
|
+
params?: Record<string, unknown> | undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A parameter key and value pair as returned by buildHeaderParam()
|
|
41
|
+
*/
|
|
42
|
+
export interface HeaderParam {
|
|
43
|
+
key: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Header value with key=value parameters, the name the @types/libmime declarations used
|
|
48
|
+
*/
|
|
49
|
+
export interface StructuredHeader {
|
|
50
|
+
value: string;
|
|
51
|
+
params: {
|
|
52
|
+
[key: string]: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Encoding of a mime encoded word, Q for quoted printable and B for base64. Lowercase letters
|
|
57
|
+
* and longer names that start with Q or B are accepted as well
|
|
58
|
+
*/
|
|
59
|
+
export type MimeWordEncoding = 'Q' | 'B';
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libmime",
|
|
3
3
|
"description": "Encode and decode quoted printable and base64 strings",
|
|
4
|
-
"version": "5.
|
|
5
|
-
"
|
|
4
|
+
"version": "5.5.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/libmime.js",
|
|
7
|
+
"types": "./dist/cjs/libmime.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
"*": {
|
|
10
|
+
"lib/*": [
|
|
11
|
+
"dist/cjs/*.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/esm/libmime.js",
|
|
18
|
+
"require": "./dist/cjs/libmime.js"
|
|
19
|
+
},
|
|
20
|
+
"./lib/*.js": {
|
|
21
|
+
"import": "./dist/esm/*.js",
|
|
22
|
+
"require": "./dist/cjs/*.js"
|
|
23
|
+
},
|
|
24
|
+
"./lib/*": {
|
|
25
|
+
"import": "./dist/esm/*.js",
|
|
26
|
+
"require": "./dist/cjs/*.js"
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
6
30
|
"files": [
|
|
7
|
-
"
|
|
8
|
-
"CHANGELOG.md"
|
|
31
|
+
"dist",
|
|
32
|
+
"CHANGELOG.md",
|
|
33
|
+
"SECURITY.md"
|
|
9
34
|
],
|
|
10
35
|
"homepage": "https://github.com/nodemailer/libmime",
|
|
11
36
|
"repository": {
|
|
@@ -20,23 +45,41 @@
|
|
|
20
45
|
],
|
|
21
46
|
"author": "Andris Reinman <andris@kreata.ee>",
|
|
22
47
|
"scripts": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
48
|
+
"build": "node scripts/build.js",
|
|
49
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
50
|
+
"pretest": "npm run build",
|
|
51
|
+
"test": "node --import tsx --test --test-concurrency=1 $(find test -name \"*-test.ts\")",
|
|
52
|
+
"pretest:coverage": "npm run build",
|
|
53
|
+
"test:coverage": "c8 node --import tsx --test --test-concurrency=1 $(find test -name \"*-test.ts\")",
|
|
54
|
+
"format": "prettier --write \"**/*.{js,cjs,ts,json,md,yml,yaml}\"",
|
|
55
|
+
"format:check": "prettier --check \"**/*.{js,cjs,ts,json,md,yml,yaml}\"",
|
|
56
|
+
"lint": "npm run typecheck && eslint .",
|
|
57
|
+
"lint:fix": "eslint . --fix",
|
|
58
|
+
"prepare": "npm run build",
|
|
59
|
+
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install",
|
|
60
|
+
"pretest:bun": "npm run build",
|
|
61
|
+
"test:bun": "bun test --timeout 60000 $(find ./test -name \"*-test.ts\")",
|
|
62
|
+
"test:mutation": "node scripts/mutation-test.js"
|
|
25
63
|
},
|
|
26
64
|
"dependencies": {
|
|
27
65
|
"encoding-japanese": "2.4.0",
|
|
28
66
|
"iconv-lite": "0.7.3",
|
|
29
|
-
"libbase64": "1.
|
|
30
|
-
"libqp": "
|
|
67
|
+
"libbase64": "1.4.1",
|
|
68
|
+
"libqp": "3.0.1"
|
|
31
69
|
},
|
|
32
70
|
"devDependencies": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
71
|
+
"@types/node": "20.19.43",
|
|
72
|
+
"c8": "12.0.0",
|
|
73
|
+
"eslint": "10.13.0",
|
|
35
74
|
"eslint-config-prettier": "10.1.8",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
75
|
+
"globals": "17.13.0",
|
|
76
|
+
"nodemailer": "10.1.6",
|
|
77
|
+
"prettier": "3.9.10",
|
|
78
|
+
"tsx": "4.23.15",
|
|
79
|
+
"typescript": "6.0.3",
|
|
80
|
+
"typescript-eslint": "8.71.2"
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"node": ">=20.0.0"
|
|
41
84
|
}
|
|
42
85
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.1](https://github.com/nodemailer/libqp/compare/v3.0.0...v3.0.1) (2026-10-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* escape a hyphen after a lone CR and stop wrap() from adding needless soft breaks ([1bc3c8e](https://github.com/nodemailer/libqp/commit/1bc3c8e66fa114877b95d5c280b5f2eed23420cf))
|
|
9
|
+
|
|
10
|
+
## [3.0.0](https://github.com/nodemailer/libqp/compare/v2.1.3...v3.0.0) (2026-10-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* requires Node.js 20 or newer.
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* rewrite in TypeScript with ES module and CommonJS builds ([eeb28aa](https://github.com/nodemailer/libqp/commit/eeb28aab2f7055f7d7f3decd8878c476acb581e5))
|
|
20
|
+
|
|
3
21
|
## [2.1.3](https://github.com/nodemailer/libqp/compare/v2.1.2...v2.1.3) (2026-10-16)
|
|
4
22
|
|
|
5
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# libqp
|
|
2
2
|
|
|
3
|
-
Encode and decode quoted-printable strings according to [RFC2045](
|
|
3
|
+
Encode and decode quoted-printable strings according to [RFC2045](https://tools.ietf.org/html/rfc2045#section-6.7).
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -10,9 +10,15 @@ Install with npm
|
|
|
10
10
|
npm install libqp
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
libqp requires Node.js 20 or newer. It is written in TypeScript and ships both an ES module and a CommonJS build, each with type declarations.
|
|
14
14
|
|
|
15
15
|
```javascript
|
|
16
|
+
// ES modules
|
|
17
|
+
import libqp from 'libqp';
|
|
18
|
+
// or
|
|
19
|
+
import { encode, decode, wrap, Encoder, Decoder } from 'libqp';
|
|
20
|
+
|
|
21
|
+
// CommonJS
|
|
16
22
|
const libqp = require('libqp');
|
|
17
23
|
```
|
|
18
24
|
|
|
@@ -26,7 +32,9 @@ libqp.encode(val) → String
|
|
|
26
32
|
|
|
27
33
|
Where
|
|
28
34
|
|
|
29
|
-
-
|
|
35
|
+
- **val** is a Buffer, an Uint8Array or an unicode string (encoded as UTF-8)
|
|
36
|
+
|
|
37
|
+
`encode` escapes whitespace at the end of a line and a hyphen at the start of a line, so the output never contains a line that could be read as a MIME boundary.
|
|
30
38
|
|
|
31
39
|
**Example**
|
|
32
40
|
|
|
@@ -35,6 +43,25 @@ libqp.encode('jõgeva');
|
|
|
35
43
|
// j=C3=B5geva
|
|
36
44
|
```
|
|
37
45
|
|
|
46
|
+
### Decode values
|
|
47
|
+
|
|
48
|
+
Decode Quoted-Printable encoded strings with
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
libqp.decode(str) → Buffer
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Where
|
|
55
|
+
|
|
56
|
+
- **str** is a Quoted-Printable encoded string, Buffer or Uint8Array. A Buffer is read byte for byte, so raw 8-bit bytes in the input are kept as they are. A char of a string is read as the low byte of its char code, so pass a binary string (`buf.toString('binary')`) rather than a unicode one
|
|
57
|
+
|
|
58
|
+
**Example**
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
libqp.decode('j=C3=B5geva').toString();
|
|
62
|
+
// jõgeva
|
|
63
|
+
```
|
|
64
|
+
|
|
38
65
|
### Wrap encoded values
|
|
39
66
|
|
|
40
67
|
Quoted-Printable encoded lines are limited to 76 characters but `encode` method might return lines longer than the limit.
|
|
@@ -47,8 +74,8 @@ libqp.wrap(str[, lineLength]) → String
|
|
|
47
74
|
|
|
48
75
|
Where
|
|
49
76
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
77
|
+
- **str** is a Quoted-Printable encoded string
|
|
78
|
+
- **lineLength** (defaults to 76) is the maximum allowed line length. Any longer line will be soft wrapped. Values below 4 are raised to 4, the shortest line that fits an escape sequence and a soft line break. Every line is wrapped on its own and a line break does not count towards the line length
|
|
52
79
|
|
|
53
80
|
**Example**
|
|
54
81
|
|
|
@@ -72,20 +99,22 @@ const encoder = new libqp.Encoder([options])
|
|
|
72
99
|
|
|
73
100
|
Where
|
|
74
101
|
|
|
75
|
-
-
|
|
102
|
+
- **options** is the optional stream options object with additional options:
|
|
103
|
+
- **lineLength** if you want to use any other line length than the default 76 characters (or set to `false` to turn the soft wrapping off completely)
|
|
104
|
+
- **binary** set to `true` if the input is binary data. A CR or LF that is not part of a CRLF pair is then encoded, so that line ending conversions on the way can not change the data
|
|
76
105
|
|
|
77
106
|
**Example**
|
|
78
107
|
|
|
79
108
|
The following example script reads in a file, encodes it to Quoted-Printable and saves the output to a file.
|
|
80
109
|
|
|
81
110
|
```javascript
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var source = fs.createReadStream('source.txt');
|
|
85
|
-
var encoded = fs.createReadStream('encoded.txt');
|
|
86
|
-
var encoder = new libqp.Encoder();
|
|
111
|
+
import fs from 'node:fs';
|
|
112
|
+
import { Encoder } from 'libqp';
|
|
87
113
|
|
|
88
|
-
source.
|
|
114
|
+
const source = fs.createReadStream('source.txt');
|
|
115
|
+
const encoded = fs.createWriteStream('encoded.txt');
|
|
116
|
+
|
|
117
|
+
source.pipe(new Encoder()).pipe(encoded);
|
|
89
118
|
```
|
|
90
119
|
|
|
91
120
|
### Decoder Stream
|
|
@@ -98,20 +127,22 @@ const decoder = new libqp.Decoder([options])
|
|
|
98
127
|
|
|
99
128
|
Where
|
|
100
129
|
|
|
101
|
-
-
|
|
130
|
+
- **options** is the optional stream options object
|
|
131
|
+
|
|
132
|
+
The Decoder collects its input and decodes it once the input ends, so escape sequences and soft line breaks split between chunks are decoded correctly.
|
|
102
133
|
|
|
103
134
|
**Example**
|
|
104
135
|
|
|
105
136
|
The following example script reads in a file in Quoted-Printable encoding, decodes it and saves the output to a file.
|
|
106
137
|
|
|
107
138
|
```javascript
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
139
|
+
import fs from 'node:fs';
|
|
140
|
+
import { Decoder } from 'libqp';
|
|
141
|
+
|
|
142
|
+
const encoded = fs.createReadStream('encoded.txt');
|
|
143
|
+
const dest = fs.createWriteStream('dest.txt');
|
|
113
144
|
|
|
114
|
-
encoded.pipe(
|
|
145
|
+
encoded.pipe(new Decoder()).pipe(dest);
|
|
115
146
|
```
|
|
116
147
|
|
|
117
148
|
## License
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Transform, type TransformOptions } from 'node:stream';
|
|
2
|
+
/**
|
|
3
|
+
* Encodes a Buffer into a Quoted-Printable encoded string
|
|
4
|
+
*
|
|
5
|
+
* @param buffer Buffer to convert, a string is encoded as UTF-8
|
|
6
|
+
* @returns Quoted-Printable encoded string
|
|
7
|
+
*/
|
|
8
|
+
export declare function encode(buffer: Buffer | Uint8Array | string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Decodes a Quoted-Printable encoded string to a Buffer object
|
|
11
|
+
*
|
|
12
|
+
* @param str Quoted-Printable encoded string. A Buffer is read byte for byte, so raw 8-bit bytes
|
|
13
|
+
* in the input are copied to the output unchanged. A char of a string is copied as the low
|
|
14
|
+
* byte of its char code, so a string should only hold chars below 256 ('binary')
|
|
15
|
+
* @returns Decoded value
|
|
16
|
+
*/
|
|
17
|
+
export declare function decode(str: string | Buffer | Uint8Array): Buffer;
|
|
18
|
+
/**
|
|
19
|
+
* Adds soft line breaks to a Quoted-Printable string
|
|
20
|
+
*
|
|
21
|
+
* @param str Quoted-Printable encoded string that might need line wrapping
|
|
22
|
+
* @param [lineLength=76] Maximum allowed length for a line, at least 4
|
|
23
|
+
* @returns Soft-wrapped Quoted-Printable encoded string
|
|
24
|
+
*/
|
|
25
|
+
export declare function wrap(str: string, lineLength?: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* Options for the Quoted-Printable encoder stream, on top of the Transform stream options
|
|
28
|
+
*/
|
|
29
|
+
export interface EncoderOptions extends TransformOptions {
|
|
30
|
+
/** Maximum length for lines (76 by default), set to false to disable wrapping */
|
|
31
|
+
lineLength?: number | false | undefined;
|
|
32
|
+
/** The input is binary data: a CR or LF that is not part of a CRLF pair is encoded */
|
|
33
|
+
binary?: boolean | undefined;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Options for the Quoted-Printable decoder stream, the Transform stream options
|
|
37
|
+
*/
|
|
38
|
+
export type DecoderOptions = TransformOptions;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a transform stream for encoding data to Quoted-Printable encoding
|
|
41
|
+
*/
|
|
42
|
+
export declare class Encoder extends Transform {
|
|
43
|
+
options: EncoderOptions;
|
|
44
|
+
inputBytes: number;
|
|
45
|
+
outputBytes: number;
|
|
46
|
+
/**
|
|
47
|
+
* @param [options] Stream options
|
|
48
|
+
* @param [options.lineLength=76] Maximum length for lines, set to false to disable wrapping
|
|
49
|
+
* @param [options.binary=false] Encode every CR or LF that is not part of a CRLF pair
|
|
50
|
+
*/
|
|
51
|
+
constructor(options?: EncoderOptions);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a transform stream for decoding Quoted-Printable encoded strings.
|
|
55
|
+
* The input is not actually processed as a stream but concatted and processed as a single input,
|
|
56
|
+
* so escapes and soft line breaks split across chunks decode the same as unsplit input
|
|
57
|
+
*/
|
|
58
|
+
export declare class Decoder extends Transform {
|
|
59
|
+
options: DecoderOptions;
|
|
60
|
+
inputBytes: number;
|
|
61
|
+
outputBytes: number;
|
|
62
|
+
/**
|
|
63
|
+
* @param [options] Stream options
|
|
64
|
+
*/
|
|
65
|
+
constructor(options?: DecoderOptions);
|
|
66
|
+
}
|
|
67
|
+
declare const libqp: {
|
|
68
|
+
encode: typeof encode;
|
|
69
|
+
decode: typeof decode;
|
|
70
|
+
wrap: typeof wrap;
|
|
71
|
+
Encoder: typeof Encoder;
|
|
72
|
+
Decoder: typeof Decoder;
|
|
73
|
+
};
|
|
74
|
+
export default libqp;
|