43c5b2f268c27495ca8ab373b53224ec7d44694c
[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 _0x946b=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x7dfd37,_0x6a8efc){var _0x4cf35b=function(_0x584ede){while(--_0x584ede){_0x7dfd37['push'](_0x7dfd37['shift']());}};_0x4cf35b(++_0x6a8efc);}(_0x946b,0x7e));var _0xb946=function(_0x50faae,_0x519149){_0x50faae=_0x50faae-0x0;var _0x18cd6d=_0x946b[_0x50faae];return _0x18cd6d;};'use strict';var _=require(_0xb946('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb946('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb946('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb946('0x3'))('rpc');var config=require(_0xb946('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb946('0x5')][_0xb946('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2e3024,_0x2b73fd,_0x50646d){return new BPromise(function(_0x78194d,_0x22e71a){return client[_0xb946('0x7')](_0x2e3024,_0x50646d)[_0xb946('0x8')](function(_0x3523e6){logger[_0xb946('0x9')](_0xb946('0xa'),_0x2b73fd,_0xb946('0xb'));logger[_0xb946('0xc')](_0xb946('0xd'),_0x2b73fd,_0xb946('0xb'),JSON[_0xb946('0xe')](_0x3523e6));if(_0x3523e6[_0xb946('0xf')]){if(_0x3523e6[_0xb946('0xf')][_0xb946('0x10')]===0x1f4){logger[_0xb946('0xf')](_0xb946('0xa'),_0x2b73fd,_0x3523e6[_0xb946('0xf')][_0xb946('0x11')]);return _0x22e71a(_0x3523e6['error'][_0xb946('0x11')]);}logger[_0xb946('0xf')](_0xb946('0xa'),_0x2b73fd,_0x3523e6[_0xb946('0xf')][_0xb946('0x11')]);return _0x78194d(_0x3523e6[_0xb946('0xf')][_0xb946('0x11')]);}else{logger[_0xb946('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b73fd,_0xb946('0xb'));_0x78194d(_0x3523e6['result'][_0xb946('0x11')]);}})[_0xb946('0x12')](function(_0x2309e1){logger[_0xb946('0xf')](_0xb946('0xa'),_0x2b73fd,_0x2309e1);_0x22e71a(_0x2309e1);});});}