10 Commits

Author SHA1 Message Date
9abbcac166 1.0.14 2020-06-18 16:19:23 +00:00
5db2cd1077 fix(core): update 2020-06-18 16:19:22 +00:00
3de9178cd0 1.0.13 2020-06-18 15:34:06 +00:00
2b1f8a2718 fix(core): update 2020-06-18 15:34:05 +00:00
2117c2f5d9 1.0.12 2020-01-21 10:05:36 +00:00
ca0daf2454 fix(core): update 2020-01-21 10:05:35 +00:00
ad6d18d306 1.0.11 2020-01-13 15:52:28 +00:00
7ddcd88862 fix(core): update 2020-01-13 15:52:27 +00:00
9d6b7f3b29 1.0.10 2020-01-13 15:52:03 +00:00
8be9fc38b6 fix(core): update 2020-01-13 15:52:02 +00:00
9 changed files with 3971 additions and 592 deletions

View File

@ -7,6 +7,7 @@
"npmAccessLevel": "public"
},
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",

4487
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,29 @@
{
"name": "@pushrocks/smartmail",
"version": "1.0.9",
"version": "1.0.14",
"private": false,
"description": "a unified format for representing and dealing with mails",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"author": "Lossless GmbH",
"license": "UNLICENSED",
"scripts": {
"test": "(tstest test/)",
"format": "(gitzone format)",
"build": "(tsbuild)"
"build": "(tsbuild --web)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.17",
"@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^13.1.6",
"tslint": "^5.20.1",
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.33",
"@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^14.0.13",
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@pushrocks/smartfile": "^7.0.6",
"@pushrocks/smartdns": "^4.0.3",
"@pushrocks/smartfile": "^7.0.12",
"@pushrocks/smartmustache": "^2.0.9"
},
"files": [

View File

@ -8,7 +8,7 @@ a unified format for representing and dealing with mails
* [docs (typedoc)](https://pushrocks.gitlab.io/smartmail/)
## Status for master
[![build status](https://gitlab.com/pushrocks/smartmail/badges/master/build.svg)](https://gitlab.com/pushrocks/smartmail/commits/master)
[![pipeline status](https://gitlab.com/pushrocks/smartmail/badges/master/pipeline.svg)](https://gitlab.com/pushrocks/smartmail/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartmail/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartmail/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartmail.svg)](https://www.npmjs.com/package/@pushrocks/smartmail)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartmail/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartmail)
@ -18,6 +18,8 @@ a unified format for representing and dealing with mails
## Usage
Use TypeScript for best in class intellisense!
## Contribution

View File

@ -1,6 +1,17 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartmail from '../ts/index';
let emailAddressValidatorInstance: smartmail.EmailAddressValidator;
tap.test('should create an instance of EmailAddressValidator', async () => {
emailAddressValidatorInstance = new smartmail.EmailAddressValidator();
expect(emailAddressValidatorInstance).to.be.instanceOf(smartmail.EmailAddressValidator);
});
tap.test('should validate an email', async () => {
const result = await emailAddressValidatorInstance.validate('sandbox@bleu.de');
});
tap.test('first test', async () => {
const testSmartmail = new smartmail.Smartmail({
body: 'hi there',

View File

@ -1 +1,2 @@
export * from './smartmail.classes.smartmail';
export * from './smartmail.classes.emailaddressvalidator';

View File

@ -0,0 +1,19 @@
import * as plugins from './smartmail.plugins';
export interface IEmailValidationResult {
valid: boolean;
reason: string;
}
export class EmailAddressValidator {
public smartdns = new plugins.smartdns.Smartdns({});
public async validate(emailArg: string): Promise<IEmailValidationResult> {
const emailArray = emailArg.split('@');
const result = await this.smartdns.getRecord(emailArray[1], 'MX');
return {
valid: !!result,
reason: 'todo'
};
}
}

View File

@ -22,6 +22,10 @@ export class Smartmail<T> {
this.attachments.push(smartfileArg);
}
public getCreationObject(): T {
return this.options.creationObjectRef;
}
public getSubject(dataArg: any = {}) {
const smartmustache = new plugins.smartmustache.SmartMustache(this.options.subject);
return smartmustache.applyData(dataArg);

View File

@ -1,4 +1,5 @@
import * as smartdns from '@pushrocks/smartdns';
import * as smartfile from '@pushrocks/smartfile';
import * as smartmustache from '@pushrocks/smartmustache';
export { smartfile, smartmustache };
export { smartdns, smartfile, smartmustache };