@4site/engrid-scripts 0.22.7 → 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.
@@ -98,7 +98,7 @@ export interface Options {
98
98
  };
99
99
  VGS?: false | {
100
100
  "transaction.ccnumber"?: {
101
- showCardIcon?: boolean;
101
+ showCardIcon?: boolean | object;
102
102
  css?: {
103
103
  [key: string]: string | object;
104
104
  };
@@ -109,7 +109,7 @@ export interface Options {
109
109
  placeholder?: string;
110
110
  };
111
111
  "transaction.ccvv"?: {
112
- showCardIcon?: boolean;
112
+ showCardIcon?: boolean | object;
113
113
  css?: {
114
114
  [key: string]: string | object;
115
115
  };
@@ -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
  }
@@ -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.7";
1
+ export declare const AppVersion = "0.22.9";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const AppVersion = "0.22.7";
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.7",
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": "23a4d37177c0037841f0220226752c7180233317",
28
+ "gitHead": "12d37d720dee51ffbe9b3fba07de92d0d63c1139",
29
29
  "devDependencies": {
30
30
  "nodemon": "^2.0.20"
31
31
  }