Built motion from commit 7158bc59.|2.5.42
[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 _0x0b2a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment','randomstring','ioredis'];(function(_0x4a4378,_0x1c7b85){var _0x7cc462=function(_0x4b4486){while(--_0x4b4486){_0x4a4378['push'](_0x4a4378['shift']());}};_0x7cc462(++_0x1c7b85);}(_0x0b2a,0x88));var _0xa0b2=function(_0x2b50fa,_0x193c01){_0x2b50fa=_0x2b50fa-0x0;var _0x34ffc2=_0x0b2a[_0x2b50fa];return _0x34ffc2;};'use strict';var _=require(_0xa0b2('0x0'));var util=require('util');var moment=require(_0xa0b2('0x1'));var BPromise=require('bluebird');var rs=require(_0xa0b2('0x2'));var fs=require('fs');var Redis=require(_0xa0b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0b2('0x4'));var logger=require(_0xa0b2('0x5'))(_0xa0b2('0x6'));var config=require(_0xa0b2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa0b2('0x8')][_0xa0b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5937a7,_0x98ef88,_0x146ae9){return new BPromise(function(_0x4553bd,_0xe1082f){return client[_0xa0b2('0xa')](_0x5937a7,_0x146ae9)[_0xa0b2('0xb')](function(_0x50b5dd){logger[_0xa0b2('0xc')](_0xa0b2('0xd'),_0x98ef88,_0xa0b2('0xe'));logger[_0xa0b2('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x98ef88,_0xa0b2('0xe'),JSON['stringify'](_0x50b5dd));if(_0x50b5dd[_0xa0b2('0x10')]){if(_0x50b5dd['error'][_0xa0b2('0x11')]===0x1f4){logger[_0xa0b2('0x10')](_0xa0b2('0xd'),_0x98ef88,_0x50b5dd[_0xa0b2('0x10')][_0xa0b2('0x12')]);return _0xe1082f(_0x50b5dd['error'][_0xa0b2('0x12')]);}logger[_0xa0b2('0x10')](_0xa0b2('0xd'),_0x98ef88,_0x50b5dd['error']['message']);return _0x4553bd(_0x50b5dd[_0xa0b2('0x10')][_0xa0b2('0x12')]);}else{logger['info'](_0xa0b2('0xd'),_0x98ef88,_0xa0b2('0xe'));_0x4553bd(_0x50b5dd['result']['message']);}})[_0xa0b2('0x13')](function(_0x2506d3){logger[_0xa0b2('0x10')](_0xa0b2('0xd'),_0x98ef88,_0x2506d3);_0xe1082f(_0x2506d3);});});}