Built motion from commit 4a17b4ed.|2.6.17
[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 _0xb4e7=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xb4e7,0x98));var _0x7b4e=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xb4e7[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x7b4e('0x0'));var util=require(_0x7b4e('0x1'));var moment=require(_0x7b4e('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b4e('0x3'));var fs=require('fs');var Redis=require(_0x7b4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b4e('0x5'));var logger=require(_0x7b4e('0x6'))(_0x7b4e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b4e('0x8')][_0x7b4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f2344,_0x31d440,_0x59a8d3){return new BPromise(function(_0x4ec725,_0xc718f9){return client[_0x7b4e('0xa')](_0x2f2344,_0x59a8d3)[_0x7b4e('0xb')](function(_0x191a07){logger['info'](_0x7b4e('0xc'),_0x31d440,_0x7b4e('0xd'));logger[_0x7b4e('0xe')](_0x7b4e('0xf'),_0x31d440,_0x7b4e('0xd'),JSON[_0x7b4e('0x10')](_0x191a07));if(_0x191a07[_0x7b4e('0x11')]){if(_0x191a07['error'][_0x7b4e('0x12')]===0x1f4){logger[_0x7b4e('0x11')](_0x7b4e('0xc'),_0x31d440,_0x191a07['error'][_0x7b4e('0x13')]);return _0xc718f9(_0x191a07[_0x7b4e('0x11')][_0x7b4e('0x13')]);}logger[_0x7b4e('0x11')](_0x7b4e('0xc'),_0x31d440,_0x191a07[_0x7b4e('0x11')][_0x7b4e('0x13')]);return _0x4ec725(_0x191a07[_0x7b4e('0x11')][_0x7b4e('0x13')]);}else{logger[_0x7b4e('0x14')](_0x7b4e('0xc'),_0x31d440,_0x7b4e('0xd'));_0x4ec725(_0x191a07[_0x7b4e('0x15')][_0x7b4e('0x13')]);}})['catch'](function(_0xbf16db){logger['error'](_0x7b4e('0xc'),_0x31d440,_0xbf16db);_0xc718f9(_0xbf16db);});});}