Built motion from commit db94841.|2.5.3
[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 _0x962e=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3443a7,_0x2a4b5a){var _0x1297d9=function(_0x4b7dcb){while(--_0x4b7dcb){_0x3443a7['push'](_0x3443a7['shift']());}};_0x1297d9(++_0x2a4b5a);}(_0x962e,0xb3));var _0xe962=function(_0x216bdd,_0x22e02b){_0x216bdd=_0x216bdd-0x0;var _0x3422b0=_0x962e[_0x216bdd];return _0x3422b0;};'use strict';var _=require(_0xe962('0x0'));var util=require(_0xe962('0x1'));var moment=require(_0xe962('0x2'));var BPromise=require(_0xe962('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe962('0x4'));var db=require(_0xe962('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe962('0x6'));var config=require(_0xe962('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe962('0x8')][_0xe962('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427ba1,_0x5e54b6,_0x2de92f){return new BPromise(function(_0x56f3ef,_0x1ff161){return client[_0xe962('0xa')](_0x427ba1,_0x2de92f)[_0xe962('0xb')](function(_0x56f3a0){logger[_0xe962('0xc')](_0xe962('0xd'),_0x5e54b6,_0xe962('0xe'));logger[_0xe962('0xf')](_0xe962('0x10'),_0x5e54b6,_0xe962('0xe'),JSON[_0xe962('0x11')](_0x56f3a0));if(_0x56f3a0[_0xe962('0x12')]){if(_0x56f3a0['error'][_0xe962('0x13')]===0x1f4){logger['error'](_0xe962('0xd'),_0x5e54b6,_0x56f3a0[_0xe962('0x12')]['message']);return _0x1ff161(_0x56f3a0[_0xe962('0x12')][_0xe962('0x14')]);}logger[_0xe962('0x12')](_0xe962('0xd'),_0x5e54b6,_0x56f3a0[_0xe962('0x12')][_0xe962('0x14')]);return _0x56f3ef(_0x56f3a0[_0xe962('0x12')]['message']);}else{logger[_0xe962('0xc')]('Setting,\x20%s,\x20%s',_0x5e54b6,_0xe962('0xe'));_0x56f3ef(_0x56f3a0['result'][_0xe962('0x14')]);}})[_0xe962('0x15')](function(_0x3d8053){logger[_0xe962('0x12')](_0xe962('0xd'),_0x5e54b6,_0x3d8053);_0x1ff161(_0x3d8053);});});}