Built motion from commit 994c64e1.|2.6.1
[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 _0xaa8f=['client','Request','request','then','debug','routing','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x35fec6,_0x9e4798){var _0x5c9c6=function(_0x49159f){while(--_0x49159f){_0x35fec6['push'](_0x35fec6['shift']());}};_0x5c9c6(++_0x9e4798);}(_0xaa8f,0xc1));var _0xfaa8=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0xaa8f[_0x43a5c7];return _0x3b12a2;};'use strict';var jayson=require(_0xfaa8('0x0'));var BPromise=require(_0xfaa8('0x1'));var logger=require(_0xfaa8('0x2'))('routing');var client=jayson[_0xfaa8('0x3')]['http']({'port':0x2329});client[_0xfaa8('0x4')]=function(_0x244e5a,_0x5c50d2){return new BPromise(function(_0x177491,_0x50398e){return client[_0xfaa8('0x5')](_0x244e5a,_0x5c50d2)[_0xfaa8('0x6')](function(_0x553a82){logger[_0xfaa8('0x7')]('rpc',_0xfaa8('0x8'),_0x244e5a,_0x5c50d2,_0x553a82);if(_0x553a82[_0xfaa8('0x9')]){logger[_0xfaa8('0x9')](_0xfaa8('0xa'),'routing',_0x244e5a,_0x553a82[_0xfaa8('0x9')][_0xfaa8('0xb')],_0x5c50d2);return _0x50398e(_0x553a82[_0xfaa8('0x9')][_0xfaa8('0xb')]);}else{return _0x177491(_0x553a82['result']);}})[_0xfaa8('0xc')](function(_0x578ea1){logger['error']('rpc',_0xfaa8('0x8'),_0x244e5a,_0x578ea1,_0x5c50d2);return _0x50398e(_0x578ea1);});});};module[_0xfaa8('0xd')]=client;