@nocobase/plugin-workflow-mailer 2.2.20 → 2.2.21

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 (173) hide show
  1. package/dist/externalVersion.js +6 -6
  2. package/dist/node_modules/joi/package.json +1 -1
  3. package/dist/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +59 -0
  4. package/dist/node_modules/nodemailer/dist/cjs/addressparser/index.js +790 -0
  5. package/dist/node_modules/nodemailer/dist/cjs/base64/index.d.ts +36 -0
  6. package/dist/node_modules/nodemailer/dist/cjs/base64/index.js +119 -0
  7. package/dist/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +52 -0
  8. package/dist/node_modules/nodemailer/dist/cjs/dkim/index.js +228 -0
  9. package/dist/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +48 -0
  10. package/dist/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +180 -0
  11. package/dist/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +36 -0
  12. package/dist/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +148 -0
  13. package/dist/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +52 -0
  14. package/dist/node_modules/nodemailer/dist/cjs/dkim/sign.js +165 -0
  15. package/dist/node_modules/nodemailer/dist/cjs/errors.d.ts +96 -0
  16. package/dist/node_modules/nodemailer/dist/cjs/errors.js +70 -0
  17. package/dist/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +107 -0
  18. package/dist/node_modules/nodemailer/dist/cjs/fetch/cookies.js +282 -0
  19. package/dist/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +65 -0
  20. package/dist/node_modules/nodemailer/dist/cjs/fetch/index.js +384 -0
  21. package/dist/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +64 -0
  22. package/dist/node_modules/nodemailer/dist/cjs/json-transport/index.js +99 -0
  23. package/dist/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +174 -0
  24. package/dist/node_modules/nodemailer/dist/cjs/mail-composer/index.js +613 -0
  25. package/dist/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +237 -0
  26. package/dist/node_modules/nodemailer/dist/cjs/mailer/index.js +415 -0
  27. package/dist/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +97 -0
  28. package/dist/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +342 -0
  29. package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +161 -0
  30. package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +787 -0
  31. package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/mime-types.d.ts +2 -0
  32. package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/mime-types.js +2103 -0
  33. package/dist/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +333 -0
  34. package/dist/node_modules/nodemailer/dist/cjs/mime-node/index.js +1493 -0
  35. package/dist/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +5 -0
  36. package/dist/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +32 -0
  37. package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +9 -0
  38. package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +40 -0
  39. package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +10 -0
  40. package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +47 -0
  41. package/dist/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +124 -0
  42. package/dist/node_modules/nodemailer/dist/cjs/nodemailer.js +1 -0
  43. package/dist/node_modules/nodemailer/dist/cjs/package-info.d.ts +3 -0
  44. package/dist/node_modules/nodemailer/dist/cjs/package-info.js +7 -0
  45. package/dist/node_modules/nodemailer/dist/cjs/package.json +3 -0
  46. package/dist/node_modules/nodemailer/dist/cjs/punycode/index.d.ts +73 -0
  47. package/dist/node_modules/nodemailer/{lib → dist/cjs}/punycode/index.js +62 -111
  48. package/dist/node_modules/nodemailer/dist/cjs/qp/index.d.ts +32 -0
  49. package/dist/node_modules/nodemailer/dist/cjs/qp/index.js +207 -0
  50. package/dist/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +69 -0
  51. package/dist/node_modules/nodemailer/dist/cjs/sendmail-transport/index.js +210 -0
  52. package/dist/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +112 -0
  53. package/dist/node_modules/nodemailer/dist/cjs/ses-transport/index.js +252 -0
  54. package/dist/node_modules/nodemailer/dist/cjs/shared/index.d.ts +260 -0
  55. package/dist/node_modules/nodemailer/dist/cjs/shared/index.js +680 -0
  56. package/dist/node_modules/nodemailer/dist/cjs/shared/objects.d.ts +23 -0
  57. package/dist/node_modules/nodemailer/dist/cjs/shared/objects.js +43 -0
  58. package/dist/node_modules/nodemailer/dist/cjs/shared/url.d.ts +21 -0
  59. package/dist/node_modules/nodemailer/dist/cjs/shared/url.js +255 -0
  60. package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +15 -0
  61. package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +108 -0
  62. package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +47 -0
  63. package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.js +189 -0
  64. package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +416 -0
  65. package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +1837 -0
  66. package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +133 -0
  67. package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +569 -0
  68. package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +62 -0
  69. package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.js +257 -0
  70. package/dist/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +156 -0
  71. package/dist/node_modules/nodemailer/dist/cjs/smtp-transport/index.js +371 -0
  72. package/dist/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +65 -0
  73. package/dist/node_modules/nodemailer/dist/cjs/stream-transport/index.js +146 -0
  74. package/dist/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +35 -0
  75. package/dist/node_modules/nodemailer/dist/cjs/well-known/index.js +41 -0
  76. package/dist/node_modules/nodemailer/dist/cjs/well-known/services.d.ts +2 -0
  77. package/dist/node_modules/nodemailer/dist/cjs/well-known/services.js +674 -0
  78. package/dist/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +201 -0
  79. package/dist/node_modules/nodemailer/dist/cjs/xoauth2/index.js +426 -0
  80. package/dist/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +59 -0
  81. package/dist/node_modules/nodemailer/{lib → dist/esm}/addressparser/index.js +361 -131
  82. package/dist/node_modules/nodemailer/dist/esm/base64/index.d.ts +36 -0
  83. package/dist/node_modules/nodemailer/{lib → dist/esm}/base64/index.js +31 -56
  84. package/dist/node_modules/nodemailer/dist/esm/dkim/index.d.ts +52 -0
  85. package/dist/node_modules/nodemailer/{lib → dist/esm}/dkim/index.js +49 -78
  86. package/dist/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +48 -0
  87. package/dist/node_modules/nodemailer/{lib → dist/esm}/dkim/message-parser.js +64 -42
  88. package/dist/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +36 -0
  89. package/dist/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +141 -0
  90. package/dist/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +52 -0
  91. package/dist/node_modules/nodemailer/{lib → dist/esm}/dkim/sign.js +50 -46
  92. package/dist/node_modules/nodemailer/dist/esm/errors.d.ts +96 -0
  93. package/dist/node_modules/nodemailer/{lib → dist/esm}/errors.js +26 -18
  94. package/dist/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +107 -0
  95. package/dist/node_modules/nodemailer/dist/esm/fetch/cookies.js +242 -0
  96. package/dist/node_modules/nodemailer/dist/esm/fetch/index.d.ts +65 -0
  97. package/dist/node_modules/nodemailer/{lib → dist/esm}/fetch/index.js +80 -147
  98. package/dist/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +64 -0
  99. package/dist/node_modules/nodemailer/{lib → dist/esm}/json-transport/index.js +19 -39
  100. package/dist/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +174 -0
  101. package/dist/node_modules/nodemailer/{lib → dist/esm}/mail-composer/index.js +199 -265
  102. package/dist/node_modules/nodemailer/dist/esm/mailer/index.d.ts +237 -0
  103. package/dist/node_modules/nodemailer/{lib → dist/esm}/mailer/index.js +128 -234
  104. package/dist/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +97 -0
  105. package/dist/node_modules/nodemailer/{lib → dist/esm}/mailer/mail-message.js +62 -114
  106. package/dist/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +161 -0
  107. package/dist/node_modules/nodemailer/dist/esm/mime-funcs/index.js +738 -0
  108. package/dist/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.d.ts +2 -0
  109. package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-funcs/mime-types.js +29 -42
  110. package/dist/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +333 -0
  111. package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/index.js +259 -372
  112. package/dist/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +5 -0
  113. package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/last-newline.js +4 -10
  114. package/dist/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +9 -0
  115. package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/le-unix.js +6 -11
  116. package/dist/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +10 -0
  117. package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/le-windows.js +6 -13
  118. package/dist/node_modules/nodemailer/dist/esm/nodemailer.d.ts +124 -0
  119. package/dist/node_modules/nodemailer/dist/esm/nodemailer.js +166 -0
  120. package/dist/node_modules/nodemailer/dist/esm/package-info.d.ts +3 -0
  121. package/dist/node_modules/nodemailer/dist/esm/package-info.js +4 -0
  122. package/dist/node_modules/nodemailer/dist/esm/package.json +3 -0
  123. package/dist/node_modules/nodemailer/dist/esm/punycode/index.d.ts +73 -0
  124. package/dist/node_modules/nodemailer/dist/esm/punycode/index.js +405 -0
  125. package/dist/node_modules/nodemailer/dist/esm/qp/index.d.ts +32 -0
  126. package/dist/node_modules/nodemailer/{lib → dist/esm}/qp/index.js +38 -67
  127. package/dist/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +69 -0
  128. package/dist/node_modules/nodemailer/{lib → dist/esm}/sendmail-transport/index.js +51 -101
  129. package/dist/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +112 -0
  130. package/dist/node_modules/nodemailer/dist/esm/ses-transport/index.js +212 -0
  131. package/dist/node_modules/nodemailer/dist/esm/shared/index.d.ts +260 -0
  132. package/dist/node_modules/nodemailer/{lib → dist/esm}/shared/index.js +156 -272
  133. package/dist/node_modules/nodemailer/dist/esm/shared/objects.d.ts +23 -0
  134. package/dist/node_modules/nodemailer/{lib → dist/esm}/shared/objects.js +13 -17
  135. package/dist/node_modules/nodemailer/dist/esm/shared/url.d.ts +21 -0
  136. package/dist/node_modules/nodemailer/dist/esm/shared/url.js +214 -0
  137. package/dist/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +15 -0
  138. package/dist/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +103 -0
  139. package/dist/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +47 -0
  140. package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-connection/http-proxy-client.js +49 -74
  141. package/dist/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +416 -0
  142. package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-connection/index.js +574 -794
  143. package/dist/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +133 -0
  144. package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-pool/index.js +172 -284
  145. package/dist/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +62 -0
  146. package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-pool/pool-resource.js +57 -97
  147. package/dist/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +156 -0
  148. package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-transport/index.js +81 -179
  149. package/dist/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +65 -0
  150. package/dist/node_modules/nodemailer/{lib → dist/esm}/stream-transport/index.js +36 -74
  151. package/dist/node_modules/nodemailer/dist/esm/well-known/index.d.ts +35 -0
  152. package/dist/node_modules/nodemailer/{lib → dist/esm}/well-known/index.js +5 -16
  153. package/dist/node_modules/nodemailer/dist/esm/well-known/services.d.ts +2 -0
  154. package/dist/node_modules/nodemailer/dist/esm/well-known/services.js +671 -0
  155. package/dist/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +201 -0
  156. package/dist/node_modules/nodemailer/{lib → dist/esm}/xoauth2/index.js +125 -187
  157. package/dist/node_modules/nodemailer/{lib → dist}/well-known/services.json +9 -2
  158. package/dist/node_modules/nodemailer/package.json +1 -1
  159. package/package.json +3 -3
  160. package/dist/node_modules/nodemailer/.gitattributes +0 -6
  161. package/dist/node_modules/nodemailer/.ncurc.js +0 -9
  162. package/dist/node_modules/nodemailer/.prettierignore +0 -8
  163. package/dist/node_modules/nodemailer/.prettierrc +0 -12
  164. package/dist/node_modules/nodemailer/.prettierrc.js +0 -10
  165. package/dist/node_modules/nodemailer/.release-please-config.json +0 -9
  166. package/dist/node_modules/nodemailer/eslint.config.js +0 -88
  167. package/dist/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  168. package/dist/node_modules/nodemailer/lib/fetch/cookies.js +0 -276
  169. package/dist/node_modules/nodemailer/lib/mime-funcs/index.js +0 -671
  170. package/dist/node_modules/nodemailer/lib/nodemailer.js +0 -1
  171. package/dist/node_modules/nodemailer/lib/ses-transport/index.js +0 -266
  172. package/dist/node_modules/nodemailer/lib/shared/url.js +0 -151
  173. package/dist/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -105
