Built motion from commit 00bf23f6.|2.6.16
[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 _0x014b=['error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc'];(function(_0x32a617,_0x4c8f62){var _0x5412da=function(_0x12c60a){while(--_0x12c60a){_0x32a617['push'](_0x32a617['shift']());}};_0x5412da(++_0x4c8f62);}(_0x014b,0x18c));var _0xb014=function(_0x549dc8,_0x4b83bc){_0x549dc8=_0x549dc8-0x0;var _0x138e37=_0x014b[_0x549dc8];return _0x138e37;};'use strict';var jayson=require(_0xb014('0x0'));var BPromise=require(_0xb014('0x1'));var logger=require(_0xb014('0x2'))(_0xb014('0x3'));var client=jayson['client'][_0xb014('0x4')]({'port':0x2329});client[_0xb014('0x5')]=function(_0xbd74e4,_0x3cffd4){return new BPromise(function(_0x163400,_0x48c563){return client[_0xb014('0x6')](_0xbd74e4,_0x3cffd4)[_0xb014('0x7')](function(_0x50584c){logger[_0xb014('0x8')](_0xb014('0x9'),_0xb014('0x3'),_0xbd74e4,_0x3cffd4,_0x50584c);if(_0x50584c['error']){logger['error']('rpc',_0xb014('0x3'),_0xbd74e4,_0x50584c[_0xb014('0xa')][_0xb014('0xb')],_0x3cffd4);return _0x48c563(_0x50584c['error'][_0xb014('0xb')]);}else{return _0x163400(_0x50584c['result']);}})[_0xb014('0xc')](function(_0x42e014){logger[_0xb014('0xa')](_0xb014('0x9'),_0xb014('0x3'),_0xbd74e4,_0x42e014,_0x3cffd4);return _0x48c563(_0x42e014);});});};module[_0xb014('0xd')]=client;