polikolog 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/.idea/5lab.iml +12 -0
  2. package/.idea/inspectionProfiles/Project_Default.xml +10 -0
  3. package/.idea/jsLibraryMappings.xml +6 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/06-02.js +48 -0
  7. package/06-03.js +22 -0
  8. package/06-04.js +22 -0
  9. package/index.html +41 -0
  10. package/m0603.js +28 -0
  11. package/mypackage/m0603.js +28 -0
  12. package/mypackage/node_modules/.package-lock.json +24 -0
  13. package/mypackage/node_modules/nodemailer/.gitattributes +6 -0
  14. package/mypackage/node_modules/nodemailer/.prettierrc.js +8 -0
  15. package/mypackage/node_modules/nodemailer/CHANGELOG.md +725 -0
  16. package/mypackage/node_modules/nodemailer/CODE_OF_CONDUCT.md +76 -0
  17. package/mypackage/node_modules/nodemailer/CONTRIBUTING.md +67 -0
  18. package/mypackage/node_modules/nodemailer/LICENSE +16 -0
  19. package/mypackage/node_modules/nodemailer/README.md +97 -0
  20. package/mypackage/node_modules/nodemailer/SECURITY.txt +22 -0
  21. package/mypackage/node_modules/nodemailer/lib/addressparser/index.js +313 -0
  22. package/mypackage/node_modules/nodemailer/lib/base64/index.js +142 -0
  23. package/mypackage/node_modules/nodemailer/lib/dkim/index.js +251 -0
  24. package/mypackage/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  25. package/mypackage/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  26. package/mypackage/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  27. package/mypackage/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  28. package/mypackage/node_modules/nodemailer/lib/fetch/index.js +274 -0
  29. package/mypackage/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  30. package/mypackage/node_modules/nodemailer/lib/mail-composer/index.js +558 -0
  31. package/mypackage/node_modules/nodemailer/lib/mailer/index.js +427 -0
  32. package/mypackage/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
  33. package/mypackage/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  34. package/mypackage/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
  35. package/mypackage/node_modules/nodemailer/lib/mime-node/index.js +1290 -0
  36. package/mypackage/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  37. package/mypackage/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  38. package/mypackage/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  39. package/mypackage/node_modules/nodemailer/lib/nodemailer.js +143 -0
  40. package/mypackage/node_modules/nodemailer/lib/qp/index.js +219 -0
  41. package/mypackage/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  42. package/mypackage/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
  43. package/mypackage/node_modules/nodemailer/lib/shared/index.js +638 -0
  44. package/mypackage/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  45. package/mypackage/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  46. package/mypackage/node_modules/nodemailer/lib/smtp-connection/index.js +1796 -0
  47. package/mypackage/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
  48. package/mypackage/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
  49. package/mypackage/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
  50. package/mypackage/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  51. package/mypackage/node_modules/nodemailer/lib/well-known/index.js +47 -0
  52. package/mypackage/node_modules/nodemailer/lib/well-known/services.json +286 -0
  53. package/mypackage/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
  54. package/mypackage/node_modules/nodemailer/package.json +46 -0
  55. package/mypackage/node_modules/nodemailer/postinstall.js +101 -0
  56. package/mypackage/package.json +15 -0
  57. package/package.json +15 -0
