Built motion from commit ff426b3f.|2.6.29
[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 _0xbeef=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','info'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xbeef,0xdb));var _0xfbee=function(_0x5e47dc,_0x4ee776){_0x5e47dc=_0x5e47dc-0x0;var _0x9e8c3f=_0xbeef[_0x5e47dc];return _0x9e8c3f;};'use strict';var _=require(_0xfbee('0x0'));var util=require(_0xfbee('0x1'));var moment=require(_0xfbee('0x2'));var BPromise=require(_0xfbee('0x3'));var rs=require(_0xfbee('0x4'));var fs=require('fs');var Redis=require(_0xfbee('0x5'));var db=require(_0xfbee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbee('0x7'))(_0xfbee('0x8'));var config=require('../../config/environment');var jayson=require(_0xfbee('0x9'));var client=jayson['client'][_0xfbee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x349422,_0x28bbbd,_0x596049){return new BPromise(function(_0x3069a5,_0x3cbf10){return client['request'](_0x349422,_0x596049)['then'](function(_0x490ba7){logger[_0xfbee('0xb')](_0xfbee('0xc'),_0x28bbbd,_0xfbee('0xd'));logger[_0xfbee('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x28bbbd,_0xfbee('0xd'),JSON[_0xfbee('0xf')](_0x490ba7));if(_0x490ba7['error']){if(_0x490ba7[_0xfbee('0x10')][_0xfbee('0x11')]===0x1f4){logger[_0xfbee('0x10')](_0xfbee('0xc'),_0x28bbbd,_0x490ba7[_0xfbee('0x10')]['message']);return _0x3cbf10(_0x490ba7[_0xfbee('0x10')]['message']);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x28bbbd,_0x490ba7['error'][_0xfbee('0x12')]);return _0x3069a5(_0x490ba7[_0xfbee('0x10')]['message']);}else{logger[_0xfbee('0xb')](_0xfbee('0xc'),_0x28bbbd,_0xfbee('0xd'));_0x3069a5(_0x490ba7[_0xfbee('0x13')][_0xfbee('0x12')]);}})[_0xfbee('0x14')](function(_0x155b51){logger[_0xfbee('0x10')](_0xfbee('0xc'),_0x28bbbd,_0x155b51);_0x3cbf10(_0x155b51);});});}