67570ffd477eada354fd398f4c4533d06dce402d
[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 _0xe5d6=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x4fd23d,_0x28d052){var _0x316f11=function(_0x2a1de6){while(--_0x2a1de6){_0x4fd23d['push'](_0x4fd23d['shift']());}};_0x316f11(++_0x28d052);}(_0xe5d6,0x189));var _0x6e5d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe5d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x6e5d('0x0'));var util=require(_0x6e5d('0x1'));var moment=require(_0x6e5d('0x2'));var BPromise=require(_0x6e5d('0x3'));var rs=require(_0x6e5d('0x4'));var fs=require('fs');var Redis=require(_0x6e5d('0x5'));var db=require(_0x6e5d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e5d('0x7'))(_0x6e5d('0x8'));var config=require(_0x6e5d('0x9'));var jayson=require(_0x6e5d('0xa'));var client=jayson[_0x6e5d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26cfb0,_0x505756,_0x428586){return new BPromise(function(_0x2e639f,_0xeb9e4e){return client['request'](_0x26cfb0,_0x428586)[_0x6e5d('0xc')](function(_0x5d0000){logger[_0x6e5d('0xd')](_0x6e5d('0xe'),_0x505756,_0x6e5d('0xf'));logger[_0x6e5d('0x10')](_0x6e5d('0x11'),_0x505756,_0x6e5d('0xf'),JSON[_0x6e5d('0x12')](_0x5d0000));if(_0x5d0000[_0x6e5d('0x13')]){if(_0x5d0000[_0x6e5d('0x13')][_0x6e5d('0x14')]===0x1f4){logger[_0x6e5d('0x13')](_0x6e5d('0xe'),_0x505756,_0x5d0000['error']['message']);return _0xeb9e4e(_0x5d0000[_0x6e5d('0x13')][_0x6e5d('0x15')]);}logger[_0x6e5d('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x505756,_0x5d0000[_0x6e5d('0x13')][_0x6e5d('0x15')]);return _0x2e639f(_0x5d0000[_0x6e5d('0x13')][_0x6e5d('0x15')]);}else{logger['info'](_0x6e5d('0xe'),_0x505756,_0x6e5d('0xf'));_0x2e639f(_0x5d0000[_0x6e5d('0x16')][_0x6e5d('0x15')]);}})[_0x6e5d('0x17')](function(_0x53c055){logger[_0x6e5d('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x505756,_0x53c055);_0xeb9e4e(_0x53c055);});});}