9be2a96904c8a60eb4292fae866dfeeb4c3681d7
[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 _0x02bf=['message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x02bf,0x122));var _0xf02b=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x02bf[_0x2d9535];return _0xb4e710;};'use strict';var _=require(_0xf02b('0x0'));var util=require('util');var moment=require(_0xf02b('0x1'));var BPromise=require(_0xf02b('0x2'));var rs=require(_0xf02b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf02b('0x4'))['db'];var utils=require(_0xf02b('0x5'));var logger=require(_0xf02b('0x6'))(_0xf02b('0x7'));var config=require(_0xf02b('0x8'));var jayson=require(_0xf02b('0x9'));var client=jayson[_0xf02b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c65a8,_0x398ed9,_0x554b25){return new BPromise(function(_0x270b5a,_0x1129ad){return client[_0xf02b('0xb')](_0x1c65a8,_0x554b25)['then'](function(_0x3492){logger[_0xf02b('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x398ed9,_0xf02b('0xd'));logger['debug'](_0xf02b('0xe'),_0x398ed9,_0xf02b('0xd'),JSON[_0xf02b('0xf')](_0x3492));if(_0x3492[_0xf02b('0x10')]){if(_0x3492[_0xf02b('0x10')][_0xf02b('0x11')]===0x1f4){logger[_0xf02b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x398ed9,_0x3492['error'][_0xf02b('0x12')]);return _0x1129ad(_0x3492[_0xf02b('0x10')]['message']);}logger[_0xf02b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x398ed9,_0x3492[_0xf02b('0x10')][_0xf02b('0x12')]);return _0x270b5a(_0x3492['error'][_0xf02b('0x12')]);}else{logger[_0xf02b('0xc')](_0xf02b('0x13'),_0x398ed9,_0xf02b('0xd'));_0x270b5a(_0x3492[_0xf02b('0x14')][_0xf02b('0x12')]);}})[_0xf02b('0x15')](function(_0x16fb6b){logger[_0xf02b('0x10')](_0xf02b('0x13'),_0x398ed9,_0x16fb6b);_0x1129ad(_0x16fb6b);});});}