9eb75e706187542dffcaf47ea8add4e893188c72
[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 _0xb98f=['rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xb98f,0x13d));var _0xfb98=function(_0x4a3d65,_0x3edbe5){_0x4a3d65=_0x4a3d65-0x0;var _0x242b89=_0xb98f[_0x4a3d65];return _0x242b89;};'use strict';var jayson=require(_0xfb98('0x0'));var BPromise=require(_0xfb98('0x1'));var logger=require(_0xfb98('0x2'))(_0xfb98('0x3'));var client=jayson[_0xfb98('0x4')]['http']({'port':0x2329});client[_0xfb98('0x5')]=function(_0x202d4b,_0x3da676){return new BPromise(function(_0x32db63,_0x3f4042){return client[_0xfb98('0x6')](_0x202d4b,_0x3da676)[_0xfb98('0x7')](function(_0x3fa54b){logger['debug'](_0xfb98('0x8'),_0xfb98('0x3'),_0x202d4b,_0x3da676,_0x3fa54b);if(_0x3fa54b[_0xfb98('0x9')]){logger['error'](_0xfb98('0x8'),_0xfb98('0x3'),_0x202d4b,_0x3fa54b[_0xfb98('0x9')][_0xfb98('0xa')],_0x3da676);return _0x3f4042(_0x3fa54b['error'][_0xfb98('0xa')]);}else{return _0x32db63(_0x3fa54b['result']);}})[_0xfb98('0xb')](function(_0x292824){logger[_0xfb98('0x9')](_0xfb98('0x8'),_0xfb98('0x3'),_0x202d4b,_0x292824,_0x3da676);return _0x3f4042(_0x292824);});});};module[_0xfb98('0xc')]=client;