Built motion from commit (unavailable).|2.4.0
[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 _0xe5c9=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','validate','shelljs','lodash','./utils','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','join','info'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xe5c9,0x137));var _0x9e5c=function(_0x57c455,_0x2387e8){_0x57c455=_0x57c455-0x0;var _0x70aa12=_0xe5c9[_0x57c455];return _0x70aa12;};'use strict';var schema=require(_0x9e5c('0x0'));var sh=require(_0x9e5c('0x1'));var _=require(_0x9e5c('0x2'));var utils=require(_0x9e5c('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x9e5c('0x4')}});exports[_0x9e5c('0x5')]=function(_0x58d6b0,_0x370af8){return function(_0x6b9e36){try{var _0xa21975={'command':_0x370af8[0x0]};var _0x5d957e=system[_0x9e5c('0x0')](_0xa21975,{'typecast':!![]});if(_0x5d957e[_0x9e5c('0x6')]){logger['error'](_0x9e5c('0x7'),_0x58d6b0,_[_0x9e5c('0x8')](_0x5d957e,'message')[_0x9e5c('0x9')](',\x20'));logger[_0x9e5c('0xa')](_0x9e5c('0xb'),_0x58d6b0);_0x6b9e36[_0x9e5c('0xc')]();}else{var _0x210cb4=this;var _0x5bef2a=utils['getMustacheRender'](_0x370af8[0x0],this);logger[_0x9e5c('0xa')](_0x9e5c('0xd'),_0x58d6b0,_0x5bef2a);sh[_0x9e5c('0xe')](_[_0x9e5c('0xf')](_0x5bef2a),function(_0x52abf1,_0x1dddfc){logger[_0x9e5c('0xa')](_0x9e5c('0x10'),_0x58d6b0,_0x52abf1);if(_0x52abf1==0x0){var _0xf111a1=_0x1dddfc[_0x9e5c('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x370af8[0x1])||_['isEmpty'](_0x370af8[0x1])){logger['info'](_0x9e5c('0x12'),_0x58d6b0);_0x210cb4[_0x9e5c('0x13')][_0x370af8[0x1]]=_0xf111a1;}else{logger[_0x9e5c('0xa')](_0x9e5c('0x14'),_0x58d6b0,_0x370af8[0x1],_0xf111a1);_0x210cb4[_0x9e5c('0x13')][_0x370af8[0x1]]=_0xf111a1;}}_0x6b9e36['next']();});}}catch(_0x3e2e25){logger[_0x9e5c('0x15')](_0x9e5c('0x7'),_0x58d6b0,_[_0x9e5c('0x16')](_0x3e2e25)?JSON['stringify'](_0x3e2e25):_0x3e2e25);logger[_0x9e5c('0xa')](_0x9e5c('0xb'),_0x58d6b0);_0x6b9e36[_0x9e5c('0xc')]();}};};