Built motion from commit ff78e754.|2.6.29
[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 _0x7a0e=['code','message','request\x20sent','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x46b1d0,_0x39fff6){var _0x1b0552=function(_0xf09634){while(--_0xf09634){_0x46b1d0['push'](_0x46b1d0['shift']());}};_0x1b0552(++_0x39fff6);}(_0x7a0e,0xdf));var _0xe7a0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7a0e[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xe7a0('0x0'));var util=require(_0xe7a0('0x1'));var moment=require(_0xe7a0('0x2'));var BPromise=require(_0xe7a0('0x3'));var rs=require(_0xe7a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7a0('0x5'));var logger=require(_0xe7a0('0x6'))(_0xe7a0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe7a0('0x8'));var client=jayson[_0xe7a0('0x9')][_0xe7a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3f26,_0x5c41c2,_0x34c9bd){return new BPromise(function(_0x10fc0c,_0x2d5057){return client[_0xe7a0('0xb')](_0x3e3f26,_0x34c9bd)[_0xe7a0('0xc')](function(_0x3691a1){logger[_0xe7a0('0xd')](_0xe7a0('0xe'),_0x5c41c2,'request\x20sent');logger['debug'](_0xe7a0('0xf'),_0x5c41c2,'request\x20sent',JSON['stringify'](_0x3691a1));if(_0x3691a1[_0xe7a0('0x10')]){if(_0x3691a1[_0xe7a0('0x10')][_0xe7a0('0x11')]===0x1f4){logger[_0xe7a0('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5c41c2,_0x3691a1['error'][_0xe7a0('0x12')]);return _0x2d5057(_0x3691a1[_0xe7a0('0x10')]['message']);}logger[_0xe7a0('0x10')](_0xe7a0('0xe'),_0x5c41c2,_0x3691a1[_0xe7a0('0x10')][_0xe7a0('0x12')]);return _0x10fc0c(_0x3691a1[_0xe7a0('0x10')][_0xe7a0('0x12')]);}else{logger[_0xe7a0('0xd')](_0xe7a0('0xe'),_0x5c41c2,_0xe7a0('0x13'));_0x10fc0c(_0x3691a1['result'][_0xe7a0('0x12')]);}})['catch'](function(_0x145e07){logger[_0xe7a0('0x10')](_0xe7a0('0xe'),_0x5c41c2,_0x145e07);_0x2d5057(_0x145e07);});});}