Built motion from commit (unavailable).|2.5.10
[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 _0x87e7=['randomstring','ioredis','../../config/utils','rpc','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','bluebird'];(function(_0x31db70,_0x62d245){var _0x5623a4=function(_0x13ae49){while(--_0x13ae49){_0x31db70['push'](_0x31db70['shift']());}};_0x5623a4(++_0x62d245);}(_0x87e7,0x75));var _0x787e=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0x87e7[_0x4291dd];return _0x152462;};'use strict';var _=require('lodash');var util=require(_0x787e('0x0'));var moment=require('moment');var BPromise=require(_0x787e('0x1'));var rs=require(_0x787e('0x2'));var fs=require('fs');var Redis=require(_0x787e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x787e('0x4'));var logger=require('../../config/logger')(_0x787e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x787e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x48fae9,_0x33f509,_0x3fb5bb){return new BPromise(function(_0x25de1d,_0x5f01a5){return client[_0x787e('0x7')](_0x48fae9,_0x3fb5bb)['then'](function(_0x2c660e){logger['info'](_0x787e('0x8'),_0x33f509,_0x787e('0x9'));logger[_0x787e('0xa')](_0x787e('0xb'),_0x33f509,_0x787e('0x9'),JSON['stringify'](_0x2c660e));if(_0x2c660e[_0x787e('0xc')]){if(_0x2c660e['error']['code']===0x1f4){logger[_0x787e('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x33f509,_0x2c660e[_0x787e('0xc')][_0x787e('0xd')]);return _0x5f01a5(_0x2c660e[_0x787e('0xc')][_0x787e('0xd')]);}logger[_0x787e('0xc')](_0x787e('0x8'),_0x33f509,_0x2c660e[_0x787e('0xc')]['message']);return _0x25de1d(_0x2c660e['error']['message']);}else{logger[_0x787e('0xe')](_0x787e('0x8'),_0x33f509,_0x787e('0x9'));_0x25de1d(_0x2c660e[_0x787e('0xf')][_0x787e('0xd')]);}})[_0x787e('0x10')](function(_0x4c966d){logger[_0x787e('0xc')](_0x787e('0x8'),_0x33f509,_0x4c966d);_0x5f01a5(_0x4c966d);});});}