Built motion from commit (unavailable).|2.5.7
[motion2.git] / server / api / mailTransferReport / mailTransferReport.rpc.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 _0xcb91=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x49592c,_0x5c04c9){var _0x483409=function(_0x46afb2){while(--_0x46afb2){_0x49592c['push'](_0x49592c['shift']());}};_0x483409(++_0x5c04c9);}(_0xcb91,0x12e));var _0x1cb9=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0xcb91[_0x591a90];return _0x551587;};'use strict';var _=require(_0x1cb9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1cb9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cb9('0x2'))['db'];var utils=require(_0x1cb9('0x3'));var logger=require('../../config/logger')(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1cb9('0x6')][_0x1cb9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33c288,_0x569f09,_0x2c9a78){return new BPromise(function(_0x378859,_0x3a34c6){return client['request'](_0x33c288,_0x2c9a78)[_0x1cb9('0x8')](function(_0x38b888){logger[_0x1cb9('0x9')](_0x1cb9('0xa'),_0x569f09,'request\x20sent');logger[_0x1cb9('0xb')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x569f09,_0x1cb9('0xc'),JSON[_0x1cb9('0xd')](_0x38b888));if(_0x38b888['error']){if(_0x38b888[_0x1cb9('0xe')][_0x1cb9('0xf')]===0x1f4){logger['error'](_0x1cb9('0xa'),_0x569f09,_0x38b888[_0x1cb9('0xe')][_0x1cb9('0x10')]);return _0x3a34c6(_0x38b888[_0x1cb9('0xe')]['message']);}logger['error'](_0x1cb9('0xa'),_0x569f09,_0x38b888['error'][_0x1cb9('0x10')]);return _0x378859(_0x38b888[_0x1cb9('0xe')][_0x1cb9('0x10')]);}else{logger['info'](_0x1cb9('0xa'),_0x569f09,'request\x20sent');_0x378859(_0x38b888[_0x1cb9('0x11')][_0x1cb9('0x10')]);}})[_0x1cb9('0x12')](function(_0x2cc358){logger[_0x1cb9('0xe')](_0x1cb9('0xa'),_0x569f09,_0x2cc358);_0x3a34c6(_0x2cc358);});});}