Built motion from commit 67e5df37.|2.0.66
[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 _0x897e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','util','moment','bluebird'];(function(_0x22b0db,_0x3c0c94){var _0x1983ff=function(_0x2e484a){while(--_0x2e484a){_0x22b0db['push'](_0x22b0db['shift']());}};_0x1983ff(++_0x3c0c94);}(_0x897e,0x87));var _0xe897=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x897e[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0xe897('0x0'));var moment=require(_0xe897('0x1'));var BPromise=require(_0xe897('0x2'));var rs=require(_0xe897('0x3'));var fs=require('fs');var db=require(_0xe897('0x4'))['db'];var utils=require(_0xe897('0x5'));var logger=require(_0xe897('0x6'))(_0xe897('0x7'));var config=require(_0xe897('0x8'));var jayson=require(_0xe897('0x9'));var client=jayson[_0xe897('0xa')][_0xe897('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d0a77,_0x508a30,_0x4cb724){return new BPromise(function(_0x425c22,_0x2de4b7){return client[_0xe897('0xc')](_0x3d0a77,_0x4cb724)['then'](function(_0x6decc5){logger[_0xe897('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x508a30,_0xe897('0xe'));logger[_0xe897('0xf')](_0xe897('0x10'),_0x508a30,_0xe897('0xe'),JSON[_0xe897('0x11')](_0x6decc5));if(_0x6decc5[_0xe897('0x12')]){if(_0x6decc5[_0xe897('0x12')][_0xe897('0x13')]===0x1f4){logger[_0xe897('0x12')](_0xe897('0x14'),_0x508a30,_0x6decc5[_0xe897('0x12')][_0xe897('0x15')]);return _0x2de4b7(_0x6decc5['error'][_0xe897('0x15')]);}logger[_0xe897('0x12')](_0xe897('0x14'),_0x508a30,_0x6decc5['error'][_0xe897('0x15')]);return _0x425c22(_0x6decc5[_0xe897('0x12')][_0xe897('0x15')]);}else{logger[_0xe897('0xd')](_0xe897('0x14'),_0x508a30,_0xe897('0xe'));_0x425c22(_0x6decc5[_0xe897('0x16')][_0xe897('0x15')]);}})['catch'](function(_0x216317){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x508a30,_0x216317);_0x2de4b7(_0x216317);});});}