Built motion from commit (unavailable).|2.5.0
[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 _0x235b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x235b,0xf0));var _0xb235=function(_0x406fa7,_0x59e646){_0x406fa7=_0x406fa7-0x0;var _0x2b72ac=_0x235b[_0x406fa7];return _0x2b72ac;};'use strict';var _=require(_0xb235('0x0'));var util=require(_0xb235('0x1'));var moment=require(_0xb235('0x2'));var BPromise=require(_0xb235('0x3'));var rs=require(_0xb235('0x4'));var fs=require('fs');var Redis=require(_0xb235('0x5'));var db=require(_0xb235('0x6'))['db'];var utils=require(_0xb235('0x7'));var logger=require('../../config/logger')(_0xb235('0x8'));var config=require(_0xb235('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb235('0xa')][_0xb235('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x791d6f,_0x3016f6,_0x356f19){return new BPromise(function(_0x227111,_0x1d83fe){return client[_0xb235('0xc')](_0x791d6f,_0x356f19)[_0xb235('0xd')](function(_0x496fd9){logger[_0xb235('0xe')](_0xb235('0xf'),_0x3016f6,'request\x20sent');logger[_0xb235('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3016f6,_0xb235('0x11'),JSON[_0xb235('0x12')](_0x496fd9));if(_0x496fd9[_0xb235('0x13')]){if(_0x496fd9[_0xb235('0x13')][_0xb235('0x14')]===0x1f4){logger['error'](_0xb235('0xf'),_0x3016f6,_0x496fd9['error'][_0xb235('0x15')]);return _0x1d83fe(_0x496fd9[_0xb235('0x13')][_0xb235('0x15')]);}logger[_0xb235('0x13')](_0xb235('0xf'),_0x3016f6,_0x496fd9[_0xb235('0x13')][_0xb235('0x15')]);return _0x227111(_0x496fd9[_0xb235('0x13')][_0xb235('0x15')]);}else{logger[_0xb235('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x3016f6,'request\x20sent');_0x227111(_0x496fd9['result'][_0xb235('0x15')]);}})['catch'](function(_0x8174a0){logger[_0xb235('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x3016f6,_0x8174a0);_0x1d83fe(_0x8174a0);});});}