9a57426d2a1bcc41a74275e88f06499a21048a21
[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 _0xb250=['client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3869c8,_0x2ff137){var _0x4caf60=function(_0x224384){while(--_0x224384){_0x3869c8['push'](_0x3869c8['shift']());}};_0x4caf60(++_0x2ff137);}(_0xb250,0x1bf));var _0x0b25=function(_0x229ce9,_0x2c9bb3){_0x229ce9=_0x229ce9-0x0;var _0x52194b=_0xb250[_0x229ce9];return _0x52194b;};'use strict';var _=require(_0x0b25('0x0'));var util=require(_0x0b25('0x1'));var moment=require('moment');var BPromise=require(_0x0b25('0x2'));var rs=require(_0x0b25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b25('0x4'))['db'];var utils=require(_0x0b25('0x5'));var logger=require(_0x0b25('0x6'))('rpc');var config=require(_0x0b25('0x7'));var jayson=require(_0x0b25('0x8'));var client=jayson[_0x0b25('0x9')][_0x0b25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7aede8,_0x2bd7ef,_0x28a97f){return new BPromise(function(_0x2e2d89,_0x1fba95){return client[_0x0b25('0xb')](_0x7aede8,_0x28a97f)[_0x0b25('0xc')](function(_0x39c3e1){logger[_0x0b25('0xd')](_0x0b25('0xe'),_0x2bd7ef,'request\x20sent');logger[_0x0b25('0xf')](_0x0b25('0x10'),_0x2bd7ef,_0x0b25('0x11'),JSON[_0x0b25('0x12')](_0x39c3e1));if(_0x39c3e1[_0x0b25('0x13')]){if(_0x39c3e1['error'][_0x0b25('0x14')]===0x1f4){logger['error'](_0x0b25('0xe'),_0x2bd7ef,_0x39c3e1[_0x0b25('0x13')][_0x0b25('0x15')]);return _0x1fba95(_0x39c3e1[_0x0b25('0x13')][_0x0b25('0x15')]);}logger[_0x0b25('0x13')](_0x0b25('0xe'),_0x2bd7ef,_0x39c3e1[_0x0b25('0x13')][_0x0b25('0x15')]);return _0x2e2d89(_0x39c3e1['error'][_0x0b25('0x15')]);}else{logger[_0x0b25('0xd')](_0x0b25('0xe'),_0x2bd7ef,_0x0b25('0x11'));_0x2e2d89(_0x39c3e1[_0x0b25('0x16')][_0x0b25('0x15')]);}})[_0x0b25('0x17')](function(_0x18241e){logger[_0x0b25('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x2bd7ef,_0x18241e);_0x1fba95(_0x18241e);});});}