1907dba89984948302546fd15f6de7a14e3f6bd4
[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 _0x2bd9=['rpc','../../config/environment','jayson/promise','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x2bd9,0x64));var _0x92bd=function(_0x542047,_0x1f423f){_0x542047=_0x542047-0x0;var _0x3294dd=_0x2bd9[_0x542047];return _0x3294dd;};'use strict';var _=require(_0x92bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x92bd('0x1'));var rs=require(_0x92bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92bd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x92bd('0x4'))(_0x92bd('0x5'));var config=require(_0x92bd('0x6'));var jayson=require(_0x92bd('0x7'));var client=jayson['client'][_0x92bd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cae6f,_0x5d10a1,_0x4ff8f4){return new BPromise(function(_0x23e989,_0x3172a3){return client[_0x92bd('0x9')](_0x4cae6f,_0x4ff8f4)['then'](function(_0x4b32b1){logger[_0x92bd('0xa')](_0x92bd('0xb'),_0x5d10a1,_0x92bd('0xc'));logger[_0x92bd('0xd')](_0x92bd('0xe'),_0x5d10a1,_0x92bd('0xc'),JSON[_0x92bd('0xf')](_0x4b32b1));if(_0x4b32b1[_0x92bd('0x10')]){if(_0x4b32b1[_0x92bd('0x10')][_0x92bd('0x11')]===0x1f4){logger[_0x92bd('0x10')](_0x92bd('0xb'),_0x5d10a1,_0x4b32b1[_0x92bd('0x10')][_0x92bd('0x12')]);return _0x3172a3(_0x4b32b1[_0x92bd('0x10')][_0x92bd('0x12')]);}logger['error'](_0x92bd('0xb'),_0x5d10a1,_0x4b32b1['error'][_0x92bd('0x12')]);return _0x23e989(_0x4b32b1['error'][_0x92bd('0x12')]);}else{logger[_0x92bd('0xa')](_0x92bd('0xb'),_0x5d10a1,_0x92bd('0xc'));_0x23e989(_0x4b32b1[_0x92bd('0x13')][_0x92bd('0x12')]);}})[_0x92bd('0x14')](function(_0x2f29e6){logger[_0x92bd('0x10')](_0x92bd('0xb'),_0x5d10a1,_0x2f29e6);_0x3172a3(_0x2f29e6);});});}