Built motion from commit (unavailable).|2.5.21
[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 _0xb389=['debug','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x1158f2,_0x406516){var _0x1dd12d=function(_0x4bde25){while(--_0x4bde25){_0x1158f2['push'](_0x1158f2['shift']());}};_0x1dd12d(++_0x406516);}(_0xb389,0xe2));var _0x9b38=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0xb389[_0x585d81];return _0x1aca0d;};'use strict';var _=require(_0x9b38('0x0'));var util=require(_0x9b38('0x1'));var moment=require('moment');var BPromise=require(_0x9b38('0x2'));var rs=require(_0x9b38('0x3'));var fs=require('fs');var Redis=require(_0x9b38('0x4'));var db=require(_0x9b38('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b38('0x6'))(_0x9b38('0x7'));var config=require(_0x9b38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9b38('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233718,_0x228e60,_0x1fdb95){return new BPromise(function(_0x366345,_0x583522){return client[_0x9b38('0xa')](_0x233718,_0x1fdb95)[_0x9b38('0xb')](function(_0x4e8c5f){logger[_0x9b38('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x228e60,_0x9b38('0xd'));logger[_0x9b38('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x228e60,_0x9b38('0xd'),JSON['stringify'](_0x4e8c5f));if(_0x4e8c5f['error']){if(_0x4e8c5f[_0x9b38('0xf')][_0x9b38('0x10')]===0x1f4){logger[_0x9b38('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x228e60,_0x4e8c5f[_0x9b38('0xf')][_0x9b38('0x11')]);return _0x583522(_0x4e8c5f[_0x9b38('0xf')][_0x9b38('0x11')]);}logger[_0x9b38('0xf')](_0x9b38('0x12'),_0x228e60,_0x4e8c5f['error'][_0x9b38('0x11')]);return _0x366345(_0x4e8c5f[_0x9b38('0xf')][_0x9b38('0x11')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x228e60,'request\x20sent');_0x366345(_0x4e8c5f[_0x9b38('0x13')][_0x9b38('0x11')]);}})['catch'](function(_0x5d335e){logger[_0x9b38('0xf')](_0x9b38('0x12'),_0x228e60,_0x5d335e);_0x583522(_0x5d335e);});});}