bb56c37b2e27641ea7379e5d4da36c53e5af2798
[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 _0x6ced=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6ced,0x1e4));var _0xd6ce=function(_0x59099c,_0x533869){_0x59099c=_0x59099c-0x0;var _0x3a4c8c=_0x6ced[_0x59099c];return _0x3a4c8c;};'use strict';var _=require(_0xd6ce('0x0'));var util=require(_0xd6ce('0x1'));var moment=require(_0xd6ce('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6ce('0x3'));var fs=require('fs');var Redis=require(_0xd6ce('0x4'));var db=require(_0xd6ce('0x5'))['db'];var utils=require(_0xd6ce('0x6'));var logger=require('../../config/logger')(_0xd6ce('0x7'));var config=require(_0xd6ce('0x8'));var jayson=require(_0xd6ce('0x9'));var client=jayson[_0xd6ce('0xa')][_0xd6ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f24e,_0x56943e,_0x3905a0){return new BPromise(function(_0x4672a0,_0x39c917){return client['request'](_0x21f24e,_0x3905a0)['then'](function(_0x6bec68){logger[_0xd6ce('0xc')](_0xd6ce('0xd'),_0x56943e,'request\x20sent');logger[_0xd6ce('0xe')](_0xd6ce('0xf'),_0x56943e,_0xd6ce('0x10'),JSON[_0xd6ce('0x11')](_0x6bec68));if(_0x6bec68['error']){if(_0x6bec68[_0xd6ce('0x12')][_0xd6ce('0x13')]===0x1f4){logger[_0xd6ce('0x12')](_0xd6ce('0xd'),_0x56943e,_0x6bec68[_0xd6ce('0x12')][_0xd6ce('0x14')]);return _0x39c917(_0x6bec68['error']['message']);}logger[_0xd6ce('0x12')](_0xd6ce('0xd'),_0x56943e,_0x6bec68[_0xd6ce('0x12')][_0xd6ce('0x14')]);return _0x4672a0(_0x6bec68[_0xd6ce('0x12')]['message']);}else{logger[_0xd6ce('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x56943e,'request\x20sent');_0x4672a0(_0x6bec68[_0xd6ce('0x15')][_0xd6ce('0x14')]);}})[_0xd6ce('0x16')](function(_0x8c7e73){logger[_0xd6ce('0x12')](_0xd6ce('0xd'),_0x56943e,_0x8c7e73);_0x39c917(_0x8c7e73);});});}