@bobfrankston/mailx 1.0.12 → 1.0.13

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 (237) hide show
  1. package/bin/mailx.js +47 -29
  2. package/client/app.js +93 -13
  3. package/client/components/folder-tree.js +84 -3
  4. package/client/components/message-list.js +134 -8
  5. package/client/components/message-viewer.js +130 -13
  6. package/client/compose/compose.html +4 -4
  7. package/client/compose/compose.js +53 -34
  8. package/client/index.html +33 -9
  9. package/client/lib/api-client.js +102 -30
  10. package/client/lib/mailxapi.js +123 -0
  11. package/client/package.json +1 -1
  12. package/client/styles/components.css +188 -15
  13. package/client/styles/layout.css +2 -1
  14. package/killmail.cmd +6 -0
  15. package/launch.ps1 +47 -5
  16. package/launcher/bin/mailx-app.exe +0 -0
  17. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Breadcrumbs +0 -0
  18. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Crashpad/metadata +0 -0
  19. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Crashpad/settings.dat +0 -0
  20. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Crashpad/throttle_store.dat +1 -0
  21. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/CrashpadMetrics-active.pma +0 -0
  22. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/BrowsingTopicsSiteData +0 -0
  23. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Cache/No_Vary_Search/journal.baj +1 -0
  24. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/DIPS +0 -0
  25. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/DashTrackerDatabase +0 -0
  26. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/EdgeJourneys/EdgeJourneys.db +0 -0
  27. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Rules/LOCK +0 -0
  28. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Rules/LOG +3 -0
  29. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Rules/MANIFEST-000001 +0 -0
  30. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Scripts/LOCK +0 -0
  31. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Scripts/LOG +3 -0
  32. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Scripts/MANIFEST-000001 +0 -0
  33. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension State/LOCK +0 -0
  34. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension State/LOG +3 -0
  35. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension State/MANIFEST-000001 +0 -0
  36. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/ExtensionActivityComp +0 -0
  37. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/ExtensionActivityEdge +0 -0
  38. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Favicons +0 -0
  39. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/History +0 -0
  40. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/History-journal +0 -0
  41. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/IndexedDB/devtools_devtools_0.indexeddb.leveldb/LOCK +0 -0
  42. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/IndexedDB/devtools_devtools_0.indexeddb.leveldb/LOG +3 -0
  43. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/IndexedDB/devtools_devtools_0.indexeddb.leveldb/MANIFEST-000001 +0 -0
  44. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOCK +0 -0
  45. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG +3 -0
  46. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Local Storage/leveldb/MANIFEST-000001 +0 -0
  47. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Login Data +0 -0
  48. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Login Data For Account +0 -0
  49. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Network/Cookies +0 -0
  50. NEL +0 -0
  51. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Network/Trust Tokens +0 -0
  52. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Network Action Predictor +0 -0
  53. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Preferences +1 -0
  54. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Safe Browsing Network/Safe Browsing Cookies +0 -0
  55. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/ServerCertificate +0 -0
  56. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Session Storage/LOCK +0 -0
  57. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Session Storage/LOG +3 -0
  58. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Session Storage/MANIFEST-000001 +0 -0
  59. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Shared Dictionary/db +0 -0
  60. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/SharedStorage +0 -0
  61. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Shortcuts +0 -0
  62. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOCK +0 -0
  63. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOG +3 -0
  64. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Site Characteristics Database/MANIFEST-000001 +0 -0
  65. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOCK +0 -0
  66. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOG +3 -0
  67. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/MANIFEST-000001 +0 -0
  68. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Top Sites +0 -0
  69. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Vpn Tokens +0 -0
  70. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Web Data +0 -0
  71. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Web Data-journal +0 -0
  72. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/WebStorage/QuotaManager +0 -0
  73. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/WebStorage/QuotaManager-journal +0 -0
  74. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/heavy_ad_intervention_opt_out.db +0 -0
  75. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/LOCK +0 -0
  76. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/LOG +3 -0
  77. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/MANIFEST-000001 +0 -0
  78. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOCK +0 -0
  79. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOG +3 -0
  80. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/MANIFEST-000001 +0 -0
  81. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/DeferredBrowserMetrics/BrowserMetrics-69CAD063-BE24.pma +0 -0
  82. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Local State +1 -0
  83. package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Variations +1 -0
  84. package/launcher/bin/mailx-app.old.exe +0 -0
  85. package/package.json +1 -1
  86. package/packages/mailx-api/index.js +79 -26
  87. package/packages/mailx-core/index.d.ts +129 -0
  88. package/packages/mailx-core/index.js +323 -0
  89. package/packages/mailx-core/ipc.d.ts +13 -0
  90. package/packages/mailx-core/ipc.js +56 -0
  91. package/packages/mailx-core/package.json +18 -0
  92. package/packages/mailx-imap/index.d.ts +5 -1
  93. package/packages/mailx-imap/index.js +76 -14
  94. package/packages/mailx-server/index.js +42 -31
  95. package/packages/mailx-server/package.json +1 -2
  96. package/packages/mailx-settings/index.d.ts +1 -1
  97. package/packages/mailx-settings/index.js +21 -12
  98. package/packages/mailx-store/db.d.ts +5 -1
  99. package/packages/mailx-store/db.js +64 -12
  100. package/packages/mailx-store/file-store.d.ts +2 -8
  101. package/packages/mailx-store/file-store.js +7 -31
  102. package/packages/mailx-types/index.d.ts +3 -1
  103. package/.tswalk.json +0 -7396
  104. package/launcher/release.cmd +0 -4
  105. package/mailx.json +0 -9
  106. package/packages/mailx-api/node_modules/nodemailer/.ncurc.js +0 -9
  107. package/packages/mailx-api/node_modules/nodemailer/.prettierignore +0 -8
  108. package/packages/mailx-api/node_modules/nodemailer/.prettierrc +0 -12
  109. package/packages/mailx-api/node_modules/nodemailer/.prettierrc.js +0 -10
  110. package/packages/mailx-api/node_modules/nodemailer/.release-please-config.json +0 -9
  111. package/packages/mailx-api/node_modules/nodemailer/LICENSE +0 -16
  112. package/packages/mailx-api/node_modules/nodemailer/README.md +0 -86
  113. package/packages/mailx-api/node_modules/nodemailer/SECURITY.txt +0 -22
  114. package/packages/mailx-api/node_modules/nodemailer/eslint.config.js +0 -88
  115. package/packages/mailx-api/node_modules/nodemailer/lib/addressparser/index.js +0 -383
  116. package/packages/mailx-api/node_modules/nodemailer/lib/base64/index.js +0 -139
  117. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/index.js +0 -253
  118. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
  119. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  120. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/sign.js +0 -117
  121. package/packages/mailx-api/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
  122. package/packages/mailx-api/node_modules/nodemailer/lib/fetch/index.js +0 -280
  123. package/packages/mailx-api/node_modules/nodemailer/lib/json-transport/index.js +0 -82
  124. package/packages/mailx-api/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
  125. package/packages/mailx-api/node_modules/nodemailer/lib/mailer/index.js +0 -441
  126. package/packages/mailx-api/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
  127. package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
  128. package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
  129. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
  130. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
  131. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
  132. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
  133. package/packages/mailx-api/node_modules/nodemailer/lib/nodemailer.js +0 -157
  134. package/packages/mailx-api/node_modules/nodemailer/lib/punycode/index.js +0 -460
  135. package/packages/mailx-api/node_modules/nodemailer/lib/qp/index.js +0 -227
  136. package/packages/mailx-api/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
  137. package/packages/mailx-api/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
  138. package/packages/mailx-api/node_modules/nodemailer/lib/shared/index.js +0 -754
  139. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
  140. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
  141. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
  142. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
  143. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
  144. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
  145. package/packages/mailx-api/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
  146. package/packages/mailx-api/node_modules/nodemailer/lib/well-known/index.js +0 -47
  147. package/packages/mailx-api/node_modules/nodemailer/lib/well-known/services.json +0 -611
  148. package/packages/mailx-api/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
  149. package/packages/mailx-api/node_modules/nodemailer/package.json +0 -47
  150. package/packages/mailx-imap/node_modules/nodemailer/.ncurc.js +0 -9
  151. package/packages/mailx-imap/node_modules/nodemailer/.prettierignore +0 -8
  152. package/packages/mailx-imap/node_modules/nodemailer/.prettierrc +0 -12
  153. package/packages/mailx-imap/node_modules/nodemailer/.prettierrc.js +0 -10
  154. package/packages/mailx-imap/node_modules/nodemailer/.release-please-config.json +0 -9
  155. package/packages/mailx-imap/node_modules/nodemailer/LICENSE +0 -16
  156. package/packages/mailx-imap/node_modules/nodemailer/README.md +0 -86
  157. package/packages/mailx-imap/node_modules/nodemailer/SECURITY.txt +0 -22
  158. package/packages/mailx-imap/node_modules/nodemailer/eslint.config.js +0 -88
  159. package/packages/mailx-imap/node_modules/nodemailer/lib/addressparser/index.js +0 -383
  160. package/packages/mailx-imap/node_modules/nodemailer/lib/base64/index.js +0 -139
  161. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/index.js +0 -253
  162. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
  163. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  164. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/sign.js +0 -117
  165. package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
  166. package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/index.js +0 -280
  167. package/packages/mailx-imap/node_modules/nodemailer/lib/json-transport/index.js +0 -82
  168. package/packages/mailx-imap/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
  169. package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/index.js +0 -441
  170. package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
  171. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
  172. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
  173. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
  174. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
  175. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
  176. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
  177. package/packages/mailx-imap/node_modules/nodemailer/lib/nodemailer.js +0 -157
  178. package/packages/mailx-imap/node_modules/nodemailer/lib/punycode/index.js +0 -460
  179. package/packages/mailx-imap/node_modules/nodemailer/lib/qp/index.js +0 -227
  180. package/packages/mailx-imap/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
  181. package/packages/mailx-imap/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
  182. package/packages/mailx-imap/node_modules/nodemailer/lib/shared/index.js +0 -754
  183. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
  184. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
  185. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
  186. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
  187. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
  188. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
  189. package/packages/mailx-imap/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
  190. package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/index.js +0 -47
  191. package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/services.json +0 -611
  192. package/packages/mailx-imap/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
  193. package/packages/mailx-imap/node_modules/nodemailer/package.json +0 -47
  194. package/packages/mailx-send/node_modules/nodemailer/.ncurc.js +0 -9
  195. package/packages/mailx-send/node_modules/nodemailer/.prettierignore +0 -8
  196. package/packages/mailx-send/node_modules/nodemailer/.prettierrc +0 -12
  197. package/packages/mailx-send/node_modules/nodemailer/.prettierrc.js +0 -10
  198. package/packages/mailx-send/node_modules/nodemailer/.release-please-config.json +0 -9
  199. package/packages/mailx-send/node_modules/nodemailer/LICENSE +0 -16
  200. package/packages/mailx-send/node_modules/nodemailer/README.md +0 -86
  201. package/packages/mailx-send/node_modules/nodemailer/SECURITY.txt +0 -22
  202. package/packages/mailx-send/node_modules/nodemailer/eslint.config.js +0 -88
  203. package/packages/mailx-send/node_modules/nodemailer/lib/addressparser/index.js +0 -383
  204. package/packages/mailx-send/node_modules/nodemailer/lib/base64/index.js +0 -139
  205. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/index.js +0 -253
  206. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
  207. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  208. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/sign.js +0 -117
  209. package/packages/mailx-send/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
  210. package/packages/mailx-send/node_modules/nodemailer/lib/fetch/index.js +0 -280
  211. package/packages/mailx-send/node_modules/nodemailer/lib/json-transport/index.js +0 -82
  212. package/packages/mailx-send/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
  213. package/packages/mailx-send/node_modules/nodemailer/lib/mailer/index.js +0 -441
  214. package/packages/mailx-send/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
  215. package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
  216. package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
  217. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
  218. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
  219. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
  220. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
  221. package/packages/mailx-send/node_modules/nodemailer/lib/nodemailer.js +0 -157
  222. package/packages/mailx-send/node_modules/nodemailer/lib/punycode/index.js +0 -460
  223. package/packages/mailx-send/node_modules/nodemailer/lib/qp/index.js +0 -227
  224. package/packages/mailx-send/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
  225. package/packages/mailx-send/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
  226. package/packages/mailx-send/node_modules/nodemailer/lib/shared/index.js +0 -754
  227. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
  228. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
  229. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
  230. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
  231. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
  232. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
  233. package/packages/mailx-send/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
  234. package/packages/mailx-send/node_modules/nodemailer/lib/well-known/index.js +0 -47
  235. package/packages/mailx-send/node_modules/nodemailer/lib/well-known/services.json +0 -611
  236. package/packages/mailx-send/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
  237. package/packages/mailx-send/node_modules/nodemailer/package.json +0 -47
