Built motion from commit 994c64e1.|2.6.1
[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 _0x8afa=['info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x5213d3,_0x457833){var _0x3eb033=function(_0x32b684){while(--_0x32b684){_0x5213d3['push'](_0x5213d3['shift']());}};_0x3eb033(++_0x457833);}(_0x8afa,0x11a));var _0xa8af=function(_0x369ee8,_0x3eaacf){_0x369ee8=_0x369ee8-0x0;var _0x336aff=_0x8afa[_0x369ee8];return _0x336aff;};'use strict';var schema=require(_0xa8af('0x0'));var sh=require(_0xa8af('0x1'));var _=require(_0xa8af('0x2'));var utils=require(_0xa8af('0x3'));var logger=require(_0xa8af('0x4'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xa8af('0x5')]=function(_0x57ea54,_0x5f29d9){return function(_0x56196a){try{var _0x3bd488={'command':_0x5f29d9[0x0]};var _0x508f33=system[_0xa8af('0x0')](_0x3bd488,{'typecast':!![]});if(_0x508f33[_0xa8af('0x6')]){logger[_0xa8af('0x7')](_0xa8af('0x8'),_0x57ea54,_[_0xa8af('0x9')](_0x508f33,_0xa8af('0xa'))[_0xa8af('0xb')](',\x20'));logger['info'](_0xa8af('0xc'),_0x57ea54);_0x56196a[_0xa8af('0xd')]();}else{var _0x13f0a3=this;var _0x37c0d0=utils[_0xa8af('0xe')](_0x5f29d9[0x0],this);logger[_0xa8af('0xf')](_0xa8af('0x10'),_0x57ea54,_0x37c0d0);sh[_0xa8af('0x11')](_[_0xa8af('0x12')](_0x37c0d0),function(_0x2b3b15,_0x3b98f4){logger[_0xa8af('0xf')](_0xa8af('0x13'),_0x57ea54,_0x2b3b15);if(_0x2b3b15==0x0){var _0x33da9d=_0x3b98f4['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xa8af('0x14')](_0x5f29d9[0x1])||_[_0xa8af('0x15')](_0x5f29d9[0x1])){logger[_0xa8af('0xf')](_0xa8af('0x16'),_0x57ea54);_0x13f0a3[_0xa8af('0x17')][_0x5f29d9[0x1]]=_0x33da9d;}else{logger[_0xa8af('0xf')](_0xa8af('0x18'),_0x57ea54,_0x5f29d9[0x1],_0x33da9d);_0x13f0a3['body'][_0x5f29d9[0x1]]=_0x33da9d;}}_0x56196a[_0xa8af('0xd')]();});}}catch(_0x2789d8){logger['error'](_0xa8af('0x8'),_0x57ea54,_[_0xa8af('0x19')](_0x2789d8)?JSON[_0xa8af('0x1a')](_0x2789d8):_0x2789d8);logger[_0xa8af('0xf')](_0xa8af('0xc'),_0x57ea54);_0x56196a[_0xa8af('0xd')]();}};};