Built motion from commit (unavailable).|2.5.4
[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 _0x34ab=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x5c6fde,_0x29fac8){var _0x2a9c77=function(_0x22d576){while(--_0x22d576){_0x5c6fde['push'](_0x5c6fde['shift']());}};_0x2a9c77(++_0x29fac8);}(_0x34ab,0x6d));var _0xb34a=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x34ab[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var moment=require('moment');var BPromise=require(_0xb34a('0x2'));var rs=require(_0xb34a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb34a('0x4'))['db'];var utils=require(_0xb34a('0x5'));var logger=require(_0xb34a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb34a('0x7'));var client=jayson[_0xb34a('0x8')][_0xb34a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x485f65,_0x22675f,_0x41162c){return new BPromise(function(_0x5c3626,_0x1b85ac){return client[_0xb34a('0xa')](_0x485f65,_0x41162c)[_0xb34a('0xb')](function(_0xfaab84){logger[_0xb34a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x22675f,'request\x20sent');logger[_0xb34a('0xd')](_0xb34a('0xe'),_0x22675f,_0xb34a('0xf'),JSON[_0xb34a('0x10')](_0xfaab84));if(_0xfaab84[_0xb34a('0x11')]){if(_0xfaab84['error'][_0xb34a('0x12')]===0x1f4){logger['error'](_0xb34a('0x13'),_0x22675f,_0xfaab84[_0xb34a('0x11')]['message']);return _0x1b85ac(_0xfaab84[_0xb34a('0x11')]['message']);}logger[_0xb34a('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x22675f,_0xfaab84[_0xb34a('0x11')][_0xb34a('0x14')]);return _0x5c3626(_0xfaab84['error']['message']);}else{logger[_0xb34a('0xc')](_0xb34a('0x13'),_0x22675f,'request\x20sent');_0x5c3626(_0xfaab84['result']['message']);}})[_0xb34a('0x15')](function(_0x2b4f25){logger[_0xb34a('0x11')](_0xb34a('0x13'),_0x22675f,_0x2b4f25);_0x1b85ac(_0x2b4f25);});});}