Built motion from commit f9526609.|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 _0x5efe=['util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x5abb00,_0x342d70){var _0xf9b854=function(_0x43ac30){while(--_0x43ac30){_0x5abb00['push'](_0x5abb00['shift']());}};_0xf9b854(++_0x342d70);}(_0x5efe,0x12f));var _0xe5ef=function(_0x61c232,_0x20a062){_0x61c232=_0x61c232-0x0;var _0xfa3132=_0x5efe[_0x61c232];return _0xfa3132;};'use strict';var _=require(_0xe5ef('0x0'));var util=require(_0xe5ef('0x1'));var moment=require('moment');var BPromise=require(_0xe5ef('0x2'));var rs=require(_0xe5ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe5ef('0x4'));var config=require(_0xe5ef('0x5'));var jayson=require(_0xe5ef('0x6'));var client=jayson[_0xe5ef('0x7')][_0xe5ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23a36e,_0x596dd1,_0x4e21cd){return new BPromise(function(_0x517c89,_0xea5164){return client[_0xe5ef('0x9')](_0x23a36e,_0x4e21cd)[_0xe5ef('0xa')](function(_0x5235e8){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x596dd1,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x596dd1,_0xe5ef('0xb'),JSON[_0xe5ef('0xc')](_0x5235e8));if(_0x5235e8[_0xe5ef('0xd')]){if(_0x5235e8[_0xe5ef('0xd')]['code']===0x1f4){logger[_0xe5ef('0xd')](_0xe5ef('0xe'),_0x596dd1,_0x5235e8[_0xe5ef('0xd')]['message']);return _0xea5164(_0x5235e8[_0xe5ef('0xd')]['message']);}logger[_0xe5ef('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x596dd1,_0x5235e8[_0xe5ef('0xd')][_0xe5ef('0xf')]);return _0x517c89(_0x5235e8[_0xe5ef('0xd')][_0xe5ef('0xf')]);}else{logger[_0xe5ef('0x10')](_0xe5ef('0xe'),_0x596dd1,_0xe5ef('0xb'));_0x517c89(_0x5235e8[_0xe5ef('0x11')]['message']);}})[_0xe5ef('0x12')](function(_0xbf8788){logger[_0xe5ef('0xd')](_0xe5ef('0xe'),_0x596dd1,_0xbf8788);_0xea5164(_0xbf8788);});});}