@open-source-initiative/notify-email
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -0,1 +1,20 @@ | ||
import nodemailer from 'nodemailer'; | ||
export declare const buildBasicConfigs: ({ host, port, username, password }: { | ||
host: string; | ||
port?: number | undefined; | ||
username: string; | ||
password: string; | ||
}, configs?: nodemailer.TransportOptions) => { | ||
component?: string | undefined; | ||
host: string; | ||
port: number | undefined; | ||
auth: { | ||
user: string; | ||
pass: string; | ||
}; | ||
secure: boolean; | ||
tls: { | ||
rejectUnauthorized: boolean; | ||
}; | ||
}; | ||
export declare const BASE_CONFIGS: { | ||
@@ -2,0 +21,0 @@ secure: boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BASE_CONFIGS = void 0; | ||
exports.BASE_CONFIGS = exports.buildBasicConfigs = void 0; | ||
const buildBasicConfigs = ({ host, port, username, password }, configs) => { | ||
return Object.assign(Object.assign(Object.assign({}, exports.BASE_CONFIGS), { host, | ||
port, auth: { | ||
user: username, | ||
pass: password | ||
} }), configs); | ||
}; | ||
exports.buildBasicConfigs = buildBasicConfigs; | ||
exports.BASE_CONFIGS = { | ||
@@ -5,0 +13,0 @@ secure: true, |
@@ -5,12 +5,3 @@ import nodemailer from 'nodemailer'; | ||
private configs; | ||
private username; | ||
private password; | ||
constructor({ username, password }: { | ||
username: string; | ||
password: string; | ||
}, configs: nodemailer.TransportOptions); | ||
setCredentials({ username, password }: { | ||
username: string; | ||
password: string; | ||
}): void; | ||
constructor(configs: nodemailer.TransportOptions); | ||
setConfigurations(configs: any): void; | ||
@@ -17,0 +8,0 @@ sendEmail(payload: nodemailer.SendMailOptions): Promise<unknown>; |
@@ -42,11 +42,5 @@ "use strict"; | ||
class Email { | ||
constructor({ username, password }, configs) { | ||
this.username = username; | ||
this.password = password; | ||
constructor(configs) { | ||
this.configs = configs; | ||
} | ||
setCredentials({ username, password }) { | ||
this.username = username; | ||
this.password = password; | ||
} | ||
setConfigurations(configs) { | ||
@@ -57,5 +51,2 @@ this.configs = configs; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!this.username || !this.password) { | ||
throw new Error('Email Credentials Not Set'); | ||
} | ||
if (!this.configs) { | ||
@@ -62,0 +53,0 @@ throw new Error('Email Configurations Not Set'); |
{ | ||
"name": "@open-source-initiative/notify-email", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Nodemailer wrapper for simple \"send email\" cases", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
22756
256