b03401d5a7d702df84f0575005fcb810a398e13a
[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 _0xefaf=['ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0xefaf,0x1c2));var _0xfefa=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xefaf[_0x100e36];return _0x1df0c9;};'use strict';var _=require(_0xfefa('0x0'));var util=require(_0xfefa('0x1'));var moment=require(_0xfefa('0x2'));var BPromise=require('bluebird');var rs=require(_0xfefa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfefa('0x4'));var logger=require('../../config/logger')(_0xfefa('0x5'));var config=require(_0xfefa('0x6'));var jayson=require(_0xfefa('0x7'));var client=jayson[_0xfefa('0x8')][_0xfefa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22a052,_0x640746,_0x295c0a){return new BPromise(function(_0x10f20a,_0x49a6d4){return client['request'](_0x22a052,_0x295c0a)[_0xfefa('0xa')](function(_0x36c583){logger[_0xfefa('0xb')](_0xfefa('0xc'),_0x640746,'request\x20sent');logger[_0xfefa('0xd')](_0xfefa('0xe'),_0x640746,_0xfefa('0xf'),JSON[_0xfefa('0x10')](_0x36c583));if(_0x36c583[_0xfefa('0x11')]){if(_0x36c583[_0xfefa('0x11')][_0xfefa('0x12')]===0x1f4){logger[_0xfefa('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x640746,_0x36c583[_0xfefa('0x11')][_0xfefa('0x13')]);return _0x49a6d4(_0x36c583['error']['message']);}logger[_0xfefa('0x11')](_0xfefa('0xc'),_0x640746,_0x36c583['error']['message']);return _0x10f20a(_0x36c583['error'][_0xfefa('0x13')]);}else{logger[_0xfefa('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x640746,_0xfefa('0xf'));_0x10f20a(_0x36c583[_0xfefa('0x14')][_0xfefa('0x13')]);}})[_0xfefa('0x15')](function(_0x27bd3d){logger[_0xfefa('0x11')](_0xfefa('0xc'),_0x640746,_0x27bd3d);_0x49a6d4(_0x27bd3d);});});}