@@ -0,0 +1,3 @@
1
+ export declare const name = "nodemailer";
2
+ export declare const version = "10.0.14";
3
+ export declare const homepage = "https://nodemailer.com/";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Generated by scripts/build.js from package.json. Do not edit by hand.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.homepage = exports.version = exports.name = void 0;
5
+ exports.name = 'nodemailer';
6
+ exports.version = '10.0.14';
7
+ exports.homepage = 'https://nodemailer.com/';
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Creates an array containing the numeric code points of each Unicode
3
+ * character in the string. While JavaScript uses UCS-2 internally,
4
+ * this function will convert a pair of surrogate halves (each of which
5
+ * UCS-2 exposes as separate characters) into a single code point,
6
+ * matching UTF-16.
7
+ * @see `punycode.ucs2.encode`
8
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
9
+ * @memberOf punycode.ucs2
10
+ * @name decode
11
+ * @param string The Unicode input string (UCS-2).
12
+ * @returns The new array of code points.
13
+ */
14
+ declare function ucs2decode(string: string): number[];
15
+ /**
16
+ * Converts a Punycode string of ASCII-only symbols to a string of Unicode
17
+ * symbols.
18
+ * @memberOf punycode
19
+ * @param input The Punycode string of ASCII-only symbols.
20
+ * @returns The resulting string of Unicode symbols.
21
+ */
22
+ declare const decode: (input: string) => string;
23
+ /**
24
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
25
+ * Punycode string of ASCII-only symbols.
26
+ * @memberOf punycode
27
+ * @param input The string of Unicode symbols.
28
+ * @returns The resulting Punycode string of ASCII-only symbols.
29
+ */
30
+ declare const encode: (input: string) => string;
31
+ /**
32
+ * Converts a Punycode string representing a domain name or an email address
33
+ * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
34
+ * it doesn't matter if you call it on a string that has already been
35
+ * converted to Unicode.
36
+ * @memberOf punycode
37
+ * @param input The Punycoded domain name or email address to
38
+ * convert to Unicode.
39
+ * @returns The Unicode representation of the given Punycode
40
+ * string.
41
+ */
42
+ declare const toUnicode: (input: string) => string;
43
+ /**
44
+ * Converts a Unicode string representing a domain name or an email address to
45
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
46
+ * i.e. it doesn't matter if you call it with a domain that's already in
47
+ * ASCII.
48
+ * @memberOf punycode
49
+ * @param input The domain name or email address to convert, as a
50
+ * Unicode string.
51
+ * @returns The Punycode representation of the given domain name or
52
+ * email address.
53
+ */
54
+ declare const toASCII: (input: string) => string;
55
+ /** Define the public API */
56
+ /**
57
+ * A string representing the current Punycode.js version number.
58
+ * @memberOf punycode
59
+ * @type String
60
+ */
61
+ export declare const version = "2.3.1";
62
+ /**
63
+ * An object of methods to convert from JavaScript's internal character
64
+ * representation (UCS-2) to Unicode code points, and back.
65
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
66
+ * @memberOf punycode
67
+ * @type Object
68
+ */
69
+ export declare const ucs2: {
70
+ decode: typeof ucs2decode;
71
+ encode: (codePoints: number[]) => string;
72
+ };
73
+ export { decode, encode, toASCII, toUnicode };
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /*
2
3
 
3
4
  Copied from https://github.com/mathiasbynens/punycode.js/blob/ef3505c8abb5143a00d53ce59077c9f7f4b2ac47/punycode.js
@@ -24,13 +25,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
25
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26
 
26
27
  */
