Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / intFreshsalesConfiguration / intFreshsalesConfiguration.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 _0x8dae=['../../mysqldb','../../config/utils','http','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x20dc1a,_0x359745){var _0x3fb789=function(_0x48b4f8){while(--_0x48b4f8){_0x20dc1a['push'](_0x20dc1a['shift']());}};_0x3fb789(++_0x359745);}(_0x8dae,0x1cf));var _0xe8da=function(_0x5009bb,_0x40380c){_0x5009bb=_0x5009bb-0x0;var _0x48ec0d=_0x8dae[_0x5009bb];return _0x48ec0d;};'use strict';var _=require(_0xe8da('0x0'));var util=require(_0xe8da('0x1'));var moment=require('moment');var BPromise=require(_0xe8da('0x2'));var rs=require(_0xe8da('0x3'));var fs=require('fs');var Redis=require(_0xe8da('0x4'));var db=require(_0xe8da('0x5'))['db'];var utils=require(_0xe8da('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe8da('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a09ce,_0x2a308d,_0x41fcb3){return new BPromise(function(_0x411d6d,_0x212e46){return client['request'](_0x2a09ce,_0x41fcb3)['then'](function(_0x1a9ed0){logger[_0xe8da('0x8')](_0xe8da('0x9'),_0x2a308d,_0xe8da('0xa'));logger[_0xe8da('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2a308d,_0xe8da('0xa'),JSON[_0xe8da('0xc')](_0x1a9ed0));if(_0x1a9ed0[_0xe8da('0xd')]){if(_0x1a9ed0['error'][_0xe8da('0xe')]===0x1f4){logger['error'](_0xe8da('0x9'),_0x2a308d,_0x1a9ed0['error'][_0xe8da('0xf')]);return _0x212e46(_0x1a9ed0['error'][_0xe8da('0xf')]);}logger[_0xe8da('0xd')](_0xe8da('0x9'),_0x2a308d,_0x1a9ed0[_0xe8da('0xd')][_0xe8da('0xf')]);return _0x411d6d(_0x1a9ed0[_0xe8da('0xd')][_0xe8da('0xf')]);}else{logger[_0xe8da('0x8')](_0xe8da('0x9'),_0x2a308d,'request\x20sent');_0x411d6d(_0x1a9ed0[_0xe8da('0x10')][_0xe8da('0xf')]);}})[_0xe8da('0x11')](function(_0x489a18){logger[_0xe8da('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2a308d,_0x489a18);_0x212e46(_0x489a18);});});}