Built motion from commit (unavailable).|2.5.23
[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 _0xbdfd=['http','Request','request','then','debug','rpc','error','message','result','exports','jayson/promise','routing','client'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var jayson=require(_0xdbdf('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xdbdf('0x1'));var client=jayson[_0xdbdf('0x2')][_0xdbdf('0x3')]({'port':0x2329});client[_0xdbdf('0x4')]=function(_0x5b8b14,_0x26b703){return new BPromise(function(_0x15cf18,_0x491f52){return client[_0xdbdf('0x5')](_0x5b8b14,_0x26b703)[_0xdbdf('0x6')](function(_0x484034){logger[_0xdbdf('0x7')](_0xdbdf('0x8'),_0xdbdf('0x1'),_0x5b8b14,_0x26b703,_0x484034);if(_0x484034[_0xdbdf('0x9')]){logger[_0xdbdf('0x9')]('rpc',_0xdbdf('0x1'),_0x5b8b14,_0x484034[_0xdbdf('0x9')][_0xdbdf('0xa')],_0x26b703);return _0x491f52(_0x484034[_0xdbdf('0x9')][_0xdbdf('0xa')]);}else{return _0x15cf18(_0x484034[_0xdbdf('0xb')]);}})['catch'](function(_0x52939e){logger[_0xdbdf('0x9')](_0xdbdf('0x8'),_0xdbdf('0x1'),_0x5b8b14,_0x52939e,_0x26b703);return _0x491f52(_0x52939e);});});};module[_0xdbdf('0xc')]=client;