Built motion from commit (unavailable).|2.5.14
[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 _0x285b=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','request\x20sent'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x285b,0x10d));var _0xb285=function(_0xdac179,_0x2bd97c){_0xdac179=_0xdac179-0x0;var _0x5d18cf=_0x285b[_0xdac179];return _0x5d18cf;};'use strict';var _=require('lodash');var util=require(_0xb285('0x0'));var moment=require(_0xb285('0x1'));var BPromise=require('bluebird');var rs=require(_0xb285('0x2'));var fs=require('fs');var Redis=require(_0xb285('0x3'));var db=require(_0xb285('0x4'))['db'];var utils=require(_0xb285('0x5'));var logger=require(_0xb285('0x6'))(_0xb285('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1345d5,_0x9ecef,_0x5035df){return new BPromise(function(_0x434561,_0x5606ac){return client[_0xb285('0x8')](_0x1345d5,_0x5035df)['then'](function(_0x2edd7c){logger[_0xb285('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x9ecef,_0xb285('0xa'));logger[_0xb285('0xb')](_0xb285('0xc'),_0x9ecef,_0xb285('0xa'),JSON[_0xb285('0xd')](_0x2edd7c));if(_0x2edd7c[_0xb285('0xe')]){if(_0x2edd7c[_0xb285('0xe')][_0xb285('0xf')]===0x1f4){logger[_0xb285('0xe')](_0xb285('0x10'),_0x9ecef,_0x2edd7c[_0xb285('0xe')][_0xb285('0x11')]);return _0x5606ac(_0x2edd7c[_0xb285('0xe')][_0xb285('0x11')]);}logger[_0xb285('0xe')](_0xb285('0x10'),_0x9ecef,_0x2edd7c[_0xb285('0xe')][_0xb285('0x11')]);return _0x434561(_0x2edd7c[_0xb285('0xe')]['message']);}else{logger['info'](_0xb285('0x10'),_0x9ecef,'request\x20sent');_0x434561(_0x2edd7c[_0xb285('0x12')][_0xb285('0x11')]);}})[_0xb285('0x13')](function(_0xe16c84){logger[_0xb285('0xe')](_0xb285('0x10'),_0x9ecef,_0xe16c84);_0x5606ac(_0xe16c84);});});}