Built motion from commit (unavailable).|2.3.9
[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 _0x3235=['rpc','../../config/environment','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils'];(function(_0xacda26,_0xdf0e51){var _0x1b222d=function(_0x560cbf){while(--_0x560cbf){_0xacda26['push'](_0xacda26['shift']());}};_0x1b222d(++_0xdf0e51);}(_0x3235,0x178));var _0x5323=function(_0x1d53ab,_0xcb4665){_0x1d53ab=_0x1d53ab-0x0;var _0x378085=_0x3235[_0x1d53ab];return _0x378085;};'use strict';var _=require('lodash');var util=require(_0x5323('0x0'));var moment=require(_0x5323('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5323('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5323('0x3'));var logger=require('../../config/logger')(_0x5323('0x4'));var config=require(_0x5323('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5323('0x6')][_0x5323('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57ff8a,_0x475690,_0x68e248){return new BPromise(function(_0x47e493,_0x4b363c){return client[_0x5323('0x8')](_0x57ff8a,_0x68e248)['then'](function(_0x5b7261){logger[_0x5323('0x9')](_0x5323('0xa'),_0x475690,_0x5323('0xb'));logger[_0x5323('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x475690,'request\x20sent',JSON[_0x5323('0xd')](_0x5b7261));if(_0x5b7261['error']){if(_0x5b7261[_0x5323('0xe')][_0x5323('0xf')]===0x1f4){logger[_0x5323('0xe')](_0x5323('0xa'),_0x475690,_0x5b7261[_0x5323('0xe')]['message']);return _0x4b363c(_0x5b7261['error'][_0x5323('0x10')]);}logger['error'](_0x5323('0xa'),_0x475690,_0x5b7261[_0x5323('0xe')][_0x5323('0x10')]);return _0x47e493(_0x5b7261['error'][_0x5323('0x10')]);}else{logger['info'](_0x5323('0xa'),_0x475690,_0x5323('0xb'));_0x47e493(_0x5b7261[_0x5323('0x11')]['message']);}})[_0x5323('0x12')](function(_0x11ed32){logger[_0x5323('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x475690,_0x11ed32);_0x4b363c(_0x11ed32);});});}