Built motion from commit a61a4a20.|2.5.46
[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 _0x5c04=['error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b4765,_0x4d1212){var _0x45353b=function(_0x3f2751){while(--_0x3f2751){_0x4b4765['push'](_0x4b4765['shift']());}};_0x45353b(++_0x4d1212);}(_0x5c04,0x146));var _0x45c0=function(_0x5470e8,_0x22e0a7){_0x5470e8=_0x5470e8-0x0;var _0x4f6121=_0x5c04[_0x5470e8];return _0x4f6121;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45c0('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x45c0('0x1'));var logger=require(_0x45c0('0x2'))(_0x45c0('0x3'));var config=require(_0x45c0('0x4'));var jayson=require(_0x45c0('0x5'));var client=jayson[_0x45c0('0x6')][_0x45c0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x12e0b5,_0x2659ec,_0x155f0b){return new BPromise(function(_0x144f72,_0x5c4a69){return client[_0x45c0('0x8')](_0x12e0b5,_0x155f0b)['then'](function(_0x35fb34){logger[_0x45c0('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x2659ec,'request\x20sent');logger[_0x45c0('0xa')](_0x45c0('0xb'),_0x2659ec,_0x45c0('0xc'),JSON[_0x45c0('0xd')](_0x35fb34));if(_0x35fb34[_0x45c0('0xe')]){if(_0x35fb34['error'][_0x45c0('0xf')]===0x1f4){logger[_0x45c0('0xe')](_0x45c0('0x10'),_0x2659ec,_0x35fb34[_0x45c0('0xe')][_0x45c0('0x11')]);return _0x5c4a69(_0x35fb34[_0x45c0('0xe')]['message']);}logger['error'](_0x45c0('0x10'),_0x2659ec,_0x35fb34[_0x45c0('0xe')][_0x45c0('0x11')]);return _0x144f72(_0x35fb34[_0x45c0('0xe')][_0x45c0('0x11')]);}else{logger[_0x45c0('0x9')](_0x45c0('0x10'),_0x2659ec,_0x45c0('0xc'));_0x144f72(_0x35fb34[_0x45c0('0x12')][_0x45c0('0x11')]);}})[_0x45c0('0x13')](function(_0x1ec521){logger[_0x45c0('0xe')](_0x45c0('0x10'),_0x2659ec,_0x1ec521);_0x5c4a69(_0x1ec521);});});}