802f6180c3eaa9b519b469a0ea5b9d8f11a51fd2
[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 _0xf021=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','then'];(function(_0x3794a0,_0x1a9cfc){var _0x5bdaba=function(_0x14a764){while(--_0x14a764){_0x3794a0['push'](_0x3794a0['shift']());}};_0x5bdaba(++_0x1a9cfc);}(_0xf021,0x18f));var _0x1f02=function(_0x80b6a,_0x1b138c){_0x80b6a=_0x80b6a-0x0;var _0x58de9b=_0xf021[_0x80b6a];return _0x58de9b;};'use strict';var jayson=require(_0x1f02('0x0'));var BPromise=require(_0x1f02('0x1'));var logger=require(_0x1f02('0x2'))(_0x1f02('0x3'));var client=jayson[_0x1f02('0x4')]['http']({'port':0x2329});client[_0x1f02('0x5')]=function(_0x54cd44,_0x2e8594){return new BPromise(function(_0x3164f0,_0x51eff6){return client['request'](_0x54cd44,_0x2e8594)[_0x1f02('0x6')](function(_0x56b275){logger[_0x1f02('0x7')](_0x1f02('0x8'),_0x1f02('0x3'),_0x54cd44,_0x2e8594,_0x56b275);if(_0x56b275[_0x1f02('0x9')]){logger[_0x1f02('0x9')]('rpc',_0x1f02('0x3'),_0x54cd44,_0x56b275['error']['message'],_0x2e8594);return _0x51eff6(_0x56b275['error'][_0x1f02('0xa')]);}else{return _0x3164f0(_0x56b275[_0x1f02('0xb')]);}})[_0x1f02('0xc')](function(_0x19ee35){logger[_0x1f02('0x9')]('rpc',_0x1f02('0x3'),_0x54cd44,_0x19ee35,_0x2e8594);return _0x51eff6(_0x19ee35);});});};module[_0x1f02('0xd')]=client;