3635939398647092e7a709e0973301f7e07e1334
[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 _0xe9cc=['request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0xa7d6a5,_0x4adc3a){var _0x9e79a3=function(_0x2da72e){while(--_0x2da72e){_0xa7d6a5['push'](_0xa7d6a5['shift']());}};_0x9e79a3(++_0x4adc3a);}(_0xe9cc,0x137));var _0xce9c=function(_0x12a452,_0x2c4b3c){_0x12a452=_0x12a452-0x0;var _0x53122a=_0xe9cc[_0x12a452];return _0x53122a;};'use strict';var _=require(_0xce9c('0x0'));var util=require(_0xce9c('0x1'));var moment=require(_0xce9c('0x2'));var BPromise=require(_0xce9c('0x3'));var rs=require(_0xce9c('0x4'));var fs=require('fs');var Redis=require(_0xce9c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce9c('0x6'));var logger=require(_0xce9c('0x7'))(_0xce9c('0x8'));var config=require('../../config/environment');var jayson=require(_0xce9c('0x9'));var client=jayson['client'][_0xce9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15d612,_0x246e5b,_0x30163b){return new BPromise(function(_0xb6e989,_0x559c47){return client[_0xce9c('0xb')](_0x15d612,_0x30163b)[_0xce9c('0xc')](function(_0x871116){logger[_0xce9c('0xd')](_0xce9c('0xe'),_0x246e5b,_0xce9c('0xf'));logger[_0xce9c('0x10')](_0xce9c('0x11'),_0x246e5b,'request\x20sent',JSON[_0xce9c('0x12')](_0x871116));if(_0x871116[_0xce9c('0x13')]){if(_0x871116[_0xce9c('0x13')][_0xce9c('0x14')]===0x1f4){logger[_0xce9c('0x13')](_0xce9c('0xe'),_0x246e5b,_0x871116[_0xce9c('0x13')][_0xce9c('0x15')]);return _0x559c47(_0x871116[_0xce9c('0x13')][_0xce9c('0x15')]);}logger[_0xce9c('0x13')](_0xce9c('0xe'),_0x246e5b,_0x871116[_0xce9c('0x13')][_0xce9c('0x15')]);return _0xb6e989(_0x871116[_0xce9c('0x13')][_0xce9c('0x15')]);}else{logger['info'](_0xce9c('0xe'),_0x246e5b,_0xce9c('0xf'));_0xb6e989(_0x871116[_0xce9c('0x16')][_0xce9c('0x15')]);}})['catch'](function(_0x20f3ce){logger[_0xce9c('0x13')](_0xce9c('0xe'),_0x246e5b,_0x20f3ce);_0x559c47(_0x20f3ce);});});}