63f676f2e44779ce60e3f5ac99511c904ba32e34
[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 _0xb514=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','Setting,\x20%s,\x20%s','request\x20sent','result','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x36e92e,_0x17f709){var _0x95e2a8=function(_0x41a543){while(--_0x41a543){_0x36e92e['push'](_0x36e92e['shift']());}};_0x95e2a8(++_0x17f709);}(_0xb514,0x176));var _0x4b51=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xb514[_0x3cb30b];return _0x2ca717;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4b51('0x0'));var rs=require(_0x4b51('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b51('0x2'))['db'];var utils=require(_0x4b51('0x3'));var logger=require(_0x4b51('0x4'))(_0x4b51('0x5'));var config=require(_0x4b51('0x6'));var jayson=require(_0x4b51('0x7'));var client=jayson[_0x4b51('0x8')][_0x4b51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x307627,_0x158c2d,_0x2e4062){return new BPromise(function(_0x122490,_0x3493d5){return client[_0x4b51('0xa')](_0x307627,_0x2e4062)[_0x4b51('0xb')](function(_0x37d18b){logger[_0x4b51('0xc')]('Setting,\x20%s,\x20%s',_0x158c2d,'request\x20sent');logger[_0x4b51('0xd')](_0x4b51('0xe'),_0x158c2d,'request\x20sent',JSON['stringify'](_0x37d18b));if(_0x37d18b[_0x4b51('0xf')]){if(_0x37d18b[_0x4b51('0xf')][_0x4b51('0x10')]===0x1f4){logger[_0x4b51('0xf')]('Setting,\x20%s,\x20%s',_0x158c2d,_0x37d18b[_0x4b51('0xf')][_0x4b51('0x11')]);return _0x3493d5(_0x37d18b[_0x4b51('0xf')][_0x4b51('0x11')]);}logger['error']('Setting,\x20%s,\x20%s',_0x158c2d,_0x37d18b[_0x4b51('0xf')][_0x4b51('0x11')]);return _0x122490(_0x37d18b[_0x4b51('0xf')]['message']);}else{logger[_0x4b51('0xc')](_0x4b51('0x12'),_0x158c2d,_0x4b51('0x13'));_0x122490(_0x37d18b[_0x4b51('0x14')][_0x4b51('0x11')]);}})['catch'](function(_0x58a4d7){logger[_0x4b51('0xf')](_0x4b51('0x12'),_0x158c2d,_0x58a4d7);_0x3493d5(_0x58a4d7);});});}