Built motion from commit (unavailable).|2.5.26
[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 _0x0b9e=['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','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0x0b9e,0x92));var _0xe0b9=function(_0x4e6796,_0x3268da){_0x4e6796=_0x4e6796-0x0;var _0x1c04eb=_0x0b9e[_0x4e6796];return _0x1c04eb;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0xe0b9('0x0'));var utils=require(_0xe0b9('0x1'));var logger=require(_0xe0b9('0x2'))(_0xe0b9('0x3'));var system=schema({'command':{'type':_0xe0b9('0x4'),'required':!![],'message':_0xe0b9('0x5')}});exports['consequence']=function(_0x2a7733,_0x22bd05){return function(_0x5ed8aa){try{var _0x1f23b0={'command':_0x22bd05[0x0]};var _0x40ea8e=system[_0xe0b9('0x6')](_0x1f23b0,{'typecast':!![]});if(_0x40ea8e[_0xe0b9('0x7')]){logger['error'](_0xe0b9('0x8'),_0x2a7733,_['map'](_0x40ea8e,'message')[_0xe0b9('0x9')](',\x20'));logger[_0xe0b9('0xa')](_0xe0b9('0xb'),_0x2a7733);_0x5ed8aa[_0xe0b9('0xc')]();}else{var _0x176b12=this;var _0x43c2c0=utils[_0xe0b9('0xd')](_0x22bd05[0x0],this);logger[_0xe0b9('0xa')](_0xe0b9('0xe'),_0x2a7733,_0x43c2c0);sh[_0xe0b9('0xf')](_[_0xe0b9('0x10')](_0x43c2c0),function(_0x368da5,_0x209d00){logger[_0xe0b9('0xa')](_0xe0b9('0x11'),_0x2a7733,_0x368da5);if(_0x368da5==0x0){var _0x1beee8=_0x209d00[_0xe0b9('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xe0b9('0x13')](_0x22bd05[0x1])||_[_0xe0b9('0x14')](_0x22bd05[0x1])){logger[_0xe0b9('0xa')](_0xe0b9('0x15'),_0x2a7733);_0x176b12[_0xe0b9('0x16')][_0x22bd05[0x1]]=_0x1beee8;}else{logger[_0xe0b9('0xa')](_0xe0b9('0x17'),_0x2a7733,_0x22bd05[0x1],_0x1beee8);_0x176b12['body'][_0x22bd05[0x1]]=_0x1beee8;}}_0x5ed8aa[_0xe0b9('0xc')]();});}}catch(_0xdae8c1){logger[_0xe0b9('0x18')]('[%s][SYSTEM]\x20%s',_0x2a7733,_[_0xe0b9('0x19')](_0xdae8c1)?JSON[_0xe0b9('0x1a')](_0xdae8c1):_0xdae8c1);logger[_0xe0b9('0xa')](_0xe0b9('0xb'),_0x2a7733);_0x5ed8aa[_0xe0b9('0xc')]();}};};