Built motion from commit 775e2a94.|2.6.3
[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 _0x8824=['request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x8824,0x144));var _0x4882=function(_0x155dfc,_0xf5455c){_0x155dfc=_0x155dfc-0x0;var _0x124d23=_0x8824[_0x155dfc];return _0x124d23;};'use strict';var _=require(_0x4882('0x0'));var util=require(_0x4882('0x1'));var moment=require('moment');var BPromise=require(_0x4882('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4882('0x3'));var db=require(_0x4882('0x4'))['db'];var utils=require(_0x4882('0x5'));var logger=require(_0x4882('0x6'))(_0x4882('0x7'));var config=require(_0x4882('0x8'));var jayson=require(_0x4882('0x9'));var client=jayson[_0x4882('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5196c7,_0x2ccf07,_0x5df4fb){return new BPromise(function(_0x5366c4,_0x533df0){return client['request'](_0x5196c7,_0x5df4fb)['then'](function(_0x3dbc6c){logger['info'](_0x4882('0xb'),_0x2ccf07,_0x4882('0xc'));logger[_0x4882('0xd')](_0x4882('0xe'),_0x2ccf07,_0x4882('0xc'),JSON['stringify'](_0x3dbc6c));if(_0x3dbc6c['error']){if(_0x3dbc6c[_0x4882('0xf')][_0x4882('0x10')]===0x1f4){logger[_0x4882('0xf')](_0x4882('0xb'),_0x2ccf07,_0x3dbc6c[_0x4882('0xf')][_0x4882('0x11')]);return _0x533df0(_0x3dbc6c[_0x4882('0xf')][_0x4882('0x11')]);}logger['error'](_0x4882('0xb'),_0x2ccf07,_0x3dbc6c['error']['message']);return _0x5366c4(_0x3dbc6c[_0x4882('0xf')]['message']);}else{logger[_0x4882('0x12')](_0x4882('0xb'),_0x2ccf07,_0x4882('0xc'));_0x5366c4(_0x3dbc6c[_0x4882('0x13')][_0x4882('0x11')]);}})[_0x4882('0x14')](function(_0xd1c9e1){logger[_0x4882('0xf')](_0x4882('0xb'),_0x2ccf07,_0xd1c9e1);_0x533df0(_0xd1c9e1);});});}