Built motion from commit (unavailable).|2.5.31
[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 _0xe130=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3ee095,_0x2a1b1d){var _0x4cda2d=function(_0x20647b){while(--_0x20647b){_0x3ee095['push'](_0x3ee095['shift']());}};_0x4cda2d(++_0x2a1b1d);}(_0xe130,0x127));var _0x0e13=function(_0x4b2bc7,_0x469b2c){_0x4b2bc7=_0x4b2bc7-0x0;var _0xd3787=_0xe130[_0x4b2bc7];return _0xd3787;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var moment=require('moment');var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require(_0x0e13('0x4'));var db=require(_0x0e13('0x5'))['db'];var utils=require(_0x0e13('0x6'));var logger=require('../../config/logger')(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson[_0x0e13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1774a5,_0x5f0d09,_0x567031){return new BPromise(function(_0x5aaa22,_0x2faf49){return client[_0x0e13('0xb')](_0x1774a5,_0x567031)['then'](function(_0x5d066a){logger[_0x0e13('0xc')](_0x0e13('0xd'),_0x5f0d09,_0x0e13('0xe'));logger[_0x0e13('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5f0d09,'request\x20sent',JSON[_0x0e13('0x10')](_0x5d066a));if(_0x5d066a[_0x0e13('0x11')]){if(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x12')]===0x1f4){logger['error'](_0x0e13('0xd'),_0x5f0d09,_0x5d066a['error'][_0x0e13('0x13')]);return _0x2faf49(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);}logger[_0x0e13('0x11')](_0x0e13('0xd'),_0x5f0d09,_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);return _0x5aaa22(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);}else{logger['info'](_0x0e13('0xd'),_0x5f0d09,_0x0e13('0xe'));_0x5aaa22(_0x5d066a[_0x0e13('0x14')][_0x0e13('0x13')]);}})[_0x0e13('0x15')](function(_0x32f76a){logger['error'](_0x0e13('0xd'),_0x5f0d09,_0x32f76a);_0x2faf49(_0x32f76a);});});}