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 _0x1ff3=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','request','then'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x1ff3,0x103));var _0x31ff=function(_0x21e117,_0x4d961e){_0x21e117=_0x21e117-0x0;var _0x214b3a=_0x1ff3[_0x21e117];return _0x214b3a;};'use strict';var jayson=require(_0x31ff('0x0'));var BPromise=require(_0x31ff('0x1'));var logger=require('../../config/logger')(_0x31ff('0x2'));var client=jayson[_0x31ff('0x3')][_0x31ff('0x4')]({'port':0x2329});client['Request']=function(_0x54a4b4,_0x5328aa){return new BPromise(function(_0x556398,_0x36f802){return client[_0x31ff('0x5')](_0x54a4b4,_0x5328aa)[_0x31ff('0x6')](function(_0x1db9b0){logger[_0x31ff('0x7')](_0x31ff('0x8'),_0x31ff('0x2'),_0x54a4b4,_0x5328aa,_0x1db9b0);if(_0x1db9b0[_0x31ff('0x9')]){logger[_0x31ff('0x9')](_0x31ff('0x8'),_0x31ff('0x2'),_0x54a4b4,_0x1db9b0[_0x31ff('0x9')][_0x31ff('0xa')],_0x5328aa);return _0x36f802(_0x1db9b0[_0x31ff('0x9')]['message']);}else{return _0x556398(_0x1db9b0[_0x31ff('0xb')]);}})[_0x31ff('0xc')](function(_0x2ae361){logger[_0x31ff('0x9')](_0x31ff('0x8'),_0x31ff('0x2'),_0x54a4b4,_0x2ae361,_0x5328aa);return _0x36f802(_0x2ae361);});});};module[_0x31ff('0xd')]=client;