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 _0x690a=['http','Request','then','rpc','memberReport','error','message','exports','jayson/promise','bluebird','ami','client'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x690a,0x110));var _0xa690=function(_0x2ec73a,_0x279dba){_0x2ec73a=_0x2ec73a-0x0;var _0xdf9eb1=_0x690a[_0x2ec73a];return _0xdf9eb1;};'use strict';var jayson=require(_0xa690('0x0'));var BPromise=require(_0xa690('0x1'));var logger=require('../../config/logger')(_0xa690('0x2'));var client=jayson[_0xa690('0x3')][_0xa690('0x4')]({'port':0x2329});client[_0xa690('0x5')]=function(_0x1c6b1a,_0x3a2567){return new BPromise(function(_0x508f9f,_0x3bc5e8){return client['request'](_0x1c6b1a,_0x3a2567)[_0xa690('0x6')](function(_0x18146c){logger['debug'](_0xa690('0x7'),_0xa690('0x8'),_0x1c6b1a,_0x3a2567,_0x18146c);if(_0x18146c[_0xa690('0x9')]){logger['error'](_0xa690('0x7'),_0xa690('0x8'),_0x1c6b1a,_0x18146c['error'][_0xa690('0xa')],_0x3a2567);return _0x3bc5e8(_0x18146c['error']['message']);}else{return _0x508f9f(_0x18146c['result']);}})['catch'](function(_0xc12c45){logger[_0xa690('0x9')](_0xa690('0x7'),_0xa690('0x8'),_0x1c6b1a,_0xc12c45,_0x3a2567);return _0x3bc5e8(_0xc12c45);});});};module[_0xa690('0xb')]=client;