f7c3450994d4b13a79cf7e6ae82b9c1c8cfcccb4
[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 _0x6dac=['../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x117089,_0x1927fe){var _0x2973dc=function(_0xc03a9){while(--_0xc03a9){_0x117089['push'](_0x117089['shift']());}};_0x2973dc(++_0x1927fe);}(_0x6dac,0x16e));var _0xc6da=function(_0x1a5f16,_0x5d540d){_0x1a5f16=_0x1a5f16-0x0;var _0x538c6e=_0x6dac[_0x1a5f16];return _0x538c6e;};'use strict';var jayson=require(_0xc6da('0x0'));var BPromise=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var client=jayson[_0xc6da('0x4')][_0xc6da('0x5')]({'port':0x2329});client[_0xc6da('0x6')]=function(_0x2fc6e0,_0x28663f){return new BPromise(function(_0x338470,_0x18ee4e){return client[_0xc6da('0x7')](_0x2fc6e0,_0x28663f)[_0xc6da('0x8')](function(_0x5caf49){logger[_0xc6da('0x9')](_0xc6da('0xa'),_0xc6da('0x3'),_0x2fc6e0,_0x28663f,_0x5caf49);if(_0x5caf49[_0xc6da('0xb')]){logger[_0xc6da('0xb')](_0xc6da('0xa'),_0xc6da('0x3'),_0x2fc6e0,_0x5caf49[_0xc6da('0xb')][_0xc6da('0xc')],_0x28663f);return _0x18ee4e(_0x5caf49['error'][_0xc6da('0xc')]);}else{return _0x338470(_0x5caf49[_0xc6da('0xd')]);}})[_0xc6da('0xe')](function(_0x2f81f2){logger[_0xc6da('0xb')](_0xc6da('0xa'),_0xc6da('0x3'),_0x2fc6e0,_0x2f81f2,_0x28663f);return _0x18ee4e(_0x2f81f2);});});};module[_0xc6da('0xf')]=client;