Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 4a2ada1..f503bb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bea=['routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','./utils'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7bea,0x103));var _0xa7be=function(_0x1bcc92,_0x4929b8){_0x1bcc92=_0x1bcc92-0x0;var _0x88406a=_0x7bea[_0x1bcc92];return _0x88406a;};'use strict';var schema=require(_0xa7be('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xa7be('0x1'));var logger=require('../../../../config/logger')(_0xa7be('0x2'));var gotoif=schema({'condition':{'type':_0xa7be('0x3'),'required':!![],'message':_0xa7be('0x4')},'priorityTrue':{'type':_0xa7be('0x5'),'message':_0xa7be('0x6')},'priorityFalse':{'type':_0xa7be('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xa7be('0x7')]=function(_0x132f46,_0x45d84c){return function(_0x406cee){try{var _0x415250={'condition':htmlToText[_0xa7be('0x8')](utils[_0xa7be('0x9')](_0x45d84c[0x0],this),{'wordwrap':![]})[_0xa7be('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x45d84c[0x1],'priorityFalse':_0x45d84c[0x2]};var _0x23606b=gotoif['validate'](_0x415250,{'typecast':!![]});if(_0x23606b[_0xa7be('0xb')]){logger['error']('[%s][GOTOIF]\x20%s',_0x132f46,_[_0xa7be('0xc')](_0x23606b,_0xa7be('0xd'))['join'](',\x20'));_0x406cee[_0xa7be('0xe')]();}else{try{var _0x505d22=eval('('+_0x415250[_0xa7be('0xf')]+')');var _0x4ec18c=_0x505d22?_0x415250[_0xa7be('0x10')]:_0x415250[_0xa7be('0x11')];logger[_0xa7be('0x12')](_0xa7be('0x13'),_0x132f46,_0x415250['condition'],_0x505d22,_0x4ec18c||_0xa7be('0x14'));if(_0x4ec18c){var _0x9b6269=_[_0xa7be('0x15')](_0x406cee[_0xa7be('0x16')](),{'p':_0x4ec18c});if(_0x9b6269>=0x0){logger[_0xa7be('0x12')](_0xa7be('0x17'),_0x132f46,_0x4ec18c||_0xa7be('0x14'),_0x9b6269);_0x406cee[_0xa7be('0x14')](_0x9b6269);}else{logger[_0xa7be('0x12')](_0xa7be('0x18'),_0x132f46,_0x4ec18c||_0xa7be('0x14'));_0x406cee[_0xa7be('0xe')]();}}else{_0x406cee['next']();}}catch(_0x34783e){logger[_0xa7be('0x19')](_0xa7be('0x1a'),_0x132f46,_0x34783e[_0xa7be('0xd')]);_0x406cee[_0xa7be('0xe')]();}}}catch(_0x14a50f){logger[_0xa7be('0x19')](_0xa7be('0x1b'),_0x132f46,JSON[_0xa7be('0x1c')](_0x14a50f));_0x406cee['stop']();}};};
\ No newline at end of file
+var _0xad77=['condition','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','length','[%s][GOTOIF]\x20%s','message','join','stop'];(function(_0x533e92,_0xf9623d){var _0xcb078d=function(_0x283a66){while(--_0x283a66){_0x533e92['push'](_0x533e92['shift']());}};_0xcb078d(++_0xf9623d);}(_0xad77,0x8d));var _0x7ad7=function(_0x3c8e36,_0x422420){_0x3c8e36=_0x3c8e36-0x0;var _0x31d8a5=_0xad77[_0x3c8e36];return _0x31d8a5;};'use strict';var schema=require(_0x7ad7('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x7ad7('0x1'));var logger=require(_0x7ad7('0x2'))(_0x7ad7('0x3'));var gotoif=schema({'condition':{'type':_0x7ad7('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x7ad7('0x5'),'message':_0x7ad7('0x6')},'priorityFalse':{'type':_0x7ad7('0x5'),'message':_0x7ad7('0x7')}});exports[_0x7ad7('0x8')]=function(_0x320f33,_0x56da7b){return function(_0x165c97){try{var _0x103576={'condition':htmlToText['fromString'](utils[_0x7ad7('0x9')](_0x56da7b[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x56da7b[0x1],'priorityFalse':_0x56da7b[0x2]};var _0x397a2f=gotoif[_0x7ad7('0x0')](_0x103576,{'typecast':!![]});if(_0x397a2f[_0x7ad7('0xa')]){logger['error'](_0x7ad7('0xb'),_0x320f33,_['map'](_0x397a2f,_0x7ad7('0xc'))[_0x7ad7('0xd')](',\x20'));_0x165c97[_0x7ad7('0xe')]();}else{try{var _0x5c9d9e=eval('('+_0x103576[_0x7ad7('0xf')]+')');var _0x185545=_0x5c9d9e?_0x103576['priorityTrue']:_0x103576[_0x7ad7('0x10')];logger[_0x7ad7('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x320f33,_0x103576['condition'],_0x5c9d9e,_0x185545||_0x7ad7('0x12'));if(_0x185545){var _0x46ccac=_[_0x7ad7('0x13')](_0x165c97[_0x7ad7('0x14')](),{'p':_0x185545});if(_0x46ccac>=0x0){logger[_0x7ad7('0x11')](_0x7ad7('0x15'),_0x320f33,_0x185545||_0x7ad7('0x12'),_0x46ccac);_0x165c97['next'](_0x46ccac);}else{logger['info'](_0x7ad7('0x16'),_0x320f33,_0x185545||_0x7ad7('0x12'));_0x165c97[_0x7ad7('0xe')]();}}else{_0x165c97[_0x7ad7('0x12')]();}}catch(_0x5d600a){logger[_0x7ad7('0x17')](_0x7ad7('0x18'),_0x320f33,_0x5d600a[_0x7ad7('0xc')]);_0x165c97['stop']();}}}catch(_0x10b221){logger['error']('[%s][GOTOIF]\x20%s',_0x320f33,JSON[_0x7ad7('0x19')](_0x10b221));_0x165c97[_0x7ad7('0xe')]();}};};
\ No newline at end of file