Built motion from commit 5293bb2a.|2.6.30
[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 _0x5140=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x5140,0xe5));var _0x0514=function(_0x35cc52,_0x4d44d7){_0x35cc52=_0x35cc52-0x0;var _0x43b8b7=_0x5140[_0x35cc52];return _0x43b8b7;};'use strict';var _=require(_0x0514('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0514('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0514('0x2'));var db=require(_0x0514('0x3'))['db'];var utils=require(_0x0514('0x4'));var logger=require(_0x0514('0x5'))(_0x0514('0x6'));var config=require('../../config/environment');var jayson=require(_0x0514('0x7'));var client=jayson[_0x0514('0x8')][_0x0514('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ccfab,_0x52b780,_0x585e27){return new BPromise(function(_0x4c3a24,_0x55d392){return client[_0x0514('0xa')](_0x1ccfab,_0x585e27)[_0x0514('0xb')](function(_0xdc6d3e){logger['info'](_0x0514('0xc'),_0x52b780,_0x0514('0xd'));logger[_0x0514('0xe')](_0x0514('0xf'),_0x52b780,_0x0514('0xd'),JSON[_0x0514('0x10')](_0xdc6d3e));if(_0xdc6d3e[_0x0514('0x11')]){if(_0xdc6d3e['error'][_0x0514('0x12')]===0x1f4){logger[_0x0514('0x11')](_0x0514('0xc'),_0x52b780,_0xdc6d3e[_0x0514('0x11')]['message']);return _0x55d392(_0xdc6d3e[_0x0514('0x11')][_0x0514('0x13')]);}logger[_0x0514('0x11')](_0x0514('0xc'),_0x52b780,_0xdc6d3e[_0x0514('0x11')]['message']);return _0x4c3a24(_0xdc6d3e[_0x0514('0x11')][_0x0514('0x13')]);}else{logger[_0x0514('0x14')](_0x0514('0xc'),_0x52b780,_0x0514('0xd'));_0x4c3a24(_0xdc6d3e[_0x0514('0x15')][_0x0514('0x13')]);}})['catch'](function(_0x575693){logger[_0x0514('0x11')](_0x0514('0xc'),_0x52b780,_0x575693);_0x55d392(_0x575693);});});}