Built motion from commit bab6f49e.|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 _0x563f=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x418874,_0x3c4c7e){var _0x1420e4=function(_0x26b306){while(--_0x26b306){_0x418874['push'](_0x418874['shift']());}};_0x1420e4(++_0x3c4c7e);}(_0x563f,0x1d4));var _0xf563=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x563f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf563('0x0'));var moment=require(_0xf563('0x1'));var BPromise=require('bluebird');var rs=require(_0xf563('0x2'));var fs=require('fs');var Redis=require(_0xf563('0x3'));var db=require(_0xf563('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf563('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf563('0x6'));var client=jayson[_0xf563('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x182d38,_0x2043d,_0x2fa6ec){return new BPromise(function(_0x4ac29c,_0x589213){return client[_0xf563('0x8')](_0x182d38,_0x2fa6ec)['then'](function(_0x5b3c62){logger['info'](_0xf563('0x9'),_0x2043d,_0xf563('0xa'));logger[_0xf563('0xb')](_0xf563('0xc'),_0x2043d,_0xf563('0xa'),JSON[_0xf563('0xd')](_0x5b3c62));if(_0x5b3c62[_0xf563('0xe')]){if(_0x5b3c62[_0xf563('0xe')][_0xf563('0xf')]===0x1f4){logger[_0xf563('0xe')](_0xf563('0x9'),_0x2043d,_0x5b3c62[_0xf563('0xe')][_0xf563('0x10')]);return _0x589213(_0x5b3c62['error']['message']);}logger[_0xf563('0xe')](_0xf563('0x9'),_0x2043d,_0x5b3c62[_0xf563('0xe')][_0xf563('0x10')]);return _0x4ac29c(_0x5b3c62['error'][_0xf563('0x10')]);}else{logger[_0xf563('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2043d,_0xf563('0xa'));_0x4ac29c(_0x5b3c62[_0xf563('0x12')][_0xf563('0x10')]);}})[_0xf563('0x13')](function(_0x583e91){logger[_0xf563('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2043d,_0x583e91);_0x589213(_0x583e91);});});}