71a1cc1b9399a862837ab4e0d7d760aa3622a74b
[motion2.git] / server / api / intFreshdeskConfiguration / intFreshdeskConfiguration.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 _0xfbaf=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x205639,_0x1e5a4f){var _0x7eefd3=function(_0x25de6e){while(--_0x25de6e){_0x205639['push'](_0x205639['shift']());}};_0x7eefd3(++_0x1e5a4f);}(_0xfbaf,0x160));var _0xffba=function(_0x3bee18,_0x393bff){_0x3bee18=_0x3bee18-0x0;var _0x10b1ff=_0xfbaf[_0x3bee18];return _0x10b1ff;};'use strict';var _=require(_0xffba('0x0'));var util=require(_0xffba('0x1'));var moment=require(_0xffba('0x2'));var BPromise=require(_0xffba('0x3'));var rs=require(_0xffba('0x4'));var fs=require('fs');var Redis=require(_0xffba('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xffba('0x6'));var logger=require('../../config/logger')(_0xffba('0x7'));var config=require(_0xffba('0x8'));var jayson=require(_0xffba('0x9'));var client=jayson[_0xffba('0xa')][_0xffba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f13d9,_0x1ad1dc,_0x2ac2b8){return new BPromise(function(_0x32c5cc,_0x5bf6b1){return client[_0xffba('0xc')](_0x2f13d9,_0x2ac2b8)[_0xffba('0xd')](function(_0x3308f0){logger['info'](_0xffba('0xe'),_0x1ad1dc,_0xffba('0xf'));logger[_0xffba('0x10')](_0xffba('0x11'),_0x1ad1dc,_0xffba('0xf'),JSON['stringify'](_0x3308f0));if(_0x3308f0[_0xffba('0x12')]){if(_0x3308f0[_0xffba('0x12')][_0xffba('0x13')]===0x1f4){logger[_0xffba('0x12')](_0xffba('0xe'),_0x1ad1dc,_0x3308f0[_0xffba('0x12')][_0xffba('0x14')]);return _0x5bf6b1(_0x3308f0[_0xffba('0x12')][_0xffba('0x14')]);}logger[_0xffba('0x12')](_0xffba('0xe'),_0x1ad1dc,_0x3308f0['error']['message']);return _0x32c5cc(_0x3308f0[_0xffba('0x12')]['message']);}else{logger[_0xffba('0x15')](_0xffba('0xe'),_0x1ad1dc,_0xffba('0xf'));_0x32c5cc(_0x3308f0[_0xffba('0x16')]['message']);}})['catch'](function(_0x1c62d0){logger[_0xffba('0x12')](_0xffba('0xe'),_0x1ad1dc,_0x1c62d0);_0x5bf6b1(_0x1c62d0);});});}