fdca70a4eb10bb9134e8452e1b0a78db43127024
[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 _0x3809=['../../config/environment','client','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1e37ed,_0xbf134c){var _0x1770c1=function(_0x71ad58){while(--_0x71ad58){_0x1e37ed['push'](_0x1e37ed['shift']());}};_0x1770c1(++_0xbf134c);}(_0x3809,0x142));var _0x9380=function(_0xf9be18,_0x293552){_0xf9be18=_0xf9be18-0x0;var _0x2393f9=_0x3809[_0xf9be18];return _0x2393f9;};'use strict';var _=require(_0x9380('0x0'));var util=require(_0x9380('0x1'));var moment=require('moment');var BPromise=require(_0x9380('0x2'));var rs=require(_0x9380('0x3'));var fs=require('fs');var Redis=require(_0x9380('0x4'));var db=require(_0x9380('0x5'))['db'];var utils=require(_0x9380('0x6'));var logger=require('../../config/logger')(_0x9380('0x7'));var config=require(_0x9380('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9380('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35a1fd,_0x3baf64,_0x566ad4){return new BPromise(function(_0x2a05e7,_0x53575e){return client['request'](_0x35a1fd,_0x566ad4)[_0x9380('0xa')](function(_0x25a243){logger[_0x9380('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x3baf64,'request\x20sent');logger[_0x9380('0xc')](_0x9380('0xd'),_0x3baf64,_0x9380('0xe'),JSON[_0x9380('0xf')](_0x25a243));if(_0x25a243[_0x9380('0x10')]){if(_0x25a243['error'][_0x9380('0x11')]===0x1f4){logger[_0x9380('0x10')](_0x9380('0x12'),_0x3baf64,_0x25a243[_0x9380('0x10')][_0x9380('0x13')]);return _0x53575e(_0x25a243[_0x9380('0x10')][_0x9380('0x13')]);}logger[_0x9380('0x10')](_0x9380('0x12'),_0x3baf64,_0x25a243[_0x9380('0x10')][_0x9380('0x13')]);return _0x2a05e7(_0x25a243[_0x9380('0x10')][_0x9380('0x13')]);}else{logger[_0x9380('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x3baf64,_0x9380('0xe'));_0x2a05e7(_0x25a243[_0x9380('0x14')][_0x9380('0x13')]);}})[_0x9380('0x15')](function(_0x2d8749){logger[_0x9380('0x10')](_0x9380('0x12'),_0x3baf64,_0x2d8749);_0x53575e(_0x2d8749);});});}