Built motion from commit 85328c08.|2.5.50
[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 _0xb14f=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0xa70eb0,_0x2971ef){var _0x3b44a6=function(_0x47c967){while(--_0x47c967){_0xa70eb0['push'](_0xa70eb0['shift']());}};_0x3b44a6(++_0x2971ef);}(_0xb14f,0x152));var _0xfb14=function(_0x497d3e,_0x3500f3){_0x497d3e=_0x497d3e-0x0;var _0x3014d1=_0xb14f[_0x497d3e];return _0x3014d1;};'use strict';var _=require(_0xfb14('0x0'));var util=require(_0xfb14('0x1'));var moment=require(_0xfb14('0x2'));var BPromise=require(_0xfb14('0x3'));var rs=require(_0xfb14('0x4'));var fs=require('fs');var Redis=require(_0xfb14('0x5'));var db=require(_0xfb14('0x6'))['db'];var utils=require(_0xfb14('0x7'));var logger=require(_0xfb14('0x8'))('rpc');var config=require(_0xfb14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb14('0xa')][_0xfb14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492dbc,_0x4f4d9a,_0x1bd6e2){return new BPromise(function(_0x31dc36,_0x16ed71){return client[_0xfb14('0xc')](_0x492dbc,_0x1bd6e2)[_0xfb14('0xd')](function(_0x5da1d2){logger[_0xfb14('0xe')](_0xfb14('0xf'),_0x4f4d9a,_0xfb14('0x10'));logger['debug'](_0xfb14('0x11'),_0x4f4d9a,_0xfb14('0x10'),JSON['stringify'](_0x5da1d2));if(_0x5da1d2[_0xfb14('0x12')]){if(_0x5da1d2[_0xfb14('0x12')]['code']===0x1f4){logger[_0xfb14('0x12')](_0xfb14('0xf'),_0x4f4d9a,_0x5da1d2[_0xfb14('0x12')][_0xfb14('0x13')]);return _0x16ed71(_0x5da1d2[_0xfb14('0x12')][_0xfb14('0x13')]);}logger[_0xfb14('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4f4d9a,_0x5da1d2['error'][_0xfb14('0x13')]);return _0x31dc36(_0x5da1d2['error']['message']);}else{logger[_0xfb14('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x4f4d9a,'request\x20sent');_0x31dc36(_0x5da1d2[_0xfb14('0x14')][_0xfb14('0x13')]);}})[_0xfb14('0x15')](function(_0x5ece28){logger[_0xfb14('0x12')](_0xfb14('0xf'),_0x4f4d9a,_0x5ece28);_0x16ed71(_0x5ece28);});});}