Built motion from commit (unavailable).|2.5.14
[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 _0x85e7=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment'];(function(_0x7870ff,_0x21c985){var _0x5d66d6=function(_0x411e71){while(--_0x411e71){_0x7870ff['push'](_0x7870ff['shift']());}};_0x5d66d6(++_0x21c985);}(_0x85e7,0x11c));var _0x785e=function(_0x5101b6,_0x589f89){_0x5101b6=_0x5101b6-0x0;var _0x5aa8e8=_0x85e7[_0x5101b6];return _0x5aa8e8;};'use strict';var _=require(_0x785e('0x0'));var util=require('util');var moment=require(_0x785e('0x1'));var BPromise=require(_0x785e('0x2'));var rs=require(_0x785e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x785e('0x4'));var logger=require(_0x785e('0x5'))('rpc');var config=require(_0x785e('0x6'));var jayson=require(_0x785e('0x7'));var client=jayson[_0x785e('0x8')][_0x785e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x122180,_0x28e909,_0x3e6193){return new BPromise(function(_0x2edb57,_0x157227){return client[_0x785e('0xa')](_0x122180,_0x3e6193)[_0x785e('0xb')](function(_0xe1c25e){logger[_0x785e('0xc')](_0x785e('0xd'),_0x28e909,'request\x20sent');logger[_0x785e('0xe')](_0x785e('0xf'),_0x28e909,_0x785e('0x10'),JSON[_0x785e('0x11')](_0xe1c25e));if(_0xe1c25e['error']){if(_0xe1c25e[_0x785e('0x12')][_0x785e('0x13')]===0x1f4){logger[_0x785e('0x12')](_0x785e('0xd'),_0x28e909,_0xe1c25e[_0x785e('0x12')][_0x785e('0x14')]);return _0x157227(_0xe1c25e[_0x785e('0x12')][_0x785e('0x14')]);}logger[_0x785e('0x12')](_0x785e('0xd'),_0x28e909,_0xe1c25e[_0x785e('0x12')]['message']);return _0x2edb57(_0xe1c25e['error']['message']);}else{logger['info'](_0x785e('0xd'),_0x28e909,_0x785e('0x10'));_0x2edb57(_0xe1c25e[_0x785e('0x15')][_0x785e('0x14')]);}})['catch'](function(_0x2757dd){logger[_0x785e('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x28e909,_0x2757dd);_0x157227(_0x2757dd);});});}