27
- /* eslint callback-return: 0, no-bitwise: 0, eqeqeq: 0, prefer-arrow-callback: 0, object-shorthand: 0 */
28
-
29
- 'use strict';
30
-
28
+ /* eslint callback-return: 0, no-bitwise: 0, eqeqeq: 0, prefer-arrow-callback: 0 */
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.toUnicode = exports.toASCII = exports.encode = exports.decode = exports.ucs2 = exports.version = void 0;
31
31
  /** Highest positive signed 32-bit float value */
32
32
  const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
33
-
34
33
  /** Bootstring parameters */
35
34
  const base = 36;
36
35
  const tMin = 1;
@@ -40,43 +39,37 @@ const damp = 700;
40
39
  const initialBias = 72;
41
40
  const initialN = 128; // 0x80
42
41
  const delimiter = '-'; // '\x2D'
43
-
44
42
  /** Regular expressions */
45
43
  const regexPunycode = /^xn--/;
46
44
  const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
47
45
  const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
48
-
49
46
  /** Error messages */
50
47
  const errors = {
51
48
  overflow: 'Overflow: input needs wider integers to process',
52
49
  'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
53
50
  'invalid-input': 'Invalid input'
54
51
  };
55
-
56
52
  /** Convenience shortcuts */
57
53
  const baseMinusTMin = base - tMin;
