1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xb3b9=['request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../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'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb3b9,0xbe));var _0x9b3b=function(_0x54088e,_0x95261e){_0x54088e=_0x54088e-0x0;var _0x4b9234=_0xb3b9[_0x54088e];return _0x4b9234;};'use strict';var _=require('lodash');var util=require(_0x9b3b('0x0'));var moment=require(_0x9b3b('0x1'));var BPromise=require(_0x9b3b('0x2'));var rs=require(_0x9b3b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b3b('0x4'));var logger=require(_0x9b3b('0x5'))(_0x9b3b('0x6'));var config=require(_0x9b3b('0x7'));var jayson=require(_0x9b3b('0x8'));var client=jayson[_0x9b3b('0x9')][_0x9b3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9da8,_0x2c2eb0,_0x2cc40f){return new BPromise(function(_0x591954,_0x12faa1){return client[_0x9b3b('0xb')](_0x3b9da8,_0x2cc40f)[_0x9b3b('0xc')](function(_0x551a7f){logger[_0x9b3b('0xd')](_0x9b3b('0xe'),_0x2c2eb0,'request\x20sent');logger[_0x9b3b('0xf')](_0x9b3b('0x10'),_0x2c2eb0,_0x9b3b('0x11'),JSON[_0x9b3b('0x12')](_0x551a7f));if(_0x551a7f[_0x9b3b('0x13')]){if(_0x551a7f[_0x9b3b('0x13')][_0x9b3b('0x14')]===0x1f4){logger[_0x9b3b('0x13')](_0x9b3b('0xe'),_0x2c2eb0,_0x551a7f[_0x9b3b('0x13')][_0x9b3b('0x15')]);return _0x12faa1(_0x551a7f['error'][_0x9b3b('0x15')]);}logger[_0x9b3b('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2c2eb0,_0x551a7f[_0x9b3b('0x13')][_0x9b3b('0x15')]);return _0x591954(_0x551a7f[_0x9b3b('0x13')][_0x9b3b('0x15')]);}else{logger[_0x9b3b('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2c2eb0,_0x9b3b('0x11'));_0x591954(_0x551a7f[_0x9b3b('0x16')][_0x9b3b('0x15')]);}})['catch'](function(_0x36d253){logger[_0x9b3b('0x13')](_0x9b3b('0xe'),_0x2c2eb0,_0x36d253);_0x12faa1(_0x36d253);});});}