@bobfrankston/mailx 1.0.31 → 1.0.32

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 (312) hide show
  1. package/client/styles/layout.css +12 -7
  2. package/launcher/builder/postinstall.js +7 -7
  3. package/package.json +4 -4
  4. package/packages/mailx-send/mailsend/node_modules/.package-lock.json +0 -49
  5. package/packages/mailx-send/mailsend/node_modules/@types/node/LICENSE +0 -21
  6. package/packages/mailx-send/mailsend/node_modules/@types/node/README.md +0 -15
  7. package/packages/mailx-send/mailsend/node_modules/@types/node/assert/strict.d.ts +0 -111
  8. package/packages/mailx-send/mailsend/node_modules/@types/node/assert.d.ts +0 -1078
  9. package/packages/mailx-send/mailsend/node_modules/@types/node/async_hooks.d.ts +0 -603
  10. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.buffer.d.ts +0 -472
  11. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.d.ts +0 -1934
  12. package/packages/mailx-send/mailsend/node_modules/@types/node/child_process.d.ts +0 -1476
  13. package/packages/mailx-send/mailsend/node_modules/@types/node/cluster.d.ts +0 -578
  14. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  15. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/index.d.ts +0 -9
  16. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  17. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  18. package/packages/mailx-send/mailsend/node_modules/@types/node/console.d.ts +0 -452
  19. package/packages/mailx-send/mailsend/node_modules/@types/node/constants.d.ts +0 -21
  20. package/packages/mailx-send/mailsend/node_modules/@types/node/crypto.d.ts +0 -4545
  21. package/packages/mailx-send/mailsend/node_modules/@types/node/dgram.d.ts +0 -600
  22. package/packages/mailx-send/mailsend/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  23. package/packages/mailx-send/mailsend/node_modules/@types/node/dns/promises.d.ts +0 -503
  24. package/packages/mailx-send/mailsend/node_modules/@types/node/dns.d.ts +0 -923
  25. package/packages/mailx-send/mailsend/node_modules/@types/node/domain.d.ts +0 -170
  26. package/packages/mailx-send/mailsend/node_modules/@types/node/events.d.ts +0 -976
  27. package/packages/mailx-send/mailsend/node_modules/@types/node/fs/promises.d.ts +0 -1295
  28. package/packages/mailx-send/mailsend/node_modules/@types/node/fs.d.ts +0 -4461
  29. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.d.ts +0 -172
  30. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  31. package/packages/mailx-send/mailsend/node_modules/@types/node/http.d.ts +0 -2089
  32. package/packages/mailx-send/mailsend/node_modules/@types/node/http2.d.ts +0 -2644
  33. package/packages/mailx-send/mailsend/node_modules/@types/node/https.d.ts +0 -579
  34. package/packages/mailx-send/mailsend/node_modules/@types/node/index.d.ts +0 -97
  35. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.d.ts +0 -253
  36. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.generated.d.ts +0 -4052
  37. package/packages/mailx-send/mailsend/node_modules/@types/node/module.d.ts +0 -891
  38. package/packages/mailx-send/mailsend/node_modules/@types/node/net.d.ts +0 -1057
  39. package/packages/mailx-send/mailsend/node_modules/@types/node/os.d.ts +0 -506
  40. package/packages/mailx-send/mailsend/node_modules/@types/node/package.json +0 -145
  41. package/packages/mailx-send/mailsend/node_modules/@types/node/path.d.ts +0 -200
  42. package/packages/mailx-send/mailsend/node_modules/@types/node/perf_hooks.d.ts +0 -968
  43. package/packages/mailx-send/mailsend/node_modules/@types/node/process.d.ts +0 -2084
  44. package/packages/mailx-send/mailsend/node_modules/@types/node/punycode.d.ts +0 -117
  45. package/packages/mailx-send/mailsend/node_modules/@types/node/querystring.d.ts +0 -152
  46. package/packages/mailx-send/mailsend/node_modules/@types/node/readline/promises.d.ts +0 -161
  47. package/packages/mailx-send/mailsend/node_modules/@types/node/readline.d.ts +0 -594
  48. package/packages/mailx-send/mailsend/node_modules/@types/node/repl.d.ts +0 -428
  49. package/packages/mailx-send/mailsend/node_modules/@types/node/sea.d.ts +0 -153
  50. package/packages/mailx-send/mailsend/node_modules/@types/node/sqlite.d.ts +0 -721
  51. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/consumers.d.ts +0 -38
  52. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/promises.d.ts +0 -90
  53. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/web.d.ts +0 -622
  54. package/packages/mailx-send/mailsend/node_modules/@types/node/stream.d.ts +0 -1664
  55. package/packages/mailx-send/mailsend/node_modules/@types/node/string_decoder.d.ts +0 -67
  56. package/packages/mailx-send/mailsend/node_modules/@types/node/test.d.ts +0 -2163
  57. package/packages/mailx-send/mailsend/node_modules/@types/node/timers/promises.d.ts +0 -108
  58. package/packages/mailx-send/mailsend/node_modules/@types/node/timers.d.ts +0 -287
  59. package/packages/mailx-send/mailsend/node_modules/@types/node/tls.d.ts +0 -1319
  60. package/packages/mailx-send/mailsend/node_modules/@types/node/trace_events.d.ts +0 -197
  61. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  62. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  63. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/index.d.ts +0 -97
  64. package/packages/mailx-send/mailsend/node_modules/@types/node/tty.d.ts +0 -208
  65. package/packages/mailx-send/mailsend/node_modules/@types/node/url.d.ts +0 -984
  66. package/packages/mailx-send/mailsend/node_modules/@types/node/util.d.ts +0 -2606
  67. package/packages/mailx-send/mailsend/node_modules/@types/node/v8.d.ts +0 -920
  68. package/packages/mailx-send/mailsend/node_modules/@types/node/vm.d.ts +0 -1000
  69. package/packages/mailx-send/mailsend/node_modules/@types/node/wasi.d.ts +0 -181
  70. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  71. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  72. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/events.d.ts +0 -97
  73. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  74. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
  75. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  76. package/packages/mailx-send/mailsend/node_modules/@types/node/worker_threads.d.ts +0 -784
  77. package/packages/mailx-send/mailsend/node_modules/@types/node/zlib.d.ts +0 -747
  78. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/LICENSE +0 -21
  79. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/README.md +0 -15
  80. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/index.d.ts +0 -82
  81. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +0 -31
  82. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/base64/index.d.ts +0 -22
  83. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/index.d.ts +0 -45
  84. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +0 -75
  85. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +0 -75
  86. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +0 -21
  87. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +0 -54
  88. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/index.d.ts +0 -38
  89. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +0 -53
  90. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +0 -25
  91. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/index.d.ts +0 -283
  92. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +0 -32
  93. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +0 -87
  94. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +0 -2
  95. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +0 -224
  96. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +0 -9
  97. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/qp/index.d.ts +0 -23
  98. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +0 -53
  99. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +0 -7
  100. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +0 -7
  101. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +0 -146
  102. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/shared/index.d.ts +0 -58
  103. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +0 -11
  104. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +0 -16
  105. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +0 -270
  106. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +0 -93
  107. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +0 -66
  108. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +0 -115
  109. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +0 -59
  110. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/well-known/index.d.ts +0 -6
  111. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +0 -114
  112. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/package.json +0 -38
  113. package/packages/mailx-send/mailsend/node_modules/nodemailer/.ncurc.js +0 -9
  114. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierignore +0 -8
  115. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc +0 -12
  116. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc.js +0 -10
  117. package/packages/mailx-send/mailsend/node_modules/nodemailer/.release-please-config.json +0 -9
  118. package/packages/mailx-send/mailsend/node_modules/nodemailer/LICENSE +0 -16
  119. package/packages/mailx-send/mailsend/node_modules/nodemailer/README.md +0 -86
  120. package/packages/mailx-send/mailsend/node_modules/nodemailer/SECURITY.txt +0 -22
  121. package/packages/mailx-send/mailsend/node_modules/nodemailer/eslint.config.js +0 -88
  122. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/addressparser/index.js +0 -383
  123. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/base64/index.js +0 -139
  124. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/index.js +0 -253
  125. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
  126. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  127. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/sign.js +0 -117
  128. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
  129. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/index.js +0 -280
  130. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/json-transport/index.js +0 -82
  131. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
  132. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/index.js +0 -441
  133. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
  134. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
  135. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
  136. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
  137. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
  138. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
  139. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
  140. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/nodemailer.js +0 -157
  141. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/punycode/index.js +0 -460
  142. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/qp/index.js +0 -227
  143. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
  144. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
  145. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/shared/index.js +0 -754
  146. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
  147. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
  148. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
  149. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
  150. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
  151. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
  152. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
  153. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/index.js +0 -47
  154. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/services.json +0 -611
  155. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
  156. package/packages/mailx-send/mailsend/node_modules/nodemailer/package.json +0 -47
  157. package/packages/mailx-send/mailsend/node_modules/undici-types/LICENSE +0 -21
  158. package/packages/mailx-send/mailsend/node_modules/undici-types/README.md +0 -6
  159. package/packages/mailx-send/mailsend/node_modules/undici-types/agent.d.ts +0 -31
  160. package/packages/mailx-send/mailsend/node_modules/undici-types/api.d.ts +0 -43
  161. package/packages/mailx-send/mailsend/node_modules/undici-types/balanced-pool.d.ts +0 -29
  162. package/packages/mailx-send/mailsend/node_modules/undici-types/cache.d.ts +0 -36
  163. package/packages/mailx-send/mailsend/node_modules/undici-types/client.d.ts +0 -108
  164. package/packages/mailx-send/mailsend/node_modules/undici-types/connector.d.ts +0 -34
  165. package/packages/mailx-send/mailsend/node_modules/undici-types/content-type.d.ts +0 -21
  166. package/packages/mailx-send/mailsend/node_modules/undici-types/cookies.d.ts +0 -28
  167. package/packages/mailx-send/mailsend/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  168. package/packages/mailx-send/mailsend/node_modules/undici-types/dispatcher.d.ts +0 -256
  169. package/packages/mailx-send/mailsend/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  170. package/packages/mailx-send/mailsend/node_modules/undici-types/errors.d.ts +0 -149
  171. package/packages/mailx-send/mailsend/node_modules/undici-types/eventsource.d.ts +0 -61
  172. package/packages/mailx-send/mailsend/node_modules/undici-types/fetch.d.ts +0 -209
  173. package/packages/mailx-send/mailsend/node_modules/undici-types/file.d.ts +0 -39
  174. package/packages/mailx-send/mailsend/node_modules/undici-types/filereader.d.ts +0 -54
  175. package/packages/mailx-send/mailsend/node_modules/undici-types/formdata.d.ts +0 -108
  176. package/packages/mailx-send/mailsend/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  177. package/packages/mailx-send/mailsend/node_modules/undici-types/global-origin.d.ts +0 -7
  178. package/packages/mailx-send/mailsend/node_modules/undici-types/handlers.d.ts +0 -15
  179. package/packages/mailx-send/mailsend/node_modules/undici-types/header.d.ts +0 -4
  180. package/packages/mailx-send/mailsend/node_modules/undici-types/index.d.ts +0 -71
  181. package/packages/mailx-send/mailsend/node_modules/undici-types/interceptors.d.ts +0 -17
  182. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-agent.d.ts +0 -50
  183. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-client.d.ts +0 -25
  184. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-errors.d.ts +0 -12
  185. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  186. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-pool.d.ts +0 -25
  187. package/packages/mailx-send/mailsend/node_modules/undici-types/package.json +0 -55
  188. package/packages/mailx-send/mailsend/node_modules/undici-types/patch.d.ts +0 -33
  189. package/packages/mailx-send/mailsend/node_modules/undici-types/pool-stats.d.ts +0 -19
  190. package/packages/mailx-send/mailsend/node_modules/undici-types/pool.d.ts +0 -39
  191. package/packages/mailx-send/mailsend/node_modules/undici-types/proxy-agent.d.ts +0 -28
  192. package/packages/mailx-send/mailsend/node_modules/undici-types/readable.d.ts +0 -65
  193. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-agent.d.ts +0 -8
  194. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-handler.d.ts +0 -116
  195. package/packages/mailx-send/mailsend/node_modules/undici-types/util.d.ts +0 -18
  196. package/packages/mailx-send/mailsend/node_modules/undici-types/webidl.d.ts +0 -228
  197. package/packages/mailx-send/mailsend/node_modules/undici-types/websocket.d.ts +0 -150
  198. package/packages/mailx-send/node_modules/.package-lock.json +0 -49
  199. package/packages/mailx-send/node_modules/@types/node/LICENSE +0 -21
  200. package/packages/mailx-send/node_modules/@types/node/README.md +0 -15
  201. package/packages/mailx-send/node_modules/@types/node/assert/strict.d.ts +0 -111
  202. package/packages/mailx-send/node_modules/@types/node/assert.d.ts +0 -1078
  203. package/packages/mailx-send/node_modules/@types/node/async_hooks.d.ts +0 -603
  204. package/packages/mailx-send/node_modules/@types/node/buffer.buffer.d.ts +0 -472
  205. package/packages/mailx-send/node_modules/@types/node/buffer.d.ts +0 -1934
  206. package/packages/mailx-send/node_modules/@types/node/child_process.d.ts +0 -1476
  207. package/packages/mailx-send/node_modules/@types/node/cluster.d.ts +0 -578
  208. package/packages/mailx-send/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  209. package/packages/mailx-send/node_modules/@types/node/compatibility/index.d.ts +0 -9
  210. package/packages/mailx-send/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  211. package/packages/mailx-send/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  212. package/packages/mailx-send/node_modules/@types/node/console.d.ts +0 -452
  213. package/packages/mailx-send/node_modules/@types/node/constants.d.ts +0 -21
  214. package/packages/mailx-send/node_modules/@types/node/crypto.d.ts +0 -4545
  215. package/packages/mailx-send/node_modules/@types/node/dgram.d.ts +0 -600
  216. package/packages/mailx-send/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  217. package/packages/mailx-send/node_modules/@types/node/dns/promises.d.ts +0 -503
  218. package/packages/mailx-send/node_modules/@types/node/dns.d.ts +0 -923
  219. package/packages/mailx-send/node_modules/@types/node/domain.d.ts +0 -170
  220. package/packages/mailx-send/node_modules/@types/node/events.d.ts +0 -976
  221. package/packages/mailx-send/node_modules/@types/node/fs/promises.d.ts +0 -1295
  222. package/packages/mailx-send/node_modules/@types/node/fs.d.ts +0 -4461
  223. package/packages/mailx-send/node_modules/@types/node/globals.d.ts +0 -172
  224. package/packages/mailx-send/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  225. package/packages/mailx-send/node_modules/@types/node/http.d.ts +0 -2089
  226. package/packages/mailx-send/node_modules/@types/node/http2.d.ts +0 -2644
  227. package/packages/mailx-send/node_modules/@types/node/https.d.ts +0 -579
  228. package/packages/mailx-send/node_modules/@types/node/index.d.ts +0 -97
  229. package/packages/mailx-send/node_modules/@types/node/inspector.d.ts +0 -253
  230. package/packages/mailx-send/node_modules/@types/node/inspector.generated.d.ts +0 -4052
  231. package/packages/mailx-send/node_modules/@types/node/module.d.ts +0 -891
  232. package/packages/mailx-send/node_modules/@types/node/net.d.ts +0 -1057
  233. package/packages/mailx-send/node_modules/@types/node/os.d.ts +0 -506
  234. package/packages/mailx-send/node_modules/@types/node/package.json +0 -145
  235. package/packages/mailx-send/node_modules/@types/node/path.d.ts +0 -200
  236. package/packages/mailx-send/node_modules/@types/node/perf_hooks.d.ts +0 -968
  237. package/packages/mailx-send/node_modules/@types/node/process.d.ts +0 -2084
  238. package/packages/mailx-send/node_modules/@types/node/punycode.d.ts +0 -117
  239. package/packages/mailx-send/node_modules/@types/node/querystring.d.ts +0 -152
  240. package/packages/mailx-send/node_modules/@types/node/readline/promises.d.ts +0 -161
  241. package/packages/mailx-send/node_modules/@types/node/readline.d.ts +0 -594
  242. package/packages/mailx-send/node_modules/@types/node/repl.d.ts +0 -428
  243. package/packages/mailx-send/node_modules/@types/node/sea.d.ts +0 -153
  244. package/packages/mailx-send/node_modules/@types/node/sqlite.d.ts +0 -721
  245. package/packages/mailx-send/node_modules/@types/node/stream/consumers.d.ts +0 -38
  246. package/packages/mailx-send/node_modules/@types/node/stream/promises.d.ts +0 -90
  247. package/packages/mailx-send/node_modules/@types/node/stream/web.d.ts +0 -622
  248. package/packages/mailx-send/node_modules/@types/node/stream.d.ts +0 -1664
  249. package/packages/mailx-send/node_modules/@types/node/string_decoder.d.ts +0 -67
  250. package/packages/mailx-send/node_modules/@types/node/test.d.ts +0 -2163
  251. package/packages/mailx-send/node_modules/@types/node/timers/promises.d.ts +0 -108
  252. package/packages/mailx-send/node_modules/@types/node/timers.d.ts +0 -287
  253. package/packages/mailx-send/node_modules/@types/node/tls.d.ts +0 -1319
  254. package/packages/mailx-send/node_modules/@types/node/trace_events.d.ts +0 -197
  255. package/packages/mailx-send/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  256. package/packages/mailx-send/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  257. package/packages/mailx-send/node_modules/@types/node/ts5.6/index.d.ts +0 -97
  258. package/packages/mailx-send/node_modules/@types/node/tty.d.ts +0 -208
  259. package/packages/mailx-send/node_modules/@types/node/url.d.ts +0 -984
  260. package/packages/mailx-send/node_modules/@types/node/util.d.ts +0 -2606
  261. package/packages/mailx-send/node_modules/@types/node/v8.d.ts +0 -920
  262. package/packages/mailx-send/node_modules/@types/node/vm.d.ts +0 -1000
  263. package/packages/mailx-send/node_modules/@types/node/wasi.d.ts +0 -181
  264. package/packages/mailx-send/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  265. package/packages/mailx-send/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  266. package/packages/mailx-send/node_modules/@types/node/web-globals/events.d.ts +0 -97
  267. package/packages/mailx-send/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  268. package/packages/mailx-send/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
  269. package/packages/mailx-send/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  270. package/packages/mailx-send/node_modules/@types/node/worker_threads.d.ts +0 -784
  271. package/packages/mailx-send/node_modules/@types/node/zlib.d.ts +0 -747
  272. package/packages/mailx-send/node_modules/undici-types/LICENSE +0 -21
  273. package/packages/mailx-send/node_modules/undici-types/README.md +0 -6
  274. package/packages/mailx-send/node_modules/undici-types/agent.d.ts +0 -31
  275. package/packages/mailx-send/node_modules/undici-types/api.d.ts +0 -43
  276. package/packages/mailx-send/node_modules/undici-types/balanced-pool.d.ts +0 -29
  277. package/packages/mailx-send/node_modules/undici-types/cache.d.ts +0 -36
  278. package/packages/mailx-send/node_modules/undici-types/client.d.ts +0 -108
  279. package/packages/mailx-send/node_modules/undici-types/connector.d.ts +0 -34
  280. package/packages/mailx-send/node_modules/undici-types/content-type.d.ts +0 -21
  281. package/packages/mailx-send/node_modules/undici-types/cookies.d.ts +0 -28
  282. package/packages/mailx-send/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  283. package/packages/mailx-send/node_modules/undici-types/dispatcher.d.ts +0 -256
  284. package/packages/mailx-send/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  285. package/packages/mailx-send/node_modules/undici-types/errors.d.ts +0 -149
  286. package/packages/mailx-send/node_modules/undici-types/eventsource.d.ts +0 -61
  287. package/packages/mailx-send/node_modules/undici-types/fetch.d.ts +0 -209
  288. package/packages/mailx-send/node_modules/undici-types/file.d.ts +0 -39
  289. package/packages/mailx-send/node_modules/undici-types/filereader.d.ts +0 -54
  290. package/packages/mailx-send/node_modules/undici-types/formdata.d.ts +0 -108
  291. package/packages/mailx-send/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  292. package/packages/mailx-send/node_modules/undici-types/global-origin.d.ts +0 -7
  293. package/packages/mailx-send/node_modules/undici-types/handlers.d.ts +0 -15
  294. package/packages/mailx-send/node_modules/undici-types/header.d.ts +0 -4
  295. package/packages/mailx-send/node_modules/undici-types/index.d.ts +0 -71
  296. package/packages/mailx-send/node_modules/undici-types/interceptors.d.ts +0 -17
  297. package/packages/mailx-send/node_modules/undici-types/mock-agent.d.ts +0 -50
  298. package/packages/mailx-send/node_modules/undici-types/mock-client.d.ts +0 -25
  299. package/packages/mailx-send/node_modules/undici-types/mock-errors.d.ts +0 -12
  300. package/packages/mailx-send/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  301. package/packages/mailx-send/node_modules/undici-types/mock-pool.d.ts +0 -25
  302. package/packages/mailx-send/node_modules/undici-types/package.json +0 -55
  303. package/packages/mailx-send/node_modules/undici-types/patch.d.ts +0 -33
  304. package/packages/mailx-send/node_modules/undici-types/pool-stats.d.ts +0 -19
  305. package/packages/mailx-send/node_modules/undici-types/pool.d.ts +0 -39
  306. package/packages/mailx-send/node_modules/undici-types/proxy-agent.d.ts +0 -28
  307. package/packages/mailx-send/node_modules/undici-types/readable.d.ts +0 -65
  308. package/packages/mailx-send/node_modules/undici-types/retry-agent.d.ts +0 -8
  309. package/packages/mailx-send/node_modules/undici-types/retry-handler.d.ts +0 -116
  310. package/packages/mailx-send/node_modules/undici-types/util.d.ts +0 -18
  311. package/packages/mailx-send/node_modules/undici-types/webidl.d.ts +0 -228
  312. package/packages/mailx-send/node_modules/undici-types/websocket.d.ts +0 -150
