Built motion from commit da617fac.|2.6.6
[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 _0x8469=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b823b,_0x3c3f3f){var _0x1cbe3d=function(_0x5cc7fe){while(--_0x5cc7fe){_0x2b823b['push'](_0x2b823b['shift']());}};_0x1cbe3d(++_0x3c3f3f);}(_0x8469,0x137));var _0x9846=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x8469[_0x1857d0];return _0x3e3c46;};'use strict';var _=require(_0x9846('0x0'));var util=require(_0x9846('0x1'));var moment=require(_0x9846('0x2'));var BPromise=require(_0x9846('0x3'));var rs=require(_0x9846('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9846('0x5'));var config=require(_0x9846('0x6'));var jayson=require(_0x9846('0x7'));var client=jayson[_0x9846('0x8')][_0x9846('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c1de7,_0x2ed132,_0x20da89){return new BPromise(function(_0x34eecc,_0x21e5ae){return client['request'](_0x1c1de7,_0x20da89)['then'](function(_0x4daaf7){logger['info'](_0x9846('0xa'),_0x2ed132,_0x9846('0xb'));logger[_0x9846('0xc')](_0x9846('0xd'),_0x2ed132,_0x9846('0xb'),JSON['stringify'](_0x4daaf7));if(_0x4daaf7[_0x9846('0xe')]){if(_0x4daaf7[_0x9846('0xe')][_0x9846('0xf')]===0x1f4){logger[_0x9846('0xe')](_0x9846('0xa'),_0x2ed132,_0x4daaf7['error'][_0x9846('0x10')]);return _0x21e5ae(_0x4daaf7['error']['message']);}logger[_0x9846('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ed132,_0x4daaf7['error']['message']);return _0x34eecc(_0x4daaf7[_0x9846('0xe')][_0x9846('0x10')]);}else{logger[_0x9846('0x11')](_0x9846('0xa'),_0x2ed132,_0x9846('0xb'));_0x34eecc(_0x4daaf7['result'][_0x9846('0x10')]);}})['catch'](function(_0x28c1ea){logger[_0x9846('0xe')](_0x9846('0xa'),_0x2ed132,_0x28c1ea);_0x21e5ae(_0x28c1ea);});});}