Built motion from commit d5e4af8c.|2.6.23
[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 _0xf3dd=['rpc','../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xf34f78,_0x206922){var _0x5ea8b4=function(_0x2cb254){while(--_0x2cb254){_0xf34f78['push'](_0xf34f78['shift']());}};_0x5ea8b4(++_0x206922);}(_0xf3dd,0x92));var _0xdf3d=function(_0x4d1d3b,_0x358031){_0x4d1d3b=_0x4d1d3b-0x0;var _0x473905=_0xf3dd[_0x4d1d3b];return _0x473905;};'use strict';var _=require(_0xdf3d('0x0'));var util=require(_0xdf3d('0x1'));var moment=require(_0xdf3d('0x2'));var BPromise=require(_0xdf3d('0x3'));var rs=require(_0xdf3d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdf3d('0x6'));var config=require(_0xdf3d('0x7'));var jayson=require(_0xdf3d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1070ec,_0x5026a0,_0x183192){return new BPromise(function(_0x1fc27b,_0x43cd94){return client[_0xdf3d('0x9')](_0x1070ec,_0x183192)[_0xdf3d('0xa')](function(_0x18d8b3){logger[_0xdf3d('0xb')](_0xdf3d('0xc'),_0x5026a0,_0xdf3d('0xd'));logger['debug'](_0xdf3d('0xe'),_0x5026a0,'request\x20sent',JSON[_0xdf3d('0xf')](_0x18d8b3));if(_0x18d8b3['error']){if(_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x11')]===0x1f4){logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x18d8b3['error']['message']);return _0x43cd94(_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x12')]);}logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x12')]);return _0x1fc27b(_0x18d8b3[_0xdf3d('0x10')]['message']);}else{logger[_0xdf3d('0xb')](_0xdf3d('0xc'),_0x5026a0,_0xdf3d('0xd'));_0x1fc27b(_0x18d8b3['result']['message']);}})['catch'](function(_0x2fc0ec){logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x2fc0ec);_0x43cd94(_0x2fc0ec);});});}