Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / services / routing / server / applications / gotoif.js
index dbcd8d1..f2835ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec09=['[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','fromString','replace','length','error','[%s][GOTOIF]\x20%s','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\x20not\x20found'];(function(_0x559335,_0x3f211b){var _0x44f033=function(_0x1dce2b){while(--_0x1dce2b){_0x559335['push'](_0x559335['shift']());}};_0x44f033(++_0x3f211b);}(_0xec09,0xd9));var _0x9ec0=function(_0x55fec7,_0x33caf4){_0x55fec7=_0x55fec7-0x0;var _0x2474cc=_0xec09[_0x55fec7];return _0x2474cc;};'use strict';var schema=require(_0x9ec0('0x0'));var _=require(_0x9ec0('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0x9ec0('0x2'))('routing');var gotoif=schema({'condition':{'type':_0x9ec0('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x9ec0('0x4'),'message':_0x9ec0('0x5')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x28b06f,_0x690bd4){return function(_0x38494e){try{var _0x90f949={'condition':htmlToText[_0x9ec0('0x6')](utils['getMustacheRender'](_0x690bd4[0x0],this),{'wordwrap':![]})[_0x9ec0('0x7')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x690bd4[0x1],'priorityFalse':_0x690bd4[0x2]};var _0x3f19bf=gotoif[_0x9ec0('0x0')](_0x90f949,{'typecast':!![]});if(_0x3f19bf[_0x9ec0('0x8')]){logger[_0x9ec0('0x9')](_0x9ec0('0xa'),_0x28b06f,_[_0x9ec0('0xb')](_0x3f19bf,_0x9ec0('0xc'))['join'](',\x20'));_0x38494e[_0x9ec0('0xd')]();}else{try{var _0x569528=eval('('+_0x90f949[_0x9ec0('0xe')]+')');var _0x54b375=_0x569528?_0x90f949[_0x9ec0('0xf')]:_0x90f949[_0x9ec0('0x10')];logger[_0x9ec0('0x11')](_0x9ec0('0x12'),_0x28b06f,_0x90f949[_0x9ec0('0xe')],_0x569528,_0x54b375||_0x9ec0('0x13'));if(_0x54b375){var _0x1807c0=_[_0x9ec0('0x14')](_0x38494e[_0x9ec0('0x15')](),{'p':_0x54b375});if(_0x1807c0>=0x0){logger[_0x9ec0('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x28b06f,_0x54b375||'next',_0x1807c0);_0x38494e[_0x9ec0('0x13')](_0x1807c0);}else{logger[_0x9ec0('0x11')](_0x9ec0('0x16'),_0x28b06f,_0x54b375||_0x9ec0('0x13'));_0x38494e[_0x9ec0('0xd')]();}}else{_0x38494e[_0x9ec0('0x13')]();}}catch(_0x1e023c){logger['error'](_0x9ec0('0x17'),_0x28b06f,_0x1e023c[_0x9ec0('0xc')]);_0x38494e[_0x9ec0('0xd')]();}}}catch(_0x3cbe04){logger['error']('[%s][GOTOIF]\x20%s',_0x28b06f,JSON['stringify'](_0x3cbe04));_0x38494e['stop']();}};};
\ No newline at end of file
+var _0x5ee1=['../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','[%s][GOTOIF]\x20%s','map','message','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils'];(function(_0x1c15d5,_0x3d52e6){var _0x1bad2c=function(_0x22bd4f){while(--_0x22bd4f){_0x1c15d5['push'](_0x1c15d5['shift']());}};_0x1bad2c(++_0x3d52e6);}(_0x5ee1,0x175));var _0x15ee=function(_0x3302bb,_0x11c44a){_0x3302bb=_0x3302bb-0x0;var _0x360c64=_0x5ee1[_0x3302bb];return _0x360c64;};'use strict';var schema=require(_0x15ee('0x0'));var _=require(_0x15ee('0x1'));var htmlToText=require(_0x15ee('0x2'));var utils=require(_0x15ee('0x3'));var logger=require(_0x15ee('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x15ee('0x5'),'required':!![],'message':_0x15ee('0x6')},'priorityTrue':{'type':_0x15ee('0x7'),'message':_0x15ee('0x8')},'priorityFalse':{'type':_0x15ee('0x7'),'message':_0x15ee('0x9')}});exports[_0x15ee('0xa')]=function(_0x117d18,_0x4baa79){return function(_0x2a60c2){try{var _0x51eaa6={'condition':htmlToText[_0x15ee('0xb')](utils['getMustacheRender'](_0x4baa79[0x0],this),{'wordwrap':![]})[_0x15ee('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4baa79[0x1],'priorityFalse':_0x4baa79[0x2]};var _0x430000=gotoif['validate'](_0x51eaa6,{'typecast':!![]});if(_0x430000['length']){logger['error'](_0x15ee('0xd'),_0x117d18,_[_0x15ee('0xe')](_0x430000,_0x15ee('0xf'))['join'](',\x20'));_0x2a60c2['stop']();}else{try{var _0xaac67e=eval('('+_0x51eaa6[_0x15ee('0x10')]+')');var _0x20186f=_0xaac67e?_0x51eaa6[_0x15ee('0x11')]:_0x51eaa6[_0x15ee('0x12')];logger['info'](_0x15ee('0x13'),_0x117d18,_0x51eaa6[_0x15ee('0x10')],_0xaac67e,_0x20186f||'next');if(_0x20186f){var _0x35d86a=_[_0x15ee('0x14')](_0x2a60c2[_0x15ee('0x15')](),{'p':_0x20186f});if(_0x35d86a>=0x0){logger[_0x15ee('0x16')](_0x15ee('0x17'),_0x117d18,_0x20186f||_0x15ee('0x18'),_0x35d86a);_0x2a60c2[_0x15ee('0x18')](_0x35d86a);}else{logger[_0x15ee('0x16')](_0x15ee('0x19'),_0x117d18,_0x20186f||_0x15ee('0x18'));_0x2a60c2[_0x15ee('0x1a')]();}}else{_0x2a60c2['next']();}}catch(_0xc413bc){logger[_0x15ee('0x1b')](_0x15ee('0x1c'),_0x117d18,_0xc413bc['message']);_0x2a60c2[_0x15ee('0x1a')]();}}}catch(_0x31357a){logger[_0x15ee('0x1b')](_0x15ee('0xd'),_0x117d18,JSON['stringify'](_0x31357a));_0x2a60c2['stop']();}};};
\ No newline at end of file