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 _0x33c5=['jayson/promise','client','http','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x57fe10,_0xc39128){var _0x183c17=function(_0x5bb8bb){while(--_0x5bb8bb){_0x57fe10['push'](_0x57fe10['shift']());}};_0x183c17(++_0xc39128);}(_0x33c5,0x1ae));var _0x533c=function(_0x3a723e,_0x59d99a){_0x3a723e=_0x3a723e-0x0;var _0x3e9c03=_0x33c5[_0x3a723e];return _0x3e9c03;};'use strict';var _=require(_0x533c('0x0'));var util=require('util');var moment=require(_0x533c('0x1'));var BPromise=require(_0x533c('0x2'));var rs=require(_0x533c('0x3'));var fs=require('fs');var Redis=require(_0x533c('0x4'));var db=require(_0x533c('0x5'))['db'];var utils=require(_0x533c('0x6'));var logger=require(_0x533c('0x7'))(_0x533c('0x8'));var config=require(_0x533c('0x9'));var jayson=require(_0x533c('0xa'));var client=jayson[_0x533c('0xb')][_0x533c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57c886,_0x18f9b4,_0x4c6999){return new BPromise(function(_0x14c331,_0x56caea){return client['request'](_0x57c886,_0x4c6999)['then'](function(_0xde2bcb){logger['info'](_0x533c('0xd'),_0x18f9b4,_0x533c('0xe'));logger['debug'](_0x533c('0xf'),_0x18f9b4,'request\x20sent',JSON[_0x533c('0x10')](_0xde2bcb));if(_0xde2bcb[_0x533c('0x11')]){if(_0xde2bcb[_0x533c('0x11')][_0x533c('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x18f9b4,_0xde2bcb[_0x533c('0x11')][_0x533c('0x13')]);return _0x56caea(_0xde2bcb[_0x533c('0x11')][_0x533c('0x13')]);}logger['error'](_0x533c('0xd'),_0x18f9b4,_0xde2bcb[_0x533c('0x11')][_0x533c('0x13')]);return _0x14c331(_0xde2bcb['error'][_0x533c('0x13')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x18f9b4,_0x533c('0xe'));_0x14c331(_0xde2bcb[_0x533c('0x14')][_0x533c('0x13')]);}})[_0x533c('0x15')](function(_0x2770d2){logger[_0x533c('0x11')](_0x533c('0xd'),_0x18f9b4,_0x2770d2);_0x56caea(_0x2770d2);});});}