Built motion from commit (unavailable).|2.3.1
[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 _0x6d4b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x6d4b,0x1b4));var _0xb6d4=function(_0x2d20f3,_0xbc107c){_0x2d20f3=_0x2d20f3-0x0;var _0x5674be=_0x6d4b[_0x2d20f3];return _0x5674be;};'use strict';var _=require(_0xb6d4('0x0'));var util=require(_0xb6d4('0x1'));var moment=require('moment');var BPromise=require(_0xb6d4('0x2'));var rs=require(_0xb6d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb6d4('0x4'));var logger=require(_0xb6d4('0x5'))('rpc');var config=require(_0xb6d4('0x6'));var jayson=require(_0xb6d4('0x7'));var client=jayson[_0xb6d4('0x8')][_0xb6d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ef79e,_0x9bf906,_0xf11f71){return new BPromise(function(_0x5881e1,_0x306dbf){return client[_0xb6d4('0xa')](_0x5ef79e,_0xf11f71)['then'](function(_0xa73a98){logger[_0xb6d4('0xb')](_0xb6d4('0xc'),_0x9bf906,_0xb6d4('0xd'));logger[_0xb6d4('0xe')](_0xb6d4('0xf'),_0x9bf906,_0xb6d4('0xd'),JSON[_0xb6d4('0x10')](_0xa73a98));if(_0xa73a98[_0xb6d4('0x11')]){if(_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x12')]===0x1f4){logger['error'](_0xb6d4('0xc'),_0x9bf906,_0xa73a98['error']['message']);return _0x306dbf(_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x13')]);}logger[_0xb6d4('0x11')](_0xb6d4('0xc'),_0x9bf906,_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x13')]);return _0x5881e1(_0xa73a98[_0xb6d4('0x11')][_0xb6d4('0x13')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x9bf906,_0xb6d4('0xd'));_0x5881e1(_0xa73a98[_0xb6d4('0x14')][_0xb6d4('0x13')]);}})[_0xb6d4('0x15')](function(_0x575b09){logger[_0xb6d4('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x9bf906,_0x575b09);_0x306dbf(_0x575b09);});});}