Built motion from commit 994c64e1.|2.6.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 _0x0538=['http','request','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e4d36,_0x57de78){var _0x158d53=function(_0x1d8cd4){while(--_0x1d8cd4){_0x2e4d36['push'](_0x2e4d36['shift']());}};_0x158d53(++_0x57de78);}(_0x0538,0x1aa));var _0x8053=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x0538[_0x531e48];return _0x202971;};'use strict';var _=require('lodash');var util=require(_0x8053('0x0'));var moment=require(_0x8053('0x1'));var BPromise=require(_0x8053('0x2'));var rs=require(_0x8053('0x3'));var fs=require('fs');var Redis=require(_0x8053('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8053('0x5'));var logger=require(_0x8053('0x6'))(_0x8053('0x7'));var config=require(_0x8053('0x8'));var jayson=require(_0x8053('0x9'));var client=jayson[_0x8053('0xa')][_0x8053('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45c16d,_0x52b087,_0x5bf44b){return new BPromise(function(_0x5287de,_0x1c6a45){return client[_0x8053('0xc')](_0x45c16d,_0x5bf44b)['then'](function(_0x5984b9){logger[_0x8053('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x52b087,_0x8053('0xe'));logger['debug'](_0x8053('0xf'),_0x52b087,_0x8053('0xe'),JSON[_0x8053('0x10')](_0x5984b9));if(_0x5984b9[_0x8053('0x11')]){if(_0x5984b9[_0x8053('0x11')][_0x8053('0x12')]===0x1f4){logger['error'](_0x8053('0x13'),_0x52b087,_0x5984b9[_0x8053('0x11')][_0x8053('0x14')]);return _0x1c6a45(_0x5984b9[_0x8053('0x11')][_0x8053('0x14')]);}logger[_0x8053('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x52b087,_0x5984b9[_0x8053('0x11')]['message']);return _0x5287de(_0x5984b9[_0x8053('0x11')][_0x8053('0x14')]);}else{logger[_0x8053('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x52b087,_0x8053('0xe'));_0x5287de(_0x5984b9[_0x8053('0x15')][_0x8053('0x14')]);}})[_0x8053('0x16')](function(_0x2bd2df){logger[_0x8053('0x11')](_0x8053('0x13'),_0x52b087,_0x2bd2df);_0x1c6a45(_0x2bd2df);});});}