Built motion from commit eddce310.|2.6.12
[motion2.git] / server / services / routing / server / applications / gotoif.js
index b52dba7..7446d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1b1=['message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','lodash','html-to-text','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','fromString','getMustacheRender','replace','validate','length','error','map'];(function(_0x53972a,_0xdd86a1){var _0x2d8aa9=function(_0x381551){while(--_0x381551){_0x53972a['push'](_0x53972a['shift']());}};_0x2d8aa9(++_0xdd86a1);}(_0xf1b1,0x1cf));var _0x1f1b=function(_0xb65ffb,_0x2cc0af){_0xb65ffb=_0xb65ffb-0x0;var _0x58f55c=_0xf1b1[_0xb65ffb];return _0x58f55c;};'use strict';var schema=require('validate');var _=require(_0x1f1b('0x0'));var htmlToText=require(_0x1f1b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x1f1b('0x2'),'required':!![],'message':_0x1f1b('0x3')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x1f1b('0x4')]=function(_0x29409c,_0x55855b){return function(_0x221d44){try{var _0x2c74b1={'condition':htmlToText[_0x1f1b('0x5')](utils[_0x1f1b('0x6')](_0x55855b[0x0],this),{'wordwrap':![]})[_0x1f1b('0x7')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x55855b[0x1],'priorityFalse':_0x55855b[0x2]};var _0x5920c9=gotoif[_0x1f1b('0x8')](_0x2c74b1,{'typecast':!![]});if(_0x5920c9[_0x1f1b('0x9')]){logger[_0x1f1b('0xa')]('[%s][GOTOIF]\x20%s',_0x29409c,_[_0x1f1b('0xb')](_0x5920c9,_0x1f1b('0xc'))[_0x1f1b('0xd')](',\x20'));_0x221d44['stop']();}else{try{var _0x196fc8=eval('('+_0x2c74b1[_0x1f1b('0xe')]+')');var _0x42ea5a=_0x196fc8?_0x2c74b1[_0x1f1b('0xf')]:_0x2c74b1[_0x1f1b('0x10')];logger[_0x1f1b('0x11')](_0x1f1b('0x12'),_0x29409c,_0x2c74b1[_0x1f1b('0xe')],_0x196fc8,_0x42ea5a||'next');if(_0x42ea5a){var _0x5a4c78=_[_0x1f1b('0x13')](_0x221d44['rules'](),{'p':_0x42ea5a});if(_0x5a4c78>=0x0){logger['info'](_0x1f1b('0x14'),_0x29409c,_0x42ea5a||_0x1f1b('0x15'),_0x5a4c78);_0x221d44['next'](_0x5a4c78);}else{logger[_0x1f1b('0x11')](_0x1f1b('0x16'),_0x29409c,_0x42ea5a||_0x1f1b('0x15'));_0x221d44['stop']();}}else{_0x221d44[_0x1f1b('0x15')]();}}catch(_0x490d11){logger[_0x1f1b('0xa')](_0x1f1b('0x17'),_0x29409c,_0x490d11['message']);_0x221d44['stop']();}}}catch(_0x492277){logger[_0x1f1b('0xa')]('[%s][GOTOIF]\x20%s',_0x29409c,JSON['stringify'](_0x492277));_0x221d44[_0x1f1b('0x18')]();}};};
\ No newline at end of file
+var _0xb5d7=['priorityTrue','priorityFalse','info','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x17876c,_0x17c9e3){var _0x26844b=function(_0x497029){while(--_0x497029){_0x17876c['push'](_0x17876c['shift']());}};_0x26844b(++_0x17c9e3);}(_0xb5d7,0x1a7));var _0x7b5d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb5d7[_0x465a0c];return _0x1e202e;};'use strict';var schema=require(_0x7b5d('0x0'));var _=require(_0x7b5d('0x1'));var htmlToText=require(_0x7b5d('0x2'));var utils=require('./utils');var logger=require(_0x7b5d('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x7b5d('0x4'),'required':!![],'message':_0x7b5d('0x5')},'priorityTrue':{'type':'number','message':_0x7b5d('0x6')},'priorityFalse':{'type':_0x7b5d('0x7'),'message':_0x7b5d('0x8')}});exports['consequence']=function(_0x2a1d1a,_0x29471a){return function(_0x4ee808){try{var _0x69cb33={'condition':htmlToText[_0x7b5d('0x9')](utils['getMustacheRender'](_0x29471a[0x0],this),{'wordwrap':![]})[_0x7b5d('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x29471a[0x1],'priorityFalse':_0x29471a[0x2]};var _0x2f3002=gotoif[_0x7b5d('0x0')](_0x69cb33,{'typecast':!![]});if(_0x2f3002[_0x7b5d('0xb')]){logger[_0x7b5d('0xc')](_0x7b5d('0xd'),_0x2a1d1a,_[_0x7b5d('0xe')](_0x2f3002,_0x7b5d('0xf'))[_0x7b5d('0x10')](',\x20'));_0x4ee808[_0x7b5d('0x11')]();}else{try{var _0x3237d8=eval('('+_0x69cb33[_0x7b5d('0x12')]+')');var _0x14d9e3=_0x3237d8?_0x69cb33[_0x7b5d('0x13')]:_0x69cb33[_0x7b5d('0x14')];logger[_0x7b5d('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2a1d1a,_0x69cb33[_0x7b5d('0x12')],_0x3237d8,_0x14d9e3||_0x7b5d('0x16'));if(_0x14d9e3){var _0x18e6a6=_['findIndex'](_0x4ee808['rules'](),{'p':_0x14d9e3});if(_0x18e6a6>=0x0){logger[_0x7b5d('0x15')](_0x7b5d('0x17'),_0x2a1d1a,_0x14d9e3||_0x7b5d('0x16'),_0x18e6a6);_0x4ee808[_0x7b5d('0x16')](_0x18e6a6);}else{logger['info'](_0x7b5d('0x18'),_0x2a1d1a,_0x14d9e3||_0x7b5d('0x16'));_0x4ee808['stop']();}}else{_0x4ee808['next']();}}catch(_0x1c96b9){logger[_0x7b5d('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2a1d1a,_0x1c96b9[_0x7b5d('0xf')]);_0x4ee808['stop']();}}}catch(_0x1d173d){logger[_0x7b5d('0xc')](_0x7b5d('0xd'),_0x2a1d1a,JSON[_0x7b5d('0x19')](_0x1d173d));_0x4ee808['stop']();}};};
\ No newline at end of file