96d0173a6647786cf5e3be762d96db41cd32885d
[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 _0xffaa=['../../config/environment','jayson/promise','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x216473,_0x267fb9){var _0x1d562b=function(_0x23a097){while(--_0x23a097){_0x216473['push'](_0x216473['shift']());}};_0x1d562b(++_0x267fb9);}(_0xffaa,0x12c));var _0xaffa=function(_0x782ba1,_0x1187e8){_0x782ba1=_0x782ba1-0x0;var _0x55bed9=_0xffaa[_0x782ba1];return _0x55bed9;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var BPromise=require(_0xaffa('0x3'));var rs=require(_0xaffa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaffa('0x5'))['db'];var utils=require(_0xaffa('0x6'));var logger=require('../../config/logger')(_0xaffa('0x7'));var config=require(_0xaffa('0x8'));var jayson=require(_0xaffa('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7a04,_0x9635ee,_0x1500a4){return new BPromise(function(_0x38b8db,_0x29c96e){return client['request'](_0x3f7a04,_0x1500a4)[_0xaffa('0xa')](function(_0x18f5eb){logger[_0xaffa('0xb')](_0xaffa('0xc'),_0x9635ee,'request\x20sent');logger[_0xaffa('0xd')](_0xaffa('0xe'),_0x9635ee,_0xaffa('0xf'),JSON[_0xaffa('0x10')](_0x18f5eb));if(_0x18f5eb[_0xaffa('0x11')]){if(_0x18f5eb[_0xaffa('0x11')][_0xaffa('0x12')]===0x1f4){logger['error'](_0xaffa('0xc'),_0x9635ee,_0x18f5eb[_0xaffa('0x11')]['message']);return _0x29c96e(_0x18f5eb[_0xaffa('0x11')][_0xaffa('0x13')]);}logger[_0xaffa('0x11')](_0xaffa('0xc'),_0x9635ee,_0x18f5eb[_0xaffa('0x11')][_0xaffa('0x13')]);return _0x38b8db(_0x18f5eb[_0xaffa('0x11')][_0xaffa('0x13')]);}else{logger[_0xaffa('0xb')](_0xaffa('0xc'),_0x9635ee,_0xaffa('0xf'));_0x38b8db(_0x18f5eb[_0xaffa('0x14')][_0xaffa('0x13')]);}})[_0xaffa('0x15')](function(_0x726a23){logger[_0xaffa('0x11')](_0xaffa('0xc'),_0x9635ee,_0x726a23);_0x29c96e(_0x726a23);});});}