Built motion from commit b5413ace.|2.6.9
[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 _0x9c1f=['client','http','request','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4c87ab,_0x36a1df){var _0x13633f=function(_0x3aeb10){while(--_0x3aeb10){_0x4c87ab['push'](_0x4c87ab['shift']());}};_0x13633f(++_0x36a1df);}(_0x9c1f,0x7c));var _0xf9c1=function(_0x655ccf,_0x24b4ca){_0x655ccf=_0x655ccf-0x0;var _0x3e7a6b=_0x9c1f[_0x655ccf];return _0x3e7a6b;};'use strict';var _=require(_0xf9c1('0x0'));var util=require(_0xf9c1('0x1'));var moment=require(_0xf9c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9c1('0x3'));var db=require(_0xf9c1('0x4'))['db'];var utils=require(_0xf9c1('0x5'));var logger=require('../../config/logger')(_0xf9c1('0x6'));var config=require(_0xf9c1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf9c1('0x8')][_0xf9c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x562a02,_0x3ce623,_0x3def11){return new BPromise(function(_0x2de626,_0x331645){return client[_0xf9c1('0xa')](_0x562a02,_0x3def11)[_0xf9c1('0xb')](function(_0x14a82c){logger[_0xf9c1('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ce623,_0xf9c1('0xd'));logger['debug'](_0xf9c1('0xe'),_0x3ce623,_0xf9c1('0xd'),JSON[_0xf9c1('0xf')](_0x14a82c));if(_0x14a82c[_0xf9c1('0x10')]){if(_0x14a82c['error'][_0xf9c1('0x11')]===0x1f4){logger[_0xf9c1('0x10')](_0xf9c1('0x12'),_0x3ce623,_0x14a82c[_0xf9c1('0x10')]['message']);return _0x331645(_0x14a82c['error'][_0xf9c1('0x13')]);}logger[_0xf9c1('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ce623,_0x14a82c[_0xf9c1('0x10')]['message']);return _0x2de626(_0x14a82c[_0xf9c1('0x10')][_0xf9c1('0x13')]);}else{logger[_0xf9c1('0xc')](_0xf9c1('0x12'),_0x3ce623,_0xf9c1('0xd'));_0x2de626(_0x14a82c[_0xf9c1('0x14')]['message']);}})[_0xf9c1('0x15')](function(_0x1b68f1){logger['error'](_0xf9c1('0x12'),_0x3ce623,_0x1b68f1);_0x331645(_0x1b68f1);});});}