Built motion from commit (unavailable).|2.5.1
[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 _0x9eae=['../../config/environment','request','then','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x9dea3f,_0x3ace7e){var _0x42dbdb=function(_0x492030){while(--_0x492030){_0x9dea3f['push'](_0x9dea3f['shift']());}};_0x42dbdb(++_0x3ace7e);}(_0x9eae,0x149));var _0xe9ea=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9eae[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe9ea('0x0'));var util=require(_0xe9ea('0x1'));var moment=require(_0xe9ea('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9ea('0x3'));var db=require(_0xe9ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9ea('0x5'))(_0xe9ea('0x6'));var config=require(_0xe9ea('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ecf0a,_0x1d04ac,_0x4bf4ba){return new BPromise(function(_0x5ed036,_0x39a42d){return client[_0xe9ea('0x8')](_0x4ecf0a,_0x4bf4ba)[_0xe9ea('0x9')](function(_0x218460){logger['info'](_0xe9ea('0xa'),_0x1d04ac,'request\x20sent');logger[_0xe9ea('0xb')](_0xe9ea('0xc'),_0x1d04ac,'request\x20sent',JSON[_0xe9ea('0xd')](_0x218460));if(_0x218460[_0xe9ea('0xe')]){if(_0x218460[_0xe9ea('0xe')][_0xe9ea('0xf')]===0x1f4){logger[_0xe9ea('0xe')](_0xe9ea('0xa'),_0x1d04ac,_0x218460[_0xe9ea('0xe')][_0xe9ea('0x10')]);return _0x39a42d(_0x218460[_0xe9ea('0xe')][_0xe9ea('0x10')]);}logger[_0xe9ea('0xe')](_0xe9ea('0xa'),_0x1d04ac,_0x218460[_0xe9ea('0xe')][_0xe9ea('0x10')]);return _0x5ed036(_0x218460[_0xe9ea('0xe')][_0xe9ea('0x10')]);}else{logger[_0xe9ea('0x11')](_0xe9ea('0xa'),_0x1d04ac,_0xe9ea('0x12'));_0x5ed036(_0x218460[_0xe9ea('0x13')]['message']);}})[_0xe9ea('0x14')](function(_0x1c3ab9){logger[_0xe9ea('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x1d04ac,_0x1c3ab9);_0x39a42d(_0x1c3ab9);});});}