d442e9771bfea46192430960b520e57dd991fc0d
[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 _0x5a0e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5844b9,_0x583ba8){var _0x226d28=function(_0x304c23){while(--_0x304c23){_0x5844b9['push'](_0x5844b9['shift']());}};_0x226d28(++_0x583ba8);}(_0x5a0e,0x19b));var _0xe5a0=function(_0x314b56,_0x292792){_0x314b56=_0x314b56-0x0;var _0x34e0d4=_0x5a0e[_0x314b56];return _0x34e0d4;};'use strict';var _=require(_0xe5a0('0x0'));var util=require(_0xe5a0('0x1'));var moment=require(_0xe5a0('0x2'));var BPromise=require(_0xe5a0('0x3'));var rs=require(_0xe5a0('0x4'));var fs=require('fs');var Redis=require(_0xe5a0('0x5'));var db=require(_0xe5a0('0x6'))['db'];var utils=require(_0xe5a0('0x7'));var logger=require('../../config/logger')(_0xe5a0('0x8'));var config=require(_0xe5a0('0x9'));var jayson=require(_0xe5a0('0xa'));var client=jayson['client'][_0xe5a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b05cc,_0x2b5163,_0x5c7ed6){return new BPromise(function(_0x29b7d6,_0x531248){return client['request'](_0x3b05cc,_0x5c7ed6)[_0xe5a0('0xc')](function(_0xcce686){logger[_0xe5a0('0xd')](_0xe5a0('0xe'),_0x2b5163,_0xe5a0('0xf'));logger[_0xe5a0('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2b5163,_0xe5a0('0xf'),JSON[_0xe5a0('0x11')](_0xcce686));if(_0xcce686[_0xe5a0('0x12')]){if(_0xcce686[_0xe5a0('0x12')][_0xe5a0('0x13')]===0x1f4){logger[_0xe5a0('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2b5163,_0xcce686[_0xe5a0('0x12')][_0xe5a0('0x14')]);return _0x531248(_0xcce686[_0xe5a0('0x12')][_0xe5a0('0x14')]);}logger[_0xe5a0('0x12')](_0xe5a0('0xe'),_0x2b5163,_0xcce686['error'][_0xe5a0('0x14')]);return _0x29b7d6(_0xcce686[_0xe5a0('0x12')][_0xe5a0('0x14')]);}else{logger['info'](_0xe5a0('0xe'),_0x2b5163,_0xe5a0('0xf'));_0x29b7d6(_0xcce686[_0xe5a0('0x15')][_0xe5a0('0x14')]);}})[_0xe5a0('0x16')](function(_0x244f1b){logger[_0xe5a0('0x12')](_0xe5a0('0xe'),_0x2b5163,_0x244f1b);_0x531248(_0x244f1b);});});}