49994ff69fa09f321a578eb264b74626fa3d2665
[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 _0x6e65=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','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','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e65,0x1da));var _0x56e6=function(_0x4bf5ec,_0x333deb){_0x4bf5ec=_0x4bf5ec-0x0;var _0x128359=_0x6e65[_0x4bf5ec];return _0x128359;};'use strict';var _=require(_0x56e6('0x0'));var util=require(_0x56e6('0x1'));var moment=require(_0x56e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x56e6('0x3'));var fs=require('fs');var Redis=require(_0x56e6('0x4'));var db=require(_0x56e6('0x5'))['db'];var utils=require(_0x56e6('0x6'));var logger=require(_0x56e6('0x7'))(_0x56e6('0x8'));var config=require(_0x56e6('0x9'));var jayson=require(_0x56e6('0xa'));var client=jayson[_0x56e6('0xb')][_0x56e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c369e,_0x3a67ab,_0x2bf1c9){return new BPromise(function(_0x4e60a5,_0x12a96f){return client['request'](_0x1c369e,_0x2bf1c9)[_0x56e6('0xd')](function(_0x1176c2){logger[_0x56e6('0xe')](_0x56e6('0xf'),_0x3a67ab,_0x56e6('0x10'));logger[_0x56e6('0x11')](_0x56e6('0x12'),_0x3a67ab,_0x56e6('0x10'),JSON[_0x56e6('0x13')](_0x1176c2));if(_0x1176c2[_0x56e6('0x14')]){if(_0x1176c2[_0x56e6('0x14')][_0x56e6('0x15')]===0x1f4){logger[_0x56e6('0x14')](_0x56e6('0xf'),_0x3a67ab,_0x1176c2[_0x56e6('0x14')][_0x56e6('0x16')]);return _0x12a96f(_0x1176c2['error'][_0x56e6('0x16')]);}logger['error'](_0x56e6('0xf'),_0x3a67ab,_0x1176c2[_0x56e6('0x14')][_0x56e6('0x16')]);return _0x4e60a5(_0x1176c2['error'][_0x56e6('0x16')]);}else{logger[_0x56e6('0xe')](_0x56e6('0xf'),_0x3a67ab,_0x56e6('0x10'));_0x4e60a5(_0x1176c2[_0x56e6('0x17')][_0x56e6('0x16')]);}})['catch'](function(_0x498a49){logger[_0x56e6('0x14')](_0x56e6('0xf'),_0x3a67ab,_0x498a49);_0x12a96f(_0x498a49);});});}