905307107524ea73b95124246938259924c9f2fc
[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 _0xa168=['then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x466a8d,_0x399097){var _0x436136=function(_0xd18c40){while(--_0xd18c40){_0x466a8d['push'](_0x466a8d['shift']());}};_0x436136(++_0x399097);}(_0xa168,0x191));var _0x8a16=function(_0xc0f3d0,_0x4cfe98){_0xc0f3d0=_0xc0f3d0-0x0;var _0x1798ba=_0xa168[_0xc0f3d0];return _0x1798ba;};'use strict';var _=require('lodash');var util=require(_0x8a16('0x0'));var moment=require('moment');var BPromise=require(_0x8a16('0x1'));var rs=require(_0x8a16('0x2'));var fs=require('fs');var Redis=require(_0x8a16('0x3'));var db=require(_0x8a16('0x4'))['db'];var utils=require(_0x8a16('0x5'));var logger=require(_0x8a16('0x6'))(_0x8a16('0x7'));var config=require(_0x8a16('0x8'));var jayson=require(_0x8a16('0x9'));var client=jayson[_0x8a16('0xa')][_0x8a16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x572802,_0x59c4ed,_0x3cc967){return new BPromise(function(_0x44e4b6,_0x287c4f){return client[_0x8a16('0xc')](_0x572802,_0x3cc967)[_0x8a16('0xd')](function(_0x3820b7){logger['info'](_0x8a16('0xe'),_0x59c4ed,_0x8a16('0xf'));logger[_0x8a16('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x59c4ed,_0x8a16('0xf'),JSON[_0x8a16('0x11')](_0x3820b7));if(_0x3820b7['error']){if(_0x3820b7[_0x8a16('0x12')][_0x8a16('0x13')]===0x1f4){logger[_0x8a16('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x59c4ed,_0x3820b7[_0x8a16('0x12')]['message']);return _0x287c4f(_0x3820b7[_0x8a16('0x12')][_0x8a16('0x14')]);}logger['error'](_0x8a16('0xe'),_0x59c4ed,_0x3820b7[_0x8a16('0x12')][_0x8a16('0x14')]);return _0x44e4b6(_0x3820b7['error'][_0x8a16('0x14')]);}else{logger['info'](_0x8a16('0xe'),_0x59c4ed,'request\x20sent');_0x44e4b6(_0x3820b7[_0x8a16('0x15')][_0x8a16('0x14')]);}})[_0x8a16('0x16')](function(_0x40d6f0){logger['error'](_0x8a16('0xe'),_0x59c4ed,_0x40d6f0);_0x287c4f(_0x40d6f0);});});}