package/.idea/5lab.iml ADDED
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,10 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
5
+ <Languages>
6
+ <language minSize="81" name="JavaScript" />
7
+ </Languages>
8
+ </inspection_tool>
9
+ </profile>
10
+ </component>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="JavaScriptLibraryMappings">
4
+ <includedPredefinedLibrary name="Node.js Core" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/5lab.iml" filepath="$PROJECT_DIR$/.idea/5lab.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+ </component>
6
+ </project>
package/06-02.js ADDED
@@ -0,0 +1,48 @@
1
+ const nodeMailer = require("nodemailer");
2
+ const http = require("http");
3
+ const fs = require("fs");
4
+
5
+ function send(from, pass, message) {
6
+ let transporter = nodeMailer.createTransport({
7
+ host: 'smtp.mail.ru',
8
+ port: 465,
9
+ secure: true,
10
+ auth: {
11
+ user: from,
12
+ pass: pass
13
+ }
14
+ });
15
+
16
+ const mailOptions = {
17
+ from: from,
18
+ to: message.to,
19
+ subject: 'Sending Email using Node.js',
20
+ text: message.text
21
+ };
22
+
23
+ transporter.sendMail(mailOptions, (error, info) => {
24
+ if (error) {
25
+ return console.log(error);
26
+ }
27
+ console.log('Message %s sent: %s', info.messageId, info.response);
28
+ });
29
+ }
30
+
31
+ http.createServer((req, res) => {
32
+ if (req.url === "/") {
33
+ res.end(fs.readFileSync("index.html", 'utf-8'));
34
+ }
35
+ if (req.method === "POST") {
36
+ if (req.url === '/send-email') {
37
+ req.on('data', (data) => {
38
+ const mes = JSON.parse(data);
39
+ send(mes.from, mes.pass, {
40
+ to: mes.to,
41
+ text: mes.text
42
+ });
43
+ });
44
+ }
45
+ }
46
+ }).listen(5000, () => {
47
+ console.log("server started on port 5000");
48
+ });
package/06-03.js ADDED
@@ -0,0 +1,22 @@
1
+ const { send } = require("./m0603");
2
+ const http = require("http");
3
+ const fs = require("fs");
4
+
5
+ http.createServer((req, res) => {
6
+ if (req.url === "/") {
7
+ res.end(fs.readFileSync("index.html", 'utf-8'));
8
+ }
9
+ if (req.method === "POST") {
10
+ if (req.url === '/send-email') {
11
+ req.on('data', (data) => {
12
+ const mes = JSON.parse(data);
13
+ send(mes.from, mes.pass, {
14
+ to: mes.to,
15
+ text: mes.text
16
+ });
17
+ });
18
+ }
19
+ }
20
+ }).listen(5000, () => {
21
+ console.log("server started on port 5000");
22
+ });
package/06-04.js ADDED
@@ -0,0 +1,22 @@
1
+ const { send } = require("m0603");
2
+ const http = require("http");
3
+ const fs = require("fs");
4
+
5
+ http.createServer((req, res) => {
6
+ if (req.url === "/") {
7
+ res.end(fs.readFileSync("index.html", 'utf-8'));
8
+ }
9
+ if (req.method === "POST") {
10
+ if (req.url === '/send-email') {
11
+ req.on('data', (data) => {
12
+ const mes = JSON.parse(data);
13
+ send(mes.from, mes.pass, {
14
+ to: mes.to,
15
+ text: mes.text
16
+ });
17
+ });
18
+ }
19
+ }
20
+ }).listen(5000, () => {
21
+ console.log("server started on port 5000");
22
+ });
package/index.html ADDED
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Document</title>
8
+ </head>
9
+ <body>
10
+ <form method="post">
11
+ <h1> Форма пересылки сообщения </h1>
12
+ <h2>Введите адрес отправителя</h2>
13
+ <input id="from" name="from" type="text"/>
14
+ <h2>Введите адрес получателя</h2>
15
+ <input id="to" name="to" type="text"/>
16
+ <h2>Введите сообщение для пересылки</h2>
17
+ <input id="message" name="message" type="text"/>
18
+ <button id="send" type="submit" onclick="Post();"> Отправить</button>
19
+ </form>
20
+
21
+ <script>
22
+
23
+ function Post() {
24
+
25
+ fetch('/send-email', {
26
+ method: 'POST', mode: 'no-cors',
27
+ headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' },
28
+ body: JSON.stringify({
29
+ from: document.querySelector('#from').value, // bstulearning@mail.ru
30
+ to: document.querySelector('#to').value,
31
+ pass: 'fA9wAJg8qEUmhTsnTe42',
32
+ text: document.querySelector('#message').value
33
+ })
34
+ })
35
+ .then(response => response.json())
36
+
37
+ }
38
+
39
+ </script>
40
+ </body>
41
+ </html>
package/m0603.js ADDED
@@ -0,0 +1,28 @@
1
+ const nodeMailer = require("nodemailer");
2
+
3
+ module.exports.send = function (from, pass, message) {
4
+ let transporter = nodeMailer.createTransport({
5
+ host: 'smtp.mail.ru',
6
+ port: 465,
7
+ secure: true,
8
+ auth: {
9
+ user: from,
10
+ pass: pass
11
+ }
12
+ });
13
+
14
+ const mailOptions = {
15
+ from: from,
16
+ to: message.to,
17
+ subject: 'Sending Email using Node.js',
18
+ text: message.text
19
+ };
20
+
21
+ transporter.sendMail(mailOptions, (error, info) => {
22
+ if (error) {
23
+ return console.log(error);
24
+ }
25
+ console.log('Message %s sent: %s', info.messageId, info.response);
26
+ });
27
+ }
28
+
@@ -0,0 +1,28 @@
1
+ const nodeMailer = require("nodemailer");
2
+
3
+ module.exports.send = function (from, pass, message) {
4
+ let transporter = nodeMailer.createTransport({
5
+ host: 'smtp.mail.ru',
6
+ port: 465,
7
+ secure: true,
8
+ auth: {
9
+ user: from,
10
+ pass: pass
11
+ }
12
+ });
13
+
14
+ const mailOptions = {
15
+ from: from,
16
+ to: message.to,
17
+ subject: 'Sending Email using Node.js',
18
+ text: message.text
19
+ };
20
+
21
+ transporter.sendMail(mailOptions, (error, info) => {
22
+ if (error) {
23
+ return console.log(error);
24
+ }
25
+ console.log('Message %s sent: %s', info.messageId, info.response);
26
+ });
27
+ }
28
+
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "mail-egor-rudman",
3
+ "version": "1.0.3",
4
+ "lockfileVersion": 2,
5
+ "requires": true,
6
+ "packages": {
7
+ "node_modules/mail-egor-rudman": {
8
+ "version": "1.0.3",
9
+ "resolved": "https://registry.npmjs.org/mail-egor-rudman/-/mail-egor-rudman-1.0.3.tgz",
10
+ "integrity": "sha512-2QbE6DupqsXOmqDuVkYbUQ9QYZ5oBKZ8pYedzD8F2qDVAi3aMOgHt1UkWXQ89oa0+P1ZHW/1Cc+ktM/4qF7yEw==",
11
+ "dependencies": {
12
+ "nodemailer": "^6.9.1"
13
+ }
14
+ },
15
+ "node_modules/nodemailer": {
16
+ "version": "6.9.1",
17
+ "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.1.tgz",
18
+ "integrity": "sha512-qHw7dOiU5UKNnQpXktdgQ1d3OFgRAekuvbJLcdG5dnEo/GtcTHRYM7+UfJARdOFU9WUQO8OiIamgWPmiSFHYAA==",
19
+ "engines": {
20
+ "node": ">=6.0.0"
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,6 @@
1
+ *.js text eol=lf
2
+ *.txt text eol=lf
3
+ *.html text eol=lf
4
+ *.htm text eol=lf
5
+ *.ics -text
6
+ *.bin -text
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ printWidth: 160,
3
+ tabWidth: 4,
4
+ singleQuote: true,
5
+ endOfLine: 'lf',
6
+ trailingComma: 'none',
7
+ arrowParens: 'avoid'
8
+ };