triangle-utils 1.0.9 → 1.0.11

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.
package/clients.js CHANGED
@@ -7,7 +7,7 @@ export default function get_clients(config) {
7
7
  if (config.region !== undefined) {
8
8
  clients.dynamodb = new DynamoDB({ region : config.region })
9
9
  }
10
- if (config.google_email !== undefined && config.google_app_password) {
10
+ if (config.google_email !== undefined && config.google_app_password !== undefined) {
11
11
  clients.transporter = nodemailer.createTransport({
12
12
  service: "Gmail",
13
13
  host: "smtp.gmail.com",
package/index.js CHANGED
@@ -6,6 +6,7 @@ import get_clients from "./clients.js"
6
6
 
7
7
  export default function get_utils(config) {
8
8
  const clients = get_clients(config)
9
+ console.log(clients)
9
10
  const utils = {}
10
11
  for (const utils_list of [utils_misc, utils_dynamodb]) {
11
12
  for (const [util_name, util] of Object.entries(utils_list)) {
package/misc.js CHANGED
@@ -13,6 +13,7 @@ export function get_current_time(clients, milliseconds = false) {
13
13
  }
14
14
 
15
15
  export async function send_email(clients, recipient, subject, text) {
16
+ console.log(clients)
16
17
  for (let i = 0; i < 3; i++) {
17
18
  try {
18
19
  await clients.transporter.sendMail({
@@ -30,7 +31,7 @@ export async function send_email(clients, recipient, subject, text) {
30
31
 
31
32
  export async function admin_alert(clients, text) {
32
33
  console.log("ADMIN ALERT:", text)
33
- await send_email(clients.config.google_email, "ADMIN ALERT", text)
34
+ await send_email(clients, clients.config.google_email, "ADMIN ALERT", text)
34
35
  }
35
36
 
36
37
  export async function safe_run(clients, f) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "index.js",
5
5
  "author": "",
6
6
  "license": "ISC",
package/test.js ADDED
File without changes