Built motion from commit 85328c08.|2.5.50
[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 _0x179e=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x41ffd2,_0x5de2e3){var _0x218d26=function(_0x444661){while(--_0x444661){_0x41ffd2['push'](_0x41ffd2['shift']());}};_0x218d26(++_0x5de2e3);}(_0x179e,0x150));var _0xe179=function(_0x41453c,_0x241b3d){_0x41453c=_0x41453c-0x0;var _0x39f9d5=_0x179e[_0x41453c];return _0x39f9d5;};'use strict';var _=require('lodash');var util=require(_0xe179('0x0'));var moment=require('moment');var BPromise=require(_0xe179('0x1'));var rs=require(_0xe179('0x2'));var fs=require('fs');var Redis=require(_0xe179('0x3'));var db=require(_0xe179('0x4'))['db'];var utils=require(_0xe179('0x5'));var logger=require(_0xe179('0x6'))('rpc');var config=require(_0xe179('0x7'));var jayson=require(_0xe179('0x8'));var client=jayson[_0xe179('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f10b8,_0x4c8b33,_0x26ca90){return new BPromise(function(_0x393225,_0x53c1d5){return client[_0xe179('0xa')](_0x2f10b8,_0x26ca90)[_0xe179('0xb')](function(_0x903562){logger['info'](_0xe179('0xc'),_0x4c8b33,_0xe179('0xd'));logger[_0xe179('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4c8b33,_0xe179('0xd'),JSON[_0xe179('0xf')](_0x903562));if(_0x903562[_0xe179('0x10')]){if(_0x903562[_0xe179('0x10')]['code']===0x1f4){logger[_0xe179('0x10')](_0xe179('0xc'),_0x4c8b33,_0x903562[_0xe179('0x10')][_0xe179('0x11')]);return _0x53c1d5(_0x903562[_0xe179('0x10')][_0xe179('0x11')]);}logger[_0xe179('0x10')](_0xe179('0xc'),_0x4c8b33,_0x903562[_0xe179('0x10')][_0xe179('0x11')]);return _0x393225(_0x903562['error'][_0xe179('0x11')]);}else{logger[_0xe179('0x12')](_0xe179('0xc'),_0x4c8b33,_0xe179('0xd'));_0x393225(_0x903562['result']['message']);}})[_0xe179('0x13')](function(_0x3459a7){logger[_0xe179('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c8b33,_0x3459a7);_0x53c1d5(_0x3459a7);});});}