Built motion from commit (unavailable).|2.4.18
[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 _0xe70f=['jayson/promise','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5713cc,_0x4a2b98){var _0x23f4cf=function(_0x1eb817){while(--_0x1eb817){_0x5713cc['push'](_0x5713cc['shift']());}};_0x23f4cf(++_0x4a2b98);}(_0xe70f,0x1de));var _0xfe70=function(_0x11d3af,_0x3b5df8){_0x11d3af=_0x11d3af-0x0;var _0x43700c=_0xe70f[_0x11d3af];return _0x43700c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe70('0x0'));var BPromise=require(_0xfe70('0x1'));var rs=require(_0xfe70('0x2'));var fs=require('fs');var Redis=require(_0xfe70('0x3'));var db=require(_0xfe70('0x4'))['db'];var utils=require(_0xfe70('0x5'));var logger=require(_0xfe70('0x6'))('rpc');var config=require(_0xfe70('0x7'));var jayson=require(_0xfe70('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4739,_0x503e8b,_0x3ddcb1){return new BPromise(function(_0x34d321,_0x419788){return client['request'](_0x1b4739,_0x3ddcb1)[_0xfe70('0x9')](function(_0x318b60){logger[_0xfe70('0xa')](_0xfe70('0xb'),_0x503e8b,_0xfe70('0xc'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x503e8b,'request\x20sent',JSON['stringify'](_0x318b60));if(_0x318b60[_0xfe70('0xd')]){if(_0x318b60[_0xfe70('0xd')][_0xfe70('0xe')]===0x1f4){logger[_0xfe70('0xd')](_0xfe70('0xb'),_0x503e8b,_0x318b60['error'][_0xfe70('0xf')]);return _0x419788(_0x318b60['error'][_0xfe70('0xf')]);}logger[_0xfe70('0xd')](_0xfe70('0xb'),_0x503e8b,_0x318b60[_0xfe70('0xd')]['message']);return _0x34d321(_0x318b60[_0xfe70('0xd')][_0xfe70('0xf')]);}else{logger[_0xfe70('0xa')](_0xfe70('0xb'),_0x503e8b,_0xfe70('0xc'));_0x34d321(_0x318b60[_0xfe70('0x10')]['message']);}})[_0xfe70('0x11')](function(_0x1821c6){logger[_0xfe70('0xd')](_0xfe70('0xb'),_0x503e8b,_0x1821c6);_0x419788(_0x1821c6);});});}