Built motion from commit eddce310.|2.6.12
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 8070a2e..7446d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8bc=['priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','join','condition'];(function(_0x4b4277,_0x22676f){var _0x1ff405=function(_0x2fa9e2){while(--_0x2fa9e2){_0x4b4277['push'](_0x4b4277['shift']());}};_0x1ff405(++_0x22676f);}(_0xf8bc,0x79));var _0xcf8b=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xf8bc[_0x5519a9];return _0x32f2cc;};'use strict';var schema=require(_0xcf8b('0x0'));var _=require(_0xcf8b('0x1'));var htmlToText=require(_0xcf8b('0x2'));var utils=require(_0xcf8b('0x3'));var logger=require('../../../../config/logger')(_0xcf8b('0x4'));var gotoif=schema({'condition':{'type':_0xcf8b('0x5'),'required':!![],'message':_0xcf8b('0x6')},'priorityTrue':{'type':_0xcf8b('0x7'),'message':_0xcf8b('0x8')},'priorityFalse':{'type':_0xcf8b('0x7'),'message':_0xcf8b('0x9')}});exports[_0xcf8b('0xa')]=function(_0x560035,_0x1d5345){return function(_0x57ca91){try{var _0x52d557={'condition':htmlToText[_0xcf8b('0xb')](utils[_0xcf8b('0xc')](_0x1d5345[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1d5345[0x1],'priorityFalse':_0x1d5345[0x2]};var _0x44e2d5=gotoif[_0xcf8b('0x0')](_0x52d557,{'typecast':!![]});if(_0x44e2d5[_0xcf8b('0xd')]){logger['error'](_0xcf8b('0xe'),_0x560035,_[_0xcf8b('0xf')](_0x44e2d5,_0xcf8b('0x10'))[_0xcf8b('0x11')](',\x20'));_0x57ca91['stop']();}else{try{var _0x2f4803=eval('('+_0x52d557[_0xcf8b('0x12')]+')');var _0x3e5ee2=_0x2f4803?_0x52d557[_0xcf8b('0x13')]:_0x52d557['priorityFalse'];logger['info'](_0xcf8b('0x14'),_0x560035,_0x52d557[_0xcf8b('0x12')],_0x2f4803,_0x3e5ee2||_0xcf8b('0x15'));if(_0x3e5ee2){var _0x4d890d=_['findIndex'](_0x57ca91['rules'](),{'p':_0x3e5ee2});if(_0x4d890d>=0x0){logger[_0xcf8b('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x560035,_0x3e5ee2||_0xcf8b('0x15'),_0x4d890d);_0x57ca91[_0xcf8b('0x15')](_0x4d890d);}else{logger['info'](_0xcf8b('0x17'),_0x560035,_0x3e5ee2||_0xcf8b('0x15'));_0x57ca91[_0xcf8b('0x18')]();}}else{_0x57ca91[_0xcf8b('0x15')]();}}catch(_0x4c0e05){logger[_0xcf8b('0x19')](_0xcf8b('0x1a'),_0x560035,_0x4c0e05[_0xcf8b('0x10')]);_0x57ca91['stop']();}}}catch(_0x2027a7){logger[_0xcf8b('0x19')](_0xcf8b('0xe'),_0x560035,JSON[_0xcf8b('0x1b')](_0x2027a7));_0x57ca91[_0xcf8b('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