-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced deliverability reporting request/models
- Loading branch information
1 parent
e2f14a3
commit 7797107
Showing
11 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class BlockListResult { | ||
constructor(data = {}) { | ||
this.id = data.id; | ||
this.name = data.name; | ||
this.result = data.result; | ||
} | ||
} | ||
|
||
module.exports = BlockListResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Content { | ||
constructor(data = {}) { | ||
this.embed = data.embed; | ||
this.iframe = data.iframe; | ||
this.object = data.object; | ||
this.script = data.script; | ||
this.shortUrls = data.shortUrls; | ||
this.textSize = data.textSize; | ||
this.totalSize = data.totalSize; | ||
this.missingAlt = data.missingAlt; | ||
this.missingListUnsubscribe = data.missingListUnsubscribe; | ||
} | ||
} | ||
|
||
module.exports = Content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const EmailAuthenticationResult = require('./emailAuthenticationResult'); | ||
const BlockListResult = require('./blockListResult'); | ||
const Content = require('./content'); | ||
const DnsRecords = require('./dnsRecords'); | ||
const SpamAssassinResult = require('./spamAssassinResult'); | ||
|
||
class DeliverabilityReport { | ||
constructor(data = {}) { | ||
this.spf = new EmailAuthenticationResult(data.spf); | ||
this.dkim = (data.dkim || []).map((i) => (new EmailAuthenticationResult(i))); | ||
this.dmarc = new EmailAuthenticationResult(data.dmarc); | ||
this.blockLists = (data.blockLists || []).map((i) => (new BlockListResult(i))); | ||
this.content = new Content(data.content); | ||
this.dnsRecords = new DnsRecords(data.dnsRecords); | ||
this.spamAssassin = new SpamAssassinResult(data.spamAssassin); | ||
} | ||
} | ||
|
||
module.exports = DeliverabilityReport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class DnsRecords { | ||
constructor(data = {}) { | ||
this.a = data.a; | ||
this.mx = data.mx; | ||
this.ptr = data.ptr; | ||
} | ||
} | ||
|
||
module.exports = DnsRecords; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class EmailAuthenticationResult { | ||
constructor(data = {}) { | ||
this.result = data.result; | ||
this.description = data.description; | ||
this.rawValue = data.rawValue; | ||
this.tags = data.tags; | ||
} | ||
} | ||
|
||
module.exports = EmailAuthenticationResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const SpamAssassinRule = require('./spamAssassinRule'); | ||
|
||
class SpamAssassinResult { | ||
constructor(data = {}) { | ||
this.score = data.score; | ||
this.result = data.result; | ||
this.rules = (data.rules || []).map((i) => (new SpamAssassinRule(i))); | ||
} | ||
} | ||
|
||
module.exports = SpamAssassinResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters