57b9d10ac2853ce4ca69c991fdfdeeaeed0c09c3
[motion2.git] / server / api / setting / setting.rpc.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 _0xadec=['client','http','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xadec,0x1f1));var _0xcade=function(_0x112ba7,_0x482126){_0x112ba7=_0x112ba7-0x0;var _0x182680=_0xadec[_0x112ba7];return _0x182680;};'use strict';var _=require(_0xcade('0x0'));var util=require(_0xcade('0x1'));var moment=require(_0xcade('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcade('0x3'))['db'];var utils=require(_0xcade('0x4'));var logger=require(_0xcade('0x5'))(_0xcade('0x6'));var config=require(_0xcade('0x7'));var jayson=require(_0xcade('0x8'));var client=jayson[_0xcade('0x9')][_0xcade('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e8bbb,_0x5e32e8,_0x336393){return new BPromise(function(_0x124bdc,_0xed50da){return client[_0xcade('0xb')](_0x3e8bbb,_0x336393)[_0xcade('0xc')](function(_0x131197){logger[_0xcade('0xd')]('Setting,\x20%s,\x20%s',_0x5e32e8,'request\x20sent');logger[_0xcade('0xe')](_0xcade('0xf'),_0x5e32e8,'request\x20sent',JSON['stringify'](_0x131197));if(_0x131197[_0xcade('0x10')]){if(_0x131197[_0xcade('0x10')][_0xcade('0x11')]===0x1f4){logger[_0xcade('0x10')](_0xcade('0x12'),_0x5e32e8,_0x131197[_0xcade('0x10')][_0xcade('0x13')]);return _0xed50da(_0x131197[_0xcade('0x10')][_0xcade('0x13')]);}logger[_0xcade('0x10')](_0xcade('0x12'),_0x5e32e8,_0x131197[_0xcade('0x10')][_0xcade('0x13')]);return _0x124bdc(_0x131197[_0xcade('0x10')][_0xcade('0x13')]);}else{logger[_0xcade('0xd')](_0xcade('0x12'),_0x5e32e8,_0xcade('0x14'));_0x124bdc(_0x131197[_0xcade('0x15')]['message']);}})['catch'](function(_0x28fd01){logger['error'](_0xcade('0x12'),_0x5e32e8,_0x28fd01);_0xed50da(_0x28fd01);});});}