Built motion from commit b5996064.|2.6.21
[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 _0x84a2=['debug','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x2394d4,_0x18a4b3){var _0x31cf9d=function(_0x12f503){while(--_0x12f503){_0x2394d4['push'](_0x2394d4['shift']());}};_0x31cf9d(++_0x18a4b3);}(_0x84a2,0x12d));var _0x284a=function(_0x4a423e,_0x59ba7b){_0x4a423e=_0x4a423e-0x0;var _0x4ad91f=_0x84a2[_0x4a423e];return _0x4ad91f;};'use strict';var _=require(_0x284a('0x0'));var util=require(_0x284a('0x1'));var moment=require('moment');var BPromise=require(_0x284a('0x2'));var rs=require(_0x284a('0x3'));var fs=require('fs');var Redis=require(_0x284a('0x4'));var db=require(_0x284a('0x5'))['db'];var utils=require(_0x284a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x284a('0x7'));var jayson=require(_0x284a('0x8'));var client=jayson[_0x284a('0x9')][_0x284a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d3bbb,_0x5c5f2f,_0x3bd2ac){return new BPromise(function(_0x551ce6,_0x11103a){return client[_0x284a('0xb')](_0x4d3bbb,_0x3bd2ac)['then'](function(_0x245e77){logger[_0x284a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5c5f2f,_0x284a('0xd'));logger[_0x284a('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5c5f2f,_0x284a('0xd'),JSON[_0x284a('0xf')](_0x245e77));if(_0x245e77[_0x284a('0x10')]){if(_0x245e77[_0x284a('0x10')][_0x284a('0x11')]===0x1f4){logger[_0x284a('0x10')](_0x284a('0x12'),_0x5c5f2f,_0x245e77['error'][_0x284a('0x13')]);return _0x11103a(_0x245e77[_0x284a('0x10')][_0x284a('0x13')]);}logger[_0x284a('0x10')](_0x284a('0x12'),_0x5c5f2f,_0x245e77['error'][_0x284a('0x13')]);return _0x551ce6(_0x245e77['error']['message']);}else{logger[_0x284a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5c5f2f,_0x284a('0xd'));_0x551ce6(_0x245e77[_0x284a('0x14')][_0x284a('0x13')]);}})['catch'](function(_0x2fc536){logger['error'](_0x284a('0x12'),_0x5c5f2f,_0x2fc536);_0x11103a(_0x2fc536);});});}