Built motion from commit 1fa89557.|2.6.10
[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 _0xa813=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3ef20d,_0x3e0843){var _0x2bc565=function(_0x992ec8){while(--_0x992ec8){_0x3ef20d['push'](_0x3ef20d['shift']());}};_0x2bc565(++_0x3e0843);}(_0xa813,0xc4));var _0x3a81=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xa813[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x3a81('0x0'));var util=require(_0x3a81('0x1'));var moment=require('moment');var BPromise=require(_0x3a81('0x2'));var rs=require(_0x3a81('0x3'));var fs=require('fs');var Redis=require(_0x3a81('0x4'));var db=require(_0x3a81('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a81('0x6'));var config=require(_0x3a81('0x7'));var jayson=require(_0x3a81('0x8'));var client=jayson[_0x3a81('0x9')][_0x3a81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dad3e,_0x5f261f,_0xe11d88){return new BPromise(function(_0x13f491,_0x4c594e){return client[_0x3a81('0xb')](_0x5dad3e,_0xe11d88)[_0x3a81('0xc')](function(_0xfcd3cf){logger[_0x3a81('0xd')](_0x3a81('0xe'),_0x5f261f,_0x3a81('0xf'));logger[_0x3a81('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x5f261f,'request\x20sent',JSON['stringify'](_0xfcd3cf));if(_0xfcd3cf['error']){if(_0xfcd3cf[_0x3a81('0x11')]['code']===0x1f4){logger['error'](_0x3a81('0xe'),_0x5f261f,_0xfcd3cf[_0x3a81('0x11')]['message']);return _0x4c594e(_0xfcd3cf['error'][_0x3a81('0x12')]);}logger[_0x3a81('0x11')](_0x3a81('0xe'),_0x5f261f,_0xfcd3cf[_0x3a81('0x11')][_0x3a81('0x12')]);return _0x13f491(_0xfcd3cf[_0x3a81('0x11')][_0x3a81('0x12')]);}else{logger[_0x3a81('0xd')](_0x3a81('0xe'),_0x5f261f,_0x3a81('0xf'));_0x13f491(_0xfcd3cf[_0x3a81('0x13')][_0x3a81('0x12')]);}})[_0x3a81('0x14')](function(_0x421dc0){logger[_0x3a81('0x11')](_0x3a81('0xe'),_0x5f261f,_0x421dc0);_0x4c594e(_0x421dc0);});});}