Built motion from commit (unavailable).|2.2.2
[motion2.git] / server / services / routing / server / applications / gotoif.js
index d9dfe5b..5fe3abb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd6=['map','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s'];(function(_0x46e43a,_0x48c771){var _0xcfc79c=function(_0x31dd2f){while(--_0x31dd2f){_0x46e43a['push'](_0x46e43a['shift']());}};_0xcfc79c(++_0x48c771);}(_0xfcd6,0x187));var _0x6fcd=function(_0x58b44a,_0x1a7aa6){_0x58b44a=_0x58b44a-0x0;var _0xd6779d=_0xfcd6[_0x58b44a];return _0xd6779d;};'use strict';var schema=require(_0x6fcd('0x0'));var _=require(_0x6fcd('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x6fcd('0x2'));var logger=require(_0x6fcd('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x6fcd('0x4'),'required':!![],'message':_0x6fcd('0x5')},'priorityTrue':{'type':_0x6fcd('0x6'),'message':_0x6fcd('0x7')},'priorityFalse':{'type':'number','message':_0x6fcd('0x8')}});exports[_0x6fcd('0x9')]=function(_0x22c9bb,_0x46d64f){return function(_0x41fc75){try{var _0x3162d2={'condition':htmlToText[_0x6fcd('0xa')](utils[_0x6fcd('0xb')](_0x46d64f[0x0],this),{'wordwrap':![]})[_0x6fcd('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x46d64f[0x1],'priorityFalse':_0x46d64f[0x2]};var _0x28072a=gotoif['validate'](_0x3162d2,{'typecast':!![]});if(_0x28072a[_0x6fcd('0xd')]){logger['error'](_0x6fcd('0xe'),_0x22c9bb,_[_0x6fcd('0xf')](_0x28072a,'message')['join'](',\x20'));_0x41fc75[_0x6fcd('0x10')]();}else{try{var _0x4992dd=eval('('+_0x3162d2[_0x6fcd('0x11')]+')');var _0x455a51=_0x4992dd?_0x3162d2[_0x6fcd('0x12')]:_0x3162d2[_0x6fcd('0x13')];logger[_0x6fcd('0x14')](_0x6fcd('0x15'),_0x22c9bb,_0x3162d2['condition'],_0x4992dd,_0x455a51||'next');if(_0x455a51){var _0x499597=_['findIndex'](_0x41fc75[_0x6fcd('0x16')](),{'p':_0x455a51});if(_0x499597>=0x0){logger[_0x6fcd('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x22c9bb,_0x455a51||'next',_0x499597);_0x41fc75[_0x6fcd('0x17')](_0x499597);}else{logger[_0x6fcd('0x14')](_0x6fcd('0x18'),_0x22c9bb,_0x455a51||_0x6fcd('0x17'));_0x41fc75[_0x6fcd('0x10')]();}}else{_0x41fc75[_0x6fcd('0x17')]();}}catch(_0x222717){logger[_0x6fcd('0x19')](_0x6fcd('0x1a'),_0x22c9bb,_0x222717[_0x6fcd('0x1b')]);_0x41fc75['stop']();}}}catch(_0x379daf){logger['error'](_0x6fcd('0xe'),_0x22c9bb,JSON[_0x6fcd('0x1c')](_0x379daf));_0x41fc75['stop']();}};};
\ No newline at end of file
+var _0x2d51=['html-to-text','./utils','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash'];(function(_0x72e08e,_0x5bc441){var _0x477837=function(_0x58c62b){while(--_0x58c62b){_0x72e08e['push'](_0x72e08e['shift']());}};_0x477837(++_0x5bc441);}(_0x2d51,0x1e1));var _0x12d5=function(_0x559a2c,_0x49d3e1){_0x559a2c=_0x559a2c-0x0;var _0x4171c3=_0x2d51[_0x559a2c];return _0x4171c3;};'use strict';var schema=require(_0x12d5('0x0'));var _=require(_0x12d5('0x1'));var htmlToText=require(_0x12d5('0x2'));var utils=require(_0x12d5('0x3'));var logger=require('../../../../config/logger')(_0x12d5('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x12d5('0x5')},'priorityTrue':{'type':_0x12d5('0x6'),'message':_0x12d5('0x7')},'priorityFalse':{'type':_0x12d5('0x6'),'message':_0x12d5('0x8')}});exports['consequence']=function(_0x2ea308,_0x17cc92){return function(_0x49bb06){try{var _0xe9ce4={'condition':htmlToText[_0x12d5('0x9')](utils['getMustacheRender'](_0x17cc92[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x17cc92[0x1],'priorityFalse':_0x17cc92[0x2]};var _0x45a11d=gotoif[_0x12d5('0x0')](_0xe9ce4,{'typecast':!![]});if(_0x45a11d['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x2ea308,_['map'](_0x45a11d,_0x12d5('0xa'))['join'](',\x20'));_0x49bb06[_0x12d5('0xb')]();}else{try{var _0x4fd1f7=eval('('+_0xe9ce4[_0x12d5('0xc')]+')');var _0x1230ab=_0x4fd1f7?_0xe9ce4[_0x12d5('0xd')]:_0xe9ce4[_0x12d5('0xe')];logger[_0x12d5('0xf')](_0x12d5('0x10'),_0x2ea308,_0xe9ce4[_0x12d5('0xc')],_0x4fd1f7,_0x1230ab||_0x12d5('0x11'));if(_0x1230ab){var _0x34d26c=_['findIndex'](_0x49bb06['rules'](),{'p':_0x1230ab});if(_0x34d26c>=0x0){logger[_0x12d5('0xf')](_0x12d5('0x12'),_0x2ea308,_0x1230ab||'next',_0x34d26c);_0x49bb06[_0x12d5('0x11')](_0x34d26c);}else{logger[_0x12d5('0xf')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2ea308,_0x1230ab||_0x12d5('0x11'));_0x49bb06[_0x12d5('0xb')]();}}else{_0x49bb06[_0x12d5('0x11')]();}}catch(_0x3fd6b5){logger[_0x12d5('0x13')](_0x12d5('0x14'),_0x2ea308,_0x3fd6b5[_0x12d5('0xa')]);_0x49bb06[_0x12d5('0xb')]();}}}catch(_0x171f7b){logger['error'](_0x12d5('0x15'),_0x2ea308,JSON[_0x12d5('0x16')](_0x171f7b));_0x49bb06[_0x12d5('0xb')]();}};};
\ No newline at end of file