Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 8e36fde..2c9f84f 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 _0xc152=['fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','number','priority\x20false\x20is\x20a\x20number','consequence'];(function(_0x29a80c,_0x56d71c){var _0x3e4bc1=function(_0x4d0169){while(--_0x4d0169){_0x29a80c['push'](_0x29a80c['shift']());}};_0x3e4bc1(++_0x56d71c);}(_0xc152,0x94));var _0x2c15=function(_0x3f681b,_0x51fe86){_0x3f681b=_0x3f681b-0x0;var _0x2d4d24=_0xc152[_0x3f681b];return _0x2d4d24;};'use strict';var schema=require(_0x2c15('0x0'));var _=require(_0x2c15('0x1'));var htmlToText=require(_0x2c15('0x2'));var utils=require(_0x2c15('0x3'));var logger=require(_0x2c15('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x2c15('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x2c15('0x5'),'message':_0x2c15('0x6')}});exports[_0x2c15('0x7')]=function(_0x56f78c,_0x439ddc){return function(_0x5bd8c8){try{var _0x4f564d={'condition':htmlToText[_0x2c15('0x8')](utils[_0x2c15('0x9')](_0x439ddc[0x0],this),{'wordwrap':![]})[_0x2c15('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x439ddc[0x1],'priorityFalse':_0x439ddc[0x2]};var _0x5c99f7=gotoif[_0x2c15('0x0')](_0x4f564d,{'typecast':!![]});if(_0x5c99f7[_0x2c15('0xb')]){logger[_0x2c15('0xc')](_0x2c15('0xd'),_0x56f78c,_[_0x2c15('0xe')](_0x5c99f7,_0x2c15('0xf'))[_0x2c15('0x10')](',\x20'));_0x5bd8c8[_0x2c15('0x11')]();}else{try{var _0x2b657c=eval('('+_0x4f564d['condition']+')');var _0x15397c=_0x2b657c?_0x4f564d[_0x2c15('0x12')]:_0x4f564d['priorityFalse'];logger[_0x2c15('0x13')](_0x2c15('0x14'),_0x56f78c,_0x4f564d[_0x2c15('0x15')],_0x2b657c,_0x15397c||_0x2c15('0x16'));if(_0x15397c){var _0x1f4f43=_['findIndex'](_0x5bd8c8['rules'](),{'p':_0x15397c});if(_0x1f4f43>=0x0){logger[_0x2c15('0x13')](_0x2c15('0x17'),_0x56f78c,_0x15397c||_0x2c15('0x16'),_0x1f4f43);_0x5bd8c8[_0x2c15('0x16')](_0x1f4f43);}else{logger[_0x2c15('0x13')](_0x2c15('0x18'),_0x56f78c,_0x15397c||'next');_0x5bd8c8['stop']();}}else{_0x5bd8c8[_0x2c15('0x16')]();}}catch(_0x3a0e0f){logger[_0x2c15('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x56f78c,_0x3a0e0f[_0x2c15('0xf')]);_0x5bd8c8[_0x2c15('0x11')]();}}}catch(_0x1639c2){logger[_0x2c15('0xc')](_0x2c15('0xd'),_0x56f78c,JSON[_0x2c15('0x19')](_0x1639c2));_0x5bd8c8[_0x2c15('0x11')]();}};};
\ No newline at end of file