956e6ddd51064a046aaa6159812079bc1edc1815
[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 _0xbdc8=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x533290,_0x31e3ae){var _0x23f13d=function(_0x3473fb){while(--_0x3473fb){_0x533290['push'](_0x533290['shift']());}};_0x23f13d(++_0x31e3ae);}(_0xbdc8,0x10e));var _0x8bdc=function(_0x333cfa,_0x74e10b){_0x333cfa=_0x333cfa-0x0;var _0x592349=_0xbdc8[_0x333cfa];return _0x592349;};'use strict';var _=require(_0x8bdc('0x0'));var util=require(_0x8bdc('0x1'));var moment=require(_0x8bdc('0x2'));var BPromise=require(_0x8bdc('0x3'));var rs=require(_0x8bdc('0x4'));var fs=require('fs');var Redis=require(_0x8bdc('0x5'));var db=require(_0x8bdc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bdc('0x7'))('rpc');var config=require(_0x8bdc('0x8'));var jayson=require(_0x8bdc('0x9'));var client=jayson[_0x8bdc('0xa')][_0x8bdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x479371,_0x5cd9a1,_0x53f52a){return new BPromise(function(_0x442183,_0x45c349){return client[_0x8bdc('0xc')](_0x479371,_0x53f52a)[_0x8bdc('0xd')](function(_0x3a4274){logger[_0x8bdc('0xe')](_0x8bdc('0xf'),_0x5cd9a1,_0x8bdc('0x10'));logger[_0x8bdc('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5cd9a1,_0x8bdc('0x10'),JSON[_0x8bdc('0x12')](_0x3a4274));if(_0x3a4274[_0x8bdc('0x13')]){if(_0x3a4274[_0x8bdc('0x13')][_0x8bdc('0x14')]===0x1f4){logger[_0x8bdc('0x13')](_0x8bdc('0xf'),_0x5cd9a1,_0x3a4274[_0x8bdc('0x13')][_0x8bdc('0x15')]);return _0x45c349(_0x3a4274[_0x8bdc('0x13')][_0x8bdc('0x15')]);}logger[_0x8bdc('0x13')](_0x8bdc('0xf'),_0x5cd9a1,_0x3a4274[_0x8bdc('0x13')][_0x8bdc('0x15')]);return _0x442183(_0x3a4274[_0x8bdc('0x13')]['message']);}else{logger[_0x8bdc('0xe')](_0x8bdc('0xf'),_0x5cd9a1,_0x8bdc('0x10'));_0x442183(_0x3a4274[_0x8bdc('0x16')][_0x8bdc('0x15')]);}})['catch'](function(_0x31419e){logger['error'](_0x8bdc('0xf'),_0x5cd9a1,_0x31419e);_0x45c349(_0x31419e);});});}