58
54
  const floor = Math.floor;
59
55
  const stringFromCharCode = String.fromCharCode;
60
-
61
56
  /*--------------------------------------------------------------------------*/
62
-
63
57
  /**
64
58
  * A generic error utility function.
65
59
  * @private
66
- * @param {String} type The error type.
67
- * @returns {Error} Throws a `RangeError` with the applicable error message.
60
+ * @param type The error type.
61
+ * @returns Throws a `RangeError` with the applicable error message.
68
62
  */
69
63
  function error(type) {
70
64
  throw new RangeError(errors[type]);
71
65
  }
72
-
73
66
  /**
74
67
  * A generic `Array#map` utility function.
75
68
  * @private
76
- * @param {Array} array The array to iterate over.
77
- * @param {Function} callback The function that gets called for every array
69
+ * @param array The array to iterate over.
70
+ * @param callback The function that gets called for every array
78
71
  * item.
79
- * @returns {Array} A new array of values returned by the callback function.
72
+ * @returns A new array of values returned by the callback function.
80
73
  */
81
74
  function map(array, callback) {
82
75
  const result = [];
@@ -86,15 +79,14 @@ function map(array, callback) {
86
79
  }
87
80
  return result;
88
81
  }
89
-
90
82
  /**
91
83
  * A simple `Array#map`-like wrapper to work with domain name strings or email
92
84
  * addresses.
93
85
  * @private
94
- * @param {String} domain The domain name or email address.
95
- * @param {Function} callback The function that gets called for every
86
+ * @param domain The domain name or email address.
87
+ * @param callback The function that gets called for every
96
88
  * character.
97
- * @returns {String} A new string of characters returned by the callback
89
+ * @returns A new string of characters returned by the callback
98
90
  * function.
99
91
  */
