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 _0x7306=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment'];(function(_0x1e1879,_0x163311){var _0x4760e3=function(_0x119454){while(--_0x119454){_0x1e1879['push'](_0x1e1879['shift']());}};_0x4760e3(++_0x163311);}(_0x7306,0x76));var _0x6730=function(_0x4b7cfa,_0x13583d){_0x4b7cfa=_0x4b7cfa-0x0;var _0x31875e=_0x7306[_0x4b7cfa];return _0x31875e;};'use strict';var _=require(_0x6730('0x0'));var util=require('util');var moment=require(_0x6730('0x1'));var BPromise=require(_0x6730('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6730('0x3'));var db=require(_0x6730('0x4'))['db'];var utils=require(_0x6730('0x5'));var logger=require(_0x6730('0x6'))(_0x6730('0x7'));var config=require('../../config/environment');var jayson=require(_0x6730('0x8'));var client=jayson['client'][_0x6730('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4905de,_0x413995,_0x1bfa6d){return new BPromise(function(_0x5a289e,_0x59fc4f){return client['request'](_0x4905de,_0x1bfa6d)[_0x6730('0xa')](function(_0x498599){logger['info'](_0x6730('0xb'),_0x413995,_0x6730('0xc'));logger[_0x6730('0xd')](_0x6730('0xe'),_0x413995,_0x6730('0xc'),JSON[_0x6730('0xf')](_0x498599));if(_0x498599[_0x6730('0x10')]){if(_0x498599['error'][_0x6730('0x11')]===0x1f4){logger[_0x6730('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x413995,_0x498599[_0x6730('0x10')][_0x6730('0x12')]);return _0x59fc4f(_0x498599[_0x6730('0x10')][_0x6730('0x12')]);}logger[_0x6730('0x10')](_0x6730('0xb'),_0x413995,_0x498599[_0x6730('0x10')][_0x6730('0x12')]);return _0x5a289e(_0x498599[_0x6730('0x10')][_0x6730('0x12')]);}else{logger['info'](_0x6730('0xb'),_0x413995,'request\x20sent');_0x5a289e(_0x498599['result'][_0x6730('0x12')]);}})[_0x6730('0x13')](function(_0x3ede2c){logger[_0x6730('0x10')](_0x6730('0xb'),_0x413995,_0x3ede2c);_0x59fc4f(_0x3ede2c);});});}