Built motion from commit (unavailable).|2.5.15
[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 _0xbfc0=['request','then','info','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3fff61,_0x523b8d){var _0x12bc13=function(_0x46c06b){while(--_0x46c06b){_0x3fff61['push'](_0x3fff61['shift']());}};_0x12bc13(++_0x523b8d);}(_0xbfc0,0x115));var _0x0bfc=function(_0x53d578,_0x4ca37f){_0x53d578=_0x53d578-0x0;var _0x5ce805=_0xbfc0[_0x53d578];return _0x5ce805;};'use strict';var _=require(_0x0bfc('0x0'));var util=require(_0x0bfc('0x1'));var moment=require('moment');var BPromise=require(_0x0bfc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bfc('0x3'));var db=require(_0x0bfc('0x4'))['db'];var utils=require(_0x0bfc('0x5'));var logger=require('../../config/logger')(_0x0bfc('0x6'));var config=require(_0x0bfc('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46cff7,_0x505af4,_0x5e19c1){return new BPromise(function(_0x337b65,_0x4ede82){return client[_0x0bfc('0x8')](_0x46cff7,_0x5e19c1)[_0x0bfc('0x9')](function(_0x228c7f){logger[_0x0bfc('0xa')]('Setting,\x20%s,\x20%s',_0x505af4,'request\x20sent');logger[_0x0bfc('0xb')]('Setting,\x20%s,\x20%s,\x20%s',_0x505af4,'request\x20sent',JSON[_0x0bfc('0xc')](_0x228c7f));if(_0x228c7f['error']){if(_0x228c7f[_0x0bfc('0xd')][_0x0bfc('0xe')]===0x1f4){logger[_0x0bfc('0xd')](_0x0bfc('0xf'),_0x505af4,_0x228c7f[_0x0bfc('0xd')][_0x0bfc('0x10')]);return _0x4ede82(_0x228c7f[_0x0bfc('0xd')][_0x0bfc('0x10')]);}logger[_0x0bfc('0xd')](_0x0bfc('0xf'),_0x505af4,_0x228c7f[_0x0bfc('0xd')][_0x0bfc('0x10')]);return _0x337b65(_0x228c7f[_0x0bfc('0xd')]['message']);}else{logger[_0x0bfc('0xa')](_0x0bfc('0xf'),_0x505af4,'request\x20sent');_0x337b65(_0x228c7f[_0x0bfc('0x11')][_0x0bfc('0x10')]);}})[_0x0bfc('0x12')](function(_0x364f0c){logger['error'](_0x0bfc('0xf'),_0x505af4,_0x364f0c);_0x4ede82(_0x364f0c);});});}