Built motion from commit (unavailable).|2.5.26
[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 _0xb8e3=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info'];(function(_0x3ea765,_0x4593f6){var _0x201138=function(_0x25a2e2){while(--_0x25a2e2){_0x3ea765['push'](_0x3ea765['shift']());}};_0x201138(++_0x4593f6);}(_0xb8e3,0x1c4));var _0x3b8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b8e('0x0'));var util=require(_0x3b8e('0x1'));var moment=require('moment');var BPromise=require(_0x3b8e('0x2'));var rs=require(_0x3b8e('0x3'));var fs=require('fs');var Redis=require(_0x3b8e('0x4'));var db=require(_0x3b8e('0x5'))['db'];var utils=require(_0x3b8e('0x6'));var logger=require(_0x3b8e('0x7'))(_0x3b8e('0x8'));var config=require(_0x3b8e('0x9'));var jayson=require(_0x3b8e('0xa'));var client=jayson[_0x3b8e('0xb')][_0x3b8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e49a6,_0x872a50,_0x5cd94d){return new BPromise(function(_0x145352,_0xd59795){return client[_0x3b8e('0xd')](_0x3e49a6,_0x5cd94d)['then'](function(_0x4dfa20){logger['info'](_0x3b8e('0xe'),_0x872a50,_0x3b8e('0xf'));logger[_0x3b8e('0x10')](_0x3b8e('0x11'),_0x872a50,'request\x20sent',JSON[_0x3b8e('0x12')](_0x4dfa20));if(_0x4dfa20['error']){if(_0x4dfa20['error'][_0x3b8e('0x13')]===0x1f4){logger['error'](_0x3b8e('0xe'),_0x872a50,_0x4dfa20['error'][_0x3b8e('0x14')]);return _0xd59795(_0x4dfa20[_0x3b8e('0x15')][_0x3b8e('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x872a50,_0x4dfa20['error'][_0x3b8e('0x14')]);return _0x145352(_0x4dfa20[_0x3b8e('0x15')][_0x3b8e('0x14')]);}else{logger[_0x3b8e('0x16')](_0x3b8e('0xe'),_0x872a50,_0x3b8e('0xf'));_0x145352(_0x4dfa20[_0x3b8e('0x17')][_0x3b8e('0x14')]);}})[_0x3b8e('0x18')](function(_0x3d9488){logger[_0x3b8e('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x872a50,_0x3d9488);_0xd59795(_0x3d9488);});});}