Built motion from commit 85328c08.|2.5.50
[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 _0xa5e8=['then','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x245d89,_0x1ebbbc){var _0x3bb629=function(_0x2703d6){while(--_0x2703d6){_0x245d89['push'](_0x245d89['shift']());}};_0x3bb629(++_0x1ebbbc);}(_0xa5e8,0xfb));var _0x8a5e=function(_0x15d715,_0x16c046){_0x15d715=_0x15d715-0x0;var _0x129065=_0xa5e8[_0x15d715];return _0x129065;};'use strict';var _=require(_0x8a5e('0x0'));var util=require('util');var moment=require(_0x8a5e('0x1'));var BPromise=require(_0x8a5e('0x2'));var rs=require(_0x8a5e('0x3'));var fs=require('fs');var Redis=require(_0x8a5e('0x4'));var db=require(_0x8a5e('0x5'))['db'];var utils=require(_0x8a5e('0x6'));var logger=require(_0x8a5e('0x7'))('rpc');var config=require(_0x8a5e('0x8'));var jayson=require(_0x8a5e('0x9'));var client=jayson[_0x8a5e('0xa')][_0x8a5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c59b6,_0x53e741,_0x415593){return new BPromise(function(_0x4d262a,_0x1bfca0){return client[_0x8a5e('0xc')](_0x2c59b6,_0x415593)[_0x8a5e('0xd')](function(_0x2bfa40){logger['info'](_0x8a5e('0xe'),_0x53e741,'request\x20sent');logger[_0x8a5e('0xf')](_0x8a5e('0x10'),_0x53e741,_0x8a5e('0x11'),JSON[_0x8a5e('0x12')](_0x2bfa40));if(_0x2bfa40[_0x8a5e('0x13')]){if(_0x2bfa40['error'][_0x8a5e('0x14')]===0x1f4){logger[_0x8a5e('0x13')](_0x8a5e('0xe'),_0x53e741,_0x2bfa40[_0x8a5e('0x13')]['message']);return _0x1bfca0(_0x2bfa40['error'][_0x8a5e('0x15')]);}logger[_0x8a5e('0x13')](_0x8a5e('0xe'),_0x53e741,_0x2bfa40[_0x8a5e('0x13')][_0x8a5e('0x15')]);return _0x4d262a(_0x2bfa40['error'][_0x8a5e('0x15')]);}else{logger[_0x8a5e('0x16')](_0x8a5e('0xe'),_0x53e741,'request\x20sent');_0x4d262a(_0x2bfa40[_0x8a5e('0x17')][_0x8a5e('0x15')]);}})['catch'](function(_0x27ebf9){logger[_0x8a5e('0x13')](_0x8a5e('0xe'),_0x53e741,_0x27ebf9);_0x1bfca0(_0x27ebf9);});});}