@@ -1,625 +0,0 @@
1
- /* eslint no-control-regex:0 */
2
-
3
- 'use strict';
4
-
5
- const base64 = require('../base64');
6
- const qp = require('../qp');
7
- const mimeTypes = require('./mime-types');
8
-
9
- module.exports = {
10
- /**
11
- * Checks if a value is plaintext string (uses only printable 7bit chars)
12
- *
13
- * @param {String} value String to be tested
14
- * @returns {Boolean} true if it is a plaintext string
15
- */
16
- isPlainText(value, isParam) {
17
- const re = isParam ? /[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
18
- if (typeof value !== 'string' || re.test(value)) {
19
- return false;
20
- } else {
21
- return true;
22
- }
23
- },
24
-
25
- /**
26
- * Checks if a multi line string containes lines longer than the selected value.
27
- *
28
- * Useful when detecting if a mail message needs any processing at all –
29
- * if only plaintext characters are used and lines are short, then there is
30
- * no need to encode the values in any way. If the value is plaintext but has
31
- * longer lines then allowed, then use format=flowed
32
- *
33
- * @param {Number} lineLength Max line length to check for
34
- * @returns {Boolean} Returns true if there is at least one line longer than lineLength chars
35
- */
36
- hasLongerLines(str, lineLength) {
37
- if (str.length > 128 * 1024) {
38
- // do not test strings longer than 128kB
39
- return true;
40
- }
41
- return new RegExp('^.{' + (lineLength + 1) + ',}', 'm').test(str);
42
- },
43
-
44
- /**
45
- * Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047)
46
- *
47
- * @param {String|Buffer} data String to be encoded
48
- * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B
49
- * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed
50
- * @return {String} Single or several mime words joined together
51
- */
52
- encodeWord(data, mimeWordEncoding, maxLength) {
53
- mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);
54
- maxLength = maxLength || 0;
55
-
56
- let encodedStr;
57
- let toCharset = 'UTF-8';
58
-
59
- if (maxLength && maxLength > 7 + toCharset.length) {
60
- maxLength -= 7 + toCharset.length;
61
- }
62
-
63
- if (mimeWordEncoding === 'Q') {
64
- // https://tools.ietf.org/html/rfc2047#section-5 rule (3)
65
- encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\-/=]/gi, chr => {
66
- let ord = chr.charCodeAt(0).toString(16).toUpperCase();
67
- if (chr === ' ') {
68
- return '_';
69
- } else {
70
- return '=' + (ord.length === 1 ? '0' + ord : ord);
71
- }
72
- });
73
- } else if (mimeWordEncoding === 'B') {
74
- encodedStr = typeof data === 'string' ? data : base64.encode(data);
75
- maxLength = maxLength ? Math.max(3, ((maxLength - (maxLength % 4)) / 4) * 3) : 0;
76
- }
77
-
78
- if (maxLength && (mimeWordEncoding !== 'B' ? encodedStr : base64.encode(data)).length > maxLength) {
79
- if (mimeWordEncoding === 'Q') {
80
- encodedStr = this.splitMimeEncodedString(encodedStr, maxLength).join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');
81
- } else {
82
- // RFC2047 6.3 (2) states that encoded-word must include an integral number of characters, so no chopping unicode sequences
83
- let parts = [];
84
- let lpart = '';
85
- for (let i = 0, len = encodedStr.length; i < len; i++) {
86
- let chr = encodedStr.charAt(i);
87
-
88
- if (/[\ud83c\ud83d\ud83e]/.test(chr) && i < len - 1) {
89
- // composite emoji byte, so add the next byte as well
90
- chr += encodedStr.charAt(++i);
91
- }
92
-
93
- // check if we can add this character to the existing string
94
- // without breaking byte length limit
95
- if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {
96
- lpart += chr;
97
- } else {
98
- // we hit the length limit, so push the existing string and start over
99
- parts.push(base64.encode(lpart));
100
- lpart = chr;
101
- }
102
- }
103
- if (lpart) {
104
- parts.push(base64.encode(lpart));
105
- }
106
-
107
- if (parts.length > 1) {
108
- encodedStr = parts.join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');
109
- } else {
110
- encodedStr = parts.join('');
111
- }
112
- }
113
- } else if (mimeWordEncoding === 'B') {
114
- encodedStr = base64.encode(data);
115
- }
116
-
117
- return '=?' + toCharset + '?' + mimeWordEncoding + '?' + encodedStr + (encodedStr.substr(-2) === '?=' ? '' : '?=');
118
- },
119
-
120
- /**
121
- * Finds word sequences with non ascii text and converts these to mime words
122
- *
123
- * @param {String} value String to be encoded
124
- * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B
125
- * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed
126
- * @param {Boolean} [encodeAll=false] If true and the value needs encoding then encodes entire string, not just the smallest match
127
- * @return {String} String with possible mime words
128
- */
129
- encodeWords(value, mimeWordEncoding, maxLength, encodeAll) {
130
- maxLength = maxLength || 0;
131
-
132
- let encodedValue;
133
-
134
- // find first word with a non-printable ascii or special symbol in it
135
- let firstMatch = value.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);
136
- if (!firstMatch) {
137
- return value;
138
- }
139
-
140
- if (encodeAll) {
141
- // if it is requested to encode everything or the string contains something that resebles encoded word, then encode everything
142
-
143
- return this.encodeWord(value, mimeWordEncoding, maxLength);
144
- }
145
-
146
- // find the last word with a non-printable ascii in it
147
- let lastMatch = value.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);
148
- if (!lastMatch) {
149
- // should not happen
150
- return value;
151
- }
152
-
153
- let startIndex =
154
- firstMatch.index +
155
- (
156
- firstMatch[0].match(/[^\s]/) || {
157
- index: 0
158
- }
159
- ).index;
160
- let endIndex = lastMatch.index + (lastMatch[1] || '').length;
161
-
162
- encodedValue =
163
- (startIndex ? value.substr(0, startIndex) : '') +
164
- this.encodeWord(value.substring(startIndex, endIndex), mimeWordEncoding || 'Q', maxLength) +
165
- (endIndex < value.length ? value.substr(endIndex) : '');
166
-
167
- return encodedValue;
168
- },
169
-
170
- /**
171
- * Joins parsed header value together as 'value; param1=value1; param2=value2'
172
- * PS: We are following RFC 822 for the list of special characters that we need to keep in quotes.
173
- * Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
174
- * @param {Object} structured Parsed header value
175
- * @return {String} joined header value
176
- */
177
- buildHeaderValue(structured) {
178
- let paramsArray = [];
179
-
180
- Object.keys(structured.params || {}).forEach(param => {
181
- // filename might include unicode characters so it is a special case
182
- // other values probably do not
183
- let value = structured.params[param];
184
- if (!this.isPlainText(value, true) || value.length >= 75) {
185
- this.buildHeaderParam(param, value, 50).forEach(encodedParam => {
186
- if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {
187
- paramsArray.push(encodedParam.key + '=' + encodedParam.value);
188
- } else {
189
- paramsArray.push(encodedParam.key + '=' + JSON.stringify(encodedParam.value));
190
- }
191
- });
192
- } else if (/[\s'"\\;:/=(),<>@[\]?]|^-/.test(value)) {
193
- paramsArray.push(param + '=' + JSON.stringify(value));
194
- } else {
195
- paramsArray.push(param + '=' + value);
196
- }
197
- });
198
-
199
- return structured.value + (paramsArray.length ? '; ' + paramsArray.join('; ') : '');
200
- },
201
-
202
- /**
203
- * Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231)
204
- * Useful for splitting long parameter values.
205
- *
206
- * For example
207
- * title="unicode string"
208
- * becomes
209
- * title*0*=utf-8''unicode
210
- * title*1*=%20string
211
- *
212
- * @param {String|Buffer} data String to be encoded
213
- * @param {Number} [maxLength=50] Max length for generated chunks
214
- * @param {String} [fromCharset='UTF-8'] Source sharacter set
215
- * @return {Array} A list of encoded keys and headers
216
- */
217
- buildHeaderParam(key, data, maxLength) {
218
- let list = [];
219
- let encodedStr = typeof data === 'string' ? data : (data || '').toString();
220
- let encodedStrArr;
221
- let chr, ord;
222
- let line;
223
- let startPos = 0;
224
- let i, len;
225
-
226
- maxLength = maxLength || 50;
227
-
228
- // process ascii only text
229
- if (this.isPlainText(data, true)) {
230
- // check if conversion is even needed
231
- if (encodedStr.length <= maxLength) {
232
- return [
233
- {
234
- key,
235
- value: encodedStr
236
- }
237
- ];
238
- }
239
-
240
- encodedStr = encodedStr.replace(new RegExp('.{' + maxLength + '}', 'g'), str => {
241
- list.push({
242
- line: str
243
- });
244
- return '';
245
- });
246
-
247
- if (encodedStr) {
248
- list.push({
249
- line: encodedStr
250
- });
251
- }
252
- } else {
253
- if (/[\uD800-\uDBFF]/.test(encodedStr)) {
254
- // string containts surrogate pairs, so normalize it to an array of bytes
255
- encodedStrArr = [];
256
- for (i = 0, len = encodedStr.length; i < len; i++) {
257
- chr = encodedStr.charAt(i);
258
- ord = chr.charCodeAt(0);
259
- if (ord >= 0xd800 && ord <= 0xdbff && i < len - 1) {
260
- chr += encodedStr.charAt(i + 1);
261
- encodedStrArr.push(chr);
262
- i++;
263
- } else {
264
- encodedStrArr.push(chr);
265
- }
266
- }
267
- encodedStr = encodedStrArr;
268
- }
269
-
270
- // first line includes the charset and language info and needs to be encoded
271
- // even if it does not contain any unicode characters
272
- line = "utf-8''";
273
- let encoded = true;
274
- startPos = 0;
275
-
276
- // process text with unicode or special chars
277
- for (i = 0, len = encodedStr.length; i < len; i++) {
278
- chr = encodedStr[i];
279
-
280
- if (encoded) {
281
- chr = this.safeEncodeURIComponent(chr);
282
- } else {
283
- // try to urlencode current char
284
- chr = chr === ' ' ? chr : this.safeEncodeURIComponent(chr);
285
- // By default it is not required to encode a line, the need
286
- // only appears when the string contains unicode or special chars
287
- // in this case we start processing the line over and encode all chars
288
- if (chr !== encodedStr[i]) {
289
- // Check if it is even possible to add the encoded char to the line
290
- // If not, there is no reason to use this line, just push it to the list
291
- // and start a new line with the char that needs encoding
292
- if ((this.safeEncodeURIComponent(line) + chr).length >= maxLength) {
293
- list.push({
294
- line,
295
- encoded
296
- });
297
- line = '';
298
- startPos = i - 1;
299
- } else {
300
- encoded = true;
301
- i = startPos;
302
- line = '';
303
- continue;
304
- }
305
- }
306
- }
307
-
308
- // if the line is already too long, push it to the list and start a new one
309
- if ((line + chr).length >= maxLength) {
310
- list.push({
311
- line,
312
- encoded
313
- });
314
- line = chr = encodedStr[i] === ' ' ? ' ' : this.safeEncodeURIComponent(encodedStr[i]);
315
- if (chr === encodedStr[i]) {
316
- encoded = false;
317
- startPos = i - 1;
318
- } else {
319
- encoded = true;
320
- }
321
- } else {
322
- line += chr;
323
- }
324
- }
325
-
326
- if (line) {
327
- list.push({
328
- line,
329
- encoded
330
- });
331
- }
332
- }
333
-
334
- return list.map((item, i) => ({
335
- // encoded lines: {name}*{part}*
336
- // unencoded lines: {name}*{part}
337
- // if any line needs to be encoded then the first line (part==0) is always encoded
338
- key: key + '*' + i + (item.encoded ? '*' : ''),
339
- value: item.line
340
- }));
341
- },
342
-
343
- /**
344
- * Parses a header value with key=value arguments into a structured
345
- * object.
346
- *
347
- * parseHeaderValue('content-type: text/plain; CHARSET='UTF-8'') ->
348
- * {
349
- * 'value': 'text/plain',
350
- * 'params': {
351
- * 'charset': 'UTF-8'
352
- * }
353
- * }
354
- *
355
- * @param {String} str Header value
356
- * @return {Object} Header value as a parsed structure
357
- */
358
- parseHeaderValue(str) {
359
- let response = {
360
- value: false,
361
- params: {}
362
- };
363
- let key = false;
364
- let value = '';
365
- let type = 'value';
366
- let quote = false;
367
- let escaped = false;
368
- let chr;
369
-
370
- for (let i = 0, len = str.length; i < len; i++) {
371
- chr = str.charAt(i);
372
- if (type === 'key') {
373
- if (chr === '=') {
374
- key = value.trim().toLowerCase();
375
- type = 'value';
376
- value = '';
377
- continue;
378
- }
379
- value += chr;
380
- } else {
381
- if (escaped) {
382
- value += chr;
383
- } else if (chr === '\\') {
384
- escaped = true;
385
- continue;
386
- } else if (quote && chr === quote) {
387
- quote = false;
388
- } else if (!quote && chr === '"') {
389
- quote = chr;
390
- } else if (!quote && chr === ';') {
391
- if (key === false) {
392
- response.value = value.trim();
393
- } else {
394
- response.params[key] = value.trim();
395
- }
396
- type = 'key';
397
- value = '';
398
- } else {
399
- value += chr;
400
- }
401
- escaped = false;
402
- }
403
- }
404
-
405
- if (type === 'value') {
406
- if (key === false) {
407
- response.value = value.trim();
408
- } else {
409
- response.params[key] = value.trim();
410
- }
411
- } else if (value.trim()) {
412
- response.params[value.trim().toLowerCase()] = '';
413
- }
414
-
415
- // handle parameter value continuations
416
- // https://tools.ietf.org/html/rfc2231#section-3
417
-
418
- // preprocess values
419
- Object.keys(response.params).forEach(key => {
420
- let actualKey, nr, match, value;
421
- if ((match = key.match(/(\*(\d+)|\*(\d+)\*|\*)$/))) {
422
- actualKey = key.substr(0, match.index);
423
- nr = Number(match[2] || match[3]) || 0;
424
-
425
- if (!response.params[actualKey] || typeof response.params[actualKey] !== 'object') {
426
- response.params[actualKey] = {
427
- charset: false,
428
- values: []
429
- };
430
- }
431
-
432
- value = response.params[key];
433
-
434
- if (nr === 0 && match[0].substr(-1) === '*' && (match = value.match(/^([^']*)'[^']*'(.*)$/))) {
435
- response.params[actualKey].charset = match[1] || 'iso-8859-1';
436
- value = match[2];
437
- }
438
-
439
- response.params[actualKey].values[nr] = value;
440
-
441
- // remove the old reference
442
- delete response.params[key];
443
- }
444
- });
445
-
446
- // concatenate split rfc2231 strings and convert encoded strings to mime encoded words
447
- Object.keys(response.params).forEach(key => {
448
- let value;
449
- if (response.params[key] && Array.isArray(response.params[key].values)) {
450
- value = response.params[key].values.map(val => val || '').join('');
451
-
452
- if (response.params[key].charset) {
453
- // convert "%AB" to "=?charset?Q?=AB?="
454
- response.params[key] =
455
- '=?' +
456
- response.params[key].charset +
457
- '?Q?' +
458
- value
459
- // fix invalidly encoded chars
460
- .replace(/[=?_\s]/g, s => {
461
- let c = s.charCodeAt(0).toString(16);
462
- if (s === ' ') {
463
- return '_';
464
- } else {
465
- return '%' + (c.length < 2 ? '0' : '') + c;
466
- }
467
- })
468
- // change from urlencoding to percent encoding
469
- .replace(/%/g, '=') +
470
- '?=';
471
- } else {
472
- response.params[key] = value;
473
- }
474
- }
475
- });
476
-
477
- return response;
478
- },
479
-
480
- /**
481
- * Returns file extension for a content type string. If no suitable extensions
482
- * are found, 'bin' is used as the default extension
483
- *
484
- * @param {String} mimeType Content type to be checked for
485
- * @return {String} File extension
486
- */
487
- detectExtension: mimeType => mimeTypes.detectExtension(mimeType),
488
-
489
- /**
490
- * Returns content type for a file extension. If no suitable content types
491
- * are found, 'application/octet-stream' is used as the default content type
492
- *
493
- * @param {String} extension Extension to be checked for
494
- * @return {String} File extension
495
- */
496
- detectMimeType: extension => mimeTypes.detectMimeType(extension),
497
-
498
- /**
499
- * Folds long lines, useful for folding header lines (afterSpace=false) and
500
- * flowed text (afterSpace=true)
501
- *
502
- * @param {String} str String to be folded
503
- * @param {Number} [lineLength=76] Maximum length of a line
504
- * @param {Boolean} afterSpace If true, leave a space in th end of a line
505
- * @return {String} String with folded lines
506
- */
507
- foldLines(str, lineLength, afterSpace) {
508
- str = (str || '').toString();
509
- lineLength = lineLength || 76;
510
-
511
- let pos = 0,
512
- len = str.length,
513
- result = '',
514
- line,
515
- match;
516
-
517
- while (pos < len) {
518
- line = str.substr(pos, lineLength);
519
- if (line.length < lineLength) {
520
- result += line;
521
- break;
522
- }
523
- if ((match = line.match(/^[^\n\r]*(\r?\n|\r)/))) {
524
- line = match[0];
525
- result += line;
526
- pos += line.length;
527
- continue;
528
- } else if ((match = line.match(/(\s+)[^\s]*$/)) && match[0].length - (afterSpace ? (match[1] || '').length : 0) < line.length) {
529
- line = line.substr(0, line.length - (match[0].length - (afterSpace ? (match[1] || '').length : 0)));
530
- } else if ((match = str.substr(pos + line.length).match(/^[^\s]+(\s*)/))) {
531
- line = line + match[0].substr(0, match[0].length - (!afterSpace ? (match[1] || '').length : 0));
532
- }
533
-
534
- result += line;
535
- pos += line.length;
536
- if (pos < len) {
537
- result += '\r\n';
538
- }
539
- }
540
-
541
- return result;
542
- },
543
-
544
- /**
545
- * Splits a mime encoded string. Needed for dividing mime words into smaller chunks
546
- *
547
- * @param {String} str Mime encoded string to be split up
548
- * @param {Number} maxlen Maximum length of characters for one part (minimum 12)
549
- * @return {Array} Split string
550
- */
551
- splitMimeEncodedString: (str, maxlen) => {
552
- let curLine,
553
- match,
554
- chr,
555
- done,
556
- lines = [];
557
-
558
- // require at least 12 symbols to fit possible 4 octet UTF-8 sequences
559
- maxlen = Math.max(maxlen || 0, 12);
560
-
561
- while (str.length) {
562
- curLine = str.substr(0, maxlen);
563
-
564
- // move incomplete escaped char back to main
565
- if ((match = curLine.match(/[=][0-9A-F]?$/i))) {
566
- curLine = curLine.substr(0, match.index);
567
- }
568
-
569
- done = false;
570
- while (!done) {
571
- done = true;
572
- // check if not middle of a unicode char sequence
573
- if ((match = str.substr(curLine.length).match(/^[=]([0-9A-F]{2})/i))) {
574
- chr = parseInt(match[1], 16);
575
- // invalid sequence, move one char back anc recheck
576
- if (chr < 0xc2 && chr > 0x7f) {
577
- curLine = curLine.substr(0, curLine.length - 3);
578
- done = false;
579
- }
580
- }
581
- }
582
-
583
- if (curLine.length) {
584
- lines.push(curLine);
585
- }
586
- str = str.substr(curLine.length);
587
- }
588
-
589
- return lines;
590
- },
591
-
592
- encodeURICharComponent: chr => {
593
- let res = '';
594
- let ord = chr.charCodeAt(0).toString(16).toUpperCase();
595
-
596
- if (ord.length % 2) {
597
- ord = '0' + ord;
598
- }
599
-
600
- if (ord.length > 2) {
601
- for (let i = 0, len = ord.length / 2; i < len; i++) {
602
- res += '%' + ord.substr(i, 2);
603
- }
604
- } else {
605
- res += '%' + ord;
606
- }
607
-
608
- return res;
609
- },
610
-
611
- safeEncodeURIComponent(str) {
612
- str = (str || '').toString();
613
-
614
- try {
615
- // might throw if we try to encode invalid sequences, eg. partial emoji
616
- str = encodeURIComponent(str);
617
- } catch (_E) {
618
- // should never run
619
- return str.replace(/[^\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]+/g, '');
620
- }
621
-
622
- // ensure chars that are not handled by encodeURICompent are converted as well
623
- return str.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g, chr => this.encodeURICharComponent(chr));
624
- }
625
- };