Built motion from commit (unavailable).|2.4.0
[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 _0xeb5e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2765a7,_0x5ab1d5){var _0x49e529=function(_0x28d1a9){while(--_0x28d1a9){_0x2765a7['push'](_0x2765a7['shift']());}};_0x49e529(++_0x5ab1d5);}(_0xeb5e,0x1a2));var _0xeeb5=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xeb5e[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xeeb5('0x0'));var util=require(_0xeeb5('0x1'));var moment=require(_0xeeb5('0x2'));var BPromise=require(_0xeeb5('0x3'));var rs=require(_0xeeb5('0x4'));var fs=require('fs');var Redis=require(_0xeeb5('0x5'));var db=require(_0xeeb5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeeb5('0x7'))(_0xeeb5('0x8'));var config=require(_0xeeb5('0x9'));var jayson=require(_0xeeb5('0xa'));var client=jayson['client'][_0xeeb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x378521,_0x346561,_0xbafa2a){return new BPromise(function(_0xb2d6d4,_0x9fc59a){return client[_0xeeb5('0xc')](_0x378521,_0xbafa2a)['then'](function(_0xbd5892){logger[_0xeeb5('0xd')](_0xeeb5('0xe'),_0x346561,'request\x20sent');logger[_0xeeb5('0xf')](_0xeeb5('0x10'),_0x346561,_0xeeb5('0x11'),JSON[_0xeeb5('0x12')](_0xbd5892));if(_0xbd5892[_0xeeb5('0x13')]){if(_0xbd5892[_0xeeb5('0x13')][_0xeeb5('0x14')]===0x1f4){logger[_0xeeb5('0x13')](_0xeeb5('0xe'),_0x346561,_0xbd5892[_0xeeb5('0x13')][_0xeeb5('0x15')]);return _0x9fc59a(_0xbd5892[_0xeeb5('0x13')][_0xeeb5('0x15')]);}logger[_0xeeb5('0x13')](_0xeeb5('0xe'),_0x346561,_0xbd5892['error']['message']);return _0xb2d6d4(_0xbd5892[_0xeeb5('0x13')]['message']);}else{logger[_0xeeb5('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x346561,'request\x20sent');_0xb2d6d4(_0xbd5892['result'][_0xeeb5('0x15')]);}})['catch'](function(_0x4dc019){logger['error'](_0xeeb5('0xe'),_0x346561,_0x4dc019);_0x9fc59a(_0x4dc019);});});}