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 _0x5d96=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util'];(function(_0x38cbbf,_0x5da053){var _0x208b6a=function(_0x1cb977){while(--_0x1cb977){_0x38cbbf['push'](_0x38cbbf['shift']());}};_0x208b6a(++_0x5da053);}(_0x5d96,0xa6));var _0x65d9=function(_0x421752,_0x20f492){_0x421752=_0x421752-0x0;var _0x23ed3e=_0x5d96[_0x421752];return _0x23ed3e;};'use strict';var _=require(_0x65d9('0x0'));var util=require(_0x65d9('0x1'));var moment=require(_0x65d9('0x2'));var BPromise=require(_0x65d9('0x3'));var rs=require(_0x65d9('0x4'));var fs=require('fs');var Redis=require(_0x65d9('0x5'));var db=require(_0x65d9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x65d9('0x7'))(_0x65d9('0x8'));var config=require(_0x65d9('0x9'));var jayson=require(_0x65d9('0xa'));var client=jayson[_0x65d9('0xb')][_0x65d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40ebe1,_0x3c6aab,_0x335736){return new BPromise(function(_0x39d32d,_0x315af5){return client[_0x65d9('0xd')](_0x40ebe1,_0x335736)[_0x65d9('0xe')](function(_0x182e42){logger[_0x65d9('0xf')](_0x65d9('0x10'),_0x3c6aab,'request\x20sent');logger[_0x65d9('0x11')](_0x65d9('0x12'),_0x3c6aab,_0x65d9('0x13'),JSON[_0x65d9('0x14')](_0x182e42));if(_0x182e42[_0x65d9('0x15')]){if(_0x182e42[_0x65d9('0x15')]['code']===0x1f4){logger[_0x65d9('0x15')](_0x65d9('0x10'),_0x3c6aab,_0x182e42[_0x65d9('0x15')][_0x65d9('0x16')]);return _0x315af5(_0x182e42['error']['message']);}logger[_0x65d9('0x15')](_0x65d9('0x10'),_0x3c6aab,_0x182e42['error'][_0x65d9('0x16')]);return _0x39d32d(_0x182e42[_0x65d9('0x15')][_0x65d9('0x16')]);}else{logger[_0x65d9('0xf')](_0x65d9('0x10'),_0x3c6aab,_0x65d9('0x13'));_0x39d32d(_0x182e42[_0x65d9('0x17')]['message']);}})['catch'](function(_0x265b7d){logger[_0x65d9('0x15')](_0x65d9('0x10'),_0x3c6aab,_0x265b7d);_0x315af5(_0x265b7d);});});}