5460606f02222f5699b45f3745914951ff44b487
[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 _0x9a22=['error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','request','then'];(function(_0x3aee4e,_0x596576){var _0x46e923=function(_0x594aa3){while(--_0x594aa3){_0x3aee4e['push'](_0x3aee4e['shift']());}};_0x46e923(++_0x596576);}(_0x9a22,0x1b2));var _0x29a2=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9a22[_0x297fd3];return _0x2af381;};'use strict';var jayson=require(_0x29a2('0x0'));var BPromise=require(_0x29a2('0x1'));var logger=require(_0x29a2('0x2'))(_0x29a2('0x3'));var client=jayson[_0x29a2('0x4')][_0x29a2('0x5')]({'port':0x2329});client['Request']=function(_0x5e20c9,_0x1ee561){return new BPromise(function(_0x2a39bb,_0x5c56a2){return client[_0x29a2('0x6')](_0x5e20c9,_0x1ee561)[_0x29a2('0x7')](function(_0x251c13){logger['debug']('rpc',_0x29a2('0x3'),_0x5e20c9,_0x1ee561,_0x251c13);if(_0x251c13['error']){logger[_0x29a2('0x8')]('rpc',_0x29a2('0x3'),_0x5e20c9,_0x251c13[_0x29a2('0x8')][_0x29a2('0x9')],_0x1ee561);return _0x5c56a2(_0x251c13[_0x29a2('0x8')][_0x29a2('0x9')]);}else{return _0x2a39bb(_0x251c13[_0x29a2('0xa')]);}})[_0x29a2('0xb')](function(_0x521e73){logger[_0x29a2('0x8')]('rpc','routing',_0x5e20c9,_0x521e73,_0x1ee561);return _0x5c56a2(_0x521e73);});});};module[_0x29a2('0xc')]=client;