Built motion from commit da24aabd.|2.6.20
[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 _0x5591=['../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x25c5eb,_0x165a76){var _0x5aa03f=function(_0x4161f7){while(--_0x4161f7){_0x25c5eb['push'](_0x25c5eb['shift']());}};_0x5aa03f(++_0x165a76);}(_0x5591,0x1dc));var _0x1559=function(_0x4f4319,_0x472bf7){_0x4f4319=_0x4f4319-0x0;var _0xacf3f6=_0x5591[_0x4f4319];return _0xacf3f6;};'use strict';var _=require('lodash');var util=require(_0x1559('0x0'));var moment=require(_0x1559('0x1'));var BPromise=require(_0x1559('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1559('0x3'));var db=require(_0x1559('0x4'))['db'];var utils=require(_0x1559('0x5'));var logger=require('../../config/logger')(_0x1559('0x6'));var config=require(_0x1559('0x7'));var jayson=require(_0x1559('0x8'));var client=jayson[_0x1559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x273b7c,_0x1d7358,_0x3312cb){return new BPromise(function(_0x169ea6,_0x144b1d){return client[_0x1559('0xa')](_0x273b7c,_0x3312cb)[_0x1559('0xb')](function(_0x4d7892){logger[_0x1559('0xc')](_0x1559('0xd'),_0x1d7358,_0x1559('0xe'));logger[_0x1559('0xf')](_0x1559('0x10'),_0x1d7358,'request\x20sent',JSON[_0x1559('0x11')](_0x4d7892));if(_0x4d7892[_0x1559('0x12')]){if(_0x4d7892[_0x1559('0x12')][_0x1559('0x13')]===0x1f4){logger['error'](_0x1559('0xd'),_0x1d7358,_0x4d7892[_0x1559('0x12')]['message']);return _0x144b1d(_0x4d7892[_0x1559('0x12')]['message']);}logger[_0x1559('0x12')](_0x1559('0xd'),_0x1d7358,_0x4d7892[_0x1559('0x12')][_0x1559('0x14')]);return _0x169ea6(_0x4d7892[_0x1559('0x12')][_0x1559('0x14')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1d7358,_0x1559('0xe'));_0x169ea6(_0x4d7892[_0x1559('0x15')]['message']);}})[_0x1559('0x16')](function(_0x405590){logger['error'](_0x1559('0xd'),_0x1d7358,_0x405590);_0x144b1d(_0x405590);});});}