100
92
  function mapDomain(domain, callback) {
@@ -112,7 +104,6 @@ function mapDomain(domain, callback) {
112
104
  const encoded = map(labels, callback).join('.');
113
105
  return result + encoded;
114
106
  }
115
-
116
107
  /**
117
108
  * Creates an array containing the numeric code points of each Unicode
118
109
  * character in the string. While JavaScript uses UCS-2 internally,
@@ -123,8 +114,8 @@ function mapDomain(domain, callback) {
123
114
  * @see <https://mathiasbynens.be/notes/javascript-encoding>
124
115
  * @memberOf punycode.ucs2
125
116
  * @name decode
126
- * @param {String} string The Unicode input string (UCS-2).
127
- * @returns {Array} The new array of code points.
117
+ * @param string The Unicode input string (UCS-2).
118
+ * @returns The new array of code points.
128
119
  */
129
120
  function ucs2decode(string) {
130
121
  const output = [];
@@ -138,35 +129,35 @@ function ucs2decode(string) {
138
129
  if ((extra & 0xfc00) == 0xdc00) {
139
130
  // Low surrogate.
140
131
  output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
141
- } else {
132
+ }
133
+ else {
142
134
  // It's an unmatched surrogate; only append this code unit, in case the
143
135
  // next code unit is the high surrogate of a surrogate pair.
144
136
  output.push(value);
145
137
  counter--;
146
138
  }
147
- } else {
139
+ }
140
+ else {
148
141
  output.push(value);
149
142
  }
150
143
  }
151
144
  return output;
152
145
  }
153
-
154
146
  /**
155
147
  * Creates a string based on an array of numeric code points.
156
148
  * @see `punycode.ucs2.decode`
157
149
  * @memberOf punycode.ucs2
158
150
  * @name encode
159
- * @param {Array} codePoints The array of numeric code points.
160
- * @returns {String} The new Unicode string (UCS-2).
151
+ * @param codePoints The array of numeric code points.
152
+ * @returns The new Unicode string (UCS-2).
161
153
  */
162
- const ucs2encode = codePoints => String.fromCodePoint(...codePoints);
163
-
154
+ const ucs2encode = (codePoints) => String.fromCodePoint(...codePoints);
164
155
  /**
165
156
  * Converts a basic code point into a digit/integer.
166
157
  * @see `digitToBasic()`
167
158
  * @private
168
- * @param {Number} codePoint The basic numeric code point value.
169
- * @returns {Number} The numeric value of a basic code point (for use in
159
+ * @param codePoint The basic numeric code point value.
160
+ * @returns The numeric value of a basic code point (for use in
170
161
  * representing integers) in the range `0` to `base - 1`, or `base` if
171
162
  * the code point does not represent a value.
172
163
  */
