4669c183252dbaf9e319c136b15338ca80f90403
[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 _0xcd2b=['stringify','error','code','Setting,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x306e09,_0x3a7903){var _0x57f64a=function(_0x4fd049){while(--_0x4fd049){_0x306e09['push'](_0x306e09['shift']());}};_0x57f64a(++_0x3a7903);}(_0xcd2b,0xd5));var _0xbcd2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcd2b[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xbcd2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcd2('0x1'));var fs=require('fs');var Redis=require(_0xbcd2('0x2'));var db=require(_0xbcd2('0x3'))['db'];var utils=require(_0xbcd2('0x4'));var logger=require(_0xbcd2('0x5'))(_0xbcd2('0x6'));var config=require(_0xbcd2('0x7'));var jayson=require(_0xbcd2('0x8'));var client=jayson[_0xbcd2('0x9')][_0xbcd2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256fed,_0x59e7e4,_0xd9af0c){return new BPromise(function(_0x22d798,_0x3c769d){return client[_0xbcd2('0xb')](_0x256fed,_0xd9af0c)[_0xbcd2('0xc')](function(_0x3ea5c9){logger[_0xbcd2('0xd')]('Setting,\x20%s,\x20%s',_0x59e7e4,_0xbcd2('0xe'));logger[_0xbcd2('0xf')](_0xbcd2('0x10'),_0x59e7e4,_0xbcd2('0xe'),JSON[_0xbcd2('0x11')](_0x3ea5c9));if(_0x3ea5c9[_0xbcd2('0x12')]){if(_0x3ea5c9[_0xbcd2('0x12')][_0xbcd2('0x13')]===0x1f4){logger[_0xbcd2('0x12')](_0xbcd2('0x14'),_0x59e7e4,_0x3ea5c9[_0xbcd2('0x12')][_0xbcd2('0x15')]);return _0x3c769d(_0x3ea5c9[_0xbcd2('0x12')][_0xbcd2('0x15')]);}logger[_0xbcd2('0x12')]('Setting,\x20%s,\x20%s',_0x59e7e4,_0x3ea5c9[_0xbcd2('0x12')][_0xbcd2('0x15')]);return _0x22d798(_0x3ea5c9[_0xbcd2('0x12')][_0xbcd2('0x15')]);}else{logger[_0xbcd2('0xd')](_0xbcd2('0x14'),_0x59e7e4,_0xbcd2('0xe'));_0x22d798(_0x3ea5c9[_0xbcd2('0x16')][_0xbcd2('0x15')]);}})['catch'](function(_0x12ff9b){logger['error'](_0xbcd2('0x14'),_0x59e7e4,_0x12ff9b);_0x3c769d(_0x12ff9b);});});}