Built motion from commit f7863d46.|2.5.41
[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 _0x461e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x461e,0x1b0));var _0xe461=function(_0x37daeb,_0x9373d3){_0x37daeb=_0x37daeb-0x0;var _0x18659d=_0x461e[_0x37daeb];return _0x18659d;};'use strict';var _=require(_0xe461('0x0'));var util=require(_0xe461('0x1'));var moment=require(_0xe461('0x2'));var BPromise=require(_0xe461('0x3'));var rs=require(_0xe461('0x4'));var fs=require('fs');var Redis=require(_0xe461('0x5'));var db=require(_0xe461('0x6'))['db'];var utils=require(_0xe461('0x7'));var logger=require(_0xe461('0x8'))('rpc');var config=require(_0xe461('0x9'));var jayson=require(_0xe461('0xa'));var client=jayson[_0xe461('0xb')][_0xe461('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16e494,_0x1d3f4c,_0x599be3){return new BPromise(function(_0x349e01,_0x36b215){return client[_0xe461('0xd')](_0x16e494,_0x599be3)[_0xe461('0xe')](function(_0x264877){logger[_0xe461('0xf')](_0xe461('0x10'),_0x1d3f4c,'request\x20sent');logger['debug'](_0xe461('0x11'),_0x1d3f4c,_0xe461('0x12'),JSON[_0xe461('0x13')](_0x264877));if(_0x264877['error']){if(_0x264877[_0xe461('0x14')][_0xe461('0x15')]===0x1f4){logger['error'](_0xe461('0x10'),_0x1d3f4c,_0x264877[_0xe461('0x14')][_0xe461('0x16')]);return _0x36b215(_0x264877[_0xe461('0x14')][_0xe461('0x16')]);}logger[_0xe461('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x1d3f4c,_0x264877[_0xe461('0x14')][_0xe461('0x16')]);return _0x349e01(_0x264877[_0xe461('0x14')][_0xe461('0x16')]);}else{logger['info'](_0xe461('0x10'),_0x1d3f4c,_0xe461('0x12'));_0x349e01(_0x264877['result'][_0xe461('0x16')]);}})['catch'](function(_0xcacd58){logger['error'](_0xe461('0x10'),_0x1d3f4c,_0xcacd58);_0x36b215(_0xcacd58);});});}