Built motion from commit ab870f9e.|2.5.44
[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 _0xb309=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x44e4af,_0xc77cfb){var _0x288203=function(_0x51a210){while(--_0x51a210){_0x44e4af['push'](_0x44e4af['shift']());}};_0x288203(++_0xc77cfb);}(_0xb309,0x6e));var _0x9b30=function(_0x30d618,_0x590668){_0x30d618=_0x30d618-0x0;var _0x39731a=_0xb309[_0x30d618];return _0x39731a;};'use strict';var _=require(_0x9b30('0x0'));var util=require(_0x9b30('0x1'));var moment=require(_0x9b30('0x2'));var BPromise=require(_0x9b30('0x3'));var rs=require(_0x9b30('0x4'));var fs=require('fs');var Redis=require(_0x9b30('0x5'));var db=require(_0x9b30('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9b30('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9b30('0x8')][_0x9b30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29603e,_0x49fc4c,_0x5c503a){return new BPromise(function(_0x3aa2ed,_0x3d2484){return client[_0x9b30('0xa')](_0x29603e,_0x5c503a)[_0x9b30('0xb')](function(_0x3f0cdd){logger[_0x9b30('0xc')](_0x9b30('0xd'),_0x49fc4c,_0x9b30('0xe'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x49fc4c,_0x9b30('0xe'),JSON[_0x9b30('0xf')](_0x3f0cdd));if(_0x3f0cdd[_0x9b30('0x10')]){if(_0x3f0cdd[_0x9b30('0x10')][_0x9b30('0x11')]===0x1f4){logger[_0x9b30('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x49fc4c,_0x3f0cdd[_0x9b30('0x10')][_0x9b30('0x12')]);return _0x3d2484(_0x3f0cdd[_0x9b30('0x10')]['message']);}logger[_0x9b30('0x10')](_0x9b30('0xd'),_0x49fc4c,_0x3f0cdd[_0x9b30('0x10')][_0x9b30('0x12')]);return _0x3aa2ed(_0x3f0cdd[_0x9b30('0x10')][_0x9b30('0x12')]);}else{logger['info'](_0x9b30('0xd'),_0x49fc4c,_0x9b30('0xe'));_0x3aa2ed(_0x3f0cdd[_0x9b30('0x13')][_0x9b30('0x12')]);}})[_0x9b30('0x14')](function(_0x18a279){logger[_0x9b30('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x49fc4c,_0x18a279);_0x3d2484(_0x18a279);});});}