Built motion from commit (unavailable).|2.4.21
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 8e36fde..be00a62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc5=['priorityTrue','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','message','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','map','join','stop','condition'];(function(_0x4c8e4a,_0xa800c9){var _0x3033ce=function(_0x4d0b12){while(--_0x4d0b12){_0x4c8e4a['push'](_0x4c8e4a['shift']());}};_0x3033ce(++_0xa800c9);}(_0x7cc5,0x82));var _0x57cc=function(_0x3a87e8,_0x1d8633){_0x3a87e8=_0x3a87e8-0x0;var _0x591e80=_0x7cc5[_0x3a87e8];return _0x591e80;};'use strict';var schema=require(_0x57cc('0x0'));var _=require(_0x57cc('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x57cc('0x2'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x57cc('0x3')},'priorityTrue':{'type':_0x57cc('0x4'),'message':_0x57cc('0x5')},'priorityFalse':{'type':_0x57cc('0x4'),'message':_0x57cc('0x6')}});exports[_0x57cc('0x7')]=function(_0x555c20,_0x2c3da4){return function(_0x26082b){try{var _0xc4382b={'condition':htmlToText[_0x57cc('0x8')](utils[_0x57cc('0x9')](_0x2c3da4[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2c3da4[0x1],'priorityFalse':_0x2c3da4[0x2]};var _0x399994=gotoif[_0x57cc('0x0')](_0xc4382b,{'typecast':!![]});if(_0x399994['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x555c20,_[_0x57cc('0xa')](_0x399994,'message')[_0x57cc('0xb')](',\x20'));_0x26082b[_0x57cc('0xc')]();}else{try{var _0x2769ca=eval('('+_0xc4382b[_0x57cc('0xd')]+')');var _0x3a5a20=_0x2769ca?_0xc4382b[_0x57cc('0xe')]:_0xc4382b['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x555c20,_0xc4382b['condition'],_0x2769ca,_0x3a5a20||'next');if(_0x3a5a20){var _0x42a0fa=_[_0x57cc('0xf')](_0x26082b['rules'](),{'p':_0x3a5a20});if(_0x42a0fa>=0x0){logger['info'](_0x57cc('0x10'),_0x555c20,_0x3a5a20||_0x57cc('0x11'),_0x42a0fa);_0x26082b[_0x57cc('0x11')](_0x42a0fa);}else{logger[_0x57cc('0x12')](_0x57cc('0x13'),_0x555c20,_0x3a5a20||_0x57cc('0x11'));_0x26082b['stop']();}}else{_0x26082b['next']();}}catch(_0x1bb758){logger[_0x57cc('0x14')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x555c20,_0x1bb758[_0x57cc('0x15')]);_0x26082b[_0x57cc('0xc')]();}}}catch(_0x20b2aa){logger['error'](_0x57cc('0x16'),_0x555c20,JSON[_0x57cc('0x17')](_0x20b2aa));_0x26082b[_0x57cc('0xc')]();}};};
\ No newline at end of file
+var _0x1de5=['stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x1de5,0x118));var _0x51de=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x1de5[_0xc8a931];return _0x28bd27;};'use strict';var schema=require(_0x51de('0x0'));var _=require(_0x51de('0x1'));var htmlToText=require(_0x51de('0x2'));var utils=require(_0x51de('0x3'));var logger=require(_0x51de('0x4'))(_0x51de('0x5'));var gotoif=schema({'condition':{'type':_0x51de('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x51de('0x7'),'message':_0x51de('0x8')},'priorityFalse':{'type':_0x51de('0x7'),'message':_0x51de('0x9')}});exports[_0x51de('0xa')]=function(_0x4e1a86,_0x2ac86d){return function(_0x1b65a7){try{var _0x212ff2={'condition':htmlToText['fromString'](utils[_0x51de('0xb')](_0x2ac86d[0x0],this),{'wordwrap':![]})[_0x51de('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2ac86d[0x1],'priorityFalse':_0x2ac86d[0x2]};var _0x6cdc6c=gotoif[_0x51de('0x0')](_0x212ff2,{'typecast':!![]});if(_0x6cdc6c[_0x51de('0xd')]){logger[_0x51de('0xe')](_0x51de('0xf'),_0x4e1a86,_[_0x51de('0x10')](_0x6cdc6c,_0x51de('0x11'))[_0x51de('0x12')](',\x20'));_0x1b65a7[_0x51de('0x13')]();}else{try{var _0x353999=eval('('+_0x212ff2[_0x51de('0x14')]+')');var _0x3747c1=_0x353999?_0x212ff2[_0x51de('0x15')]:_0x212ff2[_0x51de('0x16')];logger[_0x51de('0x17')](_0x51de('0x18'),_0x4e1a86,_0x212ff2['condition'],_0x353999,_0x3747c1||_0x51de('0x19'));if(_0x3747c1){var _0x3b8e91=_[_0x51de('0x1a')](_0x1b65a7['rules'](),{'p':_0x3747c1});if(_0x3b8e91>=0x0){logger['info'](_0x51de('0x1b'),_0x4e1a86,_0x3747c1||_0x51de('0x19'),_0x3b8e91);_0x1b65a7[_0x51de('0x19')](_0x3b8e91);}else{logger[_0x51de('0x17')](_0x51de('0x1c'),_0x4e1a86,_0x3747c1||_0x51de('0x19'));_0x1b65a7['stop']();}}else{_0x1b65a7[_0x51de('0x19')]();}}catch(_0x5b6fb5){logger[_0x51de('0xe')](_0x51de('0x1d'),_0x4e1a86,_0x5b6fb5['message']);_0x1b65a7[_0x51de('0x13')]();}}}catch(_0x1d885b){logger['error']('[%s][GOTOIF]\x20%s',_0x4e1a86,JSON[_0x51de('0x1e')](_0x1d885b));_0x1b65a7[_0x51de('0x13')]();}};};
\ No newline at end of file