Built motion from commit 013e4bb4.|2.6.18
[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 _0x0f9c=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x0f9c,0x1a9));var _0xc0f9=function(_0x40fd5e,_0xecea2f){_0x40fd5e=_0x40fd5e-0x0;var _0x3a255e=_0x0f9c[_0x40fd5e];return _0x3a255e;};'use strict';var _=require(_0xc0f9('0x0'));var util=require(_0xc0f9('0x1'));var moment=require(_0xc0f9('0x2'));var BPromise=require(_0xc0f9('0x3'));var rs=require(_0xc0f9('0x4'));var fs=require('fs');var Redis=require(_0xc0f9('0x5'));var db=require(_0xc0f9('0x6'))['db'];var utils=require(_0xc0f9('0x7'));var logger=require(_0xc0f9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc0f9('0x9')][_0xc0f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x368df8,_0x33beab,_0xfe2956){return new BPromise(function(_0x5bcba5,_0x5c38b8){return client['request'](_0x368df8,_0xfe2956)[_0xc0f9('0xb')](function(_0x4254ef){logger['info'](_0xc0f9('0xc'),_0x33beab,_0xc0f9('0xd'));logger['debug'](_0xc0f9('0xe'),_0x33beab,_0xc0f9('0xd'),JSON['stringify'](_0x4254ef));if(_0x4254ef[_0xc0f9('0xf')]){if(_0x4254ef[_0xc0f9('0xf')]['code']===0x1f4){logger[_0xc0f9('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x33beab,_0x4254ef[_0xc0f9('0xf')][_0xc0f9('0x10')]);return _0x5c38b8(_0x4254ef[_0xc0f9('0xf')][_0xc0f9('0x10')]);}logger[_0xc0f9('0xf')](_0xc0f9('0xc'),_0x33beab,_0x4254ef['error'][_0xc0f9('0x10')]);return _0x5bcba5(_0x4254ef[_0xc0f9('0xf')]['message']);}else{logger[_0xc0f9('0x11')](_0xc0f9('0xc'),_0x33beab,_0xc0f9('0xd'));_0x5bcba5(_0x4254ef[_0xc0f9('0x12')]['message']);}})[_0xc0f9('0x13')](function(_0x1c9a93){logger[_0xc0f9('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x33beab,_0x1c9a93);_0x5c38b8(_0x1c9a93);});});}