Built motion from commit f74363e9.|2.6.34
[motion2.git] / server / services / ami / trigger / integration / util.js
index 79d0feb..a469b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe92=['test','lodash','util','length','sortBy','type','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','customVariable','slice','substring','lastIndexOf','isNil'];(function(_0x2a72e7,_0x9da708){var _0x4dca68=function(_0x16f928){while(--_0x16f928){_0x2a72e7['push'](_0x2a72e7['shift']());}};_0x4dca68(++_0x9da708);}(_0xfe92,0x1d5));var _0x2fe9=function(_0x30a457,_0x2aa6b5){_0x30a457=_0x30a457-0x0;var _0x2ae5cd=_0xfe92[_0x30a457];return _0x2ae5cd;};'use strict';var _=require(_0x2fe9('0x0'));var util=require(_0x2fe9('0x1'));exports['getString']=function(_0x174b30,_0x359511,_0x556c35){var _0x5a7606=[];if(_0x174b30[_0x2fe9('0x2')]>0x0){var _0x57aca2=_[_0x2fe9('0x3')](_0x174b30,['id']);for(var _0x37e55f=0x0;_0x37e55f<_0x57aca2[_0x2fe9('0x2')];_0x37e55f++){var _0x3912fd=_0x57aca2[_0x37e55f];if(_0x3912fd[_0x2fe9('0x4')]==='string'){_0x5a7606[_0x2fe9('0x5')](_0x3912fd[_0x2fe9('0x6')]);}else if(_0x3912fd['type']===_0x2fe9('0x7')&&_0x3912fd[_0x2fe9('0x8')]){_0x359511[_0x3912fd[_0x2fe9('0x8')]]&&_0x5a7606[_0x2fe9('0x5')](_0x359511[_0x3912fd[_0x2fe9('0x8')]][_0x2fe9('0x9')]());}else if(_0x3912fd['type']==='customVariable'&&_0x3912fd['Variable']&&_0x3912fd[_0x2fe9('0xa')][_0x2fe9('0xb')]){_0x359511[_0x3912fd[_0x2fe9('0xa')][_0x2fe9('0xb')][_0x2fe9('0xc')]()]&&_0x5a7606['push'](_0x359511[_0x3912fd[_0x2fe9('0xa')][_0x2fe9('0xb')][_0x2fe9('0xc')]()]['toString']());}else if(_0x3912fd[_0x2fe9('0x4')]===_0x2fe9('0xd')){if(_0x3912fd[_0x2fe9('0xe')]===_0x2fe9('0xf')&&_0x3912fd[_0x2fe9('0x10')]){_0x5a7606[_0x2fe9('0x5')](util[_0x2fe9('0x11')](_0x2fe9('0x12'),_0x3912fd[_0x2fe9('0x10')],_0x3912fd[_0x2fe9('0x13')]));}else if(_0x3912fd[_0x2fe9('0xe')]==='variable'&&_0x3912fd[_0x2fe9('0x8')]&&_0x3912fd[_0x2fe9('0x10')]){_0x359511[_0x3912fd[_0x2fe9('0x8')]]&&_0x5a7606[_0x2fe9('0x5')](util['format']('%s:\x20%s',_0x3912fd['key'],_0x359511[_0x3912fd[_0x2fe9('0x8')]]));}else if(_0x3912fd[_0x2fe9('0xe')]===_0x2fe9('0x14')&&_0x3912fd[_0x2fe9('0xa')]&&_0x3912fd['Variable']['name']&&_0x3912fd[_0x2fe9('0x10')]){_0x359511[_0x3912fd[_0x2fe9('0xa')][_0x2fe9('0xb')]['toLowerCase']()]&&_0x5a7606[_0x2fe9('0x5')](util['format'](_0x2fe9('0x12'),_0x3912fd['key'],_0x359511[_0x3912fd[_0x2fe9('0xa')]['name']['toLowerCase']()]));}}}}return _0x5a7606['join'](_0x556c35);};exports['stripTrailingSlash']=function(_0x3e7b83){var _0x4b4283=_0x3e7b83[_0x2fe9('0x15')](-0x1);if(_0x4b4283==='/'){_0x3e7b83=_0x3e7b83[_0x2fe9('0x16')](0x0,_0x3e7b83[_0x2fe9('0x17')](_0x4b4283));}return _0x3e7b83;};exports['validateEmail']=function(_0x3b182a){if(!_[_0x2fe9('0x18')](_0x3b182a)&&_0x3b182a!==''){var _0x5cb069=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x5cb069[_0x2fe9('0x19')](String(_0x3b182a)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0xf588=['getString','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','validateEmail','test','lodash','util'];(function(_0x23a987,_0x4d34b9){var _0x1e3506=function(_0x458166){while(--_0x458166){_0x23a987['push'](_0x23a987['shift']());}};_0x1e3506(++_0x4d34b9);}(_0xf588,0xe8));var _0x8f58=function(_0x4a843e,_0x2bb8a8){_0x4a843e=_0x4a843e-0x0;var _0x162034=_0xf588[_0x4a843e];return _0x162034;};'use strict';var _=require(_0x8f58('0x0'));var util=require(_0x8f58('0x1'));exports[_0x8f58('0x2')]=function(_0x2fba8a,_0x47d42c,_0x22e561){var _0x577cb9=[];if(_0x2fba8a['length']>0x0){var _0x2adda1=_['sortBy'](_0x2fba8a,['id']);for(var _0x218d79=0x0;_0x218d79<_0x2adda1[_0x8f58('0x3')];_0x218d79++){var _0x36d601=_0x2adda1[_0x218d79];if(_0x36d601[_0x8f58('0x4')]===_0x8f58('0x5')){_0x577cb9[_0x8f58('0x6')](_0x36d601[_0x8f58('0x7')]);}else if(_0x36d601[_0x8f58('0x4')]===_0x8f58('0x8')&&_0x36d601['variableName']){_0x47d42c[_0x36d601['variableName']]&&_0x577cb9['push'](_0x47d42c[_0x36d601[_0x8f58('0x9')]][_0x8f58('0xa')]());}else if(_0x36d601[_0x8f58('0x4')]===_0x8f58('0xb')&&_0x36d601[_0x8f58('0xc')]&&_0x36d601[_0x8f58('0xc')]['name']){_0x47d42c[_0x36d601['Variable']['name']['toLowerCase']()]&&_0x577cb9[_0x8f58('0x6')](_0x47d42c[_0x36d601[_0x8f58('0xc')][_0x8f58('0xd')][_0x8f58('0xe')]()][_0x8f58('0xa')]());}else if(_0x36d601[_0x8f58('0x4')]===_0x8f58('0xf')){if(_0x36d601[_0x8f58('0x10')]===_0x8f58('0x5')&&_0x36d601[_0x8f58('0x11')]){_0x577cb9[_0x8f58('0x6')](util[_0x8f58('0x12')](_0x8f58('0x13'),_0x36d601[_0x8f58('0x11')],_0x36d601[_0x8f58('0x14')]));}else if(_0x36d601[_0x8f58('0x10')]===_0x8f58('0x8')&&_0x36d601['variableName']&&_0x36d601[_0x8f58('0x11')]){_0x47d42c[_0x36d601[_0x8f58('0x9')]]&&_0x577cb9[_0x8f58('0x6')](util[_0x8f58('0x12')]('%s:\x20%s',_0x36d601[_0x8f58('0x11')],_0x47d42c[_0x36d601[_0x8f58('0x9')]]));}else if(_0x36d601[_0x8f58('0x10')]==='customVariable'&&_0x36d601[_0x8f58('0xc')]&&_0x36d601[_0x8f58('0xc')][_0x8f58('0xd')]&&_0x36d601[_0x8f58('0x11')]){_0x47d42c[_0x36d601[_0x8f58('0xc')][_0x8f58('0xd')][_0x8f58('0xe')]()]&&_0x577cb9['push'](util[_0x8f58('0x12')](_0x8f58('0x13'),_0x36d601[_0x8f58('0x11')],_0x47d42c[_0x36d601[_0x8f58('0xc')]['name'][_0x8f58('0xe')]()]));}}}}return _0x577cb9[_0x8f58('0x15')](_0x22e561);};exports[_0x8f58('0x16')]=function(_0xd759c3){var _0x1d607c=_0xd759c3[_0x8f58('0x17')](-0x1);if(_0x1d607c==='/'){_0xd759c3=_0xd759c3['substring'](0x0,_0xd759c3['lastIndexOf'](_0x1d607c));}return _0xd759c3;};exports[_0x8f58('0x18')]=function(_0x4a2013){if(!_['isNil'](_0x4a2013)&&_0x4a2013!==''){var _0x46fb48=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x46fb48[_0x8f58('0x19')](String(_0x4a2013)['toLowerCase']());}else{return![];}};
\ No newline at end of file