3e1e9956ac942ece278175fa774ff3fafcd614d9
[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 _0x87e7=['error','message','jayson/promise','../../config/logger','routing','http','Request','request','then','debug','rpc'];(function(_0x364957,_0xd58db3){var _0x431ac6=function(_0x13a90a){while(--_0x13a90a){_0x364957['push'](_0x364957['shift']());}};_0x431ac6(++_0xd58db3);}(_0x87e7,0x1e6));var _0x787e=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x87e7[_0x45806b];return _0x3e228e;};'use strict';var jayson=require(_0x787e('0x0'));var BPromise=require('bluebird');var logger=require(_0x787e('0x1'))(_0x787e('0x2'));var client=jayson['client'][_0x787e('0x3')]({'port':0x2329});client[_0x787e('0x4')]=function(_0x26f5a6,_0x57baaf){return new BPromise(function(_0x4e5e56,_0x5e049c){return client[_0x787e('0x5')](_0x26f5a6,_0x57baaf)[_0x787e('0x6')](function(_0x5a0240){logger[_0x787e('0x7')](_0x787e('0x8'),'routing',_0x26f5a6,_0x57baaf,_0x5a0240);if(_0x5a0240[_0x787e('0x9')]){logger[_0x787e('0x9')](_0x787e('0x8'),_0x787e('0x2'),_0x26f5a6,_0x5a0240[_0x787e('0x9')][_0x787e('0xa')],_0x57baaf);return _0x5e049c(_0x5a0240['error'][_0x787e('0xa')]);}else{return _0x4e5e56(_0x5a0240['result']);}})['catch'](function(_0x2fbbef){logger['error'](_0x787e('0x8'),_0x787e('0x2'),_0x26f5a6,_0x2fbbef,_0x57baaf);return _0x5e049c(_0x2fbbef);});});};module['exports']=client;