{ "kind": "open-flow-workflow", "version": 1, "name": "Validate Emails and Extract Domains", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_0cae88c100e7b34f": { "name": "Run the example", "kind": "start", "inputDefs": [] }, "n_d0e2026c5cca3870": { "inputs": { "rows": { "kind": "value", "value": [ { "email": "person1@example.com", "confirmed": true }, { "email": "person2@example.com", "confirmed": false }, { "email": "person3@example.com", "confirmed": true }, { "email": "person4@example.com", "confirmed": false }, { "email": "person5@example.com", "confirmed": true }, { "email": "person6@example.com", "confirmed": false }, { "email": "person7@example.com", "confirmed": true }, { "email": "person8@example.com", "confirmed": false }, { "email": "person9@example.com", "confirmed": true }, { "email": "person10@example.com", "confirmed": false } ] } }, "name": "Validate email rows", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "rows" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "rows" } ], "name": "Validate email rows", "moduleId": "n_f9b20ee589f30e04", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_ae7fe8ddc0818763": { "name": "Validated rows", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "rows" } ], "outputMappings": { "rows": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d0e2026c5cca3870", "output": "rows" } ] } } } }, "edges": [ { "source": "n_0cae88c100e7b34f", "target": "n_d0e2026c5cca3870" }, { "source": "n_d0e2026c5cca3870", "target": "n_ae7fe8ddc0818763" } ] } }, "modules": { "n_f9b20ee589f30e04": { "name": "Validate email rows", "imports": [], "source": "/* validator.js 13.7.0 license:\nCopyright (c) 2018 Chris O'Hara \n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\nvar Z=Object.create;var z=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Y=(e,t,r,a)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let l of H(t))!K.call(e,l)&&l!==r&&z(e,l,{get:()=>t[l],enumerable:!(a=G(t,l))||a.enumerable});return e};var T=(e,t,r)=>(r=e!=null?Z(J(e)):{},Y(t||!e||!e.__esModule?z(r,\"default\",{value:e,enumerable:!0}):r,e));var o=s((c,q)=>{\"use strict\";Object.defineProperty(c,\"__esModule\",{value:!0});c.default=j;function p(e){\"@babel/helpers - typeof\";return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?p=function(r){return typeof r}:p=function(r){return r&&typeof Symbol==\"function\"&&r.constructor===Symbol&&r!==Symbol.prototype?\"symbol\":typeof r},p(e)}function j(e){var t=typeof e==\"string\"||e instanceof String;if(!t){var r=p(e);throw e===null?r=\"null\":r===\"object\"&&(r=e.constructor.name),new TypeError(\"Expected a string but received a \".concat(r))}}q.exports=c.default;q.exports.default=c.default});var S=s((d,w)=>{\"use strict\";Object.defineProperty(d,\"__esModule\",{value:!0});d.default=ee;function ee(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)typeof e[r]>\"u\"&&(e[r]=t[r]);return e}w.exports=d.default;w.exports.default=d.default});var C=s((_,D)=>{\"use strict\";Object.defineProperty(_,\"__esModule\",{value:!0});_.default=ae;var te=re(o());function re(e){return e&&e.__esModule?e:{default:e}}function F(e){\"@babel/helpers - typeof\";return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?F=function(r){return typeof r}:F=function(r){return r&&typeof Symbol==\"function\"&&r.constructor===Symbol&&r!==Symbol.prototype?\"symbol\":typeof r},F(e)}function ae(e,t){(0,te.default)(e);var r,a;F(t)===\"object\"?(r=t.min||0,a=t.max):(r=arguments[1],a=arguments[2]);var l=encodeURI(e).split(/%..|./).length-1;return l>=r&&(typeof a>\"u\"||l<=a)}D.exports=_.default;D.exports.default=_.default});var N=s((m,E)=>{\"use strict\";Object.defineProperty(m,\"__esModule\",{value:!0});m.default=fe;var le=L(o()),ue=L(S());function L(e){return e&&e.__esModule?e:{default:e}}var ne={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1};function fe(e,t){(0,le.default)(e),t=(0,ue.default)(t,ne),t.allow_trailing_dot&&e[e.length-1]===\".\"&&(e=e.substring(0,e.length-1)),t.allow_wildcard===!0&&e.indexOf(\"*.\")===0&&(e=e.substring(2));var r=e.split(\".\"),a=r[r.length-1];return t.require_tld&&(r.length<2||!/^([a-z\\u00A1-\\u00A8\\u00AA-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a)||/\\s/.test(a))||!t.allow_numeric_tld&&/^\\d+$/.test(a)?!1:r.every(function(l){return!(l.length>63||!/^[a-z_\\u00a1-\\uffff0-9-]+$/i.test(l)||/[\\uff01-\\uff5e]/.test(l)||/^-|-$/.test(l)||!t.allow_underscores&&/_/.test(l))})}E.exports=m.default;E.exports.default=m.default});var k=s((x,$)=>{\"use strict\";Object.defineProperty(x,\"__esModule\",{value:!0});x.default=P;var ie=se(o());function se(e){return e&&e.__esModule?e:{default:e}}var W=\"(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\",i=\"(\".concat(W,\"[.]){3}\").concat(W),ce=new RegExp(\"^\".concat(i,\"$\")),u=\"(?:[0-9a-fA-F]{1,4})\",oe=new RegExp(\"^(\"+\"(?:\".concat(u,\":){7}(?:\").concat(u,\"|:)|\")+\"(?:\".concat(u,\":){6}(?:\").concat(i,\"|:\").concat(u,\"|:)|\")+\"(?:\".concat(u,\":){5}(?::\").concat(i,\"|(:\").concat(u,\"){1,2}|:)|\")+\"(?:\".concat(u,\":){4}(?:(:\").concat(u,\"){0,1}:\").concat(i,\"|(:\").concat(u,\"){1,3}|:)|\")+\"(?:\".concat(u,\":){3}(?:(:\").concat(u,\"){0,2}:\").concat(i,\"|(:\").concat(u,\"){1,4}|:)|\")+\"(?:\".concat(u,\":){2}(?:(:\").concat(u,\"){0,3}:\").concat(i,\"|(:\").concat(u,\"){1,5}|:)|\")+\"(?:\".concat(u,\":){1}(?:(:\").concat(u,\"){0,4}:\").concat(i,\"|(:\").concat(u,\"){1,6}|:)|\")+\"(?::((?::\".concat(u,\"){0,5}:\").concat(i,\"|(?::\").concat(u,\"){1,7}|:))\")+\")(%[0-9a-zA-Z-.:]{1,})?$\");function P(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:\"\";if((0,ie.default)(e),t=String(t),!t)return P(e,4)||P(e,6);if(t===\"4\"){if(!ce.test(e))return!1;var r=e.split(\".\").sort(function(a,l){return a-l});return r[3]<=255}return t===\"6\"?!!oe.test(e):!1}$.exports=x.default;$.exports.default=x.default});var B=s((v,M)=>{\"use strict\";Object.defineProperty(v,\"__esModule\",{value:!0});v.default=we;var de=g(o()),_e=g(S()),A=g(C()),me=g(N()),Q=g(k());function g(e){return e&&e.__esModule?e:{default:e}}var xe={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:\"\",ignore_max_length:!1,host_blacklist:[]},ge=/^([^\\x00-\\x1F\\x7F-\\x9F\\cX]+)]/.test(t);if(r){if(t===e)return!1;var a=t.split('\"').length===t.split('\\\\\"').length;if(!a)return!1}return!0}function we(e,t){if((0,de.default)(e),t=(0,_e.default)(t,xe),t.require_display_name||t.allow_display_name){var r=e.match(ge);if(r){var a=r[1];if(e=e.replace(a,\"\").replace(/(^<|>$)/g,\"\"),a.endsWith(\" \")&&(a=a.substr(0,a.length-1)),!qe(a))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>be)return!1;var l=e.split(\"@\"),f=l.pop(),y=f.toLowerCase();if(t.host_blacklist.includes(y))return!1;var n=l.join(\"@\");if(t.domain_specific_validation&&(y===\"gmail.com\"||y===\"googlemail.com\")){n=n.toLowerCase();var I=n.split(\"+\")[0];if(!(0,A.default)(I.replace(/\\./g,\"\"),{min:6,max:30}))return!1;for(var R=I.split(\".\"),h=0;h{let r=typeof t.email==\"string\"?t.email:\"\",a=(0,V.default)(r),l=a?r.slice(r.lastIndexOf(\"@\")+1):void 0;return{...t,\"Valid EmailIs email \":String(a),\"Extract Domain\":l??\"\"}})}}export{Se as default};\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }