Built motion from commit (unavailable).|2.5.31
[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 _0xc73e=['client','request','then','debug','error','rpc','message','result','exports','jayson/promise','bluebird','routing'];(function(_0xb9b19,_0x2f537e){var _0x2251d8=function(_0x1348fb){while(--_0x1348fb){_0xb9b19['push'](_0xb9b19['shift']());}};_0x2251d8(++_0x2f537e);}(_0xc73e,0x1e9));var _0xec73=function(_0x2532ec,_0x58d125){_0x2532ec=_0x2532ec-0x0;var _0x526050=_0xc73e[_0x2532ec];return _0x526050;};'use strict';var jayson=require(_0xec73('0x0'));var BPromise=require(_0xec73('0x1'));var logger=require('../../config/logger')(_0xec73('0x2'));var client=jayson[_0xec73('0x3')]['http']({'port':0x2329});client['Request']=function(_0x494c49,_0x36ed48){return new BPromise(function(_0x3b35a2,_0x4fbf12){return client[_0xec73('0x4')](_0x494c49,_0x36ed48)[_0xec73('0x5')](function(_0x3bd154){logger[_0xec73('0x6')]('rpc',_0xec73('0x2'),_0x494c49,_0x36ed48,_0x3bd154);if(_0x3bd154['error']){logger[_0xec73('0x7')](_0xec73('0x8'),_0xec73('0x2'),_0x494c49,_0x3bd154[_0xec73('0x7')]['message'],_0x36ed48);return _0x4fbf12(_0x3bd154['error'][_0xec73('0x9')]);}else{return _0x3b35a2(_0x3bd154[_0xec73('0xa')]);}})['catch'](function(_0x559935){logger[_0xec73('0x7')](_0xec73('0x8'),_0xec73('0x2'),_0x494c49,_0x559935,_0x36ed48);return _0x4fbf12(_0x559935);});});};module[_0xec73('0xb')]=client;