9d3115204c5945a301c2cb0d82931375687dbfd7
[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 _0x73ec=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','lodash','util','moment'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x73ec,0x179));var _0xc73e=function(_0x40af1b,_0x5d7a32){_0x40af1b=_0x40af1b-0x0;var _0x2e1aa9=_0x73ec[_0x40af1b];return _0x2e1aa9;};'use strict';var _=require(_0xc73e('0x0'));var util=require(_0xc73e('0x1'));var moment=require(_0xc73e('0x2'));var BPromise=require(_0xc73e('0x3'));var rs=require(_0xc73e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc73e('0x5'))['db'];var utils=require(_0xc73e('0x6'));var logger=require(_0xc73e('0x7'))(_0xc73e('0x8'));var config=require('../../config/environment');var jayson=require(_0xc73e('0x9'));var client=jayson[_0xc73e('0xa')][_0xc73e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59cdb6,_0x1d0fc3,_0x30448d){return new BPromise(function(_0x57f000,_0x2660ad){return client['request'](_0x59cdb6,_0x30448d)['then'](function(_0x315d03){logger[_0xc73e('0xc')](_0xc73e('0xd'),_0x1d0fc3,_0xc73e('0xe'));logger[_0xc73e('0xf')](_0xc73e('0x10'),_0x1d0fc3,_0xc73e('0xe'),JSON['stringify'](_0x315d03));if(_0x315d03['error']){if(_0x315d03['error'][_0xc73e('0x11')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1d0fc3,_0x315d03[_0xc73e('0x12')][_0xc73e('0x13')]);return _0x2660ad(_0x315d03[_0xc73e('0x12')][_0xc73e('0x13')]);}logger[_0xc73e('0x12')](_0xc73e('0xd'),_0x1d0fc3,_0x315d03[_0xc73e('0x12')][_0xc73e('0x13')]);return _0x57f000(_0x315d03['error']['message']);}else{logger[_0xc73e('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1d0fc3,_0xc73e('0xe'));_0x57f000(_0x315d03['result']['message']);}})['catch'](function(_0x963146){logger[_0xc73e('0x12')](_0xc73e('0xd'),_0x1d0fc3,_0x963146);_0x2660ad(_0x963146);});});}