Built motion from commit (unavailable).|2.5.13
[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 _0xf326=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1da90e,_0x43220d){var _0x429618=function(_0x40781b){while(--_0x40781b){_0x1da90e['push'](_0x1da90e['shift']());}};_0x429618(++_0x43220d);}(_0xf326,0x1b6));var _0x6f32=function(_0x37dac2,_0xdb5e75){_0x37dac2=_0x37dac2-0x0;var _0x351e15=_0xf326[_0x37dac2];return _0x351e15;};'use strict';var _=require(_0x6f32('0x0'));var util=require(_0x6f32('0x1'));var moment=require(_0x6f32('0x2'));var BPromise=require(_0x6f32('0x3'));var rs=require(_0x6f32('0x4'));var fs=require('fs');var Redis=require(_0x6f32('0x5'));var db=require(_0x6f32('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f32('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f32('0x8'));var client=jayson['client'][_0x6f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x146c0c,_0x217318,_0x2632d7){return new BPromise(function(_0x1fba82,_0xa9f84a){return client[_0x6f32('0xa')](_0x146c0c,_0x2632d7)['then'](function(_0x36c2b1){logger[_0x6f32('0xb')](_0x6f32('0xc'),_0x217318,_0x6f32('0xd'));logger[_0x6f32('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x217318,_0x6f32('0xd'),JSON[_0x6f32('0xf')](_0x36c2b1));if(_0x36c2b1[_0x6f32('0x10')]){if(_0x36c2b1[_0x6f32('0x10')][_0x6f32('0x11')]===0x1f4){logger['error'](_0x6f32('0xc'),_0x217318,_0x36c2b1[_0x6f32('0x10')][_0x6f32('0x12')]);return _0xa9f84a(_0x36c2b1['error'][_0x6f32('0x12')]);}logger[_0x6f32('0x10')](_0x6f32('0xc'),_0x217318,_0x36c2b1[_0x6f32('0x10')][_0x6f32('0x12')]);return _0x1fba82(_0x36c2b1[_0x6f32('0x10')]['message']);}else{logger[_0x6f32('0xb')](_0x6f32('0xc'),_0x217318,_0x6f32('0xd'));_0x1fba82(_0x36c2b1[_0x6f32('0x13')][_0x6f32('0x12')]);}})[_0x6f32('0x14')](function(_0x56cee0){logger[_0x6f32('0x10')](_0x6f32('0xc'),_0x217318,_0x56cee0);_0xa9f84a(_0x56cee0);});});}