80837e4988799749e088e8b2916e9e0c6547ec34
[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 _0x212a=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','debug','rpc','error','message','result','catch'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0x212a,0x1cf));var _0xa212=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x212a[_0x5d6456];return _0x4d66c1;};'use strict';var jayson=require(_0xa212('0x0'));var BPromise=require(_0xa212('0x1'));var logger=require(_0xa212('0x2'))(_0xa212('0x3'));var client=jayson[_0xa212('0x4')][_0xa212('0x5')]({'port':0x2329});client[_0xa212('0x6')]=function(_0x4b9e65,_0x27ed92){return new BPromise(function(_0xa33fcf,_0x5edc38){return client['request'](_0x4b9e65,_0x27ed92)['then'](function(_0x124d13){logger[_0xa212('0x7')](_0xa212('0x8'),_0xa212('0x3'),_0x4b9e65,_0x27ed92,_0x124d13);if(_0x124d13['error']){logger[_0xa212('0x9')](_0xa212('0x8'),_0xa212('0x3'),_0x4b9e65,_0x124d13['error'][_0xa212('0xa')],_0x27ed92);return _0x5edc38(_0x124d13['error'][_0xa212('0xa')]);}else{return _0xa33fcf(_0x124d13[_0xa212('0xb')]);}})[_0xa212('0xc')](function(_0x3168f1){logger[_0xa212('0x9')]('rpc',_0xa212('0x3'),_0x4b9e65,_0x3168f1,_0x27ed92);return _0x5edc38(_0x3168f1);});});};module[_0xa212('0xd')]=client;