Built motion from commit 87cd5f02.|2.5.48
[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 _0x7f10=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x43805e,_0x384d43){var _0x692595=function(_0x40b43b){while(--_0x40b43b){_0x43805e['push'](_0x43805e['shift']());}};_0x692595(++_0x384d43);}(_0x7f10,0x12d));var _0x07f1=function(_0x16cf22,_0x504218){_0x16cf22=_0x16cf22-0x0;var _0x113c09=_0x7f10[_0x16cf22];return _0x113c09;};'use strict';var _=require(_0x07f1('0x0'));var util=require(_0x07f1('0x1'));var moment=require(_0x07f1('0x2'));var BPromise=require(_0x07f1('0x3'));var rs=require(_0x07f1('0x4'));var fs=require('fs');var Redis=require(_0x07f1('0x5'));var db=require(_0x07f1('0x6'))['db'];var utils=require(_0x07f1('0x7'));var logger=require(_0x07f1('0x8'))(_0x07f1('0x9'));var config=require('../../config/environment');var jayson=require(_0x07f1('0xa'));var client=jayson[_0x07f1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cb19a,_0x406924,_0x3887f7){return new BPromise(function(_0x11ca24,_0x37a7f3){return client['request'](_0x4cb19a,_0x3887f7)[_0x07f1('0xc')](function(_0x36de42){logger[_0x07f1('0xd')](_0x07f1('0xe'),_0x406924,_0x07f1('0xf'));logger['debug'](_0x07f1('0x10'),_0x406924,_0x07f1('0xf'),JSON[_0x07f1('0x11')](_0x36de42));if(_0x36de42[_0x07f1('0x12')]){if(_0x36de42[_0x07f1('0x12')][_0x07f1('0x13')]===0x1f4){logger[_0x07f1('0x12')](_0x07f1('0xe'),_0x406924,_0x36de42[_0x07f1('0x12')]['message']);return _0x37a7f3(_0x36de42[_0x07f1('0x12')][_0x07f1('0x14')]);}logger[_0x07f1('0x12')](_0x07f1('0xe'),_0x406924,_0x36de42[_0x07f1('0x12')][_0x07f1('0x14')]);return _0x11ca24(_0x36de42[_0x07f1('0x12')]['message']);}else{logger[_0x07f1('0xd')](_0x07f1('0xe'),_0x406924,_0x07f1('0xf'));_0x11ca24(_0x36de42['result'][_0x07f1('0x14')]);}})['catch'](function(_0xeae364){logger[_0x07f1('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x406924,_0xeae364);_0x37a7f3(_0xeae364);});});}