Built motion from commit 953226e6.|2.6.32
[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 _0x8c48=['client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0x8c48,0x12b));var _0x88c4=function(_0x5e3156,_0x402b3b){_0x5e3156=_0x5e3156-0x0;var _0x2d8d49=_0x8c48[_0x5e3156];return _0x2d8d49;};'use strict';var _=require(_0x88c4('0x0'));var util=require(_0x88c4('0x1'));var moment=require(_0x88c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x88c4('0x3'));var fs=require('fs');var Redis=require(_0x88c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88c4('0x5'))(_0x88c4('0x6'));var config=require(_0x88c4('0x7'));var jayson=require(_0x88c4('0x8'));var client=jayson[_0x88c4('0x9')][_0x88c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x451568,_0x2365b8,_0xd9b22a){return new BPromise(function(_0x1606c9,_0x4c93ee){return client['request'](_0x451568,_0xd9b22a)[_0x88c4('0xb')](function(_0x2e0e00){logger[_0x88c4('0xc')](_0x88c4('0xd'),_0x2365b8,_0x88c4('0xe'));logger[_0x88c4('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2365b8,_0x88c4('0xe'),JSON[_0x88c4('0x10')](_0x2e0e00));if(_0x2e0e00['error']){if(_0x2e0e00[_0x88c4('0x11')][_0x88c4('0x12')]===0x1f4){logger[_0x88c4('0x11')](_0x88c4('0xd'),_0x2365b8,_0x2e0e00[_0x88c4('0x11')][_0x88c4('0x13')]);return _0x4c93ee(_0x2e0e00[_0x88c4('0x11')][_0x88c4('0x13')]);}logger[_0x88c4('0x11')](_0x88c4('0xd'),_0x2365b8,_0x2e0e00[_0x88c4('0x11')][_0x88c4('0x13')]);return _0x1606c9(_0x2e0e00[_0x88c4('0x11')][_0x88c4('0x13')]);}else{logger[_0x88c4('0xc')](_0x88c4('0xd'),_0x2365b8,'request\x20sent');_0x1606c9(_0x2e0e00[_0x88c4('0x14')][_0x88c4('0x13')]);}})[_0x88c4('0x15')](function(_0x715881){logger[_0x88c4('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2365b8,_0x715881);_0x4c93ee(_0x715881);});});}