Built motion from commit (unavailable).|2.5.6
[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 _0x4753=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s'];(function(_0x4799c8,_0x4e40bb){var _0x3e6a97=function(_0x1b9012){while(--_0x1b9012){_0x4799c8['push'](_0x4799c8['shift']());}};_0x3e6a97(++_0x4e40bb);}(_0x4753,0xfe));var _0x3475=function(_0x548490,_0x35ac31){_0x548490=_0x548490-0x0;var _0x4bb536=_0x4753[_0x548490];return _0x4bb536;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var moment=require('moment');var BPromise=require(_0x3475('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3475('0x3'))['db'];var utils=require(_0x3475('0x4'));var logger=require(_0x3475('0x5'))(_0x3475('0x6'));var config=require('../../config/environment');var jayson=require(_0x3475('0x7'));var client=jayson[_0x3475('0x8')][_0x3475('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x911cc8,_0x55a934,_0xf7dd68){return new BPromise(function(_0x588a7d,_0x15ac60){return client['request'](_0x911cc8,_0xf7dd68)[_0x3475('0xa')](function(_0x3a4ffb){logger[_0x3475('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x55a934,_0x3475('0xc'));logger['debug'](_0x3475('0xd'),_0x55a934,_0x3475('0xc'),JSON[_0x3475('0xe')](_0x3a4ffb));if(_0x3a4ffb[_0x3475('0xf')]){if(_0x3a4ffb[_0x3475('0xf')][_0x3475('0x10')]===0x1f4){logger[_0x3475('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x55a934,_0x3a4ffb[_0x3475('0xf')][_0x3475('0x11')]);return _0x15ac60(_0x3a4ffb['error'][_0x3475('0x11')]);}logger['error'](_0x3475('0x12'),_0x55a934,_0x3a4ffb[_0x3475('0xf')][_0x3475('0x11')]);return _0x588a7d(_0x3a4ffb[_0x3475('0xf')][_0x3475('0x11')]);}else{logger[_0x3475('0xb')](_0x3475('0x12'),_0x55a934,_0x3475('0xc'));_0x588a7d(_0x3a4ffb[_0x3475('0x13')]['message']);}})[_0x3475('0x14')](function(_0x45e2b6){logger[_0x3475('0xf')](_0x3475('0x12'),_0x55a934,_0x45e2b6);_0x15ac60(_0x45e2b6);});});}