Built motion from commit 10af8726.|2.6.34
[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 _0xcc05=['error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x36c0d1,_0x1d9948){var _0x59c859=function(_0x5d4c69){while(--_0x5d4c69){_0x36c0d1['push'](_0x36c0d1['shift']());}};_0x59c859(++_0x1d9948);}(_0xcc05,0x180));var _0x5cc0=function(_0x2aa4ca,_0x1128aa){_0x2aa4ca=_0x2aa4ca-0x0;var _0x335a48=_0xcc05[_0x2aa4ca];return _0x335a48;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5cc0('0x0'));var BPromise=require(_0x5cc0('0x1'));var rs=require(_0x5cc0('0x2'));var fs=require('fs');var Redis=require(_0x5cc0('0x3'));var db=require(_0x5cc0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cc0('0x5'))(_0x5cc0('0x6'));var config=require(_0x5cc0('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3cf2,_0x3f0665,_0x14a5fe){return new BPromise(function(_0x5519fd,_0x1b0abf){return client[_0x5cc0('0x8')](_0x3e3cf2,_0x14a5fe)[_0x5cc0('0x9')](function(_0x2359a2){logger[_0x5cc0('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0665,_0x5cc0('0xb'));logger[_0x5cc0('0xc')](_0x5cc0('0xd'),_0x3f0665,_0x5cc0('0xb'),JSON[_0x5cc0('0xe')](_0x2359a2));if(_0x2359a2['error']){if(_0x2359a2[_0x5cc0('0xf')][_0x5cc0('0x10')]===0x1f4){logger[_0x5cc0('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0665,_0x2359a2[_0x5cc0('0xf')][_0x5cc0('0x11')]);return _0x1b0abf(_0x2359a2[_0x5cc0('0xf')]['message']);}logger['error'](_0x5cc0('0x12'),_0x3f0665,_0x2359a2[_0x5cc0('0xf')][_0x5cc0('0x11')]);return _0x5519fd(_0x2359a2['error']['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3f0665,_0x5cc0('0xb'));_0x5519fd(_0x2359a2[_0x5cc0('0x13')][_0x5cc0('0x11')]);}})[_0x5cc0('0x14')](function(_0x307f97){logger[_0x5cc0('0xf')](_0x5cc0('0x12'),_0x3f0665,_0x307f97);_0x1b0abf(_0x307f97);});});}