Built motion from commit (unavailable).|2.4.11
[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 _0x3fdd=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x28e1fd,_0x5f36cb){var _0x5bc7b1=function(_0x3383a9){while(--_0x3383a9){_0x28e1fd['push'](_0x28e1fd['shift']());}};_0x5bc7b1(++_0x5f36cb);}(_0x3fdd,0x1a9));var _0xd3fd=function(_0x541e51,_0x3b4a2c){_0x541e51=_0x541e51-0x0;var _0x4cc19e=_0x3fdd[_0x541e51];return _0x4cc19e;};'use strict';var _=require(_0xd3fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd3fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3fd('0x2'));var db=require(_0xd3fd('0x3'))['db'];var utils=require(_0xd3fd('0x4'));var logger=require('../../config/logger')(_0xd3fd('0x5'));var config=require(_0xd3fd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd3fd('0x7')][_0xd3fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x101ba8,_0x1f57c2,_0x338e41){return new BPromise(function(_0x4c2240,_0x755946){return client['request'](_0x101ba8,_0x338e41)['then'](function(_0x30d6eb){logger[_0xd3fd('0x9')](_0xd3fd('0xa'),_0x1f57c2,'request\x20sent');logger['debug'](_0xd3fd('0xb'),_0x1f57c2,_0xd3fd('0xc'),JSON[_0xd3fd('0xd')](_0x30d6eb));if(_0x30d6eb[_0xd3fd('0xe')]){if(_0x30d6eb[_0xd3fd('0xe')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x1f57c2,_0x30d6eb['error'][_0xd3fd('0xf')]);return _0x755946(_0x30d6eb['error'][_0xd3fd('0xf')]);}logger['error'](_0xd3fd('0xa'),_0x1f57c2,_0x30d6eb['error'][_0xd3fd('0xf')]);return _0x4c2240(_0x30d6eb[_0xd3fd('0xe')][_0xd3fd('0xf')]);}else{logger[_0xd3fd('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f57c2,_0xd3fd('0xc'));_0x4c2240(_0x30d6eb[_0xd3fd('0x10')]['message']);}})['catch'](function(_0x1ab294){logger[_0xd3fd('0xe')](_0xd3fd('0xa'),_0x1f57c2,_0x1ab294);_0x755946(_0x1ab294);});});}