75b156d377d0f8e38ccc18ef929e97b2612376de
[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 _0x752e=['message','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','request','then','debug','error'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0x752e,0xe1));var _0xe752=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x752e[_0x5f309e];return _0x487b5e;};'use strict';var jayson=require(_0xe752('0x0'));var BPromise=require(_0xe752('0x1'));var logger=require(_0xe752('0x2'))(_0xe752('0x3'));var client=jayson[_0xe752('0x4')]['http']({'port':0x2329});client['Request']=function(_0x5f2222,_0x11023e){return new BPromise(function(_0x407e8a,_0x3df1ba){return client[_0xe752('0x5')](_0x5f2222,_0x11023e)[_0xe752('0x6')](function(_0x3b82f7){logger[_0xe752('0x7')]('rpc',_0xe752('0x3'),_0x5f2222,_0x11023e,_0x3b82f7);if(_0x3b82f7[_0xe752('0x8')]){logger[_0xe752('0x8')]('rpc','routing',_0x5f2222,_0x3b82f7['error']['message'],_0x11023e);return _0x3df1ba(_0x3b82f7[_0xe752('0x8')][_0xe752('0x9')]);}else{return _0x407e8a(_0x3b82f7['result']);}})[_0xe752('0xa')](function(_0x70d232){logger[_0xe752('0x8')](_0xe752('0xb'),_0xe752('0x3'),_0x5f2222,_0x70d232,_0x11023e);return _0x3df1ba(_0x70d232);});});};module[_0xe752('0xc')]=client;