d4ee09137971fc1cbf885eb20a49e79d6e7b98c1
[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 _0x1f5d=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','request','then','debug','rpc','error','message'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x1f5d,0x107));var _0xd1f5=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x1f5d[_0x1a0600];return _0x734670;};'use strict';var jayson=require(_0xd1f5('0x0'));var BPromise=require(_0xd1f5('0x1'));var logger=require(_0xd1f5('0x2'))(_0xd1f5('0x3'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x313f02,_0x88c6cf){return new BPromise(function(_0x249e07,_0x372eca){return client[_0xd1f5('0x4')](_0x313f02,_0x88c6cf)[_0xd1f5('0x5')](function(_0x2b869b){logger[_0xd1f5('0x6')](_0xd1f5('0x7'),'routing',_0x313f02,_0x88c6cf,_0x2b869b);if(_0x2b869b[_0xd1f5('0x8')]){logger[_0xd1f5('0x8')](_0xd1f5('0x7'),'routing',_0x313f02,_0x2b869b['error']['message'],_0x88c6cf);return _0x372eca(_0x2b869b[_0xd1f5('0x8')][_0xd1f5('0x9')]);}else{return _0x249e07(_0x2b869b[_0xd1f5('0xa')]);}})[_0xd1f5('0xb')](function(_0x2cdcff){logger[_0xd1f5('0x8')](_0xd1f5('0x7'),_0xd1f5('0x3'),_0x313f02,_0x2cdcff,_0x88c6cf);return _0x372eca(_0x2cdcff);});});};module[_0xd1f5('0xc')]=client;