Built motion from commit 00bf23f6.|2.6.16
[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 _0x5955=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5955,0xf5));var _0x5595=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x5955[_0x128450];return _0x4d80ed;};'use strict';var _=require(_0x5595('0x0'));var util=require('util');var moment=require(_0x5595('0x1'));var BPromise=require('bluebird');var rs=require(_0x5595('0x2'));var fs=require('fs');var Redis=require(_0x5595('0x3'));var db=require(_0x5595('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5595('0x5'))(_0x5595('0x6'));var config=require(_0x5595('0x7'));var jayson=require(_0x5595('0x8'));var client=jayson[_0x5595('0x9')][_0x5595('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48414f,_0x1e7ed7,_0x5e64aa){return new BPromise(function(_0x1456d1,_0x53697b){return client[_0x5595('0xb')](_0x48414f,_0x5e64aa)[_0x5595('0xc')](function(_0x1097af){logger[_0x5595('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e7ed7,_0x5595('0xe'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1e7ed7,'request\x20sent',JSON[_0x5595('0xf')](_0x1097af));if(_0x1097af['error']){if(_0x1097af[_0x5595('0x10')]['code']===0x1f4){logger['error'](_0x5595('0x11'),_0x1e7ed7,_0x1097af[_0x5595('0x10')][_0x5595('0x12')]);return _0x53697b(_0x1097af[_0x5595('0x10')][_0x5595('0x12')]);}logger[_0x5595('0x10')](_0x5595('0x11'),_0x1e7ed7,_0x1097af[_0x5595('0x10')][_0x5595('0x12')]);return _0x1456d1(_0x1097af[_0x5595('0x10')][_0x5595('0x12')]);}else{logger[_0x5595('0xd')](_0x5595('0x11'),_0x1e7ed7,'request\x20sent');_0x1456d1(_0x1097af[_0x5595('0x13')][_0x5595('0x12')]);}})[_0x5595('0x14')](function(_0x4f2ed8){logger['error'](_0x5595('0x11'),_0x1e7ed7,_0x4f2ed8);_0x53697b(_0x4f2ed8);});});}