103d7cf622fdd37b1b4a6d722b0cd4277458c289
[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 _0xe3b5=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4f8b44,_0x4eda31){var _0x45727b=function(_0x566b10){while(--_0x566b10){_0x4f8b44['push'](_0x4f8b44['shift']());}};_0x45727b(++_0x4eda31);}(_0xe3b5,0x1a6));var _0x5e3b=function(_0x258f9b,_0x219294){_0x258f9b=_0x258f9b-0x0;var _0xfe4c92=_0xe3b5[_0x258f9b];return _0xfe4c92;};'use strict';var _=require(_0x5e3b('0x0'));var util=require(_0x5e3b('0x1'));var moment=require(_0x5e3b('0x2'));var BPromise=require(_0x5e3b('0x3'));var rs=require(_0x5e3b('0x4'));var fs=require('fs');var Redis=require(_0x5e3b('0x5'));var db=require(_0x5e3b('0x6'))['db'];var utils=require(_0x5e3b('0x7'));var logger=require(_0x5e3b('0x8'))(_0x5e3b('0x9'));var config=require(_0x5e3b('0xa'));var jayson=require(_0x5e3b('0xb'));var client=jayson[_0x5e3b('0xc')][_0x5e3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x271c7c,_0x49f766,_0x2ee8d9){return new BPromise(function(_0x57116d,_0x35271d){return client[_0x5e3b('0xe')](_0x271c7c,_0x2ee8d9)['then'](function(_0x5cc9cb){logger[_0x5e3b('0xf')](_0x5e3b('0x10'),_0x49f766,_0x5e3b('0x11'));logger[_0x5e3b('0x12')](_0x5e3b('0x13'),_0x49f766,_0x5e3b('0x11'),JSON[_0x5e3b('0x14')](_0x5cc9cb));if(_0x5cc9cb['error']){if(_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x16')]===0x1f4){logger[_0x5e3b('0x15')](_0x5e3b('0x10'),_0x49f766,_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x17')]);return _0x35271d(_0x5cc9cb['error'][_0x5e3b('0x17')]);}logger[_0x5e3b('0x15')]('ZohoConfiguration,\x20%s,\x20%s',_0x49f766,_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x17')]);return _0x57116d(_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x17')]);}else{logger[_0x5e3b('0xf')](_0x5e3b('0x10'),_0x49f766,_0x5e3b('0x11'));_0x57116d(_0x5cc9cb[_0x5e3b('0x18')][_0x5e3b('0x17')]);}})[_0x5e3b('0x19')](function(_0x1a9913){logger[_0x5e3b('0x15')](_0x5e3b('0x10'),_0x49f766,_0x1a9913);_0x35271d(_0x1a9913);});});}