Built motion from commit 44b1f254.|2.6.26
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 76933ec..b5eda78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x339e=['priorityTrue','priorityFalse','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x16f021,_0x50aa14){var _0x4d0309=function(_0x855c1c){while(--_0x855c1c){_0x16f021['push'](_0x16f021['shift']());}};_0x4d0309(++_0x50aa14);}(_0x339e,0xe0));var _0xe339=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x339e[_0x3947c9];return _0x2e7871;};'use strict';var schema=require(_0xe339('0x0'));var _=require(_0xe339('0x1'));var htmlToText=require(_0xe339('0x2'));var utils=require(_0xe339('0x3'));var logger=require('../../../../config/logger')(_0xe339('0x4'));var gotoif=schema({'condition':{'type':_0xe339('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xe339('0x6')},'priorityFalse':{'type':_0xe339('0x7'),'message':_0xe339('0x8')}});exports['consequence']=function(_0x40e9c1,_0x2700b8){return function(_0x258f41){try{var _0x597bc0={'condition':htmlToText[_0xe339('0x9')](utils[_0xe339('0xa')](_0x2700b8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2700b8[0x1],'priorityFalse':_0x2700b8[0x2]};var _0xc86d87=gotoif[_0xe339('0x0')](_0x597bc0,{'typecast':!![]});if(_0xc86d87[_0xe339('0xb')]){logger[_0xe339('0xc')](_0xe339('0xd'),_0x40e9c1,_[_0xe339('0xe')](_0xc86d87,_0xe339('0xf'))[_0xe339('0x10')](',\x20'));_0x258f41[_0xe339('0x11')]();}else{try{var _0x2ca484=eval('('+_0x597bc0[_0xe339('0x12')]+')');var _0x4c4147=_0x2ca484?_0x597bc0[_0xe339('0x13')]:_0x597bc0[_0xe339('0x14')];logger[_0xe339('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x40e9c1,_0x597bc0[_0xe339('0x12')],_0x2ca484,_0x4c4147||_0xe339('0x16'));if(_0x4c4147){var _0x4460b2=_[_0xe339('0x17')](_0x258f41['rules'](),{'p':_0x4c4147});if(_0x4460b2>=0x0){logger['info'](_0xe339('0x18'),_0x40e9c1,_0x4c4147||_0xe339('0x16'),_0x4460b2);_0x258f41[_0xe339('0x16')](_0x4460b2);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x40e9c1,_0x4c4147||_0xe339('0x16'));_0x258f41['stop']();}}else{_0x258f41[_0xe339('0x16')]();}}catch(_0x3ba1d5){logger['error'](_0xe339('0x19'),_0x40e9c1,_0x3ba1d5['message']);_0x258f41[_0xe339('0x11')]();}}}catch(_0xc90341){logger['error'](_0xe339('0xd'),_0x40e9c1,JSON[_0xe339('0x1a')](_0xc90341));_0x258f41[_0xe339('0x11')]();}};};
\ No newline at end of file
+var _0xf31b=['lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','next','stringify','validate'];(function(_0x44d693,_0x4a9d83){var _0x3aa5bb=function(_0x3efa06){while(--_0x3efa06){_0x44d693['push'](_0x44d693['shift']());}};_0x3aa5bb(++_0x4a9d83);}(_0xf31b,0x195));var _0xbf31=function(_0x1ac6fc,_0x51a028){_0x1ac6fc=_0x1ac6fc-0x0;var _0x3ece2d=_0xf31b[_0x1ac6fc];return _0x3ece2d;};'use strict';var schema=require(_0xbf31('0x0'));var _=require(_0xbf31('0x1'));var htmlToText=require(_0xbf31('0x2'));var utils=require(_0xbf31('0x3'));var logger=require(_0xbf31('0x4'))(_0xbf31('0x5'));var gotoif=schema({'condition':{'type':_0xbf31('0x6'),'required':!![],'message':_0xbf31('0x7')},'priorityTrue':{'type':_0xbf31('0x8'),'message':_0xbf31('0x9')},'priorityFalse':{'type':_0xbf31('0x8'),'message':_0xbf31('0xa')}});exports[_0xbf31('0xb')]=function(_0x3d7a07,_0x3e538b){return function(_0xbee15c){try{var _0x4fcf8={'condition':htmlToText[_0xbf31('0xc')](utils['getMustacheRender'](_0x3e538b[0x0],this),{'wordwrap':![]})[_0xbf31('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3e538b[0x1],'priorityFalse':_0x3e538b[0x2]};var _0x480eda=gotoif[_0xbf31('0x0')](_0x4fcf8,{'typecast':!![]});if(_0x480eda[_0xbf31('0xe')]){logger[_0xbf31('0xf')](_0xbf31('0x10'),_0x3d7a07,_['map'](_0x480eda,_0xbf31('0x11'))[_0xbf31('0x12')](',\x20'));_0xbee15c[_0xbf31('0x13')]();}else{try{var _0x299942=eval('('+_0x4fcf8[_0xbf31('0x14')]+')');var _0x2a9f48=_0x299942?_0x4fcf8[_0xbf31('0x15')]:_0x4fcf8[_0xbf31('0x16')];logger[_0xbf31('0x17')](_0xbf31('0x18'),_0x3d7a07,_0x4fcf8[_0xbf31('0x14')],_0x299942,_0x2a9f48||'next');if(_0x2a9f48){var _0x273ef0=_[_0xbf31('0x19')](_0xbee15c[_0xbf31('0x1a')](),{'p':_0x2a9f48});if(_0x273ef0>=0x0){logger[_0xbf31('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d7a07,_0x2a9f48||_0xbf31('0x1b'),_0x273ef0);_0xbee15c['next'](_0x273ef0);}else{logger[_0xbf31('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3d7a07,_0x2a9f48||_0xbf31('0x1b'));_0xbee15c['stop']();}}else{_0xbee15c[_0xbf31('0x1b')]();}}catch(_0x22c510){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3d7a07,_0x22c510[_0xbf31('0x11')]);_0xbee15c[_0xbf31('0x13')]();}}}catch(_0x2286fb){logger[_0xbf31('0xf')](_0xbf31('0x10'),_0x3d7a07,JSON[_0xbf31('0x1c')](_0x2286fb));_0xbee15c[_0xbf31('0x13')]();}};};
\ No newline at end of file