Built motion from commit 896e83a8.|2.6.30
[motion2.git] / server / services / ami / trigger / integration / util.js
index 74a19c6..321012d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f5=['length','string','content','variable','variableName','push','customVariable','Variable','name','toLowerCase','toString','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lodash','getString'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x26f5,0x1a0));var _0x526f=function(_0xb77207,_0x377c84){_0xb77207=_0xb77207-0x0;var _0x4b80ad=_0x26f5[_0xb77207];return _0x4b80ad;};'use strict';var _=require(_0x526f('0x0'));var util=require('util');exports[_0x526f('0x1')]=function(_0x5260b8,_0x47d307,_0x44ad5d){var _0x7967b5=[];if(_0x5260b8[_0x526f('0x2')]>0x0){var _0x134421=_['sortBy'](_0x5260b8,['id']);for(var _0x3aa4d2=0x0;_0x3aa4d2<_0x134421[_0x526f('0x2')];_0x3aa4d2++){var _0x429d31=_0x134421[_0x3aa4d2];if(_0x429d31['type']===_0x526f('0x3')){_0x7967b5['push'](_0x429d31[_0x526f('0x4')]);}else if(_0x429d31['type']===_0x526f('0x5')&&_0x429d31[_0x526f('0x6')]){_0x47d307[_0x429d31[_0x526f('0x6')]]&&_0x7967b5[_0x526f('0x7')](_0x47d307[_0x429d31[_0x526f('0x6')]]['toString']());}else if(_0x429d31['type']===_0x526f('0x8')&&_0x429d31[_0x526f('0x9')]&&_0x429d31[_0x526f('0x9')][_0x526f('0xa')]){_0x47d307[_0x429d31['Variable'][_0x526f('0xa')][_0x526f('0xb')]()]&&_0x7967b5['push'](_0x47d307[_0x429d31[_0x526f('0x9')][_0x526f('0xa')][_0x526f('0xb')]()][_0x526f('0xc')]());}else if(_0x429d31['type']==='keyValue'){if(_0x429d31[_0x526f('0xd')]===_0x526f('0x3')&&_0x429d31[_0x526f('0xe')]){_0x7967b5[_0x526f('0x7')](util[_0x526f('0xf')](_0x526f('0x10'),_0x429d31['key'],_0x429d31[_0x526f('0x11')]));}else if(_0x429d31[_0x526f('0xd')]===_0x526f('0x5')&&_0x429d31[_0x526f('0x6')]&&_0x429d31[_0x526f('0xe')]){_0x47d307[_0x429d31['variableName']]&&_0x7967b5[_0x526f('0x7')](util[_0x526f('0xf')](_0x526f('0x10'),_0x429d31[_0x526f('0xe')],_0x47d307[_0x429d31['variableName']]));}else if(_0x429d31[_0x526f('0xd')]==='customVariable'&&_0x429d31['Variable']&&_0x429d31['Variable']['name']&&_0x429d31[_0x526f('0xe')]){_0x47d307[_0x429d31[_0x526f('0x9')][_0x526f('0xa')][_0x526f('0xb')]()]&&_0x7967b5[_0x526f('0x7')](util[_0x526f('0xf')](_0x526f('0x10'),_0x429d31['key'],_0x47d307[_0x429d31['Variable'][_0x526f('0xa')][_0x526f('0xb')]()]));}}}}return _0x7967b5[_0x526f('0x12')](_0x44ad5d);};exports[_0x526f('0x13')]=function(_0x1cd48d){var _0x36a9f8=_0x1cd48d[_0x526f('0x14')](-0x1);if(_0x36a9f8==='/'){_0x1cd48d=_0x1cd48d[_0x526f('0x15')](0x0,_0x1cd48d['lastIndexOf'](_0x36a9f8));}return _0x1cd48d;};exports['validateEmail']=function(_0x551a39){if(!_['isNil'](_0x551a39)&&_0x551a39!==''){var _0x351e28=/^(([^<>()\[\]\\.,;:\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 _0x351e28['test'](String(_0x551a39)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0xd6e6=['Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','keyContent','customVariable','key','join','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','variable','variableName','toString'];(function(_0xab4be,_0x4ad3b6){var _0x5552d6=function(_0x29f8b7){while(--_0x29f8b7){_0xab4be['push'](_0xab4be['shift']());}};_0x5552d6(++_0x4ad3b6);}(_0xd6e6,0x113));var _0x6d6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6d6e('0x0'));var util=require(_0x6d6e('0x1'));exports[_0x6d6e('0x2')]=function(_0x395e2b,_0x534d72,_0x1dbbfb){var _0x4dda98=[];if(_0x395e2b[_0x6d6e('0x3')]>0x0){var _0x4cbb7d=_[_0x6d6e('0x4')](_0x395e2b,['id']);for(var _0xad5f10=0x0;_0xad5f10<_0x4cbb7d[_0x6d6e('0x3')];_0xad5f10++){var _0x489fcb=_0x4cbb7d[_0xad5f10];if(_0x489fcb[_0x6d6e('0x5')]===_0x6d6e('0x6')){_0x4dda98[_0x6d6e('0x7')](_0x489fcb['content']);}else if(_0x489fcb[_0x6d6e('0x5')]===_0x6d6e('0x8')&&_0x489fcb[_0x6d6e('0x9')]){_0x534d72[_0x489fcb['variableName']]&&_0x4dda98[_0x6d6e('0x7')](_0x534d72[_0x489fcb['variableName']][_0x6d6e('0xa')]());}else if(_0x489fcb[_0x6d6e('0x5')]==='customVariable'&&_0x489fcb[_0x6d6e('0xb')]&&_0x489fcb['Variable']['name']){_0x534d72[_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')][_0x6d6e('0xd')]()]&&_0x4dda98['push'](_0x534d72[_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')]['toLowerCase']()][_0x6d6e('0xa')]());}else if(_0x489fcb[_0x6d6e('0x5')]===_0x6d6e('0xe')){if(_0x489fcb[_0x6d6e('0xf')]===_0x6d6e('0x6')&&_0x489fcb['key']){_0x4dda98[_0x6d6e('0x7')](util[_0x6d6e('0x10')](_0x6d6e('0x11'),_0x489fcb['key'],_0x489fcb[_0x6d6e('0x12')]));}else if(_0x489fcb[_0x6d6e('0xf')]===_0x6d6e('0x8')&&_0x489fcb[_0x6d6e('0x9')]&&_0x489fcb['key']){_0x534d72[_0x489fcb['variableName']]&&_0x4dda98['push'](util[_0x6d6e('0x10')]('%s:\x20%s',_0x489fcb['key'],_0x534d72[_0x489fcb['variableName']]));}else if(_0x489fcb[_0x6d6e('0xf')]===_0x6d6e('0x13')&&_0x489fcb[_0x6d6e('0xb')]&&_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')]&&_0x489fcb[_0x6d6e('0x14')]){_0x534d72[_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')][_0x6d6e('0xd')]()]&&_0x4dda98[_0x6d6e('0x7')](util[_0x6d6e('0x10')]('%s:\x20%s',_0x489fcb['key'],_0x534d72[_0x489fcb['Variable'][_0x6d6e('0xc')]['toLowerCase']()]));}}}}return _0x4dda98[_0x6d6e('0x15')](_0x1dbbfb);};exports['stripTrailingSlash']=function(_0x591efd){var _0x4c97da=_0x591efd['slice'](-0x1);if(_0x4c97da==='/'){_0x591efd=_0x591efd[_0x6d6e('0x16')](0x0,_0x591efd[_0x6d6e('0x17')](_0x4c97da));}return _0x591efd;};exports[_0x6d6e('0x18')]=function(_0x4542dc){if(!_[_0x6d6e('0x19')](_0x4542dc)&&_0x4542dc!==''){var _0x8b12ca=/^(([^<>()\[\]\\.,;:\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 _0x8b12ca['test'](String(_0x4542dc)[_0x6d6e('0xd')]());}else{return![];}};
\ No newline at end of file