Built motion from commit (unavailable).|2.4.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 _0x90ec=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s'];(function(_0x4f4109,_0xa52149){var _0x499655=function(_0x8561d7){while(--_0x8561d7){_0x4f4109['push'](_0x4f4109['shift']());}};_0x499655(++_0xa52149);}(_0x90ec,0x1d4));var _0xc90e=function(_0x39543e,_0x232724){_0x39543e=_0x39543e-0x0;var _0x2cb6ab=_0x90ec[_0x39543e];return _0x2cb6ab;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var moment=require('moment');var BPromise=require(_0xc90e('0x2'));var rs=require(_0xc90e('0x3'));var fs=require('fs');var Redis=require(_0xc90e('0x4'));var db=require(_0xc90e('0x5'))['db'];var utils=require(_0xc90e('0x6'));var logger=require('../../config/logger')(_0xc90e('0x7'));var config=require(_0xc90e('0x8'));var jayson=require(_0xc90e('0x9'));var client=jayson['client'][_0xc90e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48bea9,_0x42051a,_0x14311a){return new BPromise(function(_0x48253c,_0x3bc98f){return client[_0xc90e('0xb')](_0x48bea9,_0x14311a)[_0xc90e('0xc')](function(_0x1a02ad){logger[_0xc90e('0xd')](_0xc90e('0xe'),_0x42051a,_0xc90e('0xf'));logger[_0xc90e('0x10')](_0xc90e('0x11'),_0x42051a,'request\x20sent',JSON[_0xc90e('0x12')](_0x1a02ad));if(_0x1a02ad['error']){if(_0x1a02ad['error']['code']===0x1f4){logger['error'](_0xc90e('0xe'),_0x42051a,_0x1a02ad[_0xc90e('0x13')]['message']);return _0x3bc98f(_0x1a02ad[_0xc90e('0x13')][_0xc90e('0x14')]);}logger['error'](_0xc90e('0xe'),_0x42051a,_0x1a02ad[_0xc90e('0x13')][_0xc90e('0x14')]);return _0x48253c(_0x1a02ad[_0xc90e('0x13')][_0xc90e('0x14')]);}else{logger[_0xc90e('0xd')]('Setting,\x20%s,\x20%s',_0x42051a,_0xc90e('0xf'));_0x48253c(_0x1a02ad[_0xc90e('0x15')]['message']);}})[_0xc90e('0x16')](function(_0x48eac8){logger[_0xc90e('0x13')](_0xc90e('0xe'),_0x42051a,_0x48eac8);_0x3bc98f(_0x48eac8);});});}