Built motion from commit (unavailable).|2.5.17
[motion2.git] / server / api / intSugarcrmConfiguration / intSugarcrmConfiguration.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 _0xb014=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x54e936,_0x38a00e){var _0xfeb048=function(_0x1d4d88){while(--_0x1d4d88){_0x54e936['push'](_0x54e936['shift']());}};_0xfeb048(++_0x38a00e);}(_0xb014,0x16b));var _0x4b01=function(_0x400da3,_0x55d4fa){_0x400da3=_0x400da3-0x0;var _0x1c7073=_0xb014[_0x400da3];return _0x1c7073;};'use strict';var _=require(_0x4b01('0x0'));var util=require(_0x4b01('0x1'));var moment=require(_0x4b01('0x2'));var BPromise=require(_0x4b01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b01('0x4'));var db=require(_0x4b01('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b01('0x6'))(_0x4b01('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b01('0x8'));var client=jayson['client'][_0x4b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547210,_0x24ac84,_0x4b9479){return new BPromise(function(_0xafa065,_0x471b11){return client[_0x4b01('0xa')](_0x547210,_0x4b9479)['then'](function(_0x4c0afd){logger[_0x4b01('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24ac84,'request\x20sent');logger['debug'](_0x4b01('0xc'),_0x24ac84,_0x4b01('0xd'),JSON[_0x4b01('0xe')](_0x4c0afd));if(_0x4c0afd[_0x4b01('0xf')]){if(_0x4c0afd['error']['code']===0x1f4){logger[_0x4b01('0xf')](_0x4b01('0x10'),_0x24ac84,_0x4c0afd[_0x4b01('0xf')][_0x4b01('0x11')]);return _0x471b11(_0x4c0afd[_0x4b01('0xf')][_0x4b01('0x11')]);}logger[_0x4b01('0xf')](_0x4b01('0x10'),_0x24ac84,_0x4c0afd[_0x4b01('0xf')][_0x4b01('0x11')]);return _0xafa065(_0x4c0afd['error'][_0x4b01('0x11')]);}else{logger[_0x4b01('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24ac84,_0x4b01('0xd'));_0xafa065(_0x4c0afd[_0x4b01('0x12')][_0x4b01('0x11')]);}})['catch'](function(_0x9307f1){logger[_0x4b01('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24ac84,_0x9307f1);_0x471b11(_0x9307f1);});});}