Built motion from commit 85328c08.|2.5.50
[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 _0x3bed=['http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49ca95,_0x50c62b){var _0x4699f9=function(_0x5a27a0){while(--_0x5a27a0){_0x49ca95['push'](_0x49ca95['shift']());}};_0x4699f9(++_0x50c62b);}(_0x3bed,0x1ee));var _0xd3be=function(_0x5ead2c,_0x17e317){_0x5ead2c=_0x5ead2c-0x0;var _0x56c52e=_0x3bed[_0x5ead2c];return _0x56c52e;};'use strict';var _=require(_0xd3be('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd3be('0x1'));var rs=require(_0xd3be('0x2'));var fs=require('fs');var Redis=require(_0xd3be('0x3'));var db=require(_0xd3be('0x4'))['db'];var utils=require(_0xd3be('0x5'));var logger=require(_0xd3be('0x6'))(_0xd3be('0x7'));var config=require(_0xd3be('0x8'));var jayson=require(_0xd3be('0x9'));var client=jayson['client'][_0xd3be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c365e,_0x2ca8aa,_0x1c37a6){return new BPromise(function(_0x46002a,_0x2744b6){return client['request'](_0x4c365e,_0x1c37a6)[_0xd3be('0xb')](function(_0x2151af){logger[_0xd3be('0xc')](_0xd3be('0xd'),_0x2ca8aa,_0xd3be('0xe'));logger[_0xd3be('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2ca8aa,'request\x20sent',JSON[_0xd3be('0x10')](_0x2151af));if(_0x2151af[_0xd3be('0x11')]){if(_0x2151af[_0xd3be('0x11')][_0xd3be('0x12')]===0x1f4){logger[_0xd3be('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ca8aa,_0x2151af[_0xd3be('0x11')][_0xd3be('0x13')]);return _0x2744b6(_0x2151af[_0xd3be('0x11')]['message']);}logger[_0xd3be('0x11')](_0xd3be('0xd'),_0x2ca8aa,_0x2151af[_0xd3be('0x11')]['message']);return _0x46002a(_0x2151af[_0xd3be('0x11')][_0xd3be('0x13')]);}else{logger[_0xd3be('0xc')](_0xd3be('0xd'),_0x2ca8aa,'request\x20sent');_0x46002a(_0x2151af['result'][_0xd3be('0x13')]);}})[_0xd3be('0x14')](function(_0x13df16){logger[_0xd3be('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ca8aa,_0x13df16);_0x2744b6(_0x13df16);});});}