bd9f4543f7a2797352e29fa763139f86adef54fd
[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 _0x640e=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x52be03,_0x5bf5f6){var _0xc64bda=function(_0x4ea1a7){while(--_0x4ea1a7){_0x52be03['push'](_0x52be03['shift']());}};_0xc64bda(++_0x5bf5f6);}(_0x640e,0x139));var _0xe640=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x640e[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xe640('0x0'));var util=require(_0xe640('0x1'));var moment=require(_0xe640('0x2'));var BPromise=require(_0xe640('0x3'));var rs=require(_0xe640('0x4'));var fs=require('fs');var Redis=require(_0xe640('0x5'));var db=require(_0xe640('0x6'))['db'];var utils=require(_0xe640('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe640('0x8'));var jayson=require(_0xe640('0x9'));var client=jayson[_0xe640('0xa')][_0xe640('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x111777,_0x209236,_0x8511bb){return new BPromise(function(_0x4239ef,_0x50097b){return client[_0xe640('0xc')](_0x111777,_0x8511bb)[_0xe640('0xd')](function(_0x4819d0){logger[_0xe640('0xe')](_0xe640('0xf'),_0x209236,_0xe640('0x10'));logger[_0xe640('0x11')](_0xe640('0x12'),_0x209236,_0xe640('0x10'),JSON[_0xe640('0x13')](_0x4819d0));if(_0x4819d0[_0xe640('0x14')]){if(_0x4819d0[_0xe640('0x14')][_0xe640('0x15')]===0x1f4){logger['error'](_0xe640('0xf'),_0x209236,_0x4819d0[_0xe640('0x14')]['message']);return _0x50097b(_0x4819d0[_0xe640('0x14')][_0xe640('0x16')]);}logger[_0xe640('0x14')](_0xe640('0xf'),_0x209236,_0x4819d0[_0xe640('0x14')]['message']);return _0x4239ef(_0x4819d0[_0xe640('0x14')][_0xe640('0x16')]);}else{logger[_0xe640('0xe')](_0xe640('0xf'),_0x209236,_0xe640('0x10'));_0x4239ef(_0x4819d0[_0xe640('0x17')][_0xe640('0x16')]);}})['catch'](function(_0x5508d2){logger[_0xe640('0x14')](_0xe640('0xf'),_0x209236,_0x5508d2);_0x50097b(_0x5508d2);});});}