Built motion from commit 85328c08.|2.5.50
[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 _0x957e=['info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x8fc830,_0x1e96ae){var _0x529d46=function(_0x34c4e7){while(--_0x34c4e7){_0x8fc830['push'](_0x8fc830['shift']());}};_0x529d46(++_0x1e96ae);}(_0x957e,0x6e));var _0xe957=function(_0x4cde9e,_0x57150a){_0x4cde9e=_0x4cde9e-0x0;var _0x38df0c=_0x957e[_0x4cde9e];return _0x38df0c;};'use strict';var _=require(_0xe957('0x0'));var util=require('util');var moment=require(_0xe957('0x1'));var BPromise=require(_0xe957('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe957('0x3'))['db'];var utils=require(_0xe957('0x4'));var logger=require('../../config/logger')(_0xe957('0x5'));var config=require(_0xe957('0x6'));var jayson=require(_0xe957('0x7'));var client=jayson['client'][_0xe957('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x486c25,_0x2371a0,_0x249917){return new BPromise(function(_0x57a196,_0xf230da){return client['request'](_0x486c25,_0x249917)[_0xe957('0x9')](function(_0x276de4){logger[_0xe957('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x2371a0,_0xe957('0xb'));logger[_0xe957('0xc')](_0xe957('0xd'),_0x2371a0,_0xe957('0xb'),JSON[_0xe957('0xe')](_0x276de4));if(_0x276de4['error']){if(_0x276de4[_0xe957('0xf')][_0xe957('0x10')]===0x1f4){logger[_0xe957('0xf')](_0xe957('0x11'),_0x2371a0,_0x276de4[_0xe957('0xf')][_0xe957('0x12')]);return _0xf230da(_0x276de4['error'][_0xe957('0x12')]);}logger[_0xe957('0xf')](_0xe957('0x11'),_0x2371a0,_0x276de4[_0xe957('0xf')][_0xe957('0x12')]);return _0x57a196(_0x276de4[_0xe957('0xf')][_0xe957('0x12')]);}else{logger[_0xe957('0xa')](_0xe957('0x11'),_0x2371a0,_0xe957('0xb'));_0x57a196(_0x276de4[_0xe957('0x13')][_0xe957('0x12')]);}})['catch'](function(_0xb28244){logger[_0xe957('0xf')](_0xe957('0x11'),_0x2371a0,_0xb28244);_0xf230da(_0xb28244);});});}