@mavogel/awscdk-rootmail 0.1.51 → 0.1.53

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.
Files changed (63) hide show
  1. package/.jsii +10 -10
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
  5. package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +1 -1
  6. package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
  7. package/node_modules/@aws-sdk/client-route-53/package.json +1 -1
  8. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
  9. package/node_modules/@aws-sdk/client-s3/package.json +2 -2
  10. package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
  11. package/node_modules/@aws-sdk/client-ses/package.json +1 -1
  12. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
  13. package/node_modules/@aws-sdk/client-ssm/package.json +1 -1
  14. package/node_modules/@zone-eu/mailsplit/package.json +10 -5
  15. package/node_modules/libmime/CHANGELOG.md +7 -0
  16. package/node_modules/libmime/package.json +10 -6
  17. package/node_modules/libqp/CHANGELOG.md +7 -0
  18. package/node_modules/libqp/README.md +1 -1
  19. package/node_modules/libqp/dist/cjs/libqp.d.ts +8 -2
  20. package/node_modules/libqp/dist/cjs/libqp.js +159 -12
  21. package/node_modules/libqp/dist/esm/libqp.d.ts +8 -2
  22. package/node_modules/libqp/dist/esm/libqp.js +159 -12
  23. package/node_modules/libqp/lib/libqp.js +1 -1
  24. package/node_modules/libqp/package.json +14 -8
  25. package/node_modules/linkify-it/README.md +49 -86
  26. package/node_modules/linkify-it/build/index.cjs.js +636 -825
  27. package/node_modules/linkify-it/build/index.cjs.js.map +1 -0
  28. package/node_modules/linkify-it/build/index.d.ts +236 -0
  29. package/node_modules/linkify-it/build/index.mjs +538 -0
  30. package/node_modules/linkify-it/build/index.mjs.map +1 -0
  31. package/node_modules/linkify-it/package.json +23 -20
  32. package/node_modules/mailparser/CHANGELOG.md +14 -0
  33. package/node_modules/mailparser/dist/cjs/mail-parser.js +34 -14
  34. package/node_modules/mailparser/dist/esm/mail-parser.js +34 -14
  35. package/node_modules/mailparser/package.json +11 -7
  36. package/node_modules/nodemailer/CHANGELOG.md +13 -0
  37. package/node_modules/nodemailer/README.md +4 -0
  38. package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +4 -1
  39. package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
  40. package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
  41. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +3 -0
  42. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +11 -3
  43. package/node_modules/nodemailer/dist/esm/fetch/cookies.js +4 -1
  44. package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
  45. package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
  46. package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +3 -0
  47. package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +11 -3
  48. package/node_modules/nodemailer/package.json +11 -6
  49. package/node_modules/uc.micro/README.md +18 -1
  50. package/node_modules/uc.micro/build/index.cjs.js +13 -18
  51. package/node_modules/uc.micro/build/index.d.ts +6 -0
  52. package/node_modules/uc.micro/build/index.mjs +8 -0
  53. package/node_modules/uc.micro/package.json +12 -17
  54. package/package.json +11 -11
  55. package/node_modules/linkify-it/index.mjs +0 -646
  56. package/node_modules/linkify-it/lib/re.mjs +0 -193
  57. package/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
  58. package/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
  59. package/node_modules/uc.micro/categories/P/regex.mjs +0 -1
  60. package/node_modules/uc.micro/categories/S/regex.mjs +0 -1
  61. package/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
  62. package/node_modules/uc.micro/index.mjs +0 -8
  63. package/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
@@ -318,10 +318,20 @@ export class Encoder extends Transform {
318
318
  }
319
319
  }
320
320
  }
321
+ /** The size the Decoder's buffer for a pending whitespace run starts at */
322
+ const BLANKS_START = 64;
323
+ /** A whitespace run buffer up to this size is kept for the next run, a larger one is dropped */
324
+ const BLANKS_KEEP = 64 * 1024;
321
325
  /**
322
326
  * Creates a transform stream for decoding Quoted-Printable encoded strings.
323
- * The input is not actually processed as a stream but concatted and processed as a single input,
324
- * so escapes and soft line breaks split across chunks decode the same as unsplit input
327
+ *
328
+ * Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
329
+ * state machine: whitespace in front of a line break is removed, then soft line breaks, then
330
+ * escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
331
+ * of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
332
+ * line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
333
+ * breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
334
+ * byte 0xAB), and the output equals decode() of the whole input however the input is split.
325
335
  */
