@4site/engrid-scripts 0.22.8 → 0.22.9
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/dist/neverbounce.d.ts +2 -0
- package/dist/neverbounce.js +22 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/neverbounce.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare class NeverBounce {
|
|
|
12
12
|
private logger;
|
|
13
13
|
private shouldRun;
|
|
14
14
|
private nbLoaded;
|
|
15
|
+
private bypassEmails;
|
|
15
16
|
constructor(apiKey: string, dateField: string | null, statusField: string | null, dateFormat: string | undefined);
|
|
16
17
|
private init;
|
|
17
18
|
private clearStatus;
|
|
@@ -19,5 +20,6 @@ export declare class NeverBounce {
|
|
|
19
20
|
private setEmailStatus;
|
|
20
21
|
private insertAfter;
|
|
21
22
|
private wrap;
|
|
23
|
+
private isBypassEmail;
|
|
22
24
|
private validate;
|
|
23
25
|
}
|
package/dist/neverbounce.js
CHANGED
|
@@ -14,6 +14,14 @@ export class NeverBounce {
|
|
|
14
14
|
this.logger = new EngridLogger("NeverBounce", "#039bc4", "#dfdfdf", "📧");
|
|
15
15
|
this.shouldRun = true;
|
|
16
16
|
this.nbLoaded = false;
|
|
17
|
+
this.bypassEmails = [
|
|
18
|
+
"noaddress.ea",
|
|
19
|
+
];
|
|
20
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
21
|
+
if (searchParams.has("bypassemailvalidation")) {
|
|
22
|
+
this.logger.log("Bypass Email Validation Enabled - not running NeverBounce");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
17
25
|
this.emailField = document.getElementById("en__field_supporter_emailAddress");
|
|
18
26
|
window._NBSettings = {
|
|
19
27
|
apiKey: this.apiKey,
|
|
@@ -154,6 +162,10 @@ export class NeverBounce {
|
|
|
154
162
|
this.logger.log("E-mail Field Not Found");
|
|
155
163
|
return;
|
|
156
164
|
}
|
|
165
|
+
if (this.isBypassEmail()) {
|
|
166
|
+
this.logger.log("Bypass email detected. Skipping status update.");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
157
169
|
// Search page for the NB Wrapper div and set as variable
|
|
158
170
|
const nb_email_field_wrapper = (document.getElementById("nb-wrapper"));
|
|
159
171
|
// Search page for the NB Feedback div and set as variable
|
|
@@ -222,6 +234,12 @@ export class NeverBounce {
|
|
|
222
234
|
(_a = el.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(wrapper, el);
|
|
223
235
|
wrapper.appendChild(el);
|
|
224
236
|
}
|
|
237
|
+
isBypassEmail() {
|
|
238
|
+
if (!this.emailField || !this.emailField.value)
|
|
239
|
+
return false;
|
|
240
|
+
const email = this.emailField.value.toLowerCase();
|
|
241
|
+
return this.bypassEmails.some((bypassEmail) => email.includes(bypassEmail.toLowerCase()));
|
|
242
|
+
}
|
|
225
243
|
validate() {
|
|
226
244
|
var _a;
|
|
227
245
|
if (!this.form.validate)
|
|
@@ -231,6 +249,10 @@ export class NeverBounce {
|
|
|
231
249
|
this.logger.log("validate(): Should Not Run. Returning true.");
|
|
232
250
|
return;
|
|
233
251
|
}
|
|
252
|
+
if (this.isBypassEmail()) {
|
|
253
|
+
this.logger.log("Bypass email detected. Skipping validation.");
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
234
256
|
if (this.nbStatus) {
|
|
235
257
|
this.nbStatus.value = nbResult;
|
|
236
258
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AppVersion = "0.22.
|
|
1
|
+
export declare const AppVersion = "0.22.9";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AppVersion = "0.22.
|
|
1
|
+
export const AppVersion = "0.22.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4site/engrid-scripts",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.9",
|
|
4
4
|
"description": "Scripts for the ENGRID Project",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"strongly-typed-events": "^2.0.9"
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/4site-interactive-studios/engrid#readme",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "12d37d720dee51ffbe9b3fba07de92d0d63c1139",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"nodemon": "^2.0.20"
|
|
31
31
|
}
|