ayiin 1.0.19 → 1.0.20

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 (2) hide show
  1. package/index.d.ts +14 -5
  2. package/package.json +3 -2
package/index.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  import nodemailer from 'nodemailer';
2
+ import smtpTransport from 'nodemailer-smtp-transport';
3
+
2
4
 
3
5
 
4
6
  declare module 'ayiin';
5
7
 
6
8
  declare class Ayiin {
9
+ email: string
10
+ password: string
11
+ array: []
12
+ object: {}
13
+ mail: any
7
14
  constructor(
8
15
  email: string,
9
16
  password: string
@@ -12,26 +19,27 @@ declare class Ayiin {
12
19
  this.password = password;
13
20
  this.array = [];
14
21
  this.object = {};
15
- this.mail = nodemailer.createTransport({
22
+ this.mail = nodemailer.createTransport(smtpTransport({
16
23
  service: 'gmail',
17
24
  host: "smtp.gmail.com",
25
+ secure: true,
18
26
  port: 587,
19
27
  auth: {
20
28
  user: this.email,
21
29
  pass: this.password
22
30
  }
23
- });
31
+ }));
24
32
  }
25
33
 
26
- sendEmail(toEmail: string, subject: string, textHtml: string) {
34
+ sendEmail(from: string, toEmail: string, subject: string, textHtml: any) {
27
35
  let mailOptions = {
28
- from: this.email,
36
+ from: from,
29
37
  to: toEmail,
30
38
  subject: subject,
31
39
  html: textHtml
32
40
  };
33
41
 
34
- this.mail.sendMail(mailOptions, (err, info) => {
42
+ this.mail.sendMail(mailOptions, (err: any, info: any) => {
35
43
  if (err) {
36
44
  console.log({ error: err });
37
45
  }
@@ -45,6 +53,7 @@ declare class Ayiin {
45
53
  for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
46
54
  return result;
47
55
  };
56
+
48
57
  };
49
58
 
50
59
  export default Ayiin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ayiin",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Library Pribadi Yang Gak Ada Isinya",
5
5
  "type": "module",
6
6
  "author": "AyiinXd",
@@ -14,6 +14,7 @@
14
14
  "test": "echo \"Error: no test specified\" && exit 1"
15
15
  },
16
16
  "dependencies": {
17
- "nodemailer": "^6.9.7"
17
+ "nodemailer": "^6.9.7",
18
+ "nodemailer-smtp-transport": "^2.7.4"
18
19
  }
19
20
  }