96accc07e9bfcb6384cde1c9e752979293efa85b
[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 _0x7e15=['debug','request\x20sent','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x4e2d9f,_0x3f01ec){var _0x3cbddc=function(_0x4a1675){while(--_0x4a1675){_0x4e2d9f['push'](_0x4e2d9f['shift']());}};_0x3cbddc(++_0x3f01ec);}(_0x7e15,0x1bf));var _0x57e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7e15[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57e1('0x0'));var util=require(_0x57e1('0x1'));var moment=require(_0x57e1('0x2'));var BPromise=require(_0x57e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57e1('0x4'));var db=require(_0x57e1('0x5'))['db'];var utils=require(_0x57e1('0x6'));var logger=require(_0x57e1('0x7'))(_0x57e1('0x8'));var config=require(_0x57e1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x57e1('0xa')][_0x57e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b929e,_0x5afffe,_0x572f2c){return new BPromise(function(_0x213f7a,_0x3ddd58){return client[_0x57e1('0xc')](_0x5b929e,_0x572f2c)[_0x57e1('0xd')](function(_0x1412b1){logger['info'](_0x57e1('0xe'),_0x5afffe,'request\x20sent');logger[_0x57e1('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5afffe,_0x57e1('0x10'),JSON['stringify'](_0x1412b1));if(_0x1412b1[_0x57e1('0x11')]){if(_0x1412b1[_0x57e1('0x11')][_0x57e1('0x12')]===0x1f4){logger[_0x57e1('0x11')](_0x57e1('0xe'),_0x5afffe,_0x1412b1[_0x57e1('0x11')]['message']);return _0x3ddd58(_0x1412b1[_0x57e1('0x11')][_0x57e1('0x13')]);}logger[_0x57e1('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5afffe,_0x1412b1[_0x57e1('0x11')]['message']);return _0x213f7a(_0x1412b1[_0x57e1('0x11')][_0x57e1('0x13')]);}else{logger[_0x57e1('0x14')](_0x57e1('0xe'),_0x5afffe,_0x57e1('0x10'));_0x213f7a(_0x1412b1[_0x57e1('0x15')][_0x57e1('0x13')]);}})['catch'](function(_0x2e7145){logger[_0x57e1('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5afffe,_0x2e7145);_0x3ddd58(_0x2e7145);});});}