@@ -1,460 +0,0 @@
1
- /*
2
-
3
- Copied from https://github.com/mathiasbynens/punycode.js/blob/ef3505c8abb5143a00d53ce59077c9f7f4b2ac47/punycode.js
4
-
5
- Copyright Mathias Bynens <https://mathiasbynens.be/>
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining
8
- a copy of this software and associated documentation files (the
9
- "Software"), to deal in the Software without restriction, including
10
- without limitation the rights to use, copy, modify, merge, publish,
11
- distribute, sublicense, and/or sell copies of the Software, and to
12
- permit persons to whom the Software is furnished to do so, subject to
13
- the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be
16
- included in all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
-
26
- */
27
- /* eslint callback-return: 0, no-bitwise: 0, eqeqeq: 0, prefer-arrow-callback: 0, object-shorthand: 0 */
28
-
29
- 'use strict';
30
-
31
- /** Highest positive signed 32-bit float value */
32
- const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
33
-
34
- /** Bootstring parameters */
35
- const base = 36;
36
- const tMin = 1;
37
- const tMax = 26;
38
- const skew = 38;
39
- const damp = 700;
40
- const initialBias = 72;
41
- const initialN = 128; // 0x80
42
- const delimiter = '-'; // '\x2D'
43
-
44
- /** Regular expressions */
45
- const regexPunycode = /^xn--/;
46
- const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
47
- const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
48
-
49
- /** Error messages */
50
- const errors = {
51
- overflow: 'Overflow: input needs wider integers to process',
52
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
53
- 'invalid-input': 'Invalid input'
54
- };
55
-
56
- /** Convenience shortcuts */
57
- const baseMinusTMin = base - tMin;
58
- const floor = Math.floor;
59
- const stringFromCharCode = String.fromCharCode;
60
-
61
- /*--------------------------------------------------------------------------*/
62
-
63
- /**
64
- * A generic error utility function.
65
- * @private
66
- * @param {String} type The error type.
67
- * @returns {Error} Throws a `RangeError` with the applicable error message.
68
- */
69
- function error(type) {
70
- throw new RangeError(errors[type]);
71
- }
72
-
73
- /**
74
- * A generic `Array#map` utility function.
75
- * @private
76
- * @param {Array} array The array to iterate over.
77
- * @param {Function} callback The function that gets called for every array
78
- * item.
79
- * @returns {Array} A new array of values returned by the callback function.
80
- */
81
- function map(array, callback) {
82
- const result = [];
83
- let length = array.length;
84
- while (length--) {
85
- result[length] = callback(array[length]);
86
- }
87
- return result;
88
- }
89
-
90
- /**
91
- * A simple `Array#map`-like wrapper to work with domain name strings or email
92
- * addresses.
93
- * @private
94
- * @param {String} domain The domain name or email address.
95
- * @param {Function} callback The function that gets called for every
96
- * character.
97
- * @returns {String} A new string of characters returned by the callback
98
- * function.
99
- */
100
- function mapDomain(domain, callback) {
101
- const parts = domain.split('@');
102
- let result = '';
103
- if (parts.length > 1) {
104
- // In email addresses, only the domain name should be punycoded. Leave
105
- // the local part (i.e. everything up to `@`) intact.
106
- result = parts[0] + '@';
107
- domain = parts[1];
108
- }
109
- // Avoid `split(regex)` for IE8 compatibility. See #17.
110
- domain = domain.replace(regexSeparators, '\x2E');
111
- const labels = domain.split('.');
112
- const encoded = map(labels, callback).join('.');
113
- return result + encoded;
114
- }
115
-
116
- /**
117
- * Creates an array containing the numeric code points of each Unicode
118
- * character in the string. While JavaScript uses UCS-2 internally,
119
- * this function will convert a pair of surrogate halves (each of which
120
- * UCS-2 exposes as separate characters) into a single code point,
121
- * matching UTF-16.
122
- * @see `punycode.ucs2.encode`
123
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
124
- * @memberOf punycode.ucs2
125
- * @name decode
126
- * @param {String} string The Unicode input string (UCS-2).
127
- * @returns {Array} The new array of code points.
128
- */
129
- function ucs2decode(string) {
130
- const output = [];
131
- let counter = 0;
132
- const length = string.length;
133
- while (counter < length) {
134
- const value = string.charCodeAt(counter++);
135
- if (value >= 0xd800 && value <= 0xdbff && counter < length) {
136
- // It's a high surrogate, and there is a next character.
137
- const extra = string.charCodeAt(counter++);
138
- if ((extra & 0xfc00) == 0xdc00) {
139
- // Low surrogate.
140
- output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
141
- } else {
142
- // It's an unmatched surrogate; only append this code unit, in case the
143
- // next code unit is the high surrogate of a surrogate pair.
144
- output.push(value);
145
- counter--;
146
- }
147
- } else {
148
- output.push(value);
149
- }
150
- }
151
- return output;
152
- }
153
-
154
- /**
155
- * Creates a string based on an array of numeric code points.
156
- * @see `punycode.ucs2.decode`
157
- * @memberOf punycode.ucs2
158
- * @name encode
159
- * @param {Array} codePoints The array of numeric code points.
160
- * @returns {String} The new Unicode string (UCS-2).
161
- */
162
- const ucs2encode = codePoints => String.fromCodePoint(...codePoints);
163
-
164
- /**
165
- * Converts a basic code point into a digit/integer.
166
- * @see `digitToBasic()`
167
- * @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
170
- * representing integers) in the range `0` to `base - 1`, or `base` if
171
- * the code point does not represent a value.
172
- */
173
- const basicToDigit = function (codePoint) {
174
- if (codePoint >= 0x30 && codePoint < 0x3a) {
175
- return 26 + (codePoint - 0x30);
176
- }
177
- if (codePoint >= 0x41 && codePoint < 0x5b) {
178
- return codePoint - 0x41;
179
- }
180
- if (codePoint >= 0x61 && codePoint < 0x7b) {
181
- return codePoint - 0x61;
182
- }
183
- return base;
184
- };
185
-
186
- /**
187
- * Converts a digit/integer into a basic code point.
188
- * @see `basicToDigit()`
189
- * @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
192
- * representing integers) is `digit`, which needs to be in the range
193
- * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
194
- * used; else, the lowercase form is used. The behavior is undefined
195
- * if `flag` is non-zero and `digit` has no uppercase form.
196
- */
197
- const digitToBasic = function (digit, flag) {
198
- // 0..25 map to ASCII a..z or A..Z
199
- // 26..35 map to ASCII 0..9
200
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
201
- };
202
-
203
- /**
204
- * Bias adaptation function as per section 3.4 of RFC 3492.
205
- * https://tools.ietf.org/html/rfc3492#section-3.4
206
- * @private
207
- */
208
- const adapt = function (delta, numPoints, firstTime) {
209
- let k = 0;
210
- delta = firstTime ? floor(delta / damp) : delta >> 1;
211
- delta += floor(delta / numPoints);
212
- for (; /* no initialization */ delta > (baseMinusTMin * tMax) >> 1; k += base) {
213
- delta = floor(delta / baseMinusTMin);
214
- }
215
- return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew));
216
- };
217
-
218
- /**
219
- * Converts a Punycode string of ASCII-only symbols to a string of Unicode
220
- * symbols.
221
- * @memberOf punycode
222
- * @param {String} input The Punycode string of ASCII-only symbols.
223
- * @returns {String} The resulting string of Unicode symbols.
224
- */
225
- const decode = function (input) {
226
- // Don't use UCS-2.
227
- const output = [];
228
- const inputLength = input.length;
229
- let i = 0;
230
- let n = initialN;
231
- let bias = initialBias;
232
-
233
- // Handle the basic code points: let `basic` be the number of input code
234
- // points before the last delimiter, or `0` if there is none, then copy
235
- // the first basic code points to the output.
236
-
237
- let basic = input.lastIndexOf(delimiter);
238
- if (basic < 0) {
239
- basic = 0;
240
- }
241
-
242
- for (let j = 0; j < basic; ++j) {
243
- // if it's not a basic code point
244
- if (input.charCodeAt(j) >= 0x80) {
245
- error('not-basic');
246
- }
247
- output.push(input.charCodeAt(j));
248
- }
249
-
250
- // Main decoding loop: start just after the last delimiter if any basic code
251
- // points were copied; start at the beginning otherwise.
252
-
253
- for (let index = basic > 0 ? basic + 1 : 0; index < inputLength /* no final expression */; ) {
254
- // `index` is the index of the next character to be consumed.
255
- // Decode a generalized variable-length integer into `delta`,
256
- // which gets added to `i`. The overflow checking is easier
257
- // if we increase `i` as we go, then subtract off its starting
258
- // value at the end to obtain `delta`.
259
- const oldi = i;
260
- for (let w = 1, k = base /* no condition */; ; k += base) {
261
- if (index >= inputLength) {
262
- error('invalid-input');
263
- }
264
-
265
- const digit = basicToDigit(input.charCodeAt(index++));
266
-
267
- if (digit >= base) {
268
- error('invalid-input');
269
- }
270
- if (digit > floor((maxInt - i) / w)) {
271
- error('overflow');
272
- }
273
-
274
- i += digit * w;
275
- const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
276
-
277
- if (digit < t) {
278
- break;
279
- }
280
-
281
- const baseMinusT = base - t;
282
- if (w > floor(maxInt / baseMinusT)) {
283
- error('overflow');
284
- }
285
-
286
- w *= baseMinusT;
287
- }
288
-
289
- const out = output.length + 1;
290
- bias = adapt(i - oldi, out, oldi == 0);
291
-
292
- // `i` was supposed to wrap around from `out` to `0`,
293
- // incrementing `n` each time, so we'll fix that now:
294
- if (floor(i / out) > maxInt - n) {
295
- error('overflow');
296
- }
297
-
298
- n += floor(i / out);
299
- i %= out;
300
-
301
- // Insert `n` at position `i` of the output.
302
- output.splice(i++, 0, n);
303
- }
304
-
305
- return String.fromCodePoint(...output);
306
- };
307
-
308
- /**
309
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
310
- * Punycode string of ASCII-only symbols.
311
- * @memberOf punycode
312
- * @param {String} input The string of Unicode symbols.
313
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
314
- */
315
- const encode = function (input) {
316
- const output = [];
317
-
318
- // Convert the input in UCS-2 to an array of Unicode code points.
319
- input = ucs2decode(input);
320
-
321
- // Cache the length.
322
- const inputLength = input.length;
323
-
324
- // Initialize the state.
325
- let n = initialN;
326
- let delta = 0;
327
- let bias = initialBias;
328
-
329
- // Handle the basic code points.
330
- for (const currentValue of input) {
331
- if (currentValue < 0x80) {
332
- output.push(stringFromCharCode(currentValue));
333
- }
334
- }
335
-
336
- const basicLength = output.length;
337
- let handledCPCount = basicLength;
338
-
339
- // `handledCPCount` is the number of code points that have been handled;
340
- // `basicLength` is the number of basic code points.
341
-
342
- // Finish the basic string with a delimiter unless it's empty.
343
- if (basicLength) {
344
- output.push(delimiter);
345
- }
346
-
347
- // Main encoding loop:
348
- while (handledCPCount < inputLength) {
349
- // All non-basic code points < n have been handled already. Find the next
350
- // larger one:
351
- let m = maxInt;
352
- for (const currentValue of input) {
353
- if (currentValue >= n && currentValue < m) {
354
- m = currentValue;
355
- }
356
- }
357
-
358
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
359
- // but guard against overflow.
360
- const handledCPCountPlusOne = handledCPCount + 1;
361
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
362
- error('overflow');
363
- }
364
-
365
- delta += (m - n) * handledCPCountPlusOne;
366
- n = m;
367
-
368
- for (const currentValue of input) {
369
- if (currentValue < n && ++delta > maxInt) {
370
- error('overflow');
371
- }
372
- if (currentValue === n) {
373
- // Represent delta as a generalized variable-length integer.
374
- let q = delta;
375
- for (let k = base /* no condition */; ; k += base) {
376
- const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
377
- if (q < t) {
378
- break;
379
- }
380
- const qMinusT = q - t;
381
- const baseMinusT = base - t;
382
- output.push(stringFromCharCode(digitToBasic(t + (qMinusT % baseMinusT), 0)));
383
- q = floor(qMinusT / baseMinusT);
384
- }
385
-
386
- output.push(stringFromCharCode(digitToBasic(q, 0)));
387
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
388
- delta = 0;
389
- ++handledCPCount;
390
- }
391
- }
392
-
393
- ++delta;
394
- ++n;
395
- }
396
- return output.join('');
397
- };
398
-
399
- /**
400
- * Converts a Punycode string representing a domain name or an email address
401
- * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
402
- * it doesn't matter if you call it on a string that has already been
403
- * converted to Unicode.
404
- * @memberOf punycode
405
- * @param {String} input The Punycoded domain name or email address to
406
- * convert to Unicode.
407
- * @returns {String} The Unicode representation of the given Punycode
408
- * string.
409
- */
410
- const toUnicode = function (input) {
411
- return mapDomain(input, function (string) {
412
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
413
- });
414
- };
415
-
416
- /**
417
- * Converts a Unicode string representing a domain name or an email address to
418
- * Punycode. Only the non-ASCII parts of the domain name will be converted,
419
- * i.e. it doesn't matter if you call it with a domain that's already in
420
- * ASCII.
421
- * @memberOf punycode
422
- * @param {String} input The domain name or email address to convert, as a
423
- * Unicode string.
424
- * @returns {String} The Punycode representation of the given domain name or
425
- * email address.
426
- */
427
- const toASCII = function (input) {
428
- return mapDomain(input, function (string) {
429
- return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
430
- });
431
- };
432
-
433
- /*--------------------------------------------------------------------------*/
434
-
435
- /** 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
458
- };
459
-
460
- module.exports = punycode;
@@ -1,227 +0,0 @@
1
- 'use strict';
2
-
3
- const Transform = require('stream').Transform;
4
-
5
- /**
6
- * Encodes a Buffer into a Quoted-Printable encoded string
7
- *
8
- * @param {Buffer} buffer Buffer to convert
9
- * @returns {String} Quoted-Printable encoded string
10
- */
11
- function encode(buffer) {
12
- if (typeof buffer === 'string') {
13
- buffer = Buffer.from(buffer, 'utf-8');
14
- }
15
-
16
- // usable characters that do not need encoding
17
- let ranges = [
18
- // https://tools.ietf.org/html/rfc2045#section-6.7
19
- [0x09], // <TAB>
20
- [0x0a], // <LF>
21
- [0x0d], // <CR>
22
- [0x20, 0x3c], // <SP>!"#$%&'()*+,-./0123456789:;
23
- [0x3e, 0x7e] // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
24
- ];
25
- let result = '';
26
- let ord;
27
-
28
- for (let i = 0, len = buffer.length; i < len; i++) {
29
- ord = buffer[i];
30
- // if the char is in allowed range, then keep as is, unless it is a WS in the end of a line
31
- if (
32
- checkRanges(ord, ranges) &&
33
- !((ord === 0x20 || ord === 0x09) && (i === len - 1 || buffer[i + 1] === 0x0a || buffer[i + 1] === 0x0d))
34
- ) {
35
- result += String.fromCharCode(ord);
36
- continue;
37
- }
38
- result += '=' + (ord < 0x10 ? '0' : '') + ord.toString(16).toUpperCase();
39
- }
40
-
41
- return result;
42
- }
43
-
44
- /**
45
- * Adds soft line breaks to a Quoted-Printable string
46
- *
47
- * @param {String} str Quoted-Printable encoded string that might need line wrapping
48
- * @param {Number} [lineLength=76] Maximum allowed length for a line
49
- * @returns {String} Soft-wrapped Quoted-Printable encoded string
50
- */
51
- function wrap(str, lineLength) {
52
- str = (str || '').toString();
53
- lineLength = lineLength || 76;
54
-
55
- if (str.length <= lineLength) {
56
- return str;
57
- }
58
-
59
- let pos = 0;
60
- let len = str.length;
61
- let match, code, line;
62
- let lineMargin = Math.floor(lineLength / 3);
63
- let result = '';
64
-
65
- // insert soft linebreaks where needed
66
- while (pos < len) {
67
- line = str.substr(pos, lineLength);
68
- if ((match = line.match(/\r\n/))) {
69
- line = line.substr(0, match.index + match[0].length);
70
- result += line;
71
- pos += line.length;
72
- continue;
73
- }
74
-
75
- if (line.substr(-1) === '\n') {
76
- // nothing to change here
77
- result += line;
78
- pos += line.length;
79
- continue;
80
- } else if ((match = line.substr(-lineMargin).match(/\n.*?$/))) {
81
- // truncate to nearest line break
82
- line = line.substr(0, line.length - (match[0].length - 1));
83
- result += line;
84
- pos += line.length;
85
- continue;
86
- } else if (line.length > lineLength - lineMargin && (match = line.substr(-lineMargin).match(/[ \t.,!?][^ \t.,!?]*$/))) {
87
- // truncate to nearest space
88
- line = line.substr(0, line.length - (match[0].length - 1));
89
- } else if (line.match(/[=][\da-f]{0,2}$/i)) {
90
- // push incomplete encoding sequences to the next line
91
- if ((match = line.match(/[=][\da-f]{0,1}$/i))) {
92
- line = line.substr(0, line.length - match[0].length);
93
- }
94
-
95
- // ensure that utf-8 sequences are not split
96
- while (
97
- line.length > 3 &&
98
- line.length < len - pos &&
99
- !line.match(/^(?:=[\da-f]{2}){1,4}$/i) &&
100
- (match = line.match(/[=][\da-f]{2}$/gi))
101
- ) {
102
- code = parseInt(match[0].substr(1, 2), 16);
103
- if (code < 128) {
104
- break;
105
- }
106
-
107
- line = line.substr(0, line.length - 3);
108
-
109
- if (code >= 0xc0) {
110
- break;
111
- }
112
- }
113
- }
114
-
115
- if (pos + line.length < len && line.substr(-1) !== '\n') {
116
- if (line.length === lineLength && line.match(/[=][\da-f]{2}$/i)) {
117
- line = line.substr(0, line.length - 3);
118
- } else if (line.length === lineLength) {
119
- line = line.substr(0, line.length - 1);
120
- }
121
- pos += line.length;
122
- line += '=\r\n';
123
- } else {
124
- pos += line.length;
125
- }
126
-
127
- result += line;
128
- }
129
-
130
- return result;
131
- }
132
-
133
- /**
134
- * Helper function to check if a number is inside provided ranges
135
- *
136
- * @param {Number} nr Number to check for
137
- * @param {Array} ranges An Array of allowed values
138
- * @returns {Boolean} True if the value was found inside allowed ranges, false otherwise
139
- */
140
- function checkRanges(nr, ranges) {
141
- for (let i = ranges.length - 1; i >= 0; i--) {
142
- if (!ranges[i].length) {
143
- continue;
144
- }
145
- if (ranges[i].length === 1 && nr === ranges[i][0]) {
146
- return true;
147
- }
148
- if (ranges[i].length === 2 && nr >= ranges[i][0] && nr <= ranges[i][1]) {
149
- return true;
150
- }
151
- }
152
- return false;
153
- }
154
-
155
- /**
156
- * Creates a transform stream for encoding data to Quoted-Printable encoding
157
- *
158
- * @constructor
159
- * @param {Object} options Stream options
160
- * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping
161
- */
162
- class Encoder extends Transform {
163
- constructor(options) {
164
- super();
165
-
166
- // init Transform
167
- this.options = options || {};
168
-
169
- if (this.options.lineLength !== false) {
170
- this.options.lineLength = this.options.lineLength || 76;
171
- }
172
-
173
- this._curLine = '';
174
-
175
- this.inputBytes = 0;
176
- this.outputBytes = 0;
177
- }
178
-
179
- _transform(chunk, encoding, done) {
180
- let qp;
181
-
182
- if (encoding !== 'buffer') {
183
- chunk = Buffer.from(chunk, encoding);
184
- }
185
-
186
- if (!chunk || !chunk.length) {
187
- return done();
188
- }
189
-
190
- this.inputBytes += chunk.length;
191
-
192
- if (this.options.lineLength) {
193
- qp = this._curLine + encode(chunk);
194
- qp = wrap(qp, this.options.lineLength);
195
- qp = qp.replace(/(^|\n)([^\n]*)$/, (match, lineBreak, lastLine) => {
196
- this._curLine = lastLine;
197
- return lineBreak;
198
- });
199
-
200
- if (qp) {
201
- this.outputBytes += qp.length;
202
- this.push(qp);
203
- }
204
- } else {
205
- qp = encode(chunk);
206
- this.outputBytes += qp.length;
207
- this.push(qp, 'ascii');
208
- }
209
-
210
- done();
211
- }
212
-
213
- _flush(done) {
214
- if (this._curLine) {
215
- this.outputBytes += this._curLine.length;
216
- this.push(this._curLine, 'ascii');
217
- }
218
- done();
219
- }
220
- }
221
-
222
- // expose to the world
223
- module.exports = {
224
- encode,
225
- wrap,
226
- Encoder
227
- };