Built motion from commit (unavailable).|2.5.30
[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 _0x92e2=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x92e2,0x150));var _0x292e=function(_0x116549,_0x210e8b){_0x116549=_0x116549-0x0;var _0x1321e5=_0x92e2[_0x116549];return _0x1321e5;};'use strict';var _=require(_0x292e('0x0'));var util=require('util');var moment=require(_0x292e('0x1'));var BPromise=require(_0x292e('0x2'));var rs=require(_0x292e('0x3'));var fs=require('fs');var Redis=require(_0x292e('0x4'));var db=require(_0x292e('0x5'))['db'];var utils=require(_0x292e('0x6'));var logger=require(_0x292e('0x7'))(_0x292e('0x8'));var config=require('../../config/environment');var jayson=require(_0x292e('0x9'));var client=jayson[_0x292e('0xa')][_0x292e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21e905,_0x51274d,_0x68b9c8){return new BPromise(function(_0x20efe3,_0x9bd4a7){return client['request'](_0x21e905,_0x68b9c8)[_0x292e('0xc')](function(_0x19ef0c){logger[_0x292e('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x51274d,_0x292e('0xe'));logger['debug'](_0x292e('0xf'),_0x51274d,_0x292e('0xe'),JSON['stringify'](_0x19ef0c));if(_0x19ef0c[_0x292e('0x10')]){if(_0x19ef0c['error'][_0x292e('0x11')]===0x1f4){logger[_0x292e('0x10')](_0x292e('0x12'),_0x51274d,_0x19ef0c[_0x292e('0x10')][_0x292e('0x13')]);return _0x9bd4a7(_0x19ef0c[_0x292e('0x10')][_0x292e('0x13')]);}logger[_0x292e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x51274d,_0x19ef0c['error'][_0x292e('0x13')]);return _0x20efe3(_0x19ef0c[_0x292e('0x10')][_0x292e('0x13')]);}else{logger['info'](_0x292e('0x12'),_0x51274d,_0x292e('0xe'));_0x20efe3(_0x19ef0c['result']['message']);}})[_0x292e('0x14')](function(_0x2563f4){logger[_0x292e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x51274d,_0x2563f4);_0x9bd4a7(_0x2563f4);});});}