@@ -182,13 +173,13 @@ const basicToDigit = function (codePoint) {
182
173
  }
183
174
  return base;
184
175
  };
185
-
186
176
  /**
187
177
  * Converts a digit/integer into a basic code point.
188
178
  * @see `basicToDigit()`
189
179
  * @private
190
- * @param {Number} digit The numeric value of a basic code point.
191
- * @returns {Number} The basic code point whose value (when used for
180
+ * @param digit The numeric value of a basic code point.
181
+ * @param flag Non-zero to use the uppercase form of the code point.
182
+ * @returns The basic code point whose value (when used for
192
183
  * representing integers) is `digit`, which needs to be in the range
193
184
  * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
194
185
  * used; else, the lowercase form is used. The behavior is undefined
@@ -197,9 +188,8 @@ const basicToDigit = function (codePoint) {
197
188
  const digitToBasic = function (digit, flag) {
198
189
  // 0..25 map to ASCII a..z or A..Z
199
190
  // 26..35 map to ASCII 0..9
200
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
191
+ return digit + 22 + 75 * Number(digit < 26) - (Number(flag != 0) << 5);
201
192
  };
202
-
203
193
  /**
204
194
  * Bias adaptation function as per section 3.4 of RFC 3492.
205
195
  * https://tools.ietf.org/html/rfc3492#section-3.4
@@ -214,13 +204,12 @@ const adapt = function (delta, numPoints, firstTime) {
214
204
  }
215
205
  return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew));
216
206
  };
217
-
218
207
  /**
219
208
  * Converts a Punycode string of ASCII-only symbols to a string of Unicode
220
209
  * symbols.
221
210
  * @memberOf punycode
222
- * @param {String} input The Punycode string of ASCII-only symbols.
223
- * @returns {String} The resulting string of Unicode symbols.
211
+ * @param input The Punycode string of ASCII-only symbols.
212
+ * @returns The resulting string of Unicode symbols.
224
213
  */
