Built motion from commit 9d1906d1.|2.5.40
[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 _0x730b=['message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','debug','code','error','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x730b,0x71));var _0xb730=function(_0x7ad268,_0x361a23){_0x7ad268=_0x7ad268-0x0;var _0xe092b7=_0x730b[_0x7ad268];return _0xe092b7;};'use strict';var _=require(_0xb730('0x0'));var util=require(_0xb730('0x1'));var moment=require(_0xb730('0x2'));var BPromise=require(_0xb730('0x3'));var rs=require(_0xb730('0x4'));var fs=require('fs');var Redis=require(_0xb730('0x5'));var db=require(_0xb730('0x6'))['db'];var utils=require(_0xb730('0x7'));var logger=require(_0xb730('0x8'))(_0xb730('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb730('0xa')][_0xb730('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4894dd,_0x3be63c,_0x3cdac9){return new BPromise(function(_0x2541e0,_0x900ba1){return client[_0xb730('0xc')](_0x4894dd,_0x3cdac9)[_0xb730('0xd')](function(_0x22ca26){logger[_0xb730('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3be63c,'request\x20sent');logger[_0xb730('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3be63c,'request\x20sent',JSON['stringify'](_0x22ca26));if(_0x22ca26['error']){if(_0x22ca26['error'][_0xb730('0x10')]===0x1f4){logger[_0xb730('0x11')](_0xb730('0x12'),_0x3be63c,_0x22ca26[_0xb730('0x11')]['message']);return _0x900ba1(_0x22ca26[_0xb730('0x11')][_0xb730('0x13')]);}logger[_0xb730('0x11')](_0xb730('0x12'),_0x3be63c,_0x22ca26[_0xb730('0x11')][_0xb730('0x13')]);return _0x2541e0(_0x22ca26[_0xb730('0x11')][_0xb730('0x13')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3be63c,_0xb730('0x14'));_0x2541e0(_0x22ca26[_0xb730('0x15')][_0xb730('0x13')]);}})['catch'](function(_0x45ccac){logger[_0xb730('0x11')](_0xb730('0x12'),_0x3be63c,_0x45ccac);_0x900ba1(_0x45ccac);});});}