Built motion from commit 9d0783e6.|2.6.13
[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 _0x3cfa=['client','http','Request','debug','error','rpc','message','catch','exports','jayson/promise','bluebird','routing'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3cfa,0x129));var _0xa3cf=function(_0x599347,_0x35a224){_0x599347=_0x599347-0x0;var _0x524fe9=_0x3cfa[_0x599347];return _0x524fe9;};'use strict';var jayson=require(_0xa3cf('0x0'));var BPromise=require(_0xa3cf('0x1'));var logger=require('../../config/logger')(_0xa3cf('0x2'));var client=jayson[_0xa3cf('0x3')][_0xa3cf('0x4')]({'port':0x2329});client[_0xa3cf('0x5')]=function(_0x52e0c2,_0x5d965c){return new BPromise(function(_0x87c188,_0x189212){return client['request'](_0x52e0c2,_0x5d965c)['then'](function(_0x1fc5a5){logger[_0xa3cf('0x6')]('rpc',_0xa3cf('0x2'),_0x52e0c2,_0x5d965c,_0x1fc5a5);if(_0x1fc5a5['error']){logger[_0xa3cf('0x7')](_0xa3cf('0x8'),'routing',_0x52e0c2,_0x1fc5a5['error'][_0xa3cf('0x9')],_0x5d965c);return _0x189212(_0x1fc5a5[_0xa3cf('0x7')][_0xa3cf('0x9')]);}else{return _0x87c188(_0x1fc5a5['result']);}})[_0xa3cf('0xa')](function(_0x4e6f72){logger[_0xa3cf('0x7')](_0xa3cf('0x8'),'routing',_0x52e0c2,_0x4e6f72,_0x5d965c);return _0x189212(_0x4e6f72);});});};module[_0xa3cf('0xb')]=client;