326
336
  export class Decoder extends Transform {
327
337
  /**
@@ -333,7 +343,14 @@ export class Decoder extends Transform {
333
343
  this.options = opts;
334
344
  this.inputBytes = 0;
335
345
  this.outputBytes = 0;
336
- this.qpChunks = [];
346
+ this._blanks = Buffer.alloc(0);
347
+ this._blankCount = 0;
348
+ this._soft = 0;
349
+ this._escape = 0;
350
+ this._escapeHigh = 0;
351
+ this._out = Buffer.alloc(0);
352
+ this._outPos = 0;
353
+ this._left = 0;
337
354
  }
338
355
  /** @internal */
339
356
  _transform(chunk, encoding, done) {
@@ -341,23 +358,153 @@ export class Decoder extends Transform {
341
358
  return done();
342
359
  }
343
360
  const buf = toBuffer(chunk, encoding);
344
- // kept as a binary string, so joining the chunks is the only copy made before decoding
345
- this.qpChunks.push(buf.toString('binary'));
346
361
  this.inputBytes += buf.length;
362
+ // all output comes from input bytes: those of this chunk and those held back before it, at
363
+ // most four bytes of a soft line break and an escape, and whitespace (room made when it is kept)
364
+ this._begin(buf.length + 4);
365
+ for (let i = 0; i < buf.length; i++) {
366
+ this._left = buf.length - i;
367
+ this._trim(buf[i]);
368
+ }
369
+ this._left = 0;
370
+ this._end();
347
371
  done();
348
372
  }
349
373
  /** @internal */
350
374
  _flush(done) {
351
- if (this.inputBytes) {
352
- const input = this.qpChunks.join('');
353
- // the chunks are not needed anymore, release them before decoding allocates more
354
- this.qpChunks = [];
355
- const buf = decode(input);
356
- this.outputBytes += buf.length;
357
- this.push(buf);
375
+ this._begin(4);
376
+ // whitespace at the end of the input is removed
377
+ this._dropBlanks();
378
+ if (this._soft === 2) {
379
+ // "=" and a CR at the end are no soft line break
380
+ this._unescape(0x3d);
381
+ this._unescape(0x0d);
382
+ }
383
+ // a "=" at the end is a soft line break and is removed
384
+ this._soft = 0;
385
+ if (this._escape >= 1) {
386
+ this._emit(0x3d);
358
387
  }
388
+ if (this._escape === 2) {
389
+ this._emit(this._escapeHigh);
390
+ }
391
+ this._escape = 0;
392
+ this._end();
359
393
  done();
360
394
  }
395
+ /** Step 1, whitespace in front of a line break @internal */
396
+ _trim(byte) {
397
+ if (byte === 0x20 || byte === 0x09) {
398
+ if (this._blankCount === this._blanks.length) {
399
+ const blanks = Buffer.allocUnsafe(Math.max(BLANKS_START, this._blanks.length * 2));
400
+ this._blanks.copy(blanks, 0, 0, this._blankCount);
401
+ this._blanks = blanks;
402
+ }
403
+ this._blanks[this._blankCount++] = byte;
404
+ return;
405
+ }
406
+ if (this._blankCount) {
407
+ if (byte !== 0x0a && byte !== 0x0d) {
408
+ // not at the end of a line: the whitespace is kept. Its first byte completes what a
409
+ // "=" in front of it started; after that no soft line break or escape is pending, and
410
+ // the rest passes through both steps unchanged
411
+ this._reserve(this._blankCount);
412
+ this._soften(this._blanks[0]);
413
+ this._outPos += this._blanks.copy(this._out, this._outPos, 1, this._blankCount);
414
+ }
415
+ this._dropBlanks();
416
+ }
417
+ this._soften(byte);
418
+ }
419
+ /** Ends the pending whitespace run, keeping a small buffer for the next one @internal */
420
+ _dropBlanks() {
421
+ this._blankCount = 0;
422
+ if (this._blanks.length > BLANKS_KEEP) {
423
+ this._blanks = Buffer.alloc(0);
424
+ }
425
+ }
426
+ /** Step 2, soft line breaks: "=" followed by LF or CR LF @internal */
427
+ _soften(byte) {
428
+ if (this._soft === 1) {
429
+ if (byte === 0x0a) {
430
+ this._soft = 0;
431
+ return;
432
+ }
433
+ if (byte === 0x0d) {
434
+ this._soft = 2;
435
+ return;
436
+ }
437
+ this._soft = 0;
438
+ this._unescape(0x3d);
439
+ }
440
+ else if (this._soft === 2) {
441
+ this._soft = 0;
442
+ if (byte === 0x0a) {
443
+ return;
444
+ }
445
+ this._unescape(0x3d);
446
+ this._unescape(0x0d);
447
+ }
448
+ if (byte === 0x3d) {
449
+ this._soft = 1;
450
+ return;
451
+ }
452
+ this._unescape(byte);
453
+ }
454
+ /** Step 3, escapes: "=" followed by two hex digits @internal */
455
+ _unescape(byte) {
456
+ if (this._escape === 1) {
457
+ if (hexValue(byte) >= 0) {
458
+ this._escape = 2;
459
+ this._escapeHigh = byte;
460
+ return;
461
+ }
462
+ this._escape = 0;
463
+ this._emit(0x3d);
464
+ }
465
+ else if (this._escape === 2) {
466
+ this._escape = 0;
467
+ const low = hexValue(byte);
468
+ if (low >= 0) {
469
+ this._emit(hexValue(this._escapeHigh) * 16 + low);
470
+ return;
471
+ }
472
+ this._emit(0x3d);
473
+ this._emit(this._escapeHigh);
474
+ }
475
+ if (byte === 0x3d) {
476
+ this._escape = 1;
477
+ return;
478
+ }
479
+ this._emit(byte);
480
+ }
481
+ /** @internal */
482
+ _begin(size) {
483
+ this._out = Buffer.allocUnsafe(size);
484
+ this._outPos = 0;
485
+ }
486
+ /** Makes room for `size` more bytes besides the rest of the current chunk @internal */
487
+ _reserve(size) {
488
+ const needed = this._outPos + size + this._left + 4;
489
+ if (needed > this._out.length) {
490
+ const out = Buffer.allocUnsafe(Math.max(this._out.length * 2, needed));
491
+ this._out.copy(out, 0, 0, this._outPos);
492
+ this._out = out;
493
+ }
494
+ }
495
+ /** @internal */
496
+ _emit(byte) {
497
+ this._out[this._outPos++] = byte;
498
+ }
499
+ /** @internal */
500
+ _end() {
501
+ if (this._outPos) {
502
+ this.outputBytes += this._outPos;
503
+ this.push(this._out.subarray(0, this._outPos));
504
+ }
505
+ this._out = Buffer.alloc(0);
506
+ this._outPos = 0;
507
+ }
361
508
  }
362
509
  const libqp = {
363
510
  encode,
@@ -2,5 +2,5 @@
2
2
 
3
3
  // The pre-TypeScript entry point. Node resolves `libqp/lib/libqp` through the exports map and
4
4
  // never loads this file, but resolvers that look for the path on disk and ignore the exports map
5
- // (webpack 4, browserify, and @yao/pkg, which warns about the import without it) still find it.
5
+ // (webpack 4, browserify, and @yao-pkg/pkg, which warns about the import without it) still find it.
6
6
  module.exports = require('../dist/cjs/libqp.js');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libqp",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Encode and decode quoted-printable strings according to rfc2045",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/libqp.js",
@@ -37,9 +37,11 @@
37
37
  "build": "node scripts/build.js",
38
38
  "typecheck": "tsc -p tsconfig.json",
39
39
  "pretest": "npm run build",
40
- "test": "node --import tsx --test $(find test -name '*-test.ts')",
40
+ "test": "node --import tsx --test --test-concurrency=1 $(find test -name '*-test.ts')",
41
41
  "pretest:coverage": "npm run build",
42
- "test:coverage": "c8 node --import tsx --test $(find test -name '*-test.ts')",
42
+ "test:coverage": "c8 node --import tsx --test --test-concurrency=1 $(find test -name '*-test.ts')",
43
+ "pretest:cjs": "npm run build",
44
+ "test:cjs": "NODE_OPTIONS=--no-experimental-require-module node test/cjs-smoke.cjs",
43
45
  "pretest:bun": "npm run build",
44
46
  "test:bun": "bun test --timeout 60000 $(find ./test -name '*-test.ts')",
45
47
  "format": "prettier --write \"**/*.{js,cjs,ts,json,md,yml,yaml}\"",
@@ -49,7 +51,7 @@
49
51
  "prepare": "npm run build",
50
52
  "update": "rm -rf node_modules package-lock.json && ncu -u && npm install",
51
53
  "test:mutation": "node scripts/mutation-test.js",
52
- "test:fuzz": "FUZZ_ITERATIONS=${FUZZ_ITERATIONS:-20000} FUZZ_SEED=${FUZZ_SEED:-random} node --import tsx --test test/property-test.ts test/legacy-test.ts"
54
+ "test:fuzz": "FUZZ_ITERATIONS=${FUZZ_ITERATIONS:-20000} FUZZ_SEED=${FUZZ_SEED:-random} node --import tsx --test --test-concurrency=1 test/property-test.ts test/legacy-test.ts"
53
55
  },
54
56
  "repository": {
55
57
  "type": "git",
@@ -68,17 +70,21 @@
68
70
  "devDependencies": {
69
71
  "@types/node": "20.19.43",
70
72
  "c8": "12.0.0",
71
- "eslint": "10.13.0",
73
+ "eslint": "10.15.0",
72
74
  "eslint-config-prettier": "10.1.8",
73
75
  "fast-check": "4.10.2",
74
- "globals": "17.13.0",
76
+ "globals": "17.14.0",
75
77
  "libqp-legacy": "npm:libqp@2.1.3",
76
- "prettier": "3.9.10",
78
+ "prettier": "3.10.1",
77
79
  "tsx": "4.23.15",
78
80
  "typescript": "6.0.3",
79
- "typescript-eslint": "8.71.2"
81
+ "typescript-eslint": "8.72.2"
80
82
  },
81
83
  "engines": {
82
84
  "node": ">=20.0.0"
85
+ },
86
+ "overrides": {
87
+ "glob": "14.0.6",
88
+ "minimatch": "11.0.8"
83
89
  }
84
90
  }
@@ -24,65 +24,39 @@ Install
24
24
  npm install linkify-it --save
25
25
  ```
26
26
 
27
- Browserification is also supported.
28
-
29
27
 
30
28
  Usage examples
31
29
  --------------
32
30
 
33
- ##### Example 1
34
-
35
31
  ```js
36
- import linkifyit from 'linkify-it';
37
- const linkify = linkifyit();
32
+ import { LinkifyIt } from 'linkify-it';
33
+ const linkify = new LinkifyIt({ fuzzyLink: true });
38
34
 
39
- // Reload full tlds list & add unofficial `.onion` domain.
40
35
  linkify
41
- .tlds(require('tlds')) // Reload with full tlds list
42
- .tlds('onion', true) // Add unofficial `.onion` domain
43
- .add('git:', 'http:') // Add `git:` protocol as "alias"
44
- .add('ftp:', null) // Disable `ftp:` protocol
45
- .set({ fuzzyIP: true }); // Enable IPs in fuzzy links (without schema)
46
-
47
- console.log(linkify.test('Site github.com!')); // true
48
-
49
- console.log(linkify.match('Site github.com!')); // [ {
50
- // schema: "",
51
- // index: 5,
52
- // lastIndex: 15,
53
- // raw: "github.com",
54
- // text: "github.com",
55
- // url: "http://github.com",
56
- // } ]
36
+ .tlds(require('tlds'))
37
+ .tlds('onion', true)
38
+ .add('ftp:', null)
39
+ .set({ fuzzyIP: true });
40
+
41
+ console.log(linkify.test('Site github.com!'));
42
+ // true
43
+
44
+ console.log(linkify.match('Site github.com!'));
45
+ // [ {
46
+ // schema: "",
47
+ // index: 5,
48
+ // lastIndex: 15,
49
+ // raw: "github.com",
50
+ // text: "github.com",
51
+ // url: "http://github.com",
52
+ // } ]
57
53
  ```
58
54
 
59
- ##### Example 2. Add twitter mentions handler
55
+ See more in examples folder:
60
56
 
61
- ```js
62
- linkify.add('@', {
63
- validate: function (text, pos, self) {
64
- const tail = text.slice(pos);
65
-
66
- if (!self.re.twitter) {
67
- self.re.twitter = new RegExp(
68
- `^([a-zA-Z0-9_]){1,15}(?!_)(?=$|${self.re.src_ZPCc})`
69
- );
70
- }
71
- if (self.re.twitter.test(tail)) {
72
- // Linkifier allows punctuation chars before prefix,
73
- // but we additionally disable `@` ("@@mention" is invalid)
74
- if (pos >= 2 && tail[pos - 2] === '@') {
75
- return false;
76
- }
77
- return tail.match(self.re.twitter)[0].length;
78
- }
79
- return 0;
80
- },
81
- normalize: function (match) {
82
- match.url = `https://twitter.com/${match.url.replace(/^@/, '')}`;
83
- }
84
- });
85
- ```
57
+ - [twitter mentions](examples/twitter.mjs)
58
+ - [CJK paired brackets in URL paths](examples/cjk-paired-brackets.mjs)
59
+ - [increased nested scopes depth](examples/nested-scopes-depth.mjs)
86
60
 
87
61
 
88
62
  API
@@ -90,39 +64,28 @@ API
90
64
 
91
65
  __[API documentation](http://markdown-it.github.io/linkify-it/doc)__
92
66
 
93
- ### new LinkifyIt(schemas, options)
67
+ ### new LinkifyIt(options)
94
68
 
95
- Creates new linkifier instance with optional additional schemas.
96
- Can be called without `new` keyword for convenience.
69
+ Creates new linkifier instance.
97
70
 
98
71
  By default understands:
99
72
 
100
73
  - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
101
- - "fuzzy" links and emails (google.com, foo@bar.com).
102
-
103
- `schemas` is an object, where each key/value describes protocol/rule:
104
-
105
- - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
106
- for example). `linkify-it` makes sure that prefix is not preceded with
107
- alphanumeric char.
108
- - __value__ - rule to check tail after link prefix
109
- - _String_ - just alias to existing rule
110
- - _Object_
111
- - _validate_ - either a `RegExp` (start with `^`, and don't include the
112
- link prefix itself), or a validator function which, given arguments
113
- _text_, _pos_, and _self_, returns the length of a match in _text_
114
- starting at index _pos_. _pos_ is the index right after the link prefix.
115
- _self_ can be used to access the linkify object to cache data.
116
- - _normalize_ - optional function to normalize text & url of matched result
117
- (for example, for twitter mentions).
74
+ - "fuzzy" emails (foo@bar.com).
118
75
 
119
76
  `options`:
120
77
 
121
- - __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `true`.
78
+ - __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `false`.
122
79
  - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
123
80
  like version numbers. Default `false`.
124
81
  - __fuzzyEmail__ - recognize emails without `mailto:` prefix. Default `true`.
82
+ - __tlds__ - allowed TLDs list for fuzzy links. Replaces the default list
83
+ when set.
125
84
  - __---__ - set `true` to terminate link with `---` (if it's considered as long dash).
85
+ Default `false`.
86
+ - __rebuilder__ - custom `REBuilder` instance for patched regex fragments.
87
+ - __urlAuth__ - recognize authentication data in URLs. Default `false`.
88
+ - __maxLength__ - maximum link length. Default `10000`.
126
89
 
127
90
 
128
91
  ### .test(text)
@@ -130,13 +93,6 @@ By default understands:
130
93
  Searches linkifiable pattern and returns `true` on success or `false` on fail.
131
94
 
132
95
 
133
- ### .pretest(text)
134
-
135
- Quick check if link MAY BE can exist. Can be used to optimize more expensive
136
- `.test()` calls. Return `false` if link can not be found, `true` - if `.test()`
137
- call needed to know exactly.
138
-
139
-
140
96
  ### .testSchemaAt(text, name, offset)
141
97
 
142
98
  Similar to `.test()` but checks only specific protocol tail exactly at given
@@ -178,18 +134,25 @@ If that's not enough, you can reload defaults with more detailed zones list.
178
134
 
179
135
  ### .add(key, value)
180
136
 
181
- Add a new schema to the schemas object. As described in the constructor
182
- definition, `key` is a link prefix (`skype:`, for example), and `value`
183
- is a String to alias to another schema, or an Object with `validate` and
184
- optionally `normalize` definitions. To disable an existing rule, use
185
- `.add(key, null)`.
137
+ Add a new schema to the schemas object.
186
138
 
139
+ `key` is a link prefix (usually, protocol name with `:` at the end, `skype:`
140
+ for example). `linkify-it` makes sure that prefix is not preceded with
141
+ alphanumeric char.
187
142
 
188
- ### .set(options)
143
+ `value` is a rule to check tail after link prefix:
189
144
 
190
- Override default options. Missed properties will not be changed.
145
+ - _Object_
146
+ - _validate_ - validator function which, given arguments _text_, _pos_, and
147
+ _self_, returns the length of a match in _text_ starting at index _pos_.
148
+ _pos_ is the index right after the link prefix. _self_ can be used to
149
+ access the linkify object to cache data.
150
+ - _normalize_ - optional function to normalize text & url of matched result
151
+ (for example, for twitter mentions).
191
152
 
153
+ To disable an existing rule, use `.add(key, null)`.
192
154
 
193
- ## License
194
155
 
195
- [MIT](https://github.com/markdown-it/linkify-it/blob/master/LICENSE)
156
+ ### .set(options)
157
+
158
+ Override default options. Missed properties will not be changed.