Built motion from commit 1fd437e9.|2.6.19
[motion2.git] / server / services / routing / client.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 _0xfb9e=['then','debug','rpc','error','message','result','exports','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x1a2107,_0x146585){var _0x3ad213=function(_0x119f22){while(--_0x119f22){_0x1a2107['push'](_0x1a2107['shift']());}};_0x3ad213(++_0x146585);}(_0xfb9e,0x181));var _0xefb9=function(_0x10f50d,_0x1b200c){_0x10f50d=_0x10f50d-0x0;var _0x24128c=_0xfb9e[_0x10f50d];return _0x24128c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xefb9('0x0'));var logger=require(_0xefb9('0x1'))(_0xefb9('0x2'));var client=jayson[_0xefb9('0x3')][_0xefb9('0x4')]({'port':0x2329});client[_0xefb9('0x5')]=function(_0xa1d1c1,_0x127dc0){return new BPromise(function(_0x194e7d,_0x1fc141){return client[_0xefb9('0x6')](_0xa1d1c1,_0x127dc0)[_0xefb9('0x7')](function(_0x363b00){logger[_0xefb9('0x8')](_0xefb9('0x9'),_0xefb9('0x2'),_0xa1d1c1,_0x127dc0,_0x363b00);if(_0x363b00[_0xefb9('0xa')]){logger[_0xefb9('0xa')](_0xefb9('0x9'),_0xefb9('0x2'),_0xa1d1c1,_0x363b00['error'][_0xefb9('0xb')],_0x127dc0);return _0x1fc141(_0x363b00[_0xefb9('0xa')]['message']);}else{return _0x194e7d(_0x363b00[_0xefb9('0xc')]);}})['catch'](function(_0x9fdf3e){logger['error'](_0xefb9('0x9'),_0xefb9('0x2'),_0xa1d1c1,_0x9fdf3e,_0x127dc0);return _0x1fc141(_0x9fdf3e);});});};module[_0xefb9('0xd')]=client;