17a288172e28beb4fc32f5d479d987a47403af05
[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 _0x74f0=['then','debug','routing','error','rpc','message','catch','exports','jayson/promise','../../config/logger','client','http','Request','request'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x74f0,0xda));var _0x074f=function(_0x2d3c60,_0x4df458){_0x2d3c60=_0x2d3c60-0x0;var _0x560041=_0x74f0[_0x2d3c60];return _0x560041;};'use strict';var jayson=require(_0x074f('0x0'));var BPromise=require('bluebird');var logger=require(_0x074f('0x1'))('routing');var client=jayson[_0x074f('0x2')][_0x074f('0x3')]({'port':0x2329});client[_0x074f('0x4')]=function(_0x460bee,_0x11687a){return new BPromise(function(_0x4fedab,_0x4b2f4c){return client[_0x074f('0x5')](_0x460bee,_0x11687a)[_0x074f('0x6')](function(_0x1d8071){logger[_0x074f('0x7')]('rpc',_0x074f('0x8'),_0x460bee,_0x11687a,_0x1d8071);if(_0x1d8071[_0x074f('0x9')]){logger[_0x074f('0x9')](_0x074f('0xa'),_0x074f('0x8'),_0x460bee,_0x1d8071[_0x074f('0x9')][_0x074f('0xb')],_0x11687a);return _0x4b2f4c(_0x1d8071[_0x074f('0x9')]['message']);}else{return _0x4fedab(_0x1d8071['result']);}})[_0x074f('0xc')](function(_0x1599d8){logger['error']('rpc',_0x074f('0x8'),_0x460bee,_0x1599d8,_0x11687a);return _0x4b2f4c(_0x1599d8);});});};module[_0x074f('0xd')]=client;