b8f6bcb11057645aa4ba59a602421f37b8f1c4a4
[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 _0xc0bf=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x3e7804,_0x121853){var _0x56efda=function(_0x1996f3){while(--_0x1996f3){_0x3e7804['push'](_0x3e7804['shift']());}};_0x56efda(++_0x121853);}(_0xc0bf,0x1ca));var _0xfc0b=function(_0x52cc3e,_0x3b1edd){_0x52cc3e=_0x52cc3e-0x0;var _0x4e5746=_0xc0bf[_0x52cc3e];return _0x4e5746;};'use strict';var _=require(_0xfc0b('0x0'));var util=require(_0xfc0b('0x1'));var moment=require(_0xfc0b('0x2'));var BPromise=require(_0xfc0b('0x3'));var rs=require(_0xfc0b('0x4'));var fs=require('fs');var Redis=require(_0xfc0b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc0b('0x6'));var logger=require(_0xfc0b('0x7'))(_0xfc0b('0x8'));var config=require(_0xfc0b('0x9'));var jayson=require(_0xfc0b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x417ec7,_0xbedfb,_0x2dcf64){return new BPromise(function(_0x32e798,_0x484e14){return client[_0xfc0b('0xb')](_0x417ec7,_0x2dcf64)[_0xfc0b('0xc')](function(_0x1a7fef){logger[_0xfc0b('0xd')](_0xfc0b('0xe'),_0xbedfb,_0xfc0b('0xf'));logger[_0xfc0b('0x10')](_0xfc0b('0x11'),_0xbedfb,_0xfc0b('0xf'),JSON['stringify'](_0x1a7fef));if(_0x1a7fef[_0xfc0b('0x12')]){if(_0x1a7fef[_0xfc0b('0x12')][_0xfc0b('0x13')]===0x1f4){logger[_0xfc0b('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xbedfb,_0x1a7fef[_0xfc0b('0x12')][_0xfc0b('0x14')]);return _0x484e14(_0x1a7fef[_0xfc0b('0x12')][_0xfc0b('0x14')]);}logger[_0xfc0b('0x12')](_0xfc0b('0xe'),_0xbedfb,_0x1a7fef[_0xfc0b('0x12')][_0xfc0b('0x14')]);return _0x32e798(_0x1a7fef['error'][_0xfc0b('0x14')]);}else{logger[_0xfc0b('0xd')](_0xfc0b('0xe'),_0xbedfb,_0xfc0b('0xf'));_0x32e798(_0x1a7fef[_0xfc0b('0x15')][_0xfc0b('0x14')]);}})['catch'](function(_0x15476e){logger['error'](_0xfc0b('0xe'),_0xbedfb,_0x15476e);_0x484e14(_0x15476e);});});}