Built motion from commit 3e059bc2.|2.5.32
[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 _0xa0ca=['result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','request','then','debug','rpc','error','message'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa0ca,0xc6));var _0xaa0c=function(_0x532dbe,_0x3e1e66){_0x532dbe=_0x532dbe-0x0;var _0x393d7b=_0xa0ca[_0x532dbe];return _0x393d7b;};'use strict';var jayson=require(_0xaa0c('0x0'));var BPromise=require(_0xaa0c('0x1'));var logger=require(_0xaa0c('0x2'))(_0xaa0c('0x3'));var client=jayson[_0xaa0c('0x4')][_0xaa0c('0x5')]({'port':0x2329});client['Request']=function(_0x516c5c,_0x4e7129){return new BPromise(function(_0x5dda3b,_0xd7d3c2){return client[_0xaa0c('0x6')](_0x516c5c,_0x4e7129)[_0xaa0c('0x7')](function(_0xffe5d1){logger[_0xaa0c('0x8')](_0xaa0c('0x9'),_0xaa0c('0x3'),_0x516c5c,_0x4e7129,_0xffe5d1);if(_0xffe5d1[_0xaa0c('0xa')]){logger[_0xaa0c('0xa')](_0xaa0c('0x9'),'routing',_0x516c5c,_0xffe5d1[_0xaa0c('0xa')][_0xaa0c('0xb')],_0x4e7129);return _0xd7d3c2(_0xffe5d1['error'][_0xaa0c('0xb')]);}else{return _0x5dda3b(_0xffe5d1[_0xaa0c('0xc')]);}})['catch'](function(_0x4dd9f5){logger['error'](_0xaa0c('0x9'),_0xaa0c('0x3'),_0x516c5c,_0x4dd9f5,_0x4e7129);return _0xd7d3c2(_0x4dd9f5);});});};module[_0xaa0c('0xd')]=client;