Built motion from commit (unavailable).|2.4.18
[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 _0x126e=['../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x45ba49,_0x27b3b3){var _0x333c1a=function(_0x322413){while(--_0x322413){_0x45ba49['push'](_0x45ba49['shift']());}};_0x333c1a(++_0x27b3b3);}(_0x126e,0xae));var _0xe126=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x126e[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var moment=require('moment');var BPromise=require(_0xe126('0x1'));var rs=require(_0xe126('0x2'));var fs=require('fs');var Redis=require(_0xe126('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe126('0x4'));var logger=require('../../config/logger')(_0xe126('0x5'));var config=require(_0xe126('0x6'));var jayson=require(_0xe126('0x7'));var client=jayson[_0xe126('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28fb01,_0x5afe50,_0x2791ee){return new BPromise(function(_0x25b533,_0x504f7e){return client[_0xe126('0x9')](_0x28fb01,_0x2791ee)[_0xe126('0xa')](function(_0xa01d4a){logger[_0xe126('0xb')](_0xe126('0xc'),_0x5afe50,_0xe126('0xd'));logger['debug'](_0xe126('0xe'),_0x5afe50,'request\x20sent',JSON[_0xe126('0xf')](_0xa01d4a));if(_0xa01d4a[_0xe126('0x10')]){if(_0xa01d4a['error'][_0xe126('0x11')]===0x1f4){logger[_0xe126('0x10')](_0xe126('0xc'),_0x5afe50,_0xa01d4a[_0xe126('0x10')][_0xe126('0x12')]);return _0x504f7e(_0xa01d4a[_0xe126('0x10')]['message']);}logger[_0xe126('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x5afe50,_0xa01d4a['error'][_0xe126('0x12')]);return _0x25b533(_0xa01d4a[_0xe126('0x10')][_0xe126('0x12')]);}else{logger[_0xe126('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x5afe50,_0xe126('0xd'));_0x25b533(_0xa01d4a[_0xe126('0x13')][_0xe126('0x12')]);}})['catch'](function(_0x28d415){logger[_0xe126('0x10')](_0xe126('0xc'),_0x5afe50,_0x28d415);_0x504f7e(_0x28d415);});});}