225
214
  const decode = function (input) {
226
215
  // Don't use UCS-2.
@@ -229,16 +218,13 @@ const decode = function (input) {
229
218
  let i = 0;
230
219
  let n = initialN;
231
220
  let bias = initialBias;
232
-
233
221
  // Handle the basic code points: let `basic` be the number of input code
234
222
  // points before the last delimiter, or `0` if there is none, then copy
235
223
  // the first basic code points to the output.
236
-
237
224
  let basic = input.lastIndexOf(delimiter);
238
225
  if (basic < 0) {
239
226
  basic = 0;
240
227
  }
241
-
242
228
  for (let j = 0; j < basic; ++j) {
243
229
  // if it's not a basic code point
244
230
  if (input.charCodeAt(j) >= 0x80) {
@@ -246,10 +232,8 @@ const decode = function (input) {
246
232
  }
247
233
  output.push(input.charCodeAt(j));
248
234
  }
249
-
250
235
  // Main decoding loop: start just after the last delimiter if any basic code
251
236
  // points were copied; start at the beginning otherwise.
252
-
253
237
  for (let index = basic > 0 ? basic + 1 : 0; index < inputLength /* no final expression */;) {
254
238
  // `index` is the index of the next character to be consumed.
255
239
  // Decode a generalized variable-length integer into `delta`,
@@ -257,122 +241,100 @@ const decode = function (input) {
257
241
  // if we increase `i` as we go, then subtract off its starting
258
242
  // value at the end to obtain `delta`.
259
243
  const oldi = i;
260
- for (let w = 1, k = base /* no condition */; ; k += base) {
244
+ for (let w = 1, k = base /* no condition */;; k += base) {
261
245
  if (index >= inputLength) {
262
246
  error('invalid-input');
263
247
  }
264
-
265
248
  const digit = basicToDigit(input.charCodeAt(index++));
266
-
267
249
  if (digit >= base) {
268
250
  error('invalid-input');
269
251
  }
270
252
  if (digit > floor((maxInt - i) / w)) {
271
253
  error('overflow');
272
254
  }
273
-
274
255
  i += digit * w;
275
256
  const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
276
-
277
257
  if (digit < t) {
278
258
  break;
279
259
  }
280
-
281
260
  const baseMinusT = base - t;
282
261
  if (w > floor(maxInt / baseMinusT)) {
283
262
  error('overflow');
284
263
  }
285
-
286
264
  w *= baseMinusT;
287
265
  }
288
-
289
266
  const out = output.length + 1;
290
267
  bias = adapt(i - oldi, out, oldi == 0);
291
-
292
268
  // `i` was supposed to wrap around from `out` to `0`,
293
269
  // incrementing `n` each time, so we'll fix that now:
294
270
  if (floor(i / out) > maxInt - n) {
295
271
  error('overflow');
296
272
  }
297
-
298
273
  n += floor(i / out);
299
274
  i %= out;
300
-
301
275
  // Insert `n` at position `i` of the output.
302
276
  output.splice(i++, 0, n);
303
277
  }
304
-
305
278
  return String.fromCodePoint(...output);
306
279
  };
307
-
280
+ exports.decode = decode;
308
281
  /**
309
282
  * Converts a string of Unicode symbols (e.g. a domain name label) to a
310
283
  * Punycode string of ASCII-only symbols.
311
284
  * @memberOf punycode
312
- * @param {String} input The string of Unicode symbols.
313
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
285
+ * @param input The string of Unicode symbols.
286
+ * @returns The resulting Punycode string of ASCII-only symbols.
314
287
  */
315
288
  const encode = function (input) {
316
289
  const output = [];
317
-
318
290
  // Convert the input in UCS-2 to an array of Unicode code points.
319
- input = ucs2decode(input);
320
-
291
+ const codePoints = ucs2decode(input);
321
292
  // Cache the length.
322
- const inputLength = input.length;
323
-
293
+ const inputLength = codePoints.length;
324
294
  // Initialize the state.
325
295
  let n = initialN;
326
296
  let delta = 0;
327
297
  let bias = initialBias;
328
-
329
298
  // Handle the basic code points.
330
- for (const currentValue of input) {
299
+ for (const currentValue of codePoints) {
331
300
  if (currentValue < 0x80) {
332
301
  output.push(stringFromCharCode(currentValue));
333
302
  }
334
303
  }
335
-
336
304
  const basicLength = output.length;
337
305
  let handledCPCount = basicLength;
338
-
339
306
  // `handledCPCount` is the number of code points that have been handled;
340
307
  // `basicLength` is the number of basic code points.
341
-
342
308
  // Finish the basic string with a delimiter unless it's empty.
343
309
  if (basicLength) {
344
310
  output.push(delimiter);
345
311
  }
346
-
347
312
  // Main encoding loop:
348
313
  while (handledCPCount < inputLength) {
349
314
  // All non-basic code points < n have been handled already. Find the next
350
315
  // larger one:
351
316
  let m = maxInt;
352
- for (const currentValue of input) {
317
+ for (const currentValue of codePoints) {
353
318
  if (currentValue >= n && currentValue < m) {
354
319
  m = currentValue;
355
320
  }
356
321
  }
357
-
358
322
  // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
359
323
  // but guard against overflow.
360
324
  const handledCPCountPlusOne = handledCPCount + 1;
361
325
  if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
362
326
  error('overflow');
363
327
  }
364
-
365
328
  delta += (m - n) * handledCPCountPlusOne;
366
329
  n = m;
367
-
368
- for (const currentValue of input) {
330
+ for (const currentValue of codePoints) {
369
331
  if (currentValue < n && ++delta > maxInt) {
370
332
  error('overflow');
371
333
  }
372
334
  if (currentValue === n) {
373
335
  // Represent delta as a generalized variable-length integer.
374
336
  let q = delta;
375
- for (let k = base /* no condition */; ; k += base) {
337
+ for (let k = base /* no condition */;; k += base) {
376
338
  const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
377
339
  if (q < t) {
378
340
  break;
@@ -382,29 +344,27 @@ const encode = function (input) {
382
344
  output.push(stringFromCharCode(digitToBasic(t + (qMinusT % baseMinusT), 0)));
383
345
  q = floor(qMinusT / baseMinusT);
384
346
  }
385
-
386
347
  output.push(stringFromCharCode(digitToBasic(q, 0)));
387
348
  bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
388
349
  delta = 0;
389
350
  ++handledCPCount;
390
351
  }
391
352
  }
392
-
393
353
  ++delta;
394
354
  ++n;
395
355
  }
396
356
  return output.join('');
397
357
  };
398
-
358
+ exports.encode = encode;
399
359
  /**
400
360
  * Converts a Punycode string representing a domain name or an email address
401
361
  * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
402
362
  * it doesn't matter if you call it on a string that has already been
403
363
  * converted to Unicode.
404
364
  * @memberOf punycode
405
- * @param {String} input The Punycoded domain name or email address to
365
+ * @param input The Punycoded domain name or email address to
406
366
  * convert to Unicode.
407
- * @returns {String} The Unicode representation of the given Punycode
367
+ * @returns The Unicode representation of the given Punycode
408
368
  * string.
409
369
  */
410
370
  const toUnicode = function (input) {
@@ -412,16 +372,16 @@ const toUnicode = function (input) {
412
372
  return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
413
373
  });
414
374
  };
415
-
375
+ exports.toUnicode = toUnicode;
416
376
  /**
417
377
  * Converts a Unicode string representing a domain name or an email address to
418
378
  * Punycode. Only the non-ASCII parts of the domain name will be converted,
419
379
  * i.e. it doesn't matter if you call it with a domain that's already in
420
380
  * ASCII.
421
381
  * @memberOf punycode
422
- * @param {String} input The domain name or email address to convert, as a
382
+ * @param input The domain name or email address to convert, as a
423
383
  * Unicode string.
424
- * @returns {String} The Punycode representation of the given domain name or
384
+ * @returns The Punycode representation of the given domain name or
425
385
  * email address.
426
386
  */
427
387
  const toASCII = function (input) {
@@ -429,32 +389,23 @@ const toASCII = function (input) {
429
389
  return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
430
390
  });
431
391
  };
432
-
392
+ exports.toASCII = toASCII;
433
393
  /*--------------------------------------------------------------------------*/
434
-
435
394
  /** Define the public API */
436
- const punycode = {
437
- /**
438
- * A string representing the current Punycode.js version number.
439
- * @memberOf punycode
440
- * @type String
441
- */
442
- version: '2.3.1',
443
- /**
444
- * An object of methods to convert from JavaScript's internal character
445
- * representation (UCS-2) to Unicode code points, and back.
446
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
447
- * @memberOf punycode
448
- * @type Object
449
- */
450
- ucs2: {
451
- decode: ucs2decode,
452
- encode: ucs2encode
453
- },
454
- decode: decode,
455
- encode: encode,
456
- toASCII: toASCII,
457
- toUnicode: toUnicode
395
+ /**
396
+ * A string representing the current Punycode.js version number.
397
+ * @memberOf punycode
398
+ * @type String
399
+ */
400
+ exports.version = '2.3.1';
401
+ /**
402
+ * An object of methods to convert from JavaScript's internal character
403
+ * representation (UCS-2) to Unicode code points, and back.
404
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
405
+ * @memberOf punycode
406
+ * @type Object
407
+ */
408
+ exports.ucs2 = {
409
+ decode: ucs2decode,
410
+ encode: ucs2encode
458
411
  };
459
-
460
- module.exports = punycode;
@@ -0,0 +1,32 @@
1
+ import { Transform } from 'node:stream';
2
+ export declare function encode(buffer: Buffer | string): string;
3
+ /**
4
+ * Adds soft line breaks to a Quoted-Printable string
5
+ *
6
+ * @param str Quoted-Printable encoded string that might need line wrapping
7
+ * @param [lineLength=76] Maximum allowed length for a line
8
+ * @returns Soft-wrapped Quoted-Printable encoded string
9
+ */
10
+ export declare function wrap(str: string, lineLength?: number): string;
11
+ /**
12
+ * Options for the Quoted-Printable encoder stream
13
+ */
14
+ export interface QPEncoderOptions {
15
+ /** Maximum length for lines, set to false to disable wrapping */
16
+ lineLength?: number | false | undefined;
17
+ }
18
+ /** The name @types/nodemailer used for QPEncoderOptions */
19
+ export type EncoderOptions = QPEncoderOptions;
20
+ /**
21
+ * Creates a transform stream for encoding data to Quoted-Printable encoding
22
+ *
23
+ * @constructor
24
+ * @param options Stream options
25
+ * @param [options.lineLength=76] Maximum length for lines, set to false to disable wrapping
26
+ */
27
+ export declare class Encoder extends Transform {
28
+ options: QPEncoderOptions;
29
+ inputBytes: number;
30
+ outputBytes: number;
31
+ constructor(options?: QPEncoderOptions);
32
+ }