02b1bec343d2a56ae5a0880073da529090646cea
[motion2.git] / server / api / intZohoConfiguration / intZohoConfiguration.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 _0xb01f=['error','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0xb01f,0x104));var _0xfb01=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xb01f[_0x3b3f4f];return _0x174dbe;};'use strict';var _=require(_0xfb01('0x0'));var util=require(_0xfb01('0x1'));var moment=require('moment');var BPromise=require(_0xfb01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb01('0x3'))['db'];var utils=require(_0xfb01('0x4'));var logger=require('../../config/logger')(_0xfb01('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x397842,_0x4ce021){return new BPromise(function(_0x209745,_0x22df89){return client[_0xfb01('0x6')](_0x3b0829,_0x4ce021)['then'](function(_0x7efa22){logger[_0xfb01('0x7')]('ZohoConfiguration,\x20%s,\x20%s',_0x397842,_0xfb01('0x8'));logger[_0xfb01('0x9')](_0xfb01('0xa'),_0x397842,_0xfb01('0x8'),JSON[_0xfb01('0xb')](_0x7efa22));if(_0x7efa22[_0xfb01('0xc')]){if(_0x7efa22[_0xfb01('0xc')]['code']===0x1f4){logger[_0xfb01('0xc')](_0xfb01('0xd'),_0x397842,_0x7efa22['error'][_0xfb01('0xe')]);return _0x22df89(_0x7efa22[_0xfb01('0xc')]['message']);}logger[_0xfb01('0xc')](_0xfb01('0xd'),_0x397842,_0x7efa22[_0xfb01('0xc')][_0xfb01('0xe')]);return _0x209745(_0x7efa22['error'][_0xfb01('0xe')]);}else{logger[_0xfb01('0x7')](_0xfb01('0xd'),_0x397842,_0xfb01('0x8'));_0x209745(_0x7efa22[_0xfb01('0xf')][_0xfb01('0xe')]);}})['catch'](function(_0x1d124d){logger[_0xfb01('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x397842,_0x1d124d);_0x22df89(_0x1d124d);});});}