Built motion from commit c0cdc9d8.|2.6.28
[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 _0x664f=['../../config/logger','rpc','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa0154a,_0x4721fb){var _0x3bd19d=function(_0x321d84){while(--_0x321d84){_0xa0154a['push'](_0xa0154a['shift']());}};_0x3bd19d(++_0x4721fb);}(_0x664f,0x13a));var _0xf664=function(_0x378752,_0x158b32){_0x378752=_0x378752-0x0;var _0xd5a262=_0x664f[_0x378752];return _0xd5a262;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf664('0x0'));var BPromise=require(_0xf664('0x1'));var rs=require(_0xf664('0x2'));var fs=require('fs');var Redis=require(_0xf664('0x3'));var db=require(_0xf664('0x4'))['db'];var utils=require(_0xf664('0x5'));var logger=require(_0xf664('0x6'))(_0xf664('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf664('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32c38c,_0x55c53f,_0x38c154){return new BPromise(function(_0x316b1b,_0x1c1b54){return client['request'](_0x32c38c,_0x38c154)[_0xf664('0x9')](function(_0x3bdfc8){logger[_0xf664('0xa')](_0xf664('0xb'),_0x55c53f,_0xf664('0xc'));logger[_0xf664('0xd')](_0xf664('0xe'),_0x55c53f,_0xf664('0xc'),JSON['stringify'](_0x3bdfc8));if(_0x3bdfc8[_0xf664('0xf')]){if(_0x3bdfc8[_0xf664('0xf')][_0xf664('0x10')]===0x1f4){logger[_0xf664('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x55c53f,_0x3bdfc8[_0xf664('0xf')][_0xf664('0x11')]);return _0x1c1b54(_0x3bdfc8[_0xf664('0xf')][_0xf664('0x11')]);}logger[_0xf664('0xf')](_0xf664('0xb'),_0x55c53f,_0x3bdfc8[_0xf664('0xf')][_0xf664('0x11')]);return _0x316b1b(_0x3bdfc8['error'][_0xf664('0x11')]);}else{logger[_0xf664('0xa')](_0xf664('0xb'),_0x55c53f,_0xf664('0xc'));_0x316b1b(_0x3bdfc8[_0xf664('0x12')][_0xf664('0x11')]);}})[_0xf664('0x13')](function(_0x347508){logger[_0xf664('0xf')](_0xf664('0xb'),_0x55c53f,_0x347508);_0x1c1b54(_0x347508);});});}