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 _0xbe46=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x2a568e,_0x4788b1){var _0xe1df87=function(_0x493678){while(--_0x493678){_0x2a568e['push'](_0x2a568e['shift']());}};_0xe1df87(++_0x4788b1);}(_0xbe46,0xd3));var _0x6be4=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xbe46[_0x34bc30];return _0x5706de;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6be4('0x0'));var fs=require('fs');var Redis=require(_0x6be4('0x1'));var db=require(_0x6be4('0x2'))['db'];var utils=require(_0x6be4('0x3'));var logger=require(_0x6be4('0x4'))(_0x6be4('0x5'));var config=require(_0x6be4('0x6'));var jayson=require(_0x6be4('0x7'));var client=jayson['client'][_0x6be4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b26c4,_0x6e5093,_0x2642ca){return new BPromise(function(_0x595b8c,_0x54d3e9){return client['request'](_0x5b26c4,_0x2642ca)['then'](function(_0x2d227d){logger[_0x6be4('0x9')](_0x6be4('0xa'),_0x6e5093,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x6e5093,_0x6be4('0xb'),JSON[_0x6be4('0xc')](_0x2d227d));if(_0x2d227d['error']){if(_0x2d227d[_0x6be4('0xd')][_0x6be4('0xe')]===0x1f4){logger[_0x6be4('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x6e5093,_0x2d227d[_0x6be4('0xd')][_0x6be4('0xf')]);return _0x54d3e9(_0x2d227d[_0x6be4('0xd')][_0x6be4('0xf')]);}logger[_0x6be4('0xd')](_0x6be4('0xa'),_0x6e5093,_0x2d227d['error'][_0x6be4('0xf')]);return _0x595b8c(_0x2d227d[_0x6be4('0xd')][_0x6be4('0xf')]);}else{logger['info'](_0x6be4('0xa'),_0x6e5093,_0x6be4('0xb'));_0x595b8c(_0x2d227d['result'][_0x6be4('0xf')]);}})[_0x6be4('0x10')](function(_0x560ffb){logger[_0x6be4('0xd')](_0x6be4('0xa'),_0x6e5093,_0x560ffb);_0x54d3e9(_0x560ffb);});});}