Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / services / routing / server / applications / system.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x192f=['../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','validate','lodash'];(function(_0x35d007,_0x132d5c){var _0x5e960f=function(_0x56771c){while(--_0x56771c){_0x35d007['push'](_0x35d007['shift']());}};_0x5e960f(++_0x132d5c);}(_0x192f,0xd6));var _0xf192=function(_0x211a57,_0x181dbf){_0x211a57=_0x211a57-0x0;var _0x306f48=_0x192f[_0x211a57];return _0x306f48;};'use strict';var schema=require(_0xf192('0x0'));var sh=require('shelljs');var _=require(_0xf192('0x1'));var utils=require('./utils');var logger=require(_0xf192('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xf192('0x3')}});exports[_0xf192('0x4')]=function(_0x1a2945,_0x22d0b0){return function(_0x1df2e1){try{var _0x221f55={'command':_0x22d0b0[0x0]};var _0x5a05b0=system[_0xf192('0x0')](_0x221f55,{'typecast':!![]});if(_0x5a05b0[_0xf192('0x5')]){logger['error'](_0xf192('0x6'),_0x1a2945,_[_0xf192('0x7')](_0x5a05b0,_0xf192('0x8'))[_0xf192('0x9')](',\x20'));logger[_0xf192('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1a2945);_0x1df2e1['next']();}else{var _0x3004d1=this;var _0x3389aa=utils[_0xf192('0xb')](_0x22d0b0[0x0],this);logger[_0xf192('0xa')](_0xf192('0xc'),_0x1a2945,_0x3389aa);sh[_0xf192('0xd')](_[_0xf192('0xe')](_0x3389aa),function(_0x1ae751,_0x5be8c7){logger[_0xf192('0xa')](_0xf192('0xf'),_0x1a2945,_0x1ae751);if(_0x1ae751==0x0){var _0x127c90=_0x5be8c7[_0xf192('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xf192('0x11')](_0x22d0b0[0x1])||_[_0xf192('0x12')](_0x22d0b0[0x1])){logger[_0xf192('0xa')](_0xf192('0x13'),_0x1a2945);_0x3004d1[_0xf192('0x14')][_0x22d0b0[0x1]]=_0x127c90;}else{logger[_0xf192('0xa')](_0xf192('0x15'),_0x1a2945,_0x22d0b0[0x1],_0x127c90);_0x3004d1[_0xf192('0x14')][_0x22d0b0[0x1]]=_0x127c90;}}_0x1df2e1['next']();});}}catch(_0x1bd912){logger[_0xf192('0x16')]('[%s][SYSTEM]\x20%s',_0x1a2945,_[_0xf192('0x17')](_0x1bd912)?JSON[_0xf192('0x18')](_0x1bd912):_0x1bd912);logger[_0xf192('0xa')](_0xf192('0x19'),_0x1a2945);_0x1df2e1[_0xf192('0x1a')]();}};};