0d5e7f0fabb56d54e792f337742231ec30f23cd6
[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 _0x9ff6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util'];(function(_0x4c99c8,_0x30f9cd){var _0x57e607=function(_0x248ce8){while(--_0x248ce8){_0x4c99c8['push'](_0x4c99c8['shift']());}};_0x57e607(++_0x30f9cd);}(_0x9ff6,0x8b));var _0x69ff=function(_0x28d396,_0x50bd20){_0x28d396=_0x28d396-0x0;var _0x3bdb1d=_0x9ff6[_0x28d396];return _0x3bdb1d;};'use strict';var _=require('lodash');var util=require(_0x69ff('0x0'));var moment=require(_0x69ff('0x1'));var BPromise=require(_0x69ff('0x2'));var rs=require(_0x69ff('0x3'));var fs=require('fs');var Redis=require(_0x69ff('0x4'));var db=require(_0x69ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69ff('0x6'))(_0x69ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x69ff('0x8'));var client=jayson[_0x69ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38a378,_0x2d6e40,_0x168235){return new BPromise(function(_0x4854f1,_0x2f1a97){return client[_0x69ff('0xa')](_0x38a378,_0x168235)[_0x69ff('0xb')](function(_0x221216){logger[_0x69ff('0xc')](_0x69ff('0xd'),_0x2d6e40,'request\x20sent');logger[_0x69ff('0xe')](_0x69ff('0xf'),_0x2d6e40,'request\x20sent',JSON['stringify'](_0x221216));if(_0x221216['error']){if(_0x221216[_0x69ff('0x10')][_0x69ff('0x11')]===0x1f4){logger[_0x69ff('0x10')](_0x69ff('0xd'),_0x2d6e40,_0x221216[_0x69ff('0x10')][_0x69ff('0x12')]);return _0x2f1a97(_0x221216[_0x69ff('0x10')]['message']);}logger[_0x69ff('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d6e40,_0x221216['error'][_0x69ff('0x12')]);return _0x4854f1(_0x221216[_0x69ff('0x10')][_0x69ff('0x12')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x2d6e40,'request\x20sent');_0x4854f1(_0x221216['result'][_0x69ff('0x12')]);}})[_0x69ff('0x13')](function(_0x2b9a60){logger[_0x69ff('0x10')](_0x69ff('0xd'),_0x2d6e40,_0x2b9a60);_0x2f1a97(_0x2b9a60);});});}