Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / system / system.controller.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 _0x1f33=['kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x656d84,_0xa4df1c){var _0x1772c4=function(_0x2ef4ea){while(--_0x2ef4ea){_0x656d84['push'](_0x656d84['shift']());}};_0x1772c4(++_0xa4df1c);}(_0x1f33,0xd2));var _0x31f3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1f33[_0x20a584];return _0x4b41a8;};'use strict';var info=require(_0x31f3('0x0'));var exec=require(_0x31f3('0x1'))['exec'];var logger=require(_0x31f3('0x2'))(_0x31f3('0x3'));var util=require(_0x31f3('0x4'));var BPromise=require(_0x31f3('0x5'));var _=require(_0x31f3('0x6'));function handleError(_0x46654f,_0x4235c7,_0x5b4c8f){_0x4235c7=_0x4235c7||0x1f4;return function(_0x4787db){logger[_0x31f3('0x7')](_0x31f3('0x8'),_0x5b4c8f,_0x4235c7,util['inspect'](_0x4787db,{'showHidden':![],'depth':null}));delete _0x4787db['name'];_0x46654f[_0x31f3('0x9')](_0x4235c7)['send'](_0x4787db);};}exports['index']=function(_0x5ceb6f,_0xd87090){return info[_0x31f3('0xa')]()[_0x31f3('0xb')](function(_0x35ac05){return _0xd87090[_0x31f3('0x9')](0xc8)[_0x31f3('0xc')](_0x35ac05);})[_0x31f3('0xd')](function(_0x1f8967){return _0xd87090[_0x31f3('0x9')](0x1f4)[_0x31f3('0xc')](_0x1f8967);});};exports[_0x31f3('0xe')]=function(_0x57160e,_0x5a2847){var _0x2f29c5=[_0x31f3('0xf')];return new BPromise(function(_0xa8adc3,_0x20c553){return exec(util[_0x31f3('0x10')](_0x31f3('0x11'),_0x57160e[_0x31f3('0x12')][_0x31f3('0x13')]),function(_0x1a5132,_0x4542c5,_0x573362){if(_0x1a5132){return _0x20c553(_0x1a5132);}return _0xa8adc3(_0x4542c5);});})[_0x31f3('0xb')](function(_0x5c61cc){var _0x5cfdd9=![];var _0x4df0bd=_0x5c61cc[_0x31f3('0x14')](/\n/);for(var _0x3d3d71=0x0,_0x23d6aa=_0x2f29c5[_0x31f3('0x15')];_0x3d3d71<_0x23d6aa,_0x5cfdd9===![];_0x3d3d71+=0x1){if(_0x5c61cc[_0x31f3('0x16')](_0x2f29c5[_0x3d3d71])>=0x0){_0x5cfdd9=!![];}}if(!_0x5cfdd9){throw new Error(util[_0x31f3('0x10')](_0x31f3('0x17'),_0x57160e[_0x31f3('0x12')][_0x31f3('0x13')]));}process[_0x31f3('0x18')](_0x57160e[_0x31f3('0x12')][_0x31f3('0x13')],'SIGINT');return _0x5a2847['status'](0xc8)[_0x31f3('0xc')]({'message':util[_0x31f3('0x10')](_0x31f3('0x19'),_0x57160e[_0x31f3('0x12')][_0x31f3('0x13')])});})[_0x31f3('0xd')](handleError(_0x5a2847,null,_0x31f3('0xe')));};