9816481f5e601a4be4875c5fad8ba5fd48cd0f49
[motion2.git] / server / services / email / 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 _0x0a15=['catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','rpc','error','message','result'];(function(_0x47b4d6,_0x13b0b3){var _0x317a04=function(_0x15549e){while(--_0x15549e){_0x47b4d6['push'](_0x47b4d6['shift']());}};_0x317a04(++_0x13b0b3);}(_0x0a15,0x160));var _0x50a1=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x0a15[_0x2db12b];return _0x20990b;};'use strict';var jayson=require(_0x50a1('0x0'));var BPromise=require(_0x50a1('0x1'));var logger=require(_0x50a1('0x2'))(_0x50a1('0x3'));var client=jayson[_0x50a1('0x4')][_0x50a1('0x5')]({'port':0x2329});client[_0x50a1('0x6')]=function(_0x8e02c9,_0x35d1f5){return new BPromise(function(_0x65978b,_0x42a77f){return client[_0x50a1('0x7')](_0x8e02c9,_0x35d1f5)['then'](function(_0x5a3c65){logger['debug'](_0x50a1('0x8'),'routing',_0x8e02c9,_0x35d1f5,_0x5a3c65);if(_0x5a3c65[_0x50a1('0x9')]){logger['error']('rpc',_0x50a1('0x3'),_0x8e02c9,_0x5a3c65['error'][_0x50a1('0xa')],_0x35d1f5);return _0x42a77f(_0x5a3c65[_0x50a1('0x9')][_0x50a1('0xa')]);}else{return _0x65978b(_0x5a3c65[_0x50a1('0xb')]);}})[_0x50a1('0xc')](function(_0x560d7c){logger[_0x50a1('0x9')]('rpc','routing',_0x8e02c9,_0x560d7c,_0x35d1f5);return _0x42a77f(_0x560d7c);});});};module['exports']=client;