c9c9e78c3a78a1a5da7ebd9fbb7261126718253d
[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 _0x68e7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3fafca,_0x195c8c){var _0x1096a5=function(_0x196eb9){while(--_0x196eb9){_0x3fafca['push'](_0x3fafca['shift']());}};_0x1096a5(++_0x195c8c);}(_0x68e7,0x1b5));var _0x768e=function(_0x1a6361,_0x583aa3){_0x1a6361=_0x1a6361-0x0;var _0x38cf20=_0x68e7[_0x1a6361];return _0x38cf20;};'use strict';var _=require(_0x768e('0x0'));var util=require(_0x768e('0x1'));var moment=require(_0x768e('0x2'));var BPromise=require(_0x768e('0x3'));var rs=require(_0x768e('0x4'));var fs=require('fs');var Redis=require(_0x768e('0x5'));var db=require(_0x768e('0x6'))['db'];var utils=require(_0x768e('0x7'));var logger=require(_0x768e('0x8'))(_0x768e('0x9'));var config=require(_0x768e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x768e('0xb')][_0x768e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x586279,_0x2c6ce9,_0x42a01c){return new BPromise(function(_0x32d010,_0x532adc){return client[_0x768e('0xd')](_0x586279,_0x42a01c)[_0x768e('0xe')](function(_0x3d4f63){logger[_0x768e('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x2c6ce9,_0x768e('0x10'));logger[_0x768e('0x11')](_0x768e('0x12'),_0x2c6ce9,_0x768e('0x10'),JSON[_0x768e('0x13')](_0x3d4f63));if(_0x3d4f63['error']){if(_0x3d4f63[_0x768e('0x14')][_0x768e('0x15')]===0x1f4){logger[_0x768e('0x14')](_0x768e('0x16'),_0x2c6ce9,_0x3d4f63['error'][_0x768e('0x17')]);return _0x532adc(_0x3d4f63['error'][_0x768e('0x17')]);}logger[_0x768e('0x14')](_0x768e('0x16'),_0x2c6ce9,_0x3d4f63[_0x768e('0x14')]['message']);return _0x32d010(_0x3d4f63[_0x768e('0x14')][_0x768e('0x17')]);}else{logger[_0x768e('0xf')](_0x768e('0x16'),_0x2c6ce9,_0x768e('0x10'));_0x32d010(_0x3d4f63[_0x768e('0x18')][_0x768e('0x17')]);}})[_0x768e('0x19')](function(_0x2c0327){logger[_0x768e('0x14')](_0x768e('0x16'),_0x2c6ce9,_0x2c0327);_0x532adc(_0x2c0327);});});}