Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / services / routing / server / applications / gotoif.js
index a29f20f..42c7999 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22a6=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x3b31b4,_0x3c8483){var _0x117f7f=function(_0xe98958){while(--_0xe98958){_0x3b31b4['push'](_0x3b31b4['shift']());}};_0x117f7f(++_0x3c8483);}(_0x22a6,0x1f0));var _0x622a=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x22a6[_0x31b5a5];return _0x364cc9;};'use strict';var schema=require(_0x622a('0x0'));var _=require(_0x622a('0x1'));var htmlToText=require(_0x622a('0x2'));var utils=require(_0x622a('0x3'));var logger=require(_0x622a('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x622a('0x5'),'required':!![],'message':_0x622a('0x6')},'priorityTrue':{'type':_0x622a('0x7'),'message':_0x622a('0x8')},'priorityFalse':{'type':_0x622a('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x622a('0x9')]=function(_0x449455,_0xae810a){return function(_0x5352de){try{var _0x286e60={'condition':htmlToText['fromString'](utils[_0x622a('0xa')](_0xae810a[0x0],this),{'wordwrap':![]})[_0x622a('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xae810a[0x1],'priorityFalse':_0xae810a[0x2]};var _0x258a74=gotoif[_0x622a('0x0')](_0x286e60,{'typecast':!![]});if(_0x258a74[_0x622a('0xc')]){logger['error'](_0x622a('0xd'),_0x449455,_['map'](_0x258a74,_0x622a('0xe'))[_0x622a('0xf')](',\x20'));_0x5352de[_0x622a('0x10')]();}else{try{var _0x528981=eval('('+_0x286e60[_0x622a('0x11')]+')');var _0x5d8073=_0x528981?_0x286e60['priorityTrue']:_0x286e60[_0x622a('0x12')];logger[_0x622a('0x13')](_0x622a('0x14'),_0x449455,_0x286e60['condition'],_0x528981,_0x5d8073||_0x622a('0x15'));if(_0x5d8073){var _0x47f29d=_[_0x622a('0x16')](_0x5352de['rules'](),{'p':_0x5d8073});if(_0x47f29d>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x449455,_0x5d8073||_0x622a('0x15'),_0x47f29d);_0x5352de[_0x622a('0x15')](_0x47f29d);}else{logger[_0x622a('0x13')](_0x622a('0x17'),_0x449455,_0x5d8073||_0x622a('0x15'));_0x5352de[_0x622a('0x10')]();}}else{_0x5352de['next']();}}catch(_0x34c7c1){logger['error'](_0x622a('0x18'),_0x449455,_0x34c7c1['message']);_0x5352de[_0x622a('0x10')]();}}}catch(_0x3bcd70){logger['error']('[%s][GOTOIF]\x20%s',_0x449455,JSON[_0x622a('0x19')](_0x3bcd70));_0x5352de[_0x622a('0x10')]();}};};
\ No newline at end of file
+var _0x6ccb=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info'];(function(_0x2a7eb9,_0x4c6cac){var _0x448808=function(_0x34d55c){while(--_0x34d55c){_0x2a7eb9['push'](_0x2a7eb9['shift']());}};_0x448808(++_0x4c6cac);}(_0x6ccb,0x109));var _0xb6cc=function(_0x50d5a5,_0x423e3c){_0x50d5a5=_0x50d5a5-0x0;var _0x2561f6=_0x6ccb[_0x50d5a5];return _0x2561f6;};'use strict';var schema=require(_0xb6cc('0x0'));var _=require(_0xb6cc('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xb6cc('0x2'));var logger=require('../../../../config/logger')(_0xb6cc('0x3'));var gotoif=schema({'condition':{'type':_0xb6cc('0x4'),'required':!![],'message':_0xb6cc('0x5')},'priorityTrue':{'type':_0xb6cc('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xb6cc('0x7')}});exports['consequence']=function(_0x24a568,_0x308aca){return function(_0x198143){try{var _0x494245={'condition':htmlToText[_0xb6cc('0x8')](utils[_0xb6cc('0x9')](_0x308aca[0x0],this),{'wordwrap':![]})[_0xb6cc('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x308aca[0x1],'priorityFalse':_0x308aca[0x2]};var _0x22397c=gotoif['validate'](_0x494245,{'typecast':!![]});if(_0x22397c[_0xb6cc('0xb')]){logger[_0xb6cc('0xc')](_0xb6cc('0xd'),_0x24a568,_[_0xb6cc('0xe')](_0x22397c,_0xb6cc('0xf'))[_0xb6cc('0x10')](',\x20'));_0x198143['stop']();}else{try{var _0x39c7a4=eval('('+_0x494245[_0xb6cc('0x11')]+')');var _0x33d503=_0x39c7a4?_0x494245[_0xb6cc('0x12')]:_0x494245[_0xb6cc('0x13')];logger['info'](_0xb6cc('0x14'),_0x24a568,_0x494245[_0xb6cc('0x11')],_0x39c7a4,_0x33d503||_0xb6cc('0x15'));if(_0x33d503){var _0x26b24f=_[_0xb6cc('0x16')](_0x198143[_0xb6cc('0x17')](),{'p':_0x33d503});if(_0x26b24f>=0x0){logger[_0xb6cc('0x18')](_0xb6cc('0x19'),_0x24a568,_0x33d503||_0xb6cc('0x15'),_0x26b24f);_0x198143[_0xb6cc('0x15')](_0x26b24f);}else{logger[_0xb6cc('0x18')](_0xb6cc('0x1a'),_0x24a568,_0x33d503||_0xb6cc('0x15'));_0x198143['stop']();}}else{_0x198143[_0xb6cc('0x15')]();}}catch(_0x786a3a){logger[_0xb6cc('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x24a568,_0x786a3a[_0xb6cc('0xf')]);_0x198143[_0xb6cc('0x1b')]();}}}catch(_0x254ce0){logger[_0xb6cc('0xc')](_0xb6cc('0xd'),_0x24a568,JSON[_0xb6cc('0x1c')](_0x254ce0));_0x198143[_0xb6cc('0x1b')]();}};};